https://bugs.webkit.org/show_bug.cgi?id=122243
Reviewed by Alexandru Chiculita.
Source/WebCore:
The margin box offset needs to be computed based on the writing mode
of the container, not the writihg mode of the float itself. This
patch makes that happen.
Test: fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine):
LayoutTests:
Test that the margins and width are properly computed in the case of
different writing modes.
* fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156806
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-10-02 Bem Jones-Bey <bjonesbe@adobe.com>
+
+ [css-shapes] shape-outside does not properly handle the container and the float having different writing modes
+ https://bugs.webkit.org/show_bug.cgi?id=122243
+
+ Reviewed by Alexandru Chiculita.
+
+ Test that the margins and width are properly computed in the case of
+ different writing modes.
+
+ * fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-expected.html: Added.
+ * fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html: Added.
+
2013-10-02 Tim Horton <timothy_horton@apple.com>
Unreviewed rebaseline, try to add newlines back that keep disappearing on me.
--- /dev/null
+<!DOCTYPE html>
+<title>shape-outside on floats with a different writing mode in the float and the container</title>
+<style>
+ .container {
+ font: 20px/1 Ahem;
+ line-height: 20px;
+ }
+ .float {
+ height: 20px;
+ width: 40px;
+ margin: 0px 20px;
+ background-color: red;
+ color: green;
+ float: left;
+ }
+</style>
+<body>
+ <p><a href="https://bugs.webkit.org/show_bug.cgi?id=122243">Bug 122243</a> - [css-shapes] shape-outside does not properly handle the container and the float having different writing modes</p>
+ <p>You should see a single green square. You should not see any red.</p>
+ <div class="container">
+ <div class="float">XX</div>
+ </div>
+</body>
--- /dev/null
+<!DOCTYPE html>
+<title>shape-outside on floats with a different writing mode in the float and the container</title>
+<style>
+ .container {
+ font: 20px/1 Ahem;
+ line-height: 20px;
+ color: green;
+ }
+ .float {
+ -webkit-writing-mode: vertical-lr;
+ -webkit-shape-outside: rectangle(-20px, 0, 20px, 20px);
+ height: 20px;
+ width: 40px;
+ margin: 0px 20px;
+ background-color: red;
+ float: left;
+ }
+</style>
+<body>
+ <p><a href="https://bugs.webkit.org/show_bug.cgi?id=122243">Bug 122243</a> - [css-shapes] shape-outside does not properly handle the container and the float having different writing modes</p>
+ <p>You should see a single green square. You should not see any red.</p>
+ <div class="container">
+ <div class="float"></div>
+ XX
+ </div>
+</body>
+2013-10-02 Bem Jones-Bey <bjonesbe@adobe.com>
+
+ [css-shapes] shape-outside does not properly handle the container and the float having different writing modes
+ https://bugs.webkit.org/show_bug.cgi?id=122243
+
+ Reviewed by Alexandru Chiculita.
+
+ The margin box offset needs to be computed based on the writing mode
+ of the container, not the writihg mode of the float itself. This
+ patch makes that happen.
+
+ Test: fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html
+
+ * rendering/shapes/ShapeOutsideInfo.cpp:
+ (WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine):
+
2013-10-02 Andreas Kling <akling@apple.com>
Remove Qt-specific code in WebCore/{bindings,bridge,loader,icon,testing}.
if (lineOverlapsShapeBounds()) {
SegmentList segments = computeSegmentsForLine(lineTopInShapeCoordinates, lineHeight);
if (segments.size()) {
- m_leftMarginBoxDelta = segments[0].logicalLeft + m_renderer->marginStart();
- m_rightMarginBoxDelta = segments[segments.size()-1].logicalRight - m_renderer->logicalWidth() - m_renderer->marginEnd();
+ m_leftMarginBoxDelta = segments.first().logicalLeft + containingBlock->marginStartForChild(m_renderer);
+ m_rightMarginBoxDelta = segments.last().logicalRight - containingBlock->logicalWidthForChild(m_renderer) - containingBlock->marginEndForChild(m_renderer);
return;
}
}
- m_leftMarginBoxDelta = m_renderer->logicalWidth() + m_renderer->marginStart();
- m_rightMarginBoxDelta = -m_renderer->logicalWidth() - m_renderer->marginEnd();
+ m_leftMarginBoxDelta = containingBlock->logicalWidthForChild(m_renderer) + containingBlock->marginStartForChild(m_renderer);
+ m_rightMarginBoxDelta = -containingBlock->logicalWidthForChild(m_renderer) - containingBlock->marginEndForChild(m_renderer);
}
}