summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-anchor-position/at-position-try-cssom.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/css-anchor-position/at-position-try-cssom.html')
-rw-r--r--testing/web-platform/tests/css/css-anchor-position/at-position-try-cssom.html17
1 files changed, 11 insertions, 6 deletions
diff --git a/testing/web-platform/tests/css/css-anchor-position/at-position-try-cssom.html b/testing/web-platform/tests/css/css-anchor-position/at-position-try-cssom.html
index d4a1f4fa24..91172c5185 100644
--- a/testing/web-platform/tests/css/css-anchor-position/at-position-try-cssom.html
+++ b/testing/web-platform/tests/css/css-anchor-position/at-position-try-cssom.html
@@ -6,7 +6,7 @@
<script src="/resources/testharnessreport.js"></script>
<div id="anchor"></div>
-<div id="not-anchor"></div>
+<div id="other-anchor"></div>
<div id="target"></div>
<script>
@@ -32,12 +32,12 @@ test(t => {
test(t => {
const style = createStyle(t, `
@position-try --pf { top: anchor(top); left: 0; }
- #anchor, #not-anchor, #target {
+ #anchor, #other-anchor, #target {
position: absolute; width: 100px; height: 100px;
}
#anchor { top: 100px; left: 0; anchor-name: --a; }
- #not-anchor { top: 200px; left: 0; anchor-name: --b; }
- #target { position-try-options: --pf; anchor-default: --a; left: 999999px; }
+ #other-anchor { top: 200px; left: 0; anchor-name: --b; }
+ #target { position-try-options: --pf; position-anchor: --a; left: 999999px; }
`);
const positionTryRule = style.sheet.cssRules[0];
@@ -50,12 +50,17 @@ test(t => {
assert_equals(target.getBoundingClientRect().left, 100);
assert_equals(target.getBoundingClientRect().top, 100);
- // These properties are disallowed in `@position-try` rule, and hence should not affect
+ // This property are disallowed in `@position-try` rule, and hence should not affect
// position fallback.
- positionTryRule.style.setProperty('anchor-default', '--b');
positionTryRule.style.setProperty('position', 'static');
assert_equals(target.getBoundingClientRect().left, 100);
assert_equals(target.getBoundingClientRect().top, 100);
+
+ // `position-anchor` is an allowed property in `@position-try` and should affect position fallback.
+ positionTryRule.style.setProperty('position-anchor', '--b');
+ assert_equals(target.getBoundingClientRect().left, 100);
+ assert_equals(target.getBoundingClientRect().top, 200);
+
}, 'CSSPositionTryRule.style.setProperty setting allowed and disallowed properties');
</script>