Fixed backgrounds don't paint in blurred inset areas
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Aug 2014 22:25:11 +0000 (22:25 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Aug 2014 22:25:11 +0000 (22:25 +0000)
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.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):

LayoutTests:

Unfortunately for this test to be valid in WK2, it needs to be run from the
platform/mac-wk2/tiled-drawing directory so that tiled drawing is enabled. So
there are two copies of the test so that we can get coverage for WK1 and WK2.
* 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.png: 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.
* platform/mac/fast/backgrounds/resources: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172291 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/mac-wk1/fast/backgrounds/resources/green.png [new file with mode: 0644]
LayoutTests/platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment-expected.html [new file with mode: 0644]
LayoutTests/platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/resources/green.png [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-expected.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBoxModelObject.cpp

index 8c7f8a1..2d1055a 100644 (file)
@@ -1,3 +1,25 @@
+2014-08-07  Beth Dakin  <bdakin@apple.com>
+
+        Fixed backgrounds don't paint in blurred inset areas
+        https://bugs.webkit.org/show_bug.cgi?id=135712
+
+        Reviewed by Simon Fraser.
+
+        Unfortunately for this test to be valid in WK2, it needs to be run from the 
+        platform/mac-wk2/tiled-drawing directory so that tiled drawing is enabled. So 
+        there are two copies of the test so that we can get coverage for WK1 and WK2.
+        * 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.png: 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.
+        * platform/mac/fast/backgrounds/resources: Added.
+
 2014-08-07  Mark Lam  <mark.lam@apple.com>
 
         http/tests/security/cross-frame-access-enumeration.html fails after FTLOPT merge.
index c060617..25e6f62 100644 (file)
@@ -51,6 +51,7 @@ plugins/snapshotting
 [ 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
 ########################################
diff --git a/LayoutTests/platform/mac-wk1/fast/backgrounds/resources/green.png b/LayoutTests/platform/mac-wk1/fast/backgrounds/resources/green.png
new file mode 100644 (file)
index 0000000..6290f68
Binary files /dev/null and b/LayoutTests/platform/mac-wk1/fast/backgrounds/resources/green.png differ
diff --git a/LayoutTests/platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment-expected.html b/LayoutTests/platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment-expected.html
new file mode 100644 (file)
index 0000000..4cce795
--- /dev/null
@@ -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>
diff --git a/LayoutTests/platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment.html b/LayoutTests/platform/mac-wk1/fast/backgrounds/top-content-inset-fixed-attachment.html
new file mode 100644 (file)
index 0000000..75b4dc7
--- /dev/null
@@ -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>
diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/resources/green.png b/LayoutTests/platform/mac-wk2/tiled-drawing/resources/green.png
new file mode 100644 (file)
index 0000000..6290f68
Binary files /dev/null and b/LayoutTests/platform/mac-wk2/tiled-drawing/resources/green.png differ
diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-expected.html b/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-expected.html
new file mode 100644 (file)
index 0000000..4cce795
--- /dev/null
@@ -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>
diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment.html b/LayoutTests/platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment.html
new file mode 100644 (file)
index 0000000..75b4dc7
--- /dev/null
@@ -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>
index 0498611..ced22e7 100644 (file)
@@ -1,3 +1,16 @@
+2014-08-07  Beth Dakin  <bdakin@apple.com>
+
+        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. 
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
+
 2014-08-07  Jer Noble  <jer.noble@apple.com>
 
         [EME][Mac] Error codes returned by AVSampleBufferDisplayLayer are negative; clip when passed to JavaScript as doubles.
index c2baf2a..beec141 100644 (file)
@@ -1127,11 +1127,12 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const RenderLayerMod
         if (frame().settings().fixedBackgroundsPaintRelativeToDocument())
             viewportRect = view().unscaledDocumentRect();
         else {
-            viewportRect = view().viewRect();
+            viewportRect.setSize(view().frameView().unscaledVisibleContentSizeIncludingObscuredArea());
+            top += view().frameView().topContentInset(ScrollView::TopContentInsetType::WebCoreOrPlatformContentInset);
             if (fixedBackgroundPaintsInLocalCoordinates())
                 viewportRect.setLocation(LayoutPoint());
             else
-                viewportRect.setLocation(toLayoutPoint(view().frameView().scrollOffsetForFixedPosition()));
+                viewportRect.setLocation(toLayoutPoint(view().frameView().documentScrollOffsetRelativeToViewOrigin()));
         }
         
         if (paintContainer)