Changeset 145785 in webkit
- Timestamp:
- Mar 13, 2013 9:06:20 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r145782 r145785 1 2013-03-13 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> 2 3 [css3-text] Add support for text-decoration-color 4 https://bugs.webkit.org/show_bug.cgi?id=91638 5 6 Reviewed by Julien Chaffraix. 7 8 Added layout tests (paint,repaint and getComputedStyle) for 9 'text-decoration-color' property, with '-webkit' vendor prefix. 10 11 * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color-expected.txt: Added. 12 * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color.html: Added. 13 * fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-color.js: Added. 14 Added getComputedStyle-based layout test covering a bunch of valid/invalid values. 15 16 * fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-color-expected.png: Added. 17 * fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-color-expected.txt: Added. 18 * fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-color.html: Added. 19 Added cross-platform repaint layout test using 'Ahem' font. 20 21 * fast/css3-text/css3-text-decoration/text-decoration-color-expected.html: Added. 22 * fast/css3-text/css3-text-decoration/text-decoration-color.html: Added. 23 Added cross-platform reference test. 24 1 25 2013-03-11 Kinuko Yasuda <kinuko@chromium.org> 2 26 -
trunk/Source/WebCore/ChangeLog
r145784 r145785 1 2013-03-13 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> 2 3 [css3-text] Add support for text-decoration-color 4 https://bugs.webkit.org/show_bug.cgi?id=91638 5 6 Reviewed by Julien Chaffraix. 7 8 This patch implements the CSS3's 'text-decoration-color' property, with 9 '-webkit' vendor prefix. 10 11 More info about "text-decoration-color" property can be found here: 12 http://dev.w3.org/csswg/css-text-decor-3/#text-decoration-color-property 13 14 Mozilla implementation (using -moz prefix) is described here: 15 https://developer.mozilla.org/en/CSS/text-decoration-color 16 17 Tests: fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color.html 18 fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-color.html 19 fast/css3-text/css3-text-decoration/text-decoration-color.html 20 21 * css/CSSComputedStyleDeclaration.cpp: 22 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 23 * css/CSSParser.cpp: 24 (WebCore::isColorPropertyID): 25 (WebCore::CSSParser::parseValue): 26 * css/CSSProperty.cpp: 27 (WebCore::CSSProperty::isInheritedProperty): 28 Added parsing checks for '-webkit-text-decoration-color' property. 29 30 * css/CSSPropertyNames.in: 31 Added '-webkit-text-decoration-color' property name. 32 33 * css/StyleBuilder.cpp: 34 (WebCore::StyleBuilder::StyleBuilder): 35 Set property handler for '-webkit-text-decoration-color'. 36 37 * css/StyleResolver.cpp: 38 (WebCore::isValidVisitedLinkProperty): 39 (WebCore::StyleResolver::applyProperty): 40 Added switch case checks for text-decoration-color property on visited 41 link checks and property appliance. 42 43 * rendering/RenderObject.cpp: 44 (WebCore::decorationColor): 45 The newly added property needs to checked here when selecting the text 46 decoration color. 47 48 * rendering/style/RenderStyle.cpp: 49 (WebCore::RenderStyle::diff): 50 (WebCore::RenderStyle::colorIncludingFallback): 51 (WebCore::RenderStyle::visitedDependentColor): 52 There is no proper way to check if a property has been set or not, so if 53 text decoration color fallbacks to default color, it would override the 54 check for 'text-fill-color' and 'text-stroke-color' properties on 55 WebCore::decorationColor() static function, changing current behavior, 56 which can be verified by new failing layout tests (ie. 57 fast/text/stroking-decorations.html). 58 59 * rendering/style/RenderStyle.h: 60 Added {non-}visited text decoration color getters and setters. 61 62 * rendering/style/StyleRareNonInheritedData.cpp: 63 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 64 (WebCore::StyleRareNonInheritedData::operator==): 65 Added {non-}visited text decoration color variables initialization to 66 copy constructor and operator assignment functions. 67 68 * rendering/style/StyleRareNonInheritedData.h: 69 (StyleRareNonInheritedData): 70 Added here as this property is not used regularly. 71 1 72 2013-03-13 Rik Cabanier <cabanier@adobe.com> 2 73 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r145450 r145785 191 191 CSSPropertyWebkitTextDecorationLine, 192 192 CSSPropertyWebkitTextDecorationStyle, 193 CSSPropertyWebkitTextDecorationColor, 193 194 CSSPropertyWebkitTextAlignLast, 194 195 CSSPropertyWebkitTextUnderlinePosition, … … 2155 2156 case CSSPropertyWebkitTextDecorationStyle: 2156 2157 return renderTextDecorationStyleFlagsToCSSValue(style->textDecorationStyle()); 2158 case CSSPropertyWebkitTextDecorationColor: 2159 return currentColorOrValidColor(style.get(), style->textDecorationColor()); 2157 2160 case CSSPropertyWebkitTextAlignLast: 2158 2161 return cssValuePool().createValue(style->textAlignLast()); -
trunk/Source/WebCore/css/CSSParser.cpp
r145784 r145785 516 516 case CSSPropertyWebkitBorderStartColor: 517 517 case CSSPropertyWebkitColumnRuleColor: 518 #if ENABLE(CSS3_TEXT) 519 case CSSPropertyWebkitTextDecorationColor: 520 #endif // CSS3_TEXT 518 521 case CSSPropertyWebkitTextEmphasisColor: 519 522 case CSSPropertyWebkitTextFillColor: … … 1980 1983 case CSSPropertyTextOverlineColor: 1981 1984 case CSSPropertyWebkitColumnRuleColor: 1985 #if ENABLE(CSS3_TEXT) 1986 case CSSPropertyWebkitTextDecorationColor: 1987 #endif // CSS3_TEXT 1982 1988 case CSSPropertyWebkitTextEmphasisColor: 1983 1989 case CSSPropertyWebkitTextFillColor: -
trunk/Source/WebCore/css/CSSProperty.cpp
r145450 r145785 643 643 #if ENABLE(CSS3_TEXT) 644 644 case CSSPropertyWebkitTextDecorationStyle: 645 case CSSPropertyWebkitTextDecorationColor: 645 646 #endif // CSS3_TEXT 646 647 case CSSPropertyWebkitTransform: -
trunk/Source/WebCore/css/CSSPropertyNames.in
r145450 r145785 372 372 -webkit-text-decoration-line 373 373 -webkit-text-decoration-style 374 -webkit-text-decoration-color 374 375 -webkit-text-align-last 375 376 -webkit-text-underline-position -
trunk/Source/WebCore/css/StyleBuilder.cpp
r145450 r145785 1932 1932 setPropertyHandler(CSSPropertyWebkitTextDecorationLine, ApplyPropertyTextDecoration::createHandler()); 1933 1933 setPropertyHandler(CSSPropertyWebkitTextDecorationStyle, ApplyPropertyDefault<TextDecorationStyle, &RenderStyle::textDecorationStyle, TextDecorationStyle, &RenderStyle::setTextDecorationStyle, TextDecorationStyle, &RenderStyle::initialTextDecorationStyle>::createHandler()); 1934 setPropertyHandler(CSSPropertyWebkitTextDecorationColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textDecorationColor, &RenderStyle::setTextDecorationColor, &RenderStyle::setVisitedLinkTextDecorationColor, &RenderStyle::color>::createHandler()); 1934 1935 setPropertyHandler(CSSPropertyWebkitTextAlignLast, ApplyPropertyDefault<TextAlignLast, &RenderStyle::textAlignLast, TextAlignLast, &RenderStyle::setTextAlignLast, TextAlignLast, &RenderStyle::initialTextAlignLast>::createHandler()); 1935 1936 setPropertyHandler(CSSPropertyWebkitTextUnderlinePosition, ApplyPropertyTextUnderlinePosition::createHandler()); -
trunk/Source/WebCore/css/StyleResolver.cpp
r145510 r145785 1979 1979 case CSSPropertyOutlineColor: 1980 1980 case CSSPropertyWebkitColumnRuleColor: 1981 #if ENABLE(CSS3_TEXT) 1982 case CSSPropertyWebkitTextDecorationColor: 1983 #endif // CSS3_TEXT 1981 1984 case CSSPropertyWebkitTextEmphasisColor: 1982 1985 case CSSPropertyWebkitTextFillColor: … … 3254 3257 case CSSPropertyWebkitTextDecorationLine: 3255 3258 case CSSPropertyWebkitTextDecorationStyle: 3259 case CSSPropertyWebkitTextDecorationColor: 3256 3260 case CSSPropertyWebkitTextAlignLast: 3257 3261 case CSSPropertyWebkitTextUnderlinePosition: -
trunk/Source/WebCore/rendering/RenderObject.cpp
r145596 r145785 2805 2805 { 2806 2806 Color result; 2807 #if ENABLE(CSS3_TEXT) 2808 // Check for text decoration color first. 2809 result = style->visitedDependentColor(CSSPropertyWebkitTextDecorationColor); 2810 if (result.isValid()) 2811 return result; 2812 #endif // CSS3_TEXT 2807 2813 if (style->textStrokeWidth() > 0) { 2808 2814 // Prefer stroke color if possible but not if it's fully transparent. -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r145168 r145785 683 683 #if ENABLE(CSS3_TEXT) 684 684 || rareNonInheritedData->m_textDecorationStyle != other->rareNonInheritedData->m_textDecorationStyle 685 || rareNonInheritedData->m_textDecorationColor != other->rareNonInheritedData->m_textDecorationColor 685 686 #endif // CSS3_TEXT 686 687 || rareInheritedData->textFillColor != other->rareInheritedData->textFillColor … … 1428 1429 result = visitedLink ? visitedLinkColumnRuleColor() : columnRuleColor(); 1429 1430 break; 1431 #if ENABLE(CSS3_TEXT) 1432 case CSSPropertyWebkitTextDecorationColor: 1433 // Text decoration color fallback is handled in RenderObject::decorationColor. 1434 return visitedLink ? visitedLinkTextDecorationColor() : textDecorationColor(); 1435 #endif // CSS3_TEXT 1430 1436 case CSSPropertyWebkitTextEmphasisColor: 1431 1437 result = visitedLink ? visitedLinkTextEmphasisColor() : textEmphasisColor(); … … 1458 1464 1459 1465 Color visitedColor = colorIncludingFallback(colorProperty, true); 1466 1467 #if ENABLE(CSS3_TEXT) 1468 // Text decoration color validity is preserved (checked in RenderObject::decorationColor). 1469 if (colorProperty == CSSPropertyWebkitTextDecorationColor) 1470 return visitedColor; 1471 #endif // CSS3_TEXT 1460 1472 1461 1473 // FIXME: Technically someone could explicitly specify the color transparent, but for now we'll just -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r145450 r145785 1347 1347 void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); } 1348 1348 void setTextCombine(TextCombine v) { SET_VAR(rareNonInheritedData, m_textCombine, v); } 1349 #if ENABLE(CSS3_TEXT) 1350 void setTextDecorationColor(const Color& c) { SET_VAR(rareNonInheritedData, m_textDecorationColor, c); } 1351 #endif // CSS3_TEXT 1349 1352 void setTextEmphasisColor(const Color& c) { SET_VAR(rareInheritedData, textEmphasisColor, c); } 1350 1353 void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData, textEmphasisFill, fill); } … … 1750 1753 void setVisitedLinkOutlineColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkOutlineColor, v); } 1751 1754 void setVisitedLinkColumnRuleColor(const Color& v) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_visitedLinkColumnRuleColor, v); } 1755 #if ENABLE(CSS3_TEXT) 1756 void setVisitedLinkTextDecorationColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkTextDecorationColor, v); } 1757 #endif // CSS3_TEXT 1752 1758 void setVisitedLinkTextEmphasisColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextEmphasisColor, v); } 1753 1759 void setVisitedLinkTextFillColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextFillColor, v); } … … 1800 1806 Color visitedLinkOutlineColor() const { return rareNonInheritedData->m_visitedLinkOutlineColor; } 1801 1807 Color visitedLinkColumnRuleColor() const { return rareNonInheritedData->m_multiCol->m_visitedLinkColumnRuleColor; } 1808 #if ENABLE(CSS3_TEXT) 1809 Color textDecorationColor() const { return rareNonInheritedData->m_textDecorationColor; } 1810 Color visitedLinkTextDecorationColor() const { return rareNonInheritedData->m_visitedLinkTextDecorationColor; } 1811 #endif // CSS3_TEXT 1802 1812 Color visitedLinkTextEmphasisColor() const { return rareInheritedData->visitedLinkTextEmphasisColor; } 1803 1813 Color visitedLinkTextFillColor() const { return rareInheritedData->visitedLinkTextFillColor; } -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r141570 r145785 130 130 , m_shapePadding(o.m_shapePadding) 131 131 , m_clipPath(o.m_clipPath) 132 #if ENABLE(CSS3_TEXT) 133 , m_textDecorationColor(o.m_textDecorationColor) 134 , m_visitedLinkTextDecorationColor(o.m_visitedLinkTextDecorationColor) 135 #endif // CSS3_TEXT 132 136 , m_visitedLinkBackgroundColor(o.m_visitedLinkBackgroundColor) 133 137 , m_visitedLinkOutlineColor(o.m_visitedLinkOutlineColor) … … 215 219 && m_shapePadding == o.m_shapePadding 216 220 && m_clipPath == o.m_clipPath 221 #if ENABLE(CSS3_TEXT) 222 && m_textDecorationColor == o.m_textDecorationColor 223 && m_visitedLinkTextDecorationColor == o.m_visitedLinkTextDecorationColor 224 #endif // CSS3_TEXT 217 225 && m_visitedLinkBackgroundColor == o.m_visitedLinkBackgroundColor 218 226 && m_visitedLinkOutlineColor == o.m_visitedLinkOutlineColor -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r135314 r145785 146 146 RefPtr<ClipPathOperation> m_clipPath; 147 147 148 #if ENABLE(CSS3_TEXT) 149 Color m_textDecorationColor; 150 Color m_visitedLinkTextDecorationColor; 151 #endif // CSS3_TEXT 148 152 Color m_visitedLinkBackgroundColor; 149 153 Color m_visitedLinkOutlineColor;
Note: See TracChangeset
for help on using the changeset viewer.