Title: [172417] trunk
Revision
172417
Author
[email protected]
Date
2014-08-11 16:03:49 -0700 (Mon, 11 Aug 2014)

Log Message

Fixed backgrounds don't paint in blurred inset areas
https://bugs.webkit.org/show_bug.cgi?id=135712

Reviewed by Simon Fraser.

Source/WebCore:

Background geometry calculations for fixed background need to use the larger 
visible rect.

The first version of this patch caused a regression because it universally 
adjusted the value for top to account for the inset whether or not the 
viewportRect location was adjusted for the same. This version fixes that — those 
two changes go hand-in-hand.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):

LayoutTests:

* platform/mac-wk1/TestExpectations:
* platform/mac-wk1/fast: Added.
* platform/mac-wk1/fast/backgrounds: Added.
* platform/mac-wk1/fast/backgrounds/resources: Added.
* platform/mac-wk1/fast/backgrounds/resources/green.png: Added.
* platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment-expected.html: Added.
* platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment.html: Added.
* platform/mac-wk2/tiled-drawing/resources/green-blue.png: Added.
* platform/mac-wk2/tiled-drawing/resources/green.png: Added.
* platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-body-expected.html: Added.
* platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-body.html: Added.
* platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-expected.html: Added.
* platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (172416 => 172417)


--- trunk/LayoutTests/ChangeLog	2014-08-11 22:30:46 UTC (rev 172416)
+++ trunk/LayoutTests/ChangeLog	2014-08-11 23:03:49 UTC (rev 172417)
@@ -1,3 +1,24 @@
+2014-08-11  Beth Dakin  <[email protected]>
+
+        Fixed backgrounds don't paint in blurred inset areas
+        https://bugs.webkit.org/show_bug.cgi?id=135712
+
+        Reviewed by Simon Fraser.
+
+        * platform/mac-wk1/TestExpectations:
+        * platform/mac-wk1/fast: Added.
+        * platform/mac-wk1/fast/backgrounds: Added.
+        * platform/mac-wk1/fast/backgrounds/resources: Added.
+        * platform/mac-wk1/fast/backgrounds/resources/green.png: Added.
+        * platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment-expected.html: Added.
+        * platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment.html: Added.
+        * platform/mac-wk2/tiled-drawing/resources/green-blue.png: Added.
+        * platform/mac-wk2/tiled-drawing/resources/green.png: Added.
+        * platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-body-expected.html: Added.
+        * platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-body.html: Added.
+        * platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-expected.html: Added.
+        * platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment.html: Added.
+
 2014-08-11  Yusuke Suzuki  <[email protected]>
 
         CSS JIT: support :scope

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (172416 => 172417)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2014-08-11 22:30:46 UTC (rev 172416)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2014-08-11 23:03:49 UTC (rev 172417)
@@ -51,6 +51,7 @@
 [ MountainLion Mavericks ] platform/mac/fast/events/content-inset-hit-testing.html [ Skip ]
 [ MountainLion Mavericks ] platform/mac/fast/events/content-inset-hit-testing-in-frame.html [ Skip ]
 [ MountainLion Mavericks ] platform/mac/fast/scrolling/scroll-select-bottom-test.html [ Skip ]
+[ MountainLion Mavericks ] platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment.html [ Skip ]
 
 ### END OF (2) Failures without bug reports
 ########################################

Added: trunk/LayoutTests/platform/mac-wk1/fast/backgrounds/resources/green.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac-wk1/fast/backgrounds/resources/green.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment-expected.html (0 => 172417)


--- trunk/LayoutTests/platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment-expected.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment-expected.html	2014-08-11 23:03:49 UTC (rev 172417)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<style>
+
+body {
+    height:2000px;
+    margin:0;
+    overflow:hidden;
+}
+
+#fixed-background-box {
+    width:400px;
+    height:600px;
+    background-image:url(resources/green.png);
+    background-attachment:fixed;
+}
+
+</style>
+</head>
+
+<body>
+
+<div id="fixed-background-box"></div>
+
+</body>
+<html>
+<html>
+<head>
+<style>
+
+body {
+    height:2000px;
+    margin:0;
+    overflow:hidden;
+}
+
+#fixed-background-box {
+    width:400px;
+    height:600px;
+    background-image:url(resources/green.png);
+    background-attachment:fixed;
+}
+
+</style>
+</head>
+
+<body>
+
+<div id="fixed-background-box"></div>
+
+</body>
+</html>

Added: trunk/LayoutTests/platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment.html (0 => 172417)


--- trunk/LayoutTests/platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment.html	2014-08-11 23:03:49 UTC (rev 172417)
@@ -0,0 +1,36 @@
+<html>
+<head>
+<style>
+
+body {
+    height:2000px;
+    margin:0;
+    overflow:hidden;
+}
+
+#fixed-background-box {
+    width:400px;
+    height:600px;
+    background-image:url(resources/green.png);
+    background-attachment:fixed;
+}
+
+</style>
+
+<script>
+function runTest() {
+    if (window.internals)
+        window.internals.setTopContentInset(100);
+    window.scrollTo(0, 100);
+}
+
+window.addEventListener('load', runTest, false);
+</script>
+</head>
+
+<body>
+
+<div id="fixed-background-box"></div>
+
+</body>
+</html>

Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/resources/green-blue.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/resources/green-blue.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/resources/green.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/resources/green.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-body-expected.html (0 => 172417)


--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-body-expected.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-body-expected.html	2014-08-11 23:03:49 UTC (rev 172417)
@@ -0,0 +1,30 @@
+<html>
+<head>
+<style>
+
+body {
+    height:2000px;
+    margin:0;
+    overflow:hidden;
+}
+
+#background-container {
+    margin:0;
+    margin-top:50px;
+    overflow:hidden;
+    background-image:url(resources/green-blue.png);
+    background-attachment:fixed;
+    width:100%;
+    height:100%;
+    background-position: 0 50;
+}
+
+</style>
+</head>
+
+<body>
+
+<div id="background-container"></div>
+
+</body>
+</html>

Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-body.html (0 => 172417)


--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-body.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-body.html	2014-08-11 23:03:49 UTC (rev 172417)
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style>
+
+body {
+    height:2000px;
+    margin:0;
+    background-image:url(resources/green-blue.png);
+    background-attachment:fixed;
+    overflow:hidden;
+}
+
+</style>
+
+<script>
+function runTest() {
+    if (window.internals)
+        window.internals.setTopContentInset(50);
+}
+
+window.addEventListener('load', runTest, false);
+</script>
+</head>
+
+<body>
+</body>
+</html>

Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-expected.html (0 => 172417)


--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-expected.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-expected.html	2014-08-11 23:03:49 UTC (rev 172417)
@@ -0,0 +1,26 @@
+<html>
+<head>
+<style>
+
+body {
+    height:2000px;
+    margin:0;
+    overflow:hidden;
+}
+
+#fixed-background-box {
+    width:400px;
+    height:600px;
+    background-image:url(resources/green.png);
+    background-attachment:fixed;
+}
+
+</style>
+</head>
+
+<body>
+
+<div id="fixed-background-box"></div>
+
+</body>
+</html>

Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment.html (0 => 172417)


--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment.html	2014-08-11 23:03:49 UTC (rev 172417)
@@ -0,0 +1,36 @@
+<html>
+<head>
+<style>
+
+body {
+    height:2000px;
+    margin:0;
+    overflow:hidden;
+}
+
+#fixed-background-box {
+    width:400px;
+    height:600px;
+    background-image:url(resources/green.png);
+    background-attachment:fixed;
+}
+
+</style>
+
+<script>
+function runTest() {
+    if (window.internals)
+        window.internals.setTopContentInset(100);
+    window.scrollTo(0, 100);
+}
+
+window.addEventListener('load', runTest, false);
+</script>
+</head>
+
+<body>
+
+<div id="fixed-background-box"></div>
+
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (172416 => 172417)


--- trunk/Source/WebCore/ChangeLog	2014-08-11 22:30:46 UTC (rev 172416)
+++ trunk/Source/WebCore/ChangeLog	2014-08-11 23:03:49 UTC (rev 172417)
@@ -1,3 +1,20 @@
+2014-08-11  Beth Dakin  <[email protected]>
+
+        Fixed backgrounds don't paint in blurred inset areas
+        https://bugs.webkit.org/show_bug.cgi?id=135712
+
+        Reviewed by Simon Fraser.
+
+        Background geometry calculations for fixed background need to use the larger 
+        visible rect.
+
+        The first version of this patch caused a regression because it universally 
+        adjusted the value for top to account for the inset whether or not the 
+        viewportRect location was adjusted for the same. This version fixes that — those 
+        two changes go hand-in-hand.
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
+
 2014-08-11  Antti Koivisto  <[email protected]>
 
         Pass inherited style only when resolving tree style

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (172416 => 172417)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2014-08-11 22:30:46 UTC (rev 172416)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2014-08-11 23:03:49 UTC (rev 172417)
@@ -1127,11 +1127,13 @@
         if (frame().settings().fixedBackgroundsPaintRelativeToDocument())
             viewportRect = view().unscaledDocumentRect();
         else {
-            viewportRect = view().viewRect();
+            viewportRect.setSize(view().frameView().unscaledVisibleContentSizeIncludingObscuredArea());
             if (fixedBackgroundPaintsInLocalCoordinates())
                 viewportRect.setLocation(LayoutPoint());
-            else
-                viewportRect.setLocation(toLayoutPoint(view().frameView().scrollOffsetForFixedPosition()));
+            else {
+                viewportRect.setLocation(toLayoutPoint(view().frameView().documentScrollOffsetRelativeToViewOrigin()));
+                top += view().frameView().topContentInset(ScrollView::TopContentInsetType::WebCoreOrPlatformContentInset);
+            }
         }
         
         if (paintContainer)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to