Changeset 233892 in webkit


Ignore:
Timestamp:
Jul 17, 2018 11:54:05 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[Web Animations] Interpolation between lengths with an "auto" value should be discrete
https://bugs.webkit.org/show_bug.cgi?id=187721

Patch by Antoine Quint <Antoine Quint> on 2018-07-17
Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark 2 new WPT progressions.

  • web-platform-tests/web-animations/animation-model/animation-types/discrete-expected.txt:

Source/WebCore:

When interpolating between two Length values, if one is "auto", we should use the from-value
from 0 and up to (but excluding) 0.5, and use the to-value from 0.5 to 1.

This change caused a regression in the legacy animation engine since it would create a CSS
transition even when the underlying and target values were non-interpolable. As such, the
underlying value would be used until the transition's mid-point and the tests at
legacy-animation-engine/imported/blink/transitions/transition-not-interpolable.html and
legacy-animation-engine/fast/animation/height-auto-transition-computed-value.html would fail
expecting the target value to be used immediately. We now ensure that no transition is actually
started if two values for a given property cannot be interpolated.

  • page/animation/CompositeAnimation.cpp:

(WebCore::CompositeAnimation::updateTransitions):

  • platform/Length.cpp:

(WebCore::blend):

LayoutTests:

Make two more tests opt into the new animation engine since they pass and they're not in the legacy-animation-engine directory.
A third test now has some logging due to transitions not actually running, which is expected and correct.

  • fast/animation/height-auto-transition-computed-value.html:
  • imported/blink/transitions/transition-not-interpolable.html:
  • legacy-animation-engine/transitions/transition-to-from-auto-expected.txt:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r233888 r233892  
     12018-07-17  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Interpolation between lengths with an "auto" value should be discrete
     4        https://bugs.webkit.org/show_bug.cgi?id=187721
     5
     6        Reviewed by Dean Jackson.
     7
     8        Make two more tests opt into the new animation engine since they pass and they're not in the legacy-animation-engine directory.
     9        A third test now has some logging due to transitions not actually running, which is expected and correct.
     10
     11        * fast/animation/height-auto-transition-computed-value.html:
     12        * imported/blink/transitions/transition-not-interpolable.html:
     13        * legacy-animation-engine/transitions/transition-to-from-auto-expected.txt:
     14
    1152018-07-17  John Wilander  <wilander@apple.com>
    216
  • trunk/LayoutTests/fast/animation/height-auto-transition-computed-value.html

    r200622 r233892  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableWebAnimationsCSSIntegration=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/imported/blink/transitions/transition-not-interpolable.html

    r190629 r233892  
    1 <!doctype html>
     1<!doctype html><!-- webkit-test-runner [ enableWebAnimationsCSSIntegration=true ] -->
    22<style>
    33#test {
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r233739 r233892  
     12018-07-17  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Interpolation between lengths with an "auto" value should be discrete
     4        https://bugs.webkit.org/show_bug.cgi?id=187721
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark 2 new WPT progressions.
     9
     10        * web-platform-tests/web-animations/animation-model/animation-types/discrete-expected.txt:
     11
    1122018-07-11  Youenn Fablet  <youenn@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/discrete-expected.txt

    r228537 r233892  
    11
    22FAIL Test animating discrete values assert_equals: Animation produces 'from' value just before the middle of the interval expected "normal" but got "oblique 9.75deg"
    3 FAIL Test discrete animation is used when interpolation fails assert_equals: Animation produces 'from' value at start of interval expected "0px" but got "200px"
    4 FAIL Test discrete animation is used only for pairs of values that cannot be interpolated assert_equals: Animation produces 'from' value at start of interval expected "0px" but got "200px"
     3PASS Test discrete animation is used when interpolation fails
     4PASS Test discrete animation is used only for pairs of values that cannot be interpolated
    55FAIL Test the 50% switch point for discrete animation is based on the effect easing assert_equals: Animation produces 'from' value at 94% of the iteration time expected "normal" but got "oblique 8.5deg"
    66FAIL Test the 50% switch point for discrete animation is based on the keyframe easing assert_equals: Animation produces 'from' value at 94% of the iteration time expected "normal" but got "oblique 8.5deg"
  • trunk/LayoutTests/legacy-animation-engine/transitions/transition-to-from-auto-expected.txt

    r230471 r233892  
     1CONSOLE MESSAGE: line 371: Failed to pause 'left' transition on element 'test1'
     2CONSOLE MESSAGE: line 371: Failed to pause 'left' transition on element 'test2'
    13PASS - "left" property for "test1" element at 1s saw something close to: 0
    24PASS - "left" property for "test2" element at 1s saw something close to: 100
  • trunk/Source/WebCore/ChangeLog

    r233891 r233892  
     12018-07-17  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Interpolation between lengths with an "auto" value should be discrete
     4        https://bugs.webkit.org/show_bug.cgi?id=187721
     5
     6        Reviewed by Dean Jackson.
     7
     8        When interpolating between two Length values, if one is "auto", we should use the from-value
     9        from 0 and up to (but excluding) 0.5, and use the to-value from 0.5 to 1.
     10
     11        This change caused a regression in the legacy animation engine since it would create a CSS
     12        transition even when the underlying and target values were non-interpolable. As such, the
     13        underlying value would be used until the transition's mid-point and the tests at
     14        legacy-animation-engine/imported/blink/transitions/transition-not-interpolable.html and
     15        legacy-animation-engine/fast/animation/height-auto-transition-computed-value.html would fail
     16        expecting the target value to be used immediately. We now ensure that no transition is actually
     17        started if two values for a given property cannot be interpolated.
     18
     19        * page/animation/CompositeAnimation.cpp:
     20        (WebCore::CompositeAnimation::updateTransitions):
     21        * platform/Length.cpp:
     22        (WebCore::blend):
     23
    1242018-07-17  Wenson Hsieh  <wenson_hsieh@apple.com>
    225
  • trunk/Source/WebCore/page/animation/CompositeAnimation.cpp

    r233267 r233892  
    160160                } else {
    161161                    // We need to start a transition if it is active and the properties don't match
    162                     equal = !isActiveTransition || CSSPropertyAnimation::propertiesEqual(prop, fromStyle, &targetStyle);
     162                    equal = !isActiveTransition || CSSPropertyAnimation::propertiesEqual(prop, fromStyle, &targetStyle) || !CSSPropertyAnimation::canPropertyBeInterpolated(prop, fromStyle, &targetStyle);
    163163                }
    164164
  • trunk/Source/WebCore/platform/Length.cpp

    r229309 r233892  
    314314Length blend(const Length& from, const Length& to, double progress)
    315315{
    316     if (from.isAuto() || from.isUndefined() || to.isAuto() || to.isUndefined())
     316    if (from.isAuto() || to.isAuto())
     317        return progress < 0.5 ? from : to;
     318
     319    if (from.isUndefined() || to.isUndefined())
    317320        return to;
    318321
Note: See TracChangeset for help on using the changeset viewer.