Changeset 154338 in webkit
- Timestamp:
- Aug 20, 2013 10:17:12 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r154332 r154338 1 2013-08-20 Bruno de Oliveira Abinader <bruno.d@partner.samsung.com> 2 3 [css3-text] Implement CSS3 text-decoration shorthand 4 https://bugs.webkit.org/show_bug.cgi?id=92000 5 6 Reviewed by Darin Adler. 7 8 Added computed style tests for text-decoration shorthand. 9 10 * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-expected.txt: Added. 11 * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering-expected.txt: Added. 12 * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html: Added. 13 * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html: Added. 14 1 15 2013-08-20 Daniel Bates <dabates@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r154336 r154338 1 2013-08-20 Bruno de Oliveira Abinader <bruno.d@partner.samsung.com> 2 3 [css3-text] Implement CSS3 text-decoration shorthand 4 https://bugs.webkit.org/show_bug.cgi?id=92000 5 6 Reviewed by Darin Adler. 7 8 Implements the text-decoration shorthand (with -webkit- prefix), as specified by the CSS3 Text Decoration specification: 9 http://dev.w3.org/csswg/css-text-decor-3/#text-decoration-property 10 11 Backported from Blink: 12 https://src.chromium.org/viewvc/blink?revision=156266&view=revision 13 14 Tests: fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html 15 fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html 16 17 * css/CSSComputedStyleDeclaration.cpp: 18 (WebCore::ComputedStyleExtractor::propertyValue): 19 * css/CSSParser.cpp: 20 (WebCore::CSSParser::parseValue): 21 (WebCore::CSSParser::addTextDecorationProperty): 22 (WebCore::CSSParser::parseTextDecoration): 23 * css/CSSProperty.cpp: 24 (WebCore::CSSProperty::isInheritedProperty): 25 * css/CSSPropertyNames.in: 26 * css/StylePropertyShorthand.cpp: 27 (WebCore::webkitTextDecorationShorthand): 28 (WebCore::shorthandForProperty): 29 (WebCore::matchingShorthandsForLonghand): 30 * css/StylePropertyShorthand.h: 31 1 32 2013-08-20 Gavin Barraclough <barraclough@apple.com> 2 33 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r154174 r154338 2294 2294 return renderTextDecorationFlagsToCSSValue(style->textDecoration()); 2295 2295 #if ENABLE(CSS3_TEXT) 2296 case CSSPropertyWebkitTextDecoration: 2297 return getCSSPropertyValuesForShorthandProperties(webkitTextDecorationShorthand()); 2296 2298 case CSSPropertyWebkitTextDecorationLine: 2297 2299 return renderTextDecorationFlagsToCSSValue(style->textDecoration()); -
trunk/Source/WebCore/css/CSSParser.cpp
r154174 r154338 2335 2335 break; 2336 2336 } 2337 2338 #if ENABLE(CSS3_TEXT) 2339 case CSSPropertyWebkitTextDecoration: 2340 // [ <text-decoration-line> || <text-decoration-style> || <text-decoration-color> ] | inherit 2341 return parseShorthand(CSSPropertyWebkitTextDecoration, webkitTextDecorationShorthand(), important); 2342 #endif 2337 2343 2338 2344 case CSSPropertyTextDecoration: … … 9523 9529 #if ENABLE(CSS3_TEXT) 9524 9530 // The text-decoration-line property takes priority over text-decoration, unless the latter has important priority set. 9525 if (propId == CSSPropertyTextDecoration && !important && m_currentShorthand == CSSPropertyInvalid) {9531 if (propId == CSSPropertyTextDecoration && !important && !inShorthand()) { 9526 9532 for (unsigned i = 0; i < m_parsedProperties.size(); ++i) { 9527 9533 if (m_parsedProperties[i].id() == CSSPropertyWebkitTextDecorationLine) … … 9536 9542 { 9537 9543 CSSParserValue* value = m_valueList->current(); 9538 if (value ->id == CSSValueNone) {9544 if (value && value->id == CSSValueNone) { 9539 9545 addTextDecorationProperty(propId, cssValuePool().createIdentifierValue(CSSValueNone), important); 9540 9546 m_valueList->next(); … … 9560 9566 } 9561 9567 9562 if (list->length() && isValid) { 9568 // Values are either valid or in shorthand scope. 9569 if (list->length() && (isValid || inShorthand())) { 9563 9570 addTextDecorationProperty(propId, list.release(), important); 9564 9571 return true; -
trunk/Source/WebCore/css/CSSProperty.cpp
r154174 r154338 657 657 case CSSPropertyWebkitPerspectiveOriginY: 658 658 #if ENABLE(CSS3_TEXT) 659 case CSSPropertyWebkitTextDecoration: 659 660 case CSSPropertyWebkitTextDecorationLine: 660 661 case CSSPropertyWebkitTextDecorationStyle: -
trunk/Source/WebCore/css/CSSPropertyNames.in
r154174 r154338 381 381 -epub-text-combine = -webkit-text-combine 382 382 #if defined(ENABLE_CSS3_TEXT) && ENABLE_CSS3_TEXT 383 -webkit-text-decoration 383 384 -webkit-text-decoration-line 384 385 -webkit-text-decoration-style -
trunk/Source/WebCore/css/StylePropertyShorthand.cpp
r153746 r154338 457 457 return webkitMaskRepeatLonghands; 458 458 } 459 460 #if ENABLE(CSS3_TEXT) 461 const StylePropertyShorthand& webkitTextDecorationShorthand() 462 { 463 static const CSSPropertyID textDecorationProperties[] = { 464 CSSPropertyWebkitTextDecorationLine, 465 CSSPropertyWebkitTextDecorationStyle, 466 CSSPropertyWebkitTextDecorationColor 467 }; 468 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitTextDecorationLonghands, (CSSPropertyWebkitTextDecoration, textDecorationProperties, WTF_ARRAY_LENGTH(textDecorationProperties))); 469 return webkitTextDecorationLonghands; 470 } 471 #endif 459 472 460 473 const StylePropertyShorthand& webkitTextEmphasisShorthand() … … 598 611 case CSSPropertyWebkitMaskRepeat: 599 612 return webkitMaskRepeatShorthand(); 613 #if ENABLE(CSS3_TEXT) 614 case CSSPropertyWebkitTextDecoration: 615 return webkitTextDecorationShorthand(); 616 #endif 600 617 case CSSPropertyWebkitTextEmphasis: 601 618 return webkitTextEmphasisShorthand(); … … 896 913 map.set(CSSPropertyWebkitMaskRepeatY, maskRepeat); 897 914 915 #if ENABLE(CSS3_TEXT) 916 Vector<const StylePropertyShorthand*, 3> textDecoration; 917 textDecoration.uncheckedAppend(&webkitTextDecorationShorthand()); 918 map.set(CSSPropertyWebkitTextDecorationLine, textDecoration); 919 map.set(CSSPropertyWebkitTextDecorationStyle, textDecoration); 920 map.set(CSSPropertyWebkitTextDecorationColor, textDecoration); 921 #endif 922 898 923 Vector<const StylePropertyShorthand*, 1> textEmphasis; 899 924 textEmphasis.uncheckedAppend(&webkitTextEmphasisShorthand()); -
trunk/Source/WebCore/css/StylePropertyShorthand.h
r153650 r154338 117 117 const StylePropertyShorthand& widthShorthand(); 118 118 119 #if ENABLE(CSS3_TEXT) 120 const StylePropertyShorthand& webkitTextDecorationShorthand(); 121 #endif 122 119 123 // Returns an empty list if the property is not a shorthand. 120 124 const StylePropertyShorthand& shorthandForProperty(CSSPropertyID);
Note: See TracChangeset
for help on using the changeset viewer.