- Revision
- 157192
- Author
- bjone...@adobe.com
- Date
- 2013-10-09 15:54:57 -0700 (Wed, 09 Oct 2013)
Log Message
[CSS Shapes] Lines that don't intersect shape-outside should ignore both left and right margins
https://bugs.webkit.org/show_bug.cgi?id=122570
Reviewed by Alexandru Chiculita.
Source/WebCore:
Due to an oversight, the left margin on left floats and the right
margin on right floats was having an effect on lines that did not
intersect the shape (but did intersect the margin box of the float).
By the spec, lines that do not intersect the shape should act as if
the float isn't there, so those margins should have no effect on
those lines. This patch fixes this.
No new tests, it is covered by the existing tests now that they have
been fixed to have the proper behavior.
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine):
LayoutTests:
Update tests to work with the proper behavior for margins. Yes, the
tests were not correct before.
* csswg/contributors/adobe/submitted/shapes/shape-outside/resources/w3c-import.log:
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-000.html:
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-007.html:
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-009.html:
* csswg/contributors/adobe/submitted/shapes/shape-outside/w3c-import.log:
* fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (157191 => 157192)
--- trunk/LayoutTests/ChangeLog 2013-10-09 22:39:13 UTC (rev 157191)
+++ trunk/LayoutTests/ChangeLog 2013-10-09 22:54:57 UTC (rev 157192)
@@ -1,5 +1,22 @@
2013-10-09 Bem Jones-Bey <bjone...@adobe.com>
+ [CSS Shapes] Lines that don't intersect shape-outside should ignore both left and right margins
+ https://bugs.webkit.org/show_bug.cgi?id=122570
+
+ Reviewed by Alexandru Chiculita.
+
+ Update tests to work with the proper behavior for margins. Yes, the
+ tests were not correct before.
+
+ * csswg/contributors/adobe/submitted/shapes/shape-outside/resources/w3c-import.log:
+ * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-000.html:
+ * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-007.html:
+ * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-009.html:
+ * csswg/contributors/adobe/submitted/shapes/shape-outside/w3c-import.log:
+ * fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html:
+
+2013-10-09 Bem Jones-Bey <bjone...@adobe.com>
+
[CSS Shapes] Clip shape-outside to the bottom of the margin box
https://bugs.webkit.org/show_bug.cgi?id=122562
Modified: trunk/LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-000.html (157191 => 157192)
--- trunk/LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-000.html 2013-10-09 22:39:13 UTC (rev 157191)
+++ trunk/LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-000.html 2013-10-09 22:54:57 UTC (rev 157192)
@@ -36,13 +36,13 @@
<body>
<p>This should display two green bars, with white squares on opposite sides.</p>
- <div class="container">
- <div id="float-left">
+ <div class="container" style="text-align: right">
+ <div id="float-right">
</div>
XXXX
</div>
<div class="container">
- <div id="float-right">
+ <div id="float-left">
</div>
XXXX
</div>
Modified: trunk/LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-007.html (157191 => 157192)
--- trunk/LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-007.html 2013-10-09 22:39:13 UTC (rev 157191)
+++ trunk/LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-007.html 2013-10-09 22:54:57 UTC (rev 157192)
@@ -37,13 +37,13 @@
<body>
<p>This should display two green bars, with white squares on opposite sides.</p>
- <div class="container">
- <div id="float-left">
+ <div class="container" style="text-align: right">
+ <div id="float-right">
</div>
XXXX
</div>
<div class="container">
- <div id="float-right">
+ <div id="float-left">
</div>
XXXX
</div>
Modified: trunk/LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-009.html (157191 => 157192)
--- trunk/LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-009.html 2013-10-09 22:39:13 UTC (rev 157191)
+++ trunk/LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-009.html 2013-10-09 22:54:57 UTC (rev 157192)
@@ -37,13 +37,13 @@
<body>
<p>This should display two green bars, with white squares on opposite sides.</p>
- <div class="container">
- <div id="float-left">
+ <div class="container" style="text-align: right">
+ <div id="float-right">
</div>
XXXX
</div>
- <div class="container" style="text-align: right">
- <div id="float-right">
+ <div class="container">
+ <div id="float-left">
</div>
XXXX
</div>
Modified: trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html (157191 => 157192)
--- trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html 2013-10-09 22:39:13 UTC (rev 157191)
+++ trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html 2013-10-09 22:54:57 UTC (rev 157192)
@@ -8,7 +8,7 @@
}
.float {
-webkit-writing-mode: vertical-lr;
- -webkit-shape-outside: rectangle(-20px, 0, 20px, 20px);
+ -webkit-shape-outside: rectangle(0px, -20px, 20px, 20px);
height: 20px;
width: 40px;
margin: 0px 20px;
Modified: trunk/Source/WebCore/ChangeLog (157191 => 157192)
--- trunk/Source/WebCore/ChangeLog 2013-10-09 22:39:13 UTC (rev 157191)
+++ trunk/Source/WebCore/ChangeLog 2013-10-09 22:54:57 UTC (rev 157192)
@@ -1,5 +1,25 @@
2013-10-09 Bem Jones-Bey <bjone...@adobe.com>
+ [CSS Shapes] Lines that don't intersect shape-outside should ignore both left and right margins
+ https://bugs.webkit.org/show_bug.cgi?id=122570
+
+ Reviewed by Alexandru Chiculita.
+
+ Due to an oversight, the left margin on left floats and the right
+ margin on right floats was having an effect on lines that did not
+ intersect the shape (but did intersect the margin box of the float).
+ By the spec, lines that do not intersect the shape should act as if
+ the float isn't there, so those margins should have no effect on
+ those lines. This patch fixes this.
+
+ No new tests, it is covered by the existing tests now that they have
+ been fixed to have the proper behavior.
+
+ * rendering/shapes/ShapeOutsideInfo.cpp:
+ (WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine):
+
+2013-10-09 Bem Jones-Bey <bjone...@adobe.com>
+
[CSS Shapes] Clip shape-outside to the bottom of the margin box
https://bugs.webkit.org/show_bug.cgi?id=122562
Modified: trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp (157191 => 157192)
--- trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp 2013-10-09 22:39:13 UTC (rev 157191)
+++ trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp 2013-10-09 22:54:57 UTC (rev 157192)
@@ -73,8 +73,15 @@
}
}
- m_leftMarginBoxDelta = containingBlock->logicalWidthForChild(m_renderer) + containingBlock->marginStartForChild(m_renderer);
- m_rightMarginBoxDelta = -containingBlock->logicalWidthForChild(m_renderer) - containingBlock->marginEndForChild(m_renderer);
+ // Lines that do not overlap the shape should act as if the float
+ // wasn't there for layout purposes. So we set the deltas to remove the
+ // entire width of the float.
+ // FIXME: The latest CSS Shapes spec says that in this case, the
+ // content should interact with previously stacked floats on the line
+ // as if this outermost float did not exist. Perhaps obviously, this
+ // solution cannot do that, and will be revisted with bug 122576.
+ m_leftMarginBoxDelta = floatingObject->logicalWidth(containingBlock->isHorizontalWritingMode());
+ m_rightMarginBoxDelta = -floatingObject->logicalWidth(containingBlock->isHorizontalWritingMode());
}
}