WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 123890
data-x-2="" not represented in dataset
https://bugs.webkit.org/show_bug.cgi?id=123890
Summary
data-x-2="" not represented in dataset
Simon Pieters (:zcorpan)
Reported
2013-11-06 05:36:13 PST
Test case:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2622
<!doctype html> <script data-x-2=x>document.write(document.querySelector("script").dataset.length == 1 ? 'PASS' : 'FAIL')</script> Spec:
http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#dom-dataset
Note that the spec says ASCII *letter*, so step 3 is no-op for this case. Similar issue in Blink:
https://code.google.com/p/chromium/issues/detail?id=171175
Attachments
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2022-08-11 14:46:27 PDT
All browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6 on macOS 12.5) show "FAIL" for this test case. Is this something removed from Web-Spec or not implemented by all browsers. Just wanted to share updated status. Thanks!
Ryosuke Niwa
Comment 2
2022-08-11 14:49:01 PDT
All browsers agree -> config changed.
Alexey Proskuryakov
Comment 3
2022-08-19 19:44:56 PDT
Sadly no, this works in Firefox and in Chrome, but fails in Safari. The reason why the test fails in all browsers is that DOMStringMap doesn't have a length property, but if you look at document.querySelector("script").dataset in developer tools, other browsers have the correct value, and we have "x-2 -> undefined".
Ryosuke Niwa
Comment 4
2022-08-20 00:16:53 PDT
wow, this is so bad. DOMStringDataset has a different code just for when there is exactly one attribute and it's precisely why it fails in that particular case.
Ryosuke Niwa
Comment 5
2022-08-20 01:06:00 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/3498
EWS
Comment 6
2022-08-20 21:12:10 PDT
Committed
253625@main
(8a40482a9c10): <
https://commits.webkit.org/253625@main
> Reviewed commits have been landed. Closing PR #3498 and removing active labels.
Radar WebKit Bug Importer
Comment 7
2022-08-20 21:13:31 PDT
<
rdar://problem/98937188
>
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