-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference Target: what type should the referenceTarget
attribute be?
#1093
Comments
I think of Most attributes on Elements which use ID references (and don't use Element reflection) are non-nullable However, I think it depends on how we want to think about un-setting a document.querySelector("#fancy-listbox").shadowRoot.referenceTarget = "";
console.log(input.ariaControlsElements); // logs `listbox` since there is no reference target; aria-controls now applies to the shadow host The original issue was concerning invalid values for I can see three options here:
My preference would be (1), but I'd honestly be ok with any of these. |
I definitely see your point here. I'd be fine with either option (1) or (2); I could live with (3) but prefer it less than either of the others. |
I'd vote against no. 3, because I have a hard time really understanding the difference between nos. 1 & 2.
|
I left out an important part of (1); I should have made a table:
So, to answer @Westbrook's questions:
It's converted to a string, |
Thanks @alice! All this points me towards no. 1 as well. I’ll make sure the WCCG has a think on this when we meet Friday to see if there’s any other feedback in the options. |
This depends on whether we want to have two attributes, or just one which deals both referencetarget and referencetargetmap (I'd still prefer to merge those two). |
If this actually points to an element through an ID, wouldn't it be |
@annevk The explainer did include some comments on this, e.g.:
I'm not sure I agree with all of the arguments listed in the explainer, but I do think the design goals and constraints are slightly different here than for something like
I think it makes sense to at least offer the option of having a |
That's a good point. From the earlier options above, I don't see how 3 would work with |
Hm, yeah, I didn't really think about that. Definitely a non-starter!
It's slightly different from the Implementation-wise, it looks like both existing implementations currently assume a non-null value for If we went with option 2, I think we'd have to update the implementations and write the spec such that the value defaults to empty string, and we consider empty string to be a "missing value" meaning that the host should be the result of resolving the reference target in that case. |
I think it's okay that it's different from |
Originally posted by @dandclark in #1089
The text was updated successfully, but these errors were encountered: