commit ed88a0583f7e9b59b52398d664d8019677a298b3
parent f2e4ee452cab5b2c28809768f303e479d20ab7cb
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date: Thu, 16 Oct 2025 18:23:10 +0000
Bug 1994673 - Adjust try-tactic-alignment to test rendering. r=layout-anchor-positioning-reviewers,dshin
Make try-tactic-alignment test the actual rendering, not
getComputedStyle result, in order to not depend on whether the
@position-try style is exposed via that API.
Differential Revision: https://phabricator.services.mozilla.com/D268913
Diffstat:
2 files changed, 9 insertions(+), 37 deletions(-)
diff --git a/testing/web-platform/meta/css/css-anchor-position/try-tactic-alignment.html.ini b/testing/web-platform/meta/css/css-anchor-position/try-tactic-alignment.html.ini
@@ -1,40 +1,4 @@
[try-tactic-alignment.html]
- [, justify-self:start]
- expected: FAIL
-
- [, justify-self:end]
- expected: FAIL
-
- [, justify-self:self-start]
- expected: FAIL
-
- [, justify-self:self-end]
- expected: FAIL
-
- [, justify-self:flex-start]
- expected: FAIL
-
- [, justify-self:flex-end]
- expected: FAIL
-
- [, align-self:start]
- expected: FAIL
-
- [, align-self:end]
- expected: FAIL
-
- [, align-self:self-start]
- expected: FAIL
-
- [, align-self:self-end]
- expected: FAIL
-
- [, align-self:flex-start]
- expected: FAIL
-
- [, align-self:flex-end]
- expected: FAIL
-
[flip-inline, justify-self:start]
expected: FAIL
diff --git a/testing/web-platform/tests/css/css-anchor-position/try-tactic-alignment.html b/testing/web-platform/tests/css/css-anchor-position/try-tactic-alignment.html
@@ -148,8 +148,16 @@ function test_computed_value(try_tactic, property, value, expected) {
#target {
position-try-fallbacks: --pf ${try_tactic};
}
+ @position-try --ref {
+ inset: 0;
+ ${property}:${expected};
+ }
+ #ref {
+ position-try-fallbacks: --ref;
+ }
`;
- assert_equals(getComputedStyle(target).getPropertyValue(property), expected);
+ assert_equals(target.offsetLeft, ref.offsetLeft, 'offsetLeft');
+ assert_equals(target.offsetTop, ref.offsetTop, 'offsetTop');
}, `${try_tactic}, ${property}:${value}`);
}