<?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>10337</bug_id>
          
          <creation_ts>2010-08-09 22:31:30 +0000</creation_ts>
          <short_desc>add [Supplemental] support</short_desc>
          <delta_ts>2011-06-22 00:29:55 +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>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Ian &apos;Hixie&apos; Hickson">ian</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>jonas</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>37323</commentid>
    <comment_count>0</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-08-09 22:31:30 +0000</bug_when>
    <thetext>For specification process reasons, some interface  definitions don&apos;t get organised the same way as we want from implementations. I&apos;ve assumed that [Supplemental] will exist, and used it as follows:

 - Setting [Supplemental, NoInterfaceObject] on an interface X with no 
   ancestor and then saying:
     Y implements X;
   ...implies that the members in X are imported into Y as if the 
   definition of Y always had X in it.

 - Setting [Supplemental, NoInterfaceObject] on an interface X that 
   inherits from Y implies that there are objects called Y that have all 
   the members of X and Y with X not appearing on the prototype chain.

 - Setting [Supplemental] on an interface that has the same name as an 
   interface definition without [Supplemental].

The distinction between these cases is that I have three different cases 
where I need to do this. One is where I have some objects, e.g. Window, 
that are made up of APIs defined in other specs, and those APIs are also 
used by other interfaces. So I define Window, and then other specs slide 
stuff into Window, and slide stuff into other interfaces (like Worker- 
related ones). Another is WorkerGlobalScope, which I want to be the name 
of the interface implementing the global scope for workers, but there are 
two types of workers, and they have slightly different interfaces. And the 
third is the deprecated interfaces, where one interface, e.g. 
HTMLAnchorElement, is defined in two places.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49900</commentid>
    <comment_count>1</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-06-20 08:13:08 +0000</bug_when>
    <thetext>The first case doesn&apos;t need [Supplemental] any more.

For the second case, I&apos;d like a more descriptive name than [Supplemental].  I&apos;ve used [CopyInheritedPrototype], but let me know if you think of something better.

For the third case, I think using extended attributes for this isn&apos;t right; we need something in the core IDL syntax.  I&apos;ve added this syntax:

  interface HTMLAnchorElement : HTMLElement {
    // ...
  };

  partial interface HTMLAnchorElement {
    // the attributes not fit for polite company
  };</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49904</commentid>
    <comment_count>2</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2011-06-20 08:43:47 +0000</bug_when>
    <thetext>Could someone give an example of when the second case is desired? I.e. when it would be appropriate to use [CopyInheritedPrototype]?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49949</commentid>
    <comment_count>3</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-06-21 04:25:59 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Could someone give an example of when the second case is desired? I.e. when it
&gt; would be appropriate to use [CopyInheritedPrototype]?

The case brought up in comment #0 is DedicatedWorkerGlobalScope/SharedWorkerGlobalScope.  Maybe Ian can explain why regular inheritance doesn&apos;t work in that case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49970</commentid>
    <comment_count>4</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2011-06-21 06:21:54 +0000</bug_when>
    <thetext>It seems to me that for worker global scopes you want different interface objects for DedicatedWorkerGlobalScope and SharedWorkerGlobalScope. That way people can test what type of object they have and use it appropriately.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50081</commentid>
    <comment_count>5</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-06-21 23:26:56 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; It seems to me that for worker global scopes you want different interface
&gt; objects for DedicatedWorkerGlobalScope and SharedWorkerGlobalScope. That way
&gt; people can test what type of object they have and use it appropriately.

If HTML says

  [CopyInheritedPrototype]
  interface DedicatedWorkerGlobalScope : Window {
    ...
  };

then you do get an interface object &quot;DedicatedWorkerGlobalScope&quot; that you can test on.  It&apos;s just that Object.getPrototypeOf(&lt;global&gt;) == Object.prototype, and there will be properties like DedicatedWorkerGlobalScope.prototype.open, etc.

`&lt;global&gt; instanceof Window` will be false, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50091</commentid>
    <comment_count>6</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2011-06-22 00:29:55 +0000</bug_when>
    <thetext>With &quot;test on&quot; I mean being able to do |foo instanceof DedicatedWorkerGlobalScope| which appears wouldn&apos;t be possible.

I still don&apos;t understand why you would want to use CopyInheritedPrototype? Can you give any concrete use cases?

And worst case, couldn&apos;t you just use &quot;DedicatedWorkerGlobalScope implements Window&quot; to accomplish the same API? Given that mixins is something that should be avoided if possible (since they fit poorly with JavaScript&apos;s single inheritance prototype chain), having multiple syntaxes to express them seems backwards.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>