Title: [161384] trunk
Revision
161384
Author
[email protected]
Date
2014-01-06 16:42:41 -0800 (Mon, 06 Jan 2014)

Log Message

[CSS Regions][CSS Shapes] ASSERTION FAILED: m_segmentRanges.size() < m_segments.size()
https://bugs.webkit.org/show_bug.cgi?id=125770

Reviewed by Bem Jones-Bey.

Source/WebCore:

When we have an e.g. up-side-down triangle, when the content doesn't fit in the bottom part of the shape,
and the adjusted content flows into the next region with a shape, we need to update the actual shape
and region. Since it wasn't updated, it led to a shape mismatch, which led to assert/layout error.

Test: fast/regions/shape-inside/shape-inside-on-multiple-regions-bottom-adjustment.html

* rendering/RenderBlockLineLayout.cpp:
(WebiCore::RenderBlockFlow::updateShapeAndSegmentsForCurrentLineInFlowThread): Update current shape
and region, when adjustment occured.

LayoutTests:

* fast/regions/shape-inside/shape-inside-on-multiple-regions-bottom-adjustment-expected.html: Added.
* fast/regions/shape-inside/shape-inside-on-multiple-regions-bottom-adjustment.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (161383 => 161384)


--- trunk/LayoutTests/ChangeLog	2014-01-07 00:35:25 UTC (rev 161383)
+++ trunk/LayoutTests/ChangeLog	2014-01-07 00:42:41 UTC (rev 161384)
@@ -1,3 +1,13 @@
+2014-01-06  Zoltan Horvath  <[email protected]>
+
+        [CSS Regions][CSS Shapes] ASSERTION FAILED: m_segmentRanges.size() < m_segments.size()
+        https://bugs.webkit.org/show_bug.cgi?id=125770
+
+        Reviewed by Bem Jones-Bey.
+
+        * fast/regions/shape-inside/shape-inside-on-multiple-regions-bottom-adjustment-expected.html: Added.
+        * fast/regions/shape-inside/shape-inside-on-multiple-regions-bottom-adjustment.html: Added.
+
 2014-01-06  Brent Fulgham  <[email protected]>
 
         Unreviewed test correction.

Added: trunk/LayoutTests/fast/regions/shape-inside/shape-inside-on-multiple-regions-bottom-adjustment-expected.html (0 => 161384)


--- trunk/LayoutTests/fast/regions/shape-inside/shape-inside-on-multiple-regions-bottom-adjustment-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/regions/shape-inside/shape-inside-on-multiple-regions-bottom-adjustment-expected.html	2014-01-07 00:42:41 UTC (rev 161384)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.region {
+    width: 100px;
+    height: 100px;
+    margin-top: 10px;
+    background-color: #CCD8D4;
+}
+
+.page {
+    font: 20px/1 Ahem, sans-serif;
+}
+</style>
+</head>
+
+<body>
+    <div class="page">
+        <div class="region">
+            <span style="margin-left: 30px;"></span>X X<br/>
+            <span style="margin-left: 35px;"></span>X<br/>
+            <span style="margin-left: 40px;"></span>X
+        </div>
+        <div class="region">
+            <span style="margin-left: 30px;"></span>X X<br/>
+            <span style="margin-left: 35px;"></span>X<br/>
+            <span style="margin-left: 40px;"></span>X
+        </div>
+        X X
+    </div>
+    <p style="margin-top: 20px;">
+        Requires Ahem font. We have two regions, an up-side-down triangular shape is applied on the regions.
+        The content should flow from the first shape to the second shape. The overflow should be pushed down below the content box.
+    </p>
+    <p>Bug <a href="" [CSS Regions][CSS Shapes] ASSERTION FAILED: m_segmentRanges.size() < m_segments.size()</p>
+</body>
+</html>

Added: trunk/LayoutTests/fast/regions/shape-inside/shape-inside-on-multiple-regions-bottom-adjustment.html (0 => 161384)


--- trunk/LayoutTests/fast/regions/shape-inside/shape-inside-on-multiple-regions-bottom-adjustment.html	                        (rev 0)
+++ trunk/LayoutTests/fast/regions/shape-inside/shape-inside-on-multiple-regions-bottom-adjustment.html	2014-01-07 00:42:41 UTC (rev 161384)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.region {
+    width: 100px;
+    height: 100px;
+    margin-top: 10px;
+    background-color: #CCD8D4;
+    -webkit-shape-inside: polygon(25px 0px, 100px 0px, 50px 100px);
+}
+
+.content {
+    font: 20px/1 Ahem, sans-serif;
+    -webkit-flow-into: flow;
+}
+
+.region { -webkit-flow-from: flow; }
+</style>
+</head>
+
+<body>
+    <div class="content">X X X X X X X X X X</div>
+
+    <div class="page">
+        <div class="region"></div>
+        <div class="region"></div>
+    </div>
+    <p style="margin-top: 40px;">
+        Requires Ahem font. We have two regions, an up-side-down triangular shape is applied on the regions.
+        The content should flow from the first shape to the second shape. The overflow should be pushed down below the content box.
+    </p>
+    <p>Bug <a href="" [CSS Regions][CSS Shapes] ASSERTION FAILED: m_segmentRanges.size() < m_segments.size()</p>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (161383 => 161384)


--- trunk/Source/WebCore/ChangeLog	2014-01-07 00:35:25 UTC (rev 161383)
+++ trunk/Source/WebCore/ChangeLog	2014-01-07 00:42:41 UTC (rev 161384)
@@ -1,3 +1,20 @@
+2014-01-06  Zoltan Horvath  <[email protected]>
+
+        [CSS Regions][CSS Shapes] ASSERTION FAILED: m_segmentRanges.size() < m_segments.size()
+        https://bugs.webkit.org/show_bug.cgi?id=125770
+
+        Reviewed by Bem Jones-Bey.
+
+        When we have an e.g. up-side-down triangle, when the content doesn't fit in the bottom part of the shape,
+        and the adjusted content flows into the next region with a shape, we need to update the actual shape
+        and region. Since it wasn't updated, it led to a shape mismatch, which led to assert/layout error.
+
+        Test: fast/regions/shape-inside/shape-inside-on-multiple-regions-bottom-adjustment.html
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebiCore::RenderBlockFlow::updateShapeAndSegmentsForCurrentLineInFlowThread): Update current shape
+        and region, when adjustment occured.
+
 2014-01-06  Seokju Kwon  <[email protected]>
 
         Web Inspector: Get rid of Inspector/BindingVisitors.h

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (161383 => 161384)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2014-01-07 00:35:25 UTC (rev 161383)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2014-01-07 00:42:41 UTC (rev 161384)
@@ -1168,7 +1168,8 @@
         shapeBottomInFlowThread = shapeInsideInfo->shapeLogicalBottom() + currentRegion->logicalTopForFlowThreadContent();
 
     bool lineOverLapsWithShapeBottom = shapeBottomInFlowThread < logicalLineBottomInFlowThread;
-    bool lineOverLapsWithRegionBottom = logicalLineBottomInFlowThread > logicalRegionBottomInFlowThread;
+    bool lineTopAdjustedIntoNextRegion = layoutState.adjustedLogicalLineTop() >= currentRegion->logicalHeight();
+    bool lineOverLapsWithRegionBottom = logicalLineBottomInFlowThread > logicalRegionBottomInFlowThread || lineTopAdjustedIntoNextRegion;
     bool overFlowsToNextRegion = nextRegion && (lineOverLapsWithShapeBottom || lineOverLapsWithRegionBottom);
 
     // If the line is between two shapes/regions we position the line to the top of the next shape/region
@@ -1184,6 +1185,9 @@
         logicalLineBottomInFlowThread = logicalLineTopInFlowThread + lineHeight;
         logicalRegionTopInFlowThread = currentRegion->logicalTopForFlowThreadContent();
         logicalRegionBottomInFlowThread = logicalRegionTopInFlowThread + currentRegion->logicalHeight() - currentRegion->borderAndPaddingBefore() - currentRegion->borderAndPaddingAfter();
+
+        if (lineTopAdjustedIntoNextRegion)
+            layoutState.setAdjustedLogicalLineTop(0);
     }
 
     if (!shapeInsideInfo)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to