Changeset 247627 in webkit


Ignore:
Timestamp:
Jul 18, 2019 5:23:31 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Enable simulated mouse events quirk for soundcloud.com
https://bugs.webkit.org/show_bug.cgi?id=199908
<rdar://problem/52915981>

Patch by Antoine Quint <Antoine Quint> on 2019-07-18
Reviewed by Brent Fulgham.

Scrubbing on soundcloud.com relies on mouse events alone when displaying on iPad with the desktop UA string.
Opting into the simulated mouse events quirk makes scrubbing work and we also ensure that page scrolling is
disabled as a result of scrubbing by returning true in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented().

Also making a drive-by fix in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented() to use a reference
instead of a pointer when downcasting a null-checked pointer.

  • page/Quirks.cpp:

(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
(WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247626 r247627  
     12019-07-18  Antoine Quint  <graouts@apple.com>
     2
     3        Enable simulated mouse events quirk for soundcloud.com
     4        https://bugs.webkit.org/show_bug.cgi?id=199908
     5        <rdar://problem/52915981>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Scrubbing on soundcloud.com relies on mouse events alone when displaying on iPad with the desktop UA string.
     10        Opting into the simulated mouse events quirk makes scrubbing work and we also ensure that page scrolling is
     11        disabled as a result of scrubbing by returning true in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented().
     12
     13        Also making a drive-by fix in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented() to use a reference
     14        instead of a pointer when downcasting a null-checked pointer.
     15
     16        * page/Quirks.cpp:
     17        (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
     18        (WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
     19
    1202019-07-18  Per Arne Vollan  <pvollan@apple.com>
    221
  • trunk/Source/WebCore/page/Quirks.cpp

    r247621 r247627  
    2828
    2929#include "CustomHeaderFields.h"
     30#include "DOMTokenList.h"
    3031#include "Document.h"
    3132#include "DocumentLoader.h"
     
    276277    if (equalLettersIgnoringASCIICase(host, "trailers.apple.com"))
    277278        return true;
     279    if (equalLettersIgnoringASCIICase(host, "soundcloud.com"))
     280        return true;
    278281    if (equalLettersIgnoringASCIICase(host, "naver.com"))
    279282        return true;
     
    292295        // When panning on an Amazon product image, we're either touching on the #magnifierLens element
    293296        // or its previous sibling.
    294         auto* element = downcast<Element>(target);
    295         if (element->getIdAttribute() == "magnifierLens")
     297        auto& element = downcast<Element>(*target);
     298        if (element.getIdAttribute() == "magnifierLens")
    296299            return true;
    297         if (auto* sibling = element->nextElementSibling())
     300        if (auto* sibling = element.nextElementSibling())
    298301            return sibling->getIdAttribute() == "magnifierLens";
    299302    }
     303
     304    if (equalLettersIgnoringASCIICase(m_document->topDocument().url().host(), "soundcloud.com") && is<Element>(target))
     305        return downcast<Element>(*target).classList().contains("sceneLayer");
    300306
    301307    return false;
Note: See TracChangeset for help on using the changeset viewer.