Title: [105172] trunk
Revision
105172
Author
timothy_hor...@apple.com
Date
2012-01-17 11:02:39 -0800 (Tue, 17 Jan 2012)

Log Message

-webkit-cross-fade doesn't respect background-size
https://bugs.webkit.org/show_bug.cgi?id=74902
<rdar://problem/10605289>

Reviewed by Simon Fraser.

CrossfadeGeneratedImage should report its intrinsic size, instead of
improperly conforming to the size of its container.

Test: css3/images/cross-fade-background-size.html

* platform/graphics/CrossfadeGeneratedImage.h:
(WebCore::CrossfadeGeneratedImage::setContainerSize):
(WebCore::CrossfadeGeneratedImage::usesContainerSize):
(WebCore::CrossfadeGeneratedImage::hasRelativeWidth):
(WebCore::CrossfadeGeneratedImage::hasRelativeHeight):
(WebCore::CrossfadeGeneratedImage::size):

Add a test (cross-fade-background-size.html) which ensures that the
background-size CSS property interacts reasonably with -webkit-cross-fade.

Modify cross-fade-overflow-position to hit both the tiled and non-tiled codepaths.

* css3/images/cross-fade-background-size.html: Added.
* css3/images/cross-fade-overflow-position.html:
* css3/images/resources/stripes-large.png: Added.
* css3/images/resources/stripes-small.png: Added.
* platform/mac/css3/images/cross-fade-background-size-expected.png: Added.
* platform/mac/css3/images/cross-fade-background-size-expected.txt: Added.
* platform/mac/css3/images/cross-fade-overflow-position-expected.png:
* platform/mac/css3/images/cross-fade-overflow-position-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (105171 => 105172)


--- trunk/LayoutTests/ChangeLog	2012-01-17 19:00:12 UTC (rev 105171)
+++ trunk/LayoutTests/ChangeLog	2012-01-17 19:02:39 UTC (rev 105172)
@@ -1,3 +1,25 @@
+2012-01-17  Tim Horton  <timothy_hor...@apple.com>
+
+        -webkit-cross-fade doesn't respect background-size
+        https://bugs.webkit.org/show_bug.cgi?id=74902
+        <rdar://problem/10605289>
+
+        Reviewed by Simon Fraser.
+        
+        Add a test (cross-fade-background-size.html) which ensures that the
+        background-size CSS property interacts reasonably with -webkit-cross-fade.
+
+        Modify cross-fade-overflow-position to hit both the tiled and non-tiled codepaths.
+
+        * css3/images/cross-fade-background-size.html: Added.
+        * css3/images/cross-fade-overflow-position.html:
+        * css3/images/resources/stripes-large.png: Added.
+        * css3/images/resources/stripes-small.png: Added.
+        * platform/mac/css3/images/cross-fade-background-size-expected.png: Added.
+        * platform/mac/css3/images/cross-fade-background-size-expected.txt: Added.
+        * platform/mac/css3/images/cross-fade-overflow-position-expected.png:
+        * platform/mac/css3/images/cross-fade-overflow-position-expected.txt:
+
 2012-01-17  Adam Barth  <aba...@webkit.org>
 
         Import some NodeIterator tests from mozilla

Added: trunk/LayoutTests/css3/images/cross-fade-background-size.html (0 => 105172)


--- trunk/LayoutTests/css3/images/cross-fade-background-size.html	                        (rev 0)
+++ trunk/LayoutTests/css3/images/cross-fade-background-size.html	2012-01-17 19:02:39 UTC (rev 105172)
@@ -0,0 +1,51 @@
+<html>
+<head>
+<title>There should be four bars, equivalent except for the length of the bar.</title>
+<style>
+
+div
+{
+    width: 200px;
+    height: 50px;
+}
+
+#compositeTiledNormal
+{
+    background-image: url(resources/stripes-large.png);
+    -webkit-transform: translateZ(0);
+    background-size: 10px 50px;
+}
+
+#compositeTiledCrossfade
+{
+    background-image: -webkit-cross-fade(url(resources/stripes-large.png), url(resources/stripes-small.png), 1%);
+    -webkit-transform: translateZ(0);
+    background-size: 10px 50px;
+}
+
+
+#normal
+{
+    background-image: url(resources/stripes-large.png);
+    background-size: 10px 50px;
+    background-repeat: no-repeat;
+}
+
+#crossfade
+{
+    background-image: -webkit-cross-fade(url(resources/stripes-large.png), url(resources/stripes-small.png), 1%);
+    background-size: 10px 50px;
+    background-repeat: no-repeat;
+}
+
+
+</style>
+</head>
+<body>
+<div id="compositeTiledNormal"></div><br/>
+<div id="compositeTiledCrossfade"></div>
+<br/><br/>
+<div id="normal"></div><br/>
+<div id="crossfade"></div>
+</body>
+</html>
\ No newline at end of file

Modified: trunk/LayoutTests/css3/images/cross-fade-overflow-position.html (105171 => 105172)


--- trunk/LayoutTests/css3/images/cross-fade-overflow-position.html	2012-01-17 19:00:12 UTC (rev 105171)
+++ trunk/LayoutTests/css3/images/cross-fade-overflow-position.html	2012-01-17 19:02:39 UTC (rev 105172)
@@ -1,5 +1,6 @@
 <html>
 <head>
+    <title>The crossfade should appear as two *bottom* halves of a green circle, with a paler green background.</title>
     <style>
     #image {
         background-image: -webkit-cross-fade(url(resources/half-circles.svg), url(resources/green-100.png), 50%);
@@ -7,23 +8,34 @@
         background-repeat: no-repeat;
     }
 
-    #container {
+    #tiledImage {
+        background-image: -webkit-cross-fade(url(resources/half-circles.svg), url(resources/green-100.png), 50%);
+        width: 300px; height: 300px;
+    }
+
+    div.container {
         overflow: hidden;
         height: 50px;
+        width: 100px;
+        margin: 10px;
     }
     </style>
     <script>
     function load()
     {
-        var container = document.getElementById("container");
-        container.scrollTop = container.scrollHeight;
+        var normalContainer = document.getElementById("normal");
+        normalContainer.scrollTop = normalContainer.scrollHeight;
+        var tiledContainer = document.getElementById("tiled");
+        tiledContainer.scrollTop = tiledContainer.scrollHeight;
     }
     </script>
 </head>
 <body _onload_="load()">
-    <div id="container">
-        <!-- The crossfade should appear as the *bottom* half of a green circle, with a paler green background -->
+    <div id="normal" class="container">
         <div id="image"></div>
     </div>
+    <div id="tiled" class="container">
+        <div id="tiledImage"></div>
+    </div>
 </body>
 </html>

Added: trunk/LayoutTests/css3/images/resources/stripes-large.png


(Binary files differ)
Property changes on: trunk/LayoutTests/css3/images/resources/stripes-large.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/css3/images/resources/stripes-small.png


(Binary files differ)
Property changes on: trunk/LayoutTests/css3/images/resources/stripes-small.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/css3/images/cross-fade-background-size-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/css3/images/cross-fade-background-size-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/css3/images/cross-fade-background-size-expected.txt (0 => 105172)


--- trunk/LayoutTests/platform/mac/css3/images/cross-fade-background-size-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/css3/images/cross-fade-background-size-expected.txt	2012-01-17 19:02:39 UTC (rev 105172)
@@ -0,0 +1,18 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock (anonymous) at (0,50) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+      RenderBlock (anonymous) at (0,118) size 784x36
+        RenderBR {BR} at (0,0) size 0x18
+        RenderBR {BR} at (0,18) size 0x18
+      RenderBlock {DIV} at (0,154) size 200x50
+      RenderBlock (anonymous) at (0,204) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,222) size 200x50
+layer at (8,8) size 200x50
+  RenderBlock {DIV} at (0,0) size 200x50
+layer at (8,76) size 200x50
+  RenderBlock {DIV} at (0,68) size 200x50

Modified: trunk/LayoutTests/platform/mac/css3/images/cross-fade-overflow-position-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/css3/images/cross-fade-overflow-position-expected.txt (105171 => 105172)


--- trunk/LayoutTests/platform/mac/css3/images/cross-fade-overflow-position-expected.txt	2012-01-17 19:00:12 UTC (rev 105171)
+++ trunk/LayoutTests/platform/mac/css3/images/cross-fade-overflow-position-expected.txt	2012-01-17 19:02:39 UTC (rev 105172)
@@ -2,7 +2,10 @@
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-layer at (8,8) size 784x50 scrollY 50 scrollHeight 100
-  RenderBlock {DIV} at (0,0) size 784x50
+    RenderBody {BODY} at (8,10) size 784x580
+layer at (18,10) size 100x50 scrollY 50 scrollHeight 100
+  RenderBlock {DIV} at (10,0) size 100x50
     RenderBlock {DIV} at (0,0) size 100x100
+layer at (18,70) size 100x50 scrollY 250 scrollWidth 300 scrollHeight 300
+  RenderBlock {DIV} at (10,60) size 100x50
+    RenderBlock {DIV} at (0,0) size 300x300

Modified: trunk/Source/WebCore/ChangeLog (105171 => 105172)


--- trunk/Source/WebCore/ChangeLog	2012-01-17 19:00:12 UTC (rev 105171)
+++ trunk/Source/WebCore/ChangeLog	2012-01-17 19:02:39 UTC (rev 105172)
@@ -1,3 +1,23 @@
+2012-01-17  Tim Horton  <timothy_hor...@apple.com>
+
+        -webkit-cross-fade doesn't respect background-size
+        https://bugs.webkit.org/show_bug.cgi?id=74902
+        <rdar://problem/10605289>
+
+        Reviewed by Simon Fraser.
+
+        CrossfadeGeneratedImage should report its intrinsic size, instead of
+        improperly conforming to the size of its container.
+
+        Test: css3/images/cross-fade-background-size.html
+
+        * platform/graphics/CrossfadeGeneratedImage.h:
+        (WebCore::CrossfadeGeneratedImage::setContainerSize):
+        (WebCore::CrossfadeGeneratedImage::usesContainerSize):
+        (WebCore::CrossfadeGeneratedImage::hasRelativeWidth):
+        (WebCore::CrossfadeGeneratedImage::hasRelativeHeight):
+        (WebCore::CrossfadeGeneratedImage::size):
+
 2012-01-17  Vsevolod Vlasov  <vse...@chromium.org>
 
         Web Inspector: Refactor _javascript_OutlineDialog: extract FilteredItemSelectionDialog and reuse DialogDelegate.

Modified: trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h (105171 => 105172)


--- trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h	2012-01-17 19:00:12 UTC (rev 105171)
+++ trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h	2012-01-17 19:02:39 UTC (rev 105172)
@@ -43,6 +43,13 @@
         return adoptRef(new CrossfadeGeneratedImage(fromImage, toImage, percentage, crossfadeSize, size));
     }
 
+    virtual void setContainerSize(const IntSize&) { }
+    virtual bool usesContainerSize() const { return false; }
+    virtual bool hasRelativeWidth() const { return false; }
+    virtual bool hasRelativeHeight() const { return false; }
+
+    virtual IntSize size() const { return m_crossfadeSize; }
+
 protected:
     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator);
     virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to