<!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>[172619] 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/172619">172619</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-08-14 21:06:27 -0700 (Thu, 14 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>CSS JIT: compile the :empty pseudo class
https://bugs.webkit.org/show_bug.cgi?id=135958

Reviewed by Andreas Kling.

Source/WebCore:

Compile :empty, nothing fancy.

Tests: fast/selectors/empty-basics.html
       fast/selectors/empty-long-adjacent-backtracking.html
       fast/selectors/empty-adjacent-style-update.html
       fast/selectors/empty-style-update.html

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::jumpIfElementIsNotEmpty):
(WebCore::SelectorCompiler::setElementStyleIsAffectedByEmpty):
(WebCore::SelectorCompiler::setElementStyleFromContextIsAffectedByEmptyAndUpdateRenderStyleIfNecessary):
(WebCore::SelectorCompiler::setElementStyleIsAffectedByEmptyAndUpdateRenderStyleIfNecessary):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsEmpty):
* dom/CharacterData.h:
(WebCore::CharacterData::dataMemoryOffset):
* dom/ContainerNode.h:
(WebCore::ContainerNode::firstChildMemoryOffset):
* dom/Node.h:
(WebCore::Node::flagIsText):

Source/WTF:

* wtf/text/StringImpl.h:
(WTF::StringImpl::lengthMemoryOffset):

LayoutTests:

Add some test coverage, :empty had very little testing.

The test empty-adjacent-style-update expose some problems with style update,
I will look into them separately.

* fast/selectors/empty-adjacent-style-update-expected.txt: Added.
* fast/selectors/empty-adjacent-style-update.html: Added.
* fast/selectors/empty-basics-expected.txt: Added.
* fast/selectors/empty-basics.html: Added.
* fast/selectors/empty-long-adjacent-backtracking-expected.txt: Added.
* fast/selectors/empty-long-adjacent-backtracking.html: Added.
* fast/selectors/empty-style-update-expected.txt: Added.
* fast/selectors/empty-style-update.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtftextStringImplh">trunk/Source/WTF/wtf/text/StringImpl.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssjitSelectorCompilercpp">trunk/Source/WebCore/cssjit/SelectorCompiler.cpp</a></li>
<li><a href="#trunkSourceWebCoredomCharacterDatah">trunk/Source/WebCore/dom/CharacterData.h</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodeh">trunk/Source/WebCore/dom/ContainerNode.h</a></li>
<li><a href="#trunkSourceWebCoredomNodeh">trunk/Source/WebCore/dom/Node.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastselectorsemptyadjacentstyleupdateexpectedtxt">trunk/LayoutTests/fast/selectors/empty-adjacent-style-update-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsemptyadjacentstyleupdatehtml">trunk/LayoutTests/fast/selectors/empty-adjacent-style-update.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsemptybasicsexpectedtxt">trunk/LayoutTests/fast/selectors/empty-basics-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsemptybasicshtml">trunk/LayoutTests/fast/selectors/empty-basics.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsemptylongadjacentbacktrackingexpectedtxt">trunk/LayoutTests/fast/selectors/empty-long-adjacent-backtracking-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsemptylongadjacentbacktrackinghtml">trunk/LayoutTests/fast/selectors/empty-long-adjacent-backtracking.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsemptystyleupdateexpectedtxt">trunk/LayoutTests/fast/selectors/empty-style-update-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsemptystyleupdatehtml">trunk/LayoutTests/fast/selectors/empty-style-update.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (172618 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-08-15 03:22:01 UTC (rev 172618)
+++ trunk/LayoutTests/ChangeLog        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2014-08-14  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        CSS JIT: compile the :empty pseudo class
+        https://bugs.webkit.org/show_bug.cgi?id=135958
+
+        Reviewed by Andreas Kling.
+
+        Add some test coverage, :empty had very little testing.
+
+        The test empty-adjacent-style-update expose some problems with style update,
+        I will look into them separately.
+
+        * fast/selectors/empty-adjacent-style-update-expected.txt: Added.
+        * fast/selectors/empty-adjacent-style-update.html: Added.
+        * fast/selectors/empty-basics-expected.txt: Added.
+        * fast/selectors/empty-basics.html: Added.
+        * fast/selectors/empty-long-adjacent-backtracking-expected.txt: Added.
+        * fast/selectors/empty-long-adjacent-backtracking.html: Added.
+        * fast/selectors/empty-style-update-expected.txt: Added.
+        * fast/selectors/empty-style-update.html: Added.
+
</ins><span class="cx"> 2014-08-14  Martin Hock  &lt;mhock@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         IndexedDB should respect SchemeRegistry's database access setting.
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsemptyadjacentstyleupdateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/empty-adjacent-style-update-expected.txt (0 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/empty-adjacent-style-update-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/empty-adjacent-style-update-expected.txt        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+Test the style with a :empty pseudo class used for a sibling of the styled element.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Initial state is emtpy.
+PASS getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+Adding a comment does not change the :empty state.
+PASS getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+Add an element as child make updates :empty.
+FAIL getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor should be rgb(255, 255, 255). Was rgb(1, 2, 3).
+FAIL getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor should be rgb(255, 255, 255). Was rgb(1, 2, 3).
+Adding an empty text node, this is still not empty because of the element.
+FAIL getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor should be rgb(255, 255, 255). Was rgb(1, 2, 3).
+FAIL getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor should be rgb(255, 255, 255). Was rgb(1, 2, 3).
+Removing the elements previously added should restore the :empty state.
+PASS getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+Adding a non empty text node makes the state non empty.
+FAIL getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor should be rgb(255, 255, 255). Was rgb(1, 2, 3).
+FAIL getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor should be rgb(255, 255, 255). Was rgb(1, 2, 3).
+Removing the last text child, back to being empty.
+PASS getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsemptyadjacentstyleupdatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/empty-adjacent-style-update.html (0 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/empty-adjacent-style-update.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/empty-adjacent-style-update.html        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+target {
+    background-color: white;
+}
+testcase:empty+target {
+    background-color: rgb(1, 2, 3);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div&gt;
+        &lt;testcase id=&quot;with-renderer&quot;&gt;&lt;/testcase&gt;
+        &lt;target id=&quot;target-with-renderer&quot;&gt;&lt;/target&gt;
+    &lt;/div&gt;
+    &lt;div style=&quot;display:none;&quot;&gt;
+        &lt;testcase id=&quot;without-renderer&quot;&gt;&lt;/testcase&gt;
+        &lt;target id=&quot;target-without-renderer&quot;&gt;&lt;/target&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test the style with a :empty pseudo class used for a sibling of the styled element.');
+
+var testCaseWithRender = document.getElementById(&quot;with-renderer&quot;);
+var testCaseWithoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+
+debug(&quot;Initial state is emtpy.&quot;);
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+
+debug(&quot;Adding a comment does not change the :empty state.&quot;);
+testCaseWithRender.appendChild(document.createComment(&quot;WebKit!&quot;));
+testCaseWithoutRenderer.appendChild(document.createComment(&quot;WebKit!&quot;));
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+
+debug(&quot;Add an element as child make updates :empty.&quot;);
+var elementForCaseWithRenderer = document.createElement('div');
+var elementForCaseWithoutRenderer = document.createElement('div');
+testCaseWithRender.appendChild(elementForCaseWithRenderer);
+testCaseWithoutRenderer.appendChild(elementForCaseWithoutRenderer);
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+
+debug(&quot;Adding an empty text node, this is still not empty because of the element.&quot;);
+testCaseWithRender.appendChild(document.createTextNode(''));
+testCaseWithoutRenderer.appendChild(document.createTextNode(''));
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+
+debug(&quot;Removing the elements previously added should restore the :empty state.&quot;);
+testCaseWithRender.removeChild(elementForCaseWithRenderer);
+testCaseWithoutRenderer.removeChild(elementForCaseWithoutRenderer);
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+
+debug(&quot;Adding a non empty text node makes the state non empty.&quot;);
+testCaseWithRender.appendChild(document.createTextNode('WebKit!'));
+testCaseWithoutRenderer.appendChild(document.createTextNode('WebKit!'));
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+
+debug(&quot;Removing the last text child, back to being empty.&quot;);
+testCaseWithRender.removeChild(testCaseWithRender.lastChild);
+testCaseWithoutRenderer.removeChild(testCaseWithoutRenderer.lastChild);
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-with-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;target-without-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsemptybasicsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/empty-basics-expected.txt (0 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/empty-basics-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/empty-basics-expected.txt        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Check the basic features of the &quot;:empty&quot; pseudo class.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.querySelectorAll(&quot;testcase:empty&quot;).length is 4
+PASS document.querySelectorAll(&quot;testcase:empty&quot;)[0] is document.getElementById(&quot;no-content&quot;)
+PASS document.querySelectorAll(&quot;testcase:empty&quot;)[1] is document.getElementById(&quot;comment&quot;)
+PASS document.querySelectorAll(&quot;testcase:empty&quot;)[2] is document.getElementById(&quot;empty-textnodes&quot;)
+PASS document.querySelectorAll(&quot;testcase:empty&quot;)[3] is document.getElementById(&quot;comments-and-empty-textnodes&quot;)
+PASS getComputedStyle(document.getElementById(&quot;no-content&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;comment&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;empty-textnodes&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;comments-and-empty-textnodes&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;space-character&quot;)).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.getElementById(&quot;element&quot;)).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsemptybasicshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/empty-basics.html (0 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/empty-basics.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/empty-basics.html        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+testcase {
+    background-color: white;
+}
+testcase:empty {
+    background-color: rgb(1, 2, 3);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div style=&quot;display:none&quot;&gt;
+        &lt;!-- Success: No content --&gt;
+        &lt;testcase id=&quot;no-content&quot;&gt;&lt;/testcase&gt;
+
+        &lt;!-- Success: Comments are not elment --&gt;
+        &lt;testcase id=&quot;comment&quot;&gt;&lt;!-- empty --&gt;&lt;/testcase&gt;
+
+        &lt;!-- Success: Empty text node are okay. --&gt;
+        &lt;testcase id=&quot;empty-textnodes&quot;&gt;&lt;/testcase&gt;
+
+        &lt;!-- Success: The two above. --&gt;
+        &lt;testcase id=&quot;comments-and-empty-textnodes&quot;&gt;&lt;/testcase&gt;
+
+        &lt;!-- Failure: Non empty text node, there is a space character. --&gt;
+        &lt;testcase id=&quot;space-character&quot;&gt; &lt;/testcase&gt;
+
+        &lt;!-- Failure: the &lt;span&gt; element inside makes the node non-empty. --&gt;
+        &lt;testcase id=&quot;element&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/testcase&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Check the basic features of the &quot;:empty&quot; pseudo class.');
+
+var emptyTextnodes = document.getElementById(&quot;empty-textnodes&quot;);
+for (var i = 0; i &lt; 10; ++i)
+    emptyTextnodes.appendChild(document.createTextNode(&quot;&quot;));
+
+var commentsAndEmptyTextnodes = document.getElementById(&quot;comments-and-empty-textnodes&quot;);
+for (var i = 0; i &lt; 10; ++i) {
+    commentsAndEmptyTextnodes.appendChild(document.createTextNode(&quot;&quot;));
+    commentsAndEmptyTextnodes.appendChild(document.createComment(&quot;WebKit!&quot;));
+}
+
+shouldBe('document.querySelectorAll(&quot;testcase:empty&quot;).length', '4');
+shouldBe('document.querySelectorAll(&quot;testcase:empty&quot;)[0]', 'document.getElementById(&quot;no-content&quot;)');
+shouldBe('document.querySelectorAll(&quot;testcase:empty&quot;)[1]', 'document.getElementById(&quot;comment&quot;)');
+shouldBe('document.querySelectorAll(&quot;testcase:empty&quot;)[2]', 'document.getElementById(&quot;empty-textnodes&quot;)');
+shouldBe('document.querySelectorAll(&quot;testcase:empty&quot;)[3]', 'document.getElementById(&quot;comments-and-empty-textnodes&quot;)');
+
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;no-content&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;comment&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;empty-textnodes&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;comments-and-empty-textnodes&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;space-character&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;element&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsemptylongadjacentbacktrackingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/empty-long-adjacent-backtracking-expected.txt (0 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/empty-long-adjacent-backtracking-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/empty-long-adjacent-backtracking-expected.txt        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+Test backtracking of a long chain of :empty siblings to catch any issue with register allocation.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.querySelectorAll(&quot;:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty)&quot;).length is 3
+PASS document.querySelectorAll(&quot;:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty)&quot;)[0] is document.getElementById(&quot;target1&quot;)
+PASS document.querySelectorAll(&quot;:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty)&quot;)[1] is document.getElementById(&quot;target2&quot;)
+PASS document.querySelectorAll(&quot;:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty)&quot;)[2] is document.getElementById(&quot;target3&quot;)
+PASS document.querySelectorAll(&quot;:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty)&gt;target-child&quot;).length is 1
+PASS document.querySelectorAll(&quot;:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty)&gt;target-child&quot;)[0] is document.getElementById(&quot;target4&quot;)
+PASS document.querySelectorAll(&quot;testcase&quot;).length is 61
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[0]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[1]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[2]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[3]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[4]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[5]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[6]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[7]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[8]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[9]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[10]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[11]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[12]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[13]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[14]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[15]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[16]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[17]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[18]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[19]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[20]).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[21]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[22]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[23]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[24]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[25]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[26]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[27]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[28]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[29]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[30]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[31]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[32]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[33]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[34]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[35]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[36]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[37]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[38]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[39]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[40]).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[41]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[42]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[43]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[44]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[45]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[46]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[47]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[48]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[49]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[50]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[51]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[52]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[53]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[54]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[55]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[56]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[57]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[58]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[59]).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[60]).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsemptylongadjacentbacktrackinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/empty-long-adjacent-backtracking.html (0 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/empty-long-adjacent-backtracking.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/empty-long-adjacent-backtracking.html        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -0,0 +1,109 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+testcase {
+    background-color: white;
+}
+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty) {
+    background-color: rgb(1, 2, 3);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div style=&quot;display:none&quot;&gt;
+        &lt;!-- 20 empty --&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+
+        &lt;testcase id=target1&gt;&lt;foobar&gt;&lt;/foobar&gt;&lt;/testcase&gt;
+
+        &lt;!-- 19 empty --&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+
+        &lt;testcase id=target2&gt;Not Empty!&lt;/testcase&gt;
+
+        &lt;!-- 19 empty --&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+        &lt;testcase class=empty&gt;&lt;/testcase&gt;
+
+        &lt;testcase id=&quot;target3&quot;&gt;
+            &lt;target-child id=&quot;target4&quot;&gt;&lt;/target-child&gt;
+        &lt;/testcase&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test backtracking of a long chain of :empty siblings to catch any issue with register allocation.');
+
+shouldBe('document.querySelectorAll(&quot;:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty)&quot;).length', '3');
+shouldBe('document.querySelectorAll(&quot;:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty)&quot;)[0]', 'document.getElementById(&quot;target1&quot;)');
+shouldBe('document.querySelectorAll(&quot;:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty)&quot;)[1]', 'document.getElementById(&quot;target2&quot;)');
+shouldBe('document.querySelectorAll(&quot;:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty)&quot;)[2]', 'document.getElementById(&quot;target3&quot;)');
+
+shouldBe('document.querySelectorAll(&quot;:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty)&gt;target-child&quot;).length', '1');
+shouldBe('document.querySelectorAll(&quot;:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty+:empty~:not(:empty)&gt;target-child&quot;)[0]', 'document.getElementById(&quot;target4&quot;)');
+
+shouldBe('document.querySelectorAll(&quot;testcase&quot;).length', '61')
+
+var allTestCases = document.querySelectorAll(&quot;testcase&quot;);
+for (var i = 0; i &lt; 61; ++i)
+    shouldBeEqualToString('getComputedStyle(document.querySelectorAll(&quot;testcase&quot;)[' + i + ']).backgroundColor', allTestCases[i].classList.contains('empty') ? 'rgb(255, 255, 255)' : 'rgb(1, 2, 3)');
+
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsemptystyleupdateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/empty-style-update-expected.txt (0 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/empty-style-update-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/empty-style-update-expected.txt        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+Test the style update with the :empty pseudo class.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Initial state is emtpy.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+Adding a comment does not change the :empty state.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+Add an element as child make updates :empty.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+Adding an empty text node, this is still not empty because of the element.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+Removing the elements previously added should restore the :empty state.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+Adding a non empty text node makes the state non empty.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor is &quot;rgb(255, 255, 255)&quot;
+Removing the last text child, back to being empty.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsemptystyleupdatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/empty-style-update.html (0 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/empty-style-update.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/empty-style-update.html        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+testcase {
+    background-color: white;
+}
+testcase:empty {
+    background-color: rgb(1, 2, 3);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div&gt;
+        &lt;testcase id=&quot;with-renderer&quot;&gt;&lt;/testcase&gt;
+    &lt;/div&gt;
+    &lt;div style=&quot;display:none;&quot;&gt;
+        &lt;testcase id=&quot;without-renderer&quot;&gt;&lt;/testcase&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test the style update with the :empty pseudo class.');
+
+var testCaseWithRender = document.getElementById(&quot;with-renderer&quot;);
+var testCaseWithoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+
+debug(&quot;Initial state is emtpy.&quot;);
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+
+debug(&quot;Adding a comment does not change the :empty state.&quot;);
+testCaseWithRender.appendChild(document.createComment(&quot;WebKit!&quot;));
+testCaseWithoutRenderer.appendChild(document.createComment(&quot;WebKit!&quot;));
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+
+debug(&quot;Add an element as child make updates :empty.&quot;);
+var elementForCaseWithRenderer = document.createElement('div');
+var elementForCaseWithoutRenderer = document.createElement('div');
+testCaseWithRender.appendChild(elementForCaseWithRenderer);
+testCaseWithoutRenderer.appendChild(elementForCaseWithoutRenderer);
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+
+debug(&quot;Adding an empty text node, this is still not empty because of the element.&quot;);
+testCaseWithRender.appendChild(document.createTextNode(''));
+testCaseWithoutRenderer.appendChild(document.createTextNode(''));
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+
+debug(&quot;Removing the elements previously added should restore the :empty state.&quot;);
+testCaseWithRender.removeChild(elementForCaseWithRenderer);
+testCaseWithoutRenderer.removeChild(elementForCaseWithoutRenderer);
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+
+debug(&quot;Adding a non empty text node makes the state non empty.&quot;);
+testCaseWithRender.appendChild(document.createTextNode('WebKit!'));
+testCaseWithoutRenderer.appendChild(document.createTextNode('WebKit!'));
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor', 'rgb(255, 255, 255)');
+
+debug(&quot;Removing the last text child, back to being empty.&quot;);
+testCaseWithRender.removeChild(testCaseWithRender.lastChild);
+testCaseWithoutRenderer.removeChild(testCaseWithoutRenderer.lastChild);
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).backgroundColor', 'rgb(1, 2, 3)');
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (172618 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2014-08-15 03:22:01 UTC (rev 172618)
+++ trunk/Source/WTF/ChangeLog        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-08-14  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        CSS JIT: compile the :empty pseudo class
+        https://bugs.webkit.org/show_bug.cgi?id=135958
+
+        Reviewed by Andreas Kling.
+
+        * wtf/text/StringImpl.h:
+        (WTF::StringImpl::lengthMemoryOffset):
+
</ins><span class="cx"> 2014-08-12  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Elements whose contents start with an astral Unicode symbol disappear when CSS `::first-letter` is applied to them
</span></span></pre></div>
<a id="trunkSourceWTFwtftextStringImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/StringImpl.h (172618 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/StringImpl.h        2014-08-15 03:22:01 UTC (rev 172618)
+++ trunk/Source/WTF/wtf/text/StringImpl.h        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -412,6 +412,7 @@
</span><span class="cx">     WTF_EXPORT_STRING_API static PassRef&lt;StringImpl&gt; adopt(StringBuffer&lt;LChar&gt;&amp;);
</span><span class="cx"> 
</span><span class="cx">     unsigned length() const { return m_length; }
</span><ins>+    static ptrdiff_t lengthMemoryOffset() { return OBJECT_OFFSETOF(StringImpl, m_length); }
</ins><span class="cx">     bool is8Bit() const { return m_hashAndFlags &amp; s_hashFlag8BitBuffer; }
</span><span class="cx"> 
</span><span class="cx">     ALWAYS_INLINE const LChar* characters8() const { ASSERT(is8Bit()); return m_data8; }
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (172618 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-15 03:22:01 UTC (rev 172618)
+++ trunk/Source/WebCore/ChangeLog        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2014-08-14  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        CSS JIT: compile the :empty pseudo class
+        https://bugs.webkit.org/show_bug.cgi?id=135958
+
+        Reviewed by Andreas Kling.
+
+        Compile :empty, nothing fancy.
+
+        Tests: fast/selectors/empty-basics.html
+               fast/selectors/empty-long-adjacent-backtracking.html
+               fast/selectors/empty-adjacent-style-update.html
+               fast/selectors/empty-style-update.html
+
+        * cssjit/SelectorCompiler.cpp:
+        (WebCore::SelectorCompiler::addPseudoClassType):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
+        (WebCore::SelectorCompiler::jumpIfElementIsNotEmpty):
+        (WebCore::SelectorCompiler::setElementStyleIsAffectedByEmpty):
+        (WebCore::SelectorCompiler::setElementStyleFromContextIsAffectedByEmptyAndUpdateRenderStyleIfNecessary):
+        (WebCore::SelectorCompiler::setElementStyleIsAffectedByEmptyAndUpdateRenderStyleIfNecessary):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsEmpty):
+        * dom/CharacterData.h:
+        (WebCore::CharacterData::dataMemoryOffset):
+        * dom/ContainerNode.h:
+        (WebCore::ContainerNode::firstChildMemoryOffset):
+        * dom/Node.h:
+        (WebCore::Node::flagIsText):
+
</ins><span class="cx"> 2014-08-14  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Implement scroll snapping animations on Mac
</span></span></pre></div>
<a id="trunkSourceWebCorecssjitSelectorCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (172618 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2014-08-15 03:22:01 UTC (rev 172618)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -238,6 +238,7 @@
</span><span class="cx">     void generateElementFunctionCallTest(Assembler::JumpList&amp; failureCases, JSC::FunctionPtr);
</span><span class="cx">     void generateContextFunctionCallTest(Assembler::JumpList&amp; failureCases, JSC::FunctionPtr);
</span><span class="cx">     void generateElementIsActive(Assembler::JumpList&amp; failureCases, const SelectorFragment&amp;);
</span><ins>+    void generateElementIsEmpty(Assembler::JumpList&amp; failureCases, const SelectorFragment&amp;);
</ins><span class="cx">     void generateElementIsFirstChild(Assembler::JumpList&amp; failureCases, const SelectorFragment&amp;);
</span><span class="cx">     void generateElementIsHovered(Assembler::JumpList&amp; failureCases, const SelectorFragment&amp;);
</span><span class="cx">     void generateElementIsInLanguage(Assembler::JumpList&amp; failureCases, const AtomicString&amp;);
</span><span class="lines">@@ -497,7 +498,6 @@
</span><span class="cx">         return FunctionType::CannotMatchAnything;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Compile these pseudoclasses, too!
</span><del>-    case CSSSelector::PseudoClassEmpty:
</del><span class="cx">     case CSSSelector::PseudoClassFirstOfType:
</span><span class="cx">     case CSSSelector::PseudoClassLastOfType:
</span><span class="cx">     case CSSSelector::PseudoClassOnlyOfType:
</span><span class="lines">@@ -529,6 +529,7 @@
</span><span class="cx">         return FunctionType::SelectorCheckerWithCheckingContext;
</span><span class="cx"> 
</span><span class="cx">     case CSSSelector::PseudoClassActive:
</span><ins>+    case CSSSelector::PseudoClassEmpty:
</ins><span class="cx">     case CSSSelector::PseudoClassFirstChild:
</span><span class="cx">     case CSSSelector::PseudoClassHover:
</span><span class="cx">     case CSSSelector::PseudoClassLastChild:
</span><span class="lines">@@ -1963,6 +1964,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (fragment.pseudoClasses.contains(CSSSelector::PseudoClassActive))
</span><span class="cx">         generateElementIsActive(matchingPostTagNameFailureCases, fragment);
</span><ins>+    if (fragment.pseudoClasses.contains(CSSSelector::PseudoClassEmpty))
+        generateElementIsEmpty(matchingPostTagNameFailureCases, fragment);
</ins><span class="cx">     if (fragment.pseudoClasses.contains(CSSSelector::PseudoClassHover))
</span><span class="cx">         generateElementIsHovered(matchingPostTagNameFailureCases, fragment);
</span><span class="cx">     if (fragment.pseudoClasses.contains(CSSSelector::PseudoClassOnlyChild))
</span><span class="lines">@@ -2459,6 +2462,97 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void jumpIfElementIsNotEmpty(Assembler&amp; assembler, RegisterAllocator&amp; registerAllocator, Assembler::JumpList&amp; notEmptyCases, Assembler::RegisterID element)
+{
+    LocalRegister currentChild(registerAllocator);
+    assembler.loadPtr(Assembler::Address(element, ContainerNode::firstChildMemoryOffset()), currentChild);
+
+    Assembler::Label loopStart(assembler.label());
+    Assembler::Jump noMoreChildren = assembler.branchTestPtr(Assembler::Zero, currentChild);
+
+    notEmptyCases.append(testIsElementFlagOnNode(Assembler::NonZero, assembler, currentChild));
+
+    {
+        Assembler::Jump skipTextNodeCheck = assembler.branchTest32(Assembler::Zero, Assembler::Address(currentChild, Node::nodeFlagsMemoryOffset()), Assembler::TrustedImm32(Node::flagIsText()));
+
+        LocalRegister textStringImpl(registerAllocator);
+        assembler.loadPtr(Assembler::Address(currentChild, CharacterData::dataMemoryOffset()), textStringImpl);
+        notEmptyCases.append(assembler.branchTest32(Assembler::NonZero, Assembler::Address(textStringImpl, StringImpl::lengthMemoryOffset())));
+
+        skipTextNodeCheck.link(&amp;assembler);
+    }
+
+    assembler.loadPtr(Assembler::Address(currentChild, Node::nextSiblingMemoryOffset()), currentChild);
+    assembler.jump().linkTo(loopStart, &amp;assembler);
+
+    noMoreChildren.link(&amp;assembler);
+}
+
+static void setElementStyleIsAffectedByEmpty(Element* element)
+{
+    element-&gt;setStyleAffectedByEmpty();
+}
+
+static void setElementStyleFromContextIsAffectedByEmptyAndUpdateRenderStyleIfNecessary(CheckingContext* context, bool isEmpty)
+{
+    ASSERT(context-&gt;elementStyle);
+    context-&gt;elementStyle-&gt;setEmptyState(isEmpty);
+}
+
+static void setElementStyleIsAffectedByEmptyAndUpdateRenderStyleIfNecessary(Element* element, bool isEmpty)
+{
+    element-&gt;setStyleAffectedByEmpty();
+
+    if (element-&gt;renderStyle() &amp;&amp; (element-&gt;document().styleSheetCollection().usesSiblingRules() || element-&gt;renderStyle()-&gt;unique()))
+        element-&gt;renderStyle()-&gt;setEmptyState(isEmpty);
+}
+
+void SelectorCodeGenerator::generateElementIsEmpty(Assembler::JumpList&amp; failureCases, const SelectorFragment&amp; fragment)
+{
+    if (m_selectorContext == SelectorContext::QuerySelector) {
+        jumpIfElementIsNotEmpty(m_assembler, m_registerAllocator, failureCases, elementAddressRegister);
+        return;
+    }
+
+    LocalRegisterWithPreference isEmptyResults(m_registerAllocator, JSC::GPRInfo::argumentGPR1);
+    m_assembler.move(Assembler::TrustedImm32(0), isEmptyResults);
+
+    Assembler::JumpList notEmpty;
+    jumpIfElementIsNotEmpty(m_assembler, m_registerAllocator, notEmpty, elementAddressRegister);
+    m_assembler.move(Assembler::TrustedImm32(1), isEmptyResults);
+    notEmpty.link(&amp;m_assembler);
+
+    Assembler::Jump skipMarking;
+    if (shouldUseRenderStyleFromCheckingContext(m_selectorContext, fragment)) {
+        {
+            LocalRegister checkingContext(m_registerAllocator);
+            skipMarking = jumpIfNotResolvingStyle(checkingContext);
+
+            FunctionCall functionCall(m_assembler, m_registerAllocator, m_stackAllocator, m_functionCalls);
+            functionCall.setFunctionAddress(setElementStyleFromContextIsAffectedByEmptyAndUpdateRenderStyleIfNecessary);
+            functionCall.setTwoArguments(checkingContext, isEmptyResults);
+            functionCall.call();
+        }
+
+        FunctionCall functionCall(m_assembler, m_registerAllocator, m_stackAllocator, m_functionCalls);
+        functionCall.setFunctionAddress(setElementStyleIsAffectedByEmpty);
+        functionCall.setOneArgument(elementAddressRegister);
+        functionCall.call();
+    } else {
+        {
+            LocalRegister checkingContext(m_registerAllocator);
+            skipMarking = jumpIfNotResolvingStyle(checkingContext);
+        }
+        FunctionCall functionCall(m_assembler, m_registerAllocator, m_stackAllocator, m_functionCalls);
+        functionCall.setFunctionAddress(setElementStyleIsAffectedByEmptyAndUpdateRenderStyleIfNecessary);
+        functionCall.setTwoArguments(elementAddressRegister, isEmptyResults);
+        functionCall.call();
+    }
+    skipMarking.link(&amp;m_assembler);
+
+    failureCases.append(m_assembler.branchTest32(Assembler::Zero, isEmptyResults));
+}
+
</ins><span class="cx"> void SelectorCodeGenerator::generateElementIsFirstChild(Assembler::JumpList&amp; failureCases, const SelectorFragment&amp; fragment)
</span><span class="cx"> {
</span><span class="cx">     if (m_selectorContext == SelectorContext::QuerySelector) {
</span></span></pre></div>
<a id="trunkSourceWebCoredomCharacterDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CharacterData.h (172618 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CharacterData.h        2014-08-15 03:22:01 UTC (rev 172618)
+++ trunk/Source/WebCore/dom/CharacterData.h        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx"> class CharacterData : public Node {
</span><span class="cx"> public:
</span><span class="cx">     String data() const { return m_data; }
</span><ins>+    static ptrdiff_t dataMemoryOffset() { return OBJECT_OFFSETOF(CharacterData, m_data); }
+
</ins><span class="cx">     void setData(const String&amp;, ExceptionCode&amp;);
</span><span class="cx">     unsigned length() const { return m_data.length(); }
</span><span class="cx">     String substringData(unsigned offset, unsigned count, ExceptionCode&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.h (172618 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.h        2014-08-15 03:22:01 UTC (rev 172618)
+++ trunk/Source/WebCore/dom/ContainerNode.h        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -84,6 +84,7 @@
</span><span class="cx">     virtual ~ContainerNode();
</span><span class="cx"> 
</span><span class="cx">     Node* firstChild() const { return m_firstChild; }
</span><ins>+    static ptrdiff_t firstChildMemoryOffset() { return OBJECT_OFFSETOF(ContainerNode, m_firstChild); }
</ins><span class="cx">     Node* lastChild() const { return m_lastChild; }
</span><span class="cx">     bool hasChildNodes() const { return m_firstChild; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (172618 => 172619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2014-08-15 03:22:01 UTC (rev 172618)
+++ trunk/Source/WebCore/dom/Node.h        2014-08-15 04:06:27 UTC (rev 172619)
</span><span class="lines">@@ -572,6 +572,7 @@
</span><span class="cx"> #if ENABLE(CSS_SELECTOR_JIT)
</span><span class="cx">     static ptrdiff_t nodeFlagsMemoryOffset() { return OBJECT_OFFSETOF(Node, m_nodeFlags); }
</span><span class="cx">     static ptrdiff_t rareDataMemoryOffset() { return OBJECT_OFFSETOF(Node, m_data.m_rareData); }
</span><ins>+    static int32_t flagIsText() { return IsTextFlag; }
</ins><span class="cx">     static int32_t flagIsElement() { return IsElementFlag; }
</span><span class="cx">     static int32_t flagIsHTML() { return IsHTMLFlag; }
</span><span class="cx">     static int32_t flagIsLink() { return IsLinkFlag; }
</span></span></pre>
</div>
</div>

</body>
</html>