Title: [170307] trunk
- Revision
- 170307
- Author
- [email protected]
- Date
- 2014-06-23 12:00:34 -0700 (Mon, 23 Jun 2014)
Log Message
CSS clip property should make layers non-opaque
https://bugs.webkit.org/show_bug.cgi?id=134147
Source/WebCore:
<rdar://problem/17324579>
Reviewed by Tim Horton.
https://www.fairphone.com has position:fixed elements with clip: rect(...)
but we were making those layers opaque, resulting in garbage pixels
in areas outside the clip rect.
Fix by checking for the clip property in RenderBox::backgroundIsKnownToBeOpaqueInRect().
Test: compositing/contents-opaque/opaque-with-clip.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
LayoutTests:
Reviewed by Tim Horton.
* compositing/contents-opaque/opaque-with-clip-expected.html: Added.
* compositing/contents-opaque/opaque-with-clip.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (170306 => 170307)
--- trunk/LayoutTests/ChangeLog 2014-06-23 19:00:32 UTC (rev 170306)
+++ trunk/LayoutTests/ChangeLog 2014-06-23 19:00:34 UTC (rev 170307)
@@ -1,5 +1,15 @@
2014-06-23 Simon Fraser <[email protected]>
+ CSS clip property should make layers non-opaque
+ https://bugs.webkit.org/show_bug.cgi?id=134147
+
+ Reviewed by Tim Horton.
+
+ * compositing/contents-opaque/opaque-with-clip-expected.html: Added.
+ * compositing/contents-opaque/opaque-with-clip.html: Added.
+
+2014-06-23 Simon Fraser <[email protected]>
+
Adding a mask on a simple color compositing layer removes the content
https://bugs.webkit.org/show_bug.cgi?id=134127
Added: trunk/LayoutTests/compositing/contents-opaque/opaque-with-clip-expected.html (0 => 170307)
--- trunk/LayoutTests/compositing/contents-opaque/opaque-with-clip-expected.html (rev 0)
+++ trunk/LayoutTests/compositing/contents-opaque/opaque-with-clip-expected.html 2014-06-23 19:00:34 UTC (rev 170307)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ .box {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 300px;
+ height: 300px;
+ background-color: blue;
+ clip: rect(100px, 300px, 200px, 100px);
+ }
+
+ .indicator {
+ position: fixed;
+ top: 50px;
+ left: 50px;
+ width: 50px;
+ height: 50px;
+ top: ;
+ background-color: green;
+ }
+ </style>
+</head>
+<body>
+<div class="indicator"></div>
+<div class="box">
+
+</div>
+</body>
+</html>
Added: trunk/LayoutTests/compositing/contents-opaque/opaque-with-clip.html (0 => 170307)
--- trunk/LayoutTests/compositing/contents-opaque/opaque-with-clip.html (rev 0)
+++ trunk/LayoutTests/compositing/contents-opaque/opaque-with-clip.html 2014-06-23 19:00:34 UTC (rev 170307)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ .box {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 300px;
+ height: 300px;
+ background-color: blue;
+ clip: rect(100px, 400px, 200px, 100px);
+ }
+
+ .indicator {
+ position: fixed;
+ top: 50px;
+ left: 50px;
+ width: 50px;
+ height: 50px;
+ top: ;
+ background-color: green;
+ }
+ </style>
+</head>
+<body>
+<div class="indicator"></div>
+<div class="box">
+
+</div>
+</body>
+</html>
Modified: trunk/LayoutTests/compositing/geometry/clip-inside-expected.txt (170306 => 170307)
--- trunk/LayoutTests/compositing/geometry/clip-inside-expected.txt 2014-06-23 19:00:32 UTC (rev 170306)
+++ trunk/LayoutTests/compositing/geometry/clip-inside-expected.txt 2014-06-23 19:00:34 UTC (rev 170307)
@@ -12,7 +12,6 @@
(position 25.00 35.00)
(anchor 0.50 0.44)
(bounds 90.00 80.00)
- (contentsOpaque 1)
(drawsContent 1)
(transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
)
Modified: trunk/Source/WebCore/ChangeLog (170306 => 170307)
--- trunk/Source/WebCore/ChangeLog 2014-06-23 19:00:32 UTC (rev 170306)
+++ trunk/Source/WebCore/ChangeLog 2014-06-23 19:00:34 UTC (rev 170307)
@@ -1,5 +1,24 @@
2014-06-23 Simon Fraser <[email protected]>
+ CSS clip property should make layers non-opaque
+ https://bugs.webkit.org/show_bug.cgi?id=134147
+ <rdar://problem/17324579>
+
+ Reviewed by Tim Horton.
+
+ https://www.fairphone.com has position:fixed elements with clip: rect(...)
+ but we were making those layers opaque, resulting in garbage pixels
+ in areas outside the clip rect.
+
+ Fix by checking for the clip property in RenderBox::backgroundIsKnownToBeOpaqueInRect().
+
+ Test: compositing/contents-opaque/opaque-with-clip.html
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
+
+2014-06-23 Simon Fraser <[email protected]>
+
Adding a mask on a simple color compositing layer removes the content
https://bugs.webkit.org/show_bug.cgi?id=134127
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (170306 => 170307)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2014-06-23 19:00:32 UTC (rev 170306)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2014-06-23 19:00:34 UTC (rev 170307)
@@ -1350,7 +1350,7 @@
return false;
// FIXME: Check the opaqueness of background images.
- if (hasClipPath())
+ if (hasClip() || hasClipPath())
return false;
// FIXME: Use rounded rect if border radius is present.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes