Title: [193610] trunk
Revision
193610
Author
simon.fra...@apple.com
Date
2015-12-06 21:14:30 -0800 (Sun, 06 Dec 2015)

Log 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:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (193609 => 193610)


--- trunk/LayoutTests/ChangeLog	2015-12-07 04:55:15 UTC (rev 193609)
+++ trunk/LayoutTests/ChangeLog	2015-12-07 05:14:30 UTC (rev 193610)
@@ -1,3 +1,22 @@
+2015-12-06  Simon Fraser  <simon.fra...@apple.com>
+
+        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.
+        
+        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:
+
 2015-12-06  David Kilzer  <ddkil...@apple.com>
 
         REGRESSION(r193584): Causes heap use-after-free crashes in Web Inspector tests with AddressSanitizer (Requested by ddkilzer on #webkit).

Added: trunk/LayoutTests/animations/fill-forwards-auto-height-expected.html (0 => 193610)


--- trunk/LayoutTests/animations/fill-forwards-auto-height-expected.html	                        (rev 0)
+++ trunk/LayoutTests/animations/fill-forwards-auto-height-expected.html	2015-12-07 05:14:30 UTC (rev 193610)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+    .landing {
+        width: 300px;
+        overflow: hidden;
+        border: 1px solid black;
+    }
+    
+    .contents {
+        height: 300px;
+        background-color: gray;
+    }
+    </style>
+</head>
+<body>
+
+<div class="landing">
+    <div class="contents">
+        
+    </div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/animations/fill-forwards-auto-height.html (0 => 193610)


--- trunk/LayoutTests/animations/fill-forwards-auto-height.html	                        (rev 0)
+++ trunk/LayoutTests/animations/fill-forwards-auto-height.html	2015-12-07 05:14:30 UTC (rev 193610)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+    @keyframes reveal {
+        0%, 50% {
+            height: 0;
+        }
+
+        100% {
+            height: auto;
+        }
+    }
+
+    .landing {
+        width: 300px;
+        overflow: hidden;
+        border: 1px solid black;
+        animation: reveal 0.01s forwards;
+    }
+    
+    .contents {
+        height: 300px;
+        background-color: gray;
+    }
+    </style>
+</head>
+<body>
+<div id="animated" class="landing">
+    <div class="contents"></div>
+</div>
+<script>
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+
+    document.getElementById('animated').addEventListener('animationend', function() {
+        if (window.testRunner)
+            testRunner.notifyDone();
+    })
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/imported/blink/transitions/transition-not-interpolable-expected.txt (193609 => 193610)


--- trunk/LayoutTests/imported/blink/transitions/transition-not-interpolable-expected.txt	2015-12-07 04:55:15 UTC (rev 193609)
+++ trunk/LayoutTests/imported/blink/transitions/transition-not-interpolable-expected.txt	2015-12-07 05:14:30 UTC (rev 193610)
@@ -1 +1 @@
-PASS
+FAIL -- transtion should not apply from 0px to auto

Modified: trunk/Source/WebCore/ChangeLog (193609 => 193610)


--- trunk/Source/WebCore/ChangeLog	2015-12-07 04:55:15 UTC (rev 193609)
+++ trunk/Source/WebCore/ChangeLog	2015-12-07 05:14:30 UTC (rev 193610)
@@ -1,5 +1,32 @@
 2015-12-06  Simon Fraser  <simon.fra...@apple.com>
 
+        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.
+        
+        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):
+
+2015-12-06  Simon Fraser  <simon.fra...@apple.com>
+
         Give SVGTransformList some inline vector capacity
         https://bugs.webkit.org/show_bug.cgi?id=151644
 

Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (193609 => 193610)


--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2015-12-07 04:55:15 UTC (rev 193609)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2015-12-07 05:14:30 UTC (rev 193610)
@@ -81,7 +81,7 @@
 
 static inline Length blendFunc(const AnimationBase*, const Length& from, const Length& to, double progress)
 {
-    return to.blend(from, narrowPrecisionToFloat(progress));
+    return to.blend(from, progress);
 }
 
 static inline LengthSize blendFunc(const AnimationBase* anim, const LengthSize& from, const LengthSize& to, double progress)
@@ -256,6 +256,7 @@
 {
     return to.blend(from, narrowPrecisionToFloat(progress));
 }
+
 static inline Vector<SVGLength> blendFunc(const AnimationBase*, const Vector<SVGLength>& from, const Vector<SVGLength>& to, double progress)
 {
     size_t fromLength = from.size();
@@ -1469,7 +1470,6 @@
         wrapper->blend(anim, dst, a, b, progress);
         return !wrapper->animationIsAccelerated() || !anim->isAccelerated();
     }
-
     return false;
 }
 

Modified: trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp (193609 => 193610)


--- trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp	2015-12-07 04:55:15 UTC (rev 193609)
+++ trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp	2015-12-07 05:14:30 UTC (rev 193610)
@@ -100,9 +100,6 @@
         prevIndex = i;
     }
 
-    double scale = 1;
-    double offset = 0;
-
     if (prevIndex == -1)
         prevIndex = 0;
 
@@ -122,8 +119,8 @@
     fromStyle = prevKeyframe.style();
     toStyle = nextKeyframe.style();
     
-    offset = prevKeyframe.key();
-    scale = 1.0 / (nextKeyframe.key() - prevKeyframe.key());
+    double offset = prevKeyframe.key();
+    double scale = 1.0 / (nextKeyframe.key() - prevKeyframe.key());
 
     prog = progress(scale, offset, prevKeyframe.timingFunction(name()));
 }

Modified: trunk/Source/WebCore/platform/Length.h (193609 => 193610)


--- trunk/Source/WebCore/platform/Length.h	2015-12-07 04:55:15 UTC (rev 193609)
+++ trunk/Source/WebCore/platform/Length.h	2015-12-07 05:14:30 UTC (rev 193610)
@@ -422,7 +422,7 @@
         return blendMixedTypes(from, progress);
 
     if (from.isZero() && isZero())
-        return *this;
+        return progress ? *this : from; // Pick up 'auto' from 'from' if progress is zero.
 
     LengthType resultType = type();
     if (isZero())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to