Audit uses of Maybe<JSAutoRealm> for the Maybe not getting constructed based on _compartments_ instead of realms
Categories
(Core :: General, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | affected |
People
(Reporter: bzbarsky, Assigned: jandem)
References
Details
Looking at things like https://searchfox.org/mozilla-central/rev/7944190ad1668a94223b950a19f1fffe8662d6b8/dom/base/Element.cpp#3455-3459 where we should either JSAutoRealm unconditionally or base it on whether the realms match, not on whether compartments match.
Jan, is this something you might have time for, or know someone who might?
Assignee | ||
Comment 1•6 years ago
|
||
I looked at uses of Maybe<JSAutoRealm> and GetObjectCompartment. I didn't find other instances of the pattern in Element::Animate, but I did notice:
This is correct right? Because the reflector's realm does not depend on who's asking?
These could be global/realm asserts instead of compartment assertions I think?
Reporter | ||
Comment 2•5 years ago
|
||
This is correct right? Because the reflector's realm does not depend on who's asking?
Right. And importantly, this callee does not have the context to know whether to wrap into the current compartment or not, so it can't make that decision itself: some of its consumers do not want the wrapping.
That said, I kinda wish this function would go away...
These could be global/realm asserts instead of compartment assertions I think?
Yes. I had actually changed those in https://phabricator.services.mozilla.com/D29706#change-dhTgUTQSN3nc yesterday; it just hasn't landed yet.
Thank you for looking through this stuff!
Description
•