Title: [238736] trunk/Source/WebCore
Revision
238736
Author
[email protected]
Date
2018-11-30 07:24:11 -0800 (Fri, 30 Nov 2018)

Log Message

[LFC][BFC] Geometry::inFlowNonReplacedHeightAndMargin should check for empty inline formatting context.
https://bugs.webkit.org/show_bug.cgi?id=192215

Reviewed by Antti Koivisto.

Check if the inline formatting context actually has any lines.

* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (238735 => 238736)


--- trunk/Source/WebCore/ChangeLog	2018-11-30 15:22:39 UTC (rev 238735)
+++ trunk/Source/WebCore/ChangeLog	2018-11-30 15:24:11 UTC (rev 238736)
@@ -1,5 +1,17 @@
 2018-11-30  Zalan Bujtas  <[email protected]>
 
+        [LFC][BFC] Geometry::inFlowNonReplacedHeightAndMargin should check for empty inline formatting context.
+        https://bugs.webkit.org/show_bug.cgi?id=192215
+
+        Reviewed by Antti Koivisto.
+
+        Check if the inline formatting context actually has any lines.
+
+        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
+        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
+
+2018-11-30  Zalan Bujtas  <[email protected]>
+
         [LFC][BFC][MarginCollapsing] Do not use computed display box values for border and padding
         https://bugs.webkit.org/show_bug.cgi?id=192214
 

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp (238735 => 238736)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp	2018-11-30 15:22:39 UTC (rev 238735)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp	2018-11-30 15:24:11 UTC (rev 238736)
@@ -76,8 +76,9 @@
         // 1. the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines
         if (layoutBox.establishesInlineFormattingContext()) {
             // This is temp and will be replaced by the correct display box once inline runs move over to the display tree.
-            auto& lastInlineRun = downcast<InlineFormattingState>(layoutState.establishedFormattingState(layoutBox)).inlineRuns().last();
-            return { lastInlineRun.logicalBottom(), nonCollapsedMargin, collapsedMargin };
+            auto& inlineRuns = downcast<InlineFormattingState>(layoutState.establishedFormattingState(layoutBox)).inlineRuns();
+            auto bottomEdge = inlineRuns.isEmpty() ? LayoutUnit() : inlineRuns.last().logicalBottom();
+            return { bottomEdge, nonCollapsedMargin, collapsedMargin };
         }
 
         // 2. the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom margin...
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to