Title: [278303] trunk/Source/WebCore
Revision
278303
Author
[email protected]
Date
2021-06-01 06:43:06 -0700 (Tue, 01 Jun 2021)

Log Message

[LFC][TFC][Quirks] heightValueOfNearestContainingBlockWithFixedHeight should not need to cross formatting context boundary
https://bugs.webkit.org/show_bug.cgi?id=226470

Reviewed by Antti Koivisto.

Now that the incoming vertical constraint is applied properly for the cell layout, we don't need to cross
the formatting context boundary in heightValueOfNearestContainingBlockWithFixedHeight to check if the table
box has fixed height value.

* layout/formattingContexts/table/TableFormattingQuirks.cpp:
(WebCore::Layout::TableFormattingQuirks::heightValueOfNearestContainingBlockWithFixedHeight const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (278302 => 278303)


--- trunk/Source/WebCore/ChangeLog	2021-06-01 13:01:01 UTC (rev 278302)
+++ trunk/Source/WebCore/ChangeLog	2021-06-01 13:43:06 UTC (rev 278303)
@@ -1,3 +1,17 @@
+2021-06-01  Alan Bujtas  <[email protected]>
+
+        [LFC][TFC][Quirks] heightValueOfNearestContainingBlockWithFixedHeight should not need to cross formatting context boundary
+        https://bugs.webkit.org/show_bug.cgi?id=226470
+
+        Reviewed by Antti Koivisto.
+
+        Now that the incoming vertical constraint is applied properly for the cell layout, we don't need to cross
+        the formatting context boundary in heightValueOfNearestContainingBlockWithFixedHeight to check if the table
+        box has fixed height value.
+
+        * layout/formattingContexts/table/TableFormattingQuirks.cpp:
+        (WebCore::Layout::TableFormattingQuirks::heightValueOfNearestContainingBlockWithFixedHeight const):
+
 2021-05-27  Sergio Villar Senin  <[email protected]>
 
         Improve if condition in RenderReplaced::computeReplacedLogicalWidth

Modified: trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingQuirks.cpp (278302 => 278303)


--- trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingQuirks.cpp	2021-06-01 13:01:01 UTC (rev 278302)
+++ trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingQuirks.cpp	2021-06-01 13:43:06 UTC (rev 278303)
@@ -62,21 +62,10 @@
     // The "let's find the nearest ancestor with fixed height to resolve percent height" quirk is limited to the table formatting
     // context. If we can't resolve it within the table subtree, we default it to 0.
     // e.g <div style="height: 100px"><table><tr><td style="height: 100%"></td></tr></table></div> is resolved to 0px.
-    auto& tableBox = formattingContext().root();
-    auto fixedLogicalHeight = [&](const auto& ancestorBox) -> std::optional<LayoutUnit> {
-        auto height = ancestorBox.style().logicalHeight();
-        if (!height.isFixed())
-            return { };
-        if (&ancestorBox != &tableBox)
+    for (auto& ancestor : containingBlockChainWithinFormattingContext(layoutBox)) {
+        auto height = ancestor.style().logicalHeight();
+        if (height.isFixed())
             return LayoutUnit { height.value() };
-        auto& grid = formattingContext().formattingState().tableGrid();
-        auto verticalSpacing = grid.verticalSpacing();
-        return LayoutUnit { height.value() - ((grid.rows().size() + 1) * verticalSpacing) };
-    };
-
-    for (auto& ancestor : containingBlockChain(layoutBox, tableBox.containingBlock())) {
-        if (auto fixedHeight = fixedLogicalHeight(ancestor))
-            return *fixedHeight;
     }
     return { };
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to