This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29514 - Need to define which globals objects created by this spec are associated with
Summary: Need to define which globals objects created by this spec are associated with
Status: RESOLVED MOVED
Alias: None
Product: Web Cryptography
Classification: Unclassified
Component: Web Cryptography API Document (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Ryan Sleevi
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-02 15:07 UTC by Boris Zbarsky
Modified: 2016-05-24 00:38 UTC (History)
2 users (show)

See Also:


Attachments
Testcase (587 bytes, text/html)
2016-03-02 15:08 UTC, Boris Zbarsky
Details

Description Boris Zbarsky 2016-03-02 15:07:57 UTC
Consider the attached testcase.  I believe it should log false, true, false, true.  That's not what I see in either Chrome or Firefox, though, and Chrome and Firefox don't agree with each other either.

The spec doesn'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'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 "false, true", 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 <https://bugzilla.mozilla.org/show_bug.cgi?id=1250930>) and will suggest that Firefox switch to the "false, true, false, true" behavior I mention above...
Comment 1 Boris Zbarsky 2016-03-02 15:08:28 UTC
Created attachment 1637 [details]
Testcase
Comment 2 Mark Watson 2016-05-24 00:38:34 UTC
Moved to https://github.com/w3c/webcrypto/issues/85