Changeset 163152 in webkit
- Timestamp:
- Jan 30, 2014 7:52:14 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r163148 r163152 1 2014-01-30 Zalan Bujtas <zalan@apple.com> 2 3 Subpixel rendering: Change BorderData's width from unsigned to float to enable subpixel border painting. 4 https://bugs.webkit.org/show_bug.cgi?id=127949 5 6 Reviewed by Andreas Kling. 7 8 Covered by existing tests. No change in functionality. 9 10 * css/DeprecatedStyleBuilder.cpp: 11 (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): 12 * page/animation/CSSPropertyAnimation.cpp: 13 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): 14 * rendering/RenderTable.cpp: 15 (WebCore::RenderTable::calcBorderStart): 16 (WebCore::RenderTable::calcBorderEnd): 17 * rendering/style/BorderValue.h: 18 (WebCore::BorderValue::BorderValue): 19 (WebCore::BorderValue::width): 20 * rendering/style/RenderStyle.cpp: 21 (WebCore::RenderStyle::borderBeforeWidth): 22 (WebCore::RenderStyle::borderAfterWidth): 23 (WebCore::RenderStyle::borderStartWidth): 24 (WebCore::RenderStyle::borderEndWidth): 25 * rendering/style/RenderStyle.h: 26 1 27 2014-01-30 David Kilzer <ddkilzer@apple.com> 2 28 -
trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r162579 r163152 2353 2353 setPropertyHandler(CSSPropertyBorderBottomRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius, &RenderStyle::initialBorderRadius>::createHandler()); 2354 2354 setPropertyHandler(CSSPropertyBorderBottomStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderBottomStyle, EBorderStyle, &RenderStyle::setBorderBottomStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler()); 2355 setPropertyHandler(CSSPropertyBorderBottomWidth, ApplyPropertyComputeLength< unsigned, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());2355 setPropertyHandler(CSSPropertyBorderBottomWidth, ApplyPropertyComputeLength<float, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler()); 2356 2356 setPropertyHandler(CSSPropertyBorderCollapse, ApplyPropertyDefault<EBorderCollapse, &RenderStyle::borderCollapse, EBorderCollapse, &RenderStyle::setBorderCollapse, EBorderCollapse, &RenderStyle::initialBorderCollapse>::createHandler()); 2357 2357 setPropertyHandler(CSSPropertyBorderImageOutset, ApplyPropertyBorderImageModifier<BorderImage, Outset>::createHandler()); … … 2362 2362 setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color>::createHandler()); 2363 2363 setPropertyHandler(CSSPropertyBorderLeftStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderLeftStyle, EBorderStyle, &RenderStyle::setBorderLeftStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler()); 2364 setPropertyHandler(CSSPropertyBorderLeftWidth, ApplyPropertyComputeLength< unsigned, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());2364 setPropertyHandler(CSSPropertyBorderLeftWidth, ApplyPropertyComputeLength<float, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler()); 2365 2365 setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color>::createHandler()); 2366 2366 setPropertyHandler(CSSPropertyBorderRightStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderRightStyle, EBorderStyle, &RenderStyle::setBorderRightStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler()); 2367 setPropertyHandler(CSSPropertyBorderRightWidth, ApplyPropertyComputeLength< unsigned, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());2367 setPropertyHandler(CSSPropertyBorderRightWidth, ApplyPropertyComputeLength<float, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler()); 2368 2368 setPropertyHandler(CSSPropertyBorderTopColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color>::createHandler()); 2369 2369 setPropertyHandler(CSSPropertyBorderTopLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius, &RenderStyle::initialBorderRadius>::createHandler()); 2370 2370 setPropertyHandler(CSSPropertyBorderTopRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius, &RenderStyle::initialBorderRadius>::createHandler()); 2371 2371 setPropertyHandler(CSSPropertyBorderTopStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderTopStyle, EBorderStyle, &RenderStyle::setBorderTopStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler()); 2372 setPropertyHandler(CSSPropertyBorderTopWidth, ApplyPropertyComputeLength< unsigned, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());2372 setPropertyHandler(CSSPropertyBorderTopWidth, ApplyPropertyComputeLength<float, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler()); 2373 2373 setPropertyHandler(CSSPropertyBottom, ApplyPropertyLength<&RenderStyle::bottom, &RenderStyle::setBottom, &RenderStyle::initialOffset, AutoEnabled>::createHandler()); 2374 2374 setPropertyHandler(CSSPropertyBoxSizing, ApplyPropertyDefault<EBoxSizing, &RenderStyle::boxSizing, EBoxSizing, &RenderStyle::setBoxSizing, EBoxSizing, &RenderStyle::initialBoxSizing>::createHandler()); -
trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
r163079 r163152 1151 1151 new PropertyWrapperFlex(), 1152 1152 1153 new PropertyWrapper< unsigned>(CSSPropertyBorderLeftWidth, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth),1154 new PropertyWrapper< unsigned>(CSSPropertyBorderRightWidth, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth),1155 new PropertyWrapper< unsigned>(CSSPropertyBorderTopWidth, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth),1156 new PropertyWrapper< unsigned>(CSSPropertyBorderBottomWidth, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth),1153 new PropertyWrapper<float>(CSSPropertyBorderLeftWidth, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth), 1154 new PropertyWrapper<float>(CSSPropertyBorderRightWidth, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth), 1155 new PropertyWrapper<float>(CSSPropertyBorderTopWidth, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth), 1156 new PropertyWrapper<float>(CSSPropertyBorderBottomWidth, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth), 1157 1157 new LengthPropertyWrapper<Length>(CSSPropertyMarginLeft, &RenderStyle::marginLeft, &RenderStyle::setMarginLeft), 1158 1158 new LengthPropertyWrapper<Length>(CSSPropertyMarginRight, &RenderStyle::marginRight, &RenderStyle::setMarginRight), -
trunk/Source/WebCore/rendering/RenderTable.cpp
r162907 r163152 962 962 return 0; 963 963 964 unsignedborderWidth = 0;964 float borderWidth = 0; 965 965 966 966 const BorderValue& tableStartBorder = style().borderStart(); … … 1016 1016 return 0; 1017 1017 1018 unsignedborderWidth = 0;1018 float borderWidth = 0; 1019 1019 1020 1020 const BorderValue& tableEndBorder = style().borderEnd(); -
trunk/Source/WebCore/rendering/style/BorderValue.h
r111076 r163152 35 35 public: 36 36 BorderValue() 37 : m_color(0) 37 : m_width(3) 38 , m_color(0) 38 39 , m_colorIsValid(false) 39 , m_width(3)40 40 , m_style(BNONE) 41 41 , m_isAuto(AUTO_OFF) … … 76 76 Color color() const { return Color(m_color, m_colorIsValid); } 77 77 78 unsignedwidth() const { return m_width; }78 float width() const { return m_width; } 79 79 EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); } 80 80 81 81 protected: 82 float m_width; 82 83 RGBA32 m_color; 83 84 unsigned m_colorIsValid : 1; 84 85 85 unsigned m_width : 26;86 86 unsigned m_style : 4; // EBorderStyle 87 87 -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r163079 r163152 55 55 56 56 struct SameSizeAsBorderValue { 57 float m_width; 57 58 RGBA32 m_color; 58 unsigned m_width;59 int m_restBits; 59 60 }; 60 61 … … 1683 1684 } 1684 1685 1685 unsigned short RenderStyle::borderBeforeWidth() const1686 float RenderStyle::borderBeforeWidth() const 1686 1687 { 1687 1688 switch (writingMode()) { … … 1699 1700 } 1700 1701 1701 unsigned short RenderStyle::borderAfterWidth() const1702 float RenderStyle::borderAfterWidth() const 1702 1703 { 1703 1704 switch (writingMode()) { … … 1715 1716 } 1716 1717 1717 unsigned short RenderStyle::borderStartWidth() const1718 float RenderStyle::borderStartWidth() const 1718 1719 { 1719 1720 if (isHorizontalWritingMode()) … … 1722 1723 } 1723 1724 1724 unsigned short RenderStyle::borderEndWidth() const1725 float RenderStyle::borderEndWidth() const 1725 1726 { 1726 1727 if (isHorizontalWritingMode()) -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r163079 r163152 504 504 bool hasBorderRadius() const { return surround->border.hasBorderRadius(); } 505 505 506 unsignedborderLeftWidth() const { return surround->border.borderLeftWidth(); }506 float borderLeftWidth() const { return surround->border.borderLeftWidth(); } 507 507 EBorderStyle borderLeftStyle() const { return surround->border.left().style(); } 508 508 bool borderLeftIsTransparent() const { return surround->border.left().isTransparent(); } 509 unsignedborderRightWidth() const { return surround->border.borderRightWidth(); }509 float borderRightWidth() const { return surround->border.borderRightWidth(); } 510 510 EBorderStyle borderRightStyle() const { return surround->border.right().style(); } 511 511 bool borderRightIsTransparent() const { return surround->border.right().isTransparent(); } 512 unsignedborderTopWidth() const { return surround->border.borderTopWidth(); }512 float borderTopWidth() const { return surround->border.borderTopWidth(); } 513 513 EBorderStyle borderTopStyle() const { return surround->border.top().style(); } 514 514 bool borderTopIsTransparent() const { return surround->border.top().isTransparent(); } 515 unsignedborderBottomWidth() const { return surround->border.borderBottomWidth(); }515 float borderBottomWidth() const { return surround->border.borderBottomWidth(); } 516 516 EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); } 517 517 bool borderBottomIsTransparent() const { return surround->border.bottom().isTransparent(); } 518 518 519 unsigned short borderBeforeWidth() const;520 unsigned short borderAfterWidth() const;521 unsigned short borderStartWidth() const;522 unsigned short borderEndWidth() const;519 float borderBeforeWidth() const; 520 float borderAfterWidth() const; 521 float borderStartWidth() const; 522 float borderEndWidth() const; 523 523 524 524 unsigned short outlineSize() const { return std::max(0, outlineWidth() + outlineOffset()); } … … 1092 1092 int topWidth, int bottomWidth, int leftWidth, int rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const; 1093 1093 1094 void setBorderLeftWidth( unsignedv) { SET_VAR(surround, border.m_left.m_width, v); }1094 void setBorderLeftWidth(float v) { SET_VAR(surround, border.m_left.m_width, v); } 1095 1095 void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_style, v); } 1096 1096 void setBorderLeftColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_left, v); } 1097 void setBorderRightWidth( unsignedv) { SET_VAR(surround, border.m_right.m_width, v); }1097 void setBorderRightWidth(float v) { SET_VAR(surround, border.m_right.m_width, v); } 1098 1098 void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right.m_style, v); } 1099 1099 void setBorderRightColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_right, v); } 1100 void setBorderTopWidth( unsignedv) { SET_VAR(surround, border.m_top.m_width, v); }1100 void setBorderTopWidth(float v) { SET_VAR(surround, border.m_top.m_width, v); } 1101 1101 void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_style, v); } 1102 1102 void setBorderTopColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_top, v); } 1103 void setBorderBottomWidth( unsignedv) { SET_VAR(surround, border.m_bottom.m_width, v); }1103 void setBorderBottomWidth(float v) { SET_VAR(surround, border.m_bottom.m_width, v); } 1104 1104 void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_bottom.m_style, v); } 1105 1105 void setBorderBottomColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_bottom, v); } … … 1650 1650 static Color initialColor() { return Color::black; } 1651 1651 static StyleImage* initialListStyleImage() { return 0; } 1652 static unsignedinitialBorderWidth() { return 3; }1652 static float initialBorderWidth() { return 3; } 1653 1653 static unsigned short initialColumnRuleWidth() { return 3; } 1654 1654 static unsigned short initialOutlineWidth() { return 3; }
Note: See TracChangeset
for help on using the changeset viewer.