Title: [207056] releases/WebKitGTK/webkit-2.14
Revision
207056
Author
[email protected]
Date
2016-10-10 23:54:29 -0700 (Mon, 10 Oct 2016)

Log Message

Merge r205659 - Don't run transitions to or from undefined Lengths
https://bugs.webkit.org/show_bug.cgi?id=161750
rdar://problem/28170460

Reviewed by Zalan Bujtas.

Source/WebCore:

For properties like max-height whose default value is 'none', we would erroneously
attempt to run transitions/animations, and then assert when one of the endpoints
was undefined.

So don't attempt to blend such Length values, just as do when they are auto.

Fixes some transitions on apple.com and developer.apple.com.

Test: transitions/transition-to-from-undefined.html

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimation::blendProperties):
* platform/Length.cpp:
(WebCore::blend):

LayoutTests:

* transitions/transition-to-from-undefined-expected.txt: Added.
* transitions/transition-to-from-undefined.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog (207055 => 207056)


--- releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog	2016-10-11 06:53:03 UTC (rev 207055)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog	2016-10-11 06:54:29 UTC (rev 207056)
@@ -1,3 +1,14 @@
+2016-09-08  Simon Fraser  <[email protected]>
+
+        Don't run transitions to or from undefined Lengths
+        https://bugs.webkit.org/show_bug.cgi?id=161750
+        rdar://problem/28170460
+
+        Reviewed by Zalan Bujtas.
+
+        * transitions/transition-to-from-undefined-expected.txt: Added.
+        * transitions/transition-to-from-undefined.html: Added.
+
 2016-09-07  Andy VanWagoner  <[email protected]>
 
         [INTL] some valid language tags cause errors in Intl constructors

Added: releases/WebKitGTK/webkit-2.14/LayoutTests/transitions/transition-to-from-undefined-expected.txt (0 => 207056)


--- releases/WebKitGTK/webkit-2.14/LayoutTests/transitions/transition-to-from-undefined-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/transitions/transition-to-from-undefined-expected.txt	2016-10-11 06:54:29 UTC (rev 207056)
@@ -0,0 +1,4 @@
+PASS - "max-height" property for "test1" element at 1s saw something close to: none
+PASS - "max-height" property for "test2" element at 1s saw something close to: 100
+PASS - "max-height" property for "test3" element at 1s saw something close to: 50
+

Added: releases/WebKitGTK/webkit-2.14/LayoutTests/transitions/transition-to-from-undefined.html (0 => 207056)


--- releases/WebKitGTK/webkit-2.14/LayoutTests/transitions/transition-to-from-undefined.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/transitions/transition-to-from-undefined.html	2016-10-11 06:54:29 UTC (rev 207056)
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style>
+    .box {
+        position: relative;
+        height: 100px;
+        width: 100px;
+        margin: 10px;
+        background-color: gray;
+        transition: max-height 2s linear;
+    }
+    
+    #test1 {
+        max-height: 100px;
+    }
+    
+    body.final #test1 {
+        max-height: none;
+    }
+
+    #test2 {
+        max-height: none;
+    }
+    
+    body.final #test2 {
+        max-height: 100px
+    }
+
+    #test3 {
+        max-height: 0;
+    }
+    
+    body.final #test3 {
+        max-height: 100px
+    }
+  </style>
+  <script src=""
+  <script type="text/_javascript_">
+
+    const expectedValues = [
+      // [time, element-id, property, expected-value, tolerance]
+      [1, 'test1', 'max-height', 'none', 2],
+      [1, 'test2', 'max-height', '100', 2],
+      [1, 'test3', 'max-height', '50', 2],
+    ];
+  
+    function setupTest()
+    {
+        document.body.classList.add('final');
+    }
+    
+    runTransitionTest(expectedValues, setupTest, usePauseAPI);
+  </script>
+</head>
+<body>
+  <div id="test1" class="box"></div>
+  <div id="test2" class="box"></div>
+  <div id="test3" class="box"></div>
+
+  <div id="result"></div>
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (207055 => 207056)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog	2016-10-11 06:53:03 UTC (rev 207055)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog	2016-10-11 06:54:29 UTC (rev 207056)
@@ -1,3 +1,26 @@
+2016-09-08  Simon Fraser  <[email protected]>
+
+        Don't run transitions to or from undefined Lengths
+        https://bugs.webkit.org/show_bug.cgi?id=161750
+        rdar://problem/28170460
+
+        Reviewed by Zalan Bujtas.
+
+        For properties like max-height whose default value is 'none', we would erroneously
+        attempt to run transitions/animations, and then assert when one of the endpoints
+        was undefined.
+
+        So don't attempt to blend such Length values, just as do when they are auto.
+
+        Fixes some transitions on apple.com and developer.apple.com.
+
+        Test: transitions/transition-to-from-undefined.html
+
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimation::blendProperties):
+        * platform/Length.cpp:
+        (WebCore::blend):
+
 2016-09-07  Chris Dumez  <[email protected]>
 
         Fix handling of negative radius in HTMLAreaElement's coords when in circle state

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (207055 => 207056)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2016-10-11 06:53:03 UTC (rev 207055)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2016-10-11 06:54:29 UTC (rev 207056)
@@ -1547,10 +1547,10 @@
 
     AnimationPropertyWrapperBase* wrapper = CSSPropertyAnimationWrapperMap::singleton().wrapperForProperty(prop);
     if (wrapper) {
-        wrapper->blend(anim, dst, a, b, progress);
 #if !LOG_DISABLED
         wrapper->logBlend(a, b, dst, progress);
 #endif
+        wrapper->blend(anim, dst, a, b, progress);
         return !wrapper->animationIsAccelerated() || !anim->isAccelerated();
     }
     return false;

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/Length.cpp (207055 => 207056)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/Length.cpp	2016-10-11 06:53:03 UTC (rev 207055)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/Length.cpp	2016-10-11 06:54:29 UTC (rev 207056)
@@ -298,7 +298,7 @@
 
 Length blend(const Length& from, const Length& to, double progress)
 {
-    if (from.isAuto() || to.isAuto())
+    if (from.isAuto() || from.isUndefined() || to.isAuto() || to.isUndefined())
         return to;
 
     if (from.type() == Calculated || to.type() == Calculated)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to