Changeset 125205 in webkit
- Timestamp:
- Aug 9, 2012 2:49:36 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r125202 r125205 1 2012-08-09 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> 2 3 [css3-text] Add suport for -webkit-text-decoration-line 4 https://bugs.webkit.org/show_bug.cgi?id=90959 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 This patch implements the "text-decoration-line" property specified in CSS3 9 working draft, with "-webkit-" prefix. The specification can be found below: 10 http://dev.w3.org/csswg/css3-text/#text-decoration-line 11 12 Additionally, Mozilla implementation details can be found here: 13 https://developer-dev.allizom.org/en-US/docs/CSS/text-decoration-line 14 15 It is important to notice that "-webkit-text-decoration-line" and 16 "text-decoration" properties shares the same property handlers, however, the 17 former resets the latter if value from latter doesn't have "important" value 18 set (same behavior as Firefox). In a rare case where both properties have 19 "important" value set, the text decoration gets value from the last parsed 20 property. 21 22 * fast/css/getComputedStyle/computed-style-expected.txt: 23 * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: 24 * fast/css/getComputedStyle/resources/property-names.js: 25 * fast/css/text-decoration-line-expected.html: Added. 26 * fast/css/text-decoration-line.html: Added. 27 * svg/css/getComputedStyle-basic-expected.txt: 28 1 29 2012-08-09 Robert Hogan <robert@webkit.org> 2 30 -
trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
r121442 r125205 86 86 text-align: start; 87 87 text-decoration: none; 88 -webkit-text-decoration-line: none; 88 89 text-indent: 0px; 89 90 text-rendering: auto; -
trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
r121442 r125205 85 85 text-align: start 86 86 text-decoration: none 87 -webkit-text-decoration-line: none 87 88 text-indent: 0px 88 89 text-rendering: auto -
trunk/LayoutTests/fast/css/getComputedStyle/resources/property-names.js
r121442 r125205 233 233 "text-anchor": true, 234 234 "text-decoration": true, 235 "-webkit-text-decoration-line": true, 235 236 "text-indent": true, 236 237 "text-overflow": true, -
trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt
r121442 r125205 169 169 rect: style.getPropertyValue(text-decoration) : none 170 170 rect: style.getPropertyCSSValue(text-decoration) : [object CSSPrimitiveValue] 171 rect: style.getPropertyValue(-webkit-text-decoration-line) : none 172 rect: style.getPropertyCSSValue(-webkit-text-decoration-line) : [object CSSPrimitiveValue] 171 173 rect: style.getPropertyValue(text-indent) : 0px 172 174 rect: style.getPropertyCSSValue(text-indent) : [object CSSPrimitiveValue] … … 671 673 g: style.getPropertyValue(text-decoration) : none 672 674 g: style.getPropertyCSSValue(text-decoration) : [object CSSPrimitiveValue] 675 g: style.getPropertyValue(-webkit-text-decoration-line) : none 676 g: style.getPropertyCSSValue(-webkit-text-decoration-line) : [object CSSPrimitiveValue] 673 677 g: style.getPropertyValue(text-indent) : 0px 674 678 g: style.getPropertyCSSValue(text-indent) : [object CSSPrimitiveValue] -
trunk/Source/WebCore/ChangeLog
r125203 r125205 1 2012-08-09 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> 2 3 [css3-text] Add suport for -webkit-text-decoration-line 4 https://bugs.webkit.org/show_bug.cgi?id=90959 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 This patch implements the "text-decoration-line" property specified in CSS3 9 working draft, with "-webkit-" prefix. The specification can be found below: 10 http://dev.w3.org/csswg/css3-text/#text-decoration-line 11 12 Additionally, Mozilla implementation details can be found here: 13 https://developer-dev.allizom.org/en-US/docs/CSS/text-decoration-line 14 15 It is important to notice that "-webkit-text-decoration-line" and 16 "text-decoration" properties shares the same property handlers, however, the 17 former resets the latter if value from latter doesn't have "important" value 18 set (same behavior as Firefox). In a rare case where both properties have 19 "important" value set, the text decoration gets value from the last parsed 20 property. 21 22 Test: fast/css/text-decoration-line.html 23 24 * css/CSSComputedStyleDeclaration.cpp: 25 (WebCore::renderTextDecorationFlagsToCSSValue): 26 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 27 * css/CSSParser.cpp: 28 (WebCore::CSSParser::parseValue): 29 (WebCore::CSSParser::addTextDecorationProperty): 30 (WebCore::CSSParser::parseTextDecoration): 31 * css/CSSParser.h: 32 * css/CSSProperty.cpp: 33 (WebCore::CSSProperty::isInheritedProperty): 34 * css/CSSPropertyNames.in: 35 * css/StyleBuilder.cpp: 36 (WebCore::StyleBuilder::StyleBuilder): 37 * css/StyleResolver.cpp: 38 (WebCore::StyleResolver::collectMatchingRulesForList): 39 1 40 2012-08-09 Huang Dongsung <luxtella@company100.net> 2 41 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r124884 r125205 177 177 CSSPropertyTextAlign, 178 178 CSSPropertyTextDecoration, 179 CSSPropertyWebkitTextDecorationLine, 179 180 CSSPropertyTextIndent, 180 181 CSSPropertyTextRendering, … … 1191 1192 static PassRefPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecoration) 1192 1193 { 1194 // Blink value is ignored. 1193 1195 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1194 1196 if (textDecoration & UNDERLINE) … … 1198 1200 if (textDecoration & LINE_THROUGH) 1199 1201 list->append(cssValuePool().createIdentifierValue(CSSValueLineThrough)); 1200 if (textDecoration & BLINK)1201 list->append(cssValuePool().createIdentifierValue(CSSValueBlink));1202 1202 1203 1203 if (!list->length()) … … 1949 1949 return cssValuePool().createValue(style->textAlign()); 1950 1950 case CSSPropertyTextDecoration: 1951 case CSSPropertyWebkitTextDecorationLine: 1951 1952 return renderTextDecorationFlagsToCSSValue(style->textDecoration()); 1952 1953 case CSSPropertyWebkitTextDecorationsInEffect: -
trunk/Source/WebCore/css/CSSParser.cpp
r125118 r125205 2101 2101 case CSSPropertyWebkitTextDecorationsInEffect: 2102 2102 // none | [ underline || overline || line-through || blink ] | inherit 2103 if (id == CSSValueNone) { 2104 validPrimitive = true; 2105 } else { 2106 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 2107 bool isValid = true; 2108 while (isValid && value) { 2109 switch (value->id) { 2110 case CSSValueBlink: 2111 break; 2112 case CSSValueUnderline: 2113 case CSSValueOverline: 2114 case CSSValueLineThrough: 2115 list->append(cssValuePool().createIdentifierValue(value->id)); 2116 break; 2117 default: 2118 isValid = false; 2119 } 2120 value = m_valueList->next(); 2121 } 2122 if (list->length() && isValid) { 2123 parsedValue = list.release(); 2124 m_valueList->next(); 2125 } 2126 } 2127 break; 2103 return parseTextDecoration(propId, important); 2104 2105 case CSSPropertyWebkitTextDecorationLine: 2106 // none | [ underline || overline || line-through ] | inherit 2107 return parseTextDecoration(propId, important); 2128 2108 2129 2109 case CSSPropertyZoom: // normal | reset | document | <number> | <percentage> | inherit … … 7931 7911 7932 7912 return value; 7913 } 7914 7915 void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important) 7916 { 7917 // The text-decoration-line property takes priority over text-decoration, unless the latter has important priority set. 7918 if (propId == CSSPropertyTextDecoration && !important && m_currentShorthand == CSSPropertyInvalid) { 7919 for (unsigned i = 0; i < m_parsedProperties.size(); ++i) { 7920 if (m_parsedProperties[i].id() == CSSPropertyWebkitTextDecorationLine) 7921 return; 7922 } 7923 } 7924 addProperty(propId, value, important); 7925 } 7926 7927 bool CSSParser::parseTextDecoration(CSSPropertyID propId, bool important) 7928 { 7929 CSSParserValue* value = m_valueList->current(); 7930 if (value->id == CSSValueNone) { 7931 addTextDecorationProperty(propId, cssValuePool().createExplicitInitialValue(), important); 7932 m_valueList->next(); 7933 return true; 7934 } 7935 7936 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 7937 bool isValid = true; 7938 while (isValid && value) { 7939 switch (value->id) { 7940 case CSSValueBlink: 7941 // Blink value is not accepted by -webkit-text-decoration-line. 7942 isValid = propId != CSSPropertyWebkitTextDecorationLine; 7943 break; 7944 case CSSValueUnderline: 7945 case CSSValueOverline: 7946 case CSSValueLineThrough: 7947 list->append(cssValuePool().createIdentifierValue(value->id)); 7948 break; 7949 default: 7950 isValid = false; 7951 break; 7952 } 7953 if (isValid) 7954 value = m_valueList->next(); 7955 } 7956 7957 if (list->length() && isValid) { 7958 addTextDecorationProperty(propId, list.release(), important); 7959 return true; 7960 } 7961 7962 return false; 7933 7963 } 7934 7964 -
trunk/Source/WebCore/css/CSSParser.h
r124970 r125205 232 232 bool parseTextEmphasisStyle(bool important); 233 233 234 void addTextDecorationProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important); 235 bool parseTextDecoration(CSSPropertyID propId, bool important); 236 234 237 bool parseLineBoxContain(bool important); 235 238 bool parseCalculation(CSSParserValue*, CalculationPermittedValueRange); -
trunk/Source/WebCore/css/CSSProperty.cpp
r124884 r125205 341 341 case CSSPropertyWebkitRtlOrdering: 342 342 case CSSPropertyWebkitTextCombine: 343 case CSSPropertyWebkitTextDecorationLine: 343 344 case CSSPropertyWebkitTextDecorationsInEffect: 344 345 case CSSPropertyWebkitTextEmphasis: -
trunk/Source/WebCore/css/CSSPropertyNames.in
r124389 r125205 352 352 -webkit-text-combine 353 353 -epub-text-combine = -webkit-text-combine 354 -webkit-text-decoration-line 354 355 -webkit-text-decorations-in-effect 355 356 -webkit-text-emphasis -
trunk/Source/WebCore/css/StyleBuilder.cpp
r124297 r125205 1934 1934 setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler()); 1935 1935 setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler()); 1936 setPropertyHandler(CSSPropertyWebkitTextDecorationLine, ApplyPropertyTextDecoration::createHandler()); 1936 1937 setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler()); 1937 1938 setPropertyHandler(CSSPropertyTextOverflow, ApplyPropertyDefault<TextOverflow, &RenderStyle::textOverflow, TextOverflow, &RenderStyle::setTextOverflow, TextOverflow, &RenderStyle::initialTextOverflow>::createHandler()); -
trunk/Source/WebCore/css/StyleResolver.cpp
r124884 r125205 4400 4400 case CSSPropertyWebkitRtlOrdering: 4401 4401 case CSSPropertyWebkitTextCombine: 4402 case CSSPropertyWebkitTextDecorationLine: 4402 4403 case CSSPropertyWebkitTextEmphasisColor: 4403 4404 case CSSPropertyWebkitTextEmphasisPosition:
Note: See TracChangeset
for help on using the changeset viewer.