Closed Bug 1017951 Opened 10 years ago Closed 10 years ago

Prevent using [Pref] on names that are exposed to workers

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: ehsan.akhgari, Unassigned)

References

Details

Boris mentioned that these currently generate code which access the pref service from the worker.  We should explicitly generate a WebIDL compiler error for now before someone starts to need it without realizing the implications.
The problem is the codegen doesn't know what's exposed to workers....
Yeah, this is simply not possible today :(

We do need to move the information about which interfaces are visible in workers into codegen eventually to generate RegisterBindings.cpp.  Perhaps we should do that now.
(In reply to comment #1)
> The problem is the codegen doesn't know what's exposed to workers....

Hmm, can't it check [ExposedTo] from the AST?
(In reply to :Ehsan Akhgari (lagging on bugmail, needinfo? me!) from comment #3)
> (In reply to comment #1)
> > The problem is the codegen doesn't know what's exposed to workers....
> 
> Hmm, can't it check [ExposedTo] from the AST?

What is [ExposedTo]?
> What is [ExposedTo]?

Ehsan mean [Exposed], from <http://heycam.github.io/webidl/#Exposed>: A pretty new addition to the spec.

But yes, we should implement [Exposed].  We can also use it to do things like skip codegen for some things on workers.

That said, I think the current spec for [Exposed] is wrong in an obvious way.  See https://www.w3.org/Bugs/Public/show_bug.cgi?id=25495
(In reply to Boris Zbarsky [:bz] from comment #5)
> > What is [ExposedTo]?
> 
> Ehsan mean [Exposed], from <http://heycam.github.io/webidl/#Exposed>: A
> pretty new addition to the spec.
> 
> But yes, we should implement [Exposed].  We can also use it to do things
> like skip codegen for some things on workers.

Ah, yeah, sorry I didn't realize that we haven't implemented that yet.  And I got the name wrong too!!

> That said, I think the current spec for [Exposed] is wrong in an obvious
> way.  See https://www.w3.org/Bugs/Public/show_bug.cgi?id=25495

Can we somehow help improve the situation there?  I think supporting [Exposed] would be beneficial to the readability of our WebIDL files as well.
Depends on: 1017988
I filed bug 1017988 on implementing [Exposed].

> Can we somehow help improve the situation there? 

https://github.com/heycam/webidl/pull/12
(In reply to comment #7)
> I filed bug 1017988 on implementing [Exposed].
> 
> > Can we somehow help improve the situation there? 
> 
> https://github.com/heycam/webidl/pull/12

Thanks!
Is this possible to fix now?
Bug 1017988 part 10 fixes it.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.