Title: [248579] branches/safari-608-branch/Source
Revision
248579
Author
[email protected]
Date
2019-08-12 16:42:56 -0700 (Mon, 12 Aug 2019)

Log Message

Cherry-pick r248502. rdar://problem/54130670

    Disable ContentChangeObserver TouchEvent adjustment on youtube.com on iOS in mobile browsing mode
    https://bugs.webkit.org/show_bug.cgi?id=200609
    <rdar://problem/54015403>

    Reviewed by Maciej Stachowiak.

    Source/WebCore:

    When watching a youtube video on iOS with "Autoplay" switched to off,
    upon finishing the video all clicks anywhere on the page are effectively ignored.
    Disabling ContentChangeObserver's TouchEvent adjustment fixes this bug.  I verified this manually.
    This switch was introduced in r242621, and it disables part of a new feature, so there is low risk of fallout.

    * loader/DocumentLoader.h:
    (WebCore::DocumentLoader::setAllowContentChangeObserverQuirk):
    (WebCore::DocumentLoader::allowContentChangeObserverQuirk const):
    * page/Quirks.cpp:
    (WebCore::Quirks::shouldDisableContentChangeObserverTouchEventAdjustment const):
    * page/Quirks.h:
    * page/ios/ContentChangeObserver.cpp:
    (WebCore::ContentChangeObserver::touchEventDidStart):

    Source/WebKit:

    * Shared/WebsitePoliciesData.cpp:
    (WebKit::WebsitePoliciesData::encode const):
    (WebKit::WebsitePoliciesData::decode):
    (WebKit::WebsitePoliciesData::applyToDocumentLoader):
    * Shared/WebsitePoliciesData.h:
    * UIProcess/API/APIWebsitePolicies.cpp:
    (API::WebsitePolicies::copy const):
    (API::WebsitePolicies::data):
    * UIProcess/API/APIWebsitePolicies.h:
    * UIProcess/ios/WebPageProxyIOS.mm:
    (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248502 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (248578 => 248579)


--- branches/safari-608-branch/Source/WebCore/ChangeLog	2019-08-12 23:42:52 UTC (rev 248578)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog	2019-08-12 23:42:56 UTC (rev 248579)
@@ -1,5 +1,71 @@
 2019-08-12  Alan Coon  <[email protected]>
 
+        Cherry-pick r248502. rdar://problem/54130670
+
+    Disable ContentChangeObserver TouchEvent adjustment on youtube.com on iOS in mobile browsing mode
+    https://bugs.webkit.org/show_bug.cgi?id=200609
+    <rdar://problem/54015403>
+    
+    Reviewed by Maciej Stachowiak.
+    
+    Source/WebCore:
+    
+    When watching a youtube video on iOS with "Autoplay" switched to off,
+    upon finishing the video all clicks anywhere on the page are effectively ignored.
+    Disabling ContentChangeObserver's TouchEvent adjustment fixes this bug.  I verified this manually.
+    This switch was introduced in r242621, and it disables part of a new feature, so there is low risk of fallout.
+    
+    * loader/DocumentLoader.h:
+    (WebCore::DocumentLoader::setAllowContentChangeObserverQuirk):
+    (WebCore::DocumentLoader::allowContentChangeObserverQuirk const):
+    * page/Quirks.cpp:
+    (WebCore::Quirks::shouldDisableContentChangeObserverTouchEventAdjustment const):
+    * page/Quirks.h:
+    * page/ios/ContentChangeObserver.cpp:
+    (WebCore::ContentChangeObserver::touchEventDidStart):
+    
+    Source/WebKit:
+    
+    * Shared/WebsitePoliciesData.cpp:
+    (WebKit::WebsitePoliciesData::encode const):
+    (WebKit::WebsitePoliciesData::decode):
+    (WebKit::WebsitePoliciesData::applyToDocumentLoader):
+    * Shared/WebsitePoliciesData.h:
+    * UIProcess/API/APIWebsitePolicies.cpp:
+    (API::WebsitePolicies::copy const):
+    (API::WebsitePolicies::data):
+    * UIProcess/API/APIWebsitePolicies.h:
+    * UIProcess/ios/WebPageProxyIOS.mm:
+    (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248502 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-08-10  Alex Christensen  <[email protected]>
+
+            Disable ContentChangeObserver TouchEvent adjustment on youtube.com on iOS in mobile browsing mode
+            https://bugs.webkit.org/show_bug.cgi?id=200609
+            <rdar://problem/54015403>
+
+            Reviewed by Maciej Stachowiak.
+
+            When watching a youtube video on iOS with "Autoplay" switched to off,
+            upon finishing the video all clicks anywhere on the page are effectively ignored.
+            Disabling ContentChangeObserver's TouchEvent adjustment fixes this bug.  I verified this manually.
+            This switch was introduced in r242621, and it disables part of a new feature, so there is low risk of fallout.
+
+            * loader/DocumentLoader.h:
+            (WebCore::DocumentLoader::setAllowContentChangeObserverQuirk):
+            (WebCore::DocumentLoader::allowContentChangeObserverQuirk const):
+            * page/Quirks.cpp:
+            (WebCore::Quirks::shouldDisableContentChangeObserverTouchEventAdjustment const):
+            * page/Quirks.h:
+            * page/ios/ContentChangeObserver.cpp:
+            (WebCore::ContentChangeObserver::touchEventDidStart):
+
+2019-08-12  Alan Coon  <[email protected]>
+
         Cherry-pick r248501. rdar://problem/54130614
 
     [iOS] Add a quirk for gmail.com messages on iPhone iOS13

Modified: branches/safari-608-branch/Source/WebCore/loader/DocumentLoader.h (248578 => 248579)


--- branches/safari-608-branch/Source/WebCore/loader/DocumentLoader.h	2019-08-12 23:42:52 UTC (rev 248578)
+++ branches/safari-608-branch/Source/WebCore/loader/DocumentLoader.h	2019-08-12 23:42:56 UTC (rev 248579)
@@ -391,6 +391,9 @@
 
     WEBCORE_EXPORT void applyPoliciesToSettings();
 
+    void setAllowContentChangeObserverQuirk(bool allow) { m_allowContentChangeObserverQuirk = allow; }
+    bool allowContentChangeObserverQuirk() const { return m_allowContentChangeObserverQuirk; }
+
 protected:
     WEBCORE_EXPORT DocumentLoader(const ResourceRequest&, const SubstituteData&);
 
@@ -594,6 +597,7 @@
 #endif
     String m_customUserAgent;
     String m_customJavaScriptUserAgentAsSiteSpecificQuirks;
+    bool m_allowContentChangeObserverQuirk { false };
     String m_customNavigatorPlatform;
     bool m_userContentExtensionsEnabled { true };
 #if ENABLE(DEVICE_ORIENTATION)

Modified: branches/safari-608-branch/Source/WebCore/page/Quirks.cpp (248578 => 248579)


--- branches/safari-608-branch/Source/WebCore/page/Quirks.cpp	2019-08-12 23:42:52 UTC (rev 248578)
+++ branches/safari-608-branch/Source/WebCore/page/Quirks.cpp	2019-08-12 23:42:56 UTC (rev 248579)
@@ -138,6 +138,20 @@
     return m_hasBrokenEncryptedMediaAPISupportQuirk.value();
 }
 
+bool Quirks::shouldDisableContentChangeObserverTouchEventAdjustment() const
+{
+    if (!needsQuirks())
+        return false;
+
+    auto& topDocument = m_document->topDocument();
+    auto* topDocumentLoader = topDocument.loader();
+    if (!topDocumentLoader || !topDocumentLoader->allowContentChangeObserverQuirk())
+        return false;
+
+    auto host = m_document->topDocument().url().host();
+    return host.endsWith(".youtube.com") || host == "youtube.com";
+}
+
 bool Quirks::shouldStripQuotationMarkInFontFaceSetFamily() const
 {
     if (!needsQuirks())

Modified: branches/safari-608-branch/Source/WebCore/page/Quirks.h (248578 => 248579)


--- branches/safari-608-branch/Source/WebCore/page/Quirks.h	2019-08-12 23:42:52 UTC (rev 248578)
+++ branches/safari-608-branch/Source/WebCore/page/Quirks.h	2019-08-12 23:42:56 UTC (rev 248579)
@@ -60,6 +60,7 @@
     bool needsInputModeNoneImplicitly(const HTMLElement&) const;
     bool needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand() const;
     bool shouldLightenJapaneseBoldSansSerif() const;
+    bool shouldDisableContentChangeObserverTouchEventAdjustment() const;
 
     WEBCORE_EXPORT bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const;
     WEBCORE_EXPORT bool shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas() const;

Modified: branches/safari-608-branch/Source/WebCore/page/ios/ContentChangeObserver.cpp (248578 => 248579)


--- branches/safari-608-branch/Source/WebCore/page/ios/ContentChangeObserver.cpp	2019-08-12 23:42:52 UTC (rev 248578)
+++ branches/safari-608-branch/Source/WebCore/page/ios/ContentChangeObserver.cpp	2019-08-12 23:42:56 UTC (rev 248579)
@@ -423,7 +423,7 @@
 void ContentChangeObserver::touchEventDidStart(PlatformEvent::Type eventType)
 {
 #if ENABLE(TOUCH_EVENTS)
-    if (!m_document.settings().contentChangeObserverEnabled())
+    if (!m_document.settings().contentChangeObserverEnabled() || m_document.quirks().shouldDisableContentChangeObserverTouchEventAdjustment())
         return;
     if (eventType != PlatformEvent::Type::TouchStart)
         return;

Modified: branches/safari-608-branch/Source/WebKit/ChangeLog (248578 => 248579)


--- branches/safari-608-branch/Source/WebKit/ChangeLog	2019-08-12 23:42:52 UTC (rev 248578)
+++ branches/safari-608-branch/Source/WebKit/ChangeLog	2019-08-12 23:42:56 UTC (rev 248579)
@@ -1,5 +1,69 @@
 2019-08-12  Alan Coon  <[email protected]>
 
+        Cherry-pick r248502. rdar://problem/54130670
+
+    Disable ContentChangeObserver TouchEvent adjustment on youtube.com on iOS in mobile browsing mode
+    https://bugs.webkit.org/show_bug.cgi?id=200609
+    <rdar://problem/54015403>
+    
+    Reviewed by Maciej Stachowiak.
+    
+    Source/WebCore:
+    
+    When watching a youtube video on iOS with "Autoplay" switched to off,
+    upon finishing the video all clicks anywhere on the page are effectively ignored.
+    Disabling ContentChangeObserver's TouchEvent adjustment fixes this bug.  I verified this manually.
+    This switch was introduced in r242621, and it disables part of a new feature, so there is low risk of fallout.
+    
+    * loader/DocumentLoader.h:
+    (WebCore::DocumentLoader::setAllowContentChangeObserverQuirk):
+    (WebCore::DocumentLoader::allowContentChangeObserverQuirk const):
+    * page/Quirks.cpp:
+    (WebCore::Quirks::shouldDisableContentChangeObserverTouchEventAdjustment const):
+    * page/Quirks.h:
+    * page/ios/ContentChangeObserver.cpp:
+    (WebCore::ContentChangeObserver::touchEventDidStart):
+    
+    Source/WebKit:
+    
+    * Shared/WebsitePoliciesData.cpp:
+    (WebKit::WebsitePoliciesData::encode const):
+    (WebKit::WebsitePoliciesData::decode):
+    (WebKit::WebsitePoliciesData::applyToDocumentLoader):
+    * Shared/WebsitePoliciesData.h:
+    * UIProcess/API/APIWebsitePolicies.cpp:
+    (API::WebsitePolicies::copy const):
+    (API::WebsitePolicies::data):
+    * UIProcess/API/APIWebsitePolicies.h:
+    * UIProcess/ios/WebPageProxyIOS.mm:
+    (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248502 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-08-10  Alex Christensen  <[email protected]>
+
+            Disable ContentChangeObserver TouchEvent adjustment on youtube.com on iOS in mobile browsing mode
+            https://bugs.webkit.org/show_bug.cgi?id=200609
+            <rdar://problem/54015403>
+
+            Reviewed by Maciej Stachowiak.
+
+            * Shared/WebsitePoliciesData.cpp:
+            (WebKit::WebsitePoliciesData::encode const):
+            (WebKit::WebsitePoliciesData::decode):
+            (WebKit::WebsitePoliciesData::applyToDocumentLoader):
+            * Shared/WebsitePoliciesData.h:
+            * UIProcess/API/APIWebsitePolicies.cpp:
+            (API::WebsitePolicies::copy const):
+            (API::WebsitePolicies::data):
+            * UIProcess/API/APIWebsitePolicies.h:
+            * UIProcess/ios/WebPageProxyIOS.mm:
+            (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
+
+2019-08-12  Alan Coon  <[email protected]>
+
         Cherry-pick r248501. rdar://problem/54130614
 
     [iOS] Add a quirk for gmail.com messages on iPhone iOS13

Modified: branches/safari-608-branch/Source/WebKit/Shared/WebsitePoliciesData.cpp (248578 => 248579)


--- branches/safari-608-branch/Source/WebKit/Shared/WebsitePoliciesData.cpp	2019-08-12 23:42:52 UTC (rev 248578)
+++ branches/safari-608-branch/Source/WebKit/Shared/WebsitePoliciesData.cpp	2019-08-12 23:42:56 UTC (rev 248579)
@@ -53,6 +53,7 @@
     encoder << mediaSourcePolicy;
     encoder << simulatedMouseEventsDispatchPolicy;
     encoder << legacyOverflowScrollingTouchPolicy;
+    encoder << allowContentChangeObserverQuirk;
 }
 
 Optional<WebsitePoliciesData> WebsitePoliciesData::decode(IPC::Decoder& decoder)
@@ -129,6 +130,11 @@
     if (!legacyOverflowScrollingTouchPolicy)
         return WTF::nullopt;
 
+    Optional<bool> allowContentChangeObserverQuirk;
+    decoder >> allowContentChangeObserverQuirk;
+    if (!allowContentChangeObserverQuirk)
+        return WTF::nullopt;
+    
     return { {
         WTFMove(*contentBlockersEnabled),
         WTFMove(*allowedAutoplayQuirks),
@@ -146,6 +152,7 @@
         WTFMove(*mediaSourcePolicy),
         WTFMove(*simulatedMouseEventsDispatchPolicy),
         WTFMove(*legacyOverflowScrollingTouchPolicy),
+        WTFMove(*allowContentChangeObserverQuirk),
     } };
 }
 
@@ -256,6 +263,8 @@
         break;
     }
 
+    documentLoader.setAllowContentChangeObserverQuirk(websitePolicies.allowContentChangeObserverQuirk);
+
     auto* frame = documentLoader.frame();
     if (!frame)
         return;

Modified: branches/safari-608-branch/Source/WebKit/Shared/WebsitePoliciesData.h (248578 => 248579)


--- branches/safari-608-branch/Source/WebKit/Shared/WebsitePoliciesData.h	2019-08-12 23:42:52 UTC (rev 248578)
+++ branches/safari-608-branch/Source/WebKit/Shared/WebsitePoliciesData.h	2019-08-12 23:42:56 UTC (rev 248579)
@@ -67,6 +67,7 @@
     WebsiteMediaSourcePolicy mediaSourcePolicy { WebsiteMediaSourcePolicy::Default };
     WebsiteSimulatedMouseEventsDispatchPolicy simulatedMouseEventsDispatchPolicy { WebsiteSimulatedMouseEventsDispatchPolicy::Default };
     WebsiteLegacyOverflowScrollingTouchPolicy legacyOverflowScrollingTouchPolicy { WebsiteLegacyOverflowScrollingTouchPolicy::Default };
+    bool allowContentChangeObserverQuirk { false };
 
     void encode(IPC::Encoder&) const;
     static Optional<WebsitePoliciesData> decode(IPC::Decoder&);

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp (248578 => 248579)


--- branches/safari-608-branch/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp	2019-08-12 23:42:52 UTC (rev 248578)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp	2019-08-12 23:42:56 UTC (rev 248579)
@@ -62,6 +62,7 @@
     policies->setMediaSourcePolicy(m_mediaSourcePolicy);
     policies->setSimulatedMouseEventsDispatchPolicy(m_simulatedMouseEventsDispatchPolicy);
     policies->setLegacyOverflowScrollingTouchPolicy(m_legacyOverflowScrollingTouchPolicy);
+    policies->setAllowContentChangeObserverQuirk(m_allowContentChangeObserverQuirk);
     
     Vector<WebCore::HTTPHeaderField> legacyCustomHeaderFields;
     legacyCustomHeaderFields.reserveInitialCapacity(m_legacyCustomHeaderFields.size());
@@ -115,6 +116,7 @@
         m_mediaSourcePolicy,
         m_simulatedMouseEventsDispatchPolicy,
         m_legacyOverflowScrollingTouchPolicy,
+        m_allowContentChangeObserverQuirk,
     };
 }
 

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/API/APIWebsitePolicies.h (248578 => 248579)


--- branches/safari-608-branch/Source/WebKit/UIProcess/API/APIWebsitePolicies.h	2019-08-12 23:42:52 UTC (rev 248578)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/API/APIWebsitePolicies.h	2019-08-12 23:42:56 UTC (rev 248579)
@@ -114,6 +114,9 @@
     WTF::String applicationNameForDesktopUserAgent() const { return m_applicationNameForDesktopUserAgent; }
     void setApplicationNameForDesktopUserAgent(const WTF::String& applicationName) { m_applicationNameForDesktopUserAgent = applicationName; }
 
+    bool allowContentChangeObserverQuirk() const { return m_allowContentChangeObserverQuirk; }
+    void setAllowContentChangeObserverQuirk(bool allow) { m_allowContentChangeObserverQuirk = allow; }
+
 private:
     WebsitePolicies(bool contentBlockersEnabled, OptionSet<WebKit::WebsiteAutoplayQuirk>, WebKit::WebsiteAutoplayPolicy, Vector<WebCore::HTTPHeaderField>&&, Vector<WebCore::CustomHeaderFields>&&, WebKit::WebsitePopUpPolicy, RefPtr<WebsiteDataStore>&&);
 
@@ -137,6 +140,7 @@
     WebKit::WebsiteLegacyOverflowScrollingTouchPolicy m_legacyOverflowScrollingTouchPolicy { WebKit::WebsiteLegacyOverflowScrollingTouchPolicy::Default };
     bool m_allowSiteSpecificQuirksToOverrideContentMode { false };
     WTF::String m_applicationNameForDesktopUserAgent;
+    bool m_allowContentChangeObserverQuirk { false };
 };
 
 } // namespace API

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (248578 => 248579)


--- branches/safari-608-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2019-08-12 23:42:52 UTC (rev 248578)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2019-08-12 23:42:56 UTC (rev 248579)
@@ -1402,8 +1402,10 @@
 
     m_allowsFastClicksEverywhere = false;
 
-    if (!useDesktopBrowsingMode)
+    if (!useDesktopBrowsingMode) {
+        policies.setAllowContentChangeObserverQuirk(true);
         return WebContentMode::Mobile;
+    }
 
     if (policies.customUserAgent().isEmpty() && customUserAgent().isEmpty()) {
         auto applicationName = policies.applicationNameForDesktopUserAgent();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to