<?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>27611</bug_id>
          
          <creation_ts>2009-07-23 11:49:02 -0700</creation_ts>
          <short_desc>document.__proto__ Behavior</short_desc>
          <delta_ts>2009-10-24 10:29:40 -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>JavaScriptCore</component>
          <version>528+ (Nightly build)</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></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>arv</cc>
    
    <cc>eric</cc>
    
    <cc>ggaren</cc>
    
    <cc>keishi</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>134177</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2009-07-23 11:49:02 -0700</bug_when>
    <thetext>Please read the comments on this bug report:
https://bugs.webkit.org/show_bug.cgi?id=27169

Note that I&apos;m only concerned with the instanceof.  The typeof doesn&apos;t seem to be a major issue.  Which behavior of instanceof do you think is correct?

Summary:

WebKit and Chrome:
&gt; document.__proto__ instanceof window.Node
true
&gt; document.__proto__.__proto__.__proto__ === Node.prototype
true
&gt;typeof document.__proto__
&quot;object&quot;

Firefox:
&gt; document.__proto__ instanceof window.Node
false
&gt; document.__proto__.__proto__.__proto__ === Node.prototype
true
&gt;typeof document.__proto__
&quot;object&quot;

Opera:
&gt; document.__proto__ instanceof window.Node
false
&gt; document.__proto__.__proto__.__proto__ === Node.prototype
ERROR
&gt; typeof document.__proto__
&quot;undefined&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134179</commentid>
    <comment_count>1</comment_count>
    <who name="Keishi Hattori">keishi</who>
    <bug_when>2009-07-23 11:51:01 -0700</bug_when>
    <thetext>Opera doesn7t support __proto__</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134180</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-07-23 11:51:46 -0700</bug_when>
    <thetext>Adding two ECMA experts who would know this off the top of their heads.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134195</commentid>
    <comment_count>3</comment_count>
    <who name="Erik Arvidsson">arv</who>
    <bug_when>2009-07-23 12:17:06 -0700</bug_when>
    <thetext>This is once again underspecified behavior.

&gt; document.__proto__ instanceof window.Node
true

This is correct because the [[Prototype]] of document should be a Node

&gt; document.__proto__.__proto__.__proto__ === Node.prototype
true

This is less clear. DOM defines everything in interfaces. But given that we treat an interface as a prototype in other places it seems as correct as we can get it

document instanceof HTMLDocument
document.__proto__instanceof Document
document.__proto__.__proto__ instanceof Node

I think this is (or should be) covered by WebIDL.

To me it seems WebKit is doing as good as it can.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>157453</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-10-24 10:29:40 -0700</bug_when>
    <thetext>Any comments as to why the resolution?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>