Title: [262109] trunk
Revision
262109
Author
[email protected]
Date
2020-05-24 10:15:23 -0700 (Sun, 24 May 2020)

Log Message

[LFC][TFC] Ignore section borders even when border collapse is off.
https://bugs.webkit.org/show_bug.cgi?id=212336

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/layoutformattingcontext/table-simple-thead-border-ignore.html

* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForSections):

LayoutTests:

* fast/layoutformattingcontext/table-simple-thead-border-ignore-expected.html: Added.
* fast/layoutformattingcontext/table-simple-thead-border-ignore.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (262108 => 262109)


--- trunk/LayoutTests/ChangeLog	2020-05-24 15:53:19 UTC (rev 262108)
+++ trunk/LayoutTests/ChangeLog	2020-05-24 17:15:23 UTC (rev 262109)
@@ -1,5 +1,15 @@
 2020-05-24  Zalan Bujtas  <[email protected]>
 
+        [LFC][TFC] Ignore section borders even when border collapse is off.
+        https://bugs.webkit.org/show_bug.cgi?id=212336
+
+        Reviewed by Antti Koivisto.
+
+        * fast/layoutformattingcontext/table-simple-thead-border-ignore-expected.html: Added.
+        * fast/layoutformattingcontext/table-simple-thead-border-ignore.html: Added.
+
+2020-05-24  Zalan Bujtas  <[email protected]>
+
         [LFC][TFC] Take sections into account when computing collapsed border.
         https://bugs.webkit.org/show_bug.cgi?id=212311
 

Added: trunk/LayoutTests/fast/layoutformattingcontext/table-simple-thead-border-ignore-expected.html (0 => 262109)


--- trunk/LayoutTests/fast/layoutformattingcontext/table-simple-thead-border-ignore-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/table-simple-thead-border-ignore-expected.html	2020-05-24 17:15:23 UTC (rev 262109)
@@ -0,0 +1,9 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:LayoutFormattingContextEnabled=true internal:LayoutFormattingContextIntegrationEnabled=false ] -->
+<style>
+div {
+    height: 50px;
+    width: 50px;
+    border: 10px solid green;
+}
+</style>
+<div></div>

Added: trunk/LayoutTests/fast/layoutformattingcontext/table-simple-thead-border-ignore.html (0 => 262109)


--- trunk/LayoutTests/fast/layoutformattingcontext/table-simple-thead-border-ignore.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/table-simple-thead-border-ignore.html	2020-05-24 17:15:23 UTC (rev 262109)
@@ -0,0 +1,21 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:LayoutFormattingContextEnabled=true internal:LayoutFormattingContextIntegrationEnabled=false ] -->
+<style>
+table {
+    border: 10px solid green;
+}
+
+th {
+    width: 20px;
+    height: 20px;
+}
+
+thead {
+    border: 50px solid red;
+}
+</style>
+<table>
+<thead>
+<tr><th></th><th></th></tr>
+<tr><th></th><th></th></tr>
+</thead>
+</table>

Modified: trunk/Source/WebCore/ChangeLog (262108 => 262109)


--- trunk/Source/WebCore/ChangeLog	2020-05-24 15:53:19 UTC (rev 262108)
+++ trunk/Source/WebCore/ChangeLog	2020-05-24 17:15:23 UTC (rev 262109)
@@ -1,3 +1,17 @@
+2020-05-24  Zalan Bujtas  <[email protected]>
+
+        [LFC][TFC] Ignore section borders even when border collapse is off.
+        https://bugs.webkit.org/show_bug.cgi?id=212336
+
+        Reviewed by Antti Koivisto.
+
+        Test: fast/layoutformattingcontext/table-simple-thead-border-ignore.html
+
+        * layout/Verification.cpp:
+        (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
+        * layout/tableformatting/TableFormattingContext.cpp:
+        (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections):
+
 2020-05-24  Sam Weinig  <[email protected]>
 
         Extended Color Cleanup: Stop allowing direct access to the underlying SimpleColor (it is almost always incorrect with respect to extended colors)

Modified: trunk/Source/WebCore/layout/Verification.cpp (262108 => 262109)


--- trunk/Source/WebCore/layout/Verification.cpp	2020-05-24 15:53:19 UTC (rev 262108)
+++ trunk/Source/WebCore/layout/Verification.cpp	2020-05-24 17:15:23 UTC (rev 262109)
@@ -261,7 +261,8 @@
         // Table rows and tbody have 0 width for some reason when border collapsing is on.
         if (is<RenderTableRow>(renderer) && downcast<RenderTableRow>(renderer).table()->collapseBorders())
             return false;
-        if (is<RenderTableSection>(renderer) && downcast<RenderTableSection>(renderer).table()->collapseBorders())
+        // Section borders are either collapsed or ignored. However they may produce negative padding boxes.
+        if (is<RenderTableSection>(renderer) && (downcast<RenderTableSection>(renderer).table()->collapseBorders() || renderer.style().hasBorder()))
             return false;
     }
     if (!areEssentiallyEqual(frameRect, displayBox.rect())) {

Modified: trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp (262108 => 262109)


--- trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp	2020-05-24 15:53:19 UTC (rev 262108)
+++ trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp	2020-05-24 17:15:23 UTC (rev 262109)
@@ -193,8 +193,8 @@
     for (auto& section : grid.sections()) {
         auto& sectionBox = section.box();
         auto& sectionDisplayBox = formattingState().displayBox(sectionBox);
-        // FIXME: Multiple sections can have their own borders.
-        sectionDisplayBox.setBorder(grid.collapsedBorder() ? Edges(): geometry().computedBorder(sectionBox));
+        // Section borders are either collapsed or ignored.
+        sectionDisplayBox.setBorder({ });
         sectionDisplayBox.setPadding(geometry().computedPadding(sectionBox, constraints.horizontal.logicalWidth));
         // Internal table elements do not have margins.
         sectionDisplayBox.setHorizontalMargin({ });
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to