Changeset 126054 in webkit
- Timestamp:
- Aug 20, 2012 12:36:03 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r126051 r126054 1 2012-08-20 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> 2 3 [css3-text] Add parsing support for -webkit-text-decoration-style 4 https://bugs.webkit.org/show_bug.cgi?id=94093 5 6 Reviewed by Julien Chaffraix. 7 8 This patch implements the "text-decoration-style" property parsing as specified 9 in CSS3 working draft, with "-webkit-" prefix. The specification can be found 10 here: http://dev.w3.org/csswg/css3-text/#text-decoration-style 11 12 Additionally, Mozilla implementation details can be found here: 13 https://developer.mozilla.org/en-US/docs/CSS/text-decoration-style 14 15 This is an individual task for bug 90958. Rendering support will be handled on a 16 different bug. 17 18 * fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style-expected.txt: Added. 19 * fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style.html: Added. 20 * fast/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-style.js: Added. 21 1 22 2012-08-20 Kenneth Russell <kbr@google.com> 2 23 -
trunk/Source/WebCore/ChangeLog
r126053 r126054 1 2012-08-20 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> 2 3 [css3-text] Add parsing support for -webkit-text-decoration-style 4 https://bugs.webkit.org/show_bug.cgi?id=94093 5 6 Reviewed by Julien Chaffraix. 7 8 This patch implements the "text-decoration-style" property parsing as specified 9 in CSS3 working draft, with "-webkit-" prefix. The specification can be found 10 here: http://dev.w3.org/csswg/css3-text/#text-decoration-style 11 12 Additionally, Mozilla implementation details can be found here: 13 https://developer.mozilla.org/en-US/docs/CSS/text-decoration-style 14 15 This is an individual task for bug 90958. Rendering support will be handled on a 16 different bug. 17 18 Test: fast/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style.html 19 20 * css/CSSComputedStyleDeclaration.cpp: 21 (WebCore::renderTextDecorationStyleFlagsToCSSValue): 22 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 23 * css/CSSParser.cpp: 24 (WebCore::CSSParser::parseValue): 25 * css/CSSPrimitiveValueMappings.h: 26 (WebCore::CSSPrimitiveValue::operator TextDecorationStyle): 27 * css/CSSProperty.cpp: 28 (WebCore::CSSProperty::isInheritedProperty): 29 * css/CSSPropertyNames.in: 30 * css/CSSValueKeywords.in: 31 * css/StyleBuilder.cpp: 32 (WebCore::StyleBuilder::StyleBuilder): 33 * css/StyleResolver.cpp: 34 (WebCore::StyleResolver::collectMatchingRulesForList): 35 * rendering/style/RenderStyle.cpp: 36 (WebCore::RenderStyle::diff): 37 * rendering/style/RenderStyle.h: 38 * rendering/style/RenderStyleConstants.h: Added non-bitwise TextDecorationStyle enum. 39 * rendering/style/StyleRareNonInheritedData.cpp: 40 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Added m_textDecorationStyle to default and copy constructors. 41 (WebCore::StyleRareNonInheritedData::operator==): Include m_textDecorationStyle in comparison. 42 * rendering/style/StyleRareNonInheritedData.h: 43 (StyleRareNonInheritedData): 44 Added m_textDecorationStyle here as it won't be used regularly. 45 1 46 2012-08-20 Jakob Petsovits <jpetsovits@rim.com> 2 47 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r126032 r126054 180 180 #if ENABLE(CSS3_TEXT_DECORATION) 181 181 CSSPropertyWebkitTextDecorationLine, 182 CSSPropertyWebkitTextDecorationStyle, 182 183 #endif // CSS3_TEXT_DECORATION 183 184 CSSPropertyTextIndent, … … 1217 1218 return list; 1218 1219 } 1220 1221 #if ENABLE(CSS3_TEXT_DECORATION) 1222 static PassRefPtr<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorationStyle textDecorationStyle) 1223 { 1224 switch (textDecorationStyle) { 1225 case TextDecorationStyleSolid: 1226 return cssValuePool().createIdentifierValue(CSSValueSolid); 1227 case TextDecorationStyleDouble: 1228 return cssValuePool().createIdentifierValue(CSSValueDouble); 1229 case TextDecorationStyleDotted: 1230 return cssValuePool().createIdentifierValue(CSSValueDotted); 1231 case TextDecorationStyleDashed: 1232 return cssValuePool().createIdentifierValue(CSSValueDashed); 1233 case TextDecorationStyleWavy: 1234 return cssValuePool().createIdentifierValue(CSSValueWavy); 1235 } 1236 1237 ASSERT_NOT_REACHED(); 1238 return cssValuePool().createExplicitInitialValue(); 1239 } 1240 #endif // CSS3_TEXT_DECORATION 1219 1241 1220 1242 static PassRefPtr<CSSValue> fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepeat yRepeat) … … 1961 1983 return cssValuePool().createValue(style->textAlign()); 1962 1984 case CSSPropertyTextDecoration: 1985 return renderTextDecorationFlagsToCSSValue(style->textDecoration()); 1963 1986 #if ENABLE(CSS3_TEXT_DECORATION) 1964 1987 case CSSPropertyWebkitTextDecorationLine: 1988 return renderTextDecorationFlagsToCSSValue(style->textDecoration()); 1989 case CSSPropertyWebkitTextDecorationStyle: 1990 return renderTextDecorationStyleFlagsToCSSValue(style->textDecorationStyle()); 1965 1991 #endif // CSS3_TEXT_DECORATION 1966 return renderTextDecorationFlagsToCSSValue(style->textDecoration());1967 1992 case CSSPropertyWebkitTextDecorationsInEffect: 1968 1993 return renderTextDecorationFlagsToCSSValue(style->textDecorationsInEffect()); -
trunk/Source/WebCore/css/CSSParser.cpp
r126032 r126054 2109 2109 // none | [ underline || overline || line-through ] | inherit 2110 2110 return parseTextDecoration(propId, important); 2111 2112 case CSSPropertyWebkitTextDecorationStyle: 2113 // solid | double | dotted | dashed | wavy 2114 if (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDotted || id == CSSValueDashed || id == CSSValueWavy) 2115 validPrimitive = true; 2116 break; 2111 2117 #endif // CSS3_TEXT_DECORATION 2112 2118 -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r125425 r126054 2198 2198 return TDNONE; 2199 2199 } 2200 2201 #if ENABLE(CSS3_TEXT_DECORATION) 2202 template<> inline CSSPrimitiveValue::operator TextDecorationStyle() const 2203 { 2204 switch (m_value.ident) { 2205 case CSSValueSolid: 2206 return TextDecorationStyleSolid; 2207 case CSSValueDouble: 2208 return TextDecorationStyleDouble; 2209 case CSSValueDotted: 2210 return TextDecorationStyleDotted; 2211 case CSSValueDashed: 2212 return TextDecorationStyleDashed; 2213 case CSSValueWavy: 2214 return TextDecorationStyleWavy; 2215 } 2216 2217 ASSERT_NOT_REACHED(); 2218 return TextDecorationStyleSolid; 2219 } 2220 #endif // CSS3_TEXT_DECORATION 2200 2221 2201 2222 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextSecurity e) -
trunk/Source/WebCore/css/CSSProperty.cpp
r126032 r126054 638 638 case CSSPropertyWebkitPerspectiveOriginX: 639 639 case CSSPropertyWebkitPerspectiveOriginY: 640 #if ENABLE(CSS3_TEXT_DECORATION) 641 case CSSPropertyWebkitTextDecorationStyle: 642 #endif // CSS3_TEXT_DECORATION 640 643 case CSSPropertyWebkitTransform: 641 644 case CSSPropertyWebkitTransformOrigin: -
trunk/Source/WebCore/css/CSSPropertyNames.in
r126032 r126054 354 354 #if defined(ENABLE_CSS3_TEXT_DECORATION) && ENABLE_CSS3_TEXT_DECORATION 355 355 -webkit-text-decoration-line 356 -webkit-text-decoration-style 356 357 #endif 357 358 -webkit-text-decorations-in-effect -
trunk/Source/WebCore/css/CSSValueKeywords.in
r126032 r126054 453 453 thin 454 454 underline 455 #if defined(ENABLE_CSS3_TEXT_DECORATION) && ENABLE_CSS3_TEXT_DECORATION 456 wavy 457 #endif 455 458 -webkit-nowrap 456 459 -
trunk/Source/WebCore/css/StyleBuilder.cpp
r126032 r126054 1935 1935 #if ENABLE(CSS3_TEXT_DECORATION) 1936 1936 setPropertyHandler(CSSPropertyWebkitTextDecorationLine, ApplyPropertyTextDecoration::createHandler()); 1937 setPropertyHandler(CSSPropertyWebkitTextDecorationStyle, ApplyPropertyDefault<TextDecorationStyle, &RenderStyle::textDecorationStyle, TextDecorationStyle, &RenderStyle::setTextDecorationStyle, TextDecorationStyle, &RenderStyle::initialTextDecorationStyle>::createHandler()); 1937 1938 #endif // CSS3_TEXT_DECORATION 1938 1939 setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler()); -
trunk/Source/WebCore/css/StyleResolver.cpp
r125925 r126054 4416 4416 #if ENABLE(CSS3_TEXT_DECORATION) 4417 4417 case CSSPropertyWebkitTextDecorationLine: 4418 case CSSPropertyWebkitTextDecorationStyle: 4418 4419 #endif // CSS3_TEXT_DECORATION 4419 4420 case CSSPropertyWebkitTextEmphasisColor: -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r126032 r126054 651 651 || rareNonInheritedData->userDrag != other->rareNonInheritedData->userDrag 652 652 || rareNonInheritedData->m_borderFit != other->rareNonInheritedData->m_borderFit 653 #if ENABLE(CSS3_TEXT_DECORATION) 654 || rareNonInheritedData->m_textDecorationStyle != other->rareNonInheritedData->m_textDecorationStyle 655 #endif // CSS3_TEXT_DECORATION 653 656 || rareInheritedData->textFillColor != other->rareInheritedData->textFillColor 654 657 || rareInheritedData->textStrokeColor != other->rareInheritedData->textStrokeColor -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r126032 r126054 611 611 ETextDecoration textDecorationsInEffect() const { return static_cast<ETextDecoration>(inherited_flags._text_decorations); } 612 612 ETextDecoration textDecoration() const { return static_cast<ETextDecoration>(visual->textDecoration); } 613 #if ENABLE(CSS3_TEXT_DECORATION) 614 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); } 615 #endif // CSS3_TEXT_DECORATION 613 616 int wordSpacing() const; 614 617 int letterSpacing() const; … … 1128 1131 void setTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations = v; } 1129 1132 void setTextDecoration(ETextDecoration v) { SET_VAR(visual, textDecoration, v); } 1133 #if ENABLE(CSS3_TEXT_DECORATION) 1134 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); } 1135 #endif // CSS3_TEXT_DECORATION 1130 1136 void setDirection(TextDirection v) { inherited_flags._direction = v; } 1131 1137 void setLineHeight(Length specifiedLineHeight); … … 1576 1582 static ETextAlign initialTextAlign() { return TASTART; } 1577 1583 static ETextDecoration initialTextDecoration() { return TDNONE; } 1584 #if ENABLE(CSS3_TEXT_DECORATION) 1585 static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; } 1586 #endif // CSS3_TEXT_DECORATION 1578 1587 static float initialZoom() { return 1.0f; } 1579 1588 static int initialOutlineOffset() { return 0; } -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r125330 r126054 346 346 inline ETextDecoration& operator|=(ETextDecoration& a, ETextDecoration b) { return a = a | b; } 347 347 348 #if ENABLE(CSS3_TEXT_DECORATION) 349 enum TextDecorationStyle { 350 TextDecorationStyleSolid, 351 TextDecorationStyleDouble, 352 TextDecorationStyleDotted, 353 TextDecorationStyleDashed, 354 TextDecorationStyleWavy 355 }; 356 #endif // CSS3_TEXT_DECORATION 357 348 358 enum EPageBreak { 349 359 PBAUTO, PBALWAYS, PBAVOID -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r126032 r126054 73 73 , m_borderFit(RenderStyle::initialBorderFit()) 74 74 , m_textCombine(RenderStyle::initialTextCombine()) 75 #if ENABLE(CSS3_TEXT_DECORATION) 76 , m_textDecorationStyle(RenderStyle::initialTextDecorationStyle()) 77 #endif // CSS3_TEXT_DECORATION 75 78 , m_wrapFlow(RenderStyle::initialWrapFlow()) 76 79 , m_wrapThrough(RenderStyle::initialWrapThrough()) … … 144 147 , m_borderFit(o.m_borderFit) 145 148 , m_textCombine(o.m_textCombine) 149 #if ENABLE(CSS3_TEXT_DECORATION) 150 , m_textDecorationStyle(o.m_textDecorationStyle) 151 #endif // CSS3_TEXT_DECORATION 146 152 , m_wrapFlow(o.m_wrapFlow) 147 153 , m_wrapThrough(o.m_wrapThrough) … … 221 227 && m_borderFit == o.m_borderFit 222 228 && m_textCombine == o.m_textCombine 229 #if ENABLE(CSS3_TEXT_DECORATION) 230 && m_textDecorationStyle == o.m_textDecorationStyle 231 #endif // CSS3_TEXT_DECORATION 223 232 && m_wrapFlow == o.m_wrapFlow 224 233 && m_wrapThrough == o.m_wrapThrough -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r126032 r126054 177 177 unsigned m_textCombine : 1; // CSS3 text-combine properties 178 178 179 #if ENABLE(CSS3_TEXT_DECORATION) 180 unsigned m_textDecorationStyle : 3; // TextDecorationStyle 181 #endif // CSS3_TEXT_DECORATION 179 182 unsigned m_wrapFlow: 3; // WrapFlow 180 183 unsigned m_wrapThrough: 1; // WrapThrough
Note: See TracChangeset
for help on using the changeset viewer.