Title: [267967] trunk/Source/WebCore
Revision
267967
Author
za...@apple.com
Date
2020-10-05 08:28:32 -0700 (Mon, 05 Oct 2020)

Log Message

[LFC][Integration] Enable non-uniform line height content with floats
https://bugs.webkit.org/show_bug.cgi?id=217306

Reviewed by Antti Koivisto.

Expand coverage now that we support non-uniform line heights.

* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (267966 => 267967)


--- trunk/Source/WebCore/ChangeLog	2020-10-05 14:57:53 UTC (rev 267966)
+++ trunk/Source/WebCore/ChangeLog	2020-10-05 15:28:32 UTC (rev 267967)
@@ -1,3 +1,15 @@
+2020-10-05  Zalan Bujtas  <za...@apple.com>
+
+        [LFC][Integration] Enable non-uniform line height content with floats
+        https://bugs.webkit.org/show_bug.cgi?id=217306
+
+        Reviewed by Antti Koivisto.
+
+        Expand coverage now that we support non-uniform line heights.
+
+        * layout/integration/LayoutIntegrationCoverage.cpp:
+        (WebCore::LayoutIntegration::canUseForLineLayoutWithReason):
+
 2020-10-05  Alex Christensen  <achristen...@webkit.org>
 
         Unify linkedOnOrAfter duplicate code and use SPI/WebCoreTestSupport instead of NSUserDefaults

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp (267966 => 267967)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2020-10-05 14:57:53 UTC (rev 267966)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2020-10-05 15:28:32 UTC (rev 267967)
@@ -319,20 +319,12 @@
         ADD_REASONS_AND_RETURN_IF_NEEDED(styleReasons, reasons, includeReasons);
     // We can't use the code path if any lines would need to be shifted below floats. This is because we don't keep per-line y coordinates.
     if (flow.containsFloats()) {
-        float minimumWidthNeeded = std::numeric_limits<float>::max();
-        for (const auto& textRenderer : childrenOfType<RenderText>(flow)) {
-            minimumWidthNeeded = std::min(minimumWidthNeeded, textRenderer.minLogicalWidth());
-
-            for (auto& floatingObject : *flow.floatingObjectSet()) {
-                ASSERT(floatingObject);
-                // if a float has a shape, we cannot tell if content will need to be shifted until after we lay it out,
-                // since the amount of space is not uniform for the height of the float.
-                if (floatingObject->renderer().shapeOutsideInfo())
-                    SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedFloat, reasons, includeReasons);
-                float availableWidth = flow.availableLogicalWidthForLine(floatingObject->y(), DoNotIndentText);
-                if (availableWidth < minimumWidthNeeded)
-                    SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedFloat, reasons, includeReasons);
-            }
+        for (auto& floatingObject : *flow.floatingObjectSet()) {
+            ASSERT(floatingObject);
+            // if a float has a shape, we cannot tell if content will need to be shifted until after we lay it out,
+            // since the amount of space is not uniform for the height of the float.
+            if (floatingObject->renderer().shapeOutsideInfo())
+                SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedFloat, reasons, includeReasons);
         }
     }
     auto fontAndTextReasons = canUseForFontAndText(flow, includeReasons);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to