<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[176545] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/176545">176545</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-11-25 16:27:52 -0800 (Tue, 25 Nov 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add parsing for :dir()
https://bugs.webkit.org/show_bug.cgi?id=138932
Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2014-11-25
Reviewed by Benjamin Poulain.
Source/WebCore:
Add support for parsing :dir() pseudo class. The implementation of selector
matching will be in a follow-up patch.
* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::CSSParser::detectFunctionTypeToken):
* css/CSSSelector.cpp:
(WebCore::appendPseudoClassFunctionTail):
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
LayoutTests:
* fast/css/css-selector-text-expected.txt:
* fast/css/css-selector-text.html:
* fast/css/css-set-selector-text-expected.txt:
* fast/css/css-set-selector-text.html:
* fast/selectors/invalid-functional-pseudo-class-expected.txt:
* fast/selectors/invalid-functional-pseudo-class.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcsscssselectortextexpectedtxt">trunk/LayoutTests/fast/css/css-selector-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsscssselectortexthtml">trunk/LayoutTests/fast/css/css-selector-text.html</a></li>
<li><a href="#trunkLayoutTestsfastcsscsssetselectortextexpectedtxt">trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsscsssetselectortexthtml">trunk/LayoutTests/fast/css/css-set-selector-text.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidfunctionalpseudoclassexpectedtxt">trunk/LayoutTests/fast/selectors/invalid-functional-pseudo-class-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidfunctionalpseudoclasshtml">trunk/LayoutTests/fast/selectors/invalid-functional-pseudo-class.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSGrammaryin">trunk/Source/WebCore/css/CSSGrammar.y.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorcpp">trunk/Source/WebCore/css/CSSSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorh">trunk/Source/WebCore/css/CSSSelector.h</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckercpp">trunk/Source/WebCore/css/SelectorChecker.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorPseudoClassAndCompatibilityElementMapin">trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in</a></li>
<li><a href="#trunkSourceWebCorecssjitSelectorCompilercpp">trunk/Source/WebCore/cssjit/SelectorCompiler.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/LayoutTests/ChangeLog        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-11-25 Sukolsak Sakshuwong <sukolsak@gmail.com>
+
+ Add parsing for :dir()
+ https://bugs.webkit.org/show_bug.cgi?id=138932
+
+ Reviewed by Benjamin Poulain.
+
+ * fast/css/css-selector-text-expected.txt:
+ * fast/css/css-selector-text.html:
+ * fast/css/css-set-selector-text-expected.txt:
+ * fast/css/css-set-selector-text.html:
+ * fast/selectors/invalid-functional-pseudo-class-expected.txt:
+ * fast/selectors/invalid-functional-pseudo-class.html:
+
</ins><span class="cx"> 2014-11-25 Alejandro G. Castro <alex@igalia.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed, upload two missing test files in the commit r174677.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscssselectortextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-selector-text-expected.txt (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-selector-text-expected.txt        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/LayoutTests/fast/css/css-selector-text-expected.txt        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -330,6 +330,21 @@
</span><span class="cx"> PASS parseThenSerializeRule(':role(role()) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
</span><span class="cx"> PASS parseThenSerializeRule(':role(:role()) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
</span><span class="cx"> PASS parseThenSerializeRule(':role(:role(a)) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
</span><ins>+
+PASS parseThenSerializeRule(':dir(ltr) { }') is ':dir(ltr) { }'
+PASS parseThenSerializeRule(':dir(rtl) { }') is ':dir(rtl) { }'
+PASS parseThenSerializeRule(':dir(LTR) { }') is ':dir(LTR) { }'
+PASS parseThenSerializeRule(':dir(aBcD) { }') is ':dir(aBcD) { }'
+PASS parseThenSerializeRule(':dir( a ) { }') is ':dir(a) { }'
+
+PASS parseThenSerializeRule(':dir() { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':dir(42) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':dir(a, b) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':dir(}) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':dir()) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':dir(dir()) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':dir(:dir()) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':dir(:dir(ltr)) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscssselectortexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-selector-text.html (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-selector-text.html        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/LayoutTests/fast/css/css-selector-text.html        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -416,6 +416,25 @@
</span><span class="cx"> shouldThrow("parseThenSerializeRule(':role(:role()) { }')");
</span><span class="cx"> shouldThrow("parseThenSerializeRule(':role(:role(a)) { }')");
</span><span class="cx">
</span><ins>+debug('');
+
+testSelectorRoundTrip(":dir(ltr)");
+testSelectorRoundTrip(":dir(rtl)");
+testSelectorRoundTrip(":dir(LTR)");
+testSelectorRoundTrip(":dir(aBcD)");
+shouldBe("parseThenSerializeRule(':dir( a ) { }')", "':dir(a) { }'");
+
+debug('');
+
+shouldThrow("parseThenSerializeRule(':dir() { }')");
+shouldThrow("parseThenSerializeRule(':dir(42) { }')");
+shouldThrow("parseThenSerializeRule(':dir(a, b) { }')");
+shouldThrow("parseThenSerializeRule(':dir(}) { }')");
+shouldThrow("parseThenSerializeRule(':dir()) { }')");
+shouldThrow("parseThenSerializeRule(':dir(dir()) { }')");
+shouldThrow("parseThenSerializeRule(':dir(:dir()) { }')");
+shouldThrow("parseThenSerializeRule(':dir(:dir(ltr)) { }')");
+
</ins><span class="cx"> </script>
</span><span class="cx"> <script src="../../resources/js-test-post.js"></script>
</span><span class="cx"> </body>
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscsssetselectortextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> PASS setThenReadSelectorText(':target') is ':target'
</span><span class="cx"> PASS setThenReadSelectorText(':visited') is ':visited'
</span><span class="cx">
</span><ins>+PASS setThenReadSelectorText(':dir(a)') is ':dir(a)'
</ins><span class="cx"> PASS setThenReadSelectorText(':lang(a)') is ':lang(a)'
</span><span class="cx"> PASS setThenReadSelectorText(':not(a)') is ':not(a)'
</span><span class="cx"> PASS setThenReadSelectorText(':role(a)') is ':role(a)'
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscsssetselectortexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-set-selector-text.html (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-set-selector-text.html        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/LayoutTests/fast/css/css-set-selector-text.html        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx">
</span><span class="cx"> debug('');
</span><span class="cx">
</span><ins>+testSelectorRoundTrip(":dir(a)");
</ins><span class="cx"> testSelectorRoundTrip(":lang(a)");
</span><span class="cx"> testSelectorRoundTrip(":not(a)");
</span><span class="cx"> testSelectorRoundTrip(":role(a)");
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsinvalidfunctionalpseudoclassexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/invalid-functional-pseudo-class-expected.txt (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-functional-pseudo-class-expected.txt        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/LayoutTests/fast/selectors/invalid-functional-pseudo-class-expected.txt        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -57,6 +57,60 @@
</span><span class="cx"> PASS document.styleSheets[1].cssRules.length is 0
</span><span class="cx"> PASS document.styleSheets[1].cssRules.length is 0
</span><span class="cx"> PASS document.styleSheets[1].cssRules.length is 0
</span><ins>+PASS document.querySelectorAll(":dir\").length threw exception SyntaxError: Unexpected EOF.
+PASS document.querySelectorAll(":dir\\").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\").length threw exception SyntaxError: Unexpected EOF.
+PASS document.querySelectorAll(":dir\\\\").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\(").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\(").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\(").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\\(").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\ .foo").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\ .foo").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\ .foo").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\\ .foo").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\( .foo").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\( .foo").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\( .foo").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\\( .foo").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\()").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\()").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\()").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\\()").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\ .foo)").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\ .foo)").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\ .foo)").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\\ .foo)").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\( .foo)").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\( .foo)").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.querySelectorAll(":dir\\\\( .foo)").length threw exception Error: SyntaxError: DOM Exception 12.
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
+PASS document.styleSheets[1].cssRules.length is 0
</ins><span class="cx"> PASS document.querySelectorAll(":lang\").length threw exception SyntaxError: Unexpected EOF.
</span><span class="cx"> PASS document.querySelectorAll(":lang\\").length threw exception Error: SyntaxError: DOM Exception 12.
</span><span class="cx"> PASS document.querySelectorAll(":lang\\\").length threw exception SyntaxError: Unexpected EOF.
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsinvalidfunctionalpseudoclasshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/invalid-functional-pseudo-class.html (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-functional-pseudo-class.html        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/LayoutTests/fast/selectors/invalid-functional-pseudo-class.html        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx">
</span><span class="cx"> var functionalPseudoClasses = [
</span><span class="cx"> "-webkit-any",
</span><ins>+ "dir",
</ins><span class="cx"> "lang",
</span><span class="cx"> "not",
</span><span class="cx"> "nth-child",
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/Source/WebCore/ChangeLog        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2014-11-25 Sukolsak Sakshuwong <sukolsak@gmail.com>
+
+ Add parsing for :dir()
+ https://bugs.webkit.org/show_bug.cgi?id=138932
+
+ Reviewed by Benjamin Poulain.
+
+ Add support for parsing :dir() pseudo class. The implementation of selector
+ matching will be in a follow-up patch.
+
+ * css/CSSGrammar.y.in:
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::detectFunctionTypeToken):
+ * css/CSSSelector.cpp:
+ (WebCore::appendPseudoClassFunctionTail):
+ (WebCore::CSSSelector::selectorText):
+ * css/CSSSelector.h:
+ * css/SelectorChecker.cpp:
+ (WebCore::SelectorChecker::checkOne):
+ * css/SelectorPseudoClassAndCompatibilityElementMap.in:
+ * cssjit/SelectorCompiler.cpp:
+ (WebCore::SelectorCompiler::addPseudoClassType):
+
</ins><span class="cx"> 2014-11-25 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove user content handling from PageGroup
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGrammaryin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGrammar.y.in        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> case NTHCHILDFUNCTIONS:
</span><span class="cx"> case NTHCHILDSELECTORSEPARATOR:
</span><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><ins>+ case DIRFUNCTION:
</ins><span class="cx"> case LANGFUNCTION:
</span><span class="cx"> case ROLEFUNCTION:
</span><span class="cx"> #endif
</span><span class="lines">@@ -232,6 +233,7 @@
</span><span class="cx"> %token <string> NTHCHILDFUNCTIONS
</span><span class="cx">
</span><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><ins>+%token <string> DIRFUNCTION
</ins><span class="cx"> %token <string> LANGFUNCTION
</span><span class="cx"> %token <string> ROLEFUNCTION
</span><span class="cx"> #endif
</span><span class="lines">@@ -1376,6 +1378,16 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><ins>+ | ':' DIRFUNCTION maybe_space IDENT maybe_space ')' {
+ $$ = nullptr;
+ auto selector = std::make_unique<CSSParserSelector>();
+ selector->setMatch(CSSSelector::PseudoClass);
+ selector->setArgument($4);
+ selector->setPseudoClassValue($2);
+ if (selector->pseudoClassType() == CSSSelector::PseudoClassDir)
+ $$ = selector.release();
+ }
+
</ins><span class="cx"> | ':' LANGFUNCTION maybe_space comma_separated_identifiers maybe_space ')' {
</span><span class="cx"> $$ = nullptr;
</span><span class="cx"> if ($4) {
</span><span class="lines">@@ -1873,7 +1885,7 @@
</span><span class="cx"> opening_parenthesis:
</span><span class="cx"> '(' | FUNCTION | CALCFUNCTION | MATCHESFUNCTION | MAXFUNCTION | MINFUNCTION | ANYFUNCTION | NOTFUNCTION
</span><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><del>- | LANGFUNCTION | ROLEFUNCTION
</del><ins>+ | DIRFUNCTION | LANGFUNCTION | ROLEFUNCTION
</ins><span class="cx"> #endif
</span><span class="cx"> #if ENABLE_VIDEO_TRACK
</span><span class="cx"> | CUEFUNCTION
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -10692,6 +10692,12 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(CSS_SELECTORS_LEVEL4)
+ if (isASCIIAlphaCaselessEqual(name[0], 'd') && isASCIIAlphaCaselessEqual(name[1], 'i') && isASCIIAlphaCaselessEqual(name[2], 'r')) {
+ m_token = DIRFUNCTION;
+ return true;
+ }
+#endif
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> case 4:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.cpp (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.cpp        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/Source/WebCore/css/CSSSelector.cpp        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -319,6 +319,9 @@
</span><span class="cx"> static void appendPseudoClassFunctionTail(StringBuilder& str, const CSSSelector* selector)
</span><span class="cx"> {
</span><span class="cx"> switch (selector->pseudoClassType()) {
</span><ins>+#if ENABLE(CSS_SELECTORS_LEVEL4)
+ case CSSSelector::PseudoClassDir:
+#endif
</ins><span class="cx"> case CSSSelector::PseudoClassLang:
</span><span class="cx"> case CSSSelector::PseudoClassNthChild:
</span><span class="cx"> case CSSSelector::PseudoClassNthLastChild:
</span><span class="lines">@@ -441,6 +444,12 @@
</span><span class="cx"> case CSSSelector::PseudoClassDefault:
</span><span class="cx"> str.appendLiteral(":default");
</span><span class="cx"> break;
</span><ins>+#if ENABLE(CSS_SELECTORS_LEVEL4)
+ case CSSSelector::PseudoClassDir:
+ str.appendLiteral(":dir(");
+ appendPseudoClassFunctionTail(str, cs);
+ break;
+#endif
</ins><span class="cx"> case CSSSelector::PseudoClassDisabled:
</span><span class="cx"> str.appendLiteral(":disabled");
</span><span class="cx"> break;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.h (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.h        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/Source/WebCore/css/CSSSelector.h        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -158,6 +158,7 @@
</span><span class="cx"> PseudoClassPast,
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(CSS_SELECTORS_LEVEL4)
</span><ins>+ PseudoClassDir,
</ins><span class="cx"> PseudoClassRole,
</span><span class="cx"> #endif
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.cpp        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -993,6 +993,10 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_SELECTORS_LEVEL4)
</span><ins>+ // FIXME: Implement :dir() selector.
+ case CSSSelector::PseudoClassDir:
+ return false;
+
</ins><span class="cx"> // FIXME: Implement :role() selector.
</span><span class="cx"> case CSSSelector::PseudoClassRole:
</span><span class="cx"> return false;
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorPseudoClassAndCompatibilityElementMapin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -14,6 +14,9 @@
</span><span class="cx"> corner-present
</span><span class="cx"> decrement
</span><span class="cx"> default
</span><ins>+#if ENABLE(CSS_SELECTORS_LEVEL4)
+dir(
+#endif
</ins><span class="cx"> disabled
</span><span class="cx"> double-button
</span><span class="cx"> empty
</span></span></pre></div>
<a id="trunkSourceWebCorecssjitSelectorCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (176544 => 176545)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2014-11-25 19:50:45 UTC (rev 176544)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2014-11-26 00:27:52 UTC (rev 176545)
</span><span class="lines">@@ -565,6 +565,7 @@
</span><span class="cx"> case CSSSelector::PseudoClassNthLastOfType:
</span><span class="cx"> case CSSSelector::PseudoClassDrag:
</span><span class="cx"> #if ENABLE(CSS_SELECTORS_LEVEL4)
</span><ins>+ case CSSSelector::PseudoClassDir:
</ins><span class="cx"> case CSSSelector::PseudoClassRole:
</span><span class="cx"> #endif
</span><span class="cx"> return FunctionType::CannotCompile;
</span></span></pre>
</div>
</div>
</body>
</html>