Changeset 243318 in webkit


Ignore:
Timestamp:
Mar 21, 2019 1:20:14 PM (5 years ago)
Author:
Simon Fraser
Message:

Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
https://bugs.webkit.org/show_bug.cgi?id=196058
rdar://problem/49078202

Reviewed by Antti Koivisto.
Source/WebCore:

Add an internal setting called "legacyOverflowScrollingTouchEnabled", initially
on by default.

When disabled, it makes the -webkit-overflow-scrolling property be unsupported.

Tests: fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html

fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html

  • css/parser/CSSParserContext.cpp:

(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):

  • css/parser/CSSParserContext.h:

(WebCore::CSSParserContextHash::hash):

  • css/parser/CSSParserFastPaths.cpp:

(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

  • css/parser/CSSParserFastPaths.h:
  • css/parser/CSSPropertyParser.cpp:

(WebCore::CSSPropertyParser::parseSingleValue):

  • page/Settings.yaml:

Source/WebKit:

Add an internal feature flag called "LegacyOverflowScrollingTouchEnabled", initially
on by default.

  • Shared/WebPreferences.yaml:

LayoutTests:

Add tests testing that the stacking-context side-effects -webkit-overflow-scrolling:touch
go away when it's disabled.

  • fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking-expected.html: Added.
  • fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html: Added.
  • fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking-expected.html: Added.
  • fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html: Added.
Location:
trunk
Files:
4 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243317 r243318  
     12019-03-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
     4        https://bugs.webkit.org/show_bug.cgi?id=196058
     5        rdar://problem/49078202
     6
     7        Reviewed by Antti Koivisto.
     8       
     9        Add tests testing that the stacking-context side-effects -webkit-overflow-scrolling:touch
     10        go away when it's disabled.
     11
     12        * fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking-expected.html: Added.
     13        * fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html: Added.
     14        * fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking-expected.html: Added.
     15        * fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html: Added.
     16
    1172019-03-21  Devin Rousso  <drousso@apple.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r243316 r243318  
     12019-03-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
     4        https://bugs.webkit.org/show_bug.cgi?id=196058
     5        rdar://problem/49078202
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Add an internal setting called "legacyOverflowScrollingTouchEnabled", initially
     10        on by default.
     11
     12        When disabled, it makes the -webkit-overflow-scrolling property be unsupported.
     13
     14        Tests: fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html
     15               fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html
     16
     17        * css/parser/CSSParserContext.cpp:
     18        (WebCore::CSSParserContext::CSSParserContext):
     19        (WebCore::operator==):
     20        * css/parser/CSSParserContext.h:
     21        (WebCore::CSSParserContextHash::hash):
     22        * css/parser/CSSParserFastPaths.cpp:
     23        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
     24        * css/parser/CSSParserFastPaths.h:
     25        * css/parser/CSSPropertyParser.cpp:
     26        (WebCore::CSSPropertyParser::parseSingleValue):
     27        * page/Settings.yaml:
     28
    1292019-03-21  Antti Koivisto  <antti@apple.com>
    230
  • trunk/Source/WebCore/css/parser/CSSParserContext.cpp

    r242780 r243318  
    5959    textAutosizingEnabled = document.settings().textAutosizingEnabled();
    6060#endif
     61#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
     62    legacyOverflowScrollingTouchEnabled = document.settings().legacyOverflowScrollingTouchEnabled();
     63#endif
    6164    springTimingFunctionEnabled = document.settings().springTimingFunctionEnabled();
    6265    constantPropertiesEnabled = document.settings().constantPropertiesEnabled();
     
    7881        && a.textAutosizingEnabled == b.textAutosizingEnabled
    7982#endif
     83#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
     84        && a.legacyOverflowScrollingTouchEnabled == b.legacyOverflowScrollingTouchEnabled
     85#endif
    8086        && a.enforcesCSSMIMETypeInNoQuirksMode == b.enforcesCSSMIMETypeInNoQuirksMode
    8187        && a.useLegacyBackgroundSizeShorthandBehavior == b.useLegacyBackgroundSizeShorthandBehavior
  • trunk/Source/WebCore/css/parser/CSSParserContext.h

    r242780 r243318  
    5050    bool textAutosizingEnabled { false };
    5151#endif
     52#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
     53    bool legacyOverflowScrollingTouchEnabled { false };
     54#endif
    5255    bool enforcesCSSMIMETypeInNoQuirksMode { true };
    5356    bool useLegacyBackgroundSizeShorthandBehavior { false };
     
    9497            & key.textAutosizingEnabled                     << 1
    9598#endif
    96             & key.enforcesCSSMIMETypeInNoQuirksMode         << 2
    97             & key.useLegacyBackgroundSizeShorthandBehavior  << 3
    98             & key.springTimingFunctionEnabled               << 4
    99             & key.constantPropertiesEnabled                 << 5
    100             & key.colorFilterEnabled                        << 6
    101             & key.deferredCSSParserEnabled                  << 7
    102             & key.hasDocumentSecurityOrigin                 << 8
    103             & key.useSystemAppearance                       << 9
     99#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
     100            & key.legacyOverflowScrollingTouchEnabled       << 2
     101#endif
     102            & key.enforcesCSSMIMETypeInNoQuirksMode         << 3
     103            & key.useLegacyBackgroundSizeShorthandBehavior  << 4
     104            & key.springTimingFunctionEnabled               << 5
     105            & key.constantPropertiesEnabled                 << 6
     106            & key.colorFilterEnabled                        << 7
     107            & key.deferredCSSParserEnabled                  << 8
     108            & key.hasDocumentSecurityOrigin                 << 9
     109            & key.useSystemAppearance                       << 10
    104110#if ENABLE(ATTACHMENT_ELEMENT)
    105             & key.attachmentEnabled                         << 10
     111            & key.attachmentEnabled                         << 11
    106112#endif
    107             & key.mode                                      << 11; // Keep this last.
     113            & key.mode                                      << 12; // Keep this last.
    108114        hash ^= WTF::intHash(bits);
    109115        return hash;
  • trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp

    r243275 r243318  
    3232
    3333#include "CSSFunctionValue.h"
     34#include "CSSParserContext.h"
    3435#include "CSSParserIdioms.h"
    3536#include "CSSPrimitiveValue.h"
     
    520521}
    521522
    522 bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID, CSSParserMode parserMode)
    523 {
    524     if (valueID == CSSValueInvalid || !isValueAllowedInMode(valueID, parserMode))
     523bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID, const CSSParserContext& context)
     524{
     525#if !ENABLE(OVERFLOW_SCROLLING_TOUCH)
     526    UNUSED_PARAM(context);
     527#endif
     528
     529    if (valueID == CSSValueInvalid || !isValueAllowedInMode(valueID, context.mode))
    525530        return false;
    526531
     
    803808#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
    804809    case CSSPropertyWebkitOverflowScrolling:
     810        if (!context.legacyOverflowScrollingTouchEnabled)
     811            return nullptr;
    805812        return valueID == CSSValueAuto || valueID == CSSValueTouch;
    806813#endif
     
    982989}
    983990
    984 static RefPtr<CSSValue> parseKeywordValue(CSSPropertyID propertyId, const String& string, CSSParserMode parserMode)
     991static RefPtr<CSSValue> parseKeywordValue(CSSPropertyID propertyId, const String& string, const CSSParserContext& context)
    985992{
    986993    ASSERT(!string.isEmpty());
     
    10141021        return CSSValuePool::singleton().createRevertValue();
    10151022   
    1016     if (CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyId, valueID, parserMode))
     1023    if (CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyId, valueID, context))
    10171024        return CSSPrimitiveValue::createIdentifier(valueID);
    10181025    return nullptr;
     
    12931300}
    12941301
    1295 RefPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String& string, CSSParserMode parserMode)
    1296 {
    1297     if (auto result = parseSimpleLengthValue(propertyID, string, parserMode))
     1302RefPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String& string, const CSSParserContext& context)
     1303{
     1304    if (auto result = parseSimpleLengthValue(propertyID, string, context.mode))
    12981305        return result;
    12991306    if (propertyID == CSSPropertyCaretColor)
    1300         return parseCaretColor(string, parserMode);
     1307        return parseCaretColor(string, context.mode);
    13011308    if (isColorPropertyID(propertyID))
    1302         return parseColor(string, parserMode);
    1303     if (auto result = parseKeywordValue(propertyID, string, parserMode))
     1309        return parseColor(string, context.mode);
     1310    if (auto result = parseKeywordValue(propertyID, string, context))
    13041311        return result;
    13051312    return parseSimpleTransform(propertyID, string);
  • trunk/Source/WebCore/css/parser/CSSParserFastPaths.h

    r209826 r243318  
    3939class CSSValue;
    4040class StyleSheetContents;
     41struct CSSParserContext;
    4142
    4243class CSSParserFastPaths {
     
    4445    // Parses simple values like '10px' or 'green', but makes no guarantees
    4546    // about handling any property completely.
    46     static RefPtr<CSSValue> maybeParseValue(CSSPropertyID, const String&, CSSParserMode);
     47    static RefPtr<CSSValue> maybeParseValue(CSSPropertyID, const String&, const CSSParserContext&);
    4748
    4849    // Properties handled here shouldn't be explicitly handled in CSSPropertyParser
    4950    static bool isKeywordPropertyID(CSSPropertyID);
    50     static bool isValidKeywordPropertyAndValue(CSSPropertyID, CSSValueID, CSSParserMode);
     51    static bool isValidKeywordPropertyAndValue(CSSPropertyID, CSSValueID, const CSSParserContext&);
    5152
    5253    static RefPtr<CSSValue> parseColor(const String&, CSSParserMode);
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r243163 r243318  
    39103910{
    39113911    if (CSSParserFastPaths::isKeywordPropertyID(property)) {
    3912         if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context.mode))
    3913             return nullptr;
     3912        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context))
     3913            return nullptr;
     3914
    39143915        return consumeIdent(m_range);
    39153916    }
     
    56995700    case CSSPropertyWebkitMarginCollapse: {
    57005701        CSSValueID id = m_range.consumeIncludingWhitespace().id();
    5701         if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginBeforeCollapse, id, m_context.mode))
     5702        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginBeforeCollapse, id, m_context))
    57025703            return false;
    57035704        addProperty(CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginCollapse, CSSValuePool::singleton().createIdentifierValue(id), important);
     
    57075708        }
    57085709        id = m_range.consumeIncludingWhitespace().id();
    5709         if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginAfterCollapse, id, m_context.mode))
     5710        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginAfterCollapse, id, m_context))
    57105711            return false;
    57115712        addProperty(CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarginCollapse, CSSValuePool::singleton().createIdentifierValue(id), important);
     
    57145715    case CSSPropertyOverflow: {
    57155716        CSSValueID id = m_range.consumeIncludingWhitespace().id();
    5716         if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyOverflowY, id, m_context.mode))
     5717        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyOverflowY, id, m_context))
    57175718            return false;
    57185719        if (!m_range.atEnd())
  • trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp

    r243273 r243318  
    812812            for (int j = firstCSSValueKeyword; j <= lastCSSValueKeyword; ++j) {
    813813                CSSValueID valueID = convertToCSSValueID(j);
    814                 if (CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyID, valueID, HTMLStandardMode))
     814                if (CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyID, valueID, strictCSSParserContext()))
    815815                    values->addItem(getValueNameString(valueID));
    816816            }
  • trunk/Source/WebCore/page/Settings.yaml

    r243046 r243318  
    389389  onChange: setNeedsRelayoutAllFrames
    390390
     391legacyOverflowScrollingTouchEnabled:
     392  initial: true
     393  onChange: setNeedsRelayoutAllFrames
     394  conditional: OVERFLOW_SCROLLING_TOUCH
     395
    391396webSecurityEnabled:
    392397  initial: true
  • trunk/Source/WebKit/ChangeLog

    r243316 r243318  
     12019-03-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
     4        https://bugs.webkit.org/show_bug.cgi?id=196058
     5        rdar://problem/49078202
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Add an internal feature flag called "LegacyOverflowScrollingTouchEnabled", initially
     10        on by default.
     11
     12        * Shared/WebPreferences.yaml:
     13
    1142019-03-21  Antti Koivisto  <antti@apple.com>
    215
  • trunk/Source/WebKit/Shared/WebPreferences.yaml

    r243292 r243318  
    14431443  category: internal
    14441444
     1445LegacyOverflowScrollingTouchEnabled:
     1446  type: bool
     1447  defaultValue: true
     1448  humanReadableName: "Legacy -webkit-overflow-scrolling property"
     1449  humanReadableDescription: "Support the legacy -webkit-overflow-scrolling CSS property"
     1450  condition: ENABLE(OVERFLOW_SCROLLING_TOUCH)
     1451  category: internal
     1452
    14451453FetchAPIKeepAliveEnabled:
    14461454  type: bool
Note: See TracChangeset for help on using the changeset viewer.