window.open(url, "_content") clobbers foreground tabs

RESOLVED FIXED

Status

()

RESOLVED FIXED
14 years ago
13 years ago

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Tracking

(Depends on: 1 bug, {fixed1.8.1})

Trunk
x86
Linux
fixed1.8.1
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [window targeting])

Attachments

(1 attachment)

STEPS TO REPRODUCE:

1)  Make sure your tabs open in the background
2)  Open attached testcase in a new tab

EXPECTED RESULTS:

The new tab says "I killed the old content" while the old tab has the bug page.

ACTUAL RESULT:

The new tab is blank, while the old tab says "I killed the old content" and the
bug page is gone.

This is akin to bug 265987.  The problem is that _content and _main resolve to
the "content-primary" docshell, but for tabbrowser that's the currently visible
tab.  Changes in bug 103638 may impose a cross-site security check here, which
will just make the call fail instead of doing what it's supposed to do.

The "right" fix would be to make _content and _main resolution do "the right
thing" when called from inside a webpage.  That means it should end up with the
equivalent of _top.

The question then is how to tell "when called from inside a webpage" apart from
other cases...

In general, perhaps nsIDocShellTreeOwner should have a list of content-primary
shells, not just one?  Or some other api to get all "main browser" shells?
Created attachment 168383 [details]
Testcase
The sidebar needs to be able to use _content to open links in the current tab...
Yes, I'm aware of that.  That's what makes this "when called inside a webpage"
thing hard... ;)
(Assignee)

Updated

14 years ago
Blocks: 277971
(Assignee)

Updated

13 years ago
Whiteboard: [window targeting]
(Assignee)

Updated

13 years ago
Depends on: 277972, 326009
(Assignee)

Updated

13 years ago
No longer blocks: 277971
Depends on: 277971
(Assignee)

Updated

13 years ago
Assignee: general → bzbarsky
Fixed on trunk and 1.8 branch by checkin for bug 277971.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.