<!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>[191229] 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/191229">191229</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-16 16:48:45 -0700 (Fri, 16 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/191204">r191204</a>.
https://bugs.webkit.org/show_bug.cgi?id=150263
This change is causing existing tests to fail (Requested by
ryanhaddad on #webkit).
Reverted changeset:
"Computed style should work correctly with slotted elements
that have display:none"
https://bugs.webkit.org/show_bug.cgi?id=150237
http://trac.webkit.org/changeset/191204</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestseditingstyleapplystyleatomicexpectedtxt">trunk/LayoutTests/editing/style/apply-style-atomic-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgetComputedStylegetComputedStylewithpseudoelementexpectedtxt">trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgetComputedStylegetComputedStylewithpseudoelementhtml">trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</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="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastshadowdomcomputedstyledisplaynoneexpectedtxt">trunk/LayoutTests/fast/shadow-dom/computed-style-display-none-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastshadowdomcomputedstyledisplaynonehtml">trunk/LayoutTests/fast/shadow-dom/computed-style-display-none.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191228 => 191229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-16 23:47:10 UTC (rev 191228)
+++ trunk/LayoutTests/ChangeLog        2015-10-16 23:48:45 UTC (rev 191229)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-10-16 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r191204.
+ https://bugs.webkit.org/show_bug.cgi?id=150263
+
+ This change is causing existing tests to fail (Requested by
+ ryanhaddad on #webkit).
+
+ Reverted changeset:
+
+ "Computed style should work correctly with slotted elements
+ that have display:none"
+ https://bugs.webkit.org/show_bug.cgi?id=150237
+ http://trac.webkit.org/changeset/191204
+
</ins><span class="cx"> 2015-10-16 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix flakey test that was added for:
</span></span></pre></div>
<a id="trunkLayoutTestseditingstyleapplystyleatomicexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/style/apply-style-atomic-expected.txt (191228 => 191229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/style/apply-style-atomic-expected.txt        2015-10-16 23:47:10 UTC (rev 191228)
+++ trunk/LayoutTests/editing/style/apply-style-atomic-expected.txt        2015-10-16 23:48:45 UTC (rev 191229)
</span><span class="lines">@@ -2,18 +2,19 @@
</span><span class="cx"> | <a>
</span><span class="cx"> | href="a"
</span><span class="cx"> | "<#selection-anchor>1"
</span><del>-| <progress>
-| <a>
-| style=""
-| "2"
-| <shadow:root>
-| <div>
-| pseudo="-webkit-progress-inner-element"
-| shadow:pseudoId="-webkit-progress-inner-element"
</del><ins>+| <progress>
+| <a>
+| style=""
+| "2"
+| <shadow:root>
</ins><span class="cx"> | <div>
</span><del>-| pseudo="-webkit-progress-bar"
-| shadow:pseudoId="-webkit-progress-bar"
</del><ins>+| pseudo="-webkit-progress-inner-element"
+| shadow:pseudoId="-webkit-progress-inner-element"
</ins><span class="cx"> | <div>
</span><del>-| pseudo="-webkit-progress-value"
-| style="width: -100%;"
-| shadow:pseudoId="-webkit-progress-value"
</del><ins>+| pseudo="-webkit-progress-bar"
+| shadow:pseudoId="-webkit-progress-bar"
+| <div>
+| pseudo="-webkit-progress-value"
+| style="width: -100%;"
+| shadow:pseudoId="-webkit-progress-value"
+| <#selection-focus>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgetComputedStylegetComputedStylewithpseudoelementexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element-expected.txt (191228 => 191229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element-expected.txt        2015-10-16 23:47:10 UTC (rev 191228)
+++ trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element-expected.txt        2015-10-16 23:48:45 UTC (rev 191229)
</span><span class="lines">@@ -51,10 +51,10 @@
</span><span class="cx"> PASS Expected '0px' for padding in the computed style for element with id testBeforeAfterInline and pseudo-element :before and got '0px'
</span><span class="cx"> PASS Expected '0px' for margin in the computed style for element with id testBeforeAfterInline and pseudo-element :after and got '0px'
</span><span class="cx"> PASS Expected '10px 20px 30px 40px' for padding in the computed style for element with id testBeforeAfterInline and pseudo-element :after and got '10px 20px 30px 40px'
</span><del>-PASS Expected '100px' for width in the computed style for element with id testBeforeAfterDisplayNone and pseudo-element :after and got '100px'
-PASS Expected '100px' for height in the computed style for element with id testBeforeAfterDisplayNone and pseudo-element :after and got '100px'
-PASS Expected '100px' for width in the computed style for element with id testBeforeAfterDisplayNone and pseudo-element :before and got '100px'
-PASS Expected '100px' for height in the computed style for element with id testBeforeAfterDisplayNone and pseudo-element :before and got '100px'
</del><ins>+PASS Expected '' for width in the computed style for element with id testBeforeAfterDisplayNone and pseudo-element :after and got ''
+PASS Expected '' for height in the computed style for element with id testBeforeAfterDisplayNone and pseudo-element :after and got ''
+PASS Expected '' for width in the computed style for element with id testBeforeAfterDisplayNone and pseudo-element :before and got ''
+PASS Expected '' for height in the computed style for element with id testBeforeAfterDisplayNone and pseudo-element :before and got ''
</ins><span class="cx"> PASS Expected 'rgb(165, 42, 42)' for color in the computed style for element with id testNoPseudoElement and pseudo-element null and got 'rgb(165, 42, 42)'
</span><span class="cx"> PASS Expected 'rgb(165, 42, 42)' for color in the computed style for element with id testNoPseudoElement and pseudo-element :first-line and got 'rgb(165, 42, 42)'
</span><span class="cx"> PASS Expected 'rgb(165, 42, 42)' for color in the computed style for element with id testNoPseudoElement and pseudo-element :first-letter and got 'rgb(165, 42, 42)'
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgetComputedStylegetComputedStylewithpseudoelementhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html (191228 => 191229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html        2015-10-16 23:47:10 UTC (rev 191228)
+++ trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html        2015-10-16 23:48:45 UTC (rev 191229)
</span><span class="lines">@@ -168,10 +168,10 @@
</span><span class="cx"> { 'elementId' : 'testBeforeAfterInline', 'pseudoElement' : ':before', 'property' : 'padding', 'expectedValue' : '0px' },
</span><span class="cx"> { 'elementId' : 'testBeforeAfterInline', 'pseudoElement' : ':after', 'property' : 'margin', 'expectedValue' : '0px' },
</span><span class="cx"> { 'elementId' : 'testBeforeAfterInline', 'pseudoElement' : ':after', 'property' : 'padding', 'expectedValue' : '10px 20px 30px 40px' },
</span><del>- { 'elementId' : 'testBeforeAfterDisplayNone', 'pseudoElement' : ':after', 'property' : 'width', 'expectedValue' : '100px' },
- { 'elementId' : 'testBeforeAfterDisplayNone', 'pseudoElement' : ':after', 'property' : 'height', 'expectedValue' : '100px' },
- { 'elementId' : 'testBeforeAfterDisplayNone', 'pseudoElement' : ':before', 'property' : 'width', 'expectedValue' : '100px' },
- { 'elementId' : 'testBeforeAfterDisplayNone', 'pseudoElement' : ':before', 'property' : 'height', 'expectedValue' : '100px' },
</del><ins>+ { 'elementId' : 'testBeforeAfterDisplayNone', 'pseudoElement' : ':after', 'property' : 'width', 'expectedValue' : '' },
+ { 'elementId' : 'testBeforeAfterDisplayNone', 'pseudoElement' : ':after', 'property' : 'height', 'expectedValue' : '' },
+ { 'elementId' : 'testBeforeAfterDisplayNone', 'pseudoElement' : ':before', 'property' : 'width', 'expectedValue' : '' },
+ { 'elementId' : 'testBeforeAfterDisplayNone', 'pseudoElement' : ':before', 'property' : 'height', 'expectedValue' : '' },
</ins><span class="cx"> { 'elementId' : 'testNoPseudoElement', 'pseudoElement' : null, 'property' : 'color', 'expectedValue' : 'rgb(165, 42, 42)' },
</span><span class="cx"> { 'elementId' : 'testNoPseudoElement', 'pseudoElement' : ':first-line', 'property' : 'color', 'expectedValue' : 'rgb(165, 42, 42)' },
</span><span class="cx"> { 'elementId' : 'testNoPseudoElement', 'pseudoElement' : ':first-letter', 'property' : 'color', 'expectedValue' : 'rgb(165, 42, 42)' },
</span></span></pre></div>
<a id="trunkLayoutTestsfastshadowdomcomputedstyledisplaynoneexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/shadow-dom/computed-style-display-none-expected.txt (191228 => 191229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shadow-dom/computed-style-display-none-expected.txt        2015-10-16 23:47:10 UTC (rev 191228)
+++ trunk/LayoutTests/fast/shadow-dom/computed-style-display-none-expected.txt        2015-10-16 23:48:45 UTC (rev 191229)
</span><span class="lines">@@ -1,10 +0,0 @@
</span><del>-Ensure tha slotted elements with display:none inherit their style via shadow tree
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS getComputedStyle(hostChild).color is "rgb(0, 128, 0)"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastshadowdomcomputedstyledisplaynonehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/shadow-dom/computed-style-display-none.html (191228 => 191229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shadow-dom/computed-style-display-none.html        2015-10-16 23:47:10 UTC (rev 191228)
+++ trunk/LayoutTests/fast/shadow-dom/computed-style-display-none.html        2015-10-16 23:48:45 UTC (rev 191229)
</span><span class="lines">@@ -1,24 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src="../../resources/js-test-pre.js"></script>
-</head>
-<style>
-my-host { display: none; color: red; }
-</style>
-<body>
-<my-host><my-host-child></my-host-child></my-host>
-<script>
-description("Ensure tha slotted elements with display:none inherit their style via shadow tree");
-
-var host = document.querySelector("my-host");
-var shadowRoot = host.attachShadow({ mode: "closed"});
-shadowRoot.innerHTML = "<style>div { color: green }</style><div><slot></slot></div>";
-
-hostChild = document.querySelector("my-host-child");
-shouldBeEqualToString("getComputedStyle(hostChild).color", "rgb(0, 128, 0)");
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191228 => 191229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-16 23:47:10 UTC (rev 191228)
+++ trunk/Source/WebCore/ChangeLog        2015-10-16 23:48:45 UTC (rev 191229)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-10-16 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r191204.
+ https://bugs.webkit.org/show_bug.cgi?id=150263
+
+ This change is causing existing tests to fail (Requested by
+ ryanhaddad on #webkit).
+
+ Reverted changeset:
+
+ "Computed style should work correctly with slotted elements
+ that have display:none"
+ https://bugs.webkit.org/show_bug.cgi?id=150237
+ http://trac.webkit.org/changeset/191204
+
</ins><span class="cx"> 2015-10-16 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> Disabled content blockers should not block any loads
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (191228 => 191229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2015-10-16 23:47:10 UTC (rev 191228)
+++ trunk/Source/WebCore/dom/Document.cpp        2015-10-16 23:48:45 UTC (rev 191229)
</span><span class="lines">@@ -1954,15 +1954,15 @@
</span><span class="cx"> m_ignorePendingStylesheets = oldIgnore;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Element& element, RenderStyle* parentStyle)
</del><ins>+Ref<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Element* element)
</ins><span class="cx"> {
</span><del>- ASSERT(&element.document() == this);
</del><ins>+ ASSERT_ARG(element, &element->document() == this);
</ins><span class="cx">
</span><span class="cx"> // On iOS request delegates called during styleForElement may result in re-entering WebKit and killing the style resolver.
</span><span class="cx"> ResourceLoadScheduler::Suspender suspender(*platformStrategies()->loaderStrategy()->resourceLoadScheduler());
</span><span class="cx">
</span><span class="cx"> TemporaryChange<bool> change(m_ignorePendingStylesheets, true);
</span><del>- return element.resolveStyle(parentStyle);
</del><ins>+ return ensureStyleResolver().styleForElement(element, element->parentNode() ? element->parentNode()->computedStyle() : nullptr);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool Document::updateLayoutIfDimensionsOutOfDate(Element& element, DimensionsCheck dimensionsCheck)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (191228 => 191229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2015-10-16 23:47:10 UTC (rev 191228)
+++ trunk/Source/WebCore/dom/Document.h        2015-10-16 23:48:45 UTC (rev 191229)
</span><span class="lines">@@ -570,7 +570,7 @@
</span><span class="cx"> };
</span><span class="cx"> WEBCORE_EXPORT void updateLayoutIgnorePendingStylesheets(RunPostLayoutTasks = RunPostLayoutTasks::Asynchronously);
</span><span class="cx">
</span><del>- Ref<RenderStyle> styleForElementIgnoringPendingStylesheets(Element&, RenderStyle* parentStyle);
</del><ins>+ Ref<RenderStyle> styleForElementIgnoringPendingStylesheets(Element*);
</ins><span class="cx">
</span><span class="cx"> // Returns true if page box (margin boxes and page borders) is visible.
</span><span class="cx"> WEBCORE_EXPORT bool isPageBoxVisible(int pageIndex);
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (191228 => 191229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2015-10-16 23:47:10 UTC (rev 191228)
+++ trunk/Source/WebCore/dom/Element.cpp        2015-10-16 23:48:45 UTC (rev 191229)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include "ChromeClient.h"
</span><span class="cx"> #include "ClientRect.h"
</span><span class="cx"> #include "ClientRectList.h"
</span><del>-#include "ComposedTreeAncestorIterator.h"
</del><span class="cx"> #include "ContainerNodeAlgorithms.h"
</span><span class="cx"> #include "DOMTokenList.h"
</span><span class="cx"> #include "Dictionary.h"
</span><span class="lines">@@ -2435,79 +2434,44 @@
</span><span class="cx"> ensureElementRareData().setMinimumSizeForResizing(size);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static PseudoElement* beforeOrAfterPseudoElement(Element& host, PseudoId pseudoElementSpecifier)
</del><ins>+static PseudoElement* beforeOrAfterPseudoElement(Element* host, PseudoId pseudoElementSpecifier)
</ins><span class="cx"> {
</span><span class="cx"> switch (pseudoElementSpecifier) {
</span><span class="cx"> case BEFORE:
</span><del>- return host.beforePseudoElement();
</del><ins>+ return host->beforePseudoElement();
</ins><span class="cx"> case AFTER:
</span><del>- return host.afterPseudoElement();
</del><ins>+ return host->afterPseudoElement();
</ins><span class="cx"> default:
</span><del>- return nullptr;
</del><ins>+ return 0;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RenderStyle* Element::existingComputedStyle()
-{
- if (RenderStyle* renderTreeStyle = renderStyle())
- return renderTreeStyle;
-
- if (hasRareData())
- return elementRareData()->computedStyle();
-
- return nullptr;
-}
-
-RenderStyle& Element::resolveComputedStyle()
-{
- ASSERT(inDocument());
- ASSERT(!existingComputedStyle());
-
- Deque<Element*, 32> elementsRequiringComputedStyle({ this });
- RenderStyle* previousStyle = nullptr;
-
- // Collect ancestors until we find one that has style.
- auto composedAncestors = composedTreeAncestors(*this);
- for (auto& ancestor : composedAncestors) {
- if (!is<Element>(ancestor))
- break;
- auto& ancestorElement = downcast<Element>(ancestor);
- elementsRequiringComputedStyle.prepend(&ancestorElement);
- if (auto* existingStyle = ancestorElement.existingComputedStyle()) {
- previousStyle = existingStyle;
- break;
- }
- }
-
- // Resolve and cache styles starting from the most distant ancestor.
- for (auto* element : elementsRequiringComputedStyle) {
- auto style = document().styleForElementIgnoringPendingStylesheets(*element, previousStyle);
- previousStyle = style.ptr();
- ElementRareData& rareData = element->ensureElementRareData();
- rareData.setComputedStyle(WTF::move(style));
- }
-
- return *previousStyle;
-}
-
</del><span class="cx"> RenderStyle* Element::computedStyle(PseudoId pseudoElementSpecifier)
</span><span class="cx"> {
</span><del>- if (PseudoElement* pseudoElement = beforeOrAfterPseudoElement(*this, pseudoElementSpecifier))
</del><ins>+ if (PseudoElement* pseudoElement = beforeOrAfterPseudoElement(this, pseudoElementSpecifier))
</ins><span class="cx"> return pseudoElement->computedStyle();
</span><span class="cx">
</span><del>- auto* style = existingComputedStyle();
- if (!style) {
- if (!inDocument())
- return nullptr;
- style = &resolveComputedStyle();
</del><ins>+ // FIXME: Find and use the renderer from the pseudo element instead of the actual element so that the 'length'
+ // properties, which are only known by the renderer because it did the layout, will be correct and so that the
+ // values returned for the ":selection" pseudo-element will be correct.
+ if (RenderStyle* usedStyle = renderStyle()) {
+ if (pseudoElementSpecifier) {
+ RenderStyle* cachedPseudoStyle = usedStyle->getCachedPseudoStyle(pseudoElementSpecifier);
+ return cachedPseudoStyle ? cachedPseudoStyle : usedStyle;
+ }
+ return usedStyle;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (pseudoElementSpecifier) {
- if (auto* cachedPseudoStyle = style->getCachedPseudoStyle(pseudoElementSpecifier))
- style = cachedPseudoStyle;
</del><ins>+ if (!inDocument()) {
+ // FIXME: Try to do better than this. Ensure that styleForElement() works for elements that are not in the
+ // document tree and figure out when to destroy the computed style for such elements.
+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return style;
</del><ins>+ ElementRareData& data = ensureElementRareData();
+ if (!data.computedStyle())
+ data.setComputedStyle(document().styleForElementIgnoringPendingStylesheets(this));
+ return pseudoElementSpecifier ? data.computedStyle()->getCachedPseudoStyle(pseudoElementSpecifier) : data.computedStyle();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Element::setStyleAffectedByEmpty()
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (191228 => 191229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2015-10-16 23:47:10 UTC (rev 191228)
+++ trunk/Source/WebCore/dom/Element.h        2015-10-16 23:48:45 UTC (rev 191229)
</span><span class="lines">@@ -573,9 +573,6 @@
</span><span class="cx">
</span><span class="cx"> void removeShadowRoot();
</span><span class="cx">
</span><del>- RenderStyle* existingComputedStyle();
- RenderStyle& resolveComputedStyle();
-
</del><span class="cx"> bool rareDataStyleAffectedByEmpty() const;
</span><span class="cx"> bool rareDataChildrenAffectedByHover() const;
</span><span class="cx"> bool rareDataChildrenAffectedByActive() const;
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (191228 => 191229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2015-10-16 23:47:10 UTC (rev 191228)
+++ trunk/Source/WebCore/dom/Node.cpp        2015-10-16 23:48:45 UTC (rev 191229)
</span><span class="lines">@@ -1006,10 +1006,11 @@
</span><span class="cx">
</span><span class="cx"> RenderStyle* Node::computedStyle(PseudoId pseudoElementSpecifier)
</span><span class="cx"> {
</span><del>- auto* composedParent = composedTreeAncestors(*this).first();
- if (!composedParent)
- return nullptr;
- return composedParent->computedStyle(pseudoElementSpecifier);
</del><ins>+ for (Node* node = this; node; node = node->parentOrShadowHostNode()) {
+ if (is<Element>(*node))
+ return downcast<Element>(*node).computedStyle(pseudoElementSpecifier);
+ }
+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> int Node::maxCharacterOffset() const
</span></span></pre>
</div>
</div>
</body>
</html>