Title: [260948] trunk/Source/WebCore
Revision
260948
Author
[email protected]
Date
2020-04-30 06:55:35 -0700 (Thu, 30 Apr 2020)

Log Message

[LFC][TFC] Adjust the available vertical space with the row span for cell layout
https://bugs.webkit.org/show_bug.cgi?id=211218

Reviewed by Antti Koivisto.

The vertical available space for a cell should include all row heights it spans.
(can't include test, current table layout logic is incompatible with LFC -and FF/Chrome.)

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (260947 => 260948)


--- trunk/Source/WebCore/ChangeLog	2020-04-30 13:38:40 UTC (rev 260947)
+++ trunk/Source/WebCore/ChangeLog	2020-04-30 13:55:35 UTC (rev 260948)
@@ -1,3 +1,16 @@
+2020-04-30  Zalan Bujtas  <[email protected]>
+
+        [LFC][TFC] Adjust the available vertical space with the row span for cell layout
+        https://bugs.webkit.org/show_bug.cgi?id=211218
+
+        Reviewed by Antti Koivisto.
+
+        The vertical available space for a cell should include all row heights it spans.
+        (can't include test, current table layout logic is incompatible with LFC -and FF/Chrome.)
+
+        * layout/tableformatting/TableFormattingContext.cpp:
+        (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
+
 2020-04-30  Philippe Normand  <[email protected]>
 
         [SOUP] http/tests/media/video-accept-encoding.html fails

Modified: trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp (260947 => 260948)


--- trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp	2020-04-30 13:38:40 UTC (rev 260947)
+++ trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp	2020-04-30 13:55:35 UTC (rev 260948)
@@ -74,8 +74,10 @@
         auto& cellDisplayBox = formattingState().displayBox(cellBox);
         cellDisplayBox.setTop(rowList[cell->startRow()].logicalTop());
         cellDisplayBox.setLeft(columnList[cell->startColumn()].logicalLeft());
-        auto rowHeight = rowList[cell->startRow()].logicalHeight();
-        layoutCell(*cell, availableHorizontalSpace, rowHeight);
+        auto availableVerticalSpace = rowList[cell->startRow()].logicalHeight();
+        for (size_t rowIndex = cell->startRow() + 1; rowIndex < cell->endRow(); ++rowIndex)
+            availableVerticalSpace += rowList[rowIndex].logicalHeight();
+        layoutCell(*cell, availableHorizontalSpace, availableVerticalSpace);
         
         // FIXME: Find out if it is ok to use the regular padding here to align the content box inside a tall cell or we need to 
         // use some kind of intrinsic padding similar to RenderTableCell.
@@ -86,7 +88,7 @@
 
         switch (cellBox.style().verticalAlign()) {
         case VerticalAlign::Middle: {
-            auto intrinsicVerticalPadding = std::max(0_lu, rowHeight - cellDisplayBox.verticalMarginBorderAndPadding() - cellDisplayBox.contentBoxHeight()); 
+            auto intrinsicVerticalPadding = std::max(0_lu, availableVerticalSpace - cellDisplayBox.verticalMarginBorderAndPadding() - cellDisplayBox.contentBoxHeight());
             intrinsicPaddingTop = intrinsicVerticalPadding / 2;
             intrinsicPaddingBottom = intrinsicVerticalPadding / 2;
             break;
@@ -95,7 +97,7 @@
             auto rowBaselineOffset = LayoutUnit { rowList[cell->startRow()].baselineOffset() };
             auto cellBaselineOffset = LayoutUnit { cell->baselineOffset() };
             intrinsicPaddingTop = std::max(0_lu, rowBaselineOffset - cellBaselineOffset - cellDisplayBox.borderTop());
-            intrinsicPaddingBottom = std::max(0_lu, rowHeight - cellDisplayBox.verticalMarginBorderAndPadding() - intrinsicPaddingTop - cellDisplayBox.contentBoxHeight());
+            intrinsicPaddingBottom = std::max(0_lu, availableVerticalSpace - cellDisplayBox.verticalMarginBorderAndPadding() - intrinsicPaddingTop - cellDisplayBox.contentBoxHeight());
             break;
         }
         default:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to