<?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>149474</bug_id>
          
          <creation_ts>2015-09-22 14:28:30 -0700</creation_ts>
          <short_desc>Web IDL: DOM &quot;onfoo&quot; attributes should be configurable and enumerable</short_desc>
          <delta_ts>2022-09-06 16:51:13 -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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://heycam.github.io/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>122213</blocked>
    
    <blocked>142934</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>ashvayka</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cdumez</cc>
    
    <cc>heycam</cc>
    
    <cc>joepeck</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1128106</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-09-22 14:28:30 -0700</bug_when>
    <thetext>* SUMMARY
DOM &quot;onfoo&quot; attributes should be configurable and enumerable
https://heycam.github.io/webidl/#es-attributes

&gt; 4.5.7. Attributes
&gt;
&gt; For each exposed attribute of the interface, whether it was declared on the interface itself
&gt; or one of its consequential interfaces, there must exist a corresponding property.
&gt; The characteristics of this property are as follows:
&gt;
&gt; • The property has attributes { [[Get]]: G, [[Set]]: S, [[Enumerable]]: true, [[Configurable]]: configurable }, where:
&gt;   - configurable is false if the attribute was declared with the [Unforgeable] extended attribute and true otherwise;
&gt;   - G is the attribute getter, defined below; and
&gt;   - S is the attribute setter, also defined below.

* TEST
var descriptor = Object.getOwnPropertyDescriptor(window, &quot;onhashchange&quot;);
assert(descriptor.enumerable);
assert(descriptor.configurable);

* NOTES
WebKit : Enumerable(false) Configurable(false)
Firefox: Enumerable(true)  Configurable(true)
Chrome : Enumerable(true)  Configurable(true)  // NOTE: window.__proto__ right now</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1128110</commentid>
    <comment_count>1</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-09-22 14:45:20 -0700</bug_when>
    <thetext>Seems like this might only be an issue with particular objects, like `window`. Looking at &quot;onclick&quot; for the Element.prototype, that is configurable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1128111</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2015-09-22 14:50:08 -0700</bug_when>
    <thetext>Yes, Window is defined with [PrimaryGlobal]:
https://html.spec.whatwg.org/multipage/browsers.html#the-window-object

As per the Web IDL spec [1], if the interface has [Global] or [PrimaryGlobal], the attributes should be on the instance rather than the prototype.

However, our bindings generator currently has an exception that makes attributes that are on the instance non-configurable.

If an attribute is not enumerable, it likely means that it has [NotEnumerable] on it in the WebKit IDL because they should be enumerable by default.

[1] https://heycam.github.io/webidl/#es-attributes</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1128123</commentid>
    <comment_count>3</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-09-22 15:36:16 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; If an attribute is not enumerable, it likely means that it has
&gt; [NotEnumerable] on it in the WebKit IDL because they should be enumerable by
&gt; default.

That is the case here, WebKit has [NotEnumerable] on these attributes. However it looks like the specification of these attributes should be enumerable:
https://html.spec.whatwg.org/multipage/webappapis.html#windoweventhandlers</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1896018</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-03 04:50:39 -0700</bug_when>
    <thetext>I searched for &apos;es-attributes&apos; and it seems that following WPT test covers it:

https://wpt.fyi/results/html/browsers/the-window-object/window-properties.https.html?label=master&amp;label=experimental&amp;aligned&amp;view=subtest&amp;q=window-properties.https.html

Safari Technology Preview 152 only fail in single test, is anything else needed here or we can create separate bug for the particular bug failure? Ignore me, if I am wrong. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1896602</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2022-09-06 16:51:13 -0700</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #4)
&gt; I searched for &apos;es-attributes&apos; and it seems that following WPT test covers
&gt; it:
&gt; 
&gt; https://wpt.fyi/results/html/browsers/the-window-object/window-properties.
&gt; https.html?label=master&amp;label=experimental&amp;aligned&amp;view=subtest&amp;q=window-
&gt; properties.https.html
&gt; 
&gt; Safari Technology Preview 152 only fail in single test, is anything else
&gt; needed here or we can create separate bug for the particular bug failure?
&gt; Ignore me, if I am wrong. Thanks!

Thank you Ahmad, that last failing test is due to WebKit no longer (or never did) supports obsolete window.external (https://html.spec.whatwg.org/multipage/obsolete.html#external).

The WPT is rightfully testing it, since just like document.all, browsers must expose it with dummy functions.

However, given Safari is mainstream and no web compat issues were reported due to lack of External, maybe it&apos;s even possible to remove it from the spec, and consequently loosen up the tests.

Anyway, &quot;onfoo&quot; attributes were fixed long time ago, so I&apos;m marking this as FIXED.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>