Title: [200622] trunk
Revision
200622
Author
[email protected]
Date
2016-05-10 08:27:02 -0700 (Tue, 10 May 2016)

Log Message

REGRESSION (r193610): Drop down menu doesn’t expand at allofbach.com
https://bugs.webkit.org/show_bug.cgi?id=157445

Reviewed by Simon Fraser.

When we don't run transitions (becasuse of to/from 'auto' values) we should also not
report the 'from' value and behave as if we finished the transition already.

Source/WebCore:

Test: fast/animation/height-auto-transition-computed-value.html

* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): This is a revert of
looping the 'to' value back to the first keyframe when reverse animation is at the start value (last keyframe).

* platform/Length.cpp:
(WebCore::blend):

LayoutTests:

* fast/animation/height-auto-transition-computed-value-expected.html: Added.
* fast/animation/height-auto-transition-computed-value.html: Added.
* imported/blink/transitions/transition-not-interpolable-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (200621 => 200622)


--- trunk/LayoutTests/ChangeLog	2016-05-10 14:56:00 UTC (rev 200621)
+++ trunk/LayoutTests/ChangeLog	2016-05-10 15:27:02 UTC (rev 200622)
@@ -1,3 +1,17 @@
+2016-05-10  Zalan Bujtas  <[email protected]>
+
+        REGRESSION (r193610): Drop down menu doesn’t expand at allofbach.com
+        https://bugs.webkit.org/show_bug.cgi?id=157445
+
+        Reviewed by Simon Fraser.
+
+        When we don't run transitions (becasuse of to/from 'auto' values) we should also not
+        report the 'from' value and behave as if we finished the transition already.
+
+        * fast/animation/height-auto-transition-computed-value-expected.html: Added.
+        * fast/animation/height-auto-transition-computed-value.html: Added.
+        * imported/blink/transitions/transition-not-interpolable-expected.txt:
+
 2016-05-09  Dean Jackson  <[email protected]>
 
         [iOS] <select> elements should render right-aligned when in RTL mode

Added: trunk/LayoutTests/fast/animation/height-auto-transition-computed-value-expected.html (0 => 200622)


--- trunk/LayoutTests/fast/animation/height-auto-transition-computed-value-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/animation/height-auto-transition-computed-value-expected.html	2016-05-10 15:27:02 UTC (rev 200622)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that auto transition returns the proper computed value.</title>
+<style>
+#dropdown {
+    overflow: hidden;
+    border: 1px solid red;
+    height: 18px;
+    transition: height 1s ease-out;
+}
+</style>
+</head>
+<body>
+<div id=dropdown></div>
+PASS if you can see foobar above.
+</body>
+</html>

Added: trunk/LayoutTests/fast/animation/height-auto-transition-computed-value.html (0 => 200622)


--- trunk/LayoutTests/fast/animation/height-auto-transition-computed-value.html	                        (rev 0)
+++ trunk/LayoutTests/fast/animation/height-auto-transition-computed-value.html	2016-05-10 15:27:02 UTC (rev 200622)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that auto transition returns the proper computed value.</title>
+<style>
+#dropdown {
+    font-size: 16px;
+    font-family: ahem;
+    color: white;
+    overflow: hidden;
+    border: 1px solid red;
+    height: 0px;
+    transition: height 1s ease-out;
+}
+</style>
+</head>
+<body>
+<div id=dropdown>foobar</div>
+PASS if you can see foobar above.
+
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+setTimeout(function() {
+    var element = document.getElementById("dropdown");
+    element.style.height = 'auto';
+    var h = element.offsetHeight;
+    element.style.height = h + 'px';
+    if (window.testRunner)
+        testRunner.notifyDone();
+}, 0);
+</script>
+</body>
+</html>

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


--- trunk/LayoutTests/imported/blink/transitions/transition-not-interpolable-expected.txt	2016-05-10 14:56:00 UTC (rev 200621)
+++ trunk/LayoutTests/imported/blink/transitions/transition-not-interpolable-expected.txt	2016-05-10 15:27:02 UTC (rev 200622)
@@ -1 +1 @@
-FAIL -- transtion should not apply from 0px to auto
+PASS

Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (200621 => 200622)


--- trunk/LayoutTests/platform/ios-simulator/TestExpectations	2016-05-10 14:56:00 UTC (rev 200621)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations	2016-05-10 15:27:02 UTC (rev 200622)
@@ -2949,6 +2949,7 @@
 fast/regions/layers/region-removed-during-animation.html [ ImageOnlyFailure ]
 fast/sub-pixel/table-with-subpixel-cell-size.html [ ImageOnlyFailure ]
 svg/text/tspan-multiple-outline.svg [ ImageOnlyFailure ]
+fast/animation/height-auto-transition-computed-value.html [ ImageOnlyFailure ]
 
 webkit.org/b/155174 svg/animations/animate-marker-orient-from-angle-to-autostartreverse.html [ Skip ]
 

Modified: trunk/Source/WebCore/ChangeLog (200621 => 200622)


--- trunk/Source/WebCore/ChangeLog	2016-05-10 14:56:00 UTC (rev 200621)
+++ trunk/Source/WebCore/ChangeLog	2016-05-10 15:27:02 UTC (rev 200622)
@@ -1,3 +1,22 @@
+2016-05-10  Zalan Bujtas  <[email protected]>
+
+        REGRESSION (r193610): Drop down menu doesn’t expand at allofbach.com
+        https://bugs.webkit.org/show_bug.cgi?id=157445
+
+        Reviewed by Simon Fraser.
+
+        When we don't run transitions (becasuse of to/from 'auto' values) we should also not
+        report the 'from' value and behave as if we finished the transition already.
+
+        Test: fast/animation/height-auto-transition-computed-value.html
+
+        * page/animation/KeyframeAnimation.cpp:
+        (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): This is a revert of
+        looping the 'to' value back to the first keyframe when reverse animation is at the start value (last keyframe).
+
+        * platform/Length.cpp:
+        (WebCore::blend):
+
 2016-05-09  Dean Jackson  <[email protected]>
 
         [iOS] <select> elements should render right-aligned when in RTL mode

Modified: trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp (200621 => 200622)


--- trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp	2016-05-10 14:56:00 UTC (rev 200621)
+++ trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp	2016-05-10 15:27:02 UTC (rev 200622)
@@ -67,23 +67,21 @@
 
 void KeyframeAnimation::fetchIntervalEndpointsForProperty(CSSPropertyID property, const RenderStyle*& fromStyle, const RenderStyle*& toStyle, double& prog) const
 {
+    size_t numKeyframes = m_keyframes.size();
+    if (!numKeyframes)
+        return;
+
     // Find the first key
     double elapsedTime = getElapsedTime();
     if (m_animation->duration() && m_animation->iterationCount() != Animation::IterationCountInfinite)
         elapsedTime = std::min(elapsedTime, m_animation->duration() * m_animation->iterationCount());
 
     const double fractionalTime = this->fractionalTime(1, elapsedTime, 0);
-
-    size_t numKeyframes = m_keyframes.size();
-    if (!numKeyframes)
-        return;
-    
     ASSERT(!m_keyframes[0].key());
     ASSERT(m_keyframes[m_keyframes.size() - 1].key() == 1);
-    
+
     int prevIndex = -1;
     int nextIndex = -1;
-    
     // FIXME: with a lot of keys, this linear search will be slow. We could binary search.
     for (size_t i = 0; i < numKeyframes; ++i) {
         const KeyframeValue& currKeyFrame = m_keyframes[i];
@@ -95,31 +93,22 @@
             nextIndex = i;
             break;
         }
-        
         prevIndex = i;
     }
 
     if (prevIndex == -1)
         prevIndex = 0;
+    if (nextIndex == -1)
+        nextIndex = m_keyframes.size() - 1;
 
-    if (nextIndex == -1) {
-        int lastIndex = m_keyframes.size() - 1;
-        if (prevIndex == lastIndex)
-            nextIndex = 0;
-        else
-            nextIndex = lastIndex;
-    }
-
-    ASSERT(prevIndex != nextIndex);
-
     const KeyframeValue& prevKeyframe = m_keyframes[prevIndex];
     const KeyframeValue& nextKeyframe = m_keyframes[nextIndex];
 
     fromStyle = prevKeyframe.style();
     toStyle = nextKeyframe.style();
-    
+
     double offset = prevKeyframe.key();
-    double scale = 1.0 / (nextKeyframe.key() - prevKeyframe.key());
+    double scale = 1.0 / (nextIndex == prevIndex ?  1 : (nextKeyframe.key() - prevKeyframe.key()));
 
     prog = progress(scale, offset, prevKeyframe.timingFunction(name()));
 }

Modified: trunk/Source/WebCore/platform/Length.cpp (200621 => 200622)


--- trunk/Source/WebCore/platform/Length.cpp	2016-05-10 14:56:00 UTC (rev 200621)
+++ trunk/Source/WebCore/platform/Length.cpp	2016-05-10 15:27:02 UTC (rev 200622)
@@ -299,7 +299,7 @@
 Length blend(const Length& from, const Length& to, double progress)
 {
     if (from.isAuto() || to.isAuto())
-        return progress ? to : from;
+        return to;
 
     if (from.type() == Calculated || to.type() == Calculated)
         return blendMixedTypes(from, to, progress);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to