Changeset 164061 in webkit
- Timestamp:
- Feb 13, 2014 3:02:31 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r164053 r164061 1 2014-02-13 Yuki Sekiguchi <yuki.sekiguchi@access-company.com> 2 3 [css3-text] Support -webkit-text-decoration-skip: objects 4 https://bugs.webkit.org/show_bug.cgi?id=128723 5 6 Reviewed by Dean Jackson. 7 8 Added 'objects' value to the current test case. 9 Added getComputedStyle() test to test renderTextDecorationSkipFlagsToCSSValue() code. 10 11 * fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt: 12 * fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html: 13 1 14 2014-02-13 Myles C. Maxfield <mmaxfield@apple.com> 2 15 -
trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt
r158127 r164061 1 PASS cssRule.type is cssRule.STYLE_RULE 2 PASS declaration.length is 0 3 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is null 4 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects" 5 PASS cssRule.type is cssRule.STYLE_RULE 6 PASS declaration.length is 1 7 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "initial" 8 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects" 1 9 PASS cssRule.type is cssRule.STYLE_RULE 2 10 PASS declaration.length is 1 3 11 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "ink" 12 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink" 4 13 PASS cssRule.type is cssRule.STYLE_RULE 5 14 PASS declaration.length is 1 6 15 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "ink" 16 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink" 7 17 PASS cssRule.type is cssRule.STYLE_RULE 8 18 PASS declaration.length is 0 19 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects" 9 20 PASS cssRule.type is cssRule.STYLE_RULE 10 21 PASS declaration.length is 1 11 22 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "ink" 23 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink" 12 24 PASS cssRule.type is cssRule.STYLE_RULE 13 25 PASS declaration.length is 1 14 26 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "ink" 27 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink" 15 28 PASS cssRule.type is cssRule.STYLE_RULE 16 29 PASS declaration.length is 1 17 30 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "ink" 31 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink" 18 32 PASS cssRule.type is cssRule.STYLE_RULE 19 33 PASS declaration.length is 1 20 34 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "ink" 35 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink" 36 PASS cssRule.type is cssRule.STYLE_RULE 37 PASS declaration.length is 1 38 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "objects" 39 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects" 40 PASS cssRule.type is cssRule.STYLE_RULE 41 PASS declaration.length is 1 42 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "objects" 43 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects" 44 PASS cssRule.type is cssRule.STYLE_RULE 45 PASS declaration.length is 1 46 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "objects" 47 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects" 48 PASS cssRule.type is cssRule.STYLE_RULE 49 PASS declaration.length is 1 50 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "objects" 51 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects" 52 PASS cssRule.type is cssRule.STYLE_RULE 53 PASS declaration.length is 1 54 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "objects" 55 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects" 56 PASS cssRule.type is cssRule.STYLE_RULE 57 PASS declaration.length is 1 58 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "objects" 59 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects" 21 60 PASS cssRule.type is cssRule.STYLE_RULE 22 61 PASS declaration.length is 1 23 62 PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is "none" 63 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "none" 24 64 PASS cssRule.type is cssRule.STYLE_RULE 25 65 PASS declaration.length is 0 66 PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects" 26 67 -
trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html
r158127 r164061 5 5 </head> 6 6 <body> 7 <div class="p"></div> 7 8 <script type="text/javascript"> 8 function testInkIsValid(stylesheet ) {9 function testInkIsValid(stylesheet, target) { 9 10 cssRule = stylesheet.cssRules.item(0); 10 11 shouldBe("cssRule.type", "cssRule.STYLE_RULE"); … … 12 13 shouldBe("declaration.length", "1"); 13 14 shouldBe("declaration.getPropertyValue('-webkit-text-decoration-skip')", "\"ink\""); 15 computedStyle = window.getComputedStyle(target, null); 16 shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText", "\"ink\""); 14 17 stylesheet.deleteRule(0); 15 18 } 16 19 17 function testInvalidRule(stylesheet) { 20 function testObjectsIsValid(stylesheet, target) { 21 cssRule = stylesheet.cssRules.item(0); 22 shouldBe("cssRule.type", "cssRule.STYLE_RULE"); 23 declaration = cssRule.style; 24 shouldBe("declaration.length", "1"); 25 shouldBe("declaration.getPropertyValue('-webkit-text-decoration-skip')", "\"objects\""); 26 computedStyle = window.getComputedStyle(target, null); 27 shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText", "\"objects\""); 28 stylesheet.deleteRule(0); 29 } 30 31 function testEmptyIsObjects(stylesheet, target) { 18 32 cssRule = stylesheet.cssRules.item(0); 19 33 shouldBe("cssRule.type", "cssRule.STYLE_RULE"); 20 34 declaration = cssRule.style; 21 35 shouldBe("declaration.length", "0"); 36 shouldBe("declaration.getPropertyValue('-webkit-text-decoration-skip')", "null"); 37 computedStyle = window.getComputedStyle(target, null); 38 shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText", "\"objects\""); 22 39 stylesheet.deleteRule(0); 23 40 } 24 41 25 function testNoneIsValid(stylesheet) { 42 function testInitialIsObjects(stylesheet, target) { 43 cssRule = stylesheet.cssRules.item(0); 44 shouldBe("cssRule.type", "cssRule.STYLE_RULE"); 45 declaration = cssRule.style; 46 shouldBe("declaration.length", "1"); 47 shouldBe("declaration.getPropertyValue('-webkit-text-decoration-skip')", "\"initial\""); 48 computedStyle = window.getComputedStyle(target, null); 49 shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText", "\"objects\""); 50 stylesheet.deleteRule(0); 51 } 52 53 function testInvalidRule(stylesheet, target) { 54 cssRule = stylesheet.cssRules.item(0); 55 shouldBe("cssRule.type", "cssRule.STYLE_RULE"); 56 declaration = cssRule.style; 57 shouldBe("declaration.length", "0"); 58 computedStyle = window.getComputedStyle(target, null); 59 shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText", "\"objects\""); 60 stylesheet.deleteRule(0); 61 } 62 63 function testNoneIsValid(stylesheet, target) { 26 64 cssRule = stylesheet.cssRules.item(0); 27 65 shouldBe("cssRule.type", "cssRule.STYLE_RULE"); … … 29 67 shouldBe("declaration.length", "1"); 30 68 shouldBe("declaration.getPropertyValue('-webkit-text-decoration-skip')", "\"none\""); 69 computedStyle = window.getComputedStyle(target, null); 70 shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText", "\"none\""); 31 71 stylesheet.deleteRule(0); 32 72 } … … 35 75 document.head.appendChild(styleElement); 36 76 stylesheet = styleElement.sheet; 77 var target = document.getElementsByClassName("p")[0]; 78 79 stylesheet.insertRule(".p { }", 0); 80 testEmptyIsObjects(stylesheet, target); 81 82 stylesheet.insertRule(".p { -webkit-text-decoration-skip: initial; }", 0); 83 testInitialIsObjects(stylesheet, target); 37 84 38 85 stylesheet.insertRule(".p { -webkit-text-decoration-skip: ink; }", 0); 39 testInkIsValid(stylesheet );86 testInkIsValid(stylesheet, target); 40 87 41 88 stylesheet.insertRule(".p { -webkit-text-decoration-skip: ink ink ink ink ink; }", 0); 42 testInkIsValid(stylesheet );89 testInkIsValid(stylesheet, target); 43 90 44 91 stylesheet.insertRule(".p { -webkit-text-decoration-skip: garbage; }", 0); 45 testInvalidRule(stylesheet );92 testInvalidRule(stylesheet, target); 46 93 47 94 stylesheet.insertRule(".p { -webkit-text-decoration-skip: garbage ink; }", 0); 48 testInkIsValid(stylesheet );95 testInkIsValid(stylesheet, target); 49 96 50 97 stylesheet.insertRule(".p { -webkit-text-decoration-skip: ink garbage; }", 0); 51 testInkIsValid(stylesheet );98 testInkIsValid(stylesheet, target); 52 99 53 100 stylesheet.insertRule(".p { -webkit-text-decoration-skip: garbage ink garbage; }", 0); 54 testInkIsValid(stylesheet );101 testInkIsValid(stylesheet, target); 55 102 56 103 stylesheet.insertRule(".p { -webkit-text-decoration-skip: ink garbage ink; }", 0); 57 testInkIsValid(stylesheet );104 testInkIsValid(stylesheet, target); 58 105 106 stylesheet.insertRule(".p { -webkit-text-decoration-skip: objects; }", 0); 107 testObjectsIsValid(stylesheet, target); 108 109 stylesheet.insertRule(".p { -webkit-text-decoration-skip: objects objects objects objects objects; }", 0); 110 testObjectsIsValid(stylesheet, target); 111 112 stylesheet.insertRule(".p { -webkit-text-decoration-skip: garbage objects; }", 0); 113 testObjectsIsValid(stylesheet, target); 114 115 stylesheet.insertRule(".p { -webkit-text-decoration-skip: objects garbage; }", 0); 116 testObjectsIsValid(stylesheet, target); 117 118 stylesheet.insertRule(".p { -webkit-text-decoration-skip: garbage objects garbage; }", 0); 119 testObjectsIsValid(stylesheet, target); 120 121 stylesheet.insertRule(".p { -webkit-text-decoration-skip: objects garbage objects; }", 0); 122 testObjectsIsValid(stylesheet, target); 123 59 124 stylesheet.insertRule(".p { -webkit-text-decoration-skip: none; }", 0); 60 testNoneIsValid(stylesheet );125 testNoneIsValid(stylesheet, target); 61 126 62 127 stylesheet.insertRule(".p { -webkit-text-decoration-skip: ; }", 0); 63 testInvalidRule(stylesheet );128 testInvalidRule(stylesheet, target); 64 129 </script> 65 130 <script src="../../resources/js-test-post.js"></script> -
trunk/Source/WebCore/ChangeLog
r164060 r164061 1 2014-02-13 Yuki Sekiguchi <yuki.sekiguchi@access-company.com> 2 3 [css3-text] Support -webkit-text-decoration-skip: objects 4 https://bugs.webkit.org/show_bug.cgi?id=128723 5 6 Reviewed by Dean Jackson. 7 8 Implemented 'objects' value of text-decoration-skip. 9 http://www.w3.org/TR/2013/CR-css-text-decor-3-20130801/#text-decoration-skip 10 11 This is initial value and same behavior without 12 ENABLE_CSS3_TEXT_DECORATION_SKIP_INK flag. Threfore, this patch only 13 added parser code and constant for 'objects'. 14 15 Changed the initial value of text-decoration-skip. 16 17 The current implementation parses 'none', but the rendering code is 18 not match the spec, so this patch added FIXME to the rendering code. 19 20 * css/CSSComputedStyleDeclaration.cpp: 21 (WebCore::renderTextDecorationSkipFlagsToCSSValue): 22 * css/CSSParser.cpp: 23 (WebCore::CSSParser::parseTextDecorationSkip): 24 * css/CSSValueKeywords.in: 25 * css/DeprecatedStyleBuilder.cpp: 26 (WebCore::valueToDecorationSkip): 27 * rendering/InlineTextBox.cpp: 28 (WebCore::InlineTextBox::paintDecoration): 29 * rendering/style/RenderStyle.h: 30 * rendering/style/RenderStyleConstants.h: 31 1 32 2014-02-13 Daniel Bates <dabates@apple.com> 2 33 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r164035 r164061 1320 1320 switch (textDecorationSkip) { 1321 1321 case TextDecorationSkipNone: 1322 return cssValuePool().create ExplicitInitialValue();1322 return cssValuePool().createIdentifierValue(CSSValueNone); 1323 1323 case TextDecorationSkipInk: 1324 1324 return cssValuePool().createIdentifierValue(CSSValueInk); 1325 case TextDecorationSkipObjects: 1326 return cssValuePool().createIdentifierValue(CSSValueObjects); 1325 1327 } 1326 1328 -
trunk/Source/WebCore/css/CSSParser.cpp
r164035 r164061 9461 9461 case CSSValueNone: 9462 9462 case CSSValueInk: 9463 case CSSValueObjects: 9463 9464 addProperty(CSSPropertyWebkitTextDecorationSkip, cssValuePool().createIdentifierValue(value->id), important); 9464 9465 return true; -
trunk/Source/WebCore/css/CSSValueKeywords.in
r163840 r164061 486 486 wavy 487 487 ink 488 objects 488 489 -webkit-nowrap 489 490 -
trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r163840 r164061 1292 1292 case CSSValueInk: 1293 1293 return TextDecorationSkipInk; 1294 case CSSValueObjects: 1295 return TextDecorationSkipObjects; 1294 1296 default: 1295 1297 break; -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r164046 r164061 1171 1171 } 1172 1172 } else { 1173 // FIXME: Need to support text-decoration-skip: none. 1173 1174 #endif // CSS3_TEXT_DECORATION_SKIP_INK 1174 1175 context.drawLineForText(FloatPoint(localOrigin.x(), localOrigin.y() + underlineOffset), width, isPrinting); … … 1200 1201 } 1201 1202 } else { 1203 // FIXME: Need to support text-decoration-skip: none. 1202 1204 #endif // CSS3_TEXT_DECORATION_SKIP_INK 1203 1205 context.drawLineForText(localOrigin, width, isPrinting); -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r163840 r164061 1672 1672 #endif // CSS3_TEXT 1673 1673 static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; } 1674 static TextDecorationSkip initialTextDecorationSkip() { return TextDecorationSkip Ink; }1674 static TextDecorationSkip initialTextDecorationSkip() { return TextDecorationSkipObjects; } 1675 1675 static TextUnderlinePosition initialTextUnderlinePosition() { return TextUnderlinePositionAuto; } 1676 1676 static float initialZoom() { return 1.0f; } -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r163840 r164061 390 390 enum TextDecorationSkipItems { 391 391 TextDecorationSkipNone = 0, 392 TextDecorationSkipInk = 1 << 0 392 TextDecorationSkipInk = 1 << 0, 393 TextDecorationSkipObjects = 1 << 1 393 394 }; 394 395 typedef unsigned TextDecorationSkip;
Note: See TracChangeset
for help on using the changeset viewer.