Closed Bug 643803 Opened 9 years ago Closed 9 years ago

Expose DOMWindowUtils via SpecialPowers

Categories

(Testing :: Mochitest, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla5

People

(Reporter: ted, Assigned: ted)

References

Details

Attachments

(1 file, 1 obsolete file)

Lots of tests use nsIDOMWindowUtils, so we should just expose it wholesale via SpecialPowers. I have a patch that exposes the current window's implementation as SpecialPowers.DOMWindowUtils. This should let us fix a whole raft of tests that are using enablePrivilege just to get at this interface.

bz wrote the meat of this patch for me, I just wired it all up. It's a little hard to follow, but we expose all the properties on the object via another object, but functions get an anonymous wrapper that calls the original, so that they get called from a privileged scope.
Here's the patch. I'm going to fix tests in a separate patch.
Attachment #520953 - Flags: review?(ctalbert)
Assignee: nobody → ted.mielczarek
Status: NEW → ASSIGNED
Blocks: 596600
Comment on attachment 520953 [details] [diff] [review]
Expose DOMWindowUtils via SpecialPowers.

This looks really cool.  I had no idea this level of wizardry was available to us.  Thanks bz and ted.  I'm building a new fennec desktop to try out the patch in, but the patch is very straightforward so I'm pretty confident with the r+.  I'll report back if I find problems on fennec desktop.
Attachment #520953 - Flags: review?(ctalbert) → review+
Attachment #520953 - Attachment is obsolete: true
http://hg.mozilla.org/mozilla-central/rev/b1267148533d
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.2
FYI, this works great in Fenenc desktop.
Blocks: 649124
You need to log in before you can comment on or make changes to this bug.