Closed Bug 1568285 Opened 2 years ago Closed 2 years ago

Stop implementing JS-exposed QueryInterface on XUL tree 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)

nsTreeContentView can only QI to nsISupports and nsITreeView, and nothing in JS QIs to nsITreeView.

nsTreeColumns only QIs to nsISupports.

I tried adding a MOZ_CRASH in dom::QueryInterface when the object is anything other than an element or window, and that crash is not hit in our tests (see https://treeherder.mozilla.org/#/jobs?repo=try&revision=0f45b9e009b38a8df79c04e4e42197e50e04b1a4), so I am guessing nothing ever QIs these tree objects.

Geoff, could you take a look at the ramifications of this. We've recently landed this: https://hg.mozilla.org/comm-central/rev/3004cd1a0a75

Flags: needinfo?(geoff)
Summary: Stop implementing QueryInterface on XUL tree objects → Stop implementing JS-exposed QueryInterface on XUL tree objects
Attachment #9080119 - Attachment description: Bug 1568285. Stop implementing QueryInterface for TreeColumns and TreeContentView. r=peterv → Bug 1568285. Stop implementing JS-exposed QueryInterface for TreeColumns and TreeContentView. r=peterv

For comm-central, the line at https://searchfox.org/comm-central/rev/687b960093d4d527105ef9faaadeec9d6a535739/mailnews/base/util/jsTreeSelection.js#587 should probably just be removed, or have a try/catch around it.

Depends on: 1568420

To be continued in bug 1568420.

Flags: needinfo?(geoff)
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d3c19058cf40
Stop implementing JS-exposed QueryInterface for TreeColumns and TreeContentView.  r=peterv
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.