-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Reflection of IDREF attributes will leave stale ID value #8306
Copy link
Copy link
Closed
Labels
a11y-trackerGroup bringing to attention of a11y, or tracked by the a11y Group but not needing response.Group bringing to attention of a11y, or tracked by the a11y Group but not needing response.
Description
In the following example, document.write will log "label-id" in all three cases even though the target element had moved to be inside a shadow tree:
const element = document.createElement('div');
const label = document.createElement('div');
label.id = 'label-id';
document.body.appendChild(element);
document.body.appendChild(label);
element.ariaLabelledByElements = [label];
document.write(element.getAttribute('aria-labelledby') + '<br>');
const newLabel = document.createElement('div');
newLabel.id = 'label-id'
document.body.insertBefore(newLabel, document.body.firstChild);
document.write(element.getAttribute('aria-labelledby') + '<br>');
const host = document.createElement('div');
document.body.appendChild(host);
host.attachShadow({mode: 'closed'}).appendChild(label);
document.write(element.getAttribute('aria-labelledby') + '<br>');This doesn't seem right. It's really confusing that setting id-ref leaves id values that are stale and no longer representative of the actually referenced element.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a11y-trackerGroup bringing to attention of a11y, or tracked by the a11y Group but not needing response.Group bringing to attention of a11y, or tracked by the a11y Group but not needing response.