From ed07b2da49e8c6bb6181ef9192e57493ca100207 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 15 Oct 2024 10:05:15 +0000 Subject: [PATCH] Bug 1923675 [wpt PR 48542] - [css-anchor-position] Allow anchor-size() for insets and margins, a=testonly Automatic update from web-platform-tests [css-anchor-position] Allow anchor-size() for insets and margins Per resolution in [1] Added tests for actually checking that anchor-size() function does apply to margins and insets. [1] https://github.com/w3c/csswg-drafts/issues/9827#issuecomment-2160430157 Bug: 346521300 Change-Id: I1d47feb6d4a3bd41c8860c3a5982025ee18fe0c4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5916307 Reviewed-by: Mason Freed Commit-Queue: Rune Lillesveen Cr-Commit-Position: refs/heads/main{#1366397} -- wpt-commits: c8bf0721b97644be612635c67c66275f8aa2c0c4 wpt-pr: 48542 UltraBlame original commit: 4ce68089d7d32da9f0f04bbb3b9f8c7f59290720 --- .../anchor-invalid-fallback.html | 26 - .../anchor-parse-invalid.html | 4 - .../css-anchor-position/anchor-size-001.html | 528 ++++++++++++++++++ 3 files changed, 528 insertions(+), 30 deletions(-) diff --git a/testing/web-platform/tests/css/css-anchor-position/anchor-invalid-fallback.html b/testing/web-platform/tests/css/css-anchor-position/anchor-invalid-fallback.html index 232bf31821f70..f402a744fec2e 100644 --- a/testing/web-platform/tests/css/css-anchor-position/anchor-invalid-fallback.html +++ b/testing/web-platform/tests/css/css-anchor-position/anchor-invalid-fallback.html @@ -1228,32 +1228,6 @@ test_ref ( ' -top -: -anchor -- -size -( -- -- -a -width -) -' -' -anchor -- -size -( -) -in -inset -' -) -; -test_ref -( -' width : anchor diff --git a/testing/web-platform/tests/css/css-anchor-position/anchor-parse-invalid.html b/testing/web-platform/tests/css/css-anchor-position/anchor-parse-invalid.html index 44a6a4dd04169..3ca1574199273 100644 --- a/testing/web-platform/tests/css/css-anchor-position/anchor-parse-invalid.html +++ b/testing/web-platform/tests/css/css-anchor-position/anchor-parse-invalid.html @@ -506,8 +506,6 @@ - size ( -- -- bar height ) @@ -615,8 +613,6 @@ - size ( -- -- baz height ) diff --git a/testing/web-platform/tests/css/css-anchor-position/anchor-size-001.html b/testing/web-platform/tests/css/css-anchor-position/anchor-size-001.html index eef6d6091e85c..0e9f6fd4c6f15 100644 --- a/testing/web-platform/tests/css/css-anchor-position/anchor-size-001.html +++ b/testing/web-platform/tests/css/css-anchor-position/anchor-size-001.html @@ -661,6 +661,320 @@ ! - - +anchor +- +size +( +) +in +insets +- +- +> +< +div +class += +" +target +" +style += +" +left +: +anchor +- +size +( +- +- +a1 +width +) +" +data +- +offset +- +x += +5 +> +< +/ +div +> +< +div +class += +" +target +" +style += +" +top +: +anchor +- +size +( +- +- +a1 +height +) +" +data +- +offset +- +y += +7 +> +< +/ +div +> +< +div +class += +" +target +" +style += +" +left +: +anchor +- +size +( +- +- +a1 +height +) +" +data +- +offset +- +x += +7 +> +< +/ +div +> +< +div +class += +" +target +" +style += +" +top +: +anchor +- +size +( +- +- +a1 +width +" +data +- +offset +- +y += +5 +> +< +/ +div +> +< +! +- +- +anchor +- +size +( +) +in +margins +- +- +> +< +div +class += +" +target +" +style += +" +margin +- +left +: +anchor +- +size +( +- +- +a1 +width +) +" +data +- +expected +- +margin +- +left += +5 +> +< +/ +div +> +< +div +class += +" +target +" +style += +" +margin +- +top +: +anchor +- +size +( +- +- +a1 +height +) +" +data +- +expected +- +margin +- +top += +7 +> +< +/ +div +> +< +div +class += +" +target +" +style += +" +margin +- +right +: +anchor +- +size +( +- +- +a1 +height +) +" +data +- +expected +- +margin +- +right += +7 +> +< +/ +div +> +< +div +class += +" +target +" +style += +" +margin +- +bottom +: +anchor +- +size +( +- +- +a1 +width +" +data +- +expected +- +margin +- +bottom += +5 +> +< +/ +div +> +< +! +- +- Implicit < anchor @@ -737,6 +1051,220 @@ div > < +div +class += +" +target +" +style += +" +left +: +anchor +- +size +( +- +- +a1 +) +" +data +- +offset +- +x += +5 +> +< +/ +div +> +< +div +class += +" +target +" +style += +" +top +: +anchor +- +size +( +- +- +a1 +) +" +data +- +offset +- +y += +7 +> +< +/ +div +> +< +div +class += +" +target +" +style += +" +margin +- +left +: +anchor +- +size +( +- +- +a1 +) +" +data +- +expected +- +margin +- +left += +5 +> +< +/ +div +> +< +div +class += +" +target +" +style += +" +margin +- +right +: +anchor +- +size +( +- +- +a1 +) +" +data +- +expected +- +margin +- +right += +5 +> +< +/ +div +> +< +div +class += +" +target +" +style += +" +margin +- +top +: +anchor +- +size +( +- +- +a1 +) +" +data +- +expected +- +margin +- +top += +7 +> +< +/ +div +> +< +div +class += +" +target +" +style += +" +margin +- +bottom +: +anchor +- +size +( +- +- +a1 +) +" +data +- +expected +- +margin +- +bottom += +7 +> +< +/ +div +> +< / div >