background-visibility:hidden should create a RenderLayer
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2012 19:50:28 +0000 (19:50 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2012 19:50:28 +0000 (19:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81134

Source/WebCore:

Reviewed by Dean Jackson.

Background-visibility:hidden has to create RenderLayers, because it's implemented
via compositing and/or paint short-circuiting in RenderLayer code.

Test: transforms/3d/general/background-visibility-layers.html

* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::requiresLayer):
* rendering/RenderObject.h:
(WebCore::RenderObject::hasHiddenBackface):
* rendering/RenderTableRow.h:

LayoutTests:

Reviewed by Dean Jackson.

Test for background-visibility: hidden making a RenderLayer.

* transforms/3d/general/background-visibility-layers-actual.png: Added.
* transforms/3d/general/background-visibility-layers-actual.txt: Added.
* transforms/3d/general/background-visibility-layers.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/transforms/3d/general/background-visibility-layers-actual.png [new file with mode: 0644]
LayoutTests/transforms/3d/general/background-visibility-layers-actual.txt [new file with mode: 0644]
LayoutTests/transforms/3d/general/background-visibility-layers.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderBoxModelObject.h
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderTableRow.h

index e8dd937..a76e0f8 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-14  Simon Fraser  <simon.fraser@apple.com>
+
+        background-visibility:hidden should create a RenderLayer
+        https://bugs.webkit.org/show_bug.cgi?id=81134
+
+        Reviewed by Dean Jackson.
+        
+        Test for background-visibility: hidden making a RenderLayer.
+
+        * transforms/3d/general/background-visibility-layers-actual.png: Added.
+        * transforms/3d/general/background-visibility-layers-actual.txt: Added.
+        * transforms/3d/general/background-visibility-layers.html: Added.
+
 2012-03-14  Raul Hudea  <rhudea@adobe.com>
 
         [CSSRegions][CSSOM] Implement regionLayoutEvent
diff --git a/LayoutTests/transforms/3d/general/background-visibility-layers-actual.png b/LayoutTests/transforms/3d/general/background-visibility-layers-actual.png
new file mode 100644 (file)
index 0000000..de91d28
Binary files /dev/null and b/LayoutTests/transforms/3d/general/background-visibility-layers-actual.png differ
diff --git a/LayoutTests/transforms/3d/general/background-visibility-layers-actual.txt b/LayoutTests/transforms/3d/general/background-visibility-layers-actual.txt
new file mode 100644 (file)
index 0000000..e3fd7d8
--- /dev/null
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x116
+  RenderBlock {HTML} at (0,0) size 800x116
+    RenderBody {BODY} at (8,8) size 784x100
+layer at (8,8) size 100x100
+  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+layer at (8,8) size 100x100
+  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
diff --git a/LayoutTests/transforms/3d/general/background-visibility-layers.html b/LayoutTests/transforms/3d/general/background-visibility-layers.html
new file mode 100644 (file)
index 0000000..8efa152
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<style>div { width: 100px; height: 100px } </style>
+<div style="-webkit-transform: rotateX(180deg); -webkit-transform-style: preserve-3d; background: green">
+  <div style="-webkit-backface-visibility: hidden; background: red;"></div>
+</div>
index 3193669..19de6ba 100644 (file)
@@ -1,3 +1,22 @@
+2012-03-14  Simon Fraser  <simon.fraser@apple.com>
+
+        background-visibility:hidden should create a RenderLayer
+        https://bugs.webkit.org/show_bug.cgi?id=81134
+
+        Reviewed by Dean Jackson.
+        
+        Background-visibility:hidden has to create RenderLayers, because it's implemented
+        via compositing and/or paint short-circuiting in RenderLayer code.
+
+        Test: transforms/3d/general/background-visibility-layers.html
+
+        * rendering/RenderBox.h:
+        * rendering/RenderBoxModelObject.h:
+        (WebCore::RenderBoxModelObject::requiresLayer):
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::hasHiddenBackface):
+        * rendering/RenderTableRow.h:
+
 2012-03-14  Raul Hudea  <rhudea@adobe.com>
 
         [CSSRegions][CSSOM] Implement regionLayoutEvent
index 2bba71f..adbc5b0 100644 (file)
@@ -42,7 +42,7 @@ public:
     RenderBox(Node*);
     virtual ~RenderBox();
 
-    virtual bool requiresLayer() const OVERRIDE { return isRoot() || isPositioned() || isRelPositioned() || isTransparent() || requiresLayerForOverflowClip() || hasTransform() || hasMask() || hasReflection() || hasFilter() || style()->specifiesColumns(); }
+    virtual bool requiresLayer() const OVERRIDE { return isRoot() || isPositioned() || isRelPositioned() || isTransparent() || requiresLayerForOverflowClip() || hasTransform() || hasHiddenBackface() || hasMask() || hasReflection() || hasFilter() || style()->specifiesColumns(); }
     bool requiresLayerForOverflowClip() const;
 
     bool hasOverflowClipWithLayer() const { return hasOverflowClip() && hasLayer(); }
index 5535847..a23755c 100644 (file)
@@ -74,7 +74,7 @@ public:
 
     bool hasSelfPaintingLayer() const;
     RenderLayer* layer() const { return m_layer; }
-    virtual bool requiresLayer() const { return isRoot() || isPositioned() || isRelPositioned() || isTransparent() || hasTransform() || hasMask() || hasReflection() || hasFilter() || style()->specifiesColumns(); }
+    virtual bool requiresLayer() const { return isRoot() || isPositioned() || isRelPositioned() || isTransparent() || hasTransform() || hasHiddenBackface() || hasMask() || hasReflection() || hasFilter() || style()->specifiesColumns(); }
 
     // This will work on inlines to return the bounding box of all of the lines' border boxes.
     virtual LayoutRect borderBoundingBox() const = 0;
index 60e2a40..4a9286f 100644 (file)
@@ -502,6 +502,7 @@ public:
 
     bool hasTransform() const { return m_bitfields.hasTransform(); }
     bool hasMask() const { return style() && style()->hasMask(); }
+    bool hasHiddenBackface() const { return style() && style()->backfaceVisibility() == BackfaceVisibilityHidden; }
 
 #if ENABLE(CSS_FILTERS)
     bool hasFilter() const { return style() && style()->hasFilter(); }
index f3175df..f660e9d 100644 (file)
@@ -58,7 +58,7 @@ private:
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
 
     // We need to allocate a layer whenever we have an overflow clip as RenderTableSection::paintObject does not push rows' clips.
-    virtual bool requiresLayer() const OVERRIDE { return isTransparent() || hasOverflowClip() || hasTransform() || hasMask() || hasFilter(); }
+    virtual bool requiresLayer() const OVERRIDE { return isTransparent() || hasOverflowClip() || hasTransform() || hasHiddenBackface() || hasMask() || hasFilter(); }
 
     virtual void paint(PaintInfo&, const LayoutPoint&);