-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should navigator.productSub/vendor/vendorSub be exposed to workers? #216
Comments
I'm all in favor of not exposing this legacy cruft in workers.... |
I have tested Edge. All of the tested attributes are exposed on Window, as expected, but all except |
@travisleithead can you fix that? |
Internal Edge bug filed (reference: VSO4790009). Thanks for the tip! |
@travisleithead, any thoughts on what to do with The one thing that bugs me is that it's going to look entirely arbitrary which attributes are exposed and not. It's pretty likely that more of this legacy cruft could be hidden from workers, but the effort to measure that hardly seems worth it. |
@foolip it seems clear that we should not expose those three in workers? If Blink and Gecko agree and Edge is interested in aligning, then why not split them off? |
I've now also tested in Safari and it exposes Adding all of this up, it seems pretty likely that it's web-compatible not not expose |
SGTM |
Someone should write web-platform-tests for this too :) |
The set of attributes with [Exposed=Window] is the union of attributes NOT exposed on Worker in shipping browsers: Blink: productSub, vendor, vendorSub Edge: appCodeName Gecko: productSub, vendor, vendorSub WebKit: appCodeName, product, productSub, vendor, vendorSub Fixes #216
The set of attributes without [Exposed=(Window,Worker)] is the union of attributes NOT exposed on Worker in shipping browsers: Blink: productSub, vendor, vendorSub Edge: appCodeName Gecko: productSub, vendor, vendorSub WebKit: appCodeName, product, productSub, vendor, vendorSub Fixes #216
Oops, bad news. It's invalid per WebIDL to use This ought to be a problem for Ideas? |
It would presumably work to split things up into a few different mixin interfaces, right? |
Merge |
Why is that invalid? There are three interfaces here:
This is satisfied for members of
This is satisfied for both So what is the problem exactly? But yes, simply using two mixins would also work, and would be robust even in the face of changes to IDL that attempt to make the "mixin being mixed into interfaces with different exposure sets contains things that would only be exposed in one of them" pattern illegal. Then again, I believe the current spec is explicitly written to allow that pattern. |
Inlining the Window-only members in the definition of |
@bzbarsky, I didn't check what the WebIDL spec says before writing, I just got an error from Blink's IDL compiler and assumed it was right about this. I don't have the error in front of me, but I think Blink's IDL compiler treats the
How is this supposed to work with |
Like I said in #216 (comment): The check is done against the interface the member is actually defined on, which is
That is the situation right now, yes. I do think that the simplest thing to do in this situation is to put the non-shared stuff on |
Thanks, reopening so that I remember to fix this somehow. |
Putting them directly on |
Yeah, if this is valid per Web IDL I guess we could keep it the way it is. Closing again, but if anyone thinks it's too confusing like this or wants to lobby for Web IDL to make it invalid, just say the word. |
Tests: web-platform-tests/wpt#3881 Attempting to write tests for the current spec revealed that product was already exposed in all engines, and appCodeName in all but Edge. This leaves productSub, vendor and vendorSub restricted, where there is a 2/2 split between engines. Follow up to #216.
Updating Blink to the recent NavigatorID changes, it makes productSub, vendor and vendorSub exposed on Worker where it previously was not. I've tested with this script:
Blink (Opera) and Gecko (Firefox) both agree that productSub/vendor/vendorSub are not exposed on workers.
Should we limit these to Window in the spec as well, or just go ahead and expose them?
CC @bzbarsky
The text was updated successfully, but these errors were encountered: