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

Changeset 273792 in webkit


Ignore:
Timestamp:
Mar 2, 2021, 7:08:39 PM (6 years ago)
Author:
Alan Coon
Message:

Cherry-pick r273385. rdar://problem/74953186

Runtime-disabled CSS features still appear enabled via CSS.supports()
​https://bugs.webkit.org/show_bug.cgi?id=222280
rdar://74595641

Reviewed by Sam Weinig.

Source/WebCore:

When parsing CSS.supports() for a runtime-disabled property, we'd successfully
parse a CSS-wide keyword like "inherit" and report that the property is supported.

We need to explicitly check for runtime-disabled properties.

Tests: css3/color-filters/color-filter-exposed-if-disabled.html

fast/css/scroll-behavior-exposed-if-disabled.html

  • css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::isPropertyRuntimeDisabled const): (WebCore::CSSParserImpl::consumeDeclaration):
  • css/parser/CSSParserImpl.h:

LayoutTests:

  • css3/color-filters/color-filter-exposed-if-disabled-expected.txt: Added. Fails tracked in webkit.org/b/217626
  • css3/color-filters/color-filter-exposed-if-disabled.html: Added.
  • fast/css/overscroll-behavior-invalidate-if-disabled-expected.txt:
  • fast/css/overscroll-behavior-invalidate-if-disabled.html:
  • fast/css/scroll-behavior-exposed-if-disabled-expected.txt: Added.
  • fast/css/scroll-behavior-exposed-if-disabled.html: Added.

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

Location:
branches/safari-612.1.5-branch
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612.1.5-branch/LayoutTests/ChangeLog

    r273791 r273792  
     12021-03-02  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r273385. rdar://problem/74953186
     4
     5    Runtime-disabled CSS features still appear enabled via CSS.supports()
     6    https://bugs.webkit.org/show_bug.cgi?id=222280
     7    rdar://74595641
     8   
     9    Reviewed by Sam Weinig.
     10   
     11    Source/WebCore:
     12   
     13    When parsing CSS.supports() for a runtime-disabled property, we'd successfully
     14    parse a CSS-wide keyword like "inherit" and report that the property is supported.
     15   
     16    We need to explicitly check for runtime-disabled properties.
     17   
     18    Tests: css3/color-filters/color-filter-exposed-if-disabled.html
     19           fast/css/scroll-behavior-exposed-if-disabled.html
     20   
     21    * css/parser/CSSParserImpl.cpp:
     22    (WebCore::CSSParserImpl::isPropertyRuntimeDisabled const):
     23    (WebCore::CSSParserImpl::consumeDeclaration):
     24    * css/parser/CSSParserImpl.h:
     25   
     26    LayoutTests:
     27   
     28    * css3/color-filters/color-filter-exposed-if-disabled-expected.txt: Added. Fails tracked in webkit.org/b/217626
     29    * css3/color-filters/color-filter-exposed-if-disabled.html: Added.
     30    * fast/css/overscroll-behavior-invalidate-if-disabled-expected.txt:
     31    * fast/css/overscroll-behavior-invalidate-if-disabled.html:
     32    * fast/css/scroll-behavior-exposed-if-disabled-expected.txt: Added.
     33    * fast/css/scroll-behavior-exposed-if-disabled.html: Added.
     34   
     35   
     36    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     37
     38    2021-02-24  Simon Fraser  <simon.fraser@apple.com>
     39
     40            Runtime-disabled CSS features still appear enabled via CSS.supports()
     41            https://bugs.webkit.org/show_bug.cgi?id=222280
     42            rdar://74595641
     43
     44            Reviewed by Sam Weinig.
     45
     46            * css3/color-filters/color-filter-exposed-if-disabled-expected.txt: Added. Fails tracked in webkit.org/b/217626
     47            * css3/color-filters/color-filter-exposed-if-disabled.html: Added.
     48            * fast/css/overscroll-behavior-invalidate-if-disabled-expected.txt:
     49            * fast/css/overscroll-behavior-invalidate-if-disabled.html:
     50            * fast/css/scroll-behavior-exposed-if-disabled-expected.txt: Added.
     51            * fast/css/scroll-behavior-exposed-if-disabled.html: Added.
     52
    1532021-03-02  Alan Coon  <alancoon@apple.com>
    254
  • branches/safari-612.1.5-branch/LayoutTests/fast/css/aspect-ratio-invalidate-if-disabled-expected.txt

    r273791 r273792  
    77PASS 'aspect-ratio' in getComputedStyle(document.documentElement) is false
    88PASS CSS.supports('aspect-ratio: 1 / 1') is false
    9 FAIL CSS.supports('aspect-ratio: inherit') should be false. Was true.
     9PASS CSS.supports('aspect-ratio: inherit') is false
    1010PASS successfullyParsed is true
    11 Some tests failed.
    1211
    1312TEST COMPLETE
  • branches/safari-612.1.5-branch/LayoutTests/fast/css/overscroll-behavior-invalidate-if-disabled-expected.txt

    r270613 r273792  
    1 Test overscrollBehavior should be invalidated if overscrollBehaviorEnabled is disabled
     1Tests that overscroll-behavior is not exposed when the feature is disabled
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    … …  
    66PASS 'overscrollBehavior' in document.documentElement.style is false
    77PASS 'overscroll-behavior' in getComputedStyle(document.documentElement) is false
     8PASS CSS.supports('overscroll-behavior: contain') is false
     9PASS CSS.supports('overscroll-behavior: inherit') is false
     10PASS CSS.supports('overscroll-behavior-x: inherit') is false
     11PASS CSS.supports('overscroll-behavior-y: inherit') is false
    812PASS successfullyParsed is true
    913
  • branches/safari-612.1.5-branch/LayoutTests/fast/css/overscroll-behavior-invalidate-if-disabled.html

    r270613 r273792  
    77<body>
    88<script>
    9 description("Test overscrollBehavior should be invalidated if overscrollBehaviorEnabled is disabled");
     9description("Tests that overscroll-behavior is not exposed when the feature is disabled");
    1010
    1111shouldBeFalse("'overscrollBehavior' in document.documentElement.style");
    1212shouldBeFalse("'overscroll-behavior' in getComputedStyle(document.documentElement)");
     13shouldBeFalse("CSS.supports('overscroll-behavior: contain')");
     14shouldBeFalse("CSS.supports('overscroll-behavior: inherit')");
     15shouldBeFalse("CSS.supports('overscroll-behavior-x: inherit')");
     16shouldBeFalse("CSS.supports('overscroll-behavior-y: inherit')");
    1317
    1418</script>
  • branches/safari-612.1.5-branch/Source/WebCore/ChangeLog

    r273791 r273792  
     12021-03-02  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r273385. rdar://problem/74953186
     4
     5    Runtime-disabled CSS features still appear enabled via CSS.supports()
     6    https://bugs.webkit.org/show_bug.cgi?id=222280
     7    rdar://74595641
     8   
     9    Reviewed by Sam Weinig.
     10   
     11    Source/WebCore:
     12   
     13    When parsing CSS.supports() for a runtime-disabled property, we'd successfully
     14    parse a CSS-wide keyword like "inherit" and report that the property is supported.
     15   
     16    We need to explicitly check for runtime-disabled properties.
     17   
     18    Tests: css3/color-filters/color-filter-exposed-if-disabled.html
     19           fast/css/scroll-behavior-exposed-if-disabled.html
     20   
     21    * css/parser/CSSParserImpl.cpp:
     22    (WebCore::CSSParserImpl::isPropertyRuntimeDisabled const):
     23    (WebCore::CSSParserImpl::consumeDeclaration):
     24    * css/parser/CSSParserImpl.h:
     25   
     26    LayoutTests:
     27   
     28    * css3/color-filters/color-filter-exposed-if-disabled-expected.txt: Added. Fails tracked in webkit.org/b/217626
     29    * css3/color-filters/color-filter-exposed-if-disabled.html: Added.
     30    * fast/css/overscroll-behavior-invalidate-if-disabled-expected.txt:
     31    * fast/css/overscroll-behavior-invalidate-if-disabled.html:
     32    * fast/css/scroll-behavior-exposed-if-disabled-expected.txt: Added.
     33    * fast/css/scroll-behavior-exposed-if-disabled.html: Added.
     34   
     35   
     36    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     37
     38    2021-02-24  Simon Fraser  <simon.fraser@apple.com>
     39
     40            Runtime-disabled CSS features still appear enabled via CSS.supports()
     41            https://bugs.webkit.org/show_bug.cgi?id=222280
     42            rdar://74595641
     43
     44            Reviewed by Sam Weinig.
     45
     46            When parsing CSS.supports() for a runtime-disabled property, we'd successfully
     47            parse a CSS-wide keyword like "inherit" and report that the property is supported.
     48
     49            We need to explicitly check for runtime-disabled properties.
     50
     51            Tests: css3/color-filters/color-filter-exposed-if-disabled.html
     52                   fast/css/scroll-behavior-exposed-if-disabled.html
     53
     54            * css/parser/CSSParserImpl.cpp:
     55            (WebCore::CSSParserImpl::isPropertyRuntimeDisabled const):
     56            (WebCore::CSSParserImpl::consumeDeclaration):
     57            * css/parser/CSSParserImpl.h:
     58
    1592021-03-02  Alan Coon  <alancoon@apple.com>
    260
  • branches/safari-612.1.5-branch/Source/WebCore/css/parser/CSSParserImpl.cpp

    r268741 r273792  
    774774}
    775775
     776bool CSSParserImpl::isPropertyRuntimeDisabled(CSSPropertyID property) const
     777{
     778    switch (property) {
     779    case CSSPropertyAspectRatio:
     780        return !m_context.aspectRatioEnabled;
     781    case CSSPropertyAppleColorFilter:
     782        return !m_context.colorFilterEnabled;
     783    case CSSPropertyTranslate:
     784    case CSSPropertyRotate:
     785    case CSSPropertyScale:
     786        return !m_context.individualTransformPropertiesEnabled;
     787    case CSSPropertyOverscrollBehavior:
     788    case CSSPropertyOverscrollBehaviorX:
     789    case CSSPropertyOverscrollBehaviorY:
     790        return !m_context.overscrollBehaviorEnabled;
     791    case CSSPropertyScrollBehavior:
     792        return !m_context.scrollBehaviorEnabled;
     793#if ENABLE(TEXT_AUTOSIZING)
     794    case CSSPropertyWebkitTextSizeAdjust:
     795#if !PLATFORM(IOS_FAMILY)
     796        return !m_context.textAutosizingEnabled;
     797#endif
     798        return false;
     799#endif // ENABLE(TEXT_AUTOSIZING)
     800#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
     801    case CSSPropertyWebkitOverflowScrolling:
     802        return !m_context.legacyOverflowScrollingTouchEnabled;
     803#endif
     804    default:
     805        return false;
     806    }
     807    return false;
     808}
     809
    776810void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range, StyleRuleType ruleType)
    777811{
    … …  
    783817    if (range.consume().type() != ColonToken)
    784818        return; // Parse error
     819
     820    if (isPropertyRuntimeDisabled(propertyID))
     821        propertyID = CSSPropertyInvalid;
    785822
    786823    bool important = false;
  • branches/safari-612.1.5-branch/Source/WebCore/css/parser/CSSParserImpl.h

    r266253 r273792  
    144144    void consumeDeclarationValue(CSSParserTokenRange, CSSPropertyID, bool important, StyleRuleType);
    145145    void consumeCustomPropertyValue(CSSParserTokenRange, const AtomString& propertyName, bool important);
     146   
     147    bool isPropertyRuntimeDisabled(CSSPropertyID) const;
    146148
    147149    static Vector<double> consumeKeyframeKeyList(CSSParserTokenRange);
Note: See TracChangeset for help on using the changeset viewer.