Title: [262101] trunk
Revision
262101
Author
za...@apple.com
Date
2020-05-23 10:10:56 -0700 (Sat, 23 May 2020)

Log Message

[LFC][TFC] Used height of a cell is the maximum of the computed and the content height.
https://bugs.webkit.org/show_bug.cgi?id=212302

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height.html

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const):

LayoutTests:

* fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height-expected.html: Added.
* fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (262100 => 262101)


--- trunk/LayoutTests/ChangeLog	2020-05-23 16:35:29 UTC (rev 262100)
+++ trunk/LayoutTests/ChangeLog	2020-05-23 17:10:56 UTC (rev 262101)
@@ -1,3 +1,13 @@
+2020-05-23  Zalan Bujtas  <za...@apple.com>
+
+        [LFC][TFC] Used height of a cell is the maximum of the computed and the content height.
+        https://bugs.webkit.org/show_bug.cgi?id=212302
+
+        Reviewed by Antti Koivisto.
+
+        * fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height-expected.html: Added.
+        * fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height.html: Added.
+
 2020-05-23  Caio Lima  <ticaiol...@gmail.com>
 
         [bmalloc] Fix OOM errors on MIPS after r261667

Added: trunk/LayoutTests/fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height-expected.html (0 => 262101)


--- trunk/LayoutTests/fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height-expected.html	2020-05-23 17:10:56 UTC (rev 262101)
@@ -0,0 +1,13 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:LayoutFormattingContextEnabled=true internal:LayoutFormattingContextIntegrationEnabled=false ] -->
+<style>
+div {
+    height: 42px;
+    width: 102px;
+    border: 1px solid green;
+    position: absolute;
+}
+</style>
+<div style="top: 10px; left: 10px;"></div>
+<div style="top: 10px; left: 116px;"></div>
+<div style="top: 56px; left: 10px;"></div>
+<div style="top: 56px; left: 116px;"></div>

Added: trunk/LayoutTests/fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height.html (0 => 262101)


--- trunk/LayoutTests/fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height.html	2020-05-23 17:10:56 UTC (rev 262101)
@@ -0,0 +1,18 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:LayoutFormattingContextEnabled=true internal:LayoutFormattingContextIntegrationEnabled=false ] -->
+<style>
+table {
+    font-size: 40px;
+    font-family: Ahem;
+    color: white;
+}
+
+td {
+    width: 100px;
+    height: 10px;
+    border: 1px solid green;
+}
+</style>
+<table>
+<tr><td>#</td><td>#</td></tr>
+<tr><td>#</td><td>#</td></tr>
+</table>

Modified: trunk/Source/WebCore/ChangeLog (262100 => 262101)


--- trunk/Source/WebCore/ChangeLog	2020-05-23 16:35:29 UTC (rev 262100)
+++ trunk/Source/WebCore/ChangeLog	2020-05-23 17:10:56 UTC (rev 262101)
@@ -1,5 +1,19 @@
 2020-05-23  Zalan Bujtas  <za...@apple.com>
 
+        [LFC][TFC] Used height of a cell is the maximum of the computed and the content height.
+        https://bugs.webkit.org/show_bug.cgi?id=212302
+
+        Reviewed by Antti Koivisto.
+
+        Test: fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height.html
+
+        * layout/FormattingContextGeometry.cpp:
+        (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
+        * layout/tableformatting/TableFormattingContextGeometry.cpp:
+        (WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const):
+
+2020-05-23  Zalan Bujtas  <za...@apple.com>
+
         [LFC][TFC] Non-collapsing row border should not make the table wider/taller
         https://bugs.webkit.org/show_bug.cgi?id=212263
 

Modified: trunk/Source/WebCore/layout/FormattingContextGeometry.cpp (262100 => 262101)


--- trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2020-05-23 16:35:29 UTC (rev 262100)
+++ trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2020-05-23 17:10:56 UTC (rev 262101)
@@ -112,7 +112,7 @@
 
 LayoutUnit FormattingContext::Geometry::contentHeightForFormattingContextRoot(const Box& layoutBox) const
 {
-    ASSERT((isHeightAuto(layoutBox) || layoutBox.establishesTableFormattingContext()) && (layoutBox.establishesFormattingContext() || layoutBox.isDocumentBox()));
+    ASSERT((isHeightAuto(layoutBox) || layoutBox.establishesTableFormattingContext() || layoutBox.isTableCell()) && (layoutBox.establishesFormattingContext() || layoutBox.isDocumentBox()));
 
     // 10.6.7 'Auto' heights for block formatting context roots
 

Modified: trunk/Source/WebCore/layout/tableformatting/TableFormattingContextGeometry.cpp (262100 => 262101)


--- trunk/Source/WebCore/layout/tableformatting/TableFormattingContextGeometry.cpp	2020-05-23 16:35:29 UTC (rev 262100)
+++ trunk/Source/WebCore/layout/tableformatting/TableFormattingContextGeometry.cpp	2020-05-23 17:10:56 UTC (rev 262101)
@@ -41,9 +41,7 @@
 LayoutUnit TableFormattingContext::Geometry::cellHeigh(const ContainerBox& cellBox) const
 {
     ASSERT(cellBox.isInFlow());
-    if (auto height = computedHeight(cellBox))
-        return *height;
-    return contentHeightForFormattingContextRoot(cellBox);
+    return std::max(computedHeight(cellBox).valueOr(0_lu), contentHeightForFormattingContextRoot(cellBox));
 }
 
 Edges TableFormattingContext::Geometry::computedCellBorder(const TableGrid::Cell& cell) const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to