Created attachment 464760 [details] 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
<rdar://problem/104881298>
This issue can be closed per tentative resolution in https://github.com/w3c/aria/pull/2057. Once the spec is updated, WebKit's behavior will be correct per the spec.