Re: [csswg-drafts] [css-anchor-position-1][css-display-4] Anchor Positioning and Display Order (#9356)

Hm, okay, then let's step back and rephrase a little.

So, Anchor Positioning is a pretty generic layout feature (an elaboration on the existing `position: absolute;`) that lets an element set its position relative to *one or more* other elements on the page. The *common* use-case is something like a popup, where the positioned element is being placed adjacent to *one* element in the page. But there is a wide variety of other things you can achieve with this functionality, where the tab-order relationship between the positioned element and the anchors is either *unclear*, or there is in fact *no* such relationship. For example, you can use a *container element* as an anchor, and position yourself in one of the corners - this is indistingishable, stylistically, from the popup case, but almost certainly doesn't want the popup to have some particular tab-order relationship with the container. 

Further, *for* that common use-case I mentioned, the Popover API is intended to capture most such examples; further elaborations like the `interesttarget` proposal do even more. Using Popover or its sub-features *does* clearly establish a semantic link between the invoker and the popup, which we *do* rely on for tab-order fixup - that's already built into the feature.

You mention a few other features, like ARIA Annotations, which similarly might *use* anchor positioning to style themselves, but which don't rely *on the anchor positioning* to establish the semantic link between the two elements; instead, it's established by the other feature.

So, since the generic CSS behavior can do a whole lot of things, and doesn't consistently establish a clear semantic relationship, I'm arguing that we do *not* want to attempt to infer any such relationship from the styles and reshuffle tab-order accordingly. Instead, we want to rely on more targeted features like Popover, ARIA Annotations, etc. to establish such linking, and those features will usually simply *use* anchor positioning for their own styling.

Does this sound reasonable? Or do you have other examples you're thinking of where a semantic relationship would be conveyed *solely* (and ideally *reliably*) by the presence of some detectable pattern of Anchor Positioning usage, and there's no other, more reliable/preferable way to establish that relationship (in markup, script, or otherwise)?

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9356#issuecomment-2087422256 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 30 April 2024 21:38:49 UTC