Title: [140648] trunk
- Revision
- 140648
- Author
- [email protected]
- Date
- 2013-01-23 21:35:37 -0800 (Wed, 23 Jan 2013)
Log Message
Source/WebCore: Avoid creating background layers on pages with a fixed background, but no image
https://bugs.webkit.org/show_bug.cgi?id=107783
<rdar://problem/13074450>
Reviewed by Beth Dakin.
http://www.nme.com has background-attachment: fixed on the <body>, but
not background image. In that case there's no point making a layer
for the fixed root background.
Test: platform/mac/tiled-drawing/fixed-background/fixed-background-no-image.html
* rendering/style/RenderStyle.cpp:
(WebCore::allLayersAreFixed): Check to see if we have an image, as well
as fixed attachment.
LayoutTests: Avoid creating background layers on pages with a fixed background, but no image
https://bugs.webkit.org/show_bug.cgi?id=107783
Reviewed by Beth Dakin.
Testcase with body { background-attachment:fixed; } but no image.
* platform/mac/tiled-drawing/fixed-background/fixed-background-no-image-expected.txt: Added.
* platform/mac/tiled-drawing/fixed-background/fixed-background-no-image.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (140647 => 140648)
--- trunk/LayoutTests/ChangeLog 2013-01-24 05:30:31 UTC (rev 140647)
+++ trunk/LayoutTests/ChangeLog 2013-01-24 05:35:37 UTC (rev 140648)
@@ -1,3 +1,15 @@
+2013-01-23 Simon Fraser <[email protected]>
+
+ Avoid creating background layers on pages with a fixed background, but no image
+ https://bugs.webkit.org/show_bug.cgi?id=107783
+
+ Reviewed by Beth Dakin.
+
+ Testcase with body { background-attachment:fixed; } but no image.
+
+ * platform/mac/tiled-drawing/fixed-background/fixed-background-no-image-expected.txt: Added.
+ * platform/mac/tiled-drawing/fixed-background/fixed-background-no-image.html: Added.
+
2013-01-23 Yoshifumi Inoue <[email protected]>
Layout Test platform/chromium-win/fast/events/panScroll-panIcon.html is failing
Added: trunk/LayoutTests/platform/mac/tiled-drawing/fixed-background/fixed-background-no-image-expected.txt (0 => 140648)
--- trunk/LayoutTests/platform/mac/tiled-drawing/fixed-background/fixed-background-no-image-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac/tiled-drawing/fixed-background/fixed-background-no-image-expected.txt 2013-01-24 05:35:37 UTC (rev 140648)
@@ -0,0 +1,18 @@
+(GraphicsLayer
+ (bounds 785.00 1700.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 785.00 1700.00)
+ (drawsContent 1)
+ (backgroundColor #FFFFFF)
+ (tile cache coverage 0, 0 785 x 1700)
+ (tile size 512 x 512)
+ (top left tile 0, 0 tiles grid 2 x 4)
+ (children 1
+ (GraphicsLayer
+ )
+ )
+ )
+ )
+)
+
Added: trunk/LayoutTests/platform/mac/tiled-drawing/fixed-background/fixed-background-no-image.html (0 => 140648)
--- trunk/LayoutTests/platform/mac/tiled-drawing/fixed-background/fixed-background-no-image.html (rev 0)
+++ trunk/LayoutTests/platform/mac/tiled-drawing/fixed-background/fixed-background-no-image.html 2013-01-24 05:35:37 UTC (rev 140648)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ body {
+ margin: 100px;
+ height: 1500px;
+ background-attachment: fixed;
+ }
+
+ .test {
+ height: 400px;
+ width: 600px;
+ background-color: rgba(0, 0, 0, 0.5);
+ border: 20px solid orange;
+ }
+
+ #layers {
+ opacity: 0;
+ }
+ </style>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText(true);
+
+ function doTest()
+ {
+ window.scrollTo(0, 200);
+
+ if (window.internals)
+ document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_TILE_CACHES);
+ }
+
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+
+ <div class="test"></div>
+<pre id="layers"></pre>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (140647 => 140648)
--- trunk/Source/WebCore/ChangeLog 2013-01-24 05:30:31 UTC (rev 140647)
+++ trunk/Source/WebCore/ChangeLog 2013-01-24 05:35:37 UTC (rev 140648)
@@ -1,3 +1,21 @@
+2013-01-23 Simon Fraser <[email protected]>
+
+ Avoid creating background layers on pages with a fixed background, but no image
+ https://bugs.webkit.org/show_bug.cgi?id=107783
+ <rdar://problem/13074450>
+
+ Reviewed by Beth Dakin.
+
+ http://www.nme.com has background-attachment: fixed on the <body>, but
+ not background image. In that case there's no point making a layer
+ for the fixed root background.
+
+ Test: platform/mac/tiled-drawing/fixed-background/fixed-background-no-image.html
+
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::allLayersAreFixed): Check to see if we have an image, as well
+ as fixed attachment.
+
2013-01-23 Wei Jia <[email protected]>
Enable autoplay when <video>'s src is from media stream
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (140647 => 140648)
--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2013-01-24 05:30:31 UTC (rev 140647)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2013-01-24 05:35:37 UTC (rev 140648)
@@ -1032,7 +1032,7 @@
bool allFixed = true;
for (const FillLayer* currLayer = layer; currLayer; currLayer = currLayer->next())
- allFixed &= currLayer->attachment() == FixedBackgroundAttachment;
+ allFixed &= (currLayer->image() && currLayer->attachment() == FixedBackgroundAttachment);
return layer && allFixed;
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes