Changeset 244537 in webkit


Ignore:
Timestamp:
Apr 22, 2019 6:36:39 PM (5 years ago)
Author:
Alan Bujtas
Message:

[ContentChangeObserver] Some dropdown menus may close without user gesture on americanexpress.com
https://bugs.webkit.org/show_bug.cgi?id=197175
<rdar://problem/49613013>

Reviewed by Simon Fraser.

Source/WebKit:

Do not generate additional synthetic mouse events (e.g. mouseout in this case) when the content handles the click event. This helps cases when the synthetic mouseout ended up dismissing the dropdown menus.
However it won't regress cases like youtube.com, where sending mouseout is required to have the control bar dismissed on play.

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::completeSyntheticClick):

LayoutTests:

  • fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click-when-default-prevented-expected.txt: Added.
  • fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click-when-default-prevented.html: Added.
Location:
trunk
Files:
1 added
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r244507 r244537  
     12019-04-22  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] Some dropdown menus may close without user gesture on americanexpress.com
     4        https://bugs.webkit.org/show_bug.cgi?id=197175
     5        <rdar://problem/49613013>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click-when-default-prevented-expected.txt: Added.
     10        * fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click-when-default-prevented.html: Added.
     11
    1122019-04-22  Justin Fan  <justin_fan@apple.com>
    213
  • trunk/LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html

    r244378 r244537  
    3636</head>
    3737<body onload="test()">
    38 <div id=tapthis>PASS if 'mouseout' text is shown below.</div>
     38<button id=tapthis>PASS if 'mouseout' text is shown below.</button>
    3939<div id=becomesVisible></div>
    4040<pre id=result></pre>
  • trunk/LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click-when-default-prevented.html

    r244533 r244537  
    22<html>
    33<head>
    4 <title>This tests that we fire mouseout on synthetic click</title>
     4<title>This tests that we fire mouseout on synthetic click unless the click is preventDefaulted</title>
    55<script src="../../../../../resources/basic-gestures.js"></script>
    66<style>
     
    3636</head>
    3737<body onload="test()">
    38 <div id=tapthis>PASS if 'mouseout' text is shown below.</div>
     38<div id=tapthis>PASS if 'mouseout' text is not shown below.</div>
    3939<div id=becomesVisible></div>
    4040<pre id=result></pre>
     
    4747tapthis.addEventListener("mouseout", function( event ) {   
    4848    result.innerHTML = result.innerHTML + " mouseout triggered ";
    49     if (window.testRunner)
    50         testRunner.notifyDone();
    5149}, false);
    5250
    5351tapthis.addEventListener("click", function( event ) {   
    5452    result.innerHTML = result.innerHTML + " clicked ";
     53    event.preventDefault();
     54    if (window.testRunner)
     55        setTimeout("testRunner.notifyDone()", 0);
    5556}, false);
    5657</script>
  • trunk/Source/WebKit/ChangeLog

    r244529 r244537  
     12019-04-22  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] Some dropdown menus may close without user gesture on americanexpress.com
     4        https://bugs.webkit.org/show_bug.cgi?id=197175
     5        <rdar://problem/49613013>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Do not generate additional synthetic mouse events (e.g. mouseout in this case) when the content handles the click event. This helps cases when the synthetic mouseout ended up dismissing the dropdown menus.
     10        However it won't regress cases like youtube.com, where sending mouseout is required to have the control bar dismissed on play.
     11
     12        * WebProcess/WebPage/ios/WebPageIOS.mm:
     13        (WebKit::WebPage::completeSyntheticClick):
     14
    1152019-04-22  Alex Christensen  <achristensen@webkit.org>
    216
  • trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r244494 r244537  
    689689        elementDidRefocus(*newFocusedElement);
    690690
    691     if (nodeRespondingToClick.document().frame())
     691    if (!tapWasHandled && nodeRespondingToClick.document().frame())
    692692        nodeRespondingToClick.document().frame()->eventHandler().dispatchSyntheticMouseOut(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::NoType, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), 0, WebCore::NoTap));
    693693    if (m_isClosed)
Note: See TracChangeset for help on using the changeset viewer.