<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>21961</bug_id>
          
          <creation_ts>2008-10-29 16:20:26 -0700</creation_ts>
          <short_desc>for-in loops should not include undetectable properties (e.g. document.all)</short_desc>
          <delta_ts>2021-05-14 13:12:52 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>525.x (Safari 3.1)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://code.google.com/p/chromium/issues/detail?id=3152</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jon@Chromium">jon</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>arv</cc>
    
    <cc>ashvayka</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>97069</commentid>
    <comment_count>0</comment_count>
    <who name="Jon@Chromium">jon</who>
    <bug_when>2008-10-29 16:20:26 -0700</bug_when>
    <thetext>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 &quot;all&quot; in for-in loops over the document, so this is really about being consistent with Firefox.

See the attached test case.

&lt;html&gt;
&lt;body&gt;
&lt;script&gt;
var hasAll = false;
for (prop in document) {
  if (prop == &apos;all&apos;)
    hasAll = true;
}

document.body.innerHTML += hasAll ? &quot;FAILED: detected document.all via for-in loop&quot; : &quot;SUCCESS&quot;;
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97070</commentid>
    <comment_count>1</comment_count>
      <attachid>24761</attachid>
    <who name="Jon@Chromium">jon</who>
    <bug_when>2008-10-29 16:21:15 -0700</bug_when>
    <thetext>Created attachment 24761
Test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1760178</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2021-05-14 13:12:52 -0700</bug_when>
    <thetext>(In reply to Jon@Chromium from comment #0)
&gt; Originated in Chromium bug tracker, see
&gt; 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).</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>24761</attachid>
            <date>2008-10-29 16:21:15 -0700</date>
            <delta_ts>2008-10-29 16:21:15 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>bug.html</filename>
            <type>text/html</type>
            <size>233</size>
            <attacher name="Jon@Chromium">jon</attacher>
            
              <data encoding="base64">PGh0bWw+Cjxib2R5Pgo8c2NyaXB0Pgp2YXIgaGFzQWxsID0gZmFsc2U7CmZvciAocHJvcCBpbiBk
b2N1bWVudCkgewogIGlmIChwcm9wID09ICdhbGwnKQogICAgaGFzQWxsID0gdHJ1ZTsKfQoKZG9j
dW1lbnQuYm9keS5pbm5lckhUTUwgKz0gaGFzQWxsID8gIkZBSUxFRDogZGV0ZWN0ZWQgZG9jdW1l
bnQuYWxsIHZpYSBmb3ItaW4gbG9vcCIgOiAiU1VDQ0VTUyI7Cjwvc2NyaXB0Pgo8L2JvZHk+Cjwv
aHRtbD4=
</data>

          </attachment>
      

    </bug>

</bugzilla>