Closed Bug 1568303 Opened 5 years ago Closed 5 years ago

Stop implementing JS-exposed QueryInterface on some core DOM objects

Categories

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

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

We don't do QI on webidl objects other than Window and Element in Firefox. See try run at https://treeherder.mozilla.org/#/jobs?repo=try&revision=0f45b9e009b38a8df79c04e4e42197e50e04b1a4

This means we can remove QI from Document, DocumentFragment, and Event.

On the try push some removals of QueryInterface(Ci.nsIDOMChromeWindow). We have a few of those:
https://searchfox.org/comm-central/search?q=QueryInterface(Ci.nsIDOMChromeWindow)&case=false&regexp=false&path=

What exactly will you remove here?

Like comment 0 says, this will remove QI methdos on Document, DocumentFragment, and Event instances.

I suggest applying https://hg.mozilla.org/try/rev/a3fb3aa2c7e8645c336c23d7bf2c0b97f6dee38d and doing a test run on Thunderbird to see whether this affects you.

Hmm, the "domparser checkies". But in the other patch you remove QueryInterface(Ci.nsIDOMChromeWindow). Wouldn't we need to do the same? How is DOMParser related to the QI on other DOM objects? Also, isn't DOMParser covered in bug 1568281? I'm confused.

Wouldn't we need to do the same?

That's needed to remove QI on Window objects, but I'm not removing that yet. I'll give you a heads-up of I get close to doing that.

How is DOMParser related to the QI on other DOM objects?

It's not.

Also, isn't DOMParser covered in bug 1568281?

It is.

I'm confused.

You're paying attention to the commit message on a test patch, which has nothing to do with that patch's contents. What that patch actually does is MOZ_CRASH if a QI happens on any Web IDL objects that is not an Element or Window. My current goal with the set of patches I have up is to remove QI for everything that's not Element or Window.

OK, thanks, here we go:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=66a759acb46876660a75053797cb68e957f69ce0
based on https://hg.mozilla.org/try/rev/e8b7cc3091ffa98ca7ed15242c8e1328fea8ea07
Oh, in case you're looking at it, the Z4 in testCategoryColors.js is currently expected.

OK, you probably want to look at the "MOZ_CRASH(This is not a great thing to be doing)" bits in the debug failure logs. I commented on the one thing I see there in bug 1568285.

Thanks, let's move the discussion to bug 1568420.

Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6598e37c88d2
Stop implementing JS-exposed QueryInterface on some core DOM objects.  r=peterv
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: