aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2023-04-14 11:15:16 +0200
committerMartin Robinson <mrobinson@igalia.com>2023-04-14 11:17:26 +0200
commitc23f05583bfcf025e531dc7e87fd1ce49ad7cde4 (patch)
tree0f3b78f8ac740a1671fb89dff1c41b1bca208538
parent15f966bde5985d02b4a35b1078d44a3023dcf382 (diff)
downloadservo-c23f05583bfcf025e531dc7e87fd1ce49ad7cde4.tar.gz
servo-c23f05583bfcf025e531dc7e87fd1ce49ad7cde4.zip
Fix calculation of block axis for abspos elements
The calculation of the block axis positioning of absolutely positioned elements was using the inline size of the containing block instead of the block size.
-rw-r--r--components/layout_2020/positioned.rs3
-rw-r--r--tests/wpt/metadata-layout-2020/css/CSS2/backgrounds/background-position-152.xht.ini2
-rw-r--r--tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/height-percentage-003.xht.ini2
-rw-r--r--tests/wpt/metadata-layout-2020/css/CSS2/positioning/bottom-offset-percentage-001.xht.ini2
-rw-r--r--tests/wpt/metadata-layout-2020/css/CSS2/positioning/left-offset-percentage-002.xht.ini2
-rw-r--r--tests/wpt/metadata-layout-2020/css/CSS2/positioning/top-offset-percentage-001.xht.ini2
-rw-r--r--tests/wpt/metadata-layout-2020/css/CSS2/positioning/top-offset-percentage-002.xht.ini2
-rw-r--r--tests/wpt/metadata-layout-2020/css/CSS2/visuren/position-absolute-percentage-inherit-001.xht.ini2
-rw-r--r--tests/wpt/metadata-layout-2020/css/css-position/position-absolute-dynamic-containing-block.html.ini12
-rw-r--r--tests/wpt/metadata-layout-2020/css/css-position/position-absolute-fit-content.html.ini2
10 files changed, 3 insertions, 28 deletions
diff --git a/components/layout_2020/positioned.rs b/components/layout_2020/positioned.rs
index 4527de651d6..2580d4af9bc 100644
--- a/components/layout_2020/positioned.rs
+++ b/components/layout_2020/positioned.rs
@@ -458,8 +458,7 @@ impl HoistedAbsolutelyPositionedBox {
};
let solve_block_axis = |computed_size| {
solve_axis(
- // TODO(delan) shouldn’t this be cbbs?
- cbis,
+ cbbs,
pbm.padding_border_sums.block,
pbm.margin.block_start,
pbm.margin.block_end,
diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/backgrounds/background-position-152.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/backgrounds/background-position-152.xht.ini
deleted file mode 100644
index 1b384364eb1..00000000000
--- a/tests/wpt/metadata-layout-2020/css/CSS2/backgrounds/background-position-152.xht.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[background-position-152.xht]
- expected: FAIL
diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/height-percentage-003.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/height-percentage-003.xht.ini
deleted file mode 100644
index 030729ac98f..00000000000
--- a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/height-percentage-003.xht.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[height-percentage-003.xht]
- expected: FAIL
diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/bottom-offset-percentage-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/positioning/bottom-offset-percentage-001.xht.ini
deleted file mode 100644
index 4f0220cbfd5..00000000000
--- a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/bottom-offset-percentage-001.xht.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[bottom-offset-percentage-001.xht]
- expected: FAIL
diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/left-offset-percentage-002.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/positioning/left-offset-percentage-002.xht.ini
deleted file mode 100644
index 1da7d09df26..00000000000
--- a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/left-offset-percentage-002.xht.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[left-offset-percentage-002.xht]
- expected: FAIL
diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/top-offset-percentage-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/positioning/top-offset-percentage-001.xht.ini
deleted file mode 100644
index c9007fc8873..00000000000
--- a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/top-offset-percentage-001.xht.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[top-offset-percentage-001.xht]
- expected: FAIL
diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/top-offset-percentage-002.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/positioning/top-offset-percentage-002.xht.ini
deleted file mode 100644
index a3cf8681178..00000000000
--- a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/top-offset-percentage-002.xht.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[top-offset-percentage-002.xht]
- expected: FAIL
diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/visuren/position-absolute-percentage-inherit-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/visuren/position-absolute-percentage-inherit-001.xht.ini
deleted file mode 100644
index 2a0ad5f976c..00000000000
--- a/tests/wpt/metadata-layout-2020/css/CSS2/visuren/position-absolute-percentage-inherit-001.xht.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[position-absolute-percentage-inherit-001.xht]
- expected: FAIL
diff --git a/tests/wpt/metadata-layout-2020/css/css-position/position-absolute-dynamic-containing-block.html.ini b/tests/wpt/metadata-layout-2020/css/css-position/position-absolute-dynamic-containing-block.html.ini
index b70e581ff49..f5ed122006b 100644
--- a/tests/wpt/metadata-layout-2020/css/css-position/position-absolute-dynamic-containing-block.html.ini
+++ b/tests/wpt/metadata-layout-2020/css/css-position/position-absolute-dynamic-containing-block.html.ini
@@ -1,16 +1,4 @@
[position-absolute-dynamic-containing-block.html]
- [abs containing block moves from outer to intermediate]
- expected: FAIL
-
- [abs containing block moves from intermediate to outer]
- expected: FAIL
-
- [target is no longer absolute]
- expected: FAIL
-
- [target becomes absolute]
- expected: FAIL
-
[fixed containing block moves from outer to intermediate]
expected: FAIL
diff --git a/tests/wpt/metadata-layout-2020/css/css-position/position-absolute-fit-content.html.ini b/tests/wpt/metadata-layout-2020/css/css-position/position-absolute-fit-content.html.ini
new file mode 100644
index 00000000000..c8b541f3150
--- /dev/null
+++ b/tests/wpt/metadata-layout-2020/css/css-position/position-absolute-fit-content.html.ini
@@ -0,0 +1,2 @@
+[position-absolute-fit-content.html]
+ expected: FAIL