diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/css-anchor-position/anchor-non-oof-inherit.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-anchor-position/anchor-non-oof-inherit.html')
-rw-r--r-- | testing/web-platform/tests/css/css-anchor-position/anchor-non-oof-inherit.html | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-anchor-position/anchor-non-oof-inherit.html b/testing/web-platform/tests/css/css-anchor-position/anchor-non-oof-inherit.html new file mode 100644 index 0000000000..75f98a1ebf --- /dev/null +++ b/testing/web-platform/tests/css/css-anchor-position/anchor-non-oof-inherit.html @@ -0,0 +1,117 @@ +<!DOCTYPE html> +<title>Tests that anchor functions can be inherited from in-flow elements</title> +<link rel="help" href="https://drafts4.csswg.org/css-anchor-position-1/"> +<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1382151"> +<link rel="author" href="mailto:xiaochengh@chromium.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/check-layout-th.js"></script> +<script src="support/test-common.js"></script> + +<style> +.cb { + width: 200px; + height: 200px; + transform: scale(1); +} + +.anchor { + width: 100px; + height: 100px; + top: 50px; + left: 50px; + position: relative; + background: red; + anchor-name: --a; +} + +.target { + position: absolute; + background: green; + top: inherit; + bottom: inherit; + left: inherit; + right: inherit; + width: inherit; + min-width: inherit; + max-width: inherit; + height: inherit; + min-height: inherit; + max-height: inherit; +} + +.inset-parent { + top: anchor(--a top); + bottom: anchor(--a bottom); + left: anchor(--a left); + right: anchor(--a right); +} + +.size-parent { + width: anchor-size(--a width); + height: anchor-size(--a height); + top: 50px; + left: 50px; +} + +.min-size-parent { + min-width: anchor-size(--a width); + min-height: anchor-size(--a height); + top: 50px; + left: 50px; + bottom: 200px; + right: 200px; +} + +.max-size-parent { + max-width: anchor-size(--a width); + max-height: anchor-size(--a height); + top: 50px; + left: 50px; + bottom: 0px; + right: 0px; +} + +</style> + +<body onload="checkLayoutForAnchorPos('.target')"> + +<p>In each test case, we should see a filled green square with no red.</p> + +<div class=cb> + <div class="anchor"></div> + <div class="inset-parent"> + <div class="target" + data-offset-x=50 data-offset-y=50 + data-expected-width=100 data-expected-height=100></div> + </div> +</div> + +<div class=cb> + <div class="anchor"></div> + <div class="size-parent"> + <div class="target" + data-offset-x=50 data-offset-y=50 + data-expected-width=100 data-expected-height=100></div> + </div> +</div> + +<div class=cb> + <div class="anchor"></div> + <div class="min-size-parent"> + <div class="target" + data-offset-x=50 data-offset-y=50 + data-expected-width=100 data-expected-height=100></div> + </div> +</div> + +<div class=cb> + <div class="anchor"></div> + <div class="max-size-parent"> + <div class="target" + data-offset-x=50 data-offset-y=50 + data-expected-width=100 data-expected-height=100></div> + </div> +</div> + +</body> |