position-area-ambiguous-self.html (1059B)
1 <!DOCTYPE html> 2 <title>CSS Anchor Positioning: position-area with writing-mode and direction</title> 3 <link rel="help" href="https://drafts.csswg.org/css-anchor-position/#position-area"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <style> 7 #abs-container { 8 writing-mode: vertical-lr; 9 position: absolute; 10 width: 400px; 11 height: 400px; 12 } 13 #anchor { 14 anchor-name: --a; 15 width: 100px; 16 height: 100px; 17 } 18 #anchored { 19 position: absolute; 20 writing-mode: horizontal-tb; 21 direction: rtl; 22 position-anchor: --a; 23 position-area: self-end self-start; 24 width: 100px; 25 height: 100px; 26 } 27 </style> 28 <div id="abs-container"> 29 <div id="anchor"></div> 30 <div id="anchored"></div> 31 </div> 32 <script> 33 test(() => { 34 assert_equals(anchored.offsetTop, 100, "positioned below the anchor"); 35 assert_equals(anchored.offsetLeft, 100, "positioned to the right of the anchor"); 36 }, "'self-end self-start' of horizontal-tb/rtl is physically 'bottom right'"); 37 </script>