Reviewed by Dan Bernstein
https://bugs.webkit.org/show_bug.cgi?id=22941
If the document element has opacity, we need to erase the view background to
white before painting.
Test: fast/backgrounds/opacity-on-document-element.html
* rendering/RenderView.cpp:
(WebCore::rendererObscuresBackground):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39463
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
Reviewed by Dan Bernstein
+ https://bugs.webkit.org/show_bug.cgi?id=22941
+
+ Add test for opacity on the document element.
+
+ * fast/backgrounds/opacity-on-document-element.html: Added.
+ * platform/mac/fast/backgrounds/opacity-on-document-element-expected.checksum: Added.
+ * platform/mac/fast/backgrounds/opacity-on-document-element-expected.png: Added.
+ * platform/mac/fast/backgrounds/opacity-on-document-element-expected.txt: Added.
+
+ * fast/transforms/identity-matrix.html:
+ * platform/mac/fast/transforms/identity-matrix-expected.txt:
+ Fix typo
+
+2008-12-23 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein
+
https://bugs.webkit.org/show_bug.cgi?id=21910
Re-create expected images after fixing painting issue with SVGImage.
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Opacity on Document</title>
+ <style type="text/css" media="screen">
+ html {
+ background-color: blue;
+ }
+ body {
+ margin: 50px;
+ background-color: gray;
+ }
+ </style>
+</head>
+<body>
+<p>The document background should be red, and the body gray. The rest of the viewport should be white. The document and body should have opacity of 0.3.</p>
+<script type="text/javascript" charset="utf-8">
+ // Do this dynamically to avoid pixels from the previous test in potentially unpainted areas
+ document.documentElement.style.backgroundColor = 'green';
+ document.documentElement.style.opacity = 0.3;
+</script>
+</body>
+</html>
</style>
</head>
<body>
-The following divs should be idential:
+The following divs should be identical:
<br>
<div></div>
--- /dev/null
+ee6700349c38450ed8ec4116e6126d07
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x136
+ RenderBlock {HTML} at (0,0) size 800x136 [bgcolor=#008000]
+ RenderBody {BODY} at (50,50) size 700x36 [bgcolor=#808080]
+ RenderBlock {P} at (0,0) size 700x36
+ RenderText {#text} at (0,0) size 677x36
+ text run at (0,0) width 677: "The document background should be red, and the body gray. The rest of the viewport should be white. The"
+ text run at (0,18) width 300: "document and body should have opacity of 0.3."
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 243x18
- text run at (0,0) width 243: "The following divs should be idential: "
+ RenderText {#text} at (0,0) size 250x18
+ text run at (0,0) width 250: "The following divs should be identical: "
RenderBR {BR} at (0,0) size 0x0
RenderBlock (floating) {DIV} at (5,23) size 110x110 [bgcolor=#87CEEB] [border: (5px solid #000000)]
RenderText {#text} at (0,0) size 0x0
Reviewed by Dan Bernstein
+ https://bugs.webkit.org/show_bug.cgi?id=22941
+
+ If the document element has opacity, we need to erase the view background to
+ white before painting.
+
+ Test: fast/backgrounds/opacity-on-document-element.html
+
+ * rendering/RenderView.cpp:
+ (WebCore::rendererObscuresBackground):
+
+2008-12-23 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein
+
https://bugs.webkit.org/show_bug.cgi?id=21910
Fix SVGImage painting by ensuring that the SVGImage resizes its FrameView correctly.
static inline bool rendererObscuresBackground(RenderObject* object)
{
- // FIXME: this should test opacity too.
- return object && object->style()->visibility() == VISIBLE && !object->style()->hasTransform();
+ return object && object->style()->visibility() == VISIBLE && object->style()->opacity() == 1 && !object->style()->hasTransform();
}
void RenderView::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)