Title: [290701] branches/safari-613-branch
Revision
290701
Author
alanc...@apple.com
Date
2022-03-01 15:50:02 -0800 (Tue, 01 Mar 2022)

Log Message

Cherry-pick r290512. rdar://problem/86582214

    [Tables] Incorrect table sizing when colgroup comes after tbody
    https://bugs.webkit.org/show_bug.cgi?id=237205
    <rdar://86582214>

    Reviewed by Antti Koivisto.

    Source/WebCore:

    Let's use the colgroup for table sizing even when it comes after any thead, tbody, tfoot, and tr elements.
    This makes WebKit match other rendering engines (see https://src.chromium.org/viewvc/blink?revision=159442&view=revision)

    Test: fast/table/table-sizing-fails-when-colgroup-comes-after-content.html

    * rendering/RenderTable.cpp:
    (WebCore::RenderTable::firstColumn const):
    * rendering/RenderTableCol.cpp:
    (WebCore::RenderTableCol::nextColumn const):

    LayoutTests:

    * fast/table/table-sizing-fails-when-colgroup-comes-after-content-expected.html: Added.
    * fast/table/table-sizing-fails-when-colgroup-comes-after-content.html: Added.
    * platform/mac/tables/mozilla_expected_failures/dom/appendCol1-expected.txt: Progression.
    * platform/mac/tables/mozilla_expected_failures/dom/appendColGroup1-expected.txt: Progression.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290512 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-613-branch/LayoutTests/ChangeLog (290700 => 290701)


--- branches/safari-613-branch/LayoutTests/ChangeLog	2022-03-01 23:49:57 UTC (rev 290700)
+++ branches/safari-613-branch/LayoutTests/ChangeLog	2022-03-01 23:50:02 UTC (rev 290701)
@@ -1,5 +1,50 @@
 2022-03-01  Russell Epstein  <repst...@apple.com>
 
+        Cherry-pick r290512. rdar://problem/86582214
+
+    [Tables] Incorrect table sizing when colgroup comes after tbody
+    https://bugs.webkit.org/show_bug.cgi?id=237205
+    <rdar://86582214>
+    
+    Reviewed by Antti Koivisto.
+    
+    Source/WebCore:
+    
+    Let's use the colgroup for table sizing even when it comes after any thead, tbody, tfoot, and tr elements.
+    This makes WebKit match other rendering engines (see https://src.chromium.org/viewvc/blink?revision=159442&view=revision)
+    
+    Test: fast/table/table-sizing-fails-when-colgroup-comes-after-content.html
+    
+    * rendering/RenderTable.cpp:
+    (WebCore::RenderTable::firstColumn const):
+    * rendering/RenderTableCol.cpp:
+    (WebCore::RenderTableCol::nextColumn const):
+    
+    LayoutTests:
+    
+    * fast/table/table-sizing-fails-when-colgroup-comes-after-content-expected.html: Added.
+    * fast/table/table-sizing-fails-when-colgroup-comes-after-content.html: Added.
+    * platform/mac/tables/mozilla_expected_failures/dom/appendCol1-expected.txt: Progression.
+    * platform/mac/tables/mozilla_expected_failures/dom/appendColGroup1-expected.txt: Progression.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-25  Alan Bujtas  <za...@apple.com>
+
+            [Tables] Incorrect table sizing when colgroup comes after tbody
+            https://bugs.webkit.org/show_bug.cgi?id=237205
+            <rdar://86582214>
+
+            Reviewed by Antti Koivisto.
+
+            * fast/table/table-sizing-fails-when-colgroup-comes-after-content-expected.html: Added.
+            * fast/table/table-sizing-fails-when-colgroup-comes-after-content.html: Added.
+            * platform/mac/tables/mozilla_expected_failures/dom/appendCol1-expected.txt: Progression.
+            * platform/mac/tables/mozilla_expected_failures/dom/appendColGroup1-expected.txt: Progression.
+
+2022-03-01  Russell Epstein  <repst...@apple.com>
+
         Cherry-pick r290156. rdar://problem/89154452
 
     ServiceWorkerGlobalScope+PushAPI requires PushAPIEnabled

Added: branches/safari-613-branch/LayoutTests/fast/table/table-sizing-fails-when-colgroup-comes-after-content-expected.html (0 => 290701)


--- branches/safari-613-branch/LayoutTests/fast/table/table-sizing-fails-when-colgroup-comes-after-content-expected.html	                        (rev 0)
+++ branches/safari-613-branch/LayoutTests/fast/table/table-sizing-fails-when-colgroup-comes-after-content-expected.html	2022-03-01 23:50:02 UTC (rev 290701)
@@ -0,0 +1,25 @@
+<style>
+table {
+  width: 0px;
+  table-layout: fixed;
+  border: solid;
+}
+
+td {
+  width: 50%;
+  overflow: auto;
+}
+</style>
+PASS if the table below is not blank.
+<table>
+<colgroup>
+  <col style="width: 200px;">
+  <col style="width: 200px;">
+</colgroup>
+<tbody>
+  <tr>
+    <td>this text</td>
+    <td>should show</td>
+  </tr>
+</tbody>
+</table>

Added: branches/safari-613-branch/LayoutTests/fast/table/table-sizing-fails-when-colgroup-comes-after-content.html (0 => 290701)


--- branches/safari-613-branch/LayoutTests/fast/table/table-sizing-fails-when-colgroup-comes-after-content.html	                        (rev 0)
+++ branches/safari-613-branch/LayoutTests/fast/table/table-sizing-fails-when-colgroup-comes-after-content.html	2022-03-01 23:50:02 UTC (rev 290701)
@@ -0,0 +1,25 @@
+<style>
+table {
+  width: 0px;
+  table-layout: fixed;
+  border: solid;
+}
+
+td {
+  width: 50%;
+  overflow: auto;
+}
+</style>
+PASS if the table below is not blank.
+<table>
+<tbody>
+  <tr>
+    <td>this text</td>
+    <td>should show</td>
+  </tr>
+</tbody>
+<colgroup>
+  <col style="width: 200px;">
+  <col style="width: 200px;">
+</colgroup>
+</table>

Modified: branches/safari-613-branch/LayoutTests/platform/ios/tables/mozilla_expected_failures/dom/appendCol1-expected.txt (290700 => 290701)


--- branches/safari-613-branch/LayoutTests/platform/ios/tables/mozilla_expected_failures/dom/appendCol1-expected.txt	2022-03-01 23:49:57 UTC (rev 290700)
+++ branches/safari-613-branch/LayoutTests/platform/ios/tables/mozilla_expected_failures/dom/appendCol1-expected.txt	2022-03-01 23:50:02 UTC (rev 290701)
@@ -6,15 +6,15 @@
       RenderBlock (anonymous) at (0,0) size 784x20
         RenderText {#text} at (0,0) size 218x19
           text run at (0,0) width 218: "The 2 tables should look the same"
-      RenderTable {TABLE} at (0,20) size 62x30 [bgcolor=#FFA500] [border: (1px outset #808080)]
+      RenderTable {TABLE} at (0,20) size 235x30 [bgcolor=#FFA500] [border: (1px outset #808080)]
         RenderTableCol {COLGROUP} at (0,0) size 0x0
           RenderTableCol {COL} at (0,0) size 0x0
-        RenderTableSection {TBODY} at (1,1) size 60x28
-          RenderTableRow {TR} at (0,2) size 60x24
+        RenderTableSection {TBODY} at (1,1) size 233x28
+          RenderTableRow {TR} at (0,2) size 233x24
             RenderTableCell {TD} at (2,2) size 27x24 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
               RenderText {#text} at (2,2) size 23x19
                 text run at (2,2) width 23: "c11"
-            RenderTableCell {TD} at (30,2) size 28x24 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (30,2) size 201x24 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
               RenderText {#text} at (2,2) size 24x19
                 text run at (2,2) width 24: "c12"
         RenderTableCol at (0,0) size 0x0

Modified: branches/safari-613-branch/LayoutTests/platform/ios/tables/mozilla_expected_failures/dom/appendColGroup1-expected.txt (290700 => 290701)


--- branches/safari-613-branch/LayoutTests/platform/ios/tables/mozilla_expected_failures/dom/appendColGroup1-expected.txt	2022-03-01 23:49:57 UTC (rev 290700)
+++ branches/safari-613-branch/LayoutTests/platform/ios/tables/mozilla_expected_failures/dom/appendColGroup1-expected.txt	2022-03-01 23:50:02 UTC (rev 290701)
@@ -6,18 +6,18 @@
       RenderBlock (anonymous) at (0,0) size 784x20
         RenderText {#text} at (0,0) size 218x19
           text run at (0,0) width 218: "The 2 tables should look the same"
-      RenderTable {TABLE} at (0,20) size 207x30 [bgcolor=#FFA500] [border: (1px outset #808080)]
+      RenderTable {TABLE} at (0,20) size 510x30 [bgcolor=#FFA500] [border: (1px outset #808080)]
         RenderTableCol {COLGROUP} at (0,0) size 0x0
           RenderTableCol {COL} at (0,0) size 0x0
-        RenderTableSection {TBODY} at (1,1) size 205x28
-          RenderTableRow {TR} at (0,2) size 205x24
+        RenderTableSection {TBODY} at (1,1) size 508x28
+          RenderTableRow {TR} at (0,2) size 508x24
             RenderTableCell {TD} at (2,2) size 100x24 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
               RenderText {#text} at (2,2) size 49x19
                 text run at (2,2) width 49: "col-100"
-            RenderTableCell {TD} at (104,2) size 49x24 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (104,2) size 200x24 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
               RenderText {#text} at (2,2) size 45x19
                 text run at (2,2) width 45: "cg-200"
-            RenderTableCell {TD} at (154,2) size 49x24 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
+            RenderTableCell {TD} at (306,2) size 200x24 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
               RenderText {#text} at (2,2) size 45x19
                 text run at (2,2) width 45: "cg-200"
         RenderTableCol {COLGROUP} at (0,0) size 0x0

Modified: branches/safari-613-branch/LayoutTests/platform/mac/tables/mozilla_expected_failures/dom/appendCol1-expected.txt (290700 => 290701)


--- branches/safari-613-branch/LayoutTests/platform/mac/tables/mozilla_expected_failures/dom/appendCol1-expected.txt	2022-03-01 23:49:57 UTC (rev 290700)
+++ branches/safari-613-branch/LayoutTests/platform/mac/tables/mozilla_expected_failures/dom/appendCol1-expected.txt	2022-03-01 23:50:02 UTC (rev 290701)
@@ -6,15 +6,15 @@
       RenderBlock (anonymous) at (0,0) size 784x18
         RenderText {#text} at (0,0) size 218x18
           text run at (0,0) width 218: "The 2 tables should look the same"
-      RenderTable {TABLE} at (0,18) size 62x28 [bgcolor=#FFA500] [border: (1px outset #808080)]
+      RenderTable {TABLE} at (0,18) size 235x28 [bgcolor=#FFA500] [border: (1px outset #808080)]
         RenderTableCol {COLGROUP} at (0,0) size 0x0
           RenderTableCol {COL} at (0,0) size 0x0
-        RenderTableSection {TBODY} at (1,1) size 60x26
-          RenderTableRow {TR} at (0,2) size 60x22
+        RenderTableSection {TBODY} at (1,1) size 233x26
+          RenderTableRow {TR} at (0,2) size 233x22
             RenderTableCell {TD} at (2,2) size 27x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
               RenderText {#text} at (2,2) size 23x18
                 text run at (2,2) width 23: "c11"
-            RenderTableCell {TD} at (30,2) size 28x22 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (30,2) size 201x22 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
               RenderText {#text} at (2,2) size 24x18
                 text run at (2,2) width 24: "c12"
         RenderTableCol at (0,0) size 0x0

Modified: branches/safari-613-branch/LayoutTests/platform/mac/tables/mozilla_expected_failures/dom/appendColGroup1-expected.txt (290700 => 290701)


--- branches/safari-613-branch/LayoutTests/platform/mac/tables/mozilla_expected_failures/dom/appendColGroup1-expected.txt	2022-03-01 23:49:57 UTC (rev 290700)
+++ branches/safari-613-branch/LayoutTests/platform/mac/tables/mozilla_expected_failures/dom/appendColGroup1-expected.txt	2022-03-01 23:50:02 UTC (rev 290701)
@@ -6,18 +6,18 @@
       RenderBlock (anonymous) at (0,0) size 784x18
         RenderText {#text} at (0,0) size 218x18
           text run at (0,0) width 218: "The 2 tables should look the same"
-      RenderTable {TABLE} at (0,18) size 207x28 [bgcolor=#FFA500] [border: (1px outset #808080)]
+      RenderTable {TABLE} at (0,18) size 510x28 [bgcolor=#FFA500] [border: (1px outset #808080)]
         RenderTableCol {COLGROUP} at (0,0) size 0x0
           RenderTableCol {COL} at (0,0) size 0x0
-        RenderTableSection {TBODY} at (1,1) size 205x26
-          RenderTableRow {TR} at (0,2) size 205x22
+        RenderTableSection {TBODY} at (1,1) size 508x26
+          RenderTableRow {TR} at (0,2) size 508x22
             RenderTableCell {TD} at (2,2) size 100x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
               RenderText {#text} at (2,2) size 49x18
                 text run at (2,2) width 49: "col-100"
-            RenderTableCell {TD} at (104,2) size 49x22 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (104,2) size 200x22 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
               RenderText {#text} at (2,2) size 45x18
                 text run at (2,2) width 45: "cg-200"
-            RenderTableCell {TD} at (154,2) size 49x22 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
+            RenderTableCell {TD} at (306,2) size 200x22 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
               RenderText {#text} at (2,2) size 45x18
                 text run at (2,2) width 45: "cg-200"
         RenderTableCol {COLGROUP} at (0,0) size 0x0

Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (290700 => 290701)


--- branches/safari-613-branch/Source/WebCore/ChangeLog	2022-03-01 23:49:57 UTC (rev 290700)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog	2022-03-01 23:50:02 UTC (rev 290701)
@@ -1,5 +1,55 @@
 2022-03-01  Russell Epstein  <repst...@apple.com>
 
+        Cherry-pick r290512. rdar://problem/86582214
+
+    [Tables] Incorrect table sizing when colgroup comes after tbody
+    https://bugs.webkit.org/show_bug.cgi?id=237205
+    <rdar://86582214>
+    
+    Reviewed by Antti Koivisto.
+    
+    Source/WebCore:
+    
+    Let's use the colgroup for table sizing even when it comes after any thead, tbody, tfoot, and tr elements.
+    This makes WebKit match other rendering engines (see https://src.chromium.org/viewvc/blink?revision=159442&view=revision)
+    
+    Test: fast/table/table-sizing-fails-when-colgroup-comes-after-content.html
+    
+    * rendering/RenderTable.cpp:
+    (WebCore::RenderTable::firstColumn const):
+    * rendering/RenderTableCol.cpp:
+    (WebCore::RenderTableCol::nextColumn const):
+    
+    LayoutTests:
+    
+    * fast/table/table-sizing-fails-when-colgroup-comes-after-content-expected.html: Added.
+    * fast/table/table-sizing-fails-when-colgroup-comes-after-content.html: Added.
+    * platform/mac/tables/mozilla_expected_failures/dom/appendCol1-expected.txt: Progression.
+    * platform/mac/tables/mozilla_expected_failures/dom/appendColGroup1-expected.txt: Progression.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-25  Alan Bujtas  <za...@apple.com>
+
+            [Tables] Incorrect table sizing when colgroup comes after tbody
+            https://bugs.webkit.org/show_bug.cgi?id=237205
+            <rdar://86582214>
+
+            Reviewed by Antti Koivisto.
+
+            Let's use the colgroup for table sizing even when it comes after any thead, tbody, tfoot, and tr elements.
+            This makes WebKit match other rendering engines (see https://src.chromium.org/viewvc/blink?revision=159442&view=revision)
+
+            Test: fast/table/table-sizing-fails-when-colgroup-comes-after-content.html
+
+            * rendering/RenderTable.cpp:
+            (WebCore::RenderTable::firstColumn const):
+            * rendering/RenderTableCol.cpp:
+            (WebCore::RenderTableCol::nextColumn const):
+
+2022-03-01  Russell Epstein  <repst...@apple.com>
+
         Cherry-pick r290156. rdar://problem/89154452
 
     ServiceWorkerGlobalScope+PushAPI requires PushAPIEnabled

Modified: branches/safari-613-branch/Source/WebCore/rendering/RenderTable.cpp (290700 => 290701)


--- branches/safari-613-branch/Source/WebCore/rendering/RenderTable.cpp	2022-03-01 23:49:57 UTC (rev 290700)
+++ branches/safari-613-branch/Source/WebCore/rendering/RenderTable.cpp	2022-03-01 23:50:02 UTC (rev 290701)
@@ -926,12 +926,7 @@
     for (auto& child : childrenOfType<RenderObject>(*this)) {
         if (is<RenderTableCol>(child))
             return &const_cast<RenderTableCol&>(downcast<RenderTableCol>(child));
-
-        // We allow only table-captions before columns or column-groups.
-        if (!is<RenderTableCaption>(child))
-            return nullptr;
     }
-
     return nullptr;
 }
 

Modified: branches/safari-613-branch/Source/WebCore/rendering/RenderTableCol.cpp (290700 => 290701)


--- branches/safari-613-branch/Source/WebCore/rendering/RenderTableCol.cpp	2022-03-01 23:49:57 UTC (rev 290700)
+++ branches/safari-613-branch/Source/WebCore/rendering/RenderTableCol.cpp	2022-03-01 23:50:02 UTC (rev 290701)
@@ -182,14 +182,8 @@
     if (!next && is<RenderTableCol>(*parent()))
         next = parent()->nextSibling();
 
-    for (; next && !is<RenderTableCol>(*next); next = next->nextSibling()) {
-        // We allow captions mixed with columns and column-groups.
-        if (is<RenderTableCaption>(*next))
-            continue;
+    for (; next && !is<RenderTableCol>(*next); next = next->nextSibling()) { }
 
-        return nullptr;
-    }
-
     return downcast<RenderTableCol>(next);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to