Changeset 248499 in webkit


Ignore:
Timestamp:
Aug 10, 2019 3:38:00 AM (5 years ago)
Author:
Antti Koivisto
Message:

Can’t sort videos on a YouTube channel page on iPad
https://bugs.webkit.org/show_bug.cgi?id=200573
<rdar://problem/53415195>

Reviewed by Darin Adler.

Add a quirk to make touch events non-cancelable (preventDefault() does nothing).

  • page/Quirks.cpp:

(WebCore::Quirks::shouldMakeTouchEventNonCancelableForTarget const):

  • page/Quirks.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r248497 r248499  
     12019-08-10  Antti Koivisto  <antti@apple.com>
     2
     3        Can’t sort videos on a YouTube channel page on iPad
     4        https://bugs.webkit.org/show_bug.cgi?id=200573
     5        <rdar://problem/53415195>
     6
     7        Reviewed by Darin Adler.
     8
     9        Add a quirk to make touch events non-cancelable (preventDefault() does nothing).
     10
     11        * page/Quirks.cpp:
     12        (WebCore::Quirks::shouldMakeTouchEventNonCancelableForTarget const):
     13        * page/Quirks.h:
     14
    1152019-08-10  Devin Rousso  <drousso@apple.com>
    216
  • trunk/Source/WebCore/page/Quirks.cpp

    r248463 r248499  
    348348    return Event::IsCancelable::Yes;
    349349}
     350
     351bool Quirks::shouldMakeTouchEventNonCancelableForTarget(EventTarget* target) const
     352{
     353    if (!needsQuirks())
     354        return false;
     355
     356    auto host = m_document->topDocument().url().host();
     357
     358    if (equalLettersIgnoringASCIICase(host, "www.youtube.com")) {
     359        if (is<Element>(target)) {
     360            unsigned depth = 3;
     361            for (auto* element = downcast<Element>(target); element && depth; element = element->parentElement(), --depth) {
     362                if (element->localName() == "paper-item" && element->classList().contains("yt-dropdown-menu"))
     363                    return true;
     364            }
     365        }
     366    }
     367
     368    return false;
     369}
    350370#endif
    351371
  • trunk/Source/WebCore/page/Quirks.h

    r248463 r248499  
    5555    bool shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented(EventTarget*) const;
    5656    Optional<Event::IsCancelable> simulatedMouseEventTypeForTarget(EventTarget*) const;
     57    bool shouldMakeTouchEventNonCancelableForTarget(EventTarget*) const;
    5758#endif
    5859    bool shouldDisablePointerEventsQuirk() const;
Note: See TracChangeset for help on using the changeset viewer.