[Webkit-unassigned] [Bug 251383] New: Reflected ARIA properties should not treat setting undefined the same as null
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jan 30 12:40:40 PST 2023
https://bugs.webkit.org/show_bug.cgi?id=251383
Bug ID: 251383
Summary: Reflected ARIA properties should not treat setting
undefined the same as null
Product: WebKit
Version: Safari Technology Preview
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: DOM
Assignee: webkit-unassigned at lists.webkit.org
Reporter: nlawson at salesforce.com
Created attachment 464760
--> https://bugs.webkit.org/attachment.cgi?id=464760&action=review
Repro
Safari Technology Preview version: Release 146 (Safari 15.4, WebKit 16614.1.14.10.6)
Steps to reproduce:
1. Go to https://codepen.io/nolanlawson-the-selector/pen/OJwojEW
What is the expected result?
It should log "undefined" (the string).
What happens instead?
It logs null.
Here is the minimal repro (same as in the CodePen):
const div = document.createElement('div')
div.ariaLabel = undefined
console.log(div.ariaLabel)
Per the ARIA spec [1], setting `null` on a reflected `aria*` property removes the associated `aria-` attribute (if it exists). However, it doesn't say anything about setting `undefined`.
So in this case, setting `undefined` should presumably be treated the same as any other non-string value – i.e. it should be stringified:
div.ariaLabel = undefined
div.ariaLabel // 'undefined'
div.getAttribute('aria-label') // 'undefined'
Note that Chrome and Safari behave identically, and Firefox has not implemented ARIA reflection yet. More details are in the relevant ARIA bug [2].
I also filed a bug on Chromium [3].
[1]: https://w3c.github.io/aria/#enumerated-attribute-values-html
[2]: https://github.com/w3c/aria/issues/1858
[3]: https://bugs.chromium.org/p/chromium/issues/detail?id=1411465
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230130/cef866e9/attachment.htm>
More information about the webkit-unassigned
mailing list