aom icon indicating copy to clipboard operation
aom copied to clipboard

Removing attribute sprouting

Open cyns opened this issue 3 years ago • 5 comments

per discussion in 6.29.2021 AOM meeting, removing attribute sprouting

cyns avatar Jul 20 '21 23:07 cyns

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.

cookiecrook avatar Aug 12 '21 18:08 cookiecrook

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.

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.

rniwa avatar Aug 17 '21 23:08 rniwa

TODO: Add example of attribute removal

cyns avatar Aug 17 '21 23:08 cyns

Let's make a change to mention removal of relationship in a separate PR.

rniwa avatar Aug 17 '21 23:08 rniwa

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.)

alice avatar Oct 03 '21 04:10 alice