<?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>29514</bug_id>
          
          <creation_ts>2016-03-02 15:07:57 +0000</creation_ts>
          <short_desc>Need to define which globals objects created by this spec are associated with</short_desc>
          <delta_ts>2016-05-24 00:38:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Web Cryptography</product>
          <component>Web Cryptography API Document</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</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="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="Ryan Sleevi">sleevi</assigned_to>
          <cc>public-webcrypto</cc>
    
    <cc>watsonm</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>125324</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2016-03-02 15:07:57 +0000</bug_when>
    <thetext>Consider the attached testcase.  I believe it should log false, true, false, true.  That&apos;s not what I see in either Chrome or Firefox, though, and Chrome and Firefox don&apos;t agree with each other either.

The spec doesn&apos;t actually define behavior here.  It simply says:

  Let result be the CryptoKey object that results from performing the
  import key operation specified by normalizedAlgorithm using keyData,
  algorithm, format, extractable and usages.

and the specific algorithm sections say things like:

  Let key be a new CryptoKey object that represents the RSA public key identified
  by publicKey

without saying which global it&apos;s associated with.  Note that the IDL specification requires all IDL objects to be explicitly associated with some global.  There are proposals for adding some sort of implicit association for simple cases of synchronous object creation (which would make the first two things logged in this testcase be &quot;false, true&quot;, as in Firefox), but async things would need to be handled a bit more explicitly still.

In any case, I consider the Firefox behavior here where the Promise and the CryptoKey come from different globals a bug (tracked at &lt;https://bugzilla.mozilla.org/show_bug.cgi?id=1250930&gt;) and will suggest that Firefox switch to the &quot;false, true, false, true&quot; behavior I mention above...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125325</commentid>
    <comment_count>1</comment_count>
      <attachid>1637</attachid>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2016-03-02 15:08:28 +0000</bug_when>
    <thetext>Created attachment 1637
Testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126545</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Watson">watsonm</who>
    <bug_when>2016-05-24 00:38:34 +0000</bug_when>
    <thetext>Moved to https://github.com/w3c/webcrypto/issues/85</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1637</attachid>
            <date>2016-03-02 15:08:28 +0000</date>
            <delta_ts>2016-03-02 15:08:28 +0000</delta_ts>
            <desc>Testcase</desc>
            <filename>bar.html</filename>
            <type>text/html</type>
            <size>587</size>
            <attacher name="Boris Zbarsky">bzbarsky</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aWZyYW1lPjwvaWZyYW1lPgo8c2NyaXB0PgogIG9ubG9h
ZCA9IGZ1bmN0aW9uKCkgewogICAgdmFyIHAgPSBjcnlwdG8uc3VidGxlLmltcG9ydEtleS5jYWxs
KAogICAgICBmcmFtZXNbMF0uY3J5cHRvLnN1YnRsZSwKICAgICAgInJhdyIsCiAgICAgIGNyeXB0
by5nZXRSYW5kb21WYWx1ZXMobmV3IFVpbnQ4QXJyYXkoMTApKSwKICAgICAge25hbWU6ICJITUFD
IixoYXNoOiB7bmFtZTogIlNIQS0xIn0sfSwKICAgICAgZmFsc2UsCiAgICAgIFsic2lnbiIsICJ2
ZXJpZnkiXSk7CiAgICBjb25zb2xlLmxvZyhwLl9fcHJvdG9fXyA9PSBQcm9taXNlLnByb3RvdHlw
ZSk7CiAgICBjb25zb2xlLmxvZyhwLl9fcHJvdG9fXyA9PSBmcmFtZXNbMF0uUHJvbWlzZS5wcm90
b3R5cGUpOwogICAgcC50aGVuKGZ1bmN0aW9uKGtleSkgewogICAgICBjb25zb2xlLmxvZyhrZXku
X19wcm90b19fID09IENyeXB0b0tleS5wcm90b3R5cGUpOwogICAgICBjb25zb2xlLmxvZyhrZXku
X19wcm90b19fID09IGZyYW1lc1swXS5DcnlwdG9LZXkucHJvdG90eXBlKQogICAgfSk7CiAgfQo8
L3NjcmlwdD4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>