Title: [260368] trunk
Revision
260368
Author
za...@apple.com
Date
2020-04-20 09:16:19 -0700 (Mon, 20 Apr 2020)

Log Message

[LFC][TFC] Add support for border-collapse: collapse.
https://bugs.webkit.org/show_bug.cgi?id=210747

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/layoutformattingcontext/table-flex-width-border-collapse.html

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

LayoutTests:

* fast/layoutformattingcontext/table-flex-width-border-collapse.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (260367 => 260368)


--- trunk/LayoutTests/ChangeLog	2020-04-20 15:53:48 UTC (rev 260367)
+++ trunk/LayoutTests/ChangeLog	2020-04-20 16:16:19 UTC (rev 260368)
@@ -1,3 +1,12 @@
+2020-04-20  Zalan Bujtas  <za...@apple.com>
+
+        [LFC][TFC] Add support for border-collapse: collapse.
+        https://bugs.webkit.org/show_bug.cgi?id=210747
+
+        Reviewed by Antti Koivisto.
+
+        * fast/layoutformattingcontext/table-flex-width-border-collapse.html: Added.
+
 2020-04-20  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Oversized caret and selection rects in text fields on ganji.com and netflix.com/login

Added: trunk/LayoutTests/fast/layoutformattingcontext/table-flex-width-border-collapse-expected.txt (0 => 260368)


--- trunk/LayoutTests/fast/layoutformattingcontext/table-flex-width-border-collapse-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/table-flex-width-border-collapse-expected.txt	2020-04-20 16:16:19 UTC (rev 260368)
@@ -0,0 +1,299 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x556
+  RenderBlock {HTML} at (0,0) size 800x556
+    RenderBody {BODY} at (8,8) size 784x540
+      RenderTable {TABLE} at (0,0) size 51x45
+        RenderTableSection {TBODY} at (0,0) size 51x45
+          RenderTableRow {TR} at (0,0) size 51x15
+            RenderTableCell {TD} at (0,0) size 17x15 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+            RenderTableCell {TD} at (17,0) size 17x15 [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (34,0) size 17x15 [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,15) size 51x15
+            RenderTableCell {TD} at (0,15) size 17x15 [r=1 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (17,15) size 17x15 [r=1 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (34,15) size 17x15 [r=1 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+          RenderTableRow {TR} at (0,30) size 51x15
+            RenderTableCell {TD} at (0,30) size 17x15 [r=2 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (17,30) size 17x15 [r=2 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+            RenderTableCell {TD} at (34,30) size 17x15 [r=2 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+      RenderTable {TABLE} at (0,45) size 21x45
+        RenderTableSection {TBODY} at (0,0) size 21x45
+          RenderTableRow {TR} at (0,0) size 21x15
+            RenderTableCell {TD} at (0,0) size 7x15 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (7,0) size 7x15 [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (14,0) size 7x15 [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,15) size 21x15
+            RenderTableCell {TD} at (0,15) size 21x15 [r=1 c=0 rs=1 cs=3]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,30) size 21x15
+            RenderTableCell {TD} at (0,30) size 14x15 [r=2 c=0 rs=1 cs=2]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (14,30) size 7x15 [r=2 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+      RenderTable {TABLE} at (0,90) size 36x45
+        RenderTableSection {TBODY} at (0,0) size 36x45
+          RenderTableRow {TR} at (0,0) size 36x15
+            RenderTableCell {TD} at (0,0) size 17x15 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+            RenderTableCell {TD} at (17,0) size 12x15 [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 10x13
+                text run at (1,1) width 10: "##"
+            RenderTableCell {TD} at (29,0) size 7x15 [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,15) size 36x15
+            RenderTableCell {TD} at (0,15) size 36x15 [r=1 c=0 rs=1 cs=3]
+              RenderText {#text} at (1,1) size 30x13
+                text run at (1,1) width 30: "######"
+          RenderTableRow {TR} at (0,30) size 36x15
+            RenderTableCell {TD} at (0,30) size 29x15 [r=2 c=0 rs=1 cs=2]
+              RenderText {#text} at (1,1) size 25x13
+                text run at (1,1) width 25: "#####"
+            RenderTableCell {TD} at (29,30) size 7x15 [r=2 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+      RenderTable {TABLE} at (0,135) size 67x45
+        RenderTableSection {TBODY} at (0,0) size 67x45
+          RenderTableRow {TR} at (0,0) size 67x15
+            RenderTableCell {TD} at (0,0) size 40x15 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 25x13
+                text run at (1,1) width 25: "#####"
+            RenderTableCell {TD} at (39,0) size 18x15 [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 10x13
+                text run at (1,1) width 10: "##"
+            RenderTableCell {TD} at (56,0) size 12x15 [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,15) size 67x15
+            RenderTableCell {TD} at (0,15) size 68x15 [r=1 c=0 rs=1 cs=3]
+              RenderText {#text} at (1,1) size 65x13
+                text run at (1,1) width 65: "#############"
+          RenderTableRow {TR} at (0,30) size 67x15
+            RenderTableCell {TD} at (0,30) size 57x15 [r=2 c=0 rs=1 cs=2]
+              RenderText {#text} at (1,1) size 35x13
+                text run at (1,1) width 35: "#######"
+            RenderTableCell {TD} at (56,30) size 12x15 [r=2 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+      RenderTable {TABLE} at (0,180) size 67x45
+        RenderTableSection {TBODY} at (0,0) size 67x45
+          RenderTableRow {TR} at (0,0) size 67x15
+            RenderTableCell {TD} at (0,0) size 40x15 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 25x13
+                text run at (1,1) width 25: "#####"
+            RenderTableCell {TD} at (39,0) size 18x15 [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 10x13
+                text run at (1,1) width 10: "##"
+            RenderTableCell {TD} at (56,0) size 12x15 [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,15) size 67x15
+            RenderTableCell {TD} at (0,15) size 68x15 [r=1 c=0 rs=1 cs=3]
+              RenderText {#text} at (1,1) size 65x13
+                text run at (1,1) width 65: "#############"
+          RenderTableRow {TR} at (0,30) size 67x15
+            RenderTableCell {TD} at (0,30) size 40x15 [r=2 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (39,30) size 29x15 [r=2 c=1 rs=1 cs=2]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+      RenderTable {TABLE} at (0,225) size 31x45
+        RenderTableSection {TBODY} at (0,0) size 31x45
+          RenderTableRow {TR} at (0,0) size 31x15
+            RenderTableCell {TD} at (0,0) size 17x15 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+            RenderTableCell {TD} at (17,0) size 7x15 [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (24,0) size 7x15 [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,15) size 31x15
+            RenderTableCell {TD} at (0,15) size 31x15 [r=1 c=0 rs=1 cs=3]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+          RenderTableRow {TR} at (0,30) size 31x15
+            RenderTableCell {TD} at (0,30) size 24x15 [r=2 c=0 rs=1 cs=2]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+            RenderTableCell {TD} at (24,30) size 7x15 [r=2 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+      RenderTable {TABLE} at (0,270) size 600x45
+        RenderTableSection {TBODY} at (0,0) size 600x45
+          RenderTableRow {TR} at (0,0) size 600x15
+            RenderTableCell {TD} at (0,0) size 200x15 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+            RenderTableCell {TD} at (200,0) size 200x15 [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (400,0) size 200x15 [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,15) size 600x15
+            RenderTableCell {TD} at (0,15) size 200x15 [r=1 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (200,15) size 200x15 [r=1 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (400,15) size 200x15 [r=1 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+          RenderTableRow {TR} at (0,30) size 600x15
+            RenderTableCell {TD} at (0,30) size 200x15 [r=2 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (200,30) size 200x15 [r=2 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+            RenderTableCell {TD} at (400,30) size 200x15 [r=2 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+      RenderTable {TABLE} at (0,315) size 600x45
+        RenderTableSection {TBODY} at (0,0) size 600x45
+          RenderTableRow {TR} at (0,0) size 600x15
+            RenderTableCell {TD} at (0,0) size 200x15 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (200,0) size 200x15 [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (400,0) size 200x15 [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,15) size 600x15
+            RenderTableCell {TD} at (0,15) size 600x15 [r=1 c=0 rs=1 cs=3]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,30) size 600x15
+            RenderTableCell {TD} at (0,30) size 400x15 [r=2 c=0 rs=1 cs=2]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (400,30) size 200x15 [r=2 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+      RenderTable {TABLE} at (0,360) size 600x45
+        RenderTableSection {TBODY} at (0,0) size 600x45
+          RenderTableRow {TR} at (0,0) size 600x15
+            RenderTableCell {TD} at (0,0) size 284x15 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+            RenderTableCell {TD} at (283,0) size 201x15 [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 10x13
+                text run at (1,1) width 10: "##"
+            RenderTableCell {TD} at (483,0) size 118x15 [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,15) size 600x15
+            RenderTableCell {TD} at (0,15) size 601x15 [r=1 c=0 rs=1 cs=3]
+              RenderText {#text} at (1,1) size 30x13
+                text run at (1,1) width 30: "######"
+          RenderTableRow {TR} at (0,30) size 600x15
+            RenderTableCell {TD} at (0,30) size 484x15 [r=2 c=0 rs=1 cs=2]
+              RenderText {#text} at (1,1) size 25x13
+                text run at (1,1) width 25: "#####"
+            RenderTableCell {TD} at (483,30) size 118x15 [r=2 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+      RenderTable {TABLE} at (0,405) size 600x45
+        RenderTableSection {TBODY} at (0,0) size 600x45
+          RenderTableRow {TR} at (0,0) size 600x15
+            RenderTableCell {TD} at (0,0) size 353x15 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 25x13
+                text run at (1,1) width 25: "#####"
+            RenderTableCell {TD} at (352,0) size 157x15 [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 10x13
+                text run at (1,1) width 10: "##"
+            RenderTableCell {TD} at (508,0) size 93x15 [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,15) size 600x15
+            RenderTableCell {TD} at (0,15) size 601x15 [r=1 c=0 rs=1 cs=3]
+              RenderText {#text} at (1,1) size 65x13
+                text run at (1,1) width 65: "#############"
+          RenderTableRow {TR} at (0,30) size 600x15
+            RenderTableCell {TD} at (0,30) size 509x15 [r=2 c=0 rs=1 cs=2]
+              RenderText {#text} at (1,1) size 35x13
+                text run at (1,1) width 35: "#######"
+            RenderTableCell {TD} at (508,30) size 93x15 [r=2 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+      RenderTable {TABLE} at (0,450) size 600x45
+        RenderTableSection {TBODY} at (0,0) size 600x45
+          RenderTableRow {TR} at (0,0) size 600x15
+            RenderTableCell {TD} at (0,0) size 353x15 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 25x13
+                text run at (1,1) width 25: "#####"
+            RenderTableCell {TD} at (352,0) size 157x15 [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 10x13
+                text run at (1,1) width 10: "##"
+            RenderTableCell {TD} at (508,0) size 93x15 [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,15) size 600x15
+            RenderTableCell {TD} at (0,15) size 601x15 [r=1 c=0 rs=1 cs=3]
+              RenderText {#text} at (1,1) size 65x13
+                text run at (1,1) width 65: "#############"
+          RenderTableRow {TR} at (0,30) size 600x15
+            RenderTableCell {TD} at (0,30) size 353x15 [r=2 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (352,30) size 249x15 [r=2 c=1 rs=1 cs=2]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+      RenderTable {TABLE} at (0,495) size 600x45
+        RenderTableSection {TBODY} at (0,0) size 600x45
+          RenderTableRow {TR} at (0,0) size 600x15
+            RenderTableCell {TD} at (0,0) size 330x15 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+            RenderTableCell {TD} at (329,0) size 136x15 [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+            RenderTableCell {TD} at (464,0) size 137x15 [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"
+          RenderTableRow {TR} at (0,15) size 600x15
+            RenderTableCell {TD} at (0,15) size 601x15 [r=1 c=0 rs=1 cs=3]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+          RenderTableRow {TR} at (0,30) size 600x15
+            RenderTableCell {TD} at (0,30) size 465x15 [r=2 c=0 rs=1 cs=2]
+              RenderText {#text} at (1,1) size 15x13
+                text run at (1,1) width 15: "###"
+            RenderTableCell {TD} at (464,30) size 137x15 [r=2 c=2 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 5x13
+                text run at (1,1) width 5: "#"

Added: trunk/LayoutTests/fast/layoutformattingcontext/table-flex-width-border-collapse.html (0 => 260368)


--- trunk/LayoutTests/fast/layoutformattingcontext/table-flex-width-border-collapse.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/table-flex-width-border-collapse.html	2020-04-20 16:16:19 UTC (rev 260368)
@@ -0,0 +1,80 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:LayoutFormattingContextEnabled=true internal:LayoutFormattingContextIntegrationEnabled=false ] -->
+<style>
+table {
+    font-size: 10px;
+    border-spacing: 100px;
+    border-collapse: collapse;
+}
+</style>
+<!-- no colspan. -->
+<table>
+<tr><td>###</td><td>#</td><td>#</td></tr>
+<tr><td>#</td><td>#</td><td>###</td></tr>
+<tr><td>#</td><td>###</td><td>#</td></tr>
+</table>
+<!-- colspans but with shorter content. -->
+<table>
+<tr><td>#</td><td>#</td><td>#</td></tr>
+<tr><td colspan=3">#</td></tr>
+<tr><td colspan=2">#</td><td>#</td></tr>
+</table>
+<!-- colspans but with exact length. -->
+<table>
+<tr><td>###</td><td>##</td><td>#</td></tr>
+<tr><td colspan=3">######</td></tr>
+<tr><td colspan=2">#####</td><td>#</td></tr>
+</table>
+<!-- colspans with longer content. -->
+<table>
+<tr><td>#####</td><td>##</td><td>#</td></tr>
+<tr><td colspan=3">#############</td></tr>
+<tr><td colspan=2">#######</td><td>#</td></tr>
+</table>
+<!-- trailing colspans. -->
+<table>
+<tr><td>#####</td><td>##</td><td>#</td></tr>
+<tr><td colspan=3">#############</td></tr>
+<tr><td>#</td><td colspan=2">###</td></tr>
+</table>
+<!-- border spacing -->
+<table style="border-spacing: 20px;">
+<tr><td>###</td><td>#</td><td>#</td></tr>
+<tr><td colspan=3">###</td></tr>
+<tr><td colspan=2">###</td><td>#</td></tr>
+</table>
+<!-- no colspan. -->
+<table style="width: 600px;">
+<tr><td>###</td><td>#</td><td>#</td></tr>
+<tr><td>#</td><td>#</td><td>###</td></tr>
+<tr><td>#</td><td>###</td><td>#</td></tr>
+</table>
+<!-- colspans with shorter content. -->
+<table style="width: 600px;">
+<tr><td>#</td><td>#</td><td>#</td></tr>
+<tr><td colspan=3">#</td></tr>
+<tr><td colspan=2">#</td><td>#</td></tr>
+</table>
+<!-- colspans with exact length. -->
+<table style="width: 600px;">
+<tr><td>###</td><td>##</td><td>#</td></tr>
+<tr><td colspan=3">######</td></tr>
+<tr><td colspan=2">#####</td><td>#</td></tr>
+</table>
+<!-- colspans with longer content. -->
+<table style="width: 600px;">
+<tr><td>#####</td><td>##</td><td>#</td></tr>
+<tr><td colspan=3">#############</td></tr>
+<tr><td colspan=2">#######</td><td>#</td></tr>
+</table>
+<!-- trailing colspans. -->
+<table style="width: 600px;">
+<tr><td>#####</td><td>##</td><td>#</td></tr>
+<tr><td colspan=3">#############</td></tr>
+<tr><td>#</td><td colspan=2">###</td></tr>
+</table>
+<!-- border spacing -->
+<table style="border-spacing: 20px; width: 600px;">
+<tr><td>###</td><td>#</td><td>#</td></tr>
+<tr><td colspan=3">###</td></tr>
+<tr><td colspan=2">###</td><td>#</td></tr>
+</table>

Modified: trunk/Source/WebCore/ChangeLog (260367 => 260368)


--- trunk/Source/WebCore/ChangeLog	2020-04-20 15:53:48 UTC (rev 260367)
+++ trunk/Source/WebCore/ChangeLog	2020-04-20 16:16:19 UTC (rev 260368)
@@ -1,3 +1,15 @@
+2020-04-20  Zalan Bujtas  <za...@apple.com>
+
+        [LFC][TFC] Add support for border-collapse: collapse.
+        https://bugs.webkit.org/show_bug.cgi?id=210747
+
+        Reviewed by Antti Koivisto.
+
+        Test: fast/layoutformattingcontext/table-flex-width-border-collapse.html
+
+        * layout/tableformatting/TableFormattingContext.cpp:
+        (WebCore::Layout::TableFormattingContext::ensureTableGrid):
+
 2020-04-20  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Oversized caret and selection rects in text fields on ganji.com and netflix.com/login

Modified: trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp (260367 => 260368)


--- trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp	2020-04-20 15:53:48 UTC (rev 260367)
+++ trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp	2020-04-20 16:16:19 UTC (rev 260368)
@@ -194,8 +194,10 @@
 {
     auto& tableBox = root();
     auto& tableGrid = formattingState().tableGrid();
-    tableGrid.setHorizontalSpacing(LayoutUnit { tableBox.style().horizontalBorderSpacing() });
-    tableGrid.setVerticalSpacing(LayoutUnit { tableBox.style().verticalBorderSpacing() });
+    auto& tableStyle = tableBox.style();
+    auto shouldApplyBorderSpacing = tableStyle.borderCollapse() == BorderCollapse::Separate;
+    tableGrid.setHorizontalSpacing(LayoutUnit { shouldApplyBorderSpacing ? tableStyle.horizontalBorderSpacing() : 0 });
+    tableGrid.setVerticalSpacing(LayoutUnit { shouldApplyBorderSpacing ? tableStyle.verticalBorderSpacing() : 0 });
 
     auto* firstChild = tableBox.firstChild();
     const Box* tableCaption = nullptr;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to