Title: [229068] branches/safari-605-branch/Source/WebCore/dom/EventTarget.cpp
Revision
229068
Author
[email protected]
Date
2018-02-27 12:33:30 -0800 (Tue, 27 Feb 2018)

Log Message

Apply patch. rdar://problem/37156477

Modified Paths


Diff

Modified: branches/safari-605-branch/Source/WebCore/dom/EventTarget.cpp (229067 => 229068)


--- branches/safari-605-branch/Source/WebCore/dom/EventTarget.cpp	2018-02-27 20:14:01 UTC (rev 229067)
+++ branches/safari-605-branch/Source/WebCore/dom/EventTarget.cpp	2018-02-27 20:33:30 UTC (rev 229068)
@@ -58,6 +58,19 @@
     return false;
 }
 
+static bool siteQuirksForceNonPassive(const Document& document)
+{
+#if !PLATFORM(IOS)
+    UNUSED_PARAM(document);
+    return false;
+#else
+    String hostName = document.topDocument().url().host();
+    // We have to consider all the localized versions of
+    // Google pages, which are generally on different domains.
+    return hostName.containsIgnoringASCIICase(".google.") || startsWithLettersIgnoringASCIICase(hostName, "google.");
+#endif
+}
+
 bool EventTarget::addEventListener(const AtomicString& eventType, Ref<EventListener>&& listener, const AddEventListenerOptions& options)
 {
     auto passive = options.passive;
@@ -66,11 +79,11 @@
         if (is<DOMWindow>(*this)) {
             auto& window = downcast<DOMWindow>(*this);
             if (auto* document = window.document())
-                passive = document->settings().passiveTouchListenersAsDefaultOnDocument();
+                passive = document->settings().passiveTouchListenersAsDefaultOnDocument() && !siteQuirksForceNonPassive(*document);
         } else if (is<Node>(*this)) {
             auto& node = downcast<Node>(*this);
             if (is<Document>(node) || node.document().documentElement() == &node || node.document().body() == &node)
-                passive = node.document().settings().passiveTouchListenersAsDefaultOnDocument();
+                passive = node.document().settings().passiveTouchListenersAsDefaultOnDocument() && !siteQuirksForceNonPassive(node.document());
         }
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to