LayoutTests/ChangeLog

 12013-10-01 Zoltan Horvath <zoltan@webkit.org>
 2
 3 [CSS Shapes] Support block content with inline content around floats in shape-inside
 4 https://bugs.webkit.org/show_bug.cgi?id=121616
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 In r156022 and r156364, I added support for floats inside shape-inside with inline content. This change extends
 9 the existing implementation to support block content with inline content (paragraphs). I added an extra text for
 10 positioning a float inside shape-inside without text content around it.
 11
 12 * fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content-expected.html: Added.
 13 * fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content.html: Added.
 14 * fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content-expected.html: Added.
 15 * fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content.html: Added.
 16 * fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-expected.html: Added.
 17 * fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle.html: Added.
 18 * fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content-expected.html: Added.
 19 * fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content.html: Added.
 20 * fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content-expected.html: Added.
 21 * fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content.html: Added.
 22
1232013-09-30 Jer Noble <jer.noble@apple.com>
224
325 Unreviewed, roll back in r156546 with rebaselined tests.

LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content-expected.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<style>
 5 #polygon-svg-shape {
 6 position: absolute;
 7 left: 0px;
 8 top: 0px;
 9 width: 200px;
 10 height: 200px;
 11 }
 12 #shape-inside {
 13 font: 20px Ahem, sans-serif;
 14 line-height: 20px;
 15 position: absolute;
 16 left: 0px;
 17 top: 0px;
 18 padding-top: 20px;
 19 }
 20 #float {
 21 position: absolute;
 22 left: 0px;
 23 top: 0px;
 24 width: 50px;
 25 height: 50px;
 26 float: left;
 27 margin-top: 50px;
 28 background-color: yellow;
 29 }
 30 #side-of-float {
 31 position: absolute;
 32 top: 70px;
 33 left: 50px;
 34 width: 20px;
 35 }
 36 #below-float {
 37 width: 200px;
 38 margin-top: 90px;
 39
 40 }
 41 #overflow {
 42 width: 200px;
 43 margin-top: 10px;
 44 }
 45</style>
 46</head>
 47<body>
 48 <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg">
 49 <polygon points="0,0 200,200 0,200" fill="#636363"></polygon>
 50 </svg>
 51 <div id="shape-inside">
 52 X
 53 <div id="float"></div>
 54 <div id="side-of-float">X<br/>X</div>
 55 <div id="below-float">X<br/><br>XXXXXXX</div>
 56 <div id="overflow">X X X X X X</div>
 57 </div>
 58
 59 <p style="margin-top: 250px;">
 60 There is a triangle shape-inside (represented by the matching filled SVG polygon), the shape-inside contains a 50x50px yellow float left,
 61 the float should be at the very left and top position inside the triangle shape where it fits first. The block content with inline content
 62 (paragraphs) should start before the yellow rectangle and then wrap around it. The overflow should be pushed under the triangle shape-inside.
 63 </p>
 64 <p>Bug <a href="http://webkit.org/b/121616">121616</a>: [CSS Shapes] Support block content with inline content around floats in shape-inside</p>
 65</body>
 66</html>

LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<style>
 5 #polygon-svg-shape {
 6 position: absolute;
 7 left: 0px;
 8 top: 0px;
 9 }
 10 #shape-inside {
 11 font: 20px Ahem, sans-serif;
 12 line-height: 20px;
 13 width: 200px;
 14 height: 200px;
 15 position: absolute;
 16 left: 0px;
 17 top: 0px;
 18 -webkit-shape-inside: polygon(0px 0px, 200px 200px, 0px 200px);
 19 }
 20 #float {
 21 width: 50px;
 22 height: 50px;
 23 float: left;
 24 background-color: yellow;
 25 }
 26</style>
 27</head>
 28<body>
 29 <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg">
 30 <polygon points="0,0 200,200 0,200" fill="#636363"></polygon>
 31 </svg>
 32 <div id="shape-inside">X
 33 <div id="float"></div>X X</p>X<p>XXXXXXX <p>X X X X X X</p>
 34 </div>
 35 <p style="margin-top: 250px;">
 36 There is a triangle shape-inside (represented by the matching filled SVG polygon), the shape-inside contains a 50x50px yellow float left,
 37 the float should be at the very left and top position inside the triangle shape where it fits first. The block content with inline content
 38 (paragraphs) should start before the yellow rectangle and then wrap around it. The overflow should be pushed under the triangle shape-inside.
 39 </p>
 40 <p>Bug <a href="http://webkit.org/b/121616">121616</a>: [CSS Shapes] Support block content with inline content around floats in shape-inside</p>
 41</body>
 42</html>

LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content-expected.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<style>
 5 #polygon-svg-shape {
 6 position: absolute;
 7 left: 0px;
 8 top: 0px;
 9 width: 200px;
 10 height: 200px;
 11 }
 12 #shape-inside {
 13 font: 20px Ahem, sans-serif;
 14 line-height: 20px;
 15 position: absolute;
 16 left: 0px;
 17 top: 0px;
 18 text-align: right;
 19 padding-top: 20px;
 20 width: 200px;
 21 height: 200px;
 22 }
 23 #float {
 24 width: 50px;
 25 height: 50px;
 26 float: right;
 27 margin-top: 10px;
 28 background-color: yellow;
 29 }
 30 #overflow {
 31 width: 200px;
 32 text-align: left;
 33 }
 34</style>
 35</head>
 36<body>
 37 <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg">
 38 <polygon points="200,0 200,200 0,200" fill="#636363"></polygon>
 39 </svg>
 40 <div id="shape-inside">
 41 X<br/>
 42 <div id="float"></div>
 43 <br/><br/><br/>X X &nbsp;<br/><br/>
 44 XXXXXXX<br/><br/>
 45 X X X X X<br/>
 46 <div id="overflow">X X X X X X</div>
 47 </div>
 48
 49 <p style="margin-top: 250px;">
 50 There is a triangle shape-inside (represented by the matching filled SVG polygon), the shape-inside contains a 50x50px yellow float left,
 51 the float should be at the very left and top position inside the triangle shape where it fits first. The block content with inline content
 52 (paragraphs) should start before the yellow rectangle and then wrap around it. The overflow should be pushed under the triangle shape-inside.
 53 </p>
 54 <p>Bug <a href="http://webkit.org/b/121616">121616</a>: [CSS Shapes] Support block content with inline content around floats in shape-inside</p>
 55</body>
 56</html>

LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<style>
 5 #polygon-svg-shape {
 6 position: absolute;
 7 left: 0px;
 8 top: 0px;
 9 }
 10 #shape-inside {
 11 font: 20px Ahem, sans-serif;
 12 line-height: 20px;
 13 width: 200px;
 14 height: 200px;
 15 position: absolute;
 16 left: 0px;
 17 top: 0px;
 18 -webkit-shape-inside: polygon(200px 0px, 200px 200px, 0px 200px);
 19 }
 20 #float {
 21 width: 50px;
 22 height: 50px;
 23 float: left;
 24 background-color: yellow;
 25 }
 26</style>
 27</head>
 28<body>
 29 <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg">
 30 <polygon points="200,0 200,200 0,200" fill="#636363"></polygon>
 31 </svg>
 32 <div id="shape-inside">X
 33 <div id="float"></div><p>X X</p><p>XXXXXXX <p>X X X X X X X X X X X</p>
 34 </div>
 35 <p style="margin-top: 250px;">
 36 There is a triangle shape-inside (represented by the matching filled SVG polygon), the shape-inside contains a 50x50px yellow float left,
 37 the float should be at the very left and top position inside the triangle shape where it fits first. The block content with inline content
 38 (paragraphs) should start before the yellow rectangle and then wrap around it. The overflow should be pushed under the triangle shape-inside.
 39 </p>
 40 <p>Bug <a href="http://webkit.org/b/121616">121616</a>: [CSS Shapes] Support block content with inline content around floats in shape-inside</p>
 41</body>
 42</html>

LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-expected.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<style>
 5 #polygon-svg-shape {
 6 position: absolute;
 7 left: 0px;
 8 top: 0px;
 9 width: 200px;
 10 height: 200px;
 11 }
 12 #shape-inside {
 13 position: absolute;
 14 left: 150px;
 15 top: 50px;
 16 width: 50px;
 17 height: 50px;
 18 float: left;
 19 background-color: yellow;
 20 }
 21</style>
 22</head>
 23<body>
 24 <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg">
 25 <polygon points="200,0 200,200 0,200" fill="#636363"></polygon>
 26 </svg>
 27 <div id="shape-inside">
 28 </div>
 29
 30 <p style="margin-top: 250px;">
 31 There is a triangle shape-inside (represented by the matching filled SVG polygon), the shape-inside contains a 50x50px yellow float left,
 32 the float should be at the very left and top position inside the triangle shape where it fits first.
 33 </p>
 34 <p>Bug <a href="http://webkit.org/b/121616">121616</a>: [CSS Shapes] Support block content with inline content around floats in shape-inside</p>
 35</body>
 36</html>

LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<style>
 5 #polygon-svg-shape {
 6 position: absolute;
 7 left: 0px;
 8 top: 0px;
 9 }
 10 #shape-inside {
 11 position: absolute;
 12 width: 200px;
 13 height: 200px;
 14 left: 0px;
 15 top: 0px;
 16 -webkit-shape-inside: polygon(200px 0px, 200px 200px, 0px 200px);
 17 }
 18 #float {
 19 width: 50px;
 20 height: 50px;
 21 float: left;
 22 background-color: yellow;
 23 }
 24</style>
 25</head>
 26<body>
 27 <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg">
 28 <polygon points="200,0 200,200 0,200" fill="#636363"></polygon>
 29 </svg>
 30 <div id="shape-inside">
 31 <div id="float"></div>
 32 </div>
 33 <p style="margin-top: 250px;">
 34 There is a triangle shape-inside (represented by the matching filled SVG polygon), the shape-inside contains a 50x50px yellow float left,
 35 the float should be at the very left and top position inside the triangle shape where it fits first.
 36 </p>
 37 <p>Bug <a href="http://webkit.org/b/121616">121616</a>: [CSS Shapes] Support block content with inline content around floats in shape-inside</p>
 38</body>
 39</html>

LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content-expected.html

 1<!DOCTYPE html>
 2<head>
 3<style>
 4 #polygon-svg-shape {
 5 position: absolute;
 6 left: 0px;
 7 top: 0px;
 8 width: 200px;
 9 height: 200px;
 10 }
 11 #shape-inside {
 12 font: 20px Ahem, sans-serif;
 13 line-height: 20px;
 14 position: absolute;
 15 left: 0px;
 16 top: 0px;
 17 }
 18 #float {
 19 width: 50px;
 20 height: 50px;
 21 float: left;
 22 background-color: yellow;
 23 }
 24</style>
 25</head>
 26<body>
 27 <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg">
 28 <polygon points="0,0 200,0 0,200" fill="#636363"></polygon>
 29 </svg>
 30 <div id="shape-inside">
 31 X<br/><br/>
 32 <div id="float"></div>
 33 XXXX<br/><br/>
 34 X<br/><br/>
 35 X<br/><br/>
 36 X<br/><br/>
 37 X X X X X<br/>
 38 X
 39 </div>
 40 <p style="margin-top: 250px;">
 41 There is a triangle shape-inside (represented by the matching filled SVG polygon), the shape-inside contains a 50x50px yellow float left,
 42 the float should be at the very left and top position inside the triangle shape where it fits first. The block content with inline content
 43 (paragraphs) should start before the yellow rectangle and then wrap around it. The overflow should be pushed under the triangle shape-inside.
 44 </p>
 45 <p>Bug <a href="http://webkit.org/b/121616">121616</a>: [CSS Shapes] Support block content with inline content around floats in shape-inside</p>
 46</body>
 47</html>

LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<style>
 5 #polygon-svg-shape {
 6 position: absolute;
 7 left: 0px;
 8 top: 0px;
 9 }
 10 #shape-inside {
 11 font: 20px Ahem, sans-serif;
 12 line-height: 20px;
 13 width: 200px;
 14 height: 200px;
 15 position: absolute;
 16 left: 0px;
 17 top: 0px;
 18 -webkit-shape-inside: polygon(0px 0px, 200px 0px, 0px 200px);
 19 }
 20 #float {
 21 width: 50px;
 22 height: 50px;
 23 float: left;
 24 background-color: yellow;
 25 }
 26</style>
 27</head>
 28<body>
 29 <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg">
 30 <polygon points="0,0 200,0 0,200" fill="#636363"></polygon>
 31 </svg>
 32 <div id="shape-inside">A<p>
 33 <div id="float"></div><p>XXXX</p><p>X <p>X</p> X</p><p> X X X X X X</p>
 34 </div>
 35 <p style="margin-top: 250px;">
 36 There is a triangle shape-inside (represented by the matching filled SVG polygon), the shape-inside contains a 50x50px yellow float left,
 37 the float should be at the very left and top position inside the triangle shape where it fits first. The block content with inline content
 38 (paragraphs) should start before the yellow rectangle and then wrap around it. The overflow should be pushed under the triangle shape-inside.
 39 </p>
 40 <p>Bug <a href="http://webkit.org/b/121616">121616</a>: [CSS Shapes] Support block content with inline content around floats in shape-inside</p>
 41</body>
 42</html>

LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content-expected.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<style>
 5 #polygon-svg-shape {
 6 position: absolute;
 7 left: 0px;
 8 top: 0px;
 9 width: 200px;
 10 height: 200px;
 11 }
 12 #shape-inside {
 13 font: 20px Ahem, sans-serif;
 14 line-height: 20px;
 15 -webkit-font-smoothing: none;
 16 position: absolute;
 17 left: 0px;
 18 top: 0px;
 19 text-align: right;
 20 }
 21 #float {
 22 width: 50px;
 23 height: 50px;
 24 float: left;
 25 margin-left: 50px;
 26 background-color: yellow;
 27 }
 28 #overflow {
 29 width: 200px;
 30 margin-top: 40px;
 31 text-align: left;
 32 }
 33</style>
 34</head>
 35<body>
 36 <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg">
 37 <polygon points="0,0 200,0 200,200" fill="#636363"></polygon>
 38 </svg>
 39 <div id="shape-inside">
 40 <div id="float"></div>
 41 <br/>X&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>
 42 X X X&nbsp;<br/><br/>
 43 XXXX<br/><br/>
 44 X&nbsp;<br/>
 45 <div id="overflow">X X X X X X</div>
 46 </div>
 47 <p style="margin-top: 250px;">
 48 There is a triangle shape-inside (represented by the matching filled SVG polygon), the shape-inside contains a 50x50px yellow float left,
 49 the float should be at the very left and top position inside the triangle shape where it fits first. The block content with inline content
 50 (paragraphs) should wrap around the float inside the shape. The overflow should be pushed under the triangle shape-inside.
 51 </p>
 52 <p>Bug <a href="http://webkit.org/b/121616">121616</a>: [CSS Shapes] Support block content with inline content around floats in shape-inside</p>
 53</body>
 54</html>

LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<style>
 5 #polygon-svg-shape {
 6 position: absolute;
 7 left: 0px;
 8 top: 0px;
 9 }
 10 #shape-inside {
 11 font: 20px Ahem, sans-serif;
 12 -webkit-font-smoothing: none;
 13 line-height: 20px;
 14 width: 200px;
 15 height: 200px;
 16 position: absolute;
 17 left: 0px;
 18 top: 0px;
 19 -webkit-shape-inside: polygon(0px 0px, 200px 0px, 200px 200px);
 20 }
 21 #float {
 22 width: 50px;
 23 height: 50px;
 24 float: left;
 25 background-color: yellow;
 26 }
 27</style>
 28</head>
 29<body>
 30 <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg">
 31 <polygon points="0,0 200,0 200,200" fill="#636363"></polygon>
 32 </svg>
 33 <div id="shape-inside">
 34 <div id="float"></div><p>X</p><p>X X X <p>XXXX</p> X</p><p> X X X X X X</p>
 35 </div>
 36 <p style="margin-top: 250px;">
 37 There is a triangle shape-inside (represented by the matching filled SVG polygon), the shape-inside contains a 50x50px yellow float left,
 38 the float should be at the very left and top position inside the triangle shape where it fits first. The block content with inline content
 39 (paragraphs) should wrap around the float inside the shape. The overflow should be pushed under the triangle shape-inside.
 40 </p>
 41 <p>Bug <a href="http://webkit.org/b/121616">121616</a>: [CSS Shapes] Support block content with inline content around floats in shape-inside</p>
 42</body>
 43</html>

Source/WebCore/ChangeLog

 12013-10-01 Zoltan Horvath <zoltan@webkit.org>
 2
 3 [CSS Shapes] Support block content with inline content around floats in shape-inside
 4 https://bugs.webkit.org/show_bug.cgi?id=121616
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 In r156022 and r156364, I added support for floats inside shape-inside with inline content. This change extends
 9 the existing implementation to support block content with inline content (paragraphs). I added an extra text for
 10 positioning a float inside shape-inside without text content around it.
 11
 12 Tests: fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content.html
 13 fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content.html
 14 fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle.html
 15 fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content.html
 16 fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content.html
 17
 18 * rendering/FloatingObjects.h:
 19 (WebCore::FloatingObject::logicalSize): Add new function to return the FloatingObject logical size.
 20 * rendering/LineWidth.cpp:
 21 (WebCore::LineWidth::fitBelowFloats): When the lineBreaker code pushes down the content below the floating object,
 22 we need to update the segments if we are in a shape-inside.
 23 * rendering/RenderBlock.cpp:
 24 (WebCore::RenderBlock::computeLogicalLocationForFloat): Do the positioning based on the float actual size, and use the
 25 recent shapeInsideInfo. (Calling layoutShapeInsideInfo which deals with the layoutStates also instead of shapeInsideInfo.)
 26 * rendering/RenderBlock.h:
 27 * rendering/RenderBlockLineLayout.cpp:
 28 (WebCore::RenderBlock::adjustLogicalLineTopAndLogicalHeightIfNeeded): If we don't have inline content we still need to positionize
 29 our float content in a shape-inside.
 30 (WebCore::updateSegmentsForShapes): Use the right coordinates for block content with inline content.
 31
1322013-09-30 Mark Rowe <mrowe@apple.com>
233
334 Fix the build when building against an SDK.

Source/WebCore/rendering/FloatingObjects.h

@@public:
9292 LayoutUnit logicalRight(bool isHorizontalWritingMode) const { return isHorizontalWritingMode ? maxX() : maxY(); }
9393 LayoutUnit logicalWidth(bool isHorizontalWritingMode) const { return isHorizontalWritingMode ? width() : height(); }
9494 LayoutUnit logicalHeight(bool isHorizontalWritingMode) const { return isHorizontalWritingMode ? height() : width(); }
 95 LayoutSize logicalSize(bool isHorizontalWritingMode) const { return isHorizontalWritingMode ? LayoutSize(width(), height()) : LayoutSize(height(), width()); }
9596
9697 int pixelSnappedLogicalTop(bool isHorizontalWritingMode) const { return isHorizontalWritingMode ? frameRect().pixelSnappedY() : frameRect().pixelSnappedX(); }
9798 int pixelSnappedLogicalBottom(bool isHorizontalWritingMode) const { return isHorizontalWritingMode ? frameRect().pixelSnappedMaxY() : frameRect().pixelSnappedMaxX(); }

Source/WebCore/rendering/LineWidth.cpp

@@void LineWidth::fitBelowFloats()
206206 newLineRight = m_block.logicalRightOffsetForLine(floatLogicalBottom, shouldIndentText());
207207 newLineWidth = max(0.0f, newLineRight - newLineLeft);
208208 lastFloatLogicalBottom = floatLogicalBottom;
 209
 210#if ENABLE(CSS_SHAPES)
 211 // FIXME: This code should be refactored to incorporate with the code above.
 212 ShapeInsideInfo* shapeInsideInfo = m_block.layoutShapeInsideInfo();
 213 if (shapeInsideInfo) {
 214 LayoutUnit logicalOffsetFromShapeContainer = m_block.logicalOffsetFromShapeAncestorContainer(shapeInsideInfo->owner()).height();
 215 LayoutUnit lineHeight = m_block.lineHeight(false, m_block.isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
 216 shapeInsideInfo->updateSegmentsForLine(lastFloatLogicalBottom + logicalOffsetFromShapeContainer, lineHeight);
 217 updateCurrentShapeSegment();
 218 updateAvailableWidth();
 219 }
 220#endif
209221 if (newLineWidth >= m_uncommittedWidth)
210222 break;
211223 }

Source/WebCore/rendering/RenderBlock.cpp

@@LayoutPoint RenderBlock::computeLogicalLocationForFloat(const FloatingObject* fl
33653365 LayoutUnit logicalRightOffset; // Constant part of right offset.
33663366#if ENABLE(CSS_SHAPES)
33673367 // FIXME Bug 102948: This only works for shape outside directly set on this block.
3368  ShapeInsideInfo* shapeInsideInfo = this->shapeInsideInfo();
 3368 ShapeInsideInfo* shapeInsideInfo = this->layoutShapeInsideInfo();
33693369 // FIXME: Implement behavior for right floats.
33703370 if (shapeInsideInfo) {
3371  LayoutSize floatLogicalSize = LayoutSize(floatingObject->logicalWidth(isHorizontalWritingMode()), floatingObject->logicalHeight(isHorizontalWritingMode()));
 3371 LayoutSize floatLogicalSize = LayoutSize(childBox->logicalWidth(), childBox->logicalHeight());
33723372 // FIXME: If the float doesn't fit in the shape we should push it under the content box
33733373 logicalTopOffset = shapeInsideInfo->computeFirstFitPositionForFloat(floatLogicalSize);
33743374 if (logicalHeight() > logicalTopOffset)

Source/WebCore/rendering/RenderBlock.h

@@public:
445445 void markShapeInsideDescendantsForLayout();
446446 ShapeInsideInfo* layoutShapeInsideInfo() const;
447447 bool allowsShapeInsideInfoSharing() const { return !isInline() && !isFloating(); }
 448 LayoutSize logicalOffsetFromShapeAncestorContainer(const RenderBlock* container) const;
448449 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) OVERRIDE;
449450#endif
450451

@@private:
547548 void computeShapeSize();
548549 void updateShapeInsideInfoAfterStyleChange(const ShapeValue*, const ShapeValue* oldShape);
549550 void relayoutShapeDescendantIfMoved(RenderBlock* child, LayoutSize offset);
550  LayoutSize logicalOffsetFromShapeAncestorContainer(const RenderBlock* container) const;
551551#endif
552552
553553 virtual const char* renderName() const OVERRIDE;

Source/WebCore/rendering/RenderBlockLineLayout.cpp

@@void RenderBlock::updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsideIn
14781478bool RenderBlock::adjustLogicalLineTopAndLogicalHeightIfNeeded(ShapeInsideInfo* shapeInsideInfo, LayoutUnit absoluteLogicalTop, LineLayoutState& layoutState, InlineBidiResolver& resolver, FloatingObject* lastFloatFromPreviousLine, InlineIterator& end, WordMeasurements& wordMeasurements)
14791479{
14801480 LayoutUnit adjustedLogicalLineTop = adjustLogicalLineTop(shapeInsideInfo, resolver.position(), end, wordMeasurements);
 1481
 1482 if (shapeInsideInfo && !wordMeasurements.size() && containsFloats()) {
 1483 lastFloatFromPreviousLine = m_floatingObjects->set().last().get();
 1484 LayoutUnit floatLogicalTopOffset = shapeInsideInfo->computeFirstFitPositionForFloat(lastFloatFromPreviousLine->logicalSize(isHorizontalWritingMode()));
 1485 if (logicalHeight() < floatLogicalTopOffset)
 1486 adjustedLogicalLineTop = floatLogicalTopOffset;
 1487 }
 1488
14811489 if (!adjustedLogicalLineTop)
14821490 return false;
14831491

@@static void updateSegmentsForShapes(RenderBlock* block, const FloatingObject* la
26492657 ASSERT(lastFloatFromPreviousLine);
26502658
26512659 ShapeInsideInfo* shapeInsideInfo = block->layoutShapeInsideInfo();
2652  if (!shapeInsideInfo)
 2660 if (!lastFloatFromPreviousLine->isPlaced() || !shapeInsideInfo)
26532661 return;
26542662
26552663 bool isHorizontalWritingMode = block->isHorizontalWritingMode();
 2664 LayoutUnit logicalOffsetFromShapeContainer = block->logicalOffsetFromShapeAncestorContainer(shapeInsideInfo->owner()).height();
26562665
2657  LayoutUnit lineLogicalTop = block->logicalHeight();
 2666 LayoutUnit lineLogicalTop = block->logicalHeight() + logicalOffsetFromShapeContainer;
26582667 LayoutUnit lineLogicalHeight = block->lineHeight(isFirstLine, isHorizontalWritingMode ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
26592668 LayoutUnit lineLogicalBottom = lineLogicalTop + lineLogicalHeight;
26602669

@@static void updateSegmentsForShapes(RenderBlock* block, const FloatingObject* la
26742683
26752684 if (block->logicalHeight() < floatLogicalTop) {
26762685 shapeInsideInfo->adjustLogicalLineTop(minSegmentWidth + floatLogicalWidth);
2677  block->setLogicalHeight(shapeInsideInfo->logicalLineTop());
 2686 block->setLogicalHeight(shapeInsideInfo->logicalLineTop() - logicalOffsetFromShapeContainer);
26782687 }
26792688
2680  shapeInsideInfo->updateSegmentsForLine(block->logicalHeight(), lineLogicalHeight);
 2689 lineLogicalTop = block->logicalHeight() + logicalOffsetFromShapeContainer;
 2690
 2691 shapeInsideInfo->updateSegmentsForLine(lineLogicalTop, lineLogicalHeight);
26812692 width.updateCurrentShapeSegment();
26822693 width.updateAvailableWidth();
26832694}