2010-06-23 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dan Bernstein.
r61215 broke Acid3
https://bugs.webkit.org/show_bug.cgi?id=41034
The code added in r61215, which tests whether the root renderer will fill
the entire viewport, should not run for subframes. So bail from
RenderView::paintBoxDecorations() if document()->ownerElement() is not null.
The old code was trying to do this by checking 'elt', but that ends up as
null after the for loop above.
We can also bail early if the is no FrameView().
Test: fast/frames/paint-iframe-background.html
* rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 2c2d1dd..fdfe209 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-06-22 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ r61215 broke Acid3
+ https://bugs.webkit.org/show_bug.cgi?id=41034
+
+ Testcase with a transparent iframe.
+
+ * fast/frames/paint-iframe-background-expected.checksum: Added.
+ * fast/frames/paint-iframe-background-expected.png: Added.
+ * fast/frames/paint-iframe-background-expected.txt: Added.
+ * fast/frames/paint-iframe-background.html: Added.
+ * fast/frames/resources/paint-iframe-background-iframe.html: Added.
+
2010-06-23 Nikolas Zimmermann <nzimmermann@rim.com>
Not reviewed. Forgot to update result of fast/xpath/namespace-vs-predicate.html after the SVG renderer creation changes.
diff --git a/LayoutTests/fast/frames/paint-iframe-background-expected.checksum b/LayoutTests/fast/frames/paint-iframe-background-expected.checksum
new file mode 100644
index 0000000..92e2a79
--- /dev/null
+++ b/LayoutTests/fast/frames/paint-iframe-background-expected.checksum
@@ -0,0 +1 @@
+1191b1bdf93b02c89a5f2706b4eb40ed
\ No newline at end of file
diff --git a/LayoutTests/fast/frames/paint-iframe-background-expected.png b/LayoutTests/fast/frames/paint-iframe-background-expected.png
new file mode 100644
index 0000000..2bffa6c
--- /dev/null
+++ b/LayoutTests/fast/frames/paint-iframe-background-expected.png
Binary files differ
diff --git a/LayoutTests/fast/frames/paint-iframe-background-expected.txt b/LayoutTests/fast/frames/paint-iframe-background-expected.txt
new file mode 100644
index 0000000..5c59eaa
--- /dev/null
+++ b/LayoutTests/fast/frames/paint-iframe-background-expected.txt
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x8
+ RenderBlock {HTML} at (0,0) size 800x8
+ RenderBody {BODY} at (8,8) size 784x0
+layer at (20,50) size 200x100
+ RenderBlock (positioned) {DIV} at (20,50) size 200x100 [bgcolor=#008000]
+layer at (20,50) size 200x100
+ RenderPartObject {IFRAME} at (20,50) size 200x100
+ layer at (0,0) size 200x100
+ RenderView at (0,0) size 200x100
+ layer at (0,0) size 200x16
+ RenderBlock {HTML} at (0,0) size 200x16
+ RenderBody {BODY} at (8,16) size 184x0
+ RenderBlock {P} at (0,0) size 184x0
diff --git a/LayoutTests/fast/frames/paint-iframe-background.html b/LayoutTests/fast/frames/paint-iframe-background.html
new file mode 100644
index 0000000..75d8196
--- /dev/null
+++ b/LayoutTests/fast/frames/paint-iframe-background.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style type="text/css" media="screen">
+ .common {
+ position: absolute;
+ top: 50px;
+ left: 20px;
+ height: 100px;
+ width: 200px;
+ }
+ .indicator {
+ background-color: green;
+ }
+ iframe {
+ border: none;
+ }
+ </style>
+</head>
+<body>
+ <!-- You should see a green rectangle -->
+ <div class="indicator common"></div>
+ <iframe class="common" src="resources/paint-iframe-background-iframe.html"></iframe>
+</body>
+</html>
diff --git a/LayoutTests/fast/frames/resources/paint-iframe-background-iframe.html b/LayoutTests/fast/frames/resources/paint-iframe-background-iframe.html
new file mode 100644
index 0000000..15ed3a4
--- /dev/null
+++ b/LayoutTests/fast/frames/resources/paint-iframe-background-iframe.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style type="text/css" media="screen">
+ * {
+ background-transparent;
+ }
+ </style>
+</head>
+<body>
+
+ <p><!-- this file is transparent --></p>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8924bbb..e7bc59c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-06-23 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ r61215 broke Acid3
+ https://bugs.webkit.org/show_bug.cgi?id=41034
+
+ The code added in r61215, which tests whether the root renderer will fill
+ the entire viewport, should not run for subframes. So bail from
+ RenderView::paintBoxDecorations() if document()->ownerElement() is not null.
+ The old code was trying to do this by checking 'elt', but that ends up as
+ null after the for loop above.
+
+ We can also bail early if the is no FrameView().
+
+ Test: fast/frames/paint-iframe-background.html
+
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::paintBoxDecorations):
+
2010-06-23 Pavel Feldman <pfeldman@chromium.org>
Reviewed by Yury Semikhatsky.
diff --git a/WebCore/rendering/RenderView.cpp b/WebCore/rendering/RenderView.cpp
index 5db02ac..b27d26e 100644
--- a/WebCore/rendering/RenderView.cpp
+++ b/WebCore/rendering/RenderView.cpp
@@ -201,6 +201,9 @@
#endif
}
+ if (document()->ownerElement() || !view())
+ return;
+
bool rootFillsViewport = false;
Node* documentElement = document()->documentElement();
if (RenderObject* rootRenderer = documentElement ? documentElement->renderer() : 0) {
@@ -210,7 +213,7 @@
}
// If painting will entirely fill the view, no need to fill the background.
- if (elt || (rootFillsViewport && rendererObscuresBackground(firstChild())) || !view())
+ if (rootFillsViewport && rendererObscuresBackground(firstChild()))
return;
// This code typically only executes if the root element's visibility has been set to hidden,