Changeset 278933 in webkit


Ignore:
Timestamp:
Jun 16, 2021, 7:37:30 AM (4 years ago)
Author:
ntim@apple.com
Message:

Make CSS.supports() return false for internal CSS properties
https://bugs.webkit.org/show_bug.cgi?id=224930

Reviewed by Antti Koivisto.

Test: LayoutTests/fast/backgrounds/background-repeat-x-y-parse.html

Examples that are now rejected:

CSS.supports("background-repeat-x: inherit")
CSS.supports("background-repeat-x", "inherit")
CSS.supports("background-repeat-y: inherit")
CSS.supports("background-repeat-y", "inherit")

Source/WebCore:

  • css/DOMCSSNamespace.cpp:

(WebCore::DOMCSSNamespace::supports):

  • css/parser/CSSParserImpl.cpp:

(WebCore::CSSParserImpl::consumeDeclaration):

LayoutTests:

  • fast/backgrounds/background-repeat-x-y-parse-expected.txt:
  • fast/backgrounds/background-repeat-x-y-parse.html:
  • fast/css/webkit-mask-crash-implicit-expected.txt:
  • fast/css/webkit-mask-crash-implicit.html:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r278932 r278933  
     12021-06-16  Tim Nguyen  <ntim@apple.com>
     2
     3        Make CSS.supports() return false for internal CSS properties
     4        https://bugs.webkit.org/show_bug.cgi?id=224930
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Test: LayoutTests/fast/backgrounds/background-repeat-x-y-parse.html
     9
     10        Examples that are now rejected:
     11
     12        CSS.supports("background-repeat-x: inherit")
     13        CSS.supports("background-repeat-x", "inherit")
     14        CSS.supports("background-repeat-y: inherit")
     15        CSS.supports("background-repeat-y", "inherit")
     16
     17        * fast/backgrounds/background-repeat-x-y-parse-expected.txt:
     18        * fast/backgrounds/background-repeat-x-y-parse.html:
     19        * fast/css/webkit-mask-crash-implicit-expected.txt:
     20        * fast/css/webkit-mask-crash-implicit.html:
     21
    1222021-06-16  Toshio Ogasawara  <toshio.ogasawara@access-company.com>
    223
  • trunk/LayoutTests/fast/backgrounds/background-repeat-x-y-parse-expected.txt

    r267644 r278933  
    1 This test checks that background-repeat-x/y are not parsed
     1This test checks that background-repeat-x/y are not parsed or supported
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     
    88PASS window.getComputedStyle(document.getElementById('test3')).getPropertyValue('background-repeat') is "repeat-y"
    99PASS window.getComputedStyle(document.getElementById('test4')).getPropertyValue('background-repeat') is "repeat-x"
     10PASS CSS.supports('background-repeat-x: inherit') is false
     11PASS CSS.supports('background-repeat-x', 'inherit') is false
     12PASS CSS.supports('background-repeat-y: inherit') is false
     13PASS CSS.supports('background-repeat-y', 'inherit') is false
    1014PASS successfullyParsed is true
    1115
  • trunk/LayoutTests/fast/backgrounds/background-repeat-x-y-parse.html

    r211152 r278933  
    2020<div id="test4" class="test" style="background-repeat: repeat-x; background-repeat-x: no-repeat;"></div>
    2121<script>
    22 description("This test checks that background-repeat-x/y are not parsed");
     22description("This test checks that background-repeat-x/y are not parsed or supported");
    2323
    2424shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).getPropertyValue('background-repeat')", "repeat");
     
    2626shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).getPropertyValue('background-repeat')", "repeat-y");
    2727shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).getPropertyValue('background-repeat')", "repeat-x");
     28
     29shouldBeFalse("CSS.supports('background-repeat-x: inherit')");
     30shouldBeFalse("CSS.supports('background-repeat-x', 'inherit')");
     31shouldBeFalse("CSS.supports('background-repeat-y: inherit')");
     32shouldBeFalse("CSS.supports('background-repeat-y', 'inherit')");
    2833</script>
    2934<script src="../../resources/js-test-post.js"></script>
  • trunk/LayoutTests/fast/css/webkit-mask-crash-implicit-expected.txt

    r200357 r278933  
    1 PASS document.styleSheets[1].rules[0].style.cssText is "-webkit-mask-repeat-x: repeat; -webkit-mask-repeat-y: inherit;"
     1PASS document.styleSheets[1].rules[0].style.cssText is "-webkit-mask-repeat-x: repeat; -webkit-mask-repeat-y: no-repeat;"
    22PASS document.styleSheets[1].rules[0].style.getPropertyValue('-webkit-mask') is ""
    3 PASS document.styleSheets[1].rules[0].style.getPropertyValue('-webkit-mask-repeat') is "inherit"
     3PASS document.styleSheets[1].rules[0].style.getPropertyValue('-webkit-mask-repeat') is "repeat-x"
    44
  • trunk/LayoutTests/fast/css/webkit-mask-crash-implicit.html

    r200357 r278933  
    1010if (window.internals)
    1111    testRunner.dumpAsText();
    12 shouldBeEqualToString("document.styleSheets[1].rules[0].style.cssText", "-webkit-mask-repeat-x: repeat; -webkit-mask-repeat-y: inherit;");
     12shouldBeEqualToString("document.styleSheets[1].rules[0].style.cssText", "-webkit-mask-repeat-x: repeat; -webkit-mask-repeat-y: no-repeat;");
    1313shouldBeEqualToString("document.styleSheets[1].rules[0].style.getPropertyValue('-webkit-mask')", "");
    14 shouldBeEqualToString("document.styleSheets[1].rules[0].style.getPropertyValue('-webkit-mask-repeat')", "inherit");
     14shouldBeEqualToString("document.styleSheets[1].rules[0].style.getPropertyValue('-webkit-mask-repeat')", "repeat-x");
    1515</script>
    1616</head>
  • trunk/Source/WebCore/ChangeLog

    r278932 r278933  
     12021-06-16  Tim Nguyen  <ntim@apple.com>
     2
     3        Make CSS.supports() return false for internal CSS properties
     4        https://bugs.webkit.org/show_bug.cgi?id=224930
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Test: LayoutTests/fast/backgrounds/background-repeat-x-y-parse.html
     9
     10        Examples that are now rejected:
     11
     12        CSS.supports("background-repeat-x: inherit")
     13        CSS.supports("background-repeat-x", "inherit")
     14        CSS.supports("background-repeat-y: inherit")
     15        CSS.supports("background-repeat-y", "inherit")
     16
     17        * css/DOMCSSNamespace.cpp:
     18        (WebCore::DOMCSSNamespace::supports):
     19        * css/parser/CSSParserImpl.cpp:
     20        (WebCore::CSSParserImpl::consumeDeclaration):
     21
    1222021-06-16  Toshio Ogasawara  <toshio.ogasawara@access-company.com>
    223
  • trunk/Source/WebCore/css/DOMCSSNamespace.cpp

    r274520 r278933  
    6464        return false;
    6565
     66    if (isInternalCSSProperty(propertyID))
     67        return false;
     68
    6669    if (propertyID == CSSPropertyInvalid)
    6770        return false;
  • trunk/Source/WebCore/css/parser/CSSParserImpl.cpp

    r278185 r278933  
    811811        return; // Parse error
    812812
    813     if (m_context.isPropertyRuntimeDisabled(propertyID))
     813    if (m_context.isPropertyRuntimeDisabled(propertyID) || isInternalCSSProperty(propertyID))
    814814        propertyID = CSSPropertyInvalid;
    815815
Note: See TracChangeset for help on using the changeset viewer.