[CSS Regions][CSS Shapes] Update updateShapeAndSegmentsForCurrentLineInFlowThread...
authorzoltan@webkit.org <zoltan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Oct 2013 17:26:35 +0000 (17:26 +0000)
committerzoltan@webkit.org <zoltan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Oct 2013 17:26:35 +0000 (17:26 +0000)
<https://bugs.webkit.org/show_bug.cgi?id=123275>

Reviewed by David Hyatt.

We have a complex condition in updateShapeAndSegmentsForCurrentLineInFlowThread, which is
adjusting the first line to the shape's top. This patch adds two boolean to make that clear.

No new tests, no behavior change.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateShapeAndSegmentsForCurrentLineInFlowThread):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158015 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlockLineLayout.cpp

index fc3c22c..06cf938 100644 (file)
@@ -1,3 +1,18 @@
+2013-10-25  Zoltan Horvath  <zoltan@webkit.org>
+
+        [CSS Regions][CSS Shapes] Update updateShapeAndSegmentsForCurrentLineInFlowThread to deal better with the first lines
+        <https://bugs.webkit.org/show_bug.cgi?id=123275>
+
+        Reviewed by David Hyatt.
+
+        We have a complex condition in updateShapeAndSegmentsForCurrentLineInFlowThread, which is
+        adjusting the first line to the shape's top. This patch adds two boolean to make that clear.
+
+        No new tests, no behavior change.
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlockFlow::updateShapeAndSegmentsForCurrentLineInFlowThread):
+
 2013-10-25  Antti Koivisto  <antti@apple.com>
 
         Faster way for simple line layout to check if text has fallback fonts
index 23296c6..ccacbad 100644 (file)
@@ -1436,8 +1436,10 @@ void RenderBlockFlow::updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsi
     if (!shapeInsideInfo)
         return;
 
+    bool isFirstLineInRegion = logicalLineBottomInFlowThread <= (logicalRegionTopInFlowThread + lineHeight);
+    bool isFirstLineAdjusted = (logicalLineTopInFlowThread - logicalRegionTopInFlowThread) < (layoutState.adjustedLogicalLineTop() - currentRegion->borderAndPaddingBefore());
     // We position the first line to the top of the shape in the region or to the previously adjusted position in the shape
-    if (logicalLineBottomInFlowThread <= (logicalRegionTopInFlowThread + lineHeight) || (logicalLineTopInFlowThread - logicalRegionTopInFlowThread) < (layoutState.adjustedLogicalLineTop() - currentRegion->borderAndPaddingBefore())) {
+    if (isFirstLineInRegion || isFirstLineAdjusted) {
         LayoutUnit shapeTopOffset = layoutState.adjustedLogicalLineTop();
         if (!shapeTopOffset)
             shapeTopOffset = shapeInsideInfo->shapeLogicalTop();