Changeset 176545 in webkit
- Timestamp:
- Nov 25, 2014, 4:27:52 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/css-selector-text-expected.txt (modified) (1 diff)
-
LayoutTests/fast/css/css-selector-text.html (modified) (1 diff)
-
LayoutTests/fast/css/css-set-selector-text-expected.txt (modified) (1 diff)
-
LayoutTests/fast/css/css-set-selector-text.html (modified) (1 diff)
-
LayoutTests/fast/selectors/invalid-functional-pseudo-class-expected.txt (modified) (1 diff)
-
LayoutTests/fast/selectors/invalid-functional-pseudo-class.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSGrammar.y.in (modified) (4 diffs)
-
Source/WebCore/css/CSSParser.cpp (modified) (1 diff)
-
Source/WebCore/css/CSSSelector.cpp (modified) (2 diffs)
-
Source/WebCore/css/CSSSelector.h (modified) (1 diff)
-
Source/WebCore/css/SelectorChecker.cpp (modified) (1 diff)
-
Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in (modified) (1 diff)
-
Source/WebCore/cssjit/SelectorCompiler.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r176543 r176545 1 2014-11-25 Sukolsak Sakshuwong <sukolsak@gmail.com> 2 3 Add parsing for :dir() 4 https://bugs.webkit.org/show_bug.cgi?id=138932 5 6 Reviewed by Benjamin Poulain. 7 8 * fast/css/css-selector-text-expected.txt: 9 * fast/css/css-selector-text.html: 10 * fast/css/css-set-selector-text-expected.txt: 11 * fast/css/css-set-selector-text.html: 12 * fast/selectors/invalid-functional-pseudo-class-expected.txt: 13 * fast/selectors/invalid-functional-pseudo-class.html: 14 1 15 2014-11-25 Alejandro G. Castro <alex@igalia.com> 2 16 -
trunk/LayoutTests/fast/css/css-selector-text-expected.txt
r176535 r176545 331 331 PASS parseThenSerializeRule(':role(:role()) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText'). 332 332 PASS parseThenSerializeRule(':role(:role(a)) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText'). 333 334 PASS parseThenSerializeRule(':dir(ltr) { }') is ':dir(ltr) { }' 335 PASS parseThenSerializeRule(':dir(rtl) { }') is ':dir(rtl) { }' 336 PASS parseThenSerializeRule(':dir(LTR) { }') is ':dir(LTR) { }' 337 PASS parseThenSerializeRule(':dir(aBcD) { }') is ':dir(aBcD) { }' 338 PASS parseThenSerializeRule(':dir( a ) { }') is ':dir(a) { }' 339 340 PASS parseThenSerializeRule(':dir() { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText'). 341 PASS parseThenSerializeRule(':dir(42) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText'). 342 PASS parseThenSerializeRule(':dir(a, b) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText'). 343 PASS parseThenSerializeRule(':dir(}) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText'). 344 PASS parseThenSerializeRule(':dir()) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText'). 345 PASS parseThenSerializeRule(':dir(dir()) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText'). 346 PASS parseThenSerializeRule(':dir(:dir()) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText'). 347 PASS parseThenSerializeRule(':dir(:dir(ltr)) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText'). 333 348 PASS successfullyParsed is true 334 349 -
trunk/LayoutTests/fast/css/css-selector-text.html
r176535 r176545 417 417 shouldThrow("parseThenSerializeRule(':role(:role(a)) { }')"); 418 418 419 debug(''); 420 421 testSelectorRoundTrip(":dir(ltr)"); 422 testSelectorRoundTrip(":dir(rtl)"); 423 testSelectorRoundTrip(":dir(LTR)"); 424 testSelectorRoundTrip(":dir(aBcD)"); 425 shouldBe("parseThenSerializeRule(':dir( a ) { }')", "':dir(a) { }'"); 426 427 debug(''); 428 429 shouldThrow("parseThenSerializeRule(':dir() { }')"); 430 shouldThrow("parseThenSerializeRule(':dir(42) { }')"); 431 shouldThrow("parseThenSerializeRule(':dir(a, b) { }')"); 432 shouldThrow("parseThenSerializeRule(':dir(}) { }')"); 433 shouldThrow("parseThenSerializeRule(':dir()) { }')"); 434 shouldThrow("parseThenSerializeRule(':dir(dir()) { }')"); 435 shouldThrow("parseThenSerializeRule(':dir(:dir()) { }')"); 436 shouldThrow("parseThenSerializeRule(':dir(:dir(ltr)) { }')"); 437 419 438 </script> 420 439 <script src="../../resources/js-test-post.js"></script> -
trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt
r176241 r176545 58 58 PASS setThenReadSelectorText(':visited') is ':visited' 59 59 60 PASS setThenReadSelectorText(':dir(a)') is ':dir(a)' 60 61 PASS setThenReadSelectorText(':lang(a)') is ':lang(a)' 61 62 PASS setThenReadSelectorText(':not(a)') is ':not(a)' -
trunk/LayoutTests/fast/css/css-set-selector-text.html
r176241 r176545 98 98 debug(''); 99 99 100 testSelectorRoundTrip(":dir(a)"); 100 101 testSelectorRoundTrip(":lang(a)"); 101 102 testSelectorRoundTrip(":not(a)"); -
trunk/LayoutTests/fast/selectors/invalid-functional-pseudo-class-expected.txt
r176241 r176545 58 58 PASS document.styleSheets[1].cssRules.length is 0 59 59 PASS document.styleSheets[1].cssRules.length is 0 60 PASS document.querySelectorAll(":dir\").length threw exception SyntaxError: Unexpected EOF. 61 PASS document.querySelectorAll(":dir\\").length threw exception Error: SyntaxError: DOM Exception 12. 62 PASS document.querySelectorAll(":dir\\\").length threw exception SyntaxError: Unexpected EOF. 63 PASS document.querySelectorAll(":dir\\\\").length threw exception Error: SyntaxError: DOM Exception 12. 64 PASS document.querySelectorAll(":dir\(").length threw exception Error: SyntaxError: DOM Exception 12. 65 PASS document.querySelectorAll(":dir\\(").length threw exception Error: SyntaxError: DOM Exception 12. 66 PASS document.querySelectorAll(":dir\\\(").length threw exception Error: SyntaxError: DOM Exception 12. 67 PASS document.querySelectorAll(":dir\\\\(").length threw exception Error: SyntaxError: DOM Exception 12. 68 PASS document.querySelectorAll(":dir\ .foo").length threw exception Error: SyntaxError: DOM Exception 12. 69 PASS document.querySelectorAll(":dir\\ .foo").length threw exception Error: SyntaxError: DOM Exception 12. 70 PASS document.querySelectorAll(":dir\\\ .foo").length threw exception Error: SyntaxError: DOM Exception 12. 71 PASS document.querySelectorAll(":dir\\\\ .foo").length threw exception Error: SyntaxError: DOM Exception 12. 72 PASS document.querySelectorAll(":dir\( .foo").length threw exception Error: SyntaxError: DOM Exception 12. 73 PASS document.querySelectorAll(":dir\\( .foo").length threw exception Error: SyntaxError: DOM Exception 12. 74 PASS document.querySelectorAll(":dir\\\( .foo").length threw exception Error: SyntaxError: DOM Exception 12. 75 PASS document.querySelectorAll(":dir\\\\( .foo").length threw exception Error: SyntaxError: DOM Exception 12. 76 PASS document.querySelectorAll(":dir\()").length threw exception Error: SyntaxError: DOM Exception 12. 77 PASS document.querySelectorAll(":dir\\()").length threw exception Error: SyntaxError: DOM Exception 12. 78 PASS document.querySelectorAll(":dir\\\()").length threw exception Error: SyntaxError: DOM Exception 12. 79 PASS document.querySelectorAll(":dir\\\\()").length threw exception Error: SyntaxError: DOM Exception 12. 80 PASS document.querySelectorAll(":dir\ .foo)").length threw exception Error: SyntaxError: DOM Exception 12. 81 PASS document.querySelectorAll(":dir\\ .foo)").length threw exception Error: SyntaxError: DOM Exception 12. 82 PASS document.querySelectorAll(":dir\\\ .foo)").length threw exception Error: SyntaxError: DOM Exception 12. 83 PASS document.querySelectorAll(":dir\\\\ .foo)").length threw exception Error: SyntaxError: DOM Exception 12. 84 PASS document.querySelectorAll(":dir\\( .foo)").length threw exception Error: SyntaxError: DOM Exception 12. 85 PASS document.querySelectorAll(":dir\\\( .foo)").length threw exception Error: SyntaxError: DOM Exception 12. 86 PASS document.querySelectorAll(":dir\\\\( .foo)").length threw exception Error: SyntaxError: DOM Exception 12. 87 PASS document.styleSheets[1].cssRules.length is 0 88 PASS document.styleSheets[1].cssRules.length is 0 89 PASS document.styleSheets[1].cssRules.length is 0 90 PASS document.styleSheets[1].cssRules.length is 0 91 PASS document.styleSheets[1].cssRules.length is 0 92 PASS document.styleSheets[1].cssRules.length is 0 93 PASS document.styleSheets[1].cssRules.length is 0 94 PASS document.styleSheets[1].cssRules.length is 0 95 PASS document.styleSheets[1].cssRules.length is 0 96 PASS document.styleSheets[1].cssRules.length is 0 97 PASS document.styleSheets[1].cssRules.length is 0 98 PASS document.styleSheets[1].cssRules.length is 0 99 PASS document.styleSheets[1].cssRules.length is 0 100 PASS document.styleSheets[1].cssRules.length is 0 101 PASS document.styleSheets[1].cssRules.length is 0 102 PASS document.styleSheets[1].cssRules.length is 0 103 PASS document.styleSheets[1].cssRules.length is 0 104 PASS document.styleSheets[1].cssRules.length is 0 105 PASS document.styleSheets[1].cssRules.length is 0 106 PASS document.styleSheets[1].cssRules.length is 0 107 PASS document.styleSheets[1].cssRules.length is 0 108 PASS document.styleSheets[1].cssRules.length is 0 109 PASS document.styleSheets[1].cssRules.length is 0 110 PASS document.styleSheets[1].cssRules.length is 0 111 PASS document.styleSheets[1].cssRules.length is 0 112 PASS document.styleSheets[1].cssRules.length is 0 113 PASS document.styleSheets[1].cssRules.length is 0 60 114 PASS document.querySelectorAll(":lang\").length threw exception SyntaxError: Unexpected EOF. 61 115 PASS document.querySelectorAll(":lang\\").length threw exception Error: SyntaxError: DOM Exception 12. -
trunk/LayoutTests/fast/selectors/invalid-functional-pseudo-class.html
r176241 r176545 61 61 var functionalPseudoClasses = [ 62 62 "-webkit-any", 63 "dir", 63 64 "lang", 64 65 "not", -
trunk/Source/WebCore/ChangeLog
r176544 r176545 1 2014-11-25 Sukolsak Sakshuwong <sukolsak@gmail.com> 2 3 Add parsing for :dir() 4 https://bugs.webkit.org/show_bug.cgi?id=138932 5 6 Reviewed by Benjamin Poulain. 7 8 Add support for parsing :dir() pseudo class. The implementation of selector 9 matching will be in a follow-up patch. 10 11 * css/CSSGrammar.y.in: 12 * css/CSSParser.cpp: 13 (WebCore::CSSParser::detectFunctionTypeToken): 14 * css/CSSSelector.cpp: 15 (WebCore::appendPseudoClassFunctionTail): 16 (WebCore::CSSSelector::selectorText): 17 * css/CSSSelector.h: 18 * css/SelectorChecker.cpp: 19 (WebCore::SelectorChecker::checkOne): 20 * css/SelectorPseudoClassAndCompatibilityElementMap.in: 21 * cssjit/SelectorCompiler.cpp: 22 (WebCore::SelectorCompiler::addPseudoClassType): 23 1 24 2014-11-25 Anders Carlsson <andersca@apple.com> 2 25 -
trunk/Source/WebCore/css/CSSGrammar.y.in
r176494 r176545 64 64 case NTHCHILDSELECTORSEPARATOR: 65 65 #if ENABLE_CSS_SELECTORS_LEVEL4 66 case DIRFUNCTION: 66 67 case LANGFUNCTION: 67 68 case ROLEFUNCTION: … … 233 234 234 235 #if ENABLE_CSS_SELECTORS_LEVEL4 236 %token <string> DIRFUNCTION 235 237 %token <string> LANGFUNCTION 236 238 %token <string> ROLEFUNCTION … … 1377 1379 1378 1380 #if ENABLE_CSS_SELECTORS_LEVEL4 1381 | ':' DIRFUNCTION maybe_space IDENT maybe_space ')' { 1382 $$ = nullptr; 1383 auto selector = std::make_unique<CSSParserSelector>(); 1384 selector->setMatch(CSSSelector::PseudoClass); 1385 selector->setArgument($4); 1386 selector->setPseudoClassValue($2); 1387 if (selector->pseudoClassType() == CSSSelector::PseudoClassDir) 1388 $$ = selector.release(); 1389 } 1390 1379 1391 | ':' LANGFUNCTION maybe_space comma_separated_identifiers maybe_space ')' { 1380 1392 $$ = nullptr; … … 1874 1886 '(' | FUNCTION | CALCFUNCTION | MATCHESFUNCTION | MAXFUNCTION | MINFUNCTION | ANYFUNCTION | NOTFUNCTION 1875 1887 #if ENABLE_CSS_SELECTORS_LEVEL4 1876 | LANGFUNCTION | ROLEFUNCTION1888 | DIRFUNCTION | LANGFUNCTION | ROLEFUNCTION 1877 1889 #endif 1878 1890 #if ENABLE_VIDEO_TRACK -
trunk/Source/WebCore/css/CSSParser.cpp
r176494 r176545 10693 10693 } 10694 10694 #endif 10695 #if ENABLE(CSS_SELECTORS_LEVEL4) 10696 if (isASCIIAlphaCaselessEqual(name[0], 'd') && isASCIIAlphaCaselessEqual(name[1], 'i') && isASCIIAlphaCaselessEqual(name[2], 'r')) { 10697 m_token = DIRFUNCTION; 10698 return true; 10699 } 10700 #endif 10695 10701 return false; 10696 10702 -
trunk/Source/WebCore/css/CSSSelector.cpp
r176535 r176545 320 320 { 321 321 switch (selector->pseudoClassType()) { 322 #if ENABLE(CSS_SELECTORS_LEVEL4) 323 case CSSSelector::PseudoClassDir: 324 #endif 322 325 case CSSSelector::PseudoClassLang: 323 326 case CSSSelector::PseudoClassNthChild: … … 442 445 str.appendLiteral(":default"); 443 446 break; 447 #if ENABLE(CSS_SELECTORS_LEVEL4) 448 case CSSSelector::PseudoClassDir: 449 str.appendLiteral(":dir("); 450 appendPseudoClassFunctionTail(str, cs); 451 break; 452 #endif 444 453 case CSSSelector::PseudoClassDisabled: 445 454 str.appendLiteral(":disabled"); -
trunk/Source/WebCore/css/CSSSelector.h
r176529 r176545 159 159 #endif 160 160 #if ENABLE(CSS_SELECTORS_LEVEL4) 161 PseudoClassDir, 161 162 PseudoClassRole, 162 163 #endif -
trunk/Source/WebCore/css/SelectorChecker.cpp
r176529 r176545 994 994 995 995 #if ENABLE(CSS_SELECTORS_LEVEL4) 996 // FIXME: Implement :dir() selector. 997 case CSSSelector::PseudoClassDir: 998 return false; 999 996 1000 // FIXME: Implement :role() selector. 997 1001 case CSSSelector::PseudoClassRole: -
trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in
r176529 r176545 15 15 decrement 16 16 default 17 #if ENABLE(CSS_SELECTORS_LEVEL4) 18 dir( 19 #endif 17 20 disabled 18 21 double-button -
trunk/Source/WebCore/cssjit/SelectorCompiler.cpp
r176529 r176545 566 566 case CSSSelector::PseudoClassDrag: 567 567 #if ENABLE(CSS_SELECTORS_LEVEL4) 568 case CSSSelector::PseudoClassDir: 568 569 case CSSSelector::PseudoClassRole: 569 570 #endif
Note:
See TracChangeset
for help on using the changeset viewer.