Title: [191589] trunk
Revision
191589
Author
[email protected]
Date
2015-10-26 11:26:48 -0700 (Mon, 26 Oct 2015)

Log Message

Incorrect repeated background-size behavior in keyframes
https://bugs.webkit.org/show_bug.cgi?id=150309

Reviewed by Zalan Bujtas.

Source/WebCore:

After computing the style for a keyframe, we failed to propagate unset
fill-layer properties to all layers, which caused incorrect behavior when
there were multiple background images, but only one value on a background
property in the keyframes.

Fix by calling adjustRenderStyle() on keyframe styles, which invokes
style.adjustBackgroundLayers() which fixes the bug.

Test: animations/multiple-backgrounds.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForKeyframe):

LayoutTests:

* animations/multiple-backgrounds-expected.html: Added.
* animations/multiple-backgrounds.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (191588 => 191589)


--- trunk/LayoutTests/ChangeLog	2015-10-26 18:24:55 UTC (rev 191588)
+++ trunk/LayoutTests/ChangeLog	2015-10-26 18:26:48 UTC (rev 191589)
@@ -1,3 +1,13 @@
+2015-10-26  Simon Fraser  <[email protected]>
+
+        Incorrect repeated background-size behavior in keyframes
+        https://bugs.webkit.org/show_bug.cgi?id=150309
+
+        Reviewed by Zalan Bujtas.
+        
+        * animations/multiple-backgrounds-expected.html: Added.
+        * animations/multiple-backgrounds.html: Added.
+
 2015-10-26  Xabier Rodriguez Calvar  <[email protected]>
 
         [Streams API] Implement abort method on writable streams

Added: trunk/LayoutTests/animations/multiple-backgrounds-expected.html (0 => 191589)


--- trunk/LayoutTests/animations/multiple-backgrounds-expected.html	                        (rev 0)
+++ trunk/LayoutTests/animations/multiple-backgrounds-expected.html	2015-10-26 18:26:48 UTC (rev 191589)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+
+    @keyframes play {
+        from {
+        	background-size: 5% 100%, 5% 100%;
+        }
+        to {
+        	background-size: 50% 100%, 50% 100%;
+        }
+    }
+
+    button {
+    	width: 200px;
+    	height: 200px;
+    	box-sizing: border-box;
+    	border: 1px solid black;
+    	background-image: linear-gradient(blue, blue), linear-gradient(blue, blue);
+    	background-position: top left, top right;
+    	background-size: 45% 100%;
+    	background-repeat: no-repeat;
+        animation: play 1000000s -10000s linear;
+    }        
+    </style>
+</head>
+<body>
+    <p>Should see symmetrical strips of color down both sides.</p>
+    <button></button>
+</body>
+</html>
+

Added: trunk/LayoutTests/animations/multiple-backgrounds.html (0 => 191589)


--- trunk/LayoutTests/animations/multiple-backgrounds.html	                        (rev 0)
+++ trunk/LayoutTests/animations/multiple-backgrounds.html	2015-10-26 18:26:48 UTC (rev 191589)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+
+    @keyframes play {
+        from {
+        	background-size: 5% 100%;
+        }
+        to {
+        	background-size: 50% 100%;
+        }
+    }
+
+    button {
+    	width: 200px;
+    	height: 200px;
+    	box-sizing: border-box;
+    	border: 1px solid black;
+    	background-image: linear-gradient(blue, blue), linear-gradient(blue, blue);
+    	background-position: top left, top right;
+    	background-size: 45% 100%;
+    	background-repeat: no-repeat;
+        animation: play 1000000s -10000s linear;
+    }        
+    </style>
+</head>
+<body>
+    <p>Should see symmetrical strips of color down both sides.</p>
+    <button></button>
+</body>
+</html>
+

Modified: trunk/Source/WebCore/ChangeLog (191588 => 191589)


--- trunk/Source/WebCore/ChangeLog	2015-10-26 18:24:55 UTC (rev 191588)
+++ trunk/Source/WebCore/ChangeLog	2015-10-26 18:26:48 UTC (rev 191589)
@@ -1,3 +1,23 @@
+2015-10-26  Simon Fraser  <[email protected]>
+
+        Incorrect repeated background-size behavior in keyframes
+        https://bugs.webkit.org/show_bug.cgi?id=150309
+
+        Reviewed by Zalan Bujtas.
+        
+        After computing the style for a keyframe, we failed to propagate unset
+        fill-layer properties to all layers, which caused incorrect behavior when
+        there were multiple background images, but only one value on a background
+        property in the keyframes.
+        
+        Fix by calling adjustRenderStyle() on keyframe styles, which invokes
+        style.adjustBackgroundLayers() which fixes the bug.
+
+        Test: animations/multiple-backgrounds.html
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::styleForKeyframe):
+
 2015-10-26  Chris Dumez  <[email protected]>
 
         Indexing an object with an integer that is not a supported property index should not call the named property getter

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (191588 => 191589)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2015-10-26 18:24:55 UTC (rev 191588)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2015-10-26 18:26:48 UTC (rev 191589)
@@ -836,6 +836,8 @@
 
     cascade.applyDeferredProperties(*this, &result);
 
+    adjustRenderStyle(*state.style(), *state.parentStyle(), nullptr);
+
     // Start loading resources referenced by this style.
     loadPendingResources();
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to