Title: [147463] trunk
Revision
147463
Author
commit-qu...@webkit.org
Date
2013-04-02 11:10:12 -0700 (Tue, 02 Apr 2013)

Log Message

[css exclusions] overflow:hidden undoes shape-outside offsets
https://bugs.webkit.org/show_bug.cgi?id=110349

Patch by Bem Jones-Bey <bjone...@adobe.com> on 2013-04-02
Reviewed by Julien Chaffraix.

Source/WebCore:

When overflow: hidden was set on a float with shape-outside, the
offset from the shape-outside was being ignored. This was because the
float was being placed in the normal flow, causing the offsets to be
calculated differently. Since floats with shape outside behave like
positioned objects in many places, I have caused them to take the same
behavior as positioned objects in this case as well: the floats with
shape-outside do not get placed in the normal flow when overflow:
hidden is set.

Test: fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::shouldBeNormalFlowOnly): Floats that have
    shape-outside should not be in the normal flow.

LayoutTests:

Add a test to make sure the float is properly positioned with
overflow: hidden.

* fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden-expected.html: Added.
* fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (147462 => 147463)


--- trunk/LayoutTests/ChangeLog	2013-04-02 18:06:42 UTC (rev 147462)
+++ trunk/LayoutTests/ChangeLog	2013-04-02 18:10:12 UTC (rev 147463)
@@ -1,3 +1,16 @@
+2013-04-02  Bem Jones-Bey  <bjone...@adobe.com>
+
+        [css exclusions] overflow:hidden undoes shape-outside offsets
+        https://bugs.webkit.org/show_bug.cgi?id=110349
+
+        Reviewed by Julien Chaffraix.
+
+        Add a test to make sure the float is properly positioned with
+        overflow: hidden.
+
+        * fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden-expected.html: Added.
+        * fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden.html: Added.
+
 2013-04-02  Jochen Eisinger  <joc...@chromium.org>
 
         Check whether popups are allowed before creating a new window

Added: trunk/LayoutTests/fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden-expected.html (0 => 147463)


--- trunk/LayoutTests/fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden-expected.html	2013-04-02 18:10:12 UTC (rev 147463)
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.container {
+  width: 200px;
+  font: 10px/1 Ahem, sans-serif;
+  color: green;
+}
+.shape {
+  width: 80px;
+  height: 90px;
+  float: left;
+  overflow: hidden;
+  color: blue;
+}
+</style>
+</head>
+<body>
+<h1><a href="" 110349</a> - [css exclusions] overflow:hidden undoes shape-outside offsets</h1>
+<h2>You should see a blue rectangle to the left of a green rectangle. You should not see any red.</h2>
+<div class="container">
+<div class='shape'>
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+</div>
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden.html (0 => 147463)


--- trunk/LayoutTests/fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden.html	                        (rev 0)
+++ trunk/LayoutTests/fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden.html	2013-04-02 18:10:12 UTC (rev 147463)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+    if (window.internals)
+        window.internals.settings.setCSSExclusionsEnabled(true);
+</script>
+<style>
+.container {
+  width: 200px;
+  font: 10px/1 Ahem, sans-serif;
+  color: green;
+  background-color: red;
+}
+.shape {
+  width: 100px;
+  height: 100px;
+  -webkit-shape-outside: rectangle(10%, 10%, 80%, 90%);
+  float: left;
+  color: blue;
+  overflow: hidden;
+}
+</style>
+</head>
+<body>
+<h1><a href="" 110349</a> - [css exclusions] overflow:hidden undoes shape-outside offsets</h1>
+<h2>You should see a blue rectangle to the left of a green rectangle. You should not see any red.</h2>
+<div class="container">
+<div class='shape'>
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+XXXXXXXX
+</div>
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+XXXXXXXXXXXX
+</div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (147462 => 147463)


--- trunk/Source/WebCore/ChangeLog	2013-04-02 18:06:42 UTC (rev 147462)
+++ trunk/Source/WebCore/ChangeLog	2013-04-02 18:10:12 UTC (rev 147463)
@@ -1,3 +1,25 @@
+2013-04-02  Bem Jones-Bey  <bjone...@adobe.com>
+
+        [css exclusions] overflow:hidden undoes shape-outside offsets
+        https://bugs.webkit.org/show_bug.cgi?id=110349
+
+        Reviewed by Julien Chaffraix.
+
+        When overflow: hidden was set on a float with shape-outside, the
+        offset from the shape-outside was being ignored. This was because the
+        float was being placed in the normal flow, causing the offsets to be
+        calculated differently. Since floats with shape outside behave like
+        positioned objects in many places, I have caused them to take the same
+        behavior as positioned objects in this case as well: the floats with
+        shape-outside do not get placed in the normal flow when overflow:
+        hidden is set.
+
+        Test: fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::shouldBeNormalFlowOnly): Floats that have
+            shape-outside should not be in the normal flow.
+
 2013-04-02  Andrey Lushnikov  <lushni...@chromium.org>
 
         Web Inspector: resource preview of html/js/css types should be on a grey background

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (147462 => 147463)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2013-04-02 18:06:42 UTC (rev 147462)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2013-04-02 18:10:12 UTC (rev 147463)
@@ -5845,7 +5845,10 @@
             && !renderer()->hasBlendMode()
 #endif
             && !isTransparent()
-            && !needsCompositedScrolling();
+            && !needsCompositedScrolling()
+#if ENABLE(CSS_EXCLUSIONS)
+            && !(renderer()->isFloating() && renderer()->style()->shapeOutside());
+#endif
 }
 
 bool RenderLayer::shouldBeSelfPaintingLayer() const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to