Skip to content

Commit

Permalink
[inset-area] Test for computed inset values
Browse files Browse the repository at this point in the history
As part of the proposal in [1], inset-area affects inset properties at
used value time. Testing with typed-om since inset properties use
resolved values for getComputedStyle.

[1] w3c/csswg-drafts#9598 (comment)

Bug: 1477314
Change-Id: I2db25b3546c6553b36f8b9cfd88aa4d906e7ea28
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5063151
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1230573}
  • Loading branch information
Rune Lillesveen authored and chromium-wpt-export-bot committed Nov 29, 2023
1 parent bf668a7 commit 8fe2483
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions css/css-anchor-position/inset-area-computed-insets.tentative.html
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<title>CSS Anchor Positioning: inset-area should not affect computed inset values</title>
<link rel="help" href="https://drafts.csswg.org/css-anchor-position/#inset-area">
<lnik rel="help" href="https://github.com/w3c/csswg-drafts/issues/9598">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/css-typed-om/resources/testhelper.js"></script>
<style>
#abs {
position: absolute;
inset-area: all;
}
</style>
<div id="abs"></div>
<script>
test(() => {
let style = abs.computedStyleMap();
assert_equals(style.get("inset-area").toString(), "all", "inset-area is supported");
assert_style_value_equals(style.get("left"), new CSSKeywordValue("auto"));
assert_style_value_equals(style.get("right"), new CSSKeywordValue("auto"));
assert_style_value_equals(style.get("top"), new CSSKeywordValue("auto"));
assert_style_value_equals(style.get("bottom"), new CSSKeywordValue("auto"));
}, "inset-area does not affect insets at computed value time");
</script>

0 comments on commit 8fe2483

Please sign in to comment.