[Bug 25390] Use [Exposed] in IDL

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25390

--- 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