Diff
Modified: trunk/LayoutTests/ChangeLog (282255 => 282256)
--- trunk/LayoutTests/ChangeLog 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/ChangeLog 2021-09-10 03:04:42 UTC (rev 282256)
@@ -1,3 +1,13 @@
+2021-09-09 Alan Bujtas <[email protected]>
+
+ [Table layout] Incorrect vertical position when the inline level box has 0px used height.
+ https://bugs.webkit.org/show_bug.cgi?id=230118
+
+ Reviewed by Antti Koivisto.
+
+ * fast/table/vertical-position-with-0-height-box-expected.txt: Added.
+ * fast/table/vertical-position-with-0-height-box.html: Added.
+
2021-09-09 Fujii Hironori <[email protected]>
[WinCairo] Unreviewed test gardening
Modified: trunk/LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.txt (282255 => 282256)
--- trunk/LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -53,4 +53,4 @@
RenderTableCell (anonymous) at (0,0) size 50x100 [r=0 c=0 rs=1 cs=1]
RenderBlock {DIV} at (0,0) size 50x50 [bgcolor=#0000FF]
RenderBlock {DIV} at (0,50) size 50x50 [bgcolor=#0000FF]
- RenderTableCell {DIV} at (50,0) size 50x0 [bgcolor=#0000FF] [r=0 c=1 rs=1 cs=1]
+ RenderTableCell {DIV} at (50,50) size 50x0 [bgcolor=#0000FF] [r=0 c=1 rs=1 cs=1]
Added: trunk/LayoutTests/fast/table/vertical-position-with-0-height-box-expected.txt (0 => 282256)
--- trunk/LayoutTests/fast/table/vertical-position-with-0-height-box-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/table/vertical-position-with-0-height-box-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -0,0 +1,2 @@
+The zero height inline level box is supposed to be aligned with the bottom of the green box (20px).
+Inline level box logical top: 20px
Added: trunk/LayoutTests/fast/table/vertical-position-with-0-height-box.html (0 => 282256)
--- trunk/LayoutTests/fast/table/vertical-position-with-0-height-box.html (rev 0)
+++ trunk/LayoutTests/fast/table/vertical-position-with-0-height-box.html 2021-09-10 03:04:42 UTC (rev 282256)
@@ -0,0 +1,30 @@
+<style>
+td {
+ padding: 0px;
+ vertical-align: baseline;
+}
+
+div {
+ display: inline-block;
+ width: 20px;
+ height: 20px;
+ background: green;
+}
+
+#zero {
+ height: 0px;
+}
+</style>
+<table>
+<tr>
+ <td><div></div></td>
+ <td><div id=zero></div></td>
+</tr>
+</table>
+<pre id=result></pre>
+<script>
+document.body.offsetHeight;
+if (window.testRunner)
+ testRunner.dumpAsText();
+result.innerText = "The zero height inline level box is supposed to be aligned with the bottom of the green box (20px).\nInline level box logical top: " + zero.offsetTop + "px";
+</script>
Modified: trunk/LayoutTests/platform/ios/fast/css/acid2-expected.txt (282255 => 282256)
--- trunk/LayoutTests/platform/ios/fast/css/acid2-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/platform/ios/fast/css/acid2-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -35,10 +35,10 @@
RenderTable {UL} at (96,192) size 48x12 [bgcolor=#FF0000]
RenderTableSection (anonymous) at (0,0) size 48x12
RenderTableRow (anonymous) at (0,0) size 48x12
- RenderTableCell {LI} at (0,0) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {LI} at (0,12) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
RenderTableCell (anonymous) at (12,0) size 12x12 [r=0 c=1 rs=1 cs=1]
RenderTable {LI} at (0,0) size 12x12 [bgcolor=#000000]
- RenderTableCell {LI} at (24,0) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
+ RenderTableCell {LI} at (24,12) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
RenderTableCell (anonymous) at (36,0) size 12x12 [r=0 c=3 rs=1 cs=1]
RenderListItem {LI} at (0,0) size 12x12 [bgcolor=#000000]
layer at (48,2844) size 740x10 scrollHeight 277
Modified: trunk/LayoutTests/platform/ios/fast/css/acid2-pixel-expected.txt (282255 => 282256)
--- trunk/LayoutTests/platform/ios/fast/css/acid2-pixel-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/platform/ios/fast/css/acid2-pixel-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -35,10 +35,10 @@
RenderTable {UL} at (96,192) size 48x12 [bgcolor=#FF0000]
RenderTableSection (anonymous) at (0,0) size 48x12
RenderTableRow (anonymous) at (0,0) size 48x12
- RenderTableCell {LI} at (0,0) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {LI} at (0,12) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
RenderTableCell (anonymous) at (12,0) size 12x12 [r=0 c=1 rs=1 cs=1]
RenderTable {LI} at (0,0) size 12x12 [bgcolor=#000000]
- RenderTableCell {LI} at (24,0) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
+ RenderTableCell {LI} at (24,12) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
RenderTableCell (anonymous) at (36,0) size 12x12 [r=0 c=3 rs=1 cs=1]
RenderListItem {LI} at (0,0) size 12x12 [bgcolor=#000000]
layer at (48,276) size 740x10 scrollHeight 277
Modified: trunk/LayoutTests/platform/ios/fast/dynamic/insert-before-table-part-in-continuation-expected.txt (282255 => 282256)
--- trunk/LayoutTests/platform/ios/fast/dynamic/insert-before-table-part-in-continuation-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/platform/ios/fast/dynamic/insert-before-table-part-in-continuation-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -40,7 +40,7 @@
RenderTable at (40,0) size 106x20
RenderTableSection (anonymous) at (0,0) size 105x20
RenderTableRow (anonymous) at (0,0) size 105x20
- RenderTableCell {TD} at (0,0) size 0x0 [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (0,15) size 0x0 [r=0 c=0 rs=1 cs=1]
RenderTableCell {DIV} at (0,0) size 105x20 [r=0 c=1 rs=1 cs=1]
RenderText {#text} at (0,0) size 105x19
text run at (0,0) width 105: "...continues here"
Modified: trunk/LayoutTests/platform/ios/http/tests/misc/acid2-expected.txt (282255 => 282256)
--- trunk/LayoutTests/platform/ios/http/tests/misc/acid2-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/platform/ios/http/tests/misc/acid2-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -35,10 +35,10 @@
RenderTable {UL} at (96,192) size 48x12 [bgcolor=#FF0000]
RenderTableSection (anonymous) at (0,0) size 48x12
RenderTableRow (anonymous) at (0,0) size 48x12
- RenderTableCell {LI} at (0,0) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {LI} at (0,12) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
RenderTableCell (anonymous) at (12,0) size 12x12 [r=0 c=1 rs=1 cs=1]
RenderTable {LI} at (0,0) size 12x12 [bgcolor=#000000]
- RenderTableCell {LI} at (24,0) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
+ RenderTableCell {LI} at (24,12) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
RenderTableCell (anonymous) at (36,0) size 12x12 [r=0 c=3 rs=1 cs=1]
RenderListItem {LI} at (0,0) size 12x12 [bgcolor=#000000]
layer at (48,2844) size 740x10 scrollHeight 277
Modified: trunk/LayoutTests/platform/ios/http/tests/misc/acid2-pixel-expected.txt (282255 => 282256)
--- trunk/LayoutTests/platform/ios/http/tests/misc/acid2-pixel-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/platform/ios/http/tests/misc/acid2-pixel-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -35,10 +35,10 @@
RenderTable {UL} at (96,192) size 48x12 [bgcolor=#FF0000]
RenderTableSection (anonymous) at (0,0) size 48x12
RenderTableRow (anonymous) at (0,0) size 48x12
- RenderTableCell {LI} at (0,0) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {LI} at (0,12) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
RenderTableCell (anonymous) at (12,0) size 12x12 [r=0 c=1 rs=1 cs=1]
RenderTable {LI} at (0,0) size 12x12 [bgcolor=#000000]
- RenderTableCell {LI} at (24,0) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
+ RenderTableCell {LI} at (24,12) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
RenderTableCell (anonymous) at (36,0) size 12x12 [r=0 c=3 rs=1 cs=1]
RenderListItem {LI} at (0,0) size 12x12 [bgcolor=#000000]
layer at (48,276) size 740x10 scrollHeight 277
Modified: trunk/LayoutTests/platform/ios/tables/mozilla/bugs/bug3037-1-expected.txt (282255 => 282256)
--- trunk/LayoutTests/platform/ios/tables/mozilla/bugs/bug3037-1-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/platform/ios/tables/mozilla/bugs/bug3037-1-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -24,7 +24,7 @@
RenderText {#text} at (0,0) size 33x19
text run at (0,0) width 33: "Back"
RenderText {#text} at (0,0) size 0x0
- RenderTableCell {HTML:SPAN} at (32,0) size 0x0 [r=0 c=1 rs=1 cs=1]
+ RenderTableCell {HTML:SPAN} at (32,15) size 0x0 [r=0 c=1 rs=1 cs=1]
RenderInline {HTML:INPUT} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
Modified: trunk/LayoutTests/platform/mac/fast/css/acid2-expected.txt (282255 => 282256)
--- trunk/LayoutTests/platform/mac/fast/css/acid2-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/platform/mac/fast/css/acid2-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -35,10 +35,10 @@
RenderTable {UL} at (96,192) size 48x12 [bgcolor=#FF0000]
RenderTableSection (anonymous) at (0,0) size 48x12
RenderTableRow (anonymous) at (0,0) size 48x12
- RenderTableCell {LI} at (0,0) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {LI} at (0,12) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
RenderTableCell (anonymous) at (12,0) size 12x12 [r=0 c=1 rs=1 cs=1]
RenderTable {LI} at (0,0) size 12x12 [bgcolor=#000000]
- RenderTableCell {LI} at (24,0) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
+ RenderTableCell {LI} at (24,12) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
RenderTableCell (anonymous) at (36,0) size 12x12 [r=0 c=3 rs=1 cs=1]
RenderListItem {LI} at (0,0) size 12x12 [bgcolor=#000000]
layer at (48,2842) size 740x10 scrollHeight 276
Modified: trunk/LayoutTests/platform/mac/fast/css/acid2-pixel-expected.txt (282255 => 282256)
--- trunk/LayoutTests/platform/mac/fast/css/acid2-pixel-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/platform/mac/fast/css/acid2-pixel-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -35,10 +35,10 @@
RenderTable {UL} at (96,192) size 48x12 [bgcolor=#FF0000]
RenderTableSection (anonymous) at (0,0) size 48x12
RenderTableRow (anonymous) at (0,0) size 48x12
- RenderTableCell {LI} at (0,0) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {LI} at (0,12) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
RenderTableCell (anonymous) at (12,0) size 12x12 [r=0 c=1 rs=1 cs=1]
RenderTable {LI} at (0,0) size 12x12 [bgcolor=#000000]
- RenderTableCell {LI} at (24,0) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
+ RenderTableCell {LI} at (24,12) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
RenderTableCell (anonymous) at (36,0) size 12x12 [r=0 c=3 rs=1 cs=1]
RenderListItem {LI} at (0,0) size 12x12 [bgcolor=#000000]
layer at (48,276) size 740x10 scrollHeight 276
Modified: trunk/LayoutTests/platform/mac/fast/dynamic/insert-before-table-part-in-continuation-expected.txt (282255 => 282256)
--- trunk/LayoutTests/platform/mac/fast/dynamic/insert-before-table-part-in-continuation-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/platform/mac/fast/dynamic/insert-before-table-part-in-continuation-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -40,7 +40,7 @@
RenderTable at (40,0) size 106x18
RenderTableSection (anonymous) at (0,0) size 105x18
RenderTableRow (anonymous) at (0,0) size 105x18
- RenderTableCell {TD} at (0,0) size 0x0 [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (0,14) size 0x0 [r=0 c=0 rs=1 cs=1]
RenderTableCell {DIV} at (0,0) size 105x18 [r=0 c=1 rs=1 cs=1]
RenderText {#text} at (0,0) size 105x18
text run at (0,0) width 105: "...continues here"
Modified: trunk/LayoutTests/platform/mac/http/tests/misc/acid2-expected.txt (282255 => 282256)
--- trunk/LayoutTests/platform/mac/http/tests/misc/acid2-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/platform/mac/http/tests/misc/acid2-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -35,10 +35,10 @@
RenderTable {UL} at (96,192) size 48x12 [bgcolor=#FF0000]
RenderTableSection (anonymous) at (0,0) size 48x12
RenderTableRow (anonymous) at (0,0) size 48x12
- RenderTableCell {LI} at (0,0) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {LI} at (0,12) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
RenderTableCell (anonymous) at (12,0) size 12x12 [r=0 c=1 rs=1 cs=1]
RenderTable {LI} at (0,0) size 12x12 [bgcolor=#000000]
- RenderTableCell {LI} at (24,0) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
+ RenderTableCell {LI} at (24,12) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
RenderTableCell (anonymous) at (36,0) size 12x12 [r=0 c=3 rs=1 cs=1]
RenderListItem {LI} at (0,0) size 12x12 [bgcolor=#000000]
layer at (48,2842) size 740x10 scrollHeight 276
Modified: trunk/LayoutTests/platform/mac/http/tests/misc/acid2-pixel-expected.txt (282255 => 282256)
--- trunk/LayoutTests/platform/mac/http/tests/misc/acid2-pixel-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/platform/mac/http/tests/misc/acid2-pixel-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -35,10 +35,10 @@
RenderTable {UL} at (96,192) size 48x12 [bgcolor=#FF0000]
RenderTableSection (anonymous) at (0,0) size 48x12
RenderTableRow (anonymous) at (0,0) size 48x12
- RenderTableCell {LI} at (0,0) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {LI} at (0,12) size 12x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
RenderTableCell (anonymous) at (12,0) size 12x12 [r=0 c=1 rs=1 cs=1]
RenderTable {LI} at (0,0) size 12x12 [bgcolor=#000000]
- RenderTableCell {LI} at (24,0) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
+ RenderTableCell {LI} at (24,12) size 12x0 [bgcolor=#000000] [r=0 c=2 rs=1 cs=1]
RenderTableCell (anonymous) at (36,0) size 12x12 [r=0 c=3 rs=1 cs=1]
RenderListItem {LI} at (0,0) size 12x12 [bgcolor=#000000]
layer at (48,276) size 740x10 scrollHeight 276
Modified: trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug3037-1-expected.txt (282255 => 282256)
--- trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug3037-1-expected.txt 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug3037-1-expected.txt 2021-09-10 03:04:42 UTC (rev 282256)
@@ -24,7 +24,7 @@
RenderText {#text} at (0,0) size 33x18
text run at (0,0) width 33: "Back"
RenderText {#text} at (0,0) size 0x0
- RenderTableCell {HTML:SPAN} at (32,0) size 0x0 [r=0 c=1 rs=1 cs=1]
+ RenderTableCell {HTML:SPAN} at (32,14) size 0x0 [r=0 c=1 rs=1 cs=1]
RenderInline {HTML:INPUT} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
Modified: trunk/Source/WebCore/ChangeLog (282255 => 282256)
--- trunk/Source/WebCore/ChangeLog 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/Source/WebCore/ChangeLog 2021-09-10 03:04:42 UTC (rev 282256)
@@ -1,3 +1,19 @@
+2021-09-09 Alan Bujtas <[email protected]>
+
+ [Table layout] Incorrect vertical position when the inline level box has 0px used height.
+ https://bugs.webkit.org/show_bug.cgi?id=230118
+
+ Reviewed by Antti Koivisto.
+
+ Intrinsic padding is used in table cells to offset the content with their alignments as the content box may not be as tall as the cell itself.
+ This patch ensures that zero height content (where the baseline is also 0) gets the alignment offset as well.
+ (This patch also fixes the bug where we may reset the intrinsic padding to 0 on subsequent layouts.)
+
+ Test: fast/table/vertical-position-with-0-height-box.html
+
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::computeIntrinsicPadding):
+
2021-09-09 Diego Pino Garcia <[email protected]>
Build fix for Ubuntu LTS and Debian after r282211
Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (282255 => 282256)
--- trunk/Source/WebCore/rendering/RenderTableCell.cpp 2021-09-10 02:25:00 UTC (rev 282255)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp 2021-09-10 03:04:42 UTC (rev 282256)
@@ -208,7 +208,7 @@
LayoutUnit oldIntrinsicPaddingAfter = intrinsicPaddingAfter();
LayoutUnit logicalHeightWithoutIntrinsicPadding = logicalHeight() - oldIntrinsicPaddingBefore - oldIntrinsicPaddingAfter;
- LayoutUnit intrinsicPaddingBefore;
+ auto intrinsicPaddingBefore = oldIntrinsicPaddingBefore;
switch (style().verticalAlign()) {
case VerticalAlign::Sub:
case VerticalAlign::Super:
@@ -216,8 +216,9 @@
case VerticalAlign::TextBottom:
case VerticalAlign::Length:
case VerticalAlign::Baseline: {
- LayoutUnit baseline = cellBaselinePosition();
- if (baseline > borderAndPaddingBefore())
+ auto baseline = cellBaselinePosition();
+ auto needsIntrinsicPadding = baseline > borderAndPaddingBefore() || !logicalHeight();
+ if (needsIntrinsicPadding)
intrinsicPaddingBefore = section()->rowBaseline(rowIndex()) - (baseline - oldIntrinsicPaddingBefore);
break;
}