⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245483 in webkit


Ignore:
Timestamp:
May 17, 2019, 3:05:07 PM (7 years ago)
Author:
graouts@webkit.org
Message:

Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
https://bugs.webkit.org/show_bug.cgi?id=197943
<rdar://problem/49078202>

Reviewed by Brent Fulgham.

Source/WebCore:

Tests: fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html

platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html

  • css/parser/CSSParserContext.cpp:

(WebCore::CSSParserContext::CSSParserContext):

  • loader/DocumentLoader.h:

(WebCore::DocumentLoader::legacyOverflowScrollingTouchPolicy const):
(WebCore::DocumentLoader::setLegacyOverflowScrollingTouchPolicy):

Source/WebKit:

  • Shared/WebsiteLegacyOverflowScrollingTouchPolicy.h: Added.
  • 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:
  • WebKit.xcodeproj/project.pbxproj:

LayoutTests:

  • fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode-expected.html: Added.
  • fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html: Added.
  • platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode-expected.txt: Added.
  • platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html: Added.
  • platform/ios/TestExpectations: Skip the new tests since they depend on code in WebKitAdditions.
Location:
trunk
Files:
7 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245475 r245483  
     12019-05-17  Antoine Quint  <graouts@apple.com>
     2
     3        Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
     4        https://bugs.webkit.org/show_bug.cgi?id=197943
     5        <rdar://problem/49078202>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode-expected.html: Added.
     10        * fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html: Added.
     11        * platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode-expected.txt: Added.
     12        * platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html: Added.
     13        * platform/ios/TestExpectations: Skip the new tests since they depend on code in WebKitAdditions.
     14
    1152019-05-17  Rob Buis  <rbuis@igalia.com>
    216
  • trunk/LayoutTests/platform/ios/TestExpectations

    r245473 r245483  
    32663266fast/events/ios/submit-form-target-blank-using-return-key.html
    32673267
     3268# These tests depend on the implementation of "modern compatibility mode" in WebKitAdditions.
     3269platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html [ Skip ]
     3270fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html [ Skip ]
     3271
    32683272webkit.org/b/197778 [ Debug ] webgl/2.0.0/conformance2/attribs/gl-vertexattribipointer.html [ Slow ]
    32693273
  • trunk/Source/WebCore/ChangeLog

    r245481 r245483  
     12019-05-17  Antoine Quint  <graouts@apple.com>
     2
     3        Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
     4        https://bugs.webkit.org/show_bug.cgi?id=197943
     5        <rdar://problem/49078202>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Tests: fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html
     10               platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html
     11
     12        * css/parser/CSSParserContext.cpp:
     13        (WebCore::CSSParserContext::CSSParserContext):
     14        * loader/DocumentLoader.h:
     15        (WebCore::DocumentLoader::legacyOverflowScrollingTouchPolicy const):
     16        (WebCore::DocumentLoader::setLegacyOverflowScrollingTouchPolicy):
     17
    1182019-05-17  Alex Christensen  <achristensen@webkit.org>
    219
  • trunk/Source/WebCore/css/parser/CSSParserContext.cpp

    r243318 r245483  
    2828
    2929#include "Document.h"
     30#include "DocumentLoader.h"
    3031#include "Page.h"
    3132#include "RuntimeEnabledFeatures.h"
     
    6162#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
    6263    legacyOverflowScrollingTouchEnabled = document.settings().legacyOverflowScrollingTouchEnabled();
     64    // The legacy -webkit-overflow-scrolling: touch behavior may have been disabled through the website policy,
     65    // in that case we want to disable the legacy behavior regardless of what the setting says.
     66    if (auto* loader = document.loader()) {
     67        if (loader->legacyOverflowScrollingTouchPolicy() == LegacyOverflowScrollingTouchPolicy::Disable)
     68            legacyOverflowScrollingTouchEnabled = false;
     69    }
    6370#endif
    6471    springTimingFunctionEnabled = document.settings().springTimingFunctionEnabled();
  • trunk/Source/WebCore/loader/DocumentLoader.h

    r245481 r245483  
    132132};
    133133
     134enum class LegacyOverflowScrollingTouchPolicy : uint8_t {
     135    Default,
     136    Disable,
     137    Enable,
     138};
     139
    134140class DocumentLoader
    135141    : public RefCounted<DocumentLoader>
     
    314320    void setSimulatedMouseEventsDispatchPolicy(SimulatedMouseEventsDispatchPolicy policy) { m_simulatedMouseEventsDispatchPolicy = policy; }
    315321
     322    LegacyOverflowScrollingTouchPolicy legacyOverflowScrollingTouchPolicy() const { return m_legacyOverflowScrollingTouchPolicy; }
     323    void setLegacyOverflowScrollingTouchPolicy(LegacyOverflowScrollingTouchPolicy policy) { m_legacyOverflowScrollingTouchPolicy = policy; }
     324
    316325    void addSubresourceLoader(ResourceLoader*);
    317326    void removeSubresourceLoader(LoadCompletionType, ResourceLoader*);
     
    597606    MediaSourcePolicy m_mediaSourcePolicy { MediaSourcePolicy::Default };
    598607    SimulatedMouseEventsDispatchPolicy m_simulatedMouseEventsDispatchPolicy { SimulatedMouseEventsDispatchPolicy::Default };
     608    LegacyOverflowScrollingTouchPolicy m_legacyOverflowScrollingTouchPolicy { LegacyOverflowScrollingTouchPolicy::Default };
    599609
    600610#if ENABLE(SERVICE_WORKER)
  • trunk/Source/WebKit/ChangeLog

    r245481 r245483  
     12019-05-17  Antoine Quint  <graouts@apple.com>
     2
     3        Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
     4        https://bugs.webkit.org/show_bug.cgi?id=197943
     5        <rdar://problem/49078202>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * Shared/WebsiteLegacyOverflowScrollingTouchPolicy.h: Added.
     10        * Shared/WebsitePoliciesData.cpp:
     11        (WebKit::WebsitePoliciesData::encode const):
     12        (WebKit::WebsitePoliciesData::decode):
     13        (WebKit::WebsitePoliciesData::applyToDocumentLoader):
     14        * Shared/WebsitePoliciesData.h:
     15        * UIProcess/API/APIWebsitePolicies.cpp:
     16        (API::WebsitePolicies::copy const):
     17        (API::WebsitePolicies::data):
     18        * UIProcess/API/APIWebsitePolicies.h:
     19        * WebKit.xcodeproj/project.pbxproj:
     20
    1212019-05-17  Alex Christensen  <achristensen@webkit.org>
    222
  • trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp

    r245481 r245483  
    5353    encoder << mediaSourcePolicy;
    5454    encoder << simulatedMouseEventsDispatchPolicy;
     55    encoder << legacyOverflowScrollingTouchPolicy;
    5556}
    5657
     
    122123    decoder >> simulatedMouseEventsDispatchPolicy;
    123124    if (!simulatedMouseEventsDispatchPolicy)
     125        return WTF::nullopt;
     126
     127    Optional<WebsiteLegacyOverflowScrollingTouchPolicy> legacyOverflowScrollingTouchPolicy;
     128    decoder >> legacyOverflowScrollingTouchPolicy;
     129    if (!legacyOverflowScrollingTouchPolicy)
    124130        return WTF::nullopt;
    125131
     
    140146        WTFMove(*mediaSourcePolicy),
    141147        WTFMove(*simulatedMouseEventsDispatchPolicy),
     148        WTFMove(*legacyOverflowScrollingTouchPolicy),
    142149    } };
    143150}
     
    238245    }
    239246
     247    switch (websitePolicies.legacyOverflowScrollingTouchPolicy) {
     248    case WebsiteLegacyOverflowScrollingTouchPolicy::Default:
     249        documentLoader.setLegacyOverflowScrollingTouchPolicy(WebCore::LegacyOverflowScrollingTouchPolicy::Default);
     250        break;
     251    case WebsiteLegacyOverflowScrollingTouchPolicy::Disable:
     252        documentLoader.setLegacyOverflowScrollingTouchPolicy(WebCore::LegacyOverflowScrollingTouchPolicy::Disable);
     253        break;
     254    case WebsiteLegacyOverflowScrollingTouchPolicy::Enable:
     255        documentLoader.setLegacyOverflowScrollingTouchPolicy(WebCore::LegacyOverflowScrollingTouchPolicy::Enable);
     256        break;
     257    }
     258
    240259    if (websitePolicies.websiteDataStoreParameters) {
    241260        if (auto* frame = documentLoader.frame()) {
  • trunk/Source/WebKit/Shared/WebsitePoliciesData.h

    r245481 r245483  
    2929#include "WebsiteAutoplayQuirk.h"
    3030#include "WebsiteDataStoreParameters.h"
     31#include "WebsiteLegacyOverflowScrollingTouchPolicy.h"
    3132#include "WebsiteMediaSourcePolicy.h"
    3233#include "WebsiteMetaViewportPolicy.h"
     
    6667    WebsiteMediaSourcePolicy mediaSourcePolicy { WebsiteMediaSourcePolicy::Default };
    6768    WebsiteSimulatedMouseEventsDispatchPolicy simulatedMouseEventsDispatchPolicy { WebsiteSimulatedMouseEventsDispatchPolicy::Default };
     69    WebsiteLegacyOverflowScrollingTouchPolicy legacyOverflowScrollingTouchPolicy { WebsiteLegacyOverflowScrollingTouchPolicy::Default };
    6870
    6971    void encode(IPC::Encoder&) const;
  • trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp

    r245481 r245483  
    6262    policies->setMediaSourcePolicy(m_mediaSourcePolicy);
    6363    policies->setSimulatedMouseEventsDispatchPolicy(m_simulatedMouseEventsDispatchPolicy);
     64    policies->setLegacyOverflowScrollingTouchPolicy(m_legacyOverflowScrollingTouchPolicy);
    6465   
    6566    Vector<WebCore::HTTPHeaderField> legacyCustomHeaderFields;
     
    114115        m_mediaSourcePolicy,
    115116        m_simulatedMouseEventsDispatchPolicy,
     117        m_legacyOverflowScrollingTouchPolicy,
    116118    };
    117119}
  • trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.h

    r245481 r245483  
    3030#include "WebsiteAutoplayPolicy.h"
    3131#include "WebsiteAutoplayQuirk.h"
     32#include "WebsiteLegacyOverflowScrollingTouchPolicy.h"
    3233#include "WebsiteMediaSourcePolicy.h"
    3334#include "WebsiteMetaViewportPolicy.h"
     
    105106    void setSimulatedMouseEventsDispatchPolicy(WebKit::WebsiteSimulatedMouseEventsDispatchPolicy policy) { m_simulatedMouseEventsDispatchPolicy = policy; }
    106107
     108    WebKit::WebsiteLegacyOverflowScrollingTouchPolicy legacyOverflowScrollingTouchPolicy() const { return m_legacyOverflowScrollingTouchPolicy; }
     109    void setLegacyOverflowScrollingTouchPolicy(WebKit::WebsiteLegacyOverflowScrollingTouchPolicy policy) { m_legacyOverflowScrollingTouchPolicy = policy; }
     110
    107111    bool allowSiteSpecificQuirksToOverrideCompatibilityMode() const { return m_allowSiteSpecificQuirksToOverrideCompatibilityMode; }
    108112    void setAllowSiteSpecificQuirksToOverrideCompatibilityMode(bool value) { m_allowSiteSpecificQuirksToOverrideCompatibilityMode = value; }
     
    131135    WebKit::WebsiteMediaSourcePolicy m_mediaSourcePolicy { WebKit::WebsiteMediaSourcePolicy::Default };
    132136    WebKit::WebsiteSimulatedMouseEventsDispatchPolicy m_simulatedMouseEventsDispatchPolicy { WebKit::WebsiteSimulatedMouseEventsDispatchPolicy::Default };
     137    WebKit::WebsiteLegacyOverflowScrollingTouchPolicy m_legacyOverflowScrollingTouchPolicy { WebKit::WebsiteLegacyOverflowScrollingTouchPolicy::Default };
    133138    bool m_allowSiteSpecificQuirksToOverrideCompatibilityMode { false };
    134139    WTF::String m_applicationNameForUserAgentWithModernCompatibility;
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r245481 r245483  
    11181118                6BE969CD1E54E054008B7483 /* ResourceLoadStatisticsClassifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE969CC1E54E054008B7483 /* ResourceLoadStatisticsClassifier.h */; };
    11191119                6EE849C81368D9390038D481 /* WKInspectorPrivateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE849C61368D92D0038D481 /* WKInspectorPrivateMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1120                711725A9228D564300018514 /* WebsiteLegacyOverflowScrollingTouchPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 711725A8228D563A00018514 /* WebsiteLegacyOverflowScrollingTouchPolicy.h */; };
    11201121                71FB810B2260627E00323677 /* WebsiteSimulatedMouseEventsDispatchPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 71FB810A2260627A00323677 /* WebsiteSimulatedMouseEventsDispatchPolicy.h */; };
    11211122                728E86F11795188C0087879E /* WebColorPickerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 728E86EF1795188C0087879E /* WebColorPickerMac.h */; };
     
    36073608                6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = com.apple.WebProcess.sb.in; path = WebProcess/com.apple.WebProcess.sb.in; sourceTree = "<group>"; };
    36083609                6EE849C61368D92D0038D481 /* WKInspectorPrivateMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKInspectorPrivateMac.h; path = mac/WKInspectorPrivateMac.h; sourceTree = "<group>"; };
     3610                711725A8228D563A00018514 /* WebsiteLegacyOverflowScrollingTouchPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteLegacyOverflowScrollingTouchPolicy.h; sourceTree = "<group>"; };
    36093611                71FB810A2260627A00323677 /* WebsiteSimulatedMouseEventsDispatchPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteSimulatedMouseEventsDispatchPolicy.h; sourceTree = "<group>"; };
    36103612                728E86EF1795188C0087879E /* WebColorPickerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebColorPickerMac.h; sourceTree = "<group>"; };
     
    52795281                                511F7D3F1EB1BCEE00E47B83 /* WebsiteDataStoreParameters.cpp */,
    52805282                                511F7D401EB1BCEE00E47B83 /* WebsiteDataStoreParameters.h */,
     5283                                711725A8228D563A00018514 /* WebsiteLegacyOverflowScrollingTouchPolicy.h */,
    52815284                                F4CB09E4225D5A0300891487 /* WebsiteMediaSourcePolicy.h */,
    52825285                                F430E941224732A9005FE053 /* WebsiteMetaViewportPolicy.h */,
     
    97739776                                1A53C2AA1A325730004E8C70 /* WebsiteDataStore.h in Headers */,
    97749777                                511F7D411EB1BCF500E47B83 /* WebsiteDataStoreParameters.h in Headers */,
     9778                                711725A9228D564300018514 /* WebsiteLegacyOverflowScrollingTouchPolicy.h in Headers */,
    97759779                                F4CB09E5225D5A0900891487 /* WebsiteMediaSourcePolicy.h in Headers */,
    97769780                                F430E9422247335F005FE053 /* WebsiteMetaViewportPolicy.h in Headers */,
Note: See TracChangeset for help on using the changeset viewer.