Closed Bug 270345 Opened 20 years ago Closed 20 years ago

nsIDocShellTreeItem's parent and treeOwner attributes are not scriptable

Categories

(Core :: DOM: Navigation, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla1.8beta1

People

(Reporter: darin.moz, Assigned: darin.moz)

Details

Attachments

(1 file)

nsIDocShellTreeItem's parent and treeOwner attributes are not scriptable

To be precise, it is the setters for these attributes that are not scriptable. 
They store pointers to the given interface pointers without calling AddRef! :(

It would be very bad if someone tried to assign a value to either of these from
JS or some other nsXPTCStub-based language binding.
Attached patch v1 patchSplinter Review
simple patch (browser.js actually reads the treeOwner attribute)
Attachment #166204 - Flags: superreview?(bzbarsky)
Attachment #166204 - Flags: review?(cbiesinger)
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8beta
Attachment #166204 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 166204 [details] [diff] [review]
v1 patch

ok, r=biesi, but this seems to be somewhat ugly... can we keep an
nsIWeakReference or something here, instead of having to mark this noscript?
Attachment #166204 - Flags: review?(cbiesinger) → review+
it is ugly, but i don't have time to fix it properly.  if you want to cut a
patch, please do.  currently, we don't have any script callers, and it would
seem there is no need for script callers :-/
actually, i can think of some people who would want to use this...
timeless: examples?
smaug's evil code iirc :)
Well, then his code must result in crashes or other badness.
of course :), but he's working on that.
This patch does not affect my code, not at least for now.
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Just a heads-up -- I plan to remove the ability to set the parent on this
interface in the very near future.  I'm not sure about the treeowner yet....  We
really want to only allow setting it on "root" docshells, somehow.
ah, good - that makes comment 2 and comment 3 moot, it seems.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: