Changeset 248502 in webkit


Ignore:
Timestamp:
Aug 10, 2019 3:45:43 PM (5 years ago)
Author:
achristensen@apple.com
Message:

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):

Location:
trunk/Source
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r248501 r248502  
     12019-08-10  Alex Christensen  <achristensen@webkit.org>
     2
     3        Disable ContentChangeObserver TouchEvent adjustment on youtube.com on iOS in mobile browsing mode
     4        https://bugs.webkit.org/show_bug.cgi?id=200609
     5        <rdar://problem/54015403>
     6
     7        Reviewed by Maciej Stachowiak.
     8
     9        When watching a youtube video on iOS with "Autoplay" switched to off,
     10        upon finishing the video all clicks anywhere on the page are effectively ignored.
     11        Disabling ContentChangeObserver's TouchEvent adjustment fixes this bug.  I verified this manually.
     12        This switch was introduced in r242621, and it disables part of a new feature, so there is low risk of fallout.
     13
     14        * loader/DocumentLoader.h:
     15        (WebCore::DocumentLoader::setAllowContentChangeObserverQuirk):
     16        (WebCore::DocumentLoader::allowContentChangeObserverQuirk const):
     17        * page/Quirks.cpp:
     18        (WebCore::Quirks::shouldDisableContentChangeObserverTouchEventAdjustment const):
     19        * page/Quirks.h:
     20        * page/ios/ContentChangeObserver.cpp:
     21        (WebCore::ContentChangeObserver::touchEventDidStart):
     22
    1232019-08-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
    224
  • trunk/Source/WebCore/loader/DocumentLoader.h

    r245873 r248502  
    392392    WEBCORE_EXPORT void applyPoliciesToSettings();
    393393
     394    void setAllowContentChangeObserverQuirk(bool allow) { m_allowContentChangeObserverQuirk = allow; }
     395    bool allowContentChangeObserverQuirk() const { return m_allowContentChangeObserverQuirk; }
     396
    394397protected:
    395398    WEBCORE_EXPORT DocumentLoader(const ResourceRequest&, const SubstituteData&);
     
    595598    String m_customUserAgent;
    596599    String m_customJavaScriptUserAgentAsSiteSpecificQuirks;
     600    bool m_allowContentChangeObserverQuirk { false };
    597601    String m_customNavigatorPlatform;
    598602    bool m_userContentExtensionsEnabled { true };
  • trunk/Source/WebCore/page/Quirks.cpp

    r248501 r248502  
    140140}
    141141
     142bool Quirks::shouldDisableContentChangeObserverTouchEventAdjustment() const
     143{
     144    if (!needsQuirks())
     145        return false;
     146
     147    auto& topDocument = m_document->topDocument();
     148    auto* topDocumentLoader = topDocument.loader();
     149    if (!topDocumentLoader || !topDocumentLoader->allowContentChangeObserverQuirk())
     150        return false;
     151
     152    auto host = m_document->topDocument().url().host();
     153    return host.endsWith(".youtube.com") || host == "youtube.com";
     154}
     155
    142156bool Quirks::shouldStripQuotationMarkInFontFaceSetFamily() const
    143157{
  • trunk/Source/WebCore/page/Quirks.h

    r248501 r248502  
    6262    bool needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand() const;
    6363    bool shouldLightenJapaneseBoldSansSerif() const;
     64    bool shouldDisableContentChangeObserverTouchEventAdjustment() const;
    6465
    6566    WEBCORE_EXPORT bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const;
  • trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp

    r248463 r248502  
    424424{
    425425#if ENABLE(TOUCH_EVENTS)
    426     if (!m_document.settings().contentChangeObserverEnabled())
     426    if (!m_document.settings().contentChangeObserverEnabled() || m_document.quirks().shouldDisableContentChangeObserverTouchEventAdjustment())
    427427        return;
    428428    if (eventType != PlatformEvent::Type::TouchStart)
  • trunk/Source/WebKit/ChangeLog

    r248501 r248502  
     12019-08-10  Alex Christensen  <achristensen@webkit.org>
     2
     3        Disable ContentChangeObserver TouchEvent adjustment on youtube.com on iOS in mobile browsing mode
     4        https://bugs.webkit.org/show_bug.cgi?id=200609
     5        <rdar://problem/54015403>
     6
     7        Reviewed by Maciej Stachowiak.
     8
     9        * Shared/WebsitePoliciesData.cpp:
     10        (WebKit::WebsitePoliciesData::encode const):
     11        (WebKit::WebsitePoliciesData::decode):
     12        (WebKit::WebsitePoliciesData::applyToDocumentLoader):
     13        * Shared/WebsitePoliciesData.h:
     14        * UIProcess/API/APIWebsitePolicies.cpp:
     15        (API::WebsitePolicies::copy const):
     16        (API::WebsitePolicies::data):
     17        * UIProcess/API/APIWebsitePolicies.h:
     18        * UIProcess/ios/WebPageProxyIOS.mm:
     19        (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
     20
    1212019-08-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
    222
  • trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp

    r246167 r248502  
    5454    encoder << simulatedMouseEventsDispatchPolicy;
    5555    encoder << legacyOverflowScrollingTouchPolicy;
     56    encoder << allowContentChangeObserverQuirk;
    5657}
    5758
     
    130131        return WTF::nullopt;
    131132
     133    Optional<bool> allowContentChangeObserverQuirk;
     134    decoder >> allowContentChangeObserverQuirk;
     135    if (!allowContentChangeObserverQuirk)
     136        return WTF::nullopt;
     137   
    132138    return { {
    133139        WTFMove(*contentBlockersEnabled),
     
    147153        WTFMove(*simulatedMouseEventsDispatchPolicy),
    148154        WTFMove(*legacyOverflowScrollingTouchPolicy),
     155        WTFMove(*allowContentChangeObserverQuirk),
    149156    } };
    150157}
     
    257264    }
    258265
     266    documentLoader.setAllowContentChangeObserverQuirk(websitePolicies.allowContentChangeObserverQuirk);
     267
    259268    auto* frame = documentLoader.frame();
    260269    if (!frame)
  • trunk/Source/WebKit/Shared/WebsitePoliciesData.h

    r245483 r248502  
    6868    WebsiteSimulatedMouseEventsDispatchPolicy simulatedMouseEventsDispatchPolicy { WebsiteSimulatedMouseEventsDispatchPolicy::Default };
    6969    WebsiteLegacyOverflowScrollingTouchPolicy legacyOverflowScrollingTouchPolicy { WebsiteLegacyOverflowScrollingTouchPolicy::Default };
     70    bool allowContentChangeObserverQuirk { false };
    7071
    7172    void encode(IPC::Encoder&) const;
  • trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp

    r246236 r248502  
    6363    policies->setSimulatedMouseEventsDispatchPolicy(m_simulatedMouseEventsDispatchPolicy);
    6464    policies->setLegacyOverflowScrollingTouchPolicy(m_legacyOverflowScrollingTouchPolicy);
     65    policies->setAllowContentChangeObserverQuirk(m_allowContentChangeObserverQuirk);
    6566   
    6667    Vector<WebCore::HTTPHeaderField> legacyCustomHeaderFields;
     
    116117        m_simulatedMouseEventsDispatchPolicy,
    117118        m_legacyOverflowScrollingTouchPolicy,
     119        m_allowContentChangeObserverQuirk,
    118120    };
    119121}
  • trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.h

    r246236 r248502  
    115115    void setApplicationNameForDesktopUserAgent(const WTF::String& applicationName) { m_applicationNameForDesktopUserAgent = applicationName; }
    116116
     117    bool allowContentChangeObserverQuirk() const { return m_allowContentChangeObserverQuirk; }
     118    void setAllowContentChangeObserverQuirk(bool allow) { m_allowContentChangeObserverQuirk = allow; }
     119
    117120private:
    118121    WebsitePolicies(bool contentBlockersEnabled, OptionSet<WebKit::WebsiteAutoplayQuirk>, WebKit::WebsiteAutoplayPolicy, Vector<WebCore::HTTPHeaderField>&&, Vector<WebCore::CustomHeaderFields>&&, WebKit::WebsitePopUpPolicy, RefPtr<WebsiteDataStore>&&);
     
    138141    bool m_allowSiteSpecificQuirksToOverrideContentMode { false };
    139142    WTF::String m_applicationNameForDesktopUserAgent;
     143    bool m_allowContentChangeObserverQuirk { false };
    140144};
    141145
  • trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

    r248501 r248502  
    14211421    m_allowsFastClicksEverywhere = false;
    14221422
    1423     if (!useDesktopBrowsingMode)
     1423    if (!useDesktopBrowsingMode) {
     1424        policies.setAllowContentChangeObserverQuirk(true);
    14241425        return WebContentMode::Mobile;
     1426    }
    14251427
    14261428    if (policies.customUserAgent().isEmpty() && customUserAgent().isEmpty()) {
Note: See TracChangeset for help on using the changeset viewer.