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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21069</bug_id>
          
          <creation_ts>2013-02-21 11:23:06 +0000</creation_ts>
          <short_desc>[Unforgeable] attributes as data property</short_desc>
          <delta_ts>2013-02-21 13:55:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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="David Bruant">bruant.d</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>annevk</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>83478</commentid>
    <comment_count>0</comment_count>
    <who name="David Bruant">bruant.d</who>
    <bug_when>2013-02-21 11:23:06 +0000</bug_when>
    <thetext>Per bug 21068, event.isTrusted is now [Unforgeable], so the &apos;isTrusted&apos; property is now own and not inherited.

One question which answer is not fully clear to me is:
should there be one getter per event instance or one getter shared by all event instances?

A way to not have to answer this question is just to make [Unforgeable] attributes data properties instead of getters.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83479</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-02-21 11:31:43 +0000</bug_when>
    <thetext>Also, if all attributes that are unforgeable are readonly (and it looks like it) maybe we should support this is

  unforgeable attribute ...;

instead?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83480</commentid>
    <comment_count>2</comment_count>
    <who name="David Bruant">bruant.d</who>
    <bug_when>2013-02-21 11:37:19 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Also, if all attributes that are unforgeable are readonly (and it looks like
&gt; it) maybe we should support this is
&gt; 
&gt;   unforgeable attribute ...;
&gt; 
&gt; instead?

First line of the definition of [Unforgeable]:
&quot;If the [Unforgeable] extended attribute appears on a read only attribute...&quot;, so I guess it means it can only happen to read only attributes...
The only places I know of unforgeable properties are:
* http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#the-window-object
* http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#document
* and now event.isTrusted

And indeed, it only applies to readonly.
So it probably is a nice refactoring.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83482</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-02-21 13:33:27 +0000</bug_when>
    <thetext>In Gecko&apos;s implementation there is a separate getter per object instance for unforgeable attributes.

Making this a data property is not an option, imo: it needs to be non-configurable and readonly but the boolean returned can change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83483</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-02-21 13:41:12 +0000</bug_when>
    <thetext>Ah yeah, the value of isTrusted can change over time. (I should probably learn about data properties at some point.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83484</commentid>
    <comment_count>5</comment_count>
    <who name="David Bruant">bruant.d</who>
    <bug_when>2013-02-21 13:46:43 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Ah yeah, the value of isTrusted can change over time.
In what circumstances?

&gt; (I should probably
&gt; learn about data properties at some point.)
I think this particular section will tell you all you need to know:
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/defineProperty#Description
(I plan to move the property descriptor material to its own page eventually instead of having it explained in Object.defineProperty)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83485</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-02-21 13:53:19 +0000</bug_when>
    <thetext>Put a trusted event object in a variable and then dispatch it. isTrusted will have changed per http://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent for hopefully obvious reasons.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83486</commentid>
    <comment_count>7</comment_count>
    <who name="David Bruant">bruant.d</who>
    <bug_when>2013-02-21 13:55:13 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; Put a trusted event object in a variable and then dispatch it. isTrusted
&gt; will have changed per
&gt; http://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent for hopefully
&gt; obvious reasons.
Yes, ok. Taking back the data property idea, then.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>