<?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>48337</bug_id>
          
          <creation_ts>2010-10-26 09:48:26 -0700</creation_ts>
          <short_desc>V8 bindings report readonly idl attributes as writable</short_desc>
          <delta_ts>2013-09-27 09:49:15 -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>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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>1</everconfirmed>
          <reporter name="Erik Arvidsson">arv</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>antonm</cc>
    
    <cc>dglazkov</cc>
    
    <cc>dominicc</cc>
    
    <cc>japhet</cc>
    
    <cc>raynos2</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>299530</commentid>
    <comment_count>0</comment_count>
    <who name="Erik Arvidsson">arv</who>
    <bug_when>2010-10-26 09:48:26 -0700</bug_when>
    <thetext>Given:

var event = document.createEvent(&apos;Event&apos;);
JSON.stringify(Object.getOwnPropertyDescriptor(event, &apos;currentTarget&apos;))

returns

{&quot;value&quot;:null,&quot;writable&quot;:true,&quot;enumerable&quot;:true,&quot;configurable&quot;:true}

But the Event.idl file says

 readonly attribute EventTarget      currentTarget;


Safari + JSC returns 

{&quot;value&quot;:null,&quot;writable&quot;:false,&quot;enumerable&quot;:true,&quot;configurable&quot;:false}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>299651</commentid>
    <comment_count>1</comment_count>
    <who name="anton muhin">antonm</who>
    <bug_when>2010-10-26 11:40:00 -0700</bug_when>
    <thetext>Rico did a lot of work on getOwnPropertyDescriptor, so he is probably the best guy to solve it.

Alas, we have two options to control not-writeability of API callbacks (currentTarget is API callback that is thing like getter where getter is implemented in C++): property attributes and absence of a setter.

Currently v8 believes into attributes (see src/runtime.cc  ln. 77 as of bleeding edge@63542) while DOM bindings use missing setter (see third_party/WebKit/WebCore/bindings/scripts/CodeGeneratorV8.pm, ln. 1535 as of @70305).

If memory serves, v8 treats callback properties without setter as readonly anyway (at least it ignores any attempts to write, but we need to double check how it correlates with const), so I think the problem should be fixed on v8 part (checking if a setter is missing).

Rico, any thoughts?

Erik, this issue doesn&apos;t look of very high priority and could probably wait a bit (Rico is on paternity leave).

And I cannot just cc Rico, so I am forwarding this bug to him cc&apos;ing this bug cc list instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>409312</commentid>
    <comment_count>2</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2011-05-24 16:58:32 -0700</bug_when>
    <thetext>Note that per bug 49739 these attributes should be on Event.prototype. But the bug is still valid re: writable: true, configurable: true being invalid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>409347</commentid>
    <comment_count>3</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2011-05-24 18:15:50 -0700</bug_when>
    <thetext>Actually, per the Web IDL working draft &lt;http://www.w3.org/TR/2010/WD-WebIDL-20101021/#es-attributes&gt; readonly attributes should be attribute getters and setters.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>494260</commentid>
    <comment_count>4</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2011-11-01 16:08:13 -0700</bug_when>
    <thetext>*** Bug 71113 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>933974</commentid>
    <comment_count>5</comment_count>
    <who name="Erik Arvidsson">arv</who>
    <bug_when>2013-09-27 09:49:15 -0700</bug_when>
    <thetext>V8 is gone</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>