<?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>28765</bug_id>
          
          <creation_ts>2015-06-05 06:29:33 +0000</creation_ts>
          <short_desc>It seems better to make DedicatedWorkerGlobalScope _implements_ WorkerGlobalScope so that var foo = foo | webkitFoo | msFoo | ... will work as expected, just like Window.</short_desc>
          <delta_ts>2015-09-18 10:54:55 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>https://html.spec.whatwg.org/#dedicated-workers-and-the-dedicatedworkerglobalscope-interface</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>cam</cc>
    
    <cc>josh</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>120721</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2015-06-05 06:29:33 +0000</bug_when>
    <thetext>Specification: https://html.spec.whatwg.org/multipage/workers.html
Multipage: https://html.spec.whatwg.org/multipage/#dedicated-workers-and-the-dedicatedworkerglobalscope-interface
Complete: https://html.spec.whatwg.org/#dedicated-workers-and-the-dedicatedworkerglobalscope-interface
Referrer: https://html.spec.whatwg.org/multipage/workers.html

Comment:
It seems better to make DedicatedWorkerGlobalScope _implements_
WorkerGlobalScope so that var foo = foo | webkitFoo | msFoo | ... will work as
expected, just like Window.

Posted from: 74.125.56.38
User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2421.0 Safari/537.36</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123241</commentid>
    <comment_count>1</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2015-09-17 10:46:03 +0000</bug_when>
    <thetext>Are we planning to add any prefixed attributes to WorkerGlobalScope?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123242</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-09-17 11:09:48 +0000</bug_when>
    <thetext>I think we&apos;d want the same setup for globals around the platform so if IDL indeed makes this different I think we should change. heycam, bz, what do you think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123243</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2015-09-17 14:00:42 +0000</bug_when>
    <thetext>The setup is the same for all globals, and the setup is as follows: properties that appear on the [Global] or [PrimaryGlobal] interface appear directly on the object.  Properties that appear on ancestor interfaces of that interface appear on the corresponding prototypes.

So for Window, for example, &quot;addEventListener&quot; appears on EventTarget.prototype, not directly on the window object, while &quot;open&quot; appears on the window object itself, since the latter is defined on the Window interface, which is [PrimaryGlobal].

Now EventTarget is implemented by various things, so it makes sense to put its methods directly on its prototype so that you can hook all event targets (including Window) at once.  But in the worker case, it&apos;s not like there are multiple things implementing WorkerGlobalScope around.  So it would not be entirely unreasonable to make WorkerGlobalScope a mixin.  Arguments for:

1)  If someone adds a prefixed property on WorkerGlobalScope and ships it (which would be considered pretty bad web citizenship at this point, given our experience with prefixed properties), the &quot;var foo&quot; thing would not break, as described when the bug was filed.

2)  It makes some property-access optimizations on the global a bit easier (e.g. see https://bugzilla.mozilla.org/show_bug.cgi?id=1063878 and the &quot;not a leaf interface&quot; bit in &lt;https://bugzilla.mozilla.org/show_bug.cgi?id=1063879#c0&gt;).

Arguments against:

I)  It&apos;s a backwards-incompatible change to functionality that&apos;s been shipping for a while in browsers.  It would break any scripts that add properties to WorkerGlobalScope.prototype or get properties from it.  So we&apos;d need to at least do some due diligence looking for such scripts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123255</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-09-18 10:54:55 +0000</bug_when>
    <thetext>Thank you bz. The churn does not seem worth it based on those arguments.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>