diff --git a/components/layout/table/layout.rs b/components/layout/table/layout.rs index d8d0ebc923a..9fccce4c927 100644 --- a/components/layout/table/layout.rs +++ b/components/layout/table/layout.rs @@ -2819,12 +2819,11 @@ impl TableSlotCell { let cell_content_rect = cell_rect.deflate(&(layout.padding + layout.border)); let content_block_size = layout.layout.content_block_size; + let free_space = || Au::zero().max(cell_content_rect.size.block - content_block_size); let vertical_align_offset = match self.effective_vertical_align() { VerticalAlignKeyword::Top => Au::zero(), - VerticalAlignKeyword::Bottom => cell_content_rect.size.block - content_block_size, - VerticalAlignKeyword::Middle => { - (cell_content_rect.size.block - content_block_size).scale_by(0.5) - }, + VerticalAlignKeyword::Bottom => free_space(), + VerticalAlignKeyword::Middle => free_space().scale_by(0.5), _ => { cell_baseline - (layout.padding.block_start + layout.border.block_start) - diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json index 6c6c7df1e42..7c10d47ac30 100644 --- a/tests/wpt/meta/MANIFEST.json +++ b/tests/wpt/meta/MANIFEST.json @@ -126411,6 +126411,62 @@ {} ] ], + "align-content-table-cell-002.html": [ + "1082be469bfa7fa23981ebd3793d7d321901640a", + [ + null, + [ + [ + "/css/reference/ref-filled-green-300px-square.html", + "==" + ] + ], + {} + ] + ], + "align-content-table-cell-003.html": [ + "cf156a07bf9ae928ae0a69d566e27042fc4b52d7", + [ + null, + [ + [ + "/css/reference/ref-filled-green-300px-square.html", + "==" + ] + ], + {} + ] + ], + "align-content-table-cell-004.html": [ + "103c95947cd842b1ecb55d54f9e20097911794d1", + [ + null, + [ + [ + "/css/reference/ref-filled-green-300px-square.html", + "==" + ] + ], + {} + ] + ], + "align-content-table-cell-005.html": [ + "b311489d44445c3811ed792ed7fc4fc86690cac5", + [ + null, + [ + [ + "/css/reference/ref-filled-green-300px-square.html", + "==" + ], + [ + "/css/css-align/blocks/align-content-table-cell-005-ref-alt.html", + "==" + ] + ], + {} + ] + ], "justify-items-anonymous.html": [ "641dea1f54b2f0cea29bc4c4c82e023a479e3d3c", [ @@ -424536,6 +424592,10 @@ "align-content-block-overflow-000-ref.html": [ "8ca5407e4ca0a65d3a98e322c90d4cada8fef15b", [] + ], + "align-content-table-cell-005-ref-alt.html": [ + "771c8f72adf18d011985a002d67e9519c1fa3900", + [] ] }, "content-distribution": { diff --git a/tests/wpt/meta/css/css-align/blocks/align-content-table-cell-004.html.ini b/tests/wpt/meta/css/css-align/blocks/align-content-table-cell-004.html.ini new file mode 100644 index 00000000000..c9a27f17e43 --- /dev/null +++ b/tests/wpt/meta/css/css-align/blocks/align-content-table-cell-004.html.ini @@ -0,0 +1,2 @@ +[align-content-table-cell-004.html] + expected: FAIL diff --git a/tests/wpt/meta/css/css-align/blocks/align-content-table-cell-005.html.ini b/tests/wpt/meta/css/css-align/blocks/align-content-table-cell-005.html.ini new file mode 100644 index 00000000000..e64e9c99ba5 --- /dev/null +++ b/tests/wpt/meta/css/css-align/blocks/align-content-table-cell-005.html.ini @@ -0,0 +1,2 @@ +[align-content-table-cell-005.html] + expected: FAIL diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-table-cell-002.html b/tests/wpt/tests/css/css-align/blocks/align-content-table-cell-002.html new file mode 100644 index 00000000000..1082be469bf --- /dev/null +++ b/tests/wpt/tests/css/css-align/blocks/align-content-table-cell-002.html @@ -0,0 +1,45 @@ + + + + + + + + + + +
Test passes if there is a filled green square and no red.
+ ++ | + | + + + + |
Test passes if there is a filled green square and no red.
+ ++ | + | + + + + |
Test passes if there is a filled green square and no red.
+ ++ | + | + + + + |
Test passes if there is a filled green square and no red.
+ + + + + + + + diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-table-cell-005.html b/tests/wpt/tests/css/css-align/blocks/align-content-table-cell-005.html new file mode 100644 index 00000000000..b311489d444 --- /dev/null +++ b/tests/wpt/tests/css/css-align/blocks/align-content-table-cell-005.html @@ -0,0 +1,45 @@ + + + + + + + + + + + +Test passes if there is a filled green square and no red.
+ ++ | + | + + + + |