[CSS Blending] The composited layers isolated by the page group should blend with...
authorrosca@adobe.com <rosca@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Sep 2014 07:47:21 +0000 (07:47 +0000)
committerrosca@adobe.com <rosca@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Sep 2014 07:47:21 +0000 (07:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136563

Reviewed by Simon Fraser.

Source/WebCore:

If a blending layer is not isolated, then it should blend with a white backdrop:
http://dev.w3.org/fxtf/compositing-1/#pagebackdrop

Tests: css3/blending/blend-mode-body-composited-child-background-color.html
       css3/blending/blend-mode-body-composited-child.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
If the isolating composited layer is the root renderer, then it should have a backing store
into which the initial white backdrop will be painted.

LayoutTests:

* css3/blending/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer-expected.txt:
* css3/blending/blend-mode-body-composited-child-background-color-expected.html: Added.
* css3/blending/blend-mode-body-composited-child-background-color.html: Added.
* css3/blending/blend-mode-body-composited-child-expected.html: Added.
* css3/blending/blend-mode-body-composited-child.html: Added.
* css3/blending/blend-mode-parent-of-composited-blended-has-layer-expected.txt:
* css3/blending/blend-mode-with-composited-descendant-should-have-layer-expected.txt:

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

LayoutTests/ChangeLog
LayoutTests/css3/blending/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer-expected.txt
LayoutTests/css3/blending/blend-mode-body-composited-child-background-color-expected.html [new file with mode: 0644]
LayoutTests/css3/blending/blend-mode-body-composited-child-background-color.html [new file with mode: 0644]
LayoutTests/css3/blending/blend-mode-body-composited-child-expected.html [new file with mode: 0644]
LayoutTests/css3/blending/blend-mode-body-composited-child.html [new file with mode: 0644]
LayoutTests/css3/blending/blend-mode-parent-of-composited-blended-has-layer-expected.txt
LayoutTests/css3/blending/blend-mode-with-composited-descendant-should-have-layer-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerBacking.cpp

index c96648e..e2f4337 100644 (file)
@@ -1,3 +1,18 @@
+2014-09-23  Ion Rosca  <rosca@adobe.com>
+
+        [CSS Blending] The composited layers isolated by the page group should blend with the default white background color.
+        https://bugs.webkit.org/show_bug.cgi?id=136563
+
+        Reviewed by Simon Fraser.
+
+        * css3/blending/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer-expected.txt:
+        * css3/blending/blend-mode-body-composited-child-background-color-expected.html: Added.
+        * css3/blending/blend-mode-body-composited-child-background-color.html: Added.
+        * css3/blending/blend-mode-body-composited-child-expected.html: Added.
+        * css3/blending/blend-mode-body-composited-child.html: Added.
+        * css3/blending/blend-mode-parent-of-composited-blended-has-layer-expected.txt:
+        * css3/blending/blend-mode-with-composited-descendant-should-have-layer-expected.txt:
+
 2014-09-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         Unreviewed, EFL gardening. Unskip media test on EFL port. Almost media tests
diff --git a/LayoutTests/css3/blending/blend-mode-body-composited-child-background-color-expected.html b/LayoutTests/css3/blending/blend-mode-body-composited-child-background-color-expected.html
new file mode 100644 (file)
index 0000000..be33c75
--- /dev/null
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<head>
+    <link rel="stylesheet" href="resources/blending-style.css">
+</head>
+
+<body class="black white-text">
+    <p class="composited">This file tests that a blending composited element will blend with body's background color,
+        even if the background has no other content.<br/> The test passes only if you don't see a rectangle on the screen.</p>
+</body>
diff --git a/LayoutTests/css3/blending/blend-mode-body-composited-child-background-color.html b/LayoutTests/css3/blending/blend-mode-body-composited-child-background-color.html
new file mode 100644 (file)
index 0000000..c2798bf
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<head>
+    <link rel="stylesheet" href="resources/blending-style.css">
+</head>
+
+<body class="black white-text">
+    <!-- This p is composited to get its own backing, so that the body element is left without content. -->
+    <p class="composited">This file tests that a blending composited element will blend with body's background color,
+        even if the background has no other content.<br/> The test passes only if you don't see a rectangle on the screen.</p>
+
+    <div class="box red multiply composited"></div>
+</body>
diff --git a/LayoutTests/css3/blending/blend-mode-body-composited-child-expected.html b/LayoutTests/css3/blending/blend-mode-body-composited-child-expected.html
new file mode 100644 (file)
index 0000000..86d96f3
--- /dev/null
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<head>
+    <link rel="stylesheet" href="resources/blending-style.css">
+</head>
+
+<body>
+    <p class="composited">This file tests that a blending composited element will blend with default white background,
+        even if the background has no content.<br/> The test passes only if you don't see a rectangle on the screen.</p>
+</body>
diff --git a/LayoutTests/css3/blending/blend-mode-body-composited-child.html b/LayoutTests/css3/blending/blend-mode-body-composited-child.html
new file mode 100644 (file)
index 0000000..46d823d
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<head>
+    <link rel="stylesheet" href="resources/blending-style.css">
+</head>
+
+<body>
+    <!-- This p is composited to get its own backing, so that the body element is left without content. -->
+    <p class="composited">This file tests that a blending composited element will blend with default white background,
+        even if the background has no content.<br/> The test passes only if you don't see a rectangle on the screen.</p>
+
+    <div class="box red screen composited"></div>
+</body>
index f28daa9..ae37acb 100644 (file)
@@ -8,6 +8,7 @@
       (children 1
         (GraphicsLayer
           (bounds 800.00 600.00)
+          (drawsContent 1)
           (children 1
             (GraphicsLayer
               (position 18.00 10.00)
index 1a22140..0230b21 100644 (file)
@@ -8,6 +8,7 @@
       (children 1
         (GraphicsLayer
           (bounds 800.00 600.00)
+          (drawsContent 1)
           (children 1
             (GraphicsLayer
               (position 8.00 10.00)
index 328e2b0..68e2da9 100644 (file)
@@ -1,3 +1,21 @@
+2014-09-23  Ion Rosca  <rosca@adobe.com>
+
+        [CSS Blending] The composited layers isolated by the page group should blend with the default white background color.
+        https://bugs.webkit.org/show_bug.cgi?id=136563
+
+        Reviewed by Simon Fraser.
+
+        If a blending layer is not isolated, then it should blend with a white backdrop:
+        http://dev.w3.org/fxtf/compositing-1/#pagebackdrop
+
+        Tests: css3/blending/blend-mode-body-composited-child-background-color.html
+               css3/blending/blend-mode-body-composited-child.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
+        If the isolating composited layer is the root renderer, then it should have a backing store
+        into which the initial white backdrop will be painted.
+
 2014-09-22  Christophe Dumez  <cdumez@apple.com>
 
         Unreviewed build fix after r173859.
index 34f972d..21a0103 100644 (file)
@@ -1706,6 +1706,9 @@ bool RenderLayerBacking::isSimpleContainerCompositingLayer() const
     if (renderer().isRenderNamedFlowFragmentContainer())
         return false;
 
+    if (renderer().isRoot() && m_owningLayer.isolatesCompositedBlending())
+        return false;
+
     if (renderer().isRenderView()) {
         // Look to see if the root object has a non-simple background
         RenderObject* rootObject = renderer().document().documentElement() ? renderer().document().documentElement()->renderer() : 0;