<?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>28538</bug_id>
          
          <creation_ts>2015-04-22 18:51:54 +0000</creation_ts>
          <short_desc>[NoInterfaceObject, Exposed=(Window,Worker)] makes no sense</short_desc>
          <delta_ts>2015-04-24 09:21:37 +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>URL</component>
          <version>unspecified</version>
          <rep_platform>PC</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>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philip Jägenstedt">philipj</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>mike</cc>
    
    <cc>rubys</cc>
          
          <qa_contact>sideshowbarker+urlspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>119764</commentid>
    <comment_count>0</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2015-04-22 18:51:54 +0000</bug_when>
    <thetext>AFAICT WebIDL doesn&apos;t explicitly disallow this:
http://heycam.github.io/webidl/#Exposed

However, I don&apos;t think the [Exposed=(Window,Worker)] bit actually does anything, as there is no interface object to expose anywhere.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119765</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-04-22 18:57:08 +0000</bug_when>
    <thetext>Exposed is about the members too and is definitely needed as far as I know.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119805</commentid>
    <comment_count>2</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2015-04-23 12:48:17 +0000</bug_when>
    <thetext>Context: https://url.spec.whatwg.org/#api

Do you mean that without [Exposed=(Window,Worker)] on URLUtils, the members of URLUtils would not show up on URL in workers, even though URL itself has [Exposed=(Window,Worker)]?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119823</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-04-23 16:47:07 +0000</bug_when>
    <thetext>Yeah, I think that&apos;s the case. bz can probably help us out here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119825</commentid>
    <comment_count>4</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2015-04-23 16:55:36 +0000</bug_when>
    <thetext>Comment 2 is correct.  Exposed annotations on interfaces do two slightly separate things: they indicate where the interface name is exposed (for interfaces with an interface object) and they set the default exposure set for the interface members, which can then be overridden (well, narrowed down) via [Exposed] annotations on the members themselves.

In the case of mixins (aka. things pulled in via &quot;implements&quot;) the mixin, not the interface it&apos;s mixed into, sets the default exposure set for its members.  At least the way Web IDL is specced right now.

One other thing.  This IDL:

  [Exposed=(Window, Worker)] interface URL {};
  [NoInterfaceObject] interface URLUtils {};
  URL implements URLUtils;

is actually explicitly invalid.  http://heycam.github.io/webidl/#Exposed says:

  An interface&apos;s exposure set MUST also be a subset of the exposure set of all
  of the interface&apos;s consequential interfaces. 

Fwiw, this is implemented correctly in Gecko.  If I drop the Exposed=(Window,Worker) from URLUtils, our IDL compiler says:

 WebIDL.WebIDLError: error: Interface URL is exposed in globals where its consequential interface URLUtils is not exposed., dom/webidl/URL.webidl line 19:0
 interface URL {
 ^
 dom/webidl/URLUtils.webidl line 18:0
 interface URLUtils {
 ^</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119872</commentid>
    <comment_count>5</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2015-04-24 09:21:37 +0000</bug_when>
    <thetext>Thanks Boris and Anne! I didn&apos;t realize that there was more to [Exposed] than the interface object itself, but it makes sense.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>