<!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>[202358] 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/202358">202358</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-06-22 16:35:25 -0700 (Wed, 22 Jun 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>AX: Add support for CSS4 :focus-within pseudo
https://bugs.webkit.org/show_bug.cgi?id=140144
Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-06-22
Reviewed by Antti Koivisto.
Source/WebCore:
Tests: fast/css/pseudo-focus-within-basics.html
fast/css/pseudo-focus-within-inside-shadow-dom.html
fast/css/pseudo-focus-within-style-sharing-1.html
fast/css/pseudo-focus-within-style-sharing-2.html
fast/selectors/focus-within-style-update.html
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasFocusWithin):
* dom/ContainerNode.cpp:
(WebCore::destroyRenderTreeIfNeeded):
* dom/Element.cpp:
(WebCore::Element::~Element):
(WebCore::Element::setFocus):
(WebCore::Element::unregisterNamedFlowContentElement):
(WebCore::Element::setIsNamedFlowContentElement):
(WebCore::Element::clearIsNamedFlowContentElement):
(WebCore::Element::setStyleAffectedByFocusWithin):
(WebCore::Element::rareDataStyleAffectedByFocusWithin):
(WebCore::Element::rareDataIsNamedFlowContentElement):
* dom/Element.h:
(WebCore::Element::hasFocusWithin):
(WebCore::Element::styleAffectedByFocusWithin):
(WebCore::Element::isNamedFlowContentElement):
(WebCore::Element::setHasFocusWithin):
* dom/ElementRareData.h:
(WebCore::ElementRareData::styleAffectedByFocusWithin):
(WebCore::ElementRareData::setStyleAffectedByFocusWithin):
(WebCore::ElementRareData::isNamedFlowContentElement):
(WebCore::ElementRareData::setIsNamedFlowContentElement):
(WebCore::ElementRareData::ElementRareData):
(WebCore::ElementRareData::resetComputedStyle):
* dom/Node.h:
(WebCore::Node::flagHasFocusWithin):
(WebCore::Node::isNamedFlowContentNode): Deleted.
(WebCore::Node::setIsNamedFlowContentNode): Deleted.
(WebCore::Node::clearIsNamedFlowContentNode): Deleted.
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::clearContentElements):
(WebCore::RenderNamedFlowThread::registerNamedFlowContentElement):
(WebCore::RenderNamedFlowThread::unregisterNamedFlowContentElement):
(WebCore::nextNodeInsideContentElement):
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
* style/StyleRelations.cpp:
(WebCore::Style::commitRelationsToRenderStyle):
(WebCore::Style::commitRelations):
* style/StyleRelations.h:
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement):
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/css/pseudo-focus-within-basics-expected.html: Added.
* fast/css/pseudo-focus-within-basics.html: Added.
* fast/css/pseudo-focus-within-inside-shadow-dom-expected.html: Added.
* fast/css/pseudo-focus-within-inside-shadow-dom.html: Added.
* fast/css/pseudo-focus-within-style-sharing-1-expected.html: Added.
* fast/css/pseudo-focus-within-style-sharing-1.html: Added.
* fast/css/pseudo-focus-within-style-sharing-2-expected.html: Added.
* fast/css/pseudo-focus-within-style-sharing-2.html: Added.
* fast/selectors/focus-within-style-update-expected.txt: Added.
* fast/selectors/focus-within-style-update.html: Added.</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="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCoredomElementRareDatah">trunk/Source/WebCore/dom/ElementRareData.h</a></li>
<li><a href="#trunkSourceWebCoredomNodeh">trunk/Source/WebCore/dom/Node.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderNamedFlowThreadcpp">trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreeUpdatercpp">trunk/Source/WebCore/style/RenderTreeUpdater.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleRelationscpp">trunk/Source/WebCore/style/StyleRelations.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleRelationsh">trunk/Source/WebCore/style/StyleRelations.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleSharingResolvercpp">trunk/Source/WebCore/style/StyleSharingResolver.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcsspseudofocuswithinbasicsexpectedhtml">trunk/LayoutTests/fast/css/pseudo-focus-within-basics-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudofocuswithinbasicshtml">trunk/LayoutTests/fast/css/pseudo-focus-within-basics.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudofocuswithininsideshadowdomexpectedhtml">trunk/LayoutTests/fast/css/pseudo-focus-within-inside-shadow-dom-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudofocuswithininsideshadowdomhtml">trunk/LayoutTests/fast/css/pseudo-focus-within-inside-shadow-dom.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudofocuswithinstylesharing1expectedhtml">trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-1-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudofocuswithinstylesharing1html">trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-1.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudofocuswithinstylesharing2expectedhtml">trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-2-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudofocuswithinstylesharing2html">trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-2.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsfocuswithinstyleupdateexpectedtxt">trunk/LayoutTests/fast/selectors/focus-within-style-update-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsfocuswithinstyleupdatehtml">trunk/LayoutTests/fast/selectors/focus-within-style-update.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsfocuswithinwithselectorcheckerexpectedtxt">trunk/LayoutTests/fast/selectors/focus-within-with-selector-checker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsfocuswithinwithselectorcheckerhtml">trunk/LayoutTests/fast/selectors/focus-within-with-selector-checker.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/LayoutTests/ChangeLog        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-06-22 Benjamin Poulain <bpoulain@apple.com>
+
+ AX: Add support for CSS4 :focus-within pseudo
+ https://bugs.webkit.org/show_bug.cgi?id=140144
+
+ Reviewed by Antti Koivisto.
+
+ * 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/css/pseudo-focus-within-basics-expected.html: Added.
+ * fast/css/pseudo-focus-within-basics.html: Added.
+ * fast/css/pseudo-focus-within-inside-shadow-dom-expected.html: Added.
+ * fast/css/pseudo-focus-within-inside-shadow-dom.html: Added.
+ * fast/css/pseudo-focus-within-style-sharing-1-expected.html: Added.
+ * fast/css/pseudo-focus-within-style-sharing-1.html: Added.
+ * fast/css/pseudo-focus-within-style-sharing-2-expected.html: Added.
+ * fast/css/pseudo-focus-within-style-sharing-2.html: Added.
+ * fast/selectors/focus-within-style-update-expected.txt: Added.
+ * fast/selectors/focus-within-style-update.html: Added.
+
</ins><span class="cx"> 2016-06-17 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION: Double tap to zoom does not work on yahoo finance
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscssselectortextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-selector-text-expected.txt (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-selector-text-expected.txt        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/LayoutTests/fast/css/css-selector-text-expected.txt        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -216,6 +216,26 @@
</span><span class="cx"> PASS parseThenSerializeRule('a#b::-webkit-input-placeholder { }') is 'a#b::-webkit-input-placeholder { }'
</span><span class="cx"> PASS parseThenSerializeRule('a[b].c#d::-webkit-input-placeholder { }') is 'a[b].c#d::-webkit-input-placeholder { }'
</span><span class="cx">
</span><ins>+PASS parseThenSerializeRule('a[b]:default { }') is 'a[b]:default { }'
+PASS parseThenSerializeRule('a.b:default { }') is 'a.b:default { }'
+PASS parseThenSerializeRule('a#b:default { }') is 'a#b:default { }'
+PASS parseThenSerializeRule('a[b].c#d:default { }') is 'a[b].c#d:default { }'
+
+PASS parseThenSerializeRule('a[b]:in-range { }') is 'a[b]:in-range { }'
+PASS parseThenSerializeRule('a.b:in-range { }') is 'a.b:in-range { }'
+PASS parseThenSerializeRule('a#b:in-range { }') is 'a#b:in-range { }'
+PASS parseThenSerializeRule('a[b].c#d:in-range { }') is 'a[b].c#d:in-range { }'
+
+PASS parseThenSerializeRule('a[b]:out-of-range { }') is 'a[b]:out-of-range { }'
+PASS parseThenSerializeRule('a.b:out-of-range { }') is 'a.b:out-of-range { }'
+PASS parseThenSerializeRule('a#b:out-of-range { }') is 'a#b:out-of-range { }'
+PASS parseThenSerializeRule('a[b].c#d:out-of-range { }') is 'a[b].c#d:out-of-range { }'
+
+PASS parseThenSerializeRule('a[b]:focus-within { }') is 'a[b]:focus-within { }'
+PASS parseThenSerializeRule('a.b:focus-within { }') is 'a.b:focus-within { }'
+PASS parseThenSerializeRule('a#b:focus-within { }') is 'a#b:focus-within { }'
+PASS parseThenSerializeRule('a[b].c#d:focus-within { }') is 'a[b].c#d:focus-within { }'
+
</ins><span class="cx"> PASS parseThenSerializeRule('input:not([type="file"]):focus { }') is 'input:not([type="file"]):focus { }'
</span><span class="cx"> PASS parseThenSerializeRule(':-webkit-any([type="file"]) { }') is ':-webkit-any([type="file"]) { }'
</span><span class="cx"> PASS parseThenSerializeRule(':-webkit-any(:hover) { }') is ':-webkit-any(:hover) { }'
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscssselectortexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-selector-text.html (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-selector-text.html        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/LayoutTests/fast/css/css-selector-text.html        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -307,6 +307,34 @@
</span><span class="cx">
</span><span class="cx"> debug('');
</span><span class="cx">
</span><ins>+testSelectorRoundTrip("a[b]:default");
+testSelectorRoundTrip("a.b:default");
+testSelectorRoundTrip("a#b:default");
+testSelectorRoundTrip("a[b].c#d:default");
+
+debug('');
+
+testSelectorRoundTrip("a[b]:in-range");
+testSelectorRoundTrip("a.b:in-range");
+testSelectorRoundTrip("a#b:in-range");
+testSelectorRoundTrip("a[b].c#d:in-range");
+
+debug('');
+
+testSelectorRoundTrip("a[b]:out-of-range");
+testSelectorRoundTrip("a.b:out-of-range");
+testSelectorRoundTrip("a#b:out-of-range");
+testSelectorRoundTrip("a[b].c#d:out-of-range");
+
+debug('');
+
+testSelectorRoundTrip("a[b]:focus-within");
+testSelectorRoundTrip("a.b:focus-within");
+testSelectorRoundTrip("a#b:focus-within");
+testSelectorRoundTrip("a[b].c#d:focus-within");
+
+debug('');
+
</ins><span class="cx"> testSelectorRoundTrip('input:not([type="file"]):focus');
</span><span class="cx"> testSelectorRoundTrip(':-webkit-any([type="file"])');
</span><span class="cx"> testSelectorRoundTrip(':-webkit-any(:hover)');
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscsssetselectortextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -218,6 +218,26 @@
</span><span class="cx"> PASS setThenReadSelectorText('a#b::-webkit-input-placeholder') is 'a#b::-webkit-input-placeholder'
</span><span class="cx"> PASS setThenReadSelectorText('a[b].c#d::-webkit-input-placeholder') is 'a[b].c#d::-webkit-input-placeholder'
</span><span class="cx">
</span><ins>+PASS setThenReadSelectorText('a[b]:default') is 'a[b]:default'
+PASS setThenReadSelectorText('a.b:default') is 'a.b:default'
+PASS setThenReadSelectorText('a#b:default') is 'a#b:default'
+PASS setThenReadSelectorText('a[b].c#d:default') is 'a[b].c#d:default'
+
+PASS setThenReadSelectorText('a[b]:in-range') is 'a[b]:in-range'
+PASS setThenReadSelectorText('a.b:in-range') is 'a.b:in-range'
+PASS setThenReadSelectorText('a#b:in-range') is 'a#b:in-range'
+PASS setThenReadSelectorText('a[b].c#d:in-range') is 'a[b].c#d:in-range'
+
+PASS setThenReadSelectorText('a[b]:out-of-range') is 'a[b]:out-of-range'
+PASS setThenReadSelectorText('a.b:out-of-range') is 'a.b:out-of-range'
+PASS setThenReadSelectorText('a#b:out-of-range') is 'a#b:out-of-range'
+PASS setThenReadSelectorText('a[b].c#d:out-of-range') is 'a[b].c#d:out-of-range'
+
+PASS setThenReadSelectorText('a[b]:focus-within') is 'a[b]:focus-within'
+PASS setThenReadSelectorText('a.b:focus-within') is 'a.b:focus-within'
+PASS setThenReadSelectorText('a#b:focus-within') is 'a#b:focus-within'
+PASS setThenReadSelectorText('a[b].c#d:focus-within') is 'a[b].c#d:focus-within'
+
</ins><span class="cx"> PASS setThenReadSelectorText('input:not([type="file"]):focus') is 'input:not([type="file"]):focus'
</span><span class="cx"> PASS setThenReadSelectorText(':-webkit-any([type="file"])') is ':-webkit-any([type="file"])'
</span><span class="cx"> PASS setThenReadSelectorText(':-webkit-any(:hover)') is ':-webkit-any(:hover)'
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscsssetselectortexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-set-selector-text.html (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-set-selector-text.html        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/LayoutTests/fast/css/css-set-selector-text.html        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -311,6 +311,34 @@
</span><span class="cx">
</span><span class="cx"> debug('');
</span><span class="cx">
</span><ins>+testSelectorRoundTrip("a[b]:default");
+testSelectorRoundTrip("a.b:default");
+testSelectorRoundTrip("a#b:default");
+testSelectorRoundTrip("a[b].c#d:default");
+
+debug('');
+
+testSelectorRoundTrip("a[b]:in-range");
+testSelectorRoundTrip("a.b:in-range");
+testSelectorRoundTrip("a#b:in-range");
+testSelectorRoundTrip("a[b].c#d:in-range");
+
+debug('');
+
+testSelectorRoundTrip("a[b]:out-of-range");
+testSelectorRoundTrip("a.b:out-of-range");
+testSelectorRoundTrip("a#b:out-of-range");
+testSelectorRoundTrip("a[b].c#d:out-of-range");
+
+debug('');
+
+testSelectorRoundTrip("a[b]:focus-within");
+testSelectorRoundTrip("a.b:focus-within");
+testSelectorRoundTrip("a#b:focus-within");
+testSelectorRoundTrip("a[b].c#d:focus-within");
+
+debug('');
+
</ins><span class="cx"> testSelectorRoundTrip('input:not([type="file"]):focus');
</span><span class="cx"> testSelectorRoundTrip(':-webkit-any([type="file"])');
</span><span class="cx"> testSelectorRoundTrip(':-webkit-any(:hover)');
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudofocuswithinbasicsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-focus-within-basics-expected.html (0 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-focus-within-basics-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-focus-within-basics-expected.html        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+<!DOCTYPE HTML>
+<html class="focus-within">
+<head>
+<style>
+ * {
+ border: none;
+ }
+ .focus-within {
+ border: 2px solid green;
+ }
+</style>
+</head>
+<body class="focus-within">
+ <form id="form">
+ </form>
+ <div class="focus-within">
+ <input form="form" id="input" autofocus class="focus-within">
+ </div>
+ <script>
+ document.getElementById("input").focus();
+ </script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudofocuswithinbasicshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-focus-within-basics.html (0 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-focus-within-basics.html         (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-focus-within-basics.html        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+ * {
+ border: none;
+ }
+ :focus-within {
+ border: 2px solid green;
+ }
+</style>
+</head>
+<body>
+ <form id="form">
+ </form>
+ <div>
+ <input form="form" id="input" autofocus>
+ </div>
+ <script>
+ document.getElementById("input").focus();
+ </script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudofocuswithininsideshadowdomexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-focus-within-inside-shadow-dom-expected.html (0 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-focus-within-inside-shadow-dom-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-focus-within-inside-shadow-dom-expected.html        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+<!DOCTYPE HTML>
+<html class="focus-within">
+<head>
+<style>
+ * {
+ border: none;
+ }
+ .focus-within {
+ border: 2px solid green;
+ }
+</style>
+</head>
+<body class="focus-within">
+ <div id="root" class="focus-within">
+ </div>
+ <script>
+ let rootElement = document.getElementById('root');
+ let firstRoot = rootElement.attachShadow({mode: 'closed'});
+ let insideDiv = document.createElement("div");
+ insideDiv.innerText = "Foobar";
+ insideDiv.className = "focus-within";
+ let inputElement = document.createElement("input")
+ inputElement.className = "focus-within";
+ insideDiv.appendChild(inputElement);
+ firstRoot.appendChild(insideDiv);
+ inputElement.focus();
+ </script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudofocuswithininsideshadowdomhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-focus-within-inside-shadow-dom.html (0 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-focus-within-inside-shadow-dom.html         (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-focus-within-inside-shadow-dom.html        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+ * {
+ border: none;
+ }
+ :focus-within {
+ border: 2px solid green;
+ }
+</style>
+</head>
+<body>
+ <div id="root">
+ </div>
+ <script>
+ let rootElement = document.getElementById('root');
+ let firstRoot = rootElement.attachShadow({mode: 'closed'});
+ let insideDiv = document.createElement("div");
+ insideDiv.innerText = "Foobar";
+ let inputElement = document.createElement("input")
+ insideDiv.appendChild(inputElement);
+ firstRoot.appendChild(insideDiv);
+ inputElement.focus();
+ </script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudofocuswithinstylesharing1expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-1-expected.html (0 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-1-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-1-expected.html        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+<!DOCTYPE HTML>
+<html class="focus-within">
+<head>
+<style>
+ * {
+ border: none;
+ }
+ .focus-within {
+ border: 2px solid green;
+ }
+</style>
+</head>
+<body class="focus-within">
+ <div class="focus-within">
+ <input form="form" id="input" autofocus class="focus-within">
+ </div>
+ <div>
+ Foo
+ </div>
+ <div>
+ Bar
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudofocuswithinstylesharing1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-1.html (0 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-1.html         (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-1.html        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+ * {
+ border: none;
+ }
+ :focus-within {
+ border: 2px solid green;
+ }
+</style>
+</head>
+<body>
+ <div>
+ <input form="form" id="input" autofocus>
+ </div>
+ <div>
+ Foo
+ </div>
+ <div>
+ Bar
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudofocuswithinstylesharing2expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-2-expected.html (0 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-2-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-2-expected.html        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<!DOCTYPE HTML>
+<html class="focus-within">
+<head>
+<style>
+ * {
+ border: none;
+ }
+ .focus-within {
+ border: 2px solid green;
+ }
+</style>
+</head>
+<body class="focus-within">
+ <div class="focus-within">
+ <input>
+ <input>
+ <input>
+ <input class="focus-within">
+ <input>
+ <input>
+ <input>
+ </div>
+ <script>
+ let midInput = document.getElementsByTagName("input")[3];
+ midInput.focus();
+ </script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudofocuswithinstylesharing2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-2.html (0 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-2.html         (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-focus-within-style-sharing-2.html        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+ * {
+ border: none;
+ }
+ :focus-within {
+ border: 2px solid green;
+ }
+</style>
+</head>
+<body>
+ <div>
+ <input>
+ <input>
+ <input>
+ <input>
+ <input>
+ <input>
+ <input>
+ </div>
+ <script>
+ let midInput = document.getElementsByTagName("input")[3];
+ midInput.focus();
+ </script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsfocuswithinstyleupdateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/focus-within-style-update-expected.txt (0 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/focus-within-style-update-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/selectors/focus-within-style-update-expected.txt        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+Check the basic features of the :focus-within pseudo class
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Initial State
+PASS elementsStyledWithFocusWithinSelector() is []
+PASS elementsMatchingFocusWithinSelector() is []
+Focus target1
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+Focus target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+Set display none on target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS target2.matches(":focus") is true
+Focus target1
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+Try to focus target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS target1.matches(":focus") is true
+PASS target2.matches(":focus") is false
+Set display back on target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+Focus target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+Set display none on container2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS target2.matches(":focus") is true
+Focus target1
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+Try to focus target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS target1.matches(":focus") is true
+PASS target2.matches(":focus") is false
+Set display back on container2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+Detach container1 from the document
+PASS elementsStyledWithFocusWithinSelector() is []
+PASS elementsMatchingFocusWithinSelector() is []
+PASS container1.querySelectorAll(":focus-within").length is 0
+PASS target1.matches(":focus") is false
+PASS target2.matches(":focus") is false
+Try to focus target1
+PASS elementsStyledWithFocusWithinSelector() is []
+PASS elementsMatchingFocusWithinSelector() is []
+PASS container1.querySelectorAll(":focus-within").length is 0
+PASS target1.matches(":focus") is false
+PASS target2.matches(":focus") is false
+Focus target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+Attach container1 in container2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+Focus target1
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "container1", "sibling2", "target1"]
+Move target1 in container2
+PASS elementsStyledWithFocusWithinSelector() is []
+PASS elementsMatchingFocusWithinSelector() is []
+PASS target1.matches(":focus") is false
+PASS target2.matches(":focus") is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsfocuswithinstyleupdatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/focus-within-style-update.html (0 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/focus-within-style-update.html         (rev 0)
+++ trunk/LayoutTests/fast/selectors/focus-within-style-update.html        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -0,0 +1,170 @@
</span><ins>+<!doctype html>
+<html id="html">
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="style">
+* {
+ background-color: white;
+}
+:focus-within {
+ background-color: rgb(1, 2, 3);
+}
+</style>
+</head>
+<body id="body">
+ <div id="webkit-test">
+ <div id="container1">
+ <div id="sibling1"></div>
+ <div id="sibling2">
+ <input id="target1">
+ </div>
+ <div id="sibling3"></div>
+ </div>
+ <div id="container2">
+ <div id="sibling4"></div>
+ <div id="sibling5">
+ <textarea id="target2"></textarea>
+ </div>
+ <div id="sibling6"></div>
+ </div>
+ </div>
+</body>
+<script>
+"use strict";
+description('Check the basic features of the :focus-within pseudo class');
+
+function elementsStyledWithFocusWithinSelector() {
+ let elements = [];
+ for (let element of document.querySelectorAll("*")) {
+ if (getComputedStyle(element).backgroundColor === 'rgb(1, 2, 3)') {
+ elements.push(element.id);
+ }
+ }
+ return elements;
+}
+
+function elementsMatchingFocusWithinSelector() {
+ let elements = [];
+ for (let element of document.querySelectorAll(":focus-within")) {
+ elements.push(element.id);
+ }
+ return elements;
+}
+
+debug("Initial State");
+shouldBe('elementsStyledWithFocusWithinSelector()', '[]');
+shouldBe('elementsMatchingFocusWithinSelector()', '[]');
+
+debug("Focus target1");
+var target1 = document.getElementById("target1");
+target1.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+
+debug("Focus target2");
+var target2 = document.getElementById("target2");
+target2.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+
+debug("Set display none on target2");
+target2.style.display = "none";
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBeTrue('target2.matches(":focus")');
+
+debug("Focus target1");
+target1.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+
+debug("Try to focus target2");
+target2.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBeTrue('target1.matches(":focus")');
+shouldBeFalse('target2.matches(":focus")');
+
+debug("Set display back on target2");
+target2.style.display = "revert";
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+
+debug("Focus target2");
+target2.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+
+debug("Set display none on container2");
+var container2 = document.getElementById("container2");
+container2.style.display = "none";
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBeTrue('target2.matches(":focus")');
+
+debug("Focus target1");
+target1.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+
+debug("Try to focus target2");
+target2.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBeTrue('target1.matches(":focus")');
+shouldBeFalse('target2.matches(":focus")');
+
+debug("Set display back on container2");
+var container2 = document.getElementById("container2");
+container2.style.display = "revert";
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+
+debug("Detach container1 from the document");
+var container1 = document.getElementById("container1");
+container1.parentElement.removeChild(container1);
+shouldBe('elementsStyledWithFocusWithinSelector()', '[]');
+shouldBe('elementsMatchingFocusWithinSelector()', '[]');
+shouldBe('container1.querySelectorAll(":focus-within").length', '0');
+shouldBeFalse('target1.matches(":focus")');
+shouldBeFalse('target2.matches(":focus")');
+
+debug("Try to focus target1");
+target1.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '[]');
+shouldBe('elementsMatchingFocusWithinSelector()', '[]');
+shouldBe('container1.querySelectorAll(":focus-within").length', '0');
+shouldBeFalse('target1.matches(":focus")');
+shouldBeFalse('target2.matches(":focus")');
+
+debug("Focus target2");
+target2.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+
+debug("Attach container1 in container2");
+container2.appendChild(container1);
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+
+debug("Focus target1");
+target1.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "container1", "sibling2", "target1"]');
+
+debug("Move target1 in container2");
+container2.appendChild(target1);
+shouldBe('elementsStyledWithFocusWithinSelector()', '[]');
+shouldBe('elementsMatchingFocusWithinSelector()', '[]');
+shouldBeFalse('target1.matches(":focus")');
+shouldBeFalse('target2.matches(":focus")');
+
+gc();
+
+// Clean up the test.
+document.getElementById("webkit-test").style.display = "none";
+document.getElementById("style").innerHTML = "";
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsfocuswithinwithselectorcheckerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/focus-within-with-selector-checker-expected.txt (0 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/focus-within-with-selector-checker-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/selectors/focus-within-with-selector-checker-expected.txt        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+Test :focus-within with selectors not compiled by CSS JIT
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Initial State
+PASS elementsStyledWithFocusWithinSelector() is []
+PASS elementsMatchingFocusWithinSelector() is []
+Focus target1
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+Focus target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+Set display none on target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS target2.matches(":focus") is true
+Focus target1
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+Try to focus target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS target1.matches(":focus") is true
+PASS target2.matches(":focus") is false
+Set display back on target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+Focus target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+Set display none on container2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS target2.matches(":focus") is true
+Focus target1
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+Try to focus target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS target1.matches(":focus") is true
+PASS target2.matches(":focus") is false
+Set display back on container2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container1", "sibling2", "target1"]
+Detach container1 from the document
+PASS elementsStyledWithFocusWithinSelector() is []
+PASS elementsMatchingFocusWithinSelector() is []
+PASS container1.querySelectorAll(":focus-within").length is 0
+PASS target1.matches(":focus") is false
+PASS target2.matches(":focus") is false
+Try to focus target1
+PASS elementsStyledWithFocusWithinSelector() is []
+PASS elementsMatchingFocusWithinSelector() is []
+PASS container1.querySelectorAll(":focus-within").length is 0
+PASS target1.matches(":focus") is false
+PASS target2.matches(":focus") is false
+Focus target2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+Attach container1 in container2
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "sibling5", "target2"]
+Focus target1
+PASS elementsStyledWithFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "container1", "sibling2", "target1"]
+PASS elementsMatchingFocusWithinSelector() is ["html", "body", "webkit-test", "container2", "container1", "sibling2", "target1"]
+Move target1 in container2
+PASS elementsStyledWithFocusWithinSelector() is []
+PASS elementsMatchingFocusWithinSelector() is []
+PASS target1.matches(":focus") is false
+PASS target2.matches(":focus") is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsfocuswithinwithselectorcheckerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/focus-within-with-selector-checker.html (0 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/focus-within-with-selector-checker.html         (rev 0)
+++ trunk/LayoutTests/fast/selectors/focus-within-with-selector-checker.html        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -0,0 +1,173 @@
</span><ins>+<!doctype html>
+<html id="html">
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="style">
+* {
+ background-color: white;
+ color: rgb(2, 3, 4);
+}
+:matches(:root, :nth-of-type(n), :not(#specificity-trick), :nth-last-of-type(n)):focus-within {
+ background-color: rgb(1, 2, 3);
+}
+:matches(:root, :nth-last-of-type(n), :not(#specificity-trick)):focus-within {
+ color: rgb(5, 6, 7);
+}
+</style>
+</head>
+<body id="body">
+ <div id="webkit-test">
+ <div id="container1">
+ <div id="sibling1"></div>
+ <div id="sibling2">
+ <input id="target1">
+ </div>
+ <div id="sibling3"></div>
+ </div>
+ <div id="container2">
+ <div id="sibling4"></div>
+ <div id="sibling5">
+ <textarea id="target2"></textarea>
+ </div>
+ <div id="sibling6"></div>
+ </div>
+ </div>
+</body>
+<script>
+"use strict";
+description('Test :focus-within with selectors not compiled by CSS JIT');
+
+function elementsStyledWithFocusWithinSelector() {
+ let elements = [];
+ for (let element of document.querySelectorAll("*")) {
+ let computedStyle = getComputedStyle(element);
+ if (computedStyle.backgroundColor === 'rgb(1, 2, 3)' && computedStyle.color === 'rgb(5, 6, 7)') {
+ elements.push(element.id);
+ }
+ }
+ return elements;
+}
+
+function elementsMatchingFocusWithinSelector() {
+ let elements = [];
+ for (let element of document.querySelectorAll(":matches(:root, :nth-of-type(n), :not(#specificity-trick), :nth-last-of-type(n)):focus-within")) {
+ elements.push(element.id);
+ }
+ return elements;
+}
+
+debug("Initial State");
+shouldBe('elementsStyledWithFocusWithinSelector()', '[]');
+shouldBe('elementsMatchingFocusWithinSelector()', '[]');
+
+debug("Focus target1");
+var target1 = document.getElementById("target1");
+target1.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+
+debug("Focus target2");
+var target2 = document.getElementById("target2");
+target2.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+
+debug("Set display none on target2");
+target2.style.display = "none";
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBeTrue('target2.matches(":focus")');
+
+debug("Focus target1");
+target1.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+
+debug("Try to focus target2");
+target2.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBeTrue('target1.matches(":focus")');
+shouldBeFalse('target2.matches(":focus")');
+
+debug("Set display back on target2");
+target2.style.display = "revert";
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+
+debug("Focus target2");
+target2.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+
+debug("Set display none on container2");
+var container2 = document.getElementById("container2");
+container2.style.display = "none";
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBeTrue('target2.matches(":focus")');
+
+debug("Focus target1");
+target1.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+
+debug("Try to focus target2");
+target2.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBeTrue('target1.matches(":focus")');
+shouldBeFalse('target2.matches(":focus")');
+
+debug("Set display back on container2");
+var container2 = document.getElementById("container2");
+container2.style.display = "revert";
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container1", "sibling2", "target1"]');
+
+debug("Detach container1 from the document");
+var container1 = document.getElementById("container1");
+container1.parentElement.removeChild(container1);
+shouldBe('elementsStyledWithFocusWithinSelector()', '[]');
+shouldBe('elementsMatchingFocusWithinSelector()', '[]');
+shouldBe('container1.querySelectorAll(":focus-within").length', '0');
+shouldBeFalse('target1.matches(":focus")');
+shouldBeFalse('target2.matches(":focus")');
+
+debug("Try to focus target1");
+target1.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '[]');
+shouldBe('elementsMatchingFocusWithinSelector()', '[]');
+shouldBe('container1.querySelectorAll(":focus-within").length', '0');
+shouldBeFalse('target1.matches(":focus")');
+shouldBeFalse('target2.matches(":focus")');
+
+debug("Focus target2");
+target2.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+
+debug("Attach container1 in container2");
+container2.appendChild(container1);
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "sibling5", "target2"]');
+
+debug("Focus target1");
+target1.focus();
+shouldBe('elementsStyledWithFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "container1", "sibling2", "target1"]');
+shouldBe('elementsMatchingFocusWithinSelector()', '["html", "body", "webkit-test", "container2", "container1", "sibling2", "target1"]');
+
+debug("Move target1 in container2");
+container2.appendChild(target1);
+shouldBe('elementsStyledWithFocusWithinSelector()', '[]');
+shouldBe('elementsMatchingFocusWithinSelector()', '[]');
+shouldBeFalse('target1.matches(":focus")');
+shouldBeFalse('target2.matches(":focus")');
+
+// Clean up the test.
+document.getElementById("webkit-test").style.display = "none";
+document.getElementById("style").innerHTML = "";
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/ChangeLog        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -1,3 +1,68 @@
</span><ins>+2016-06-22 Benjamin Poulain <bpoulain@apple.com>
+
+ AX: Add support for CSS4 :focus-within pseudo
+ https://bugs.webkit.org/show_bug.cgi?id=140144
+
+ Reviewed by Antti Koivisto.
+
+ Tests: fast/css/pseudo-focus-within-basics.html
+ fast/css/pseudo-focus-within-inside-shadow-dom.html
+ fast/css/pseudo-focus-within-style-sharing-1.html
+ fast/css/pseudo-focus-within-style-sharing-2.html
+ fast/selectors/focus-within-style-update.html
+
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::selectorText):
+ * css/CSSSelector.h:
+ * css/SelectorChecker.cpp:
+ (WebCore::SelectorChecker::checkOne):
+ * css/SelectorPseudoClassAndCompatibilityElementMap.in:
+ * cssjit/SelectorCompiler.cpp:
+ (WebCore::SelectorCompiler::addPseudoClassType):
+ (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
+ (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasFocusWithin):
+ * dom/ContainerNode.cpp:
+ (WebCore::destroyRenderTreeIfNeeded):
+ * dom/Element.cpp:
+ (WebCore::Element::~Element):
+ (WebCore::Element::setFocus):
+ (WebCore::Element::unregisterNamedFlowContentElement):
+ (WebCore::Element::setIsNamedFlowContentElement):
+ (WebCore::Element::clearIsNamedFlowContentElement):
+ (WebCore::Element::setStyleAffectedByFocusWithin):
+ (WebCore::Element::rareDataStyleAffectedByFocusWithin):
+ (WebCore::Element::rareDataIsNamedFlowContentElement):
+ * dom/Element.h:
+ (WebCore::Element::hasFocusWithin):
+ (WebCore::Element::styleAffectedByFocusWithin):
+ (WebCore::Element::isNamedFlowContentElement):
+ (WebCore::Element::setHasFocusWithin):
+ * dom/ElementRareData.h:
+ (WebCore::ElementRareData::styleAffectedByFocusWithin):
+ (WebCore::ElementRareData::setStyleAffectedByFocusWithin):
+ (WebCore::ElementRareData::isNamedFlowContentElement):
+ (WebCore::ElementRareData::setIsNamedFlowContentElement):
+ (WebCore::ElementRareData::ElementRareData):
+ (WebCore::ElementRareData::resetComputedStyle):
+ * dom/Node.h:
+ (WebCore::Node::flagHasFocusWithin):
+ (WebCore::Node::isNamedFlowContentNode): Deleted.
+ (WebCore::Node::setIsNamedFlowContentNode): Deleted.
+ (WebCore::Node::clearIsNamedFlowContentNode): Deleted.
+ * rendering/RenderNamedFlowThread.cpp:
+ (WebCore::RenderNamedFlowThread::clearContentElements):
+ (WebCore::RenderNamedFlowThread::registerNamedFlowContentElement):
+ (WebCore::RenderNamedFlowThread::unregisterNamedFlowContentElement):
+ (WebCore::nextNodeInsideContentElement):
+ * style/RenderTreeUpdater.cpp:
+ (WebCore::RenderTreeUpdater::updateElementRenderer):
+ * style/StyleRelations.cpp:
+ (WebCore::Style::commitRelationsToRenderStyle):
+ (WebCore::Style::commitRelations):
+ * style/StyleRelations.h:
+ * style/StyleSharingResolver.cpp:
+ (WebCore::Style::SharingResolver::canShareStyleWithElement):
+
</ins><span class="cx"> 2016-06-22 Oliver Hunt <oliver@apple.com>
</span><span class="cx">
</span><span class="cx"> Integrate WebKit's CFURLConnection with App Transport Security
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.cpp (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.cpp        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/css/CSSSelector.cpp        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -497,6 +497,9 @@
</span><span class="cx"> case CSSSelector::PseudoClassFocus:
</span><span class="cx"> str.appendLiteral(":focus");
</span><span class="cx"> break;
</span><ins>+ case CSSSelector::PseudoClassFocusWithin:
+ str.appendLiteral(":focus-within");
+ break;
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> case CSSSelector::PseudoClassFuture:
</span><span class="cx"> str.appendLiteral(":future");
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.h (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.h        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/css/CSSSelector.h        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -112,6 +112,7 @@
</span><span class="cx"> PseudoClassHover,
</span><span class="cx"> PseudoClassDrag,
</span><span class="cx"> PseudoClassFocus,
</span><ins>+ PseudoClassFocusWithin,
</ins><span class="cx"> PseudoClassActive,
</span><span class="cx"> PseudoClassChecked,
</span><span class="cx"> PseudoClassEnabled,
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.cpp        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -944,6 +944,9 @@
</span><span class="cx"> break;
</span><span class="cx"> case CSSSelector::PseudoClassFocus:
</span><span class="cx"> return matchesFocusPseudoClass(element);
</span><ins>+ case CSSSelector::PseudoClassFocusWithin:
+ addStyleRelation(checkingContext, element, Style::Relation::AffectedByFocusWithin);
+ return element.hasFocusWithin();
</ins><span class="cx"> case CSSSelector::PseudoClassHover:
</span><span class="cx"> if (m_strictParsing || element.isLink() || canMatchHoverOrActiveInQuirksMode(context)) {
</span><span class="cx"> addStyleRelation(checkingContext, element, Style::Relation::AffectedByHover);
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorPseudoClassAndCompatibilityElementMapin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> first-line, PseudoClassUnknown, PseudoElementFirstLine
</span><span class="cx"> first-of-type
</span><span class="cx"> focus
</span><ins>+focus-within
</ins><span class="cx"> horizontal
</span><span class="cx"> host
</span><span class="cx"> hover
</span></span></pre></div>
<a id="trunkSourceWebCorecssjitSelectorCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -323,6 +323,7 @@
</span><span class="cx"> void generateElementIsRoot(Assembler::JumpList& failureCases);
</span><span class="cx"> void generateElementIsScopeRoot(Assembler::JumpList& failureCases);
</span><span class="cx"> void generateElementIsTarget(Assembler::JumpList& failureCases);
</span><ins>+ void generateElementHasFocusWithin(Assembler::JumpList& failureCases);
</ins><span class="cx">
</span><span class="cx"> // Helpers.
</span><span class="cx"> void generateAddStyleRelationIfResolvingStyle(Assembler::RegisterID element, Style::Relation::Type, Optional<Assembler::RegisterID> value = { });
</span><span class="lines">@@ -674,6 +675,7 @@
</span><span class="cx"> case CSSSelector::PseudoClassLastChild:
</span><span class="cx"> case CSSSelector::PseudoClassOnlyChild:
</span><span class="cx"> case CSSSelector::PseudoClassPlaceholderShown:
</span><ins>+ case CSSSelector::PseudoClassFocusWithin:
</ins><span class="cx"> fragment.pseudoClasses.add(type);
</span><span class="cx"> if (selectorContext == SelectorContext::QuerySelector)
</span><span class="cx"> return FunctionType::SimpleSelectorChecker;
</span><span class="lines">@@ -2578,6 +2580,9 @@
</span><span class="cx"> if (fragment.pseudoClasses.contains(CSSSelector::PseudoClassTarget))
</span><span class="cx"> generateElementIsTarget(matchingPostTagNameFailureCases);
</span><span class="cx">
</span><ins>+ if (fragment.pseudoClasses.contains(CSSSelector::PseudoClassFocusWithin))
+ generateElementHasFocusWithin(matchingPostTagNameFailureCases);
+
</ins><span class="cx"> for (unsigned i = 0; i < fragment.unoptimizedPseudoClasses.size(); ++i)
</span><span class="cx"> generateElementFunctionCallTest(matchingPostTagNameFailureCases, fragment.unoptimizedPseudoClasses[i]);
</span><span class="cx">
</span><span class="lines">@@ -3791,6 +3796,12 @@
</span><span class="cx"> failureCases.append(m_assembler.branchPtr(Assembler::NotEqual, Assembler::Address(document, Document::cssTargetMemoryOffset()), elementAddressRegister));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void SelectorCodeGenerator::generateElementHasFocusWithin(Assembler::JumpList& failureCases)
+{
+ generateAddStyleRelationIfResolvingStyle(elementAddressRegister, Style::Relation::AffectedByFocusWithin);
+ failureCases.append(m_assembler.branchTest32(Assembler::Zero, Assembler::Address(elementAddressRegister, Node::nodeFlagsMemoryOffset()), Assembler::TrustedImm32(Node::flagHasFocusWithin())));
+}
+
</ins><span class="cx"> void SelectorCodeGenerator::generateElementIsFirstLink(Assembler::JumpList& failureCases, Assembler::RegisterID element)
</span><span class="cx"> {
</span><span class="cx"> LocalRegister currentElement(m_registerAllocator);
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -103,9 +103,11 @@
</span><span class="cx"> bool childIsHTMLSlotElement = false;
</span><span class="cx"> childIsHTMLSlotElement = is<HTMLSlotElement>(child);
</span><span class="cx"> // FIXME: Get rid of the named flow test.
</span><del>- if (!child.renderer() && !child.isNamedFlowContentNode() && !childIsHTMLSlotElement)
</del><ins>+ bool isElement = is<Element>(child);
+ if (!child.renderer() && !childIsHTMLSlotElement
+ && !(isElement && downcast<Element>(child).isNamedFlowContentElement()))
</ins><span class="cx"> return;
</span><del>- if (is<Element>(child))
</del><ins>+ if (isElement)
</ins><span class="cx"> RenderTreeUpdater::tearDownRenderers(downcast<Element>(child));
</span><span class="cx"> else if (is<Text>(child))
</span><span class="cx"> RenderTreeUpdater::tearDownRenderer(downcast<Text>(child));
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/dom/Element.cpp        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -182,8 +182,8 @@
</span><span class="cx"> if (document().hasLivingRenderTree()) {
</span><span class="cx"> // When the document is not destroyed, an element that was part of a named flow
</span><span class="cx"> // content nodes should have been removed from the content nodes collection
</span><del>- // and the isNamedFlowContentNode flag reset.
- ASSERT_WITH_SECURITY_IMPLICATION(!isNamedFlowContentNode());
</del><ins>+ // and the isNamedFlowContentElement flag reset.
+ ASSERT_WITH_SECURITY_IMPLICATION(!isNamedFlowContentElement());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -601,6 +601,9 @@
</span><span class="cx">
</span><span class="cx"> document().userActionElements().setFocused(this, flag);
</span><span class="cx"> setNeedsStyleRecalc();
</span><ins>+
+ for (Element* element = this; element; element = element->parentOrShadowHostElement())
+ element->setHasFocusWithin(flag);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Element::setHovered(bool flag)
</span><span class="lines">@@ -1620,7 +1623,7 @@
</span><span class="cx">
</span><span class="cx"> void Element::unregisterNamedFlowContentElement()
</span><span class="cx"> {
</span><del>- if (isNamedFlowContentNode() && document().renderView())
</del><ins>+ if (isNamedFlowContentElement() && document().renderView())
</ins><span class="cx"> document().renderView()->flowThreadController().unregisterNamedFlowContentElement(*this);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1908,6 +1911,16 @@
</span><span class="cx"> setAttributeEventListener(eventType, JSLazyEventListener::create(*this, attributeName, attributeValue));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void Element::setIsNamedFlowContentElement()
+{
+ ensureElementRareData().setIsNamedFlowContentElement(true);
+}
+
+void Element::clearIsNamedFlowContentElement()
+{
+ ensureElementRareData().setIsNamedFlowContentElement(false);
+}
+
</ins><span class="cx"> void Element::removeAllEventListeners()
</span><span class="cx"> {
</span><span class="cx"> ContainerNode::removeAllEventListeners();
</span><span class="lines">@@ -2562,6 +2575,11 @@
</span><span class="cx"> ensureElementRareData().setStyleAffectedByEmpty(true);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void Element::setStyleAffectedByFocusWithin()
+{
+ ensureElementRareData().setStyleAffectedByFocusWithin(true);
+}
+
</ins><span class="cx"> void Element::setChildrenAffectedByActive()
</span><span class="cx"> {
</span><span class="cx"> ensureElementRareData().setChildrenAffectedByActive(true);
</span><span class="lines">@@ -2607,6 +2625,18 @@
</span><span class="cx"> return elementRareData()->styleAffectedByEmpty();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool Element::rareDataStyleAffectedByFocusWithin() const
+{
+ ASSERT(hasRareData());
+ return elementRareData()->styleAffectedByFocusWithin();
+}
+
+bool Element::rareDataIsNamedFlowContentElement() const
+{
+ ASSERT(hasRareData());
+ return elementRareData()->isNamedFlowContentElement();
+}
+
</ins><span class="cx"> bool Element::rareDataChildrenAffectedByActive() const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(hasRareData());
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/dom/Element.h        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -273,10 +273,12 @@
</span><span class="cx"> bool active() const { return isUserActionElement() && isUserActionElementActive(); }
</span><span class="cx"> bool hovered() const { return isUserActionElement() && isUserActionElementHovered(); }
</span><span class="cx"> bool focused() const { return isUserActionElement() && isUserActionElementFocused(); }
</span><ins>+ bool hasFocusWithin() const { return getFlag(HasFocusWithin); };
</ins><span class="cx">
</span><span class="cx"> virtual void setActive(bool flag = true, bool pause = false);
</span><span class="cx"> virtual void setHovered(bool flag = true);
</span><span class="cx"> virtual void setFocus(bool flag);
</span><ins>+ void setHasFocusWithin(bool flag);
</ins><span class="cx">
</span><span class="cx"> bool tabIndexSetExplicitly() const;
</span><span class="cx"> virtual bool supportsFocus() const;
</span><span class="lines">@@ -296,6 +298,7 @@
</span><span class="cx">
</span><span class="cx"> // Methods for indicating the style is affected by dynamic updates (e.g., children changing, our position changing in our sibling list, etc.)
</span><span class="cx"> bool styleAffectedByEmpty() const { return hasRareData() && rareDataStyleAffectedByEmpty(); }
</span><ins>+ bool styleAffectedByFocusWithin() const { return hasRareData() && rareDataStyleAffectedByFocusWithin(); }
</ins><span class="cx"> bool childrenAffectedByHover() const { return getFlag(ChildrenAffectedByHoverRulesFlag); }
</span><span class="cx"> bool childrenAffectedByActive() const { return hasRareData() && rareDataChildrenAffectedByActive(); }
</span><span class="cx"> bool childrenAffectedByDrag() const { return hasRareData() && rareDataChildrenAffectedByDrag(); }
</span><span class="lines">@@ -309,6 +312,7 @@
</span><span class="cx"> bool hasFlagsSetDuringStylingOfChildren() const;
</span><span class="cx">
</span><span class="cx"> void setStyleAffectedByEmpty();
</span><ins>+ void setStyleAffectedByFocusWithin();
</ins><span class="cx"> void setChildrenAffectedByHover() { setFlag(ChildrenAffectedByHoverRulesFlag); }
</span><span class="cx"> void setChildrenAffectedByActive();
</span><span class="cx"> void setChildrenAffectedByDrag();
</span><span class="lines">@@ -521,6 +525,10 @@
</span><span class="cx"> using ContainerNode::setAttributeEventListener;
</span><span class="cx"> void setAttributeEventListener(const AtomicString& eventType, const QualifiedName& attributeName, const AtomicString& value);
</span><span class="cx">
</span><ins>+ bool isNamedFlowContentElement() const { return hasRareData() && rareDataIsNamedFlowContentElement(); }
+ void setIsNamedFlowContentElement();
+ void clearIsNamedFlowContentElement();
+
</ins><span class="cx"> protected:
</span><span class="cx"> Element(const QualifiedName&, Document&, ConstructionType);
</span><span class="cx">
</span><span class="lines">@@ -607,6 +615,8 @@
</span><span class="cx"> const RenderStyle& resolveComputedStyle();
</span><span class="cx">
</span><span class="cx"> bool rareDataStyleAffectedByEmpty() const;
</span><ins>+ bool rareDataStyleAffectedByFocusWithin() const;
+ bool rareDataIsNamedFlowContentElement() const;
</ins><span class="cx"> bool rareDataChildrenAffectedByHover() const;
</span><span class="cx"> bool rareDataChildrenAffectedByActive() const;
</span><span class="cx"> bool rareDataChildrenAffectedByDrag() const;
</span><span class="lines">@@ -749,6 +759,15 @@
</span><span class="cx"> return element.isHTMLElement() && element.document().isHTMLDocument();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+inline void Element::setHasFocusWithin(bool flag)
+{
+ if (hasFocusWithin() == flag)
+ return;
+ setFlag(flag, HasFocusWithin);
+ if (styleAffectedByFocusWithin())
+ setNeedsStyleRecalc();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::Element)
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementRareDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ElementRareData.h (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ElementRareData.h        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/dom/ElementRareData.h        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2009, 2010, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2009, 2010, 2014, 2016 Apple Inc. All rights reserved.
</ins><span class="cx"> * Copyright (C) 2008 David Smith <catfish.man@gmail.com>
</span><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -58,9 +58,15 @@
</span><span class="cx"> bool styleAffectedByEmpty() const { return m_styleAffectedByEmpty; }
</span><span class="cx"> void setStyleAffectedByEmpty(bool value) { m_styleAffectedByEmpty = value; }
</span><span class="cx">
</span><ins>+ bool styleAffectedByFocusWithin() const { return m_styleAffectedByFocusWithin; }
+ void setStyleAffectedByFocusWithin(bool value) { m_styleAffectedByFocusWithin = value; }
+
</ins><span class="cx"> RegionOversetState regionOversetState() const { return m_regionOversetState; }
</span><span class="cx"> void setRegionOversetState(RegionOversetState state) { m_regionOversetState = state; }
</span><span class="cx">
</span><ins>+ bool isNamedFlowContentElement() const { return m_isNamedFlowContentElement; }
+ void setIsNamedFlowContentElement(bool value) { m_isNamedFlowContentElement = value; }
+
</ins><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx"> bool containsFullScreenElement() { return m_containsFullScreenElement; }
</span><span class="cx"> void setContainsFullScreenElement(bool value) { m_containsFullScreenElement = value; }
</span><span class="lines">@@ -116,6 +122,7 @@
</span><span class="cx"> unsigned m_tabIndexWasSetExplicitly : 1;
</span><span class="cx"> unsigned m_needsFocusAppearanceUpdateSoonAfterAttach : 1;
</span><span class="cx"> unsigned m_styleAffectedByEmpty : 1;
</span><ins>+ unsigned m_styleAffectedByFocusWithin : 1;
</ins><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx"> unsigned m_containsFullScreenElement : 1;
</span><span class="cx"> #endif
</span><span class="lines">@@ -130,6 +137,7 @@
</span><span class="cx"> unsigned m_childrenAffectedByBackwardPositionalRules : 1;
</span><span class="cx"> unsigned m_childrenAffectedByPropertyBasedBackwardPositionalRules : 1;
</span><span class="cx"> unsigned m_hasDisplayContents : 1;
</span><ins>+ unsigned m_isNamedFlowContentElement : 1;
</ins><span class="cx">
</span><span class="cx"> RegionOversetState m_regionOversetState;
</span><span class="cx">
</span><span class="lines">@@ -160,6 +168,7 @@
</span><span class="cx"> , m_tabIndexWasSetExplicitly(false)
</span><span class="cx"> , m_needsFocusAppearanceUpdateSoonAfterAttach(false)
</span><span class="cx"> , m_styleAffectedByEmpty(false)
</span><ins>+ , m_styleAffectedByFocusWithin(false)
</ins><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx"> , m_containsFullScreenElement(false)
</span><span class="cx"> #endif
</span><span class="lines">@@ -171,6 +180,7 @@
</span><span class="cx"> , m_childrenAffectedByBackwardPositionalRules(false)
</span><span class="cx"> , m_childrenAffectedByPropertyBasedBackwardPositionalRules(false)
</span><span class="cx"> , m_hasDisplayContents(false)
</span><ins>+ , m_isNamedFlowContentElement(false)
</ins><span class="cx"> , m_regionOversetState(RegionUndefined)
</span><span class="cx"> , m_minimumSizeForResizing(defaultMinimumSizeForResizing())
</span><span class="cx"> {
</span><span class="lines">@@ -200,6 +210,7 @@
</span><span class="cx"> m_computedStyle = nullptr;
</span><span class="cx"> m_hasDisplayContents = false;
</span><span class="cx"> setStyleAffectedByEmpty(false);
</span><ins>+ setStyleAffectedByFocusWithin(false);
</ins><span class="cx"> setChildIndex(0);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/dom/Node.h        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -247,7 +247,6 @@
</span><span class="cx"> bool isDocumentFragment() const { return getFlag(IsDocumentFragmentFlag); }
</span><span class="cx"> bool isShadowRoot() const { return isDocumentFragment() && isTreeScope(); }
</span><span class="cx">
</span><del>- bool isNamedFlowContentNode() const { return getFlag(IsNamedFlowContentNodeFlag); }
</del><span class="cx"> bool hasCustomStyleResolveCallbacks() const { return getFlag(HasCustomStyleResolveCallbacksFlag); }
</span><span class="cx">
</span><span class="cx"> bool hasSyntheticAttrChildNodes() const { return getFlag(HasSyntheticAttrChildNodesFlag); }
</span><span class="lines">@@ -337,9 +336,6 @@
</span><span class="cx"> bool isLink() const { return getFlag(IsLinkFlag); }
</span><span class="cx"> void setIsLink(bool flag) { setFlag(flag, IsLinkFlag); }
</span><span class="cx">
</span><del>- void setIsNamedFlowContentNode() { setFlag(IsNamedFlowContentNodeFlag); }
- void clearIsNamedFlowContentNode() { clearFlag(IsNamedFlowContentNodeFlag); }
-
</del><span class="cx"> bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); }
</span><span class="cx"> void setHasEventTargetData(bool flag) { setFlag(flag, HasEventTargetDataFlag); }
</span><span class="cx">
</span><span class="lines">@@ -572,6 +568,7 @@
</span><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><ins>+ static int32_t flagHasFocusWithin() { return HasFocusWithin; }
</ins><span class="cx"> static int32_t flagHasRareData() { return HasRareDataFlag; }
</span><span class="cx"> static int32_t flagIsParsingChildrenFinished() { return IsParsingChildrenFinishedFlag; }
</span><span class="cx"> static int32_t flagChildrenAffectedByFirstChildRulesFlag() { return ChildrenAffectedByFirstChildRulesFlag; }
</span><span class="lines">@@ -602,7 +599,7 @@
</span><span class="cx">
</span><span class="cx"> StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1) | 1 << (nodeStyleChangeShift + 2),
</span><span class="cx"> IsEditingTextOrUnresolvedCustomElementFlag = 1 << 17,
</span><del>- IsNamedFlowContentNodeFlag = 1 << 18,
</del><ins>+ HasFocusWithin = 1 << 18,
</ins><span class="cx"> HasSyntheticAttrChildNodesFlag = 1 << 19,
</span><span class="cx"> HasCustomStyleResolveCallbacksFlag = 1 << 20,
</span><span class="cx"> HasEventTargetDataFlag = 1 << 21,
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderNamedFlowThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -74,10 +74,10 @@
</span><span class="cx"> {
</span><span class="cx"> for (auto& contentElement : m_contentElements) {
</span><span class="cx"> ASSERT(contentElement);
</span><del>- ASSERT(contentElement->isNamedFlowContentNode());
</del><ins>+ ASSERT(contentElement->isNamedFlowContentElement());
</ins><span class="cx"> ASSERT(&contentElement->document() == &document());
</span><span class="cx">
</span><del>- contentElement->clearIsNamedFlowContentNode();
</del><ins>+ contentElement->clearIsNamedFlowContentElement();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_contentElements.clear();
</span><span class="lines">@@ -497,7 +497,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(&contentElement.document() == &document());
</span><span class="cx">
</span><del>- contentElement.setIsNamedFlowContentNode();
</del><ins>+ contentElement.setIsNamedFlowContentElement();
</ins><span class="cx">
</span><span class="cx"> resetMarkForDestruction();
</span><span class="cx">
</span><span class="lines">@@ -518,10 +518,10 @@
</span><span class="cx"> void RenderNamedFlowThread::unregisterNamedFlowContentElement(Element& contentElement)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_contentElements.contains(&contentElement));
</span><del>- ASSERT(contentElement.isNamedFlowContentNode());
</del><ins>+ ASSERT(contentElement.isNamedFlowContentElement());
</ins><span class="cx"> ASSERT(&contentElement.document() == &document());
</span><span class="cx">
</span><del>- contentElement.clearIsNamedFlowContentNode();
</del><ins>+ contentElement.clearIsNamedFlowContentElement();
</ins><span class="cx"> m_contentElements.remove(&contentElement);
</span><span class="cx">
</span><span class="cx"> if (canBeDestroyed())
</span><span class="lines">@@ -616,7 +616,7 @@
</span><span class="cx"> // Retrieve the next node to be visited while computing the ranges inside a region.
</span><span class="cx"> static Node* nextNodeInsideContentElement(const Node& currNode, const Element* contentElement)
</span><span class="cx"> {
</span><del>- ASSERT(contentElement && contentElement->isNamedFlowContentNode());
</del><ins>+ ASSERT(contentElement && contentElement->isNamedFlowContentElement());
</ins><span class="cx">
</span><span class="cx"> if (currNode.renderer() && currNode.renderer()->isSVGRoot())
</span><span class="cx"> return NodeTraversal::nextSkippingChildren(currNode, contentElement);
</span></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreeUpdatercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreeUpdater.cpp (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreeUpdater.cpp        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/style/RenderTreeUpdater.cpp        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx">
</span><span class="cx"> void RenderTreeUpdater::updateElementRenderer(Element& element, Style::ElementUpdate& update)
</span><span class="cx"> {
</span><del>- bool shouldTearDownRenderers = update.change == Style::Detach && (element.renderer() || element.isNamedFlowContentNode());
</del><ins>+ bool shouldTearDownRenderers = update.change == Style::Detach && (element.renderer() || element.isNamedFlowContentElement());
</ins><span class="cx"> if (shouldTearDownRenderers)
</span><span class="cx"> tearDownRenderers(element, TeardownType::KeepHoverAndActive);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleRelationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleRelations.cpp (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleRelations.cpp        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/style/StyleRelations.cpp        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -72,6 +72,7 @@
</span><span class="cx"> case Relation::Unique:
</span><span class="cx"> style.setUnique();
</span><span class="cx"> break;
</span><ins>+ case Relation::AffectedByFocusWithin:
</ins><span class="cx"> case Relation::AffectedByPreviousSibling:
</span><span class="cx"> case Relation::AffectsNextSibling:
</span><span class="cx"> case Relation::ChildrenAffectedByBackwardPositionalRules:
</span><span class="lines">@@ -102,6 +103,9 @@
</span><span class="cx"> case Relation::AffectedByEmpty:
</span><span class="cx"> element.setStyleAffectedByEmpty();
</span><span class="cx"> break;
</span><ins>+ case Relation::AffectedByFocusWithin:
+ element.setStyleAffectedByFocusWithin();
+ break;
</ins><span class="cx"> case Relation::AffectedByHover:
</span><span class="cx"> element.setChildrenAffectedByHover();
</span><span class="cx"> break;
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleRelationsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleRelations.h (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleRelations.h        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/style/StyleRelations.h        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> AffectedByActive,
</span><span class="cx"> AffectedByDrag,
</span><span class="cx"> AffectedByEmpty,
</span><ins>+ AffectedByFocusWithin,
</ins><span class="cx"> AffectedByHover,
</span><span class="cx"> AffectedByPreviousSibling,
</span><span class="cx"> // For AffectsNextSibling 'value' tells how many element siblings to mark starting with 'element'.
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleSharingResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleSharingResolver.cpp (202357 => 202358)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleSharingResolver.cpp        2016-06-22 23:31:42 UTC (rev 202357)
+++ trunk/Source/WebCore/style/StyleSharingResolver.cpp        2016-06-22 23:35:25 UTC (rev 202358)
</span><span class="lines">@@ -230,6 +230,8 @@
</span><span class="cx"> return false;
</span><span class="cx"> if (candidateElement.affectsNextSiblingElementStyle() || candidateElement.styleIsAffectedByPreviousSibling())
</span><span class="cx"> return false;
</span><ins>+ if (candidateElement.styleAffectedByFocusWithin() || element.styleAffectedByFocusWithin())
+ return false;
</ins><span class="cx">
</span><span class="cx"> auto& candidateElementId = candidateElement.idForStyleResolution();
</span><span class="cx"> if (!candidateElementId.isNull() && m_ruleSets.features().idsInRules.contains(candidateElementId.impl()))
</span></span></pre>
</div>
</div>
</body>
</html>