Bug 1738781 Comment 2 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

If you perform the STR, but click `Replace all, then insert`, then the problem reproduces in Chromium as well.

The reason why it doesn't is because Chrome invalidates the anchor on focus changes (that is, when you click the button), via [`Node::NotifyPriorityScrollAnchorStatusChanged()`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/node.cc;l=1691;drc=279e2ba7a52a23b96d86cce13a76c2aa73248327).

Blink implemented the same behavior as I just did for `content-visibility: auto`... Chris, do you have opinions on this? I think recomputed the anchor if at the time of computation it had dirty children makes some amount of sense to me, it guarantees that we find an optimal anchor without depending on layout timing.

That said for now I could just implement the ["priority candidates" bits](https://drafts.csswg.org/css-scroll-anchoring/#anchor-priority-candidates) from [the relevant spec PR](https://github.com/w3c/csswg-drafts/pull/5050) and punt on this, since it'd paper over most these issues...
If you perform the STR, but click `Replace all, then insert`, then the problem reproduces in Chromium as well.

The reason why it doesn't if you click both buttons separately is because Chrome invalidates the anchor on focus changes (that is, when you click the button), via [`Node::NotifyPriorityScrollAnchorStatusChanged()`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/node.cc;l=1691;drc=279e2ba7a52a23b96d86cce13a76c2aa73248327).

Blink implemented the same behavior as I just did for `content-visibility: auto`... Chris, do you have opinions on this? I think recomputed the anchor if at the time of computation it had dirty children makes some amount of sense to me, it guarantees that we find an optimal anchor without depending on layout timing.

That said for now I could just implement the ["priority candidates" bits](https://drafts.csswg.org/css-scroll-anchoring/#anchor-priority-candidates) from [the relevant spec PR](https://github.com/w3c/csswg-drafts/pull/5050) and punt on this, since it'd paper over most these issues...

Back to Bug 1738781 Comment 2