Title: [247627] trunk/Source/WebCore
Revision
247627
Author
commit-qu...@webkit.org
Date
2019-07-18 17:23:31 -0700 (Thu, 18 Jul 2019)

Log 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 <grao...@apple.com> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (247626 => 247627)


--- trunk/Source/WebCore/ChangeLog	2019-07-19 00:07:52 UTC (rev 247626)
+++ trunk/Source/WebCore/ChangeLog	2019-07-19 00:23:31 UTC (rev 247627)
@@ -1,3 +1,22 @@
+2019-07-18  Antoine Quint  <grao...@apple.com>
+
+        Enable simulated mouse events quirk for soundcloud.com
+        https://bugs.webkit.org/show_bug.cgi?id=199908
+        <rdar://problem/52915981>
+
+        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):
+
 2019-07-18  Per Arne Vollan  <pvol...@apple.com>
 
         Prewarm font cache with more fonts

Modified: trunk/Source/WebCore/page/Quirks.cpp (247626 => 247627)


--- trunk/Source/WebCore/page/Quirks.cpp	2019-07-19 00:07:52 UTC (rev 247626)
+++ trunk/Source/WebCore/page/Quirks.cpp	2019-07-19 00:23:31 UTC (rev 247627)
@@ -27,6 +27,7 @@
 #include "Quirks.h"
 
 #include "CustomHeaderFields.h"
+#include "DOMTokenList.h"
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "HTMLMetaElement.h"
@@ -275,6 +276,8 @@
         return true;
     if (equalLettersIgnoringASCIICase(host, "trailers.apple.com"))
         return true;
+    if (equalLettersIgnoringASCIICase(host, "soundcloud.com"))
+        return true;
     if (equalLettersIgnoringASCIICase(host, "naver.com"))
         return true;
     // Disable the quirk for tv.naver.com subdomain to be able to simulate hover on videos.
@@ -291,13 +294,16 @@
     if (isAmazon() && is<Element>(target)) {
         // When panning on an Amazon product image, we're either touching on the #magnifierLens element
         // or its previous sibling.
-        auto* element = downcast<Element>(target);
-        if (element->getIdAttribute() == "magnifierLens")
+        auto& element = downcast<Element>(*target);
+        if (element.getIdAttribute() == "magnifierLens")
             return true;
-        if (auto* sibling = element->nextElementSibling())
+        if (auto* sibling = element.nextElementSibling())
             return sibling->getIdAttribute() == "magnifierLens";
     }
 
+    if (equalLettersIgnoringASCIICase(m_document->topDocument().url().host(), "soundcloud.com") && is<Element>(target))
+        return downcast<Element>(*target).classList().contains("sceneLayer");
+
     return false;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to