Title: [270240] trunk/Source/WebCore
Revision
270240
Author
[email protected]
Date
2020-11-30 07:00:28 -0800 (Mon, 30 Nov 2020)

Log Message

[LFC][IFC] Preferred width computation is not constrained by existing floats
https://bugs.webkit.org/show_bug.cgi?id=219338

Reviewed by Antti Koivisto.

Let's create a fake(empty) floating state/context for the line as existing floats should not constrain the min/max content widths.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (270239 => 270240)


--- trunk/Source/WebCore/ChangeLog	2020-11-30 14:59:43 UTC (rev 270239)
+++ trunk/Source/WebCore/ChangeLog	2020-11-30 15:00:28 UTC (rev 270240)
@@ -1,5 +1,17 @@
 2020-11-30  Zalan Bujtas  <[email protected]>
 
+        [LFC][IFC] Preferred width computation is not constrained by existing floats
+        https://bugs.webkit.org/show_bug.cgi?id=219338
+
+        Reviewed by Antti Koivisto.
+
+        Let's create a fake(empty) floating state/context for the line as existing floats should not constrain the min/max content widths.
+
+        * layout/inlineformatting/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
+
+2020-11-30  Zalan Bujtas  <[email protected]>
+
         [LFC][TFC] Add missing TableGrid::Row::m_baseline initialization
         https://bugs.webkit.org/show_bug.cgi?id=219336
 

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp (270239 => 270240)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2020-11-30 14:59:43 UTC (rev 270239)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2020-11-30 15:00:28 UTC (rev 270240)
@@ -261,10 +261,12 @@
 InlineLayoutUnit InlineFormattingContext::computedIntrinsicWidthForConstraint(InlineLayoutUnit availableWidth) const
 {
     auto& inlineItems = formattingState().inlineItems();
-    auto maximumLineWidth = InlineLayoutUnit { };
-    auto floatingContext = FloatingContext { *this, formattingState().floatingState() };
+    // Preferred width computation is not constrained by floats. 
+    auto floatingState = FloatingState::create(layoutState(), root());
+    auto floatingContext = FloatingContext { *this, floatingState };
     auto lineBuilder = LineBuilder { *this, floatingContext, root(), inlineItems };
     auto layoutRange = LineBuilder::InlineItemRange { 0 , inlineItems.size() };
+    auto maximumLineWidth = InlineLayoutUnit { };
     while (!layoutRange.isEmpty()) {
         auto intrinsicContent = lineBuilder.computedIntrinsicWidth(layoutRange, availableWidth);
         layoutRange.start = intrinsicContent.inlineItemRange.end;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to