W3C home > Mailing lists > Public > public-webcrypto@w3.org > April 2014

[Bug 25390] Use [Exposed] in IDL

From: <bugzilla@jessica.w3.org>
Date: Mon, 28 Apr 2014 23:59:13 +0000
To: public-webcrypto@w3.org
Message-ID: <bug-25390-7213-3rFsiHtx7A@http.www.w3.org/Bugs/Public/>

--- Comment #2 from Ryan Sleevi <sleevi@google.com> ---
(In reply to Anne from comment #0)
> Instead of Crypto, WorkerCrypto, and RandomSource, have this:
> [Exposed=Window,Worker]
> interface Crypto {
>   readonly attribute SubtleCrypto subtle;
>   ArrayBufferView getRandomValues(ArrayBufferView array);
> };

This is not equivalent to what is in the spec. According to
http://heycam.github.io/webidl/#Exposed , Exposed only applies to an interface
if it's part of the global scope (eg: exposed on the global scope)

Your proposed modifications mean it's no longer "window.crypto.subtle" or
"worker.crypto.subtle", but instead, "window.subtle", which is not the same,
nor necessarily desirable.

If Crypto was a Constructable-object, yes, it would mean you could do "new
Crypto" from the context of a worker - except it's not.

Unless I'm missing something, isn't this a WontFix?

(In reply to Anne from comment #1)
> You probably also need [Exposed] for various other interfaces to make sure
> they are exposed in workers.

Did you have any interfaces in mind? None of the interfaces are constructible,
which would be the only thing that exposing them would seem of value.

Even still, using [Exposed] would seem wrong, because the global object does
*not* implement the interfaces specified.

You are receiving this mail because:
You are on the CC list for the bug.
Received on Monday, 28 April 2014 23:59:15 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:17:22 UTC