<?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>68002</bug_id>
          
          <creation_ts>2011-09-13 07:03:13 -0700</creation_ts>
          <short_desc>Some interface attributes do not appear on the prototype as required by WebIDL</short_desc>
          <delta_ts>2011-12-29 06:44:59 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>49739</dup_id>
          
          <bug_file_loc>http://dev.w3.org/2006/webapi/WebIDL/#es-attributes</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>67335</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Joel Martin">webkit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andyearnshaw</cc>
    
    <cc>ap</cc>
    
    <cc>haraken</cc>
    
    <cc>sam</cc>
    
    <cc>yutak</cc>
    
    <cc>zcorpan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>466274</commentid>
    <comment_count>0</comment_count>
    <who name="Joel Martin">webkit</who>
    <bug_when>2011-09-13 07:03:13 -0700</bug_when>
    <thetext>I was attempting to object detect support for binary type support in the WebSocket object and discovered that the binaryType attribute is not visible in the prototype (https://bugs.webkit.org/show_bug.cgi?id=67335#add_comment). For WebSocket object detection this is a blocking issue because instantiating the object triggers a network connection (even if you immediately call close() and null the websocket object in the same execution context).

However, it seems like a more general issue of efficiency (object detection without needing instantiantion) and also of compliance with the WebIDL definition of attributes: http://dev.w3.org/2006/webapi/WebIDL/#es-attributes:

&quot;For each attribute defined on the interface, there must exist a corresponding property. If the attribute was declared with the [Unforgeable] extended attribute, then the property exists on every object that implements the interface. Otherwise, it exists on the interface’s interface prototype object.&quot;

I&apos;m not sure how widely this problem exists Chrome, but at least for WebSocket attributes, firefox and opera are correct and have the attributes names visible on the prototype.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>467806</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Pieters (:zcorpan)">zcorpan</who>
    <bug_when>2011-09-15 07:54:34 -0700</bug_when>
    <thetext>I don&apos;t have &quot;canconfirm&quot; permission but I can nonetheless confirm that WebKit violates the spec here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>468260</commentid>
    <comment_count>2</comment_count>
    <who name="Yuta Kitamura">yutak</who>
    <bug_when>2011-09-15 20:09:37 -0700</bug_when>
    <thetext>For example, what should happen if you call &quot;WebSocket.prototype.readyState&quot; without creating a WebSocket instance?

Firefox Aurora raises a cryptic exception, which actually made me get surprised.

&gt; MozWebSocket.prototype.readyState
[Exception... &quot;Illegal operation on WrappedNative prototype object&quot;  nsresult: &quot;0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)&quot;  location: &quot;JS frame :: Web Console :: &lt;TOP_LEVEL&gt; :: line 1&quot;  data: no]

Does this match what the spec expects?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>468263</commentid>
    <comment_count>3</comment_count>
    <who name="Yuta Kitamura">yutak</who>
    <bug_when>2011-09-15 20:14:56 -0700</bug_when>
    <thetext>Pasting Sam&apos;s comment at https://bugs.webkit.org/show_bug.cgi?id=67335#c10 for the record

&gt; For the record, it is currently our intention to eventually put attributes on the prototype, we just need to figure out a way to do it with regressing performance (which is a bit difficult).  In the mean time, one can always construct a dummy object and test for the attributes presence to do feature detection.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>491084</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-10-26 12:10:43 -0700</bug_when>
    <thetext>*** Bug 70929 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>491085</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-10-26 12:11:17 -0700</bug_when>
    <thetext>Is this the same as bug 49739?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>527911</commentid>
    <comment_count>6</comment_count>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2011-12-29 06:44:59 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 49739 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>