Closed
Bug 1895551
Opened 10 months ago
Closed 9 months ago
Setting Null on ElementInternals attributes does not remove attribute
Categories
(Core :: Disability Access APIs, defect)
Core
Disability Access APIs
Tracking
()
RESOLVED
FIXED
128 Branch
Tracking | Status | |
---|---|---|
firefox128 | --- | fixed |
People
(Reporter: eeejay, Assigned: eeejay)
References
Details
Attachments
(1 file)
Given:
<custom-slider></custom-slider>
<script>
customElements.define(`custom-slider`,
class extends HTMLElement {
constructor() {
super();
this._internals = this.attachInternals();
this._internals.role = slider;
this._internals.ariaValueNow = "5";
this._internals.ariaValueMin = "1";
this._internals.ariaValueMax = "10";
this._internals.ariaValueText = null;
}
}
);
</script>
The expected value would be "5", but it is "". This is because ElementInternals does not treat null values correctly and considers the ariaValueText
attribute to be set.
Assignee | ||
Comment 1•10 months ago
|
||
While we could fix this in a11y by distinguishing between a null and empty string attribute, I would argue that the correct remedy is that the attribute should be unset in the internals when null is passed. This is the same behavior in Element.
Assignee | ||
Comment 2•10 months ago
|
||
Comment 3•10 months ago
|
||
FWIW, we originally had the same bug in Element, bug 1853209. That was definitely contrary to the spec.
See Also: → 1853209
Updated•10 months ago
|
Severity: -- → S3
Pushed by eisaacson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/820577191451
Remove aria attribute from ElementInternals when set to null. r=Jamie,dom-core,edgar
Comment 5•9 months ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 months ago
status-firefox128:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•