Re: [heycam/webidl] Introduce a SameRealmBrandCheck extended attribute (#718)

> he implied it would decrease the complexity

It requires new codepahts in bindings and JITs, no?  I don't see how that decreases complexity.  It does slow down various codepaths involving bindings, by adding an extra branch on this state, which is not great.  I've been trying to think about how to eliminate that and haven't come up with something workable, but I keep hoping I will.

As you point out, it might decrease complexity in some API implementations, because relevant realm and current realm are the same.  I agree that this is a nice benefit.

On the other hand, it increases the mental overhead for consumers a bit, because now these APIs act like nothing else in the web's standard library (either WebIDL-defined or ES-defined)... And people probably shouldn't do the `.call()` thing, but in some cases they do...

> how would you polyfill that

So the real question here is how to ensure that the branding window1 and window2 use is compatible, right?   And specifically, what's being polyfilled is the entire interface, not just one method?

If we want something guaranteed non-spoofable, I haven't thought of a good option here yet.




-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/718#issuecomment-487334791

Received on Sunday, 28 April 2019 02:18:06 UTC