[CSS Shapes] ShapeOutsideInfo needs to use the parent's writing mode when calculating offsets

https://bugs.webkit.org/show_bug.cgi?id=124680

Patch by Rob Buis <rob.buis@samsung.com> on 2013-12-06
Reviewed by Dirk Schulze.

Source/WebCore:

Do not take the writing-mode property on the float into account for shape-outside.
Add a virtual method writingMode() in order to do this for shape-outside but
keep old behavior (element writingMode) for shape-inside.

Change existing test floats/shape-outside-floats-different-writing-modes.html to test the
new behavior.

* rendering/shapes/ShapeInfo.cpp:
(WebCore::::computedShape):
* rendering/shapes/ShapeInfo.h:
(WebCore::ShapeInfo::writingMode):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::writingMode):
* rendering/shapes/ShapeOutsideInfo.h:

LayoutTests:

Make sure the writing-mode property on the float is not taken into account for shape-outside.
Adapt highlight-shape-outside.html so it sets the writing-mode on the container div, not the float.
However because of earlier unreliability in EFL/GTK, skip the test for now.

* TestExpectations:
* fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html:
* inspector-protocol/model/highlight-shape-outside-expected.txt:
* inspector-protocol/model/highlight-shape-outside.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6f2bf6ca
2013-12-06 Rob Buis <rob.buis@samsung.com>
[CSS Shapes] ShapeOutsideInfo needs to use the parent's writing mode when calculating offsets
https://bugs.webkit.org/show_bug.cgi?id=124680
Reviewed by Dirk Schulze.
Make sure the writing-mode property on the float is not taken into account for shape-outside.
Adapt highlight-shape-outside.html so it sets the writing-mode on the container div, not the float.
However because of earlier unreliability in EFL/GTK, skip the test for now.
* TestExpectations:
* fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html:
* inspector-protocol/model/highlight-shape-outside-expected.txt:
* inspector-protocol/model/highlight-shape-outside.html:
2013-12-06 Filip Pizlo <fpizlo@apple.com>
FTL should support all of ValueToInt32
......@@ -68,3 +68,5 @@ webkit.org/b/53990 fast/forms/search-event-delay.html [ Pass Failure ]
# No port in WebKit already support getMediaStream, so we are skipping those for now.
fast/mediastream/MediaStream-construct-with-ended-tracks.html [ Skip ]
fast/mediastream/MediaStream-clone.html [ Skip ]
webkit.org/b/124660 inspector-protocol/model/highlight-shape-outside.html [ Failure ]
......@@ -8,7 +8,7 @@
}
.float {
-webkit-writing-mode: vertical-lr;
-webkit-shape-outside: rectangle(0px, -20px, 20px, 20px) content-box;
-webkit-shape-outside: rectangle(-20px, 0px, 20px, 20px) content-box;
height: 20px;
width: 40px;
margin: 0px 20px;
......
......@@ -72,19 +72,19 @@ function shapeTests() {
'path' : ['M', 50, 50, 'L', 150, 50, 'L', 150, 100, 'L', 50, 100, 'L', 50, 50, 'Z']
},
{
'selector' : '.rectangle.vertical-lr',
'selector' : '.vertical-lr > .rectangle',
'path' : ['M', 50, 50, 'L', 50, 100, 'L', 150, 100, 'L', 150, 50, 'L', 50, 50, 'Z']
},
{
'selector' : '.rectangle.vertical-rl',
'selector' : '.vertical-rl > .rectangle',
'path' : ['M', 150, 50, 'L', 150, 100, 'L', 50, 100, 'L', 50, 50, 'L', 150, 50, 'Z']
},
{
'selector' : '.rectangle.padded.vertical-rl',
'selector' : '.vertical-rl > .rectangle.padded',
'path' : ['M', 175, 75, 'L', 175, 125, 'L', 75, 125, 'L', 75, 75, 'L', 175, 75, 'Z']
},
{
'selector' : '.rectangle.padded.vertical-rl.border-box',
'selector' : '.vertical-rl > .rectangle.padded.border-box',
'path' : ['M', 150, 50, 'L', 150, 100, 'L', 50, 100, 'L', 50, 50, 'L', 150, 50, 'Z']
},
{
......@@ -130,10 +130,14 @@ window.onload = function() { ShapeInfoHelper.runShapeTest(shapeTests); }
<div class='shape polygon'></div>
<div class='shape padded rectangle'></div>
<div class='shape padded rectangle border-box'></div>
<div class='shape rectangle vertical-lr'></div>
<div class='shape rectangle vertical-rl'></div>
<div class='shape padded rectangle vertical-rl'></div>
<div class='shape padded rectangle vertical-rl border-box'></div>
<div class='vertical-lr'>
<div class='shape rectangle'></div>
</div>
<div class='vertical-rl'>
<div class='shape rectangle'></div>
<div class='shape padded rectangle'></div>
<div class='shape padded rectangle border-box'></div>
</div>
<div class='shape padded content-box'></div>
<div class='shape padded raster-svg'></div>
<div class='shape padded raster-svg-complex'></div>
......
2013-12-06 Rob Buis <rob.buis@samsung.com>
[CSS Shapes] ShapeOutsideInfo needs to use the parent's writing mode when calculating offsets
https://bugs.webkit.org/show_bug.cgi?id=124680
Reviewed by Dirk Schulze.
Do not take the writing-mode property on the float into account for shape-outside.
Add a virtual method writingMode() in order to do this for shape-outside but
keep old behavior (element writingMode) for shape-inside.
Change existing test floats/shape-outside-floats-different-writing-modes.html to test the
new behavior.
* rendering/shapes/ShapeInfo.cpp:
(WebCore::::computedShape):
* rendering/shapes/ShapeInfo.h:
(WebCore::ShapeInfo::writingMode):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::writingMode):
* rendering/shapes/ShapeOutsideInfo.h:
2013-12-06 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove Staging Workaround
......@@ -60,7 +60,7 @@ const Shape& ShapeInfo<RenderType>::computedShape() const
if (Shape* shape = m_shape.get())
return *shape;
WritingMode writingMode = m_renderer.style().writingMode();
WritingMode writingMode = this->writingMode();
Length margin = m_renderer.style().shapeMargin();
Length padding = m_renderer.style().shapePadding();
float shapeImageThreshold = m_renderer.style().shapeImageThreshold();
......
......@@ -165,6 +165,8 @@ protected:
virtual ShapeValue* shapeValue() const = 0;
virtual void getIntervals(LayoutUnit, LayoutUnit, SegmentList&) const = 0;
virtual WritingMode writingMode() const { return m_renderer.style().writingMode(); }
LayoutUnit logicalTopOffset() const
{
BasicShape::ReferenceBox box = resolvedBox();
......
......@@ -100,6 +100,12 @@ ShapeValue* ShapeOutsideInfo::shapeValue() const
return m_renderer.style().shapeOutside();
}
WritingMode ShapeOutsideInfo::writingMode() const
{
ASSERT(m_renderer.containingBlock());
return m_renderer.containingBlock()->style().writingMode();
}
}
#endif
......@@ -79,6 +79,8 @@ private:
return computedShape().getExcludedIntervals(lineTop, lineHeight, segments);
}
virtual WritingMode writingMode() const;
LayoutUnit m_leftMarginBoxDelta;
LayoutUnit m_rightMarginBoxDelta;
LayoutUnit m_lineTop;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment