Title: [289734] trunk/Source/WebCore
Revision
289734
Author
za...@apple.com
Date
2022-02-14 06:37:48 -0800 (Mon, 14 Feb 2022)

Log Message

[LFC][IFC] Fix fast/block/float/float-with-fractional-height-vertical-lr.html
https://bugs.webkit.org/show_bug.cgi?id=236576

Reviewed by Antti Koivisto.

Let's translate the incoming float boxes' visual coordinates to logical for line layout.

* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::prepareFloatingState):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (289733 => 289734)


--- trunk/Source/WebCore/ChangeLog	2022-02-14 14:06:38 UTC (rev 289733)
+++ trunk/Source/WebCore/ChangeLog	2022-02-14 14:37:48 UTC (rev 289734)
@@ -1,3 +1,15 @@
+2022-02-14  Alan Bujtas  <za...@apple.com>
+
+        [LFC][IFC] Fix fast/block/float/float-with-fractional-height-vertical-lr.html
+        https://bugs.webkit.org/show_bug.cgi?id=236576
+
+        Reviewed by Antti Koivisto.
+
+        Let's translate the incoming float boxes' visual coordinates to logical for line layout.
+
+        * layout/integration/LayoutIntegrationLineLayout.cpp:
+        (WebCore::LayoutIntegration::LineLayout::prepareFloatingState):
+
 2022-02-14  Martin Robinson  <mrobin...@webkit.org>
 
         Animation from "scale()" to "scale() translate()" does not yield the expected result

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (289733 => 289734)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2022-02-14 14:06:38 UTC (rev 289733)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2022-02-14 14:37:48 UTC (rev 289734)
@@ -379,7 +379,7 @@
         return;
 
     for (auto& floatingObject : *flow().floatingObjectSet()) {
-        auto& rect = floatingObject->frameRect();
+        auto& visualRect = floatingObject->frameRect();
         auto position = floatingObject->type() == FloatingObject::FloatRight
             ? Layout::FloatingState::FloatItem::Position::Right
             : Layout::FloatingState::FloatItem::Position::Left;
@@ -386,11 +386,14 @@
         auto boxGeometry = Layout::BoxGeometry { };
         // FIXME: We are flooring here for legacy compatibility.
         //        See FloatingObjects::intervalForFloatingObject and RenderBlockFlow::clearFloats.
-        auto y = rect.y().floor();
-        auto maxY = rect.maxY().floor();
-        boxGeometry.setLogicalTopLeft({ rect.x(), y });
-        boxGeometry.setContentBoxWidth(rect.width());
-        boxGeometry.setContentBoxHeight(maxY - y);
+        auto logicalTop = visualRect.y().floor();
+        auto logicalHeight = visualRect.maxY().floor() - logicalTop;
+        auto logicalRect = flow().style().isHorizontalWritingMode() ? LayoutRect(visualRect.x(), logicalTop, visualRect.width(), logicalHeight)
+            : LayoutRect(logicalTop, visualRect.x(), logicalHeight, visualRect.width());
+
+        boxGeometry.setLogicalTopLeft(logicalRect.location());
+        boxGeometry.setContentBoxWidth(logicalRect.width());
+        boxGeometry.setContentBoxHeight(logicalRect.height());
         boxGeometry.setBorder({ });
         boxGeometry.setPadding({ });
         boxGeometry.setHorizontalMargin({ });
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to