Re: [csswg-drafts] [selectors] `/idref()/` combinator to follow element references for arbitrary IDREF attributes (#10970)

> Perhaps worth noting that the HTML spec makes no mention of "idref", nor does MDN. HTML refers to the reflection of an element from an attribute as an ["attr-associated element"](https://html.spec.whatwg.org/#attr-associated-element), and MDN doesn't really strongly associate these IDL properties or content attributes with a specifically named concept. While "idref" might be used as a name by some developers, it seems to be an archaic term that is perhaps borrowed from XSLT, which I believe defined it?
> 
> The point being, while I hold no objection to using idref (others might though), I think there is lots of opportunity for us to pick a better name that is either more ergonomic or more meaningful for developers.

Agreed (archaic indeed — the name comes from XML), though I can't think of a better name for the concept that is hardcoded to ids. Perhaps that's another argument for a parameterized version where both the source attribute and the referencing attribute are passed as parameters every time (see #12446). If we call it `ref()` it is only 1 character longer than `idref()`. 

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


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

Received on Monday, 7 July 2025 19:06:20 UTC