Lines Matching full:style
502 bool RenderThemeChromiumMac::isControlStyled(const RenderStyle* style, const BorderData& border,
505 if (style->appearance() == TextFieldPart || style->appearance() == TextAreaPart || style->appearance() == ListboxPart)
506 return style->border() != border;
509 // scaled. They can't really draw properly when transformed either. We can't detect the transform case at style
512 if (style->appearance() == MenulistPart && style->effectiveZoom() != 1.0f)
515 return RenderTheme::isControlStyled(style, border, background, backgroundColor);
520 ControlPart part = o->style()->appearance();
537 float zoomLevel = o->style()->effectiveZoom();
634 bool focused = isFocused(o) && o->style()->outlineStyleIsAuto();
658 if (o->style()->appearance() == CheckboxPart)
665 NSControlSize RenderThemeChromiumMac::controlSizeForFont(RenderStyle* style) const
667 int fontSize = style->fontSize();
690 IntSize RenderThemeChromiumMac::sizeForFont(RenderStyle* style, const IntSize* sizes) const
692 if (style->effectiveZoom() != 1.0f) {
693 IntSize result = sizes[controlSizeForFont(style)];
694 return IntSize(result.width() * style->effectiveZoom(), result.height() * style->effectiveZoom());
696 return sizes[controlSizeForFont(style)];
699 IntSize RenderThemeChromiumMac::sizeForSystemFont(RenderStyle* style, const IntSize* sizes) const
701 if (style->effectiveZoom() != 1.0f) {
702 IntSize result = sizes[controlSizeForSystemFont(style)];
703 return IntSize(result.width() * style->effectiveZoom(), result.height() * style->effectiveZoom());
705 return sizes[controlSizeForSystemFont(style)];
708 void RenderThemeChromiumMac::setSizeFromFont(RenderStyle* style, const IntSize* sizes) const
711 IntSize size = sizeForFont(style, sizes);
712 if (style->width().isIntrinsicOrAuto() && size.width() > 0)
713 style->setWidth(Length(size.width(), Fixed));
714 if (style->height().isAuto() && size.height() > 0)
715 style->setHeight(Length(size.height(), Fixed));
718 void RenderThemeChromiumMac::setFontFromControlSize(CSSStyleSelector*, RenderStyle* style, NSControlSize controlSize) const
726 fontDescription.setComputedSize([font pointSize] * style->effectiveZoom());
727 fontDescription.setSpecifiedSize([font pointSize] * style->effectiveZoom());
730 style->setLineHeight(RenderStyle::initialLineHeight());
732 if (style->setFontDescription(fontDescription))
733 style->font().update(0);
736 NSControlSize RenderThemeChromiumMac::controlSizeForSystemFont(RenderStyle* style) const
738 int fontSize = style->fontSize();
813 float zoomLevel = o->style()->effectiveZoom();
820 if (r.width() >= minimumMenuListSize(o->style()))
912 o->style()->getBorderRadiiForRect(r, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
967 IntRect bounds = IntRect(r.x() + o->style()->borderLeftWidth(),
968 r.y() + o->style()->borderTopWidth(),
969 r.width() - o->style()->borderLeftWidth() - o->style()->borderRightWidth(),
970 r.height() - o->style()->borderTopWidth() - o->style()->borderBottomWidth());
975 float fontScale = min(o->style()->fontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows));
979 float leftEdge = bounds.right() - arrowPaddingRight * o->style()->effectiveZoom() - arrowWidth;
982 if (bounds.width() < arrowWidth + arrowPaddingLeft * o->style()->effectiveZoom())
987 paintInfo.context->setFillColor(o->style()->color(), o->style()->colorSpace());
1011 int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * o->style()->effectiveZoom()); // FIXME: Round?
1034 void RenderThemeChromiumMac::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
1036 NSControlSize controlSize = controlSizeForFont(style);
1038 style->resetBorder();
1039 style->resetPadding();
1042 style->setHeight(Length(Auto));
1045 style->setWhiteSpace(PRE);
1049 style->setColor(e && e->isEnabledFormControl() ? static_cast<RGBA32>(Color::black) : Color::darkGray);
1052 setSizeFromFont(style, menuListButtonSizes());
1057 setFontFromControlSize(selector, style, controlSize);
1059 style->setBoxShadow(0);
1062 int RenderThemeChromiumMac::popupInternalPaddingLeft(RenderStyle* style) const
1064 if (style->appearance() == MenulistPart)
1065 return popupButtonPadding(controlSizeForFont(style))[leftPadding] * style->effectiveZoom();
1066 if (style->appearance() == MenulistButtonPart)
1067 return styledPopupPaddingLeft * style->effectiveZoom();
1071 int RenderThemeChromiumMac::popupInternalPaddingRight(RenderStyle* style) const
1073 if (style->appearance() == MenulistPart)
1074 return popupButtonPadding(controlSizeForFont(style))[rightPadding] * style->effectiveZoom();
1075 if (style->appearance() == MenulistButtonPart) {
1076 float fontScale = style->fontSize() / baseFontSize;
1078 return static_cast<int>(ceilf(arrowWidth + (arrowPaddingLeft + arrowPaddingRight + paddingBeforeSeparator) * style->effectiveZoom()));
1083 int RenderThemeChromiumMac::popupInternalPaddingTop(RenderStyle* style) const
1085 if (style->appearance() == MenulistPart)
1086 return popupButtonPadding(controlSizeForFont(style))[topPadding] * style->effectiveZoom();
1087 if (style->appearance() == MenulistButtonPart)
1088 return styledPopupPaddingTop * style->effectiveZoom();
1092 int RenderThemeChromiumMac::popupInternalPaddingBottom(RenderStyle* style) const
1094 if (style->appearance() == MenulistPart)
1095 return popupButtonPadding(controlSizeForFont(style))[bottomPadding] * style->effectiveZoom();
1096 if (style->appearance() == MenulistButtonPart)
1097 return styledPopupPaddingBottom * style->effectiveZoom();
1101 void RenderThemeChromiumMac::adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1103 float fontScale = style->fontSize() / baseFontSize;
1105 style->resetPadding();
1106 style->setBorderRadius(IntSize(int(baseBorderRadius + fontScale - 1), int(baseBorderRadius + fontScale - 1))); // FIXME: Round up?
1109 style->setMinHeight(Length(minHeight, Fixed));
1111 style->setLineHeight(RenderStyle::initialLineHeight());
1119 setControlSize(popupButton, popupButtonSizes(), r.size(), o->style()->effectiveZoom());
1135 int RenderThemeChromiumMac::minimumMenuListSize(RenderStyle* style) const
1137 return sizeForSystemFont(style, menuListSizes()).width();
1143 void RenderThemeChromiumMac::adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1145 style->setBoxShadow(0);
1151 float zoomLevel = o->style()->effectiveZoom();
1154 if (o->style()->appearance() == SliderHorizontalPart || o->style()->appearance() == MediaSliderPart) {
1157 } else if (o->style()->appearance() == SliderVerticalPart) {
1172 if (o->style()->appearance() == SliderVerticalPart)
1187 void RenderThemeChromiumMac::adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1189 style->setBoxShadow(0);
1198 NSSliderCell* sliderThumbCell = o->style()->appearance() == SliderThumbVerticalPart
1211 if (o->style()->appearance() == SliderThumbVerticalPart)
1218 if (o->style()->appearance() == SliderThumbVerticalPart)
1232 if (o->style()->appearance() == SliderThumbVerticalPart)
1233 bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o->style()->effectiveZoom());
1236 float zoomLevel = o->style()->effectiveZoom();
1264 float zoomLevel = o->style()->effectiveZoom();
1297 [search setControlSize:controlSizeForFont(o->style())];
1311 void RenderThemeChromiumMac::setSearchFieldSize(RenderStyle* style) const
1314 if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto())
1318 setSizeFromFont(style, searchFieldSizes());
1321 void RenderThemeChromiumMac::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element*) const
1324 style->resetBorder();
1325 const short borderWidth = 2 * style->effectiveZoom();
1326 style->setBorderLeftWidth(borderWidth);
1327 style->setBorderLeftStyle(INSET);
1328 style->setBorderRightWidth(borderWidth);
1329 style->setBorderRightStyle(INSET);
1330 style->setBorderBottomWidth(borderWidth);
1331 style->setBorderBottomStyle(INSET);
1332 style->setBorderTopWidth(borderWidth);
1333 style->setBorderTopStyle(INSET);
1336 style->setHeight(Length(Auto));
1337 setSearchFieldSize(style);
1340 const int padding = 1 * style->effectiveZoom();
1341 style->setPaddingLeft(Length(padding, Fixed));
1342 style->setPaddingRight(Length(padding, Fixed));
1343 style->setPaddingTop(Length(padding, Fixed));
1344 style->setPaddingBottom(Length(padding, Fixed));
1346 NSControlSize controlSize = controlSizeForFont(style);
1347 setFontFromControlSize(selector, style, controlSize);
1349 style->setBoxShadow(0);
1367 float zoomLevel = o->style()->effectiveZoom();
1394 void RenderThemeChromiumMac::adjustSearchFieldCancelButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1396 IntSize size = sizeForSystemFont(style, cancelButtonSizes());
1397 style->setWidth(Length(size.width(), Fixed));
1398 style->setHeight(Length(size.height(), Fixed));
1399 style->setBoxShadow(0);
1409 void RenderThemeChromiumMac::adjustSearchFieldDecorationStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1411 IntSize size = sizeForSystemFont(style, resultsButtonSizes());
1412 style->setWidth(Length(size.width() - emptyResultsOffset, Fixed));
1413 style->setHeight(Length(size.height(), Fixed));
1414 style->setBoxShadow(0);
1422 void RenderThemeChromiumMac::adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1424 IntSize size = sizeForSystemFont(style, resultsButtonSizes());
1425 style->setWidth(Length(size.width(), Fixed));
1426 style->setHeight(Length(size.height(), Fixed));
1427 style->setBoxShadow(0);
1454 void RenderThemeChromiumMac::adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
1456 IntSize size = sizeForSystemFont(style, resultsButtonSizes());
1457 style->setWidth(Length(size.width() + resultsArrowWidth, Fixed));
1458 style->setHeight(Length(size.height(), Fixed));
1459 style->setBoxShadow(0);
1479 float zoomLevel = o->style()->effectiveZoom();
1506 float zoomLevel = o->style()->effectiveZoom();
1507 if (o->style()->appearance() == SliderThumbHorizontalPart || o->style()->appearance() == SliderThumbVerticalPart) {
1508 o->style()->setWidth(Length(static_cast<int>(sliderThumbWidth * zoomLevel), Fixed));
1509 o->style()->setHeight(Length(static_cast<int>(sliderThumbHeight * zoomLevel), Fixed));