Title: [247098] trunk
Revision
247098
Author
za...@apple.com
Date
2019-07-03 12:53:01 -0700 (Wed, 03 Jul 2019)

Log Message

Source/WebKit:
[ContentChangeObserver] REGRESSION (r244356): Drop down menus collapse without user input - Ebay.com
https://bugs.webkit.org/show_bug.cgi?id=199457
<rdar://problem/52386563>

Reviewed by Simon Fraser.

There's a fixed, 32ms window for observing content changes after the tap is committed. r244356 introduced the fast-click behavior on form elements by omitting this fixed window and
dispatch the synthetic click on the target node.
This patch preserves the fast-click behavior, but now we stay at hover if the mouseMove event triggers a synchronous actionable visiblity change (as opposed to always proceed with click).

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):

LayoutTests:
REGRESSION (r244356): Drop down menus collapse without user input - Ebay.com
https://bugs.webkit.org/show_bug.cgi?id=199457
<rdar://problem/52386563>

Reviewed by Simon Fraser.

* fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-async-clickable-change-expected.txt: Added.
* fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-async-clickable-change.html: Copied from LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element.html.
* fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-clickable-change-expected.txt: Added.
* fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-clickable-change.html: Copied from LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element.html.
* fast/events/touch/ios/content-observation/tap-on-input-type-button-element.html:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (247097 => 247098)


--- trunk/LayoutTests/ChangeLog	2019-07-03 19:52:42 UTC (rev 247097)
+++ trunk/LayoutTests/ChangeLog	2019-07-03 19:53:01 UTC (rev 247098)
@@ -1,3 +1,17 @@
+2019-07-03  Zalan Bujtas  <za...@apple.com>
+
+        REGRESSION (r244356): Drop down menus collapse without user input - Ebay.com
+        https://bugs.webkit.org/show_bug.cgi?id=199457
+        <rdar://problem/52386563>
+
+        Reviewed by Simon Fraser.
+
+        * fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-async-clickable-change-expected.txt: Added.
+        * fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-async-clickable-change.html: Copied from LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element.html.
+        * fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-clickable-change-expected.txt: Added.
+        * fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-clickable-change.html: Copied from LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element.html.
+        * fast/events/touch/ios/content-observation/tap-on-input-type-button-element.html:
+
 2019-07-03  Andres Gonzalez  <andresg...@apple.com>
 
         Safari hanging while loading pages - WebCore::AccessibilityRenderObject::visiblePositionRangeForLine.

Modified: trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-looking-div-with-role.html (247097 => 247098)


--- trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-looking-div-with-role.html	2019-07-03 19:52:42 UTC (rev 247097)
+++ trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-looking-div-with-role.html	2019-07-03 19:53:01 UTC (rev 247098)
@@ -43,10 +43,6 @@
     becomesVisible.style.visibility = "visible";
 }, false);
 
-becomesVisible.addEventListener("click", function( event ) {   
-    result.innerHTML = "clicked hidden";
-}, false);
-
 tapthis.addEventListener("click", function( event ) {   
     result.innerHTML = "clicked";
     if (window.testRunner)

Added: trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-async-clickable-change-expected.txt (0 => 247098)


--- trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-async-clickable-change-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-async-clickable-change-expected.txt	2019-07-03 19:53:01 UTC (rev 247098)
@@ -0,0 +1,3 @@
+PASS if 'clicked' text is shown below.
+
+clicked

Copied: trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-async-clickable-change.html (from rev 247096, trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element.html) (0 => 247098)


--- trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-async-clickable-change.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-async-clickable-change.html	2019-07-03 19:53:01 UTC (rev 247098)
@@ -0,0 +1,57 @@
+<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+<html>
+<head>
+<title>This tests the case when the tap target node is a form control element but it triggers async actionable visibility change -> click (we want to preserve fast click behavior on form controls).</title>
+<script src=""
+<style>
+#becomesVisible {
+    visibility: hidden;
+    width: 100px;
+    height: 100px;
+    background-color: green;
+	transition-property: opacity, left;
+	transition-duration: 100ms, 200ms;
+}
+</style>
+<script>
+async function test() {
+    if (!window.testRunner || !testRunner.runUIScript)
+        return;
+    if (window.internals)
+        internals.settings.setContentChangeObserverEnabled(true);
+
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+
+    let rect = tapthis.getBoundingClientRect();
+    let x = rect.left + rect.width / 2;
+    let y = rect.top + rect.height / 2;
+
+    await tapAtPoint(x, y);
+}
+</script>
+</head>
+<body _onload_="test()">
+PASS if 'clicked' text is shown below.<br>
+<input type="button" value="tap this button" id=tapthis>
+<div id=becomesVisible></div>
+<pre id=result></pre>
+<script>
+tapthis.addEventListener("mousemove", function( event ) {
+    setTimeout(function() {
+        becomesVisible.style.visibility = "visible";
+    }, 100);
+}, false);
+
+becomesVisible.addEventListener("click", function( event ) {   
+    result.innerHTML = "clicked hidden";
+}, false);
+
+tapthis.addEventListener("click", function( event ) {   
+    result.innerHTML = "clicked";
+    if (window.testRunner)
+        testRunner.notifyDone();
+}, false);
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-clickable-change-expected.txt (0 => 247098)


--- trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-clickable-change-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-clickable-change-expected.txt	2019-07-03 19:53:01 UTC (rev 247098)
@@ -0,0 +1,3 @@
+PASS if 'clicked' text is NOT shown below.
+
+

Copied: trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-clickable-change.html (from rev 247096, trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element.html) (0 => 247098)


--- trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-clickable-change.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element-with-clickable-change.html	2019-07-03 19:53:01 UTC (rev 247098)
@@ -0,0 +1,55 @@
+<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+<html>
+<head>
+<title>This tests the case when the tap target node is a form control element but it triggers synchronous actionable visibility change -> "fast" hover.</title>
+<script src=""
+<style>
+#becomesVisible {
+    visibility: hidden;
+    width: 100px;
+    height: 100px;
+    background-color: green;
+	transition-property: opacity, left;
+	transition-duration: 100ms, 200ms;
+}
+</style>
+<script>
+async function test() {
+    if (!window.testRunner || !testRunner.runUIScript)
+        return;
+    if (window.internals)
+        internals.settings.setContentChangeObserverEnabled(true);
+
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+
+    let rect = tapthis.getBoundingClientRect();
+    let x = rect.left + rect.width / 2;
+    let y = rect.top + rect.height / 2;
+
+    await tapAtPoint(x, y);
+}
+</script>
+</head>
+<body _onload_="test()">
+PASS if 'clicked' text is NOT shown below.<br>
+<input type="button" value="tap this button" id=tapthis>
+<div id=becomesVisible></div>
+<pre id=result></pre>
+<script>
+tapthis.addEventListener("mousemove", function( event ) {
+    becomesVisible.style.visibility = "visible";
+    if (window.testRunner)
+        setTimeout("testRunner.notifyDone()", 50);
+}, false);
+
+becomesVisible.addEventListener("click", function( event ) {   
+    result.innerHTML = "clicked hidden";
+}, false);
+
+tapthis.addEventListener("click", function( event ) {   
+    result.innerHTML = "clicked";
+}, false);
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element.html (247097 => 247098)


--- trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element.html	2019-07-03 19:52:42 UTC (rev 247097)
+++ trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-button-element.html	2019-07-03 19:53:01 UTC (rev 247098)
@@ -1,7 +1,7 @@
 <!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
 <html>
 <head>
-<title>This tests the case when the tap target node is a form control element.</title>
+<title>This tests the case when the tap target node is a form control element -> "fast" click.</title>
 <script src=""
 <style>
 #becomesVisible {
@@ -41,10 +41,6 @@
     becomesVisible.style.visibility = "visible";
 }, false);
 
-becomesVisible.addEventListener("click", function( event ) {   
-    result.innerHTML = "clicked hidden";
-}, false);
-
 tapthis.addEventListener("click", function( event ) {   
     result.innerHTML = "clicked";
     if (window.testRunner)

Modified: trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-text-element.html (247097 => 247098)


--- trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-text-element.html	2019-07-03 19:52:42 UTC (rev 247097)
+++ trunk/LayoutTests/fast/events/touch/ios/content-observation/tap-on-input-type-text-element.html	2019-07-03 19:53:01 UTC (rev 247098)
@@ -41,10 +41,6 @@
     becomesVisible.style.visibility = "visible";
 }, false);
 
-becomesVisible.addEventListener("click", function( event ) {   
-    result.innerHTML = "clicked hidden";
-}, false);
-
 tapthis.addEventListener("click", function( event ) {   
     result.innerHTML = "clicked";
     if (window.testRunner)

Modified: trunk/Source/WebKit/ChangeLog (247097 => 247098)


--- trunk/Source/WebKit/ChangeLog	2019-07-03 19:52:42 UTC (rev 247097)
+++ trunk/Source/WebKit/ChangeLog	2019-07-03 19:53:01 UTC (rev 247098)
@@ -1,3 +1,18 @@
+2019-07-03  Zalan Bujtas  <za...@apple.com>
+
+        [ContentChangeObserver] REGRESSION (r244356): Drop down menus collapse without user input - Ebay.com
+        https://bugs.webkit.org/show_bug.cgi?id=199457
+        <rdar://problem/52386563>
+
+        Reviewed by Simon Fraser.
+
+        There's a fixed, 32ms window for observing content changes after the tap is committed. r244356 introduced the fast-click behavior on form elements by omitting this fixed window and
+        dispatch the synthetic click on the target node.
+        This patch preserves the fast-click behavior, but now we stay at hover if the mouseMove event triggers a synchronous actionable visiblity change (as opposed to always proceed with click).
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::handleSyntheticClick):
+
 2019-07-03  Patrick Griffis  <pgrif...@igalia.com>
 
         [GTK][WPE] Remove Flatpak sandbox

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (247097 => 247098)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-07-03 19:52:42 UTC (rev 247097)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-07-03 19:53:01 UTC (rev 247098)
@@ -575,7 +575,7 @@
     mainFrame.eventHandler().dispatchSyntheticMouseMove(mouseEvent);
 }
 
-static bool nodeAlwaysTriggersClick(const Node& targetNode)
+static bool nodeTriggersFastPath(const Node& targetNode)
 {
     if (!is<Element>(targetNode))
         return false;
@@ -683,9 +683,9 @@
     }
 
     auto observedContentChange = contentChangeObserver.observedContentChange();
-    auto targetNodeTriggersClick = nodeAlwaysTriggersClick(nodeRespondingToClick);
+    auto targetNodeTriggersFastPath = nodeTriggersFastPath(nodeRespondingToClick);
 
-    auto continueContentObservation = !(observedContentChange == WKContentVisibilityChange || targetNodeTriggersClick);
+    auto continueContentObservation = !(observedContentChange == WKContentVisibilityChange || targetNodeTriggersFastPath);
     if (continueContentObservation) {
         // Wait for callback to completePendingSyntheticClickForContentChangeObserver() to decide whether to send the click event.
         const Seconds observationDuration = 32_ms;
@@ -698,11 +698,11 @@
         return;
     }
 
-    callOnMainThread([protectedThis = makeRefPtr(this), targetNode = Ref<Node>(nodeRespondingToClick), location, modifiers, observedContentChange, targetNodeTriggersClick, pointerId] {
+    callOnMainThread([protectedThis = makeRefPtr(this), targetNode = Ref<Node>(nodeRespondingToClick), location, modifiers, observedContentChange, pointerId] {
         if (protectedThis->m_isClosed || !protectedThis->corePage())
             return;
 
-        auto shouldStayAtHoverState = observedContentChange == WKContentVisibilityChange && !targetNodeTriggersClick;
+        auto shouldStayAtHoverState = observedContentChange == WKContentVisibilityChange;
         if (shouldStayAtHoverState) {
             // The move event caused new contents to appear. Don't send synthetic click event, but just ensure that the mouse is on the most recent content.
             dispatchSyntheticMouseMove(protectedThis->corePage()->mainFrame(), location, modifiers, pointerId);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to