Changeset 193610 in webkit


Ignore:
Timestamp:
Dec 6, 2015 9:14:30 PM (8 years ago)
Author:
Simon Fraser
Message:

REGRESSION (r187121): Can't get to the main content of the page at https://theintercept.com/drone-papers/
https://bugs.webkit.org/show_bug.cgi?id=151849
rdar://problem/23132828

Reviewed by Zalan Bujtas.

Source/WebCore:

This page uses a fill-forwards animation where the last keyframe has height: auto.
After r187121, we tried to blend the height Length value from the last keyframe to the
first keyframe with progress=0 (which should pick up the 'auto' from the last keyframe).

However, Length::blend() just considered both 0 and 'auto' to be zero, and returned
the 0 length.

So fix Length::blend() to return the "from" length if progress is zero.

Test: animations/fill-forwards-auto-height.html

  • page/animation/CSSPropertyAnimation.cpp:

(WebCore::blendFunc): Length::blend takes a double, so don't narrow to float.

  • page/animation/KeyframeAnimation.cpp:

(WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): Declare two variables
at first use.

  • platform/Length.h:

(WebCore::Length::blend):

LayoutTests:

New ref test.

The behavior of imported/blink/transitions/transition-not-interpolable.html changed
with this patch, but that test is trying to determine if transitions run to/from
'auto' values, and doing it wrong. The current patch doesn't change the user-visible
behavior of transitions with 'auto' endpoints (covered by http://webkit.org/b/38243).

  • animations/fill-forwards-auto-height-expected.html: Added.
  • animations/fill-forwards-auto-height.html: Added.
  • imported/blink/transitions/transition-not-interpolable-expected.txt:
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r193606 r193610  
     12015-12-06  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r187121): Can't get to the main content of the page at https://theintercept.com/drone-papers/
     4        https://bugs.webkit.org/show_bug.cgi?id=151849
     5        rdar://problem/23132828
     6
     7        Reviewed by Zalan Bujtas.
     8       
     9        New ref test.
     10       
     11        The behavior of imported/blink/transitions/transition-not-interpolable.html changed
     12        with this patch, but that test is trying to determine if transitions run to/from
     13        'auto' values, and doing it wrong. The current patch doesn't change the user-visible
     14        behavior of transitions with 'auto' endpoints (covered by http://webkit.org/b/38243).
     15
     16        * animations/fill-forwards-auto-height-expected.html: Added.
     17        * animations/fill-forwards-auto-height.html: Added.
     18        * imported/blink/transitions/transition-not-interpolable-expected.txt:
     19
    1202015-12-06  David Kilzer  <ddkilzer@apple.com>
    221
  • trunk/LayoutTests/imported/blink/transitions/transition-not-interpolable-expected.txt

    r190629 r193610  
    1 PASS
     1FAIL -- transtion should not apply from 0px to auto
  • trunk/Source/WebCore/ChangeLog

    r193609 r193610  
     12015-12-06  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r187121): Can't get to the main content of the page at https://theintercept.com/drone-papers/
     4        https://bugs.webkit.org/show_bug.cgi?id=151849
     5        rdar://problem/23132828
     6
     7        Reviewed by Zalan Bujtas.
     8       
     9        This page uses a fill-forwards animation where the last keyframe has height: auto.
     10        After r187121, we tried to blend the height Length value from the last keyframe to the
     11        first keyframe with progress=0 (which should pick up the 'auto' from the last keyframe).
     12       
     13        However, Length::blend() just considered both 0 and 'auto' to be zero, and returned
     14        the 0 length.
     15       
     16        So fix Length::blend() to return the "from" length if progress is zero.
     17
     18        Test: animations/fill-forwards-auto-height.html
     19
     20        * page/animation/CSSPropertyAnimation.cpp:
     21        (WebCore::blendFunc): Length::blend takes a double, so don't narrow to float.
     22        * page/animation/KeyframeAnimation.cpp:
     23        (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): Declare two variables
     24        at first use.
     25        * platform/Length.h:
     26        (WebCore::Length::blend):
     27
    1282015-12-06  Simon Fraser  <simon.fraser@apple.com>
    229
  • trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp

    r191017 r193610  
    8282static inline Length blendFunc(const AnimationBase*, const Length& from, const Length& to, double progress)
    8383{
    84     return to.blend(from, narrowPrecisionToFloat(progress));
     84    return to.blend(from, progress);
    8585}
    8686
     
    257257    return to.blend(from, narrowPrecisionToFloat(progress));
    258258}
     259
    259260static inline Vector<SVGLength> blendFunc(const AnimationBase*, const Vector<SVGLength>& from, const Vector<SVGLength>& to, double progress)
    260261{
     
    14701471        return !wrapper->animationIsAccelerated() || !anim->isAccelerated();
    14711472    }
    1472 
    14731473    return false;
    14741474}
  • trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp

    r189987 r193610  
    101101    }
    102102
    103     double scale = 1;
    104     double offset = 0;
    105 
    106103    if (prevIndex == -1)
    107104        prevIndex = 0;
     
    123120    toStyle = nextKeyframe.style();
    124121   
    125     offset = prevKeyframe.key();
    126     scale = 1.0 / (nextKeyframe.key() - prevKeyframe.key());
     122    double offset = prevKeyframe.key();
     123    double scale = 1.0 / (nextKeyframe.key() - prevKeyframe.key());
    127124
    128125    prog = progress(scale, offset, prevKeyframe.timingFunction(name()));
  • trunk/Source/WebCore/platform/Length.h

    r191310 r193610  
    423423
    424424    if (from.isZero() && isZero())
    425         return *this;
     425        return progress ? *this : from; // Pick up 'auto' from 'from' if progress is zero.
    426426
    427427    LengthType resultType = type();
Note: See TracChangeset for help on using the changeset viewer.