summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-anchor-position/anchor-center-vrl-vrl.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/css-anchor-position/anchor-center-vrl-vrl.html
parentInitial commit. (diff)
downloadfirefox-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-center-vrl-vrl.html')
-rw-r--r--testing/web-platform/tests/css/css-anchor-position/anchor-center-vrl-vrl.html85
1 files changed, 85 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-anchor-position/anchor-center-vrl-vrl.html b/testing/web-platform/tests/css/css-anchor-position/anchor-center-vrl-vrl.html
new file mode 100644
index 0000000000..d314dc7f2f
--- /dev/null
+++ b/testing/web-platform/tests/css/css-anchor-position/anchor-center-vrl-vrl.html
@@ -0,0 +1,85 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/">
+<title>Tests the position and available-size of 'anchor-center' alignment with different insets.</title>
+<style>
+.container {
+ writing-mode: vertical-rl;
+ width: 100px;
+ height: 100px;
+ border: solid 3px;
+ position: relative;
+ margin: 50px;
+}
+
+.anchor {
+ anchor-name: --anchor;
+ position: relative;
+ width: 50px;
+ height: 50px;
+ right: 40px;
+ top: 40px;
+ background: lime;
+}
+
+.target {
+ anchor-default: --anchor;
+ position: absolute;
+ background: cyan;
+ justify-self: anchor-center;
+ right: anchor(left);
+ width: 20px;
+}
+/* used to test the available-size given to the element */
+.target::after {
+ color: transparent;
+ content: 'a a a a a a a a a a a a a a a a a a';
+}
+</style>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/check-layout-th.js"></script>
+
+<body onload="checkLayout('.target')">
+
+<!-- no insets -->
+<div class="container">
+ <div class="anchor"></div>
+ <div class="target" data-expected-height="70" data-offset-y="30"></div>
+</div>
+
+<!-- single insets -->
+<div class="container">
+ <div class="anchor"></div>
+ <div class="target" style="top: 20px;" data-expected-height="70" data-offset-y="30"></div>
+</div>
+
+<div class="container">
+ <div class="anchor"></div>
+ <div class="target" style="bottom: 20px;" data-expected-height="30" data-offset-y="50"></div>
+</div>
+
+<div class="container">
+ <div class="anchor"></div>
+ <div class="target" style="bottom: -20px;" data-expected-height="110" data-offset-y="10"></div>
+</div>
+
+<div class="container">
+ <div class="anchor"></div>
+ <div class="target" style="bottom: -100px;" data-expected-height="130" data-offset-y="0"></div>
+</div>
+
+<!-- both insets -->
+<div class="container">
+ <div class="anchor"></div>
+ <div class="target" style="top: 10px; bottom: 20px;" data-expected-height="30" data-offset-y="50"></div>
+</div>
+
+<div class="container">
+ <div class="anchor"></div>
+ <div class="target" style="top: 10px; bottom: -20px;" data-expected-height="110" data-offset-y="10"></div>
+</div>
+
+<div class="container">
+ <div class="anchor"></div>
+ <div class="target" style="top: -10px; bottom: -50px;" data-expected-height="150" data-offset-y="-10"></div>
+</div>