Home | History | Annotate | Download | only in rendering

Lines Matching full:style

450 bool RenderThemeMac::isControlStyled(const RenderStyle* style, const BorderData& border,
453 if (style->appearance() == TextFieldPart || style->appearance() == TextAreaPart || style->appearance() == ListboxPart)
454 return style->border() != border;
457 // scaled. They can't really draw properly when transformed either. We can't detect the transform case at style
460 if (style->appearance() == MenulistPart && style->effectiveZoom() != 1.0f)
463 return RenderTheme::isControlStyled(style, border, background, backgroundColor);
468 ControlPart part = o->style()->appearance();
485 float zoomLevel = o->style()->effectiveZoom();
563 bool focused = isFocused(o) && o->style()->outlineStyleIsAuto();
587 if (o->style()->appearance() == CheckboxPart)
594 NSControlSize RenderThemeMac::controlSizeForFont(RenderStyle* style) const
596 int fontSize = style->fontSize();
619 IntSize RenderThemeMac::sizeForFont(RenderStyle* style, const IntSize* sizes) const
621 if (style->effectiveZoom() != 1.0f) {
622 IntSize result = sizes[controlSizeForFont(style)];
623 return IntSize(result.width() * style->effectiveZoom(), result.height() * style->effectiveZoom());
625 return sizes[controlSizeForFont(style)];
628 IntSize RenderThemeMac::sizeForSystemFont(RenderStyle* style, const IntSize* sizes) const
630 if (style->effectiveZoom() != 1.0f) {
631 IntSize result = sizes[controlSizeForSystemFont(style)];
632 return IntSize(result.width() * style->effectiveZoom(), result.height() * style->effectiveZoom());
634 return sizes[controlSizeForSystemFont(style)];
637 void RenderThemeMac::setSizeFromFont(RenderStyle* style, const IntSize* sizes) const
640 IntSize size = sizeForFont(style, sizes);
641 if (style->width().isIntrinsicOrAuto() && size.width() > 0)
642 style->setWidth(Length(size.width(), Fixed));
643 if (style->height().isAuto() && size.height() > 0)
644 style->setHeight(Length(size.height(), Fixed));
647 void RenderThemeMac::setFontFromControlSize(CSSStyleSelector*, RenderStyle* style, NSControlSize controlSize) const
655 fontDescription.setComputedSize([font pointSize] * style->effectiveZoom());
656 fontDescription.setSpecifiedSize([font pointSize] * style->effectiveZoom());
659 style->setLineHeight(RenderStyle::initialLineHeight());
661 if (style->setFontDescription(fontDescription))
662 style->font().update(0);
665 NSControlSize RenderThemeMac::controlSizeForSystemFont(RenderStyle* style) const
667 int fontSize = style->fontSize();
742 float zoomLevel = o->style()->effectiveZoom();
749 if (r.width() >= minimumMenuListSize(o->style()))
841 o->style()->getBorderRadiiForRect(r, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
896 IntRect bounds = IntRect(r.x() + o->style()->borderLeftWidth(),
897 r.y() + o->style()->borderTopWidth(),
898 r.width() - o->style()->borderLeftWidth() - o->style()->borderRightWidth(),
899 r.height() - o->style()->borderTopWidth() - o->style()->borderBottomWidth());
904 float fontScale = min(o->style()->fontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows));
908 float leftEdge = bounds.right() - arrowPaddingRight * o->style()->effectiveZoom() - arrowWidth;
911 if (bounds.width() < arrowWidth + arrowPaddingLeft * o->style()->effectiveZoom())
916 paintInfo.context->setFillColor(o->style()->color(), o->style()->colorSpace());
940 int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * o->style()->effectiveZoom()); // FIXME: Round?
963 void RenderThemeMac::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
965 NSControlSize controlSize = controlSizeForFont(style);
967 style->resetBorder();
968 style->resetPadding();
971 style->setHeight(Length(Auto));
974 style->setWhiteSpace(PRE);
978 style->setColor(e && e->isEnabledFormControl() ? static_cast<RGBA32>(Color::black) : Color::darkGray);
981 setSizeFromFont(style, menuListButtonSizes());
986 setFontFromControlSize(selector, style, controlSize);
988 style->setBoxShadow(0);
991 int RenderThemeMac::popupInternalPaddingLeft(RenderStyle* style) const
993 if (style->appearance() == MenulistPart)
994 return popupButtonPadding(controlSizeForFont(style))[leftPadding] * style->effectiveZoom();
995 if (style->appearance() == MenulistButtonPart)
996 return styledPopupPaddingLeft * style->effectiveZoom();
1000 int RenderThemeMac::popupInternalPaddingRight(RenderStyle* style) const
1002 if (style->appearance() == MenulistPart)
1003 return popupButtonPadding(controlSizeForFont(style))[rightPadding] * style->effectiveZoom();
1004 if (style->appearance() == MenulistButtonPart) {
1005 float fontScale = style->fontSize() / baseFontSize;
1007 return static_cast<int>(ceilf(arrowWidth + (arrowPaddingLeft + arrowPaddingRight + paddingBeforeSeparator) * style->effectiveZoom()));
1012 int RenderThemeMac::popupInternalPaddingTop(RenderStyle* style) const
1014 if (style->appearance() == MenulistPart)
1015 return popupButtonPadding(controlSizeForFont(style))[topPadding] * style->effectiveZoom();
1016 if (style->appearance() == MenulistButtonPart)
1017 return styledPopupPaddingTop * style->effectiveZoom();
1021 int RenderThemeMac::popupInternalPaddingBottom(RenderStyle* style) const
1023 if (style->appearance() == MenulistPart)
1024 return popupButtonPadding(controlSizeForFont(style))[bottomPadding] * style->effectiveZoom();
1025 if (style->appearance() == MenulistButtonPart)
1026 return styledPopupPaddingBottom * style->effectiveZoom();
1030 void RenderThemeMac::adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1032 float fontScale = style->fontSize() / baseFontSize;
1034 style->resetPadding();
1035 style->setBorderRadius(IntSize(int(baseBorderRadius + fontScale - 1), int(baseBorderRadius + fontScale - 1))); // FIXME: Round up?
1038 style->setMinHeight(Length(minHeight, Fixed));
1040 style->setLineHeight(RenderStyle::initialLineHeight());
1048 setControlSize(popupButton, popupButtonSizes(), r.size(), o->style()->effectiveZoom());
1063 int RenderThemeMac::minimumMenuListSize(RenderStyle* style) const
1065 return sizeForSystemFont(style, menuListSizes()).width();
1071 void RenderThemeMac::adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1073 style->setBoxShadow(0);
1079 float zoomLevel = o->style()->effectiveZoom();
1082 if (o->style()->appearance() == SliderHorizontalPart || o->style()->appearance() == MediaSliderPart) {
1085 } else if (o->style()->appearance() == SliderVerticalPart) {
1100 if (o->style()->appearance() == SliderVerticalPart)
1115 void RenderThemeMac::adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1117 style->setBoxShadow(0);
1126 NSSliderCell* sliderThumbCell = o->style()->appearance() == SliderThumbVerticalPart
1138 if (o->style()->appearance() == SliderThumbVerticalPart)
1145 if (o->style()->appearance() == SliderThumbVerticalPart)
1159 if (o->style()->appearance() == SliderThumbVerticalPart)
1160 bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o->style()->effectiveZoom());
1163 float zoomLevel = o->style()->effectiveZoom();
1191 float zoomLevel = o->style()->effectiveZoom();
1224 [search setControlSize:controlSizeForFont(o->style())];
1237 void RenderThemeMac::setSearchFieldSize(RenderStyle* style) const
1240 if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto())
1244 setSizeFromFont(style, searchFieldSizes());
1247 void RenderThemeMac::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element*) const
1250 style->resetBorder();
1251 const short borderWidth = 2 * style->effectiveZoom();
1252 style->setBorderLeftWidth(borderWidth);
1253 style->setBorderLeftStyle(INSET);
1254 style->setBorderRightWidth(borderWidth);
1255 style->setBorderRightStyle(INSET);
1256 style->setBorderBottomWidth(borderWidth);
1257 style->setBorderBottomStyle(INSET);
1258 style->setBorderTopWidth(borderWidth);
1259 style->setBorderTopStyle(INSET);
1262 style->setHeight(Length(Auto));
1263 setSearchFieldSize(style);
1266 const int padding = 1 * style->effectiveZoom();
1267 style->setPaddingLeft(Length(padding, Fixed));
1268 style->setPaddingRight(Length(padding, Fixed));
1269 style->setPaddingTop(Length(padding, Fixed));
1270 style->setPaddingBottom(Length(padding, Fixed));
1272 NSControlSize controlSize = controlSizeForFont(style);
1273 setFontFromControlSize(selector, style, controlSize);
1275 style->setBoxShadow(0);
1292 float zoomLevel = o->style()->effectiveZoom();
1319 void RenderThemeMac::adjustSearchFieldCancelButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1321 IntSize size = sizeForSystemFont(style, cancelButtonSizes());
1322 style->setWidth(Length(size.width(), Fixed));
1323 style->setHeight(Length(size.height(), Fixed));
1324 style->setBoxShadow(0);
1334 void RenderThemeMac::adjustSearchFieldDecorationStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1336 IntSize size = sizeForSystemFont(style, resultsButtonSizes());
1337 style->setWidth(Length(size.width() - emptyResultsOffset, Fixed));
1338 style->setHeight(Length(size.height(), Fixed));
1339 style->setBoxShadow(0);
1347 void RenderThemeMac::adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1349 IntSize size = sizeForSystemFont(style, resultsButtonSizes());
1350 style->setWidth(Length(size.width(), Fixed));
1351 style->setHeight(Length(size.height(), Fixed));
1352 style->setBoxShadow(0);
1377 void RenderThemeMac::adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1379 IntSize size = sizeForSystemFont(style, resultsButtonSizes());
1380 style->setWidth(Length(size.width() + resultsArrowWidth, Fixed));
1381 style->setHeight(Length(size.height(), Fixed));
1382 style->setBoxShadow(0);
1400 float zoomLevel = o->style()->effectiveZoom();
1460 float zoomLevel = o->style()->effectiveZoom();
1461 if (o->style()->appearance() == SliderThumbHorizontalPart || o->style()->appearance() == SliderThumbVerticalPart) {
1462 o->style()->setWidth(Length(static_cast<int>(sliderThumbWidth * zoomLevel), Fixed));
1463 o->style()->setHeight(Length(static_cast<int>(sliderThumbHeight * zoomLevel), Fixed));
1467 else if (o->style()->appearance() == MediaSliderThumbPart) {
1479 o->style()->setWidth(Length(static_cast<int>(width * zoomLevel), Fixed));
1480 o->style()->setHeight(Length(static_cast<int>(height * zoomLevel), Fixed));
1508 float zoomLevel = o->style()->effectiveZoom();