Changeset 244814 in webkit


Ignore:
Timestamp:
Apr 30, 2019 5:12:51 PM (5 years ago)
Author:
Devin Rousso
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):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r244812 r244814  
     12019-04-30  Devin Rousso  <drousso@apple.com>
     2
     3        Crash when running test wpt/tests/element_click/bubbling.py::test_element_disappears_during_click
     4        https://bugs.webkit.org/show_bug.cgi?id=197361
     5        <rdar://problem/49861407>
     6
     7        Reviewed by Brian Burg.
     8
     9        Don't assume that all elements have client rects (e.g. `getClientRects`). If the container
     10        element isn't visible, then the child won't be either.
     11
     12        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
     13        (WebKit::SimulatedInputDispatcher::resolveLocation):
     14        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
     15        * UIProcess/Automation/WebAutomationSession.cpp:
     16        (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
     17
    1182019-04-30  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp

    r240554 r244814  
    223223            }
    224224
    225             ASSERT(inViewCenterPoint);
     225            if (!inViewCenterPoint) {
     226                completionHandler(WTF::nullopt, AUTOMATION_COMMAND_ERROR_WITH_NAME(ElementNotInteractable));
     227                return;
     228            }
     229
    226230            destination.moveBy(inViewCenterPoint.value());
    227231            completionHandler(destination, WTF::nullopt);
     
    270274                return;
    271275            }
    272             RELEASE_ASSERT(location);
     276
     277            if (!location) {
     278                eventDispatchFinished(AUTOMATION_COMMAND_ERROR_WITH_NAME(ElementNotInteractable));
     279                return;
     280            }
     281
    273282            b.location = location;
    274283            // The "dispatch a pointer{Down,Up,Move} action" algorithms (§17.4 Dispatching Actions).
     
    304313                return;
    305314            }
    306             RELEASE_ASSERT(location);
     315
     316            if (!location) {
     317                eventDispatchFinished(AUTOMATION_COMMAND_ERROR_WITH_NAME(ElementNotInteractable));
     318                return;
     319            }
     320
    307321            b.location = location;
    308322            // The "dispatch a pointer{Down,Up,Move} action" algorithms (§17.4 Dispatching Actions).
  • trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp

    r244281 r244814  
    14621462        }
    14631463
    1464         ASSERT(inViewCenterPoint);
     1464        if (!inViewCenterPoint) {
     1465            completionHandler(WTF::nullopt, AUTOMATION_COMMAND_ERROR_WITH_NAME(ElementNotInteractable));
     1466            return;
     1467        }
     1468
    14651469        completionHandler(inViewCenterPoint, WTF::nullopt);
    14661470    };
Note: See TracChangeset for help on using the changeset viewer.