RESOLVED WONTFIX21961
for-in loops should not include undetectable properties (e.g. document.all)
https://bugs.webkit.org/show_bug.cgi?id=21961
Summary for-in loops should not include undetectable properties (e.g. document.all)
Jon@Chromium
Reported 2008-10-29 16:20:26 PDT
Originated in Chromium bug tracker, see http://code.google.com/p/chromium/issues/detail?id=3152 Firefox, which also has undetectable document.all does not put "all" in for-in loops over the document, so this is really about being consistent with Firefox. See the attached test case. <html> <body> <script> var hasAll = false; for (prop in document) { if (prop == 'all') hasAll = true; } document.body.innerHTML += hasAll ? "FAILED: detected document.all via for-in loop" : "SUCCESS"; </script> </body> </html>
Attachments
Test case (233 bytes, text/html)
2008-10-29 16:21 PDT, Jon@Chromium
no flags
Jon@Chromium
Comment 1 2008-10-29 16:21:15 PDT
Created attachment 24761 [details] Test case
Alexey Shvayka
Comment 2 2021-05-14 13:12:52 PDT
(In reply to Jon@Chromium from comment #0) > Originated in Chromium bug tracker, see > http://code.google.com/p/chromium/issues/detail?id=3152 As it was concluded in Chromium bug tracker, `document.all` should be enumerable. [[IsHTMLDDA]] tries to fix web compatibility by introducing the minimum number of quirks necessary, thus keeping the ordinary value of [[Enumerable]]. This is tested by wpt/html/dom/idlharness.https.html (https://github.com/web-platform-tests/wpt/blob/afae1650e3441650024d04dc5837348ae3e0b049/resources/idlharness.js#L2903).
Note You need to log in before you can comment on or make changes to this bug.