Closed Bug 273984 Opened 20 years ago Closed 18 years ago

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

Categories

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

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Depends on 1 open bug)

Details

(Keywords: fixed1.8.1, Whiteboard: [window targeting])

Attachments

(1 file)

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?
Attached file 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... ;)
Blocks: 277971
Whiteboard: [window targeting]
Depends on: 277972, 326009
No longer blocks: 277971
Depends on: 277971
Assignee: general → bzbarsky
Fixed on trunk and 1.8 branch by checkin for bug 277971.
Status: NEW → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: