WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
129316
Setting `element.id = null` should not remove the `id` attribute
https://bugs.webkit.org/show_bug.cgi?id=129316
Summary
Setting `element.id = null` should not remove the `id` attribute
Mathias Bynens
Reported
2014-02-25 10:07:07 PST
Setting `element.id = null` should have the same result as `element.id = 'null'`. In Safari, this remove the `id` attribute instead. Test case: data:text/html,<p%20id=x></p><script>var%20el%20=%20x;%20el.id%20=%20null;%20document.write(el.id%20===%20'null'%20?%20'PASS'%20:%20'FAIL')</script> Chrome, Opera, and Firefox get it right.
Attachments
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2022-08-09 15:36:26 PDT
I took the test case from
Comment 0
and replaced %20 with Space and then changed it into JSFiddle: Link -
https://jsfiddle.net/cwdjomup/
It shows "PASS" for all browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6 on macOS 12.5). I think something along the line fixed it. So I am marking this as "RESOLVED CONFIGURATION CHANGED". Thanks!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug