Title: [244814] trunk/Source/WebKit
Revision
244814
Author
[email protected]
Date
2019-04-30 17:12:51 -0700 (Tue, 30 Apr 2019)

Log Message

Crash when running test wpt/tests/element_click/bubbling.py::test_element_disappears_during_click
https://bugs.webkit.org/show_bug.cgi?id=197361
<rdar://problem/49861407>

Reviewed by Brian Burg.

Don't assume that all elements have client rects (e.g. `getClientRects`). If the container
element isn't visible, then the child won't be either.

* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::resolveLocation):
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (244813 => 244814)


--- trunk/Source/WebKit/ChangeLog	2019-04-30 23:56:20 UTC (rev 244813)
+++ trunk/Source/WebKit/ChangeLog	2019-05-01 00:12:51 UTC (rev 244814)
@@ -1,3 +1,20 @@
+2019-04-30  Devin Rousso  <[email protected]>
+
+        Crash when running test wpt/tests/element_click/bubbling.py::test_element_disappears_during_click
+        https://bugs.webkit.org/show_bug.cgi?id=197361
+        <rdar://problem/49861407>
+
+        Reviewed by Brian Burg.
+
+        Don't assume that all elements have client rects (e.g. `getClientRects`). If the container
+        element isn't visible, then the child won't be either.
+
+        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
+        (WebKit::SimulatedInputDispatcher::resolveLocation):
+        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
+
 2019-04-30  Chris Dumez  <[email protected]>
 
         Unreviewed, rolling out r244802.

Modified: trunk/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp (244813 => 244814)


--- trunk/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp	2019-04-30 23:56:20 UTC (rev 244813)
+++ trunk/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp	2019-05-01 00:12:51 UTC (rev 244814)
@@ -222,7 +222,11 @@
                 return;
             }
 
-            ASSERT(inViewCenterPoint);
+            if (!inViewCenterPoint) {
+                completionHandler(WTF::nullopt, AUTOMATION_COMMAND_ERROR_WITH_NAME(ElementNotInteractable));
+                return;
+            }
+
             destination.moveBy(inViewCenterPoint.value());
             completionHandler(destination, WTF::nullopt);
         });
@@ -269,7 +273,12 @@
                 eventDispatchFinished(error);
                 return;
             }
-            RELEASE_ASSERT(location);
+
+            if (!location) {
+                eventDispatchFinished(AUTOMATION_COMMAND_ERROR_WITH_NAME(ElementNotInteractable));
+                return;
+            }
+
             b.location = location;
             // The "dispatch a pointer{Down,Up,Move} action" algorithms (§17.4 Dispatching Actions).
             if (!a.pressedMouseButton && b.pressedMouseButton) {
@@ -303,7 +312,12 @@
                 eventDispatchFinished(error);
                 return;
             }
-            RELEASE_ASSERT(location);
+
+            if (!location) {
+                eventDispatchFinished(AUTOMATION_COMMAND_ERROR_WITH_NAME(ElementNotInteractable));
+                return;
+            }
+
             b.location = location;
             // The "dispatch a pointer{Down,Up,Move} action" algorithms (§17.4 Dispatching Actions).
             if (!a.pressedMouseButton && b.pressedMouseButton) {

Modified: trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp (244813 => 244814)


--- trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp	2019-04-30 23:56:20 UTC (rev 244813)
+++ trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp	2019-05-01 00:12:51 UTC (rev 244814)
@@ -1461,7 +1461,11 @@
             return;
         }
 
-        ASSERT(inViewCenterPoint);
+        if (!inViewCenterPoint) {
+            completionHandler(WTF::nullopt, AUTOMATION_COMMAND_ERROR_WITH_NAME(ElementNotInteractable));
+            return;
+        }
+
         completionHandler(inViewCenterPoint, WTF::nullopt);
     };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to