aom
aom copied to clipboard
Removing attribute sprouting
per discussion in 6.29.2021 AOM meeting, removing attribute sprouting
What happens with the following?
el.setAttribute('aria-labelledby', 'original_label_idref');
el.ariaLabelledByElements = [newLabelEl]; // I don't recall if this is the current syntax for setting, but my point remains.
el.getAttribute('aria-labelledby'); // Is this stale content attribute left in the DOM, removed, or set to an empty string?
I think what should happen is that setting the ariaLabelledByElements
DOM property should NOT leave the stale aria-labelledby
content attribute in the DOM... Instead, it should either remove the attribute, or set it to an empty string.
What happens with the following?
el.setAttribute('aria-labelledby', 'original_label_idref'); el.ariaLabelledByElements = [newLabelEl]; // I don't recall if this is the current syntax for setting, but my point remains. el.getAttribute('aria-labelledby'); // Is this stale content attribute left in the DOM, removed, or set to an empty string?
I think what should happen is that setting the
ariaLabelledByElements
DOM property should NOT leave the stalearia-labelledby
content attribute in the DOM... Instead, it should either remove the attribute, or set it to an empty string.
I might be wrong but I think we landed on not affecting content attributes in this case as well to be consistent with not sprouting content attributes. It's weird for DOM API to not create a content attribute but at the same time to remove an existing one.
TODO: Add example of attribute removal
Let's make a change to mention removal of relationship in a separate PR.
To clarify my original intent with sprouting: I imagined that where a valid IDREF/IDREF list couldn't be generated, an empty content attribute would still be sprouted, and that removing the content attribute would have the effect of removing the association. That seems to have been dropped sometime before this change.
My reasoning for that was that the presence/absence of the content attribute would reliably indicate that an IDL attribute was/wasn't set.
Separately, sprouting serializable attributes using IDREFs where possible was more of a nice to have, and I'm happy for that to be removed if it's causing serious issues.
I had a brief skim through the meeting notes for the last 5 months, but couldn't find the discussion of the first point (empty content attributes) easily. Would anyone like to point me to that?
(This is not a -1 for this PR, just a clarification of the original intent of this design.)