Bug 123890
| Summary: | data-x-2="" not represented in dataset | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Pieters (:zcorpan) <zcorpan> |
| Component: | DOM | Assignee: | Ryosuke Niwa <rniwa> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | achristensen, ahmad.saleem792, ap, bfulgham, cdumez, rniwa, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=126200 | ||
Simon Pieters (:zcorpan)
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
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
All browsers agree -> config changed.
Alexey Proskuryakov
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
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
Pull request: https://github.com/WebKit/WebKit/pull/3498
EWS
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
<rdar://problem/98937188>