- From: Xiaocheng Hu via GitHub <sysbot+gh@w3.org>
- Date: Thu, 20 Jul 2023 21:26:09 +0000
- To: public-css-archive@w3.org
> > We can't use the anchor name on the containing block itself.
>
> I forget why this is the case - is it because the positioned element can trigger scrollbars on the containing block, and thus we don't have the "laid out strictly after" condition, @xiaochengh ?
I don't rememeber exactly. But we already the same issue with the plain positioned layout, e.g.
```html
<style>
body {
height: 0;
overflow: auto;
}
#target {
position: absolute;
width: 100px;
height: 100px;
right: 0;
background: lime;
top: calc(100vh - 10px); /* triggers vertical scrollbar to the right*/
}
</style>
<body>
<div id=target></div>
</body>
```
In the end, `#target` gets right-aligned to the left edge of the scrollbar to the right. It appears that when scrollbars are triggered, we rerun layout with a modified containing block. I haven't looked into the spec/impl to confirm this though.
It seems that we can do the same when anchoring to CB. Just some more layout passes, what can possibly go wrong?
(famous last words)
--
GitHub Notification of comment by xiaochengh
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9045#issuecomment-1644629054 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 20 July 2023 21:26:11 UTC