<!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>[194038] 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/194038">194038</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-12-14 10:07:19 -0800 (Mon, 14 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] DOM click event may not be dispatched when page has :active style and &lt;input type=&quot;search&quot;&gt;
https://bugs.webkit.org/show_bug.cgi?id=144451
&lt;rdar://problem/23099482&gt;

Patch by Daniel Bates &lt;dabates@apple.com&gt; on 2015-12-14
Reviewed by Simon Fraser.

Source/WebCore:

Fixes an issue where a DOM click event is not dispatched to an element in a subframe on a page
that has a &lt;input type=&quot;search&quot;&gt; and defines a CSS :active pseudo-class for the HTML body element.

On iOS we only dispatch a DOM click event if the content of the page does not change as part of
dispatching a DOM mousemove event at the tapped element as a means of providing a good user
experience on web pages that reveal or hide content based on mouse hover. Currently we consider
the content of the page to have changed if the visibility of any element on the page changes.
In particular we consider the content of the page to have changed if the visibility of a user
agent shadow DOM element changes (e.g. the search field cancel button). Instead we should only
consider visibility changes to the actual web page content and ignore visibility changes to
user agent shadow DOM elements.

Tests: fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html
       fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html
       fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html
       fast/forms/search/search-cancel-in-formerly-invisible-element.html
       fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html
       fast/forms/search/search-cancel-toggle-visibility-initially-visible.html

* style/StyleResolveTree.cpp:
(WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::~CheckForVisibilityChangeOnRecalcStyle):
Ignore visibility changes to user agent shadow DOM elements.

LayoutTests:

Add a test to ensure that a DOM click event is dispatched to an element in a subframe on a page
with a search field and that specifies a CSS :active pseudo-class that changes the tap highlight
color.

Additionally, add tests to ensure we update the cancel button visibility whenever the visibility
of the search field changes.

* fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field-expected.txt: Added.
* fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html: Added.
* fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled-expected.html: Added.
* fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html: Added.
* fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly-expected.html: Added.
* fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html: Added.
* fast/forms/search/search-cancel-in-formerly-invisible-element-expected.html: Added.
* fast/forms/search/search-cancel-in-formerly-invisible-element.html: Added.
* fast/forms/search/search-cancel-toggle-visibility-initially-hidden-expected.html: Added.
* fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html: Added.
* fast/forms/search/search-cancel-toggle-visibility-initially-visible-expected.html: Added.
* fast/forms/search/search-cancel-toggle-visibility-initially-visible.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorestyleStyleResolveTreecpp">trunk/Source/WebCore/style/StyleResolveTree.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasteventscanclickelementonpagewithactivepseudoclassandsearchfieldexpectedtxt">trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventscanclickelementonpagewithactivepseudoclassandsearchfieldhtml">trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html</a></li>
<li><a href="#trunkLayoutTestsfastformssearchsearchcancelbuttonvisiblewheninputbecomesdisabledexpectedhtml">trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastformssearchsearchcancelbuttonvisiblewheninputbecomesdisabledhtml">trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html</a></li>
<li><a href="#trunkLayoutTestsfastformssearchsearchcancelbuttonvisiblewheninputbecomesreadonlyexpectedhtml">trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastformssearchsearchcancelbuttonvisiblewheninputbecomesreadonlyhtml">trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html</a></li>
<li><a href="#trunkLayoutTestsfastformssearchsearchcancelinformerlyinvisibleelementexpectedhtml">trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastformssearchsearchcancelinformerlyinvisibleelementhtml">trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element.html</a></li>
<li><a href="#trunkLayoutTestsfastformssearchsearchcanceltogglevisibilityinitiallyhiddenexpectedhtml">trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastformssearchsearchcanceltogglevisibilityinitiallyhiddenhtml">trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html</a></li>
<li><a href="#trunkLayoutTestsfastformssearchsearchcanceltogglevisibilityinitiallyvisibleexpectedhtml">trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastformssearchsearchcanceltogglevisibilityinitiallyvisiblehtml">trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (194037 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-12-14 17:44:17 UTC (rev 194037)
+++ trunk/LayoutTests/ChangeLog        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2015-12-14  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        [iOS] DOM click event may not be dispatched when page has :active style and &lt;input type=&quot;search&quot;&gt;
+        https://bugs.webkit.org/show_bug.cgi?id=144451
+        &lt;rdar://problem/23099482&gt;
+
+        Reviewed by Simon Fraser.
+
+        Add a test to ensure that a DOM click event is dispatched to an element in a subframe on a page
+        with a search field and that specifies a CSS :active pseudo-class that changes the tap highlight
+        color.
+
+        Additionally, add tests to ensure we update the cancel button visibility whenever the visibility
+        of the search field changes.
+
+        * fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field-expected.txt: Added.
+        * fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html: Added.
+        * fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled-expected.html: Added.
+        * fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html: Added.
+        * fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly-expected.html: Added.
+        * fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html: Added.
+        * fast/forms/search/search-cancel-in-formerly-invisible-element-expected.html: Added.
+        * fast/forms/search/search-cancel-in-formerly-invisible-element.html: Added.
+        * fast/forms/search/search-cancel-toggle-visibility-initially-hidden-expected.html: Added.
+        * fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html: Added.
+        * fast/forms/search/search-cancel-toggle-visibility-initially-visible-expected.html: Added.
+        * fast/forms/search/search-cancel-toggle-visibility-initially-visible.html: Added.
+
</ins><span class="cx"> 2015-12-14  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Roll out r193974 and follow-up fixes as it caused JSC crashes
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventscanclickelementonpagewithactivepseudoclassandsearchfieldexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field-expected.txt (0 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field-expected.txt        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+Test that an element, with an onclick handler and an empty ontouchstart attribute, in an &lt;iframe&gt; on a page with a search field and specifies an :active pseudo-class for &lt;body&gt; receives a DOM click event when tapped. To run this test by hand, click the blue square below.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+PASS clicked blue square
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventscanclickelementonpagewithactivepseudoclassandsearchfieldhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html (0 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html                                (rev 0)
+++ trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+body:active {
+    /* Must be non-empty. */
+    -webkit-tap-highlight-color: yellow;
+}
+&lt;/style&gt;
+&lt;script&gt;
+window.jsTestIsAsync = true;
+
+function notifyPass()
+{
+    testPassed(&quot;clicked blue square&quot;);
+
+    var testContainer = document.getElementById(&quot;test-container&quot;);
+    testContainer.parentNode.removeChild(testContainer);
+    finishJSTest();
+}
+
+function runTest()
+{
+    if (!window.testRunner)
+        return;
+    var iframe = document.getElementById(&quot;iframe&quot;);
+    var square = iframe.contentDocument.getElementById(&quot;square&quot;);
+    var x = iframe.offsetLeft + square.offsetLeft + Math.floor(square.offsetWidth / 2);
+    var y = iframe.offsetTop + square.offsetTop + Math.floor(square.offsetHeight / 2);
+    if (testRunner.runUIScript &amp;&amp; window.TouchEvent)
+        testRunner.runUIScript(&quot;(function() { uiController.singleTapAtPoint(&quot; + x + &quot;, &quot; + y + &quot;); })()&quot;);
+    else if (window.eventSender) {
+        eventSender.mouseMoveTo(x, y);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div id=&quot;description&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;test-container&quot;&gt;
+    &lt;p&gt;&lt;input type=&quot;search&quot; placeholder=&quot;Do not click me&quot;&gt;&lt;/p&gt;
+    &lt;iframe id=&quot;iframe&quot; width=&quot;128&quot; height=&quot;128&quot; onload=&quot;runTest()&quot; srcdoc='
+        &lt;style&gt;
+            body {
+                margin: 0;
+                padding 0;
+            }
+            #square {
+                -webkit-box-align: center;
+                -webkit-box-pack: center;
+                -webkit-user-select: none;
+                background-color: blue;
+                color: white;
+                cursor: pointer;
+                display: -webkit-box;
+                height: 128px;
+                width: 128px;
+            }
+        &lt;/style&gt;
+        &lt;div id=&quot;square&quot; ontouchstart=&quot;&quot; onclick=&quot;window.parent.notifyPass()&quot;&gt;Click me&lt;/div&gt;&lt;!-- Intentionally empty attribute ontouchstart. --&gt;
+    '&gt;&lt;/iframe&gt;
+&lt;/div&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+description(&quot;Test that an element, with an onclick handler and an empty ontouchstart attribute, in an &amp;lt;iframe&amp;gt; on a page with a search field and specifies an &lt;code&gt;:active&lt;/code&gt; pseudo-class for &amp;lt;body&amp;gt; receives a DOM click event when tapped. To run this test by hand, click the blue square below.&quot;);
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformssearchsearchcancelbuttonvisiblewheninputbecomesdisabledexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled-expected.html (0 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled-expected.html        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;This tests that the search cancel button renders when the field becomes disabled (no change).&lt;/p&gt;
+&lt;input type=&quot;search&quot; value=&quot;search&quot; disabled&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformssearchsearchcancelbuttonvisiblewheninputbecomesdisabledhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html (0 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;This tests that the search cancel button renders when the field becomes disabled (no change).&lt;/p&gt;
+&lt;input type=&quot;search&quot; id=&quot;search&quot; value=&quot;search&quot;&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+var search = document.getElementById(&quot;search&quot;);
+
+function makeFieldDisabledAndNotifyDone()
+{
+    search.disabled = true;
+    if (window.internals)
+        internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window.setTimeout(makeFieldDisabledAndNotifyDone, 0);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformssearchsearchcancelbuttonvisiblewheninputbecomesreadonlyexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly-expected.html (0 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly-expected.html        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;This tests that the search cancel button renders when the field becomes read only (no change).&lt;/p&gt;
+&lt;input type=&quot;search&quot; value=&quot;search&quot; readonly&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformssearchsearchcancelbuttonvisiblewheninputbecomesreadonlyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html (0 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;This tests that the search cancel button renders when the field becomes read only (no change).&lt;/p&gt;
+&lt;input type=&quot;search&quot; id=&quot;search&quot; value=&quot;search&quot;&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+var search = document.getElementById(&quot;search&quot;);
+
+function makeFieldReadOnlyAndNotifyDone()
+{
+    search.readOnly = true;
+    if (window.internals)
+        internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window.setTimeout(makeFieldReadOnlyAndNotifyDone, 0);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformssearchsearchcancelinformerlyinvisibleelementexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element-expected.html (0 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element-expected.html        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;input type=&quot;search&quot; value=&quot;search&quot;&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformssearchsearchcancelinformerlyinvisibleelementhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element.html (0 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-in-formerly-invisible-element.html        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;input type=&quot;search&quot; id=&quot;search&quot; value=&quot;search&quot; style=&quot;visibility: hidden&quot;&gt;
+&lt;script&gt;
+document.getElementById(&quot;search&quot;).style.visibility = &quot;visible&quot;;
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformssearchsearchcanceltogglevisibilityinitiallyhiddenexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden-expected.html (0 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden-expected.html        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+.width-200px {
+    width: 200px;
+}
+&lt;/style&gt;
+&lt;body&gt;
+&lt;p&gt;Tests that the search cancel button is not shown after changing the visibility of &amp;lt;input type=&amp;quot;search&amp;quot;&amp;gt; from hidden to visible to hidden. This test passed if you do not see the search cancel button in the blue outlined box (below).&lt;/p&gt;
+&lt;div class=&quot;width-200px&quot; style=&quot;border: 1px solid blue&quot;&gt;
+    &lt;input type=&quot;search&quot; value=&quot;search&quot; class=&quot;width-200px&quot; style=&quot;visibility: hidden&quot;&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformssearchsearchcanceltogglevisibilityinitiallyhiddenhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html (0 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+.width-200px {
+    width: 200px;
+}
+&lt;/style&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.waitUntilDone();
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Tests that the search cancel button is not shown after changing the visibility of &amp;lt;input type=&amp;quot;search&amp;quot;&amp;gt; from hidden to visible to hidden. This test passed if you do not see the search cancel button in the blue outlined box (below).&lt;/p&gt;
+&lt;div class=&quot;width-200px&quot; style=&quot;border: 1px solid blue&quot;&gt;
+    &lt;input type=&quot;search&quot; id=&quot;search&quot; value=&quot;search&quot; class=&quot;width-200px&quot; style=&quot;visibility: hidden&quot;&gt;
+&lt;/div&gt;
+&lt;script&gt;
+var search = document.getElementById(&quot;search&quot;);
+search.style.visibility = &quot;visible&quot;;
+function done() {
+    search.style.visibility = &quot;hidden&quot;;
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+window.setTimeout(done, 0);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformssearchsearchcanceltogglevisibilityinitiallyvisibleexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible-expected.html (0 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible-expected.html        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+.width-200px {
+    width: 200px;
+}
+&lt;/style&gt;
+&lt;body&gt;
+&lt;p&gt;Tests that the search cancel button is not shown after changing the visibility of &amp;lt;input type=&amp;quot;search&amp;quot;&amp;gt; from visible to hidden to visible. This test passed if you see the search cancel button in the blue outlined box (below).&lt;/p&gt;
+&lt;div class=&quot;width-200px&quot; style=&quot;border: 1px solid blue&quot;&gt;
+    &lt;input type=&quot;search&quot; value=&quot;search&quot; class=&quot;width-200px&quot;&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformssearchsearchcanceltogglevisibilityinitiallyvisiblehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible.html (0 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/search/search-cancel-toggle-visibility-initially-visible.html        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+.width-200px {
+    width: 200px;
+}
+&lt;/style&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.waitUntilDone();
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Tests that the search cancel button is not shown after changing the visibility of &amp;lt;input type=&amp;quot;search&amp;quot;&amp;gt; from visible to hidden to visible. This test passed if you see the search cancel button in the blue outlined box (below).&lt;/p&gt;
+&lt;div class=&quot;width-200px&quot; style=&quot;border: 1px solid blue&quot;&gt;
+    &lt;input type=&quot;search&quot; id=&quot;search&quot; value=&quot;search&quot; class=&quot;width-200px&quot;&gt;
+&lt;/div&gt;
+&lt;script&gt;
+var search = document.getElementById(&quot;search&quot;);
+search.style.visibility = &quot;hidden&quot;;
+function done() {
+    search.style.visibility = &quot;visible&quot;;
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+window.setTimeout(done, 0);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (194037 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-12-14 17:44:17 UTC (rev 194037)
+++ trunk/Source/WebCore/ChangeLog        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2015-12-14  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        [iOS] DOM click event may not be dispatched when page has :active style and &lt;input type=&quot;search&quot;&gt;
+        https://bugs.webkit.org/show_bug.cgi?id=144451
+        &lt;rdar://problem/23099482&gt;
+
+        Reviewed by Simon Fraser.
+
+        Fixes an issue where a DOM click event is not dispatched to an element in a subframe on a page
+        that has a &lt;input type=&quot;search&quot;&gt; and defines a CSS :active pseudo-class for the HTML body element.
+
+        On iOS we only dispatch a DOM click event if the content of the page does not change as part of
+        dispatching a DOM mousemove event at the tapped element as a means of providing a good user
+        experience on web pages that reveal or hide content based on mouse hover. Currently we consider
+        the content of the page to have changed if the visibility of any element on the page changes.
+        In particular we consider the content of the page to have changed if the visibility of a user
+        agent shadow DOM element changes (e.g. the search field cancel button). Instead we should only
+        consider visibility changes to the actual web page content and ignore visibility changes to
+        user agent shadow DOM elements.
+
+        Tests: fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html
+               fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html
+               fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html
+               fast/forms/search/search-cancel-in-formerly-invisible-element.html
+               fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html
+               fast/forms/search/search-cancel-toggle-visibility-initially-visible.html
+
+        * style/StyleResolveTree.cpp:
+        (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::~CheckForVisibilityChangeOnRecalcStyle):
+        Ignore visibility changes to user agent shadow DOM elements.
+
</ins><span class="cx"> 2015-12-14  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         [Streams API] Directly use @then as much as possible
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleResolveTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleResolveTree.cpp (194037 => 194038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleResolveTree.cpp        2015-12-14 17:44:17 UTC (rev 194037)
+++ trunk/Source/WebCore/style/StyleResolveTree.cpp        2015-12-14 18:07:19 UTC (rev 194038)
</span><span class="lines">@@ -757,6 +757,8 @@
</span><span class="cx">     {
</span><span class="cx">         if (!WKObservingContentChanges())
</span><span class="cx">             return;
</span><ins>+        if (m_element-&gt;isInUserAgentShadowTree())
+            return;
</ins><span class="cx">         RenderStyle* style = m_element-&gt;renderStyle();
</span><span class="cx">         if (!style)
</span><span class="cx">             return;
</span></span></pre>
</div>
</div>

</body>
</html>