<!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>[203985] 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/203985">203985</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2016-08-01 13:49:53 -0700 (Mon, 01 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION(<a href="http://trac.webkit.org/projects/webkit/changeset/198943">r198943</a>): drop-down menu navigation on fiddlevideo.com doesn't appear on iOS, works on OS X
https://bugs.webkit.org/show_bug.cgi?id=160406
Source/WebCore:

rdar://problem/26310261

Reviewed by Simon Fraser.

On iOS we generate synthetic mouse events from taps. Click event is generated on tap only if the move event
doesn't produce visible changes to the document. This is important to make certain types of drop down menus
work.

The information on mutations is passed via WKContentObservation side channel which is updated from varous parts
of the code. Newly visible elements are detected CheckForVisibilityChangeOnRecalcStyle during style resolution.
This got broken by the style refactoring because it assumes that renderer is mutated along with style computation.
However mutation is now a separate step performed by RenderTreeUpdater.

Fix by moving CheckForVisibilityChange to RenderTreeUpdater.

Test: fast/content-observation/click-event-suppression-on-content-change.html

* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::Parent::Parent):
(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::RenderTreeUpdater::tearDownRenderer):
(WebCore::elementImplicitVisibility):
(WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
(WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
(WebCore::Style::TreeResolver::pushParent):
(WebCore::Style::TreeResolver::resolveComposedTree):
(WebCore::Style::elementImplicitVisibility): Deleted.
(WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle): Deleted.
(WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::~CheckForVisibilityChangeOnRecalcStyle): Deleted.

LayoutTests:


Reviewed by Simon Fraser.

This stuff has had zero test coverage. Adding a basic UIScript based test.

* TestExpectations:
* fast/content-observation/click-event-suppression-on-content-change-expected.txt: Added.
* fast/content-observation/click-event-suppression-on-content-change.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreeUpdatercpp">trunk/Source/WebCore/style/RenderTreeUpdater.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleTreeResolvercpp">trunk/Source/WebCore/style/StyleTreeResolver.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/fast/content-observation/</li>
<li><a href="#trunkLayoutTestsfastcontentobservationclickeventsuppressiononcontentchangeexpectedtxt">trunk/LayoutTests/fast/content-observation/click-event-suppression-on-content-change-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcontentobservationclickeventsuppressiononcontentchangehtml">trunk/LayoutTests/fast/content-observation/click-event-suppression-on-content-change.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203984 => 203985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-08-01 20:48:35 UTC (rev 203984)
+++ trunk/LayoutTests/ChangeLog        2016-08-01 20:49:53 UTC (rev 203985)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-08-01  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        REGRESSION(r198943): drop-down menu navigation on fiddlevideo.com doesn't appear on iOS, works on OS X
+        https://bugs.webkit.org/show_bug.cgi?id=160406
+
+        Reviewed by Simon Fraser.
+
+        This stuff has had zero test coverage. Adding a basic UIScript based test.
+
+        * TestExpectations:
+        * fast/content-observation/click-event-suppression-on-content-change-expected.txt: Added.
+        * fast/content-observation/click-event-suppression-on-content-change.html: Added.
+
</ins><span class="cx"> 2016-08-01  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac][iOS] Adopt MediaRemote &quot;seek to playback position&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (203984 => 203985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2016-08-01 20:48:35 UTC (rev 203984)
+++ trunk/LayoutTests/TestExpectations        2016-08-01 20:49:53 UTC (rev 203985)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> fast/events/ios [ Skip ]
</span><span class="cx"> fast/events/touch/ios [ Skip ]
</span><span class="cx"> fast/scrolling/ios [ Skip ]
</span><ins>+fast/content-observation [ Skip ]
</ins><span class="cx"> media/mac [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> fast/forms/attributed-strings.html [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsfastcontentobservationclickeventsuppressiononcontentchangeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/content-observation/click-event-suppression-on-content-change-expected.txt (0 => 203985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/content-observation/click-event-suppression-on-content-change-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/content-observation/click-event-suppression-on-content-change-expected.txt        2016-08-01 20:49:53 UTC (rev 203985)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test that if document is visibly mutated in mouseover handler then synthetic click is not generated until the next tap.
+Tapping once
+mouseover
+mouseclick
+Tapping again
+mouseclick
+Tapping out
+mouseout
+Enabling mutation on mouseover
+Tapping once
+mouseover
+Tapping again
+mouseclick
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcontentobservationclickeventsuppressiononcontentchangehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/content-observation/click-event-suppression-on-content-change.html (0 => 203985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/content-observation/click-event-suppression-on-content-change.html                                (rev 0)
+++ trunk/LayoutTests/fast/content-observation/click-event-suppression-on-content-change.html        2016-08-01 20:49:53 UTC (rev 203985)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+#neutral { position:absolute; top:0px; left:100px; width:100px; height:100px; border:2px solid blue; }
+#test { position:absolute; top:100px; left:100px; width:100px; height:100px; border:2px solid blue; }
+#test div { border: 2px solid red; width: 10px; height: 10px; }
+&lt;/style&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+var outputText = &quot;&quot;;
+
+function output(text) {
+    outputText += text + '&lt;br&gt;';
+}
+
+var mutateOnMouseOver = false;
+
+function mouseOver() {
+    if (mutateOnMouseOver)
+        document.querySelector('#test').appendChild(document.createElement(&quot;div&quot;));
+    output('mouseover');
+}
+function mouseOut() {
+    output('mouseout');
+}
+function mouseClick() {
+    output('mouseclick');
+}
+
+function getTapUIScript(x, y)
+{
+    return `
+    (function() {
+        uiController.singleTapAtPoint(${x}, ${y}, function() {
+            uiController.uiScriptComplete(&quot;Done&quot;);
+        });
+    })();`
+}
+
+function test() {
+    if (!window.testRunner || !window.testRunner.runUIScript)
+        return;
+    // Test tapping in a div.
+    output(&quot;Tapping once&quot;);
+    testRunner.runUIScript(getTapUIScript(150, 150), function(result) {
+        output(&quot;Tapping again&quot;);
+        testRunner.runUIScript(getTapUIScript(150, 150), function(result) {
+            output(&quot;Tapping out&quot;);
+            testRunner.runUIScript(getTapUIScript(150, 50), function(result) {
+                output(&quot;Enabling mutation on mouseover&quot;);
+                mutateOnMouseOver = true;
+                output(&quot;Tapping once&quot;);
+                testRunner.runUIScript(getTapUIScript(150, 150), function(result) {
+                    output(&quot;Tapping again&quot;);
+                    testRunner.runUIScript(getTapUIScript(150, 150), function(result) {
+                        document.querySelector('#output').innerHTML += outputText;
+                        testRunner.notifyDone();
+                    });
+                });
+            });
+        });
+    });
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;test()&quot;&gt;
+    &lt;div&gt;Test that if document is visibly mutated in mouseover handler then synthetic click is not generated until the next tap.&lt;/div&gt;
+    &lt;div id='neutral' onmouseover='' onmouseout='' onclick=''&gt;
+    &lt;/div&gt;
+    &lt;div id='test' onmouseover='mouseOver()' onmouseout='mouseOut()' onclick='mouseClick()'&gt;
+    &lt;/div&gt;
+    &lt;div id='output'&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203984 => 203985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-01 20:48:35 UTC (rev 203984)
+++ trunk/Source/WebCore/ChangeLog        2016-08-01 20:49:53 UTC (rev 203985)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2016-08-01  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        REGRESSION(r198943): drop-down menu navigation on fiddlevideo.com doesn't appear on iOS, works on OS X
+        https://bugs.webkit.org/show_bug.cgi?id=160406
+        rdar://problem/26310261
+
+        Reviewed by Simon Fraser.
+
+        On iOS we generate synthetic mouse events from taps. Click event is generated on tap only if the move event
+        doesn't produce visible changes to the document. This is important to make certain types of drop down menus
+        work.
+
+        The information on mutations is passed via WKContentObservation side channel which is updated from varous parts
+        of the code. Newly visible elements are detected CheckForVisibilityChangeOnRecalcStyle during style resolution.
+        This got broken by the style refactoring because it assumes that renderer is mutated along with style computation.
+        However mutation is now a separate step performed by RenderTreeUpdater.
+
+        Fix by moving CheckForVisibilityChange to RenderTreeUpdater.
+
+        Test: fast/content-observation/click-event-suppression-on-content-change.html
+
+        * style/RenderTreeUpdater.cpp:
+        (WebCore::RenderTreeUpdater::Parent::Parent):
+        (WebCore::RenderTreeUpdater::updateElementRenderer):
+        (WebCore::RenderTreeUpdater::tearDownRenderer):
+        (WebCore::elementImplicitVisibility):
+        (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
+        (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
+        * style/StyleTreeResolver.cpp:
+        (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
+        (WebCore::Style::TreeResolver::pushParent):
+        (WebCore::Style::TreeResolver::resolveComposedTree):
+        (WebCore::Style::elementImplicitVisibility): Deleted.
+        (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle): Deleted.
+        (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::~CheckForVisibilityChangeOnRecalcStyle): Deleted.
+
</ins><span class="cx"> 2016-08-01  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] A video element that does not pause after exiting from fullscreen should be allowed to continue playing inline
</span></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreeUpdatercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreeUpdater.cpp (203984 => 203985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreeUpdater.cpp        2016-08-01 20:48:35 UTC (rev 203984)
+++ trunk/Source/WebCore/style/RenderTreeUpdater.cpp        2016-08-01 20:49:53 UTC (rev 203985)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;FlowThreadController.h&quot;
</span><span class="cx"> #include &quot;HTMLSlotElement.h&quot;
</span><span class="cx"> #include &quot;InspectorInstrumentation.h&quot;
</span><ins>+#include &quot;NodeRenderStyle.h&quot;
</ins><span class="cx"> #include &quot;PseudoElement.h&quot;
</span><span class="cx"> #include &quot;RenderFullScreen.h&quot;
</span><span class="cx"> #include &quot;RenderNamedFlowThread.h&quot;
</span><span class="lines">@@ -40,8 +41,26 @@
</span><span class="cx"> #include &quot;StyleResolver.h&quot;
</span><span class="cx"> #include &quot;StyleTreeResolver.h&quot;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WKContentObservation.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+class CheckForVisibilityChange {
+public:
+    CheckForVisibilityChange(const Element&amp;);
+    ~CheckForVisibilityChange();
+
+private:
+    const Element&amp; m_element;
+    EDisplay m_previousDisplay;
+    EVisibility m_previousVisibility;
+    EVisibility m_previousImplicitVisibility;
+};
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> RenderTreeUpdater::Parent::Parent(ContainerNode&amp; root)
</span><span class="cx">     : element(is&lt;Document&gt;(root) ? nullptr : downcast&lt;Element&gt;(&amp;root))
</span><span class="cx">     , renderTreePosition(RenderTreePosition(*root.renderer()))
</span><span class="lines">@@ -242,6 +261,10 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderTreeUpdater::updateElementRenderer(Element&amp; element, Style::ElementUpdate&amp; update)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    CheckForVisibilityChange checkForVisibilityChange(element);
+#endif
+
</ins><span class="cx">     bool shouldTearDownRenderers = update.change == Style::Detach &amp;&amp; (element.renderer() || element.isNamedFlowContentElement());
</span><span class="cx">     if (shouldTearDownRenderers)
</span><span class="cx">         tearDownRenderers(element, TeardownType::KeepHoverAndActive);
</span><span class="lines">@@ -566,4 +589,51 @@
</span><span class="cx">     text.setRenderer(nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+static EVisibility elementImplicitVisibility(const Element&amp; element)
+{
+    auto* renderer = element.renderer();
+    if (!renderer)
+        return VISIBLE;
+
+    auto&amp; style = renderer-&gt;style();
+
+    auto width = style.width();
+    auto height = style.height();
+    if ((width.isFixed() &amp;&amp; width.value() &lt;= 0) || (height.isFixed() &amp;&amp; height.value() &lt;= 0))
+        return HIDDEN;
+
+    auto top = style.top();
+    auto left = style.left();
+    if (left.isFixed() &amp;&amp; width.isFixed() &amp;&amp; -left.value() &gt;= width.value())
+        return HIDDEN;
+
+    if (top.isFixed() &amp;&amp; height.isFixed() &amp;&amp; -top.value() &gt;= height.value())
+        return HIDDEN;
+    return VISIBLE;
</ins><span class="cx"> }
</span><ins>+
+CheckForVisibilityChange::CheckForVisibilityChange(const Element&amp; element)
+    : m_element(element)
+    , m_previousDisplay(element.renderStyle() ? element.renderStyle()-&gt;display() : NONE)
+    , m_previousVisibility(element.renderStyle() ? element.renderStyle()-&gt;visibility() : HIDDEN)
+    , m_previousImplicitVisibility(WKObservingContentChanges() &amp;&amp; WKObservedContentChange() != WKContentVisibilityChange ? elementImplicitVisibility(element) : VISIBLE)
+{
+}
+
+CheckForVisibilityChange::~CheckForVisibilityChange()
+{
+    if (!WKObservingContentChanges())
+        return;
+    if (m_element.isInUserAgentShadowTree())
+        return;
+    auto* style = m_element.renderStyle();
+    if (!style)
+        return;
+    if ((m_previousDisplay == NONE &amp;&amp; style-&gt;display() != NONE) || (m_previousVisibility == HIDDEN &amp;&amp; style-&gt;visibility() != HIDDEN)
+        || (m_previousImplicitVisibility == HIDDEN &amp;&amp; elementImplicitVisibility(m_element) == VISIBLE))
+        WKSetObservedContentChange(WKContentVisibilityChange);
+}
+#endif
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorestyleStyleTreeResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (203984 => 203985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleTreeResolver.cpp        2016-08-01 20:48:35 UTC (rev 203984)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp        2016-08-01 20:49:53 UTC (rev 203985)
</span><span class="lines">@@ -47,10 +47,6 @@
</span><span class="cx"> #include &quot;StyleResolver.h&quot;
</span><span class="cx"> #include &quot;Text.h&quot;
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-#include &quot;WKContentObservation.h&quot;
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> namespace Style {
</span><span class="lines">@@ -265,60 +261,6 @@
</span><span class="cx">     return update;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-static EVisibility elementImplicitVisibility(const Element* element)
-{
-    RenderObject* renderer = element-&gt;renderer();
-    if (!renderer)
-        return VISIBLE;
-
-    auto&amp; style = renderer-&gt;style();
-
-    Length width(style.width());
-    Length height(style.height());
-    if ((width.isFixed() &amp;&amp; width.value() &lt;= 0) || (height.isFixed() &amp;&amp; height.value() &lt;= 0))
-        return HIDDEN;
-
-    Length top(style.top());
-    Length left(style.left());
-    if (left.isFixed() &amp;&amp; width.isFixed() &amp;&amp; -left.value() &gt;= width.value())
-        return HIDDEN;
-
-    if (top.isFixed() &amp;&amp; height.isFixed() &amp;&amp; -top.value() &gt;= height.value())
-        return HIDDEN;
-    return VISIBLE;
-}
-
-class CheckForVisibilityChangeOnRecalcStyle {
-public:
-    CheckForVisibilityChangeOnRecalcStyle(Element* element, const RenderStyle* currentStyle)
-        : m_element(element)
-        , m_previousDisplay(currentStyle ? currentStyle-&gt;display() : NONE)
-        , m_previousVisibility(currentStyle ? currentStyle-&gt;visibility() : HIDDEN)
-        , m_previousImplicitVisibility(WKObservingContentChanges() &amp;&amp; WKObservedContentChange() != WKContentVisibilityChange ? elementImplicitVisibility(element) : VISIBLE)
-    {
-    }
-    ~CheckForVisibilityChangeOnRecalcStyle()
-    {
-        if (!WKObservingContentChanges())
-            return;
-        if (m_element-&gt;isInUserAgentShadowTree())
-            return;
-        auto* style = m_element-&gt;renderStyle();
-        if (!style)
-            return;
-        if ((m_previousDisplay == NONE &amp;&amp; style-&gt;display() != NONE) || (m_previousVisibility == HIDDEN &amp;&amp; style-&gt;visibility() != HIDDEN)
-            || (m_previousImplicitVisibility == HIDDEN &amp;&amp; elementImplicitVisibility(m_element.get()) == VISIBLE))
-            WKSetObservedContentChange(WKContentVisibilityChange);
-    }
-private:
-    RefPtr&lt;Element&gt; m_element;
-    EDisplay m_previousDisplay;
-    EVisibility m_previousVisibility;
-    EVisibility m_previousImplicitVisibility;
-};
-#endif // PLATFORM(IOS)
-
</del><span class="cx"> void TreeResolver::pushParent(Element&amp; element, const RenderStyle&amp; style, Change change)
</span><span class="cx"> {
</span><span class="cx">     scope().selectorFilter.pushParent(&amp;element);
</span><span class="lines">@@ -448,9 +390,6 @@
</span><span class="cx"> 
</span><span class="cx">         bool shouldResolve = shouldResolveElement(element, parent.change) || affectedByPreviousSibling;
</span><span class="cx">         if (shouldResolve) {
</span><del>-#if PLATFORM(IOS)
-            CheckForVisibilityChangeOnRecalcStyle checkForVisibilityChange(&amp;element, element.renderStyle());
-#endif
</del><span class="cx">             element.resetComputedStyle();
</span><span class="cx"> 
</span><span class="cx">             if (element.hasCustomStyleResolveCallbacks()) {
</span></span></pre>
</div>
</div>

</body>
</html>