Changeset 274055 in webkit


Ignore:
Timestamp:
Mar 7, 2021 12:16:46 PM (17 months ago)
Author:
graouts@webkit.org
Message:

Correctly handle "auto" values when blending z-index
https://bugs.webkit.org/show_bug.cgi?id=222870

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Add an extra 72 PASS results. We now pass all the z-index interpolation tests.

Another test has new failures, but this is expected, this test behaves the same way
across Firefox and Chrome as well.

  • web-platform-tests/css/css-transitions/animations/z-index-interpolation-expected.txt:
  • web-platform-tests/css/css-transitions/properties-value-auto-001-expected.txt:

Source/WebCore:

Create a dedicated wrapper for z-index such that we can handle "auto" values
instead of just blending an int.

  • animation/CSSPropertyAnimation.cpp:

(WebCore::ZIndexPropertyWrapper::ZIndexPropertyWrapper):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

LayoutTests:

Fix the test animations/stacking-context-unchanged-while-running.html which made the
wrong assumption about blending of z-index with auto values. We now make this test
expect an "auto" value and update the helper to know how to deal with "auto" values
for "z-index".

  • animations/resources/animation-test-helpers.js:

(getPropertyValue):
(comparePropertyValue):

  • animations/stacking-context-unchanged-while-running.html:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r274054 r274055  
     12021-03-07  Antoine Quint  <graouts@webkit.org>
     2
     3        Correctly handle "auto" values when blending z-index
     4        https://bugs.webkit.org/show_bug.cgi?id=222870
     5
     6        Reviewed by Dean Jackson.
     7
     8        Fix the test animations/stacking-context-unchanged-while-running.html which made the
     9        wrong assumption about blending of z-index with auto values. We now make this test
     10        expect an "auto" value and update the helper to know how to deal with "auto" values
     11        for "z-index".
     12
     13        * animations/resources/animation-test-helpers.js:
     14        (getPropertyValue):
     15        (comparePropertyValue):
     16        * animations/stacking-context-unchanged-while-running.html:
     17
    1182021-03-07  Rob Buis  <rbuis@igalia.com>
    219
  • trunk/LayoutTests/animations/resources/animation-test-helpers.js

    r267188 r274055  
    448448    } else {
    449449        var computedStyle = window.getComputedStyle(element).getPropertyCSSValue(property);
     450        if (property == "z-index" && computedStyle.cssText == "auto")
     451            return "auto";
    450452        computedValue = computedStyle.getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
    451453    }
     
    457459{
    458460    var result = true;
     461
     462    if (computedValue == expectedValue)
     463        return true;
    459464
    460465    if (!property.indexOf("webkitTransform") || !property.indexOf("transform")) {
  • trunk/LayoutTests/animations/stacking-context-unchanged-while-running.html

    r236541 r274055  
    4747        const expectedValues = [
    4848            // [animation-name, time, element-id, property, expected-value, tolerance]
    49             ["move", 0.5, "animating", "z-index", 0, 0],
     49            ["move", 0.5, "animating", "z-index", "auto", 0],
    5050        ];
    5151
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r274038 r274055  
     12021-03-07  Antoine Quint  <graouts@webkit.org>
     2
     3        Correctly handle "auto" values when blending z-index
     4        https://bugs.webkit.org/show_bug.cgi?id=222870
     5
     6        Reviewed by Dean Jackson.
     7
     8        Add an extra 72 PASS results. We now pass all the z-index interpolation tests.
     9
     10        Another test has new failures, but this is expected, this test behaves the same way
     11        across Firefox and Chrome as well.
     12
     13        * web-platform-tests/css/css-transitions/animations/z-index-interpolation-expected.txt:
     14        * web-platform-tests/css/css-transitions/properties-value-auto-001-expected.txt:
     15
    1162021-03-06  Antoine Quint  <graouts@webkit.org>
    217
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/animations/z-index-interpolation-expected.txt

    r272904 r274055  
    2424PASS Web Animations: property <z-index> from neutral to [5] at (1) should be [5]
    2525PASS Web Animations: property <z-index> from neutral to [5] at (1.5) should be [9]
    26 FAIL CSS Transitions: property <z-index> from [initial] to [5] at (-0.3) should be [5] assert_equals: expected "5 " but got "- 1 "
    27 FAIL CSS Transitions: property <z-index> from [initial] to [5] at (0) should be [5] assert_equals: expected "5 " but got "0 "
    28 FAIL CSS Transitions: property <z-index> from [initial] to [5] at (0.3) should be [5] assert_equals: expected "5 " but got "2 "
    29 FAIL CSS Transitions: property <z-index> from [initial] to [5] at (0.5) should be [5] assert_equals: expected "5 " but got "3 "
    30 FAIL CSS Transitions: property <z-index> from [initial] to [5] at (0.6) should be [5] assert_equals: expected "5 " but got "3 "
     26PASS CSS Transitions: property <z-index> from [initial] to [5] at (-0.3) should be [5]
     27PASS CSS Transitions: property <z-index> from [initial] to [5] at (0) should be [5]
     28PASS CSS Transitions: property <z-index> from [initial] to [5] at (0.3) should be [5]
     29PASS CSS Transitions: property <z-index> from [initial] to [5] at (0.5) should be [5]
     30PASS CSS Transitions: property <z-index> from [initial] to [5] at (0.6) should be [5]
    3131PASS CSS Transitions: property <z-index> from [initial] to [5] at (1) should be [5]
    32 FAIL CSS Transitions: property <z-index> from [initial] to [5] at (1.5) should be [5] assert_equals: expected "5 " but got "8 "
    33 FAIL CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (-0.3) should be [5] assert_equals: expected "5 " but got "- 1 "
    34 FAIL CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (0) should be [5] assert_equals: expected "5 " but got "0 "
    35 FAIL CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (0.3) should be [5] assert_equals: expected "5 " but got "2 "
    36 FAIL CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (0.5) should be [5] assert_equals: expected "5 " but got "3 "
    37 FAIL CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (0.6) should be [5] assert_equals: expected "5 " but got "3 "
     32PASS CSS Transitions: property <z-index> from [initial] to [5] at (1.5) should be [5]
     33PASS CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (-0.3) should be [5]
     34PASS CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (0) should be [5]
     35PASS CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (0.3) should be [5]
     36PASS CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (0.5) should be [5]
     37PASS CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (0.6) should be [5]
    3838PASS CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (1) should be [5]
    39 FAIL CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (1.5) should be [5] assert_equals: expected "5 " but got "8 "
    40 FAIL CSS Animations: property <z-index> from [initial] to [5] at (-0.3) should be [initial] assert_equals: expected "auto " but got "- 1 "
    41 FAIL CSS Animations: property <z-index> from [initial] to [5] at (0) should be [initial] assert_equals: expected "auto " but got "0 "
    42 FAIL CSS Animations: property <z-index> from [initial] to [5] at (0.3) should be [initial] assert_equals: expected "auto " but got "2 "
    43 FAIL CSS Animations: property <z-index> from [initial] to [5] at (0.5) should be [5] assert_equals: expected "5 " but got "3 "
    44 FAIL CSS Animations: property <z-index> from [initial] to [5] at (0.6) should be [5] assert_equals: expected "5 " but got "3 "
     39PASS CSS Transitions with transition: all: property <z-index> from [initial] to [5] at (1.5) should be [5]
     40PASS CSS Animations: property <z-index> from [initial] to [5] at (-0.3) should be [initial]
     41PASS CSS Animations: property <z-index> from [initial] to [5] at (0) should be [initial]
     42PASS CSS Animations: property <z-index> from [initial] to [5] at (0.3) should be [initial]
     43PASS CSS Animations: property <z-index> from [initial] to [5] at (0.5) should be [5]
     44PASS CSS Animations: property <z-index> from [initial] to [5] at (0.6) should be [5]
    4545PASS CSS Animations: property <z-index> from [initial] to [5] at (1) should be [5]
    46 FAIL CSS Animations: property <z-index> from [initial] to [5] at (1.5) should be [5] assert_equals: expected "5 " but got "8 "
    47 FAIL Web Animations: property <z-index> from [initial] to [5] at (-0.3) should be [initial] assert_equals: expected "auto " but got "- 1 "
    48 FAIL Web Animations: property <z-index> from [initial] to [5] at (0) should be [initial] assert_equals: expected "auto " but got "0 "
    49 FAIL Web Animations: property <z-index> from [initial] to [5] at (0.3) should be [initial] assert_equals: expected "auto " but got "2 "
    50 FAIL Web Animations: property <z-index> from [initial] to [5] at (0.5) should be [5] assert_equals: expected "5 " but got "3 "
    51 FAIL Web Animations: property <z-index> from [initial] to [5] at (0.6) should be [5] assert_equals: expected "5 " but got "3 "
     46PASS CSS Animations: property <z-index> from [initial] to [5] at (1.5) should be [5]
     47PASS Web Animations: property <z-index> from [initial] to [5] at (-0.3) should be [initial]
     48PASS Web Animations: property <z-index> from [initial] to [5] at (0) should be [initial]
     49PASS Web Animations: property <z-index> from [initial] to [5] at (0.3) should be [initial]
     50PASS Web Animations: property <z-index> from [initial] to [5] at (0.5) should be [5]
     51PASS Web Animations: property <z-index> from [initial] to [5] at (0.6) should be [5]
    5252PASS Web Animations: property <z-index> from [initial] to [5] at (1) should be [5]
    53 FAIL Web Animations: property <z-index> from [initial] to [5] at (1.5) should be [5] assert_equals: expected "5 " but got "8 "
     53PASS Web Animations: property <z-index> from [initial] to [5] at (1.5) should be [5]
    5454PASS CSS Transitions: property <z-index> from [inherit] to [5] at (-0.3) should be [18]
    5555PASS CSS Transitions: property <z-index> from [inherit] to [5] at (0) should be [15]
     
    7676PASS Web Animations: property <z-index> from [inherit] to [5] at (1) should be [5]
    7777PASS Web Animations: property <z-index> from [inherit] to [5] at (1.5) should be [0]
    78 FAIL CSS Transitions: property <z-index> from [unset] to [5] at (-0.3) should be [5] assert_equals: expected "5 " but got "- 1 "
    79 FAIL CSS Transitions: property <z-index> from [unset] to [5] at (0) should be [5] assert_equals: expected "5 " but got "0 "
    80 FAIL CSS Transitions: property <z-index> from [unset] to [5] at (0.3) should be [5] assert_equals: expected "5 " but got "2 "
    81 FAIL CSS Transitions: property <z-index> from [unset] to [5] at (0.5) should be [5] assert_equals: expected "5 " but got "3 "
    82 FAIL CSS Transitions: property <z-index> from [unset] to [5] at (0.6) should be [5] assert_equals: expected "5 " but got "3 "
     78PASS CSS Transitions: property <z-index> from [unset] to [5] at (-0.3) should be [5]
     79PASS CSS Transitions: property <z-index> from [unset] to [5] at (0) should be [5]
     80PASS CSS Transitions: property <z-index> from [unset] to [5] at (0.3) should be [5]
     81PASS CSS Transitions: property <z-index> from [unset] to [5] at (0.5) should be [5]
     82PASS CSS Transitions: property <z-index> from [unset] to [5] at (0.6) should be [5]
    8383PASS CSS Transitions: property <z-index> from [unset] to [5] at (1) should be [5]
    84 FAIL CSS Transitions: property <z-index> from [unset] to [5] at (1.5) should be [5] assert_equals: expected "5 " but got "8 "
    85 FAIL CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (-0.3) should be [5] assert_equals: expected "5 " but got "- 1 "
    86 FAIL CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (0) should be [5] assert_equals: expected "5 " but got "0 "
    87 FAIL CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (0.3) should be [5] assert_equals: expected "5 " but got "2 "
    88 FAIL CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (0.5) should be [5] assert_equals: expected "5 " but got "3 "
    89 FAIL CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (0.6) should be [5] assert_equals: expected "5 " but got "3 "
     84PASS CSS Transitions: property <z-index> from [unset] to [5] at (1.5) should be [5]
     85PASS CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (-0.3) should be [5]
     86PASS CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (0) should be [5]
     87PASS CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (0.3) should be [5]
     88PASS CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (0.5) should be [5]
     89PASS CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (0.6) should be [5]
    9090PASS CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (1) should be [5]
    91 FAIL CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (1.5) should be [5] assert_equals: expected "5 " but got "8 "
    92 FAIL CSS Animations: property <z-index> from [unset] to [5] at (-0.3) should be [unset] assert_equals: expected "auto " but got "- 1 "
    93 FAIL CSS Animations: property <z-index> from [unset] to [5] at (0) should be [unset] assert_equals: expected "auto " but got "0 "
    94 FAIL CSS Animations: property <z-index> from [unset] to [5] at (0.3) should be [unset] assert_equals: expected "auto " but got "2 "
    95 FAIL CSS Animations: property <z-index> from [unset] to [5] at (0.5) should be [5] assert_equals: expected "5 " but got "3 "
    96 FAIL CSS Animations: property <z-index> from [unset] to [5] at (0.6) should be [5] assert_equals: expected "5 " but got "3 "
     91PASS CSS Transitions with transition: all: property <z-index> from [unset] to [5] at (1.5) should be [5]
     92PASS CSS Animations: property <z-index> from [unset] to [5] at (-0.3) should be [unset]
     93PASS CSS Animations: property <z-index> from [unset] to [5] at (0) should be [unset]
     94PASS CSS Animations: property <z-index> from [unset] to [5] at (0.3) should be [unset]
     95PASS CSS Animations: property <z-index> from [unset] to [5] at (0.5) should be [5]
     96PASS CSS Animations: property <z-index> from [unset] to [5] at (0.6) should be [5]
    9797PASS CSS Animations: property <z-index> from [unset] to [5] at (1) should be [5]
    98 FAIL CSS Animations: property <z-index> from [unset] to [5] at (1.5) should be [5] assert_equals: expected "5 " but got "8 "
    99 FAIL Web Animations: property <z-index> from [unset] to [5] at (-0.3) should be [unset] assert_equals: expected "auto " but got "- 1 "
    100 FAIL Web Animations: property <z-index> from [unset] to [5] at (0) should be [unset] assert_equals: expected "auto " but got "0 "
    101 FAIL Web Animations: property <z-index> from [unset] to [5] at (0.3) should be [unset] assert_equals: expected "auto " but got "2 "
    102 FAIL Web Animations: property <z-index> from [unset] to [5] at (0.5) should be [5] assert_equals: expected "5 " but got "3 "
    103 FAIL Web Animations: property <z-index> from [unset] to [5] at (0.6) should be [5] assert_equals: expected "5 " but got "3 "
     98PASS CSS Animations: property <z-index> from [unset] to [5] at (1.5) should be [5]
     99PASS Web Animations: property <z-index> from [unset] to [5] at (-0.3) should be [unset]
     100PASS Web Animations: property <z-index> from [unset] to [5] at (0) should be [unset]
     101PASS Web Animations: property <z-index> from [unset] to [5] at (0.3) should be [unset]
     102PASS Web Animations: property <z-index> from [unset] to [5] at (0.5) should be [5]
     103PASS Web Animations: property <z-index> from [unset] to [5] at (0.6) should be [5]
    104104PASS Web Animations: property <z-index> from [unset] to [5] at (1) should be [5]
    105 FAIL Web Animations: property <z-index> from [unset] to [5] at (1.5) should be [5] assert_equals: expected "5 " but got "8 "
     105PASS Web Animations: property <z-index> from [unset] to [5] at (1.5) should be [5]
    106106PASS CSS Transitions: property <z-index> from [-5] to [5] at (-0.3) should be [-8]
    107107PASS CSS Transitions: property <z-index> from [-5] to [5] at (0) should be [-5]
     
    180180PASS Web Animations: property <z-index> from [-2] to [-4] at (1) should be [-4]
    181181PASS Web Animations: property <z-index> from [-2] to [-4] at (1.5) should be [-5]
    182 FAIL CSS Transitions: property <z-index> from [auto] to [10] at (-0.3) should be [10] assert_equals: expected "10 " but got "- 3 "
    183 FAIL CSS Transitions: property <z-index> from [auto] to [10] at (0) should be [10] assert_equals: expected "10 " but got "0 "
    184 FAIL CSS Transitions: property <z-index> from [auto] to [10] at (0.3) should be [10] assert_equals: expected "10 " but got "3 "
    185 FAIL CSS Transitions: property <z-index> from [auto] to [10] at (0.5) should be [10] assert_equals: expected "10 " but got "5 "
    186 FAIL CSS Transitions: property <z-index> from [auto] to [10] at (0.6) should be [10] assert_equals: expected "10 " but got "6 "
     182PASS CSS Transitions: property <z-index> from [auto] to [10] at (-0.3) should be [10]
     183PASS CSS Transitions: property <z-index> from [auto] to [10] at (0) should be [10]
     184PASS CSS Transitions: property <z-index> from [auto] to [10] at (0.3) should be [10]
     185PASS CSS Transitions: property <z-index> from [auto] to [10] at (0.5) should be [10]
     186PASS CSS Transitions: property <z-index> from [auto] to [10] at (0.6) should be [10]
    187187PASS CSS Transitions: property <z-index> from [auto] to [10] at (1) should be [10]
    188 FAIL CSS Transitions: property <z-index> from [auto] to [10] at (1.5) should be [10] assert_equals: expected "10 " but got "15 "
    189 FAIL CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (-0.3) should be [10] assert_equals: expected "10 " but got "- 3 "
    190 FAIL CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (0) should be [10] assert_equals: expected "10 " but got "0 "
    191 FAIL CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (0.3) should be [10] assert_equals: expected "10 " but got "3 "
    192 FAIL CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (0.5) should be [10] assert_equals: expected "10 " but got "5 "
    193 FAIL CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (0.6) should be [10] assert_equals: expected "10 " but got "6 "
     188PASS CSS Transitions: property <z-index> from [auto] to [10] at (1.5) should be [10]
     189PASS CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (-0.3) should be [10]
     190PASS CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (0) should be [10]
     191PASS CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (0.3) should be [10]
     192PASS CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (0.5) should be [10]
     193PASS CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (0.6) should be [10]
    194194PASS CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (1) should be [10]
    195 FAIL CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (1.5) should be [10] assert_equals: expected "10 " but got "15 "
    196 FAIL CSS Animations: property <z-index> from [auto] to [10] at (-0.3) should be [auto] assert_equals: expected "auto " but got "- 3 "
    197 FAIL CSS Animations: property <z-index> from [auto] to [10] at (0) should be [auto] assert_equals: expected "auto " but got "0 "
    198 FAIL CSS Animations: property <z-index> from [auto] to [10] at (0.3) should be [auto] assert_equals: expected "auto " but got "3 "
    199 FAIL CSS Animations: property <z-index> from [auto] to [10] at (0.5) should be [10] assert_equals: expected "10 " but got "5 "
    200 FAIL CSS Animations: property <z-index> from [auto] to [10] at (0.6) should be [10] assert_equals: expected "10 " but got "6 "
     195PASS CSS Transitions with transition: all: property <z-index> from [auto] to [10] at (1.5) should be [10]
     196PASS CSS Animations: property <z-index> from [auto] to [10] at (-0.3) should be [auto]
     197PASS CSS Animations: property <z-index> from [auto] to [10] at (0) should be [auto]
     198PASS CSS Animations: property <z-index> from [auto] to [10] at (0.3) should be [auto]
     199PASS CSS Animations: property <z-index> from [auto] to [10] at (0.5) should be [10]
     200PASS CSS Animations: property <z-index> from [auto] to [10] at (0.6) should be [10]
    201201PASS CSS Animations: property <z-index> from [auto] to [10] at (1) should be [10]
    202 FAIL CSS Animations: property <z-index> from [auto] to [10] at (1.5) should be [10] assert_equals: expected "10 " but got "15 "
    203 FAIL Web Animations: property <z-index> from [auto] to [10] at (-0.3) should be [auto] assert_equals: expected "auto " but got "- 3 "
    204 FAIL Web Animations: property <z-index> from [auto] to [10] at (0) should be [auto] assert_equals: expected "auto " but got "0 "
    205 FAIL Web Animations: property <z-index> from [auto] to [10] at (0.3) should be [auto] assert_equals: expected "auto " but got "3 "
    206 FAIL Web Animations: property <z-index> from [auto] to [10] at (0.5) should be [10] assert_equals: expected "10 " but got "5 "
    207 FAIL Web Animations: property <z-index> from [auto] to [10] at (0.6) should be [10] assert_equals: expected "10 " but got "6 "
     202PASS CSS Animations: property <z-index> from [auto] to [10] at (1.5) should be [10]
     203PASS Web Animations: property <z-index> from [auto] to [10] at (-0.3) should be [auto]
     204PASS Web Animations: property <z-index> from [auto] to [10] at (0) should be [auto]
     205PASS Web Animations: property <z-index> from [auto] to [10] at (0.3) should be [auto]
     206PASS Web Animations: property <z-index> from [auto] to [10] at (0.5) should be [10]
     207PASS Web Animations: property <z-index> from [auto] to [10] at (0.6) should be [10]
    208208PASS Web Animations: property <z-index> from [auto] to [10] at (1) should be [10]
    209 FAIL Web Animations: property <z-index> from [auto] to [10] at (1.5) should be [10] assert_equals: expected "10 " but got "15 "
     209PASS Web Animations: property <z-index> from [auto] to [10] at (1.5) should be [10]
    210210
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/properties-value-auto-001-expected.txt

    r273635 r274055  
    4848FAIL bottom auto(from) / values assert_not_equals: must not be target value after start got disallowed value "13.333333015441895px"
    4949FAIL bottom auto(from) / events assert_equals: Expected TransitionEnd events triggered on .transition expected "bottom:2s" but got ""
    50 PASS z-index auto(to) / values
    51 PASS z-index auto(to) / events
    52 PASS z-index auto(from) / values
    53 PASS z-index auto(from) / events
     50FAIL z-index auto(to) / values assert_not_equals: must not be target value after start got disallowed value "auto"
     51FAIL z-index auto(to) / events assert_equals: Expected TransitionEnd events triggered on .transition expected "z-index:2s" but got ""
     52FAIL z-index auto(from) / values assert_not_equals: must not be target value after start got disallowed value "10"
     53FAIL z-index auto(from) / events assert_equals: Expected TransitionEnd events triggered on .transition expected "z-index:2s" but got ""
    5454Text sample
    5555
  • trunk/Source/WebCore/ChangeLog

    r274054 r274055  
     12021-03-07  Antoine Quint  <graouts@webkit.org>
     2
     3        Correctly handle "auto" values when blending z-index
     4        https://bugs.webkit.org/show_bug.cgi?id=222870
     5
     6        Reviewed by Dean Jackson.
     7
     8        Create a dedicated wrapper for z-index such that we can handle "auto" values
     9        instead of just blending an int.
     10
     11        * animation/CSSPropertyAnimation.cpp:
     12        (WebCore::ZIndexPropertyWrapper::ZIndexPropertyWrapper):
     13        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     14
    1152021-03-07  Rob Buis  <rbuis@igalia.com>
    216
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r274050 r274055  
    16991699};
    17001700
     1701class ZIndexPropertyWrapper : public PropertyWrapper<int> {
     1702    WTF_MAKE_FAST_ALLOCATED;
     1703public:
     1704    ZIndexPropertyWrapper()
     1705        : PropertyWrapper<int>(CSSPropertyZIndex, &RenderStyle::specifiedZIndex, &RenderStyle::setSpecifiedZIndex)
     1706    {
     1707    }
     1708
     1709    bool canInterpolate(const RenderStyle* from, const RenderStyle* to) const override
     1710    {
     1711        return !from->hasAutoSpecifiedZIndex() && !to->hasAutoSpecifiedZIndex();
     1712    }
     1713
     1714    void blend(const CSSPropertyBlendingClient* anim, RenderStyle* dst, const RenderStyle* from, const RenderStyle* to, double progress) const override
     1715    {
     1716        PropertyWrapper::blend(anim, dst, from, to, progress);
     1717        if (canInterpolate(from, to))
     1718            return;
     1719
     1720        ASSERT(!progress || progress == 1.0);
     1721        if (!progress) {
     1722            if (from->hasAutoSpecifiedZIndex())
     1723                dst->setHasAutoSpecifiedZIndex();
     1724        } else {
     1725            if (to->hasAutoSpecifiedZIndex())
     1726                dst->setHasAutoSpecifiedZIndex();
     1727        }
     1728    }
     1729};
     1730
    17011731class CSSPropertyAnimationWrapperMap {
    17021732    WTF_MAKE_FAST_ALLOCATED;
     
    18161846        new PropertyWrapper<float>(CSSPropertyWebkitBorderHorizontalSpacing, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing),
    18171847        new PropertyWrapper<float>(CSSPropertyWebkitBorderVerticalSpacing, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing),
    1818         new PropertyWrapper<int>(CSSPropertyZIndex, &RenderStyle::specifiedZIndex, &RenderStyle::setSpecifiedZIndex),
     1848        new ZIndexPropertyWrapper,
    18191849        new PropertyWrapper<unsigned short>(CSSPropertyOrphans, &RenderStyle::orphans, &RenderStyle::setOrphans),
    18201850        new PropertyWrapper<unsigned short>(CSSPropertyWidows, &RenderStyle::widows, &RenderStyle::setWidows),
Note: See TracChangeset for help on using the changeset viewer.