anchor-fixed-pos-descendant.html (962B)
1 <!doctype html> 2 <title>Anchor positioning to your own descendant shouldn't work</title> 3 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=2005461"> 4 <link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/#target"> 5 <link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> 6 <link rel="author" href="https://mozilla.com" title="Mozilla"> 7 <link rel="match" href="anchor-fixed-pos-descendant-ref.html"> 8 <style> 9 p { 10 display: block; 11 outline: 1px solid; 12 height: 1lh; 13 anchor-name: --foo; 14 anchor-scope: --foo; 15 overflow: hidden; 16 resize: horizontal; 17 } 18 19 p > span { 20 position: fixed; 21 pointer-events: none; 22 inset: anchor(--foo inside); 23 left: anchor(--anchor right, 0); 24 right: anchor(--foo right, 0); 25 26 &::before { 27 content: ""; 28 position: absolute; 29 inset: 0; 30 anchor-name: --anchor; 31 width: 10px; 32 background-color: pink; 33 } 34 } 35 </style> 36 <p style="width: 100px"><span></span></p>