⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 238280 in webkit


Ignore:
Timestamp:
Nov 16, 2018, 7:07:17 AM (8 years ago)
Author:
Alan Bujtas
Message:

Source/WebCore:
[iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com (hover vs click).
https://bugs.webkit.org/show_bug.cgi?id=191712
<rdar://problem/45612900>

Reviewed by Simon Fraser.

In handleSyntheticClick() we use WKContentObservation to figure out whether the tap should be treated as a hover or a click.
In general, if the mouse-move event triggers a visible content change, we assume we hit a hover-like drop down menu (or something similar)
and no need to dispatch a click event.
The idea here is that if the new content (result of the mouse-move event) does not respond to mouse click, it is most likely
only for tooltip-like reasons and it's ok to proceed with the click event.

Test: fast/events/touch/ios/click-instead-of-hover-simple.html

  • rendering/updating/RenderTreeUpdater.cpp:

(WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):

LayoutTests:
[iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com
https://bugs.webkit.org/show_bug.cgi?id=191712
<rdar://problem/45612900>

Reviewed by Simon Fraser.

  • fast/events/touch/ios/click-instead-of-hover-simple-expected.txt: Added.
  • fast/events/touch/ios/click-instead-of-hover-simple.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r238279 r238280  
     12018-11-16  Zalan Bujtas  <zalan@apple.com>
     2
     3        [iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com
     4        https://bugs.webkit.org/show_bug.cgi?id=191712
     5        <rdar://problem/45612900>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/events/touch/ios/click-instead-of-hover-simple-expected.txt: Added.
     10        * fast/events/touch/ios/click-instead-of-hover-simple.html: Added.
     11
    1122018-11-16  Zalan Bujtas  <zalan@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r238279 r238280  
     12018-11-16  Zalan Bujtas  <zalan@apple.com>
     2
     3        [iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com (hover vs click).
     4        https://bugs.webkit.org/show_bug.cgi?id=191712
     5        <rdar://problem/45612900>
     6
     7        Reviewed by Simon Fraser.
     8
     9        In handleSyntheticClick() we use WKContentObservation to figure out whether the tap should be treated as a hover or a click.
     10        In general, if the mouse-move event triggers a visible content change, we assume we hit a hover-like drop down menu (or something similar)
     11        and no need to dispatch a click event.
     12        The idea here is that if the new content (result of the mouse-move event) does not respond to mouse click, it is most likely
     13        only for tooltip-like reasons and it's ok to proceed with the click event.
     14
     15        Test: fast/events/touch/ios/click-instead-of-hover-simple.html
     16
     17        * rendering/updating/RenderTreeUpdater.cpp:
     18        (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
     19
    1202018-11-16  Zalan Bujtas  <zalan@apple.com>
    221
  • trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp

    r237468 r238280  
    680680    if (!WKObservingContentChanges())
    681681        return;
    682     if (m_element.isInUserAgentShadowTree())
    683         return;
     682
    684683    auto* style = m_element.renderStyle();
    685     if (!style)
     684
     685    auto qualifiesForVisibilityCheck = [&] {
     686        if (!style)
     687            return false;
     688        if (m_element.isInUserAgentShadowTree())
     689            return false;
     690        if (!const_cast<Element&>(m_element).willRespondToMouseClickEvents())
     691            return false;
     692        return true;
     693    };
     694
     695    if (!qualifiesForVisibilityCheck())
    686696        return;
    687697    if ((m_previousDisplay == DisplayType::None && style->display() != DisplayType::None) || (m_previousVisibility == Visibility::Hidden && style->visibility() != Visibility::Hidden)
Note: See TracChangeset for help on using the changeset viewer.