Title: [246205] trunk/Source/WebCore
Revision
246205
Author
[email protected]
Date
2019-06-07 10:11:01 -0700 (Fri, 07 Jun 2019)

Log Message

Limit simulated mouse events on Google Maps to entering Street View
https://bugs.webkit.org/show_bug.cgi?id=198657
<rdar://problem/51345064>

Reviewed by Brent Fulgham.

* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
(WebCore::Quirks::shouldDispatchSimulatedMouseEventsOnTarget const):
* page/Quirks.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (246204 => 246205)


--- trunk/Source/WebCore/ChangeLog	2019-06-07 17:10:35 UTC (rev 246204)
+++ trunk/Source/WebCore/ChangeLog	2019-06-07 17:11:01 UTC (rev 246205)
@@ -1,3 +1,16 @@
+2019-06-07  Antoine Quint  <[email protected]>
+
+        Limit simulated mouse events on Google Maps to entering Street View
+        https://bugs.webkit.org/show_bug.cgi?id=198657
+        <rdar://problem/51345064>
+
+        Reviewed by Brent Fulgham.
+
+        * page/Quirks.cpp:
+        (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
+        (WebCore::Quirks::shouldDispatchSimulatedMouseEventsOnTarget const):
+        * page/Quirks.h:
+
 2019-06-07  Joonghun Park  <[email protected]>
 
         Unreviewed. Use const TabSize& instead of TabSize to avoid unnecessary copy.

Modified: trunk/Source/WebCore/page/Quirks.cpp (246204 => 246205)


--- trunk/Source/WebCore/page/Quirks.cpp	2019-06-07 17:10:35 UTC (rev 246204)
+++ trunk/Source/WebCore/page/Quirks.cpp	2019-06-07 17:11:01 UTC (rev 246205)
@@ -282,9 +282,9 @@
     return shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreasForHost(m_document->topDocument().url().host());
 }
 
+#if PLATFORM(IOS_FAMILY)
 bool Quirks::shouldDispatchSimulatedMouseEvents() const
 {
-#if PLATFORM(IOS_FAMILY)
     if (!needsQuirks())
         return false;
 
@@ -317,10 +317,23 @@
         return true;
     if (equalLettersIgnoringASCIICase(host, "naver.com") || host.endsWithIgnoringASCIICase(".naver.com"))
         return true;
-#endif
     return false;
 }
 
+bool Quirks::shouldDispatchSimulatedMouseEventsOnTarget(EventTarget* target) const
+{
+    if (!needsQuirks() || !shouldDispatchSimulatedMouseEvents())
+        return false;
+
+    // On Google Maps, we want to limit simulated mouse events to dragging the little man that allows entering into Street View.
+    auto& url = ""
+    auto host = url.host();
+    if (equalLettersIgnoringASCIICase(host, "www.google.com") && url.path().startsWithIgnoringASCIICase("/maps/"))
+        return is<Element>(target) && downcast<Element>(target)->getAttribute("class") == "widget-expand-button-pegman-icon";
+    return true;
+}
+#endif
+
 bool Quirks::shouldDisablePointerEventsQuirk() const
 {
 #if PLATFORM(IOS_FAMILY)

Modified: trunk/Source/WebCore/page/Quirks.h (246204 => 246205)


--- trunk/Source/WebCore/page/Quirks.h	2019-06-07 17:10:35 UTC (rev 246204)
+++ trunk/Source/WebCore/page/Quirks.h	2019-06-07 17:11:01 UTC (rev 246205)
@@ -49,7 +49,10 @@
     bool shouldAutoplayForArbitraryUserGesture() const;
     bool hasBrokenEncryptedMediaAPISupportQuirk() const;
     bool hasWebSQLSupportQuirk() const;
+#if PLATFORM(IOS_FAMILY)
     bool shouldDispatchSimulatedMouseEvents() const;
+    bool shouldDispatchSimulatedMouseEventsOnTarget(EventTarget*) const;
+#endif
     bool shouldDisablePointerEventsQuirk() const;
     bool needsInputModeNoneImplicitly(const HTMLElement&) const;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to