Changeset 251658 in webkit


Ignore:
Timestamp:
Oct 28, 2019 10:01:55 AM (5 years ago)
Author:
graouts@webkit.org
Message:

CSS Transitions and CSS Animations properties should treat unitless 0 as an invalid value for times
https://bugs.webkit.org/show_bug.cgi?id=203484

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Mark WPT progressions.

  • web-platform-tests/css/css-animations/parsing/animation-delay-invalid-expected.txt:
  • web-platform-tests/css/css-animations/parsing/animation-duration-invalid-expected.txt:
  • web-platform-tests/css/css-transitions/parsing/transition-delay-invalid-expected.txt:

Source/WebCore:

The CSS specification does not allow for "0" as a valid time (https://drafts.csswg.org/css-values-3/#time).
We change the way we parse time values to only allow for "0" if the UnitlessQuirk is set to Allow, which is
only the case for the -webkit-marquee-speed property.

  • css/parser/CSSPropertyParserHelpers.cpp:

(WebCore::CSSPropertyParserHelpers::consumeTime):

Source/WebInspectorUI:

Use 0s instead of 0 in places where unitless times were used but shouldn't have been.

  • UserInterface/Views/FindBanner.css:

(.no-find-banner-transition:matches(.find-banner, .supports-find-banner)):

  • UserInterface/Views/TabBar.css:

(.tab-bar > .item > .close):

LayoutTests:

Use 0s instead of 0 in places where unitless times were used but shouldn't have been.

  • animations/fill-mode-forwards-zero-duration.html:
  • compositing/animation/keyframe-order.html:
  • css1/units/zero-duration-without-units.html:
  • legacy-animation-engine/animations/fill-mode-forwards-zero-duration.html:
  • legacy-animation-engine/compositing/animation/keyframe-order.html:
  • legacy-animation-engine/css1/units/zero-duration-without-units.html:
  • legacy-animation-engine/transitions/zero-duration-in-list.html:
  • legacy-animation-engine/transitions/zero-duration-without-units.html:
  • transitions/zero-duration-in-list.html:
  • transitions/zero-duration-without-units.html:
  • webanimations/css-animations-expected.txt:
  • webanimations/css-animations.html:
Location:
trunk
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r251656 r251658  
     12019-10-28  Antoine Quint  <graouts@apple.com>
     2
     3        CSS Transitions and CSS Animations properties should treat unitless 0 as an invalid value for times
     4        https://bugs.webkit.org/show_bug.cgi?id=203484
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Use 0s instead of 0 in places where unitless times were used but shouldn't have been.
     9
     10        * animations/fill-mode-forwards-zero-duration.html:
     11        * compositing/animation/keyframe-order.html:
     12        * css1/units/zero-duration-without-units.html:
     13        * legacy-animation-engine/animations/fill-mode-forwards-zero-duration.html:
     14        * legacy-animation-engine/compositing/animation/keyframe-order.html:
     15        * legacy-animation-engine/css1/units/zero-duration-without-units.html:
     16        * legacy-animation-engine/transitions/zero-duration-in-list.html:
     17        * legacy-animation-engine/transitions/zero-duration-without-units.html:
     18        * transitions/zero-duration-in-list.html:
     19        * transitions/zero-duration-without-units.html:
     20        * webanimations/css-animations-expected.txt:
     21        * webanimations/css-animations.html:
     22
    1232019-10-28  Carlos Alberto Lopez Perez  <clopez@igalia.com>
    224
  • trunk/LayoutTests/animations/fill-mode-forwards-zero-duration.html

    r236541 r251658  
    1010      width: 100px;
    1111      background-color: blue;
    12       animation: anim1 0 2s linear forwards;
     12      animation: anim1 0s 2s linear forwards;
    1313    }
    1414    @keyframes anim1 {
  • trunk/LayoutTests/compositing/animation/keyframe-order.html

    r170691 r251658  
    2222   
    2323    .spinner.animating {
    24         -webkit-animation: imageSpin 999999999s linear 0 infinite
     24        -webkit-animation: imageSpin 999999999s linear 0s infinite
    2525    }
    2626
  • trunk/LayoutTests/css1/units/zero-duration-without-units.html

    r119990 r251658  
    1313      -webkit-transition-property: top, left;
    1414      -webkit-transition-duration: 1s;
    15       -webkit-transition-duration: 0;
     15      -webkit-transition-duration: 0s;
    1616      -webkit-transition-timing-function: linear;
    1717    }
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r251657 r251658  
     12019-10-28  Antoine Quint  <graouts@apple.com>
     2
     3        CSS Transitions and CSS Animations properties should treat unitless 0 as an invalid value for times
     4        https://bugs.webkit.org/show_bug.cgi?id=203484
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Mark WPT progressions.
     9
     10        * web-platform-tests/css/css-animations/parsing/animation-delay-invalid-expected.txt:
     11        * web-platform-tests/css/css-animations/parsing/animation-duration-invalid-expected.txt:
     12        * web-platform-tests/css/css-transitions/parsing/transition-delay-invalid-expected.txt:
     13
    1142019-10-27  Antoine Quint  <graouts@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-delay-invalid-expected.txt

    r251591 r251658  
    11
    22PASS e.style['animation-delay'] = "infinite" should not set the property value
    3 FAIL e.style['animation-delay'] = "0" should not set the property value assert_equals: expected "" but got "0ms"
     3PASS e.style['animation-delay'] = "0" should not set the property value
    44PASS e.style['animation-delay'] = "1s 2s" should not set the property value
    55PASS e.style['animation-delay'] = "initial, -3s" should not set the property value
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-duration-invalid-expected.txt

    r251591 r251658  
    11
    22PASS e.style['animation-duration'] = "-3s" should not set the property value
    3 FAIL e.style['animation-duration'] = "0" should not set the property value assert_equals: expected "" but got "0ms"
     3PASS e.style['animation-duration'] = "0" should not set the property value
    44PASS e.style['animation-duration'] = "infinite" should not set the property value
    55PASS e.style['animation-duration'] = "1s 2s" should not set the property value
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-delay-invalid-expected.txt

    r251591 r251658  
    11
    22PASS e.style['transition-delay'] = "infinite" should not set the property value
    3 FAIL e.style['transition-delay'] = "0" should not set the property value assert_equals: expected "" but got "0ms"
     3PASS e.style['transition-delay'] = "0" should not set the property value
    44PASS e.style['transition-delay'] = "500ms 0.5s" should not set the property value
    55PASS e.style['transition-delay'] = "-3s, initial" should not set the property value
  • trunk/LayoutTests/legacy-animation-engine/animations/fill-mode-forwards-zero-duration.html

    r235960 r251658  
    1010      width: 100px;
    1111      background-color: blue;
    12       animation: anim1 0 2s linear forwards;
     12      animation: anim1 0s 2s linear forwards;
    1313    }
    1414    @keyframes anim1 {
  • trunk/LayoutTests/legacy-animation-engine/compositing/animation/keyframe-order.html

    r235960 r251658  
    2222   
    2323    .spinner.animating {
    24         -webkit-animation: imageSpin 999999999s linear 0 infinite
     24        -webkit-animation: imageSpin 999999999s linear 0s infinite
    2525    }
    2626
  • trunk/LayoutTests/legacy-animation-engine/css1/units/zero-duration-without-units.html

    r235960 r251658  
    1212      -webkit-transition-property: top, left;
    1313      -webkit-transition-duration: 1s;
    14       -webkit-transition-duration: 0;
     14      -webkit-transition-duration: 0s;
    1515      -webkit-transition-timing-function: linear;
    1616    }
  • trunk/LayoutTests/legacy-animation-engine/transitions/zero-duration-in-list.html

    r235960 r251658  
    1010      width: 100px;
    1111      background-color: blue;
    12       -webkit-transition-duration: 0, 0.5s;
     12      -webkit-transition-duration: 0s, 0.5s;
    1313      -webkit-transition-timing-function: linear;
    1414      -webkit-transition-property: top, left;
  • trunk/LayoutTests/legacy-animation-engine/transitions/zero-duration-without-units.html

    r235960 r251658  
    1010      -webkit-transition-property: top;
    1111      -webkit-transition-duration: 1s;
    12       -webkit-transition-duration: 0;
     12      -webkit-transition-duration: 0s;
    1313    }
    1414  </style>
  • trunk/LayoutTests/transitions/zero-duration-in-list.html

    r235948 r251658  
    1010      width: 100px;
    1111      background-color: blue;
    12       -webkit-transition-duration: 0, 0.5s;
     12      -webkit-transition-duration: 0s, 0.5s;
    1313      -webkit-transition-timing-function: linear;
    1414      -webkit-transition-property: top, left;
  • trunk/LayoutTests/transitions/zero-duration-without-units.html

    r120521 r251658  
    1010      -webkit-transition-property: top;
    1111      -webkit-transition-duration: 1s;
    12       -webkit-transition-duration: 0;
     12      -webkit-transition-duration: 0s;
    1313    }
    1414  </style>
  • trunk/LayoutTests/webanimations/css-animations-expected.txt

    r229981 r251658  
    1212PASS Seeking the animation to its end time no longer lists the animation after it has been running.
    1313PASS Setting the target's animation-name to none no longer lists the animation after it has been running.
    14 PASS Setting the target's animation-duration to 0 no longer lists the animation after it has been running.
     14PASS Setting the target's animation-duration to 0s no longer lists the animation after it has been running.
    1515
  • trunk/LayoutTests/webanimations/css-animations.html

    r237857 r251658  
    9292    assert_equals(target.getAnimations()[0].effect.getTiming().delay, -1000, "The animation's delay matches the initial animation-delay property.");
    9393
    94     target.style.animationDelay = 0;
     94    target.style.animationDelay = "0s";
    9595    assert_equals(target.getAnimations()[0].effect.getTiming().delay, 0, "The animation's delay matches the updated animation-delay property.");
    9696}, "Web Animations should reflect the animation-delay property.");
     
    222222runAnimationCompletionTest(animation => animation.currentTime = animation.effect.getTiming().duration, "Seeking the animation to its end time");
    223223runAnimationCompletionTest(animation => animation.effect.target.style.animationName = "none", "Setting the target's animation-name to none");
    224 runAnimationCompletionTest(animation => animation.effect.target.style.animationDuration = 0, "Setting the target's animation-duration to 0");
     224runAnimationCompletionTest(animation => animation.effect.target.style.animationDuration = "0s", "Setting the target's animation-duration to 0s");
    225225
    226226</script>
  • trunk/Source/WebCore/ChangeLog

    r251657 r251658  
     12019-10-28  Antoine Quint  <graouts@apple.com>
     2
     3        CSS Transitions and CSS Animations properties should treat unitless 0 as an invalid value for times
     4        https://bugs.webkit.org/show_bug.cgi?id=203484
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The CSS specification does not allow for "0" as a valid time (https://drafts.csswg.org/css-values-3/#time).
     9        We change the way we parse time values to only allow for "0" if the UnitlessQuirk is set to Allow, which is
     10        only the case for the -webkit-marquee-speed property.
     11
     12        * css/parser/CSSPropertyParserHelpers.cpp:
     13        (WebCore::CSSPropertyParserHelpers::consumeTime):
     14
    1152019-10-27  Antoine Quint  <graouts@apple.com>
    216
  • trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp

    r251580 r251658  
    448448    const CSSParserToken& token = range.peek();
    449449    CSSPrimitiveValue::UnitType unit = token.unitType();
    450     bool acceptUnitless = token.type() == NumberToken && shouldAcceptUnitlessValue(token.numericValue(), cssParserMode, unitless);
     450    bool acceptUnitless = token.type() == NumberToken && unitless == UnitlessQuirk::Allow && shouldAcceptUnitlessValue(token.numericValue(), cssParserMode, unitless);
    451451    if (acceptUnitless)
    452452        unit = CSSPrimitiveValue::UnitType::CSS_MS;
  • trunk/Source/WebInspectorUI/ChangeLog

    r251624 r251658  
     12019-10-28  Antoine Quint  <graouts@apple.com>
     2
     3        CSS Transitions and CSS Animations properties should treat unitless 0 as an invalid value for times
     4        https://bugs.webkit.org/show_bug.cgi?id=203484
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Use 0s instead of 0 in places where unitless times were used but shouldn't have been.
     9
     10        * UserInterface/Views/FindBanner.css:
     11        (.no-find-banner-transition:matches(.find-banner, .supports-find-banner)):
     12        * UserInterface/Views/TabBar.css:
     13        (.tab-bar > .item > .close):
     14
    1152019-10-25  Devin Rousso  <drousso@apple.com>
    216
  • trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.css

    r248180 r251658  
    5353
    5454.no-find-banner-transition:matches(.find-banner, .supports-find-banner) {
    55     transition-duration: 0 !important;
     55    transition-duration: 0s !important;
    5656}
    5757
  • trunk/Source/WebInspectorUI/UserInterface/Views/TabBar.css

    r246666 r251658  
    191191    transition-property: background-color, opacity;
    192192    transition-duration: 250ms, 500ms;
    193     transition-delay: 0, 50ms;
     193    transition-delay: 0s, 50ms;
    194194
    195195    -webkit-margin-end: 4px;
Note: See TracChangeset for help on using the changeset viewer.