Closed Bug 278916 Opened 20 years ago Closed 20 years ago

[FIX]link launches blank popup window and new page with the desired content


(Core :: DOM: Navigation, defect, P1)






(Reporter: friscofrog, Assigned: bzbarsky)




(Keywords: fixed-aviary1.0.1, fixed1.7.6, Whiteboard: Ignore comments 8-12)


(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/125.5.5 (KHTML, like Gecko) Safari/125.11
Build Identifier: Camino 2005011008

On the homepage there is a small image in the right column
with the caption "Day in Pictures" Clicking on the text or the picture launches
a smaller blank popup window and a new regular sized window which contains the
desired content. This problem was first noted by me on the nightlies released on
January 11 and all thereafter. It does not exist with the latest version of
Mozilla (1.8a) or Firefox or versions of Camino prior to Jan 11. The desired
action on clicking on the text or image is to launch the popup with content
which can be navigated within that window.

Reproducible: Always

Steps to Reproduce:
1.Launch any Camino nightly build after Jan 11
2.Go to on image or text labelled "Day in Pictures"

Actual Results:  
A blank popup window is launched and then is covered with a regular-sized new
window with the desired content

Expected Results:  
Content should be present in popup window. It should be navigatable. No new
larger window should be created.
Here's the relevant bit of HTML:

<!-- day in pictures -->

<A HREF="/cgi-bin/object/dip?f=/g/archive/2005/01/18/dip.DTL" TARGET="photos"
<img src="/templates/types/homepage/graphics/sub_dip2.gif" width="118"
height="15" border="0" vspace="3" hspace="0"></a><br>

<table border="0" cellpadding="0" cellspacing="0" width="143"><tr><td valign="top">
<A HREF="/cgi-bin/object/dip?f=/g/archive/2005/01/18/dip.DTL" TARGET="photos"
SRC="/templates/types/object/graphics/dip_t.gif" HEIGHT="64" WIDTH="64"
HSPACE="0" VSPACE="0" border="1"></A></td>
<td width="2">&nbsp;</td>
<td valign="middle" class="text1sm">

Animal tales and human prayers. 
<A HREF="/cgi-bin/object/dip?f=/g/archive/2005/01/18/dip.DTL" TARGET="photos"

To my ignorant eye, it looks like they're using both a TARGET and an
onClick=", which seems iffy to my ignorant brain.

From the rest of the initial report, it seems to me that something in the way
Gecko handled those changed on Jan 11 on the trunk.

FriscoFrog, did you test in Mozilla 1.8a6 (which was released on Jan 12 and may
or may not have that code depending on the freeze point) and/or a Firefox
nightly after Jan 11?
jst, did any popup blocking stuff change last week that camino might have missed?
Confirming :)
Severity: normal → major
Ever confirmed: true
Target Milestone: --- → Camino0.9
Mike, I bet this changed when security bug 273699 was fixed, that bug was fixed
by bug 103638.
*** Bug 279201 has been marked as a duplicate of this bug. ***
This regressed between 11 and 12 januarie.
I looked and it seems that Johnny Stenback is right in that those two bugs seems
to be the cause when looking at the checkins.
So the problem is clearly that the target is not finding the just-opened window.
 Is the window being found but failing the security checks added in bug 103638?
 Or is it just not being found at all?

Also, does Camino use nsWebBrowser and nsDocShellTreeOwner, or does it use the
appshell goop in xpfe/?  If the former, does it also have its own
nsIDocShellTreeOwner implementation?
Same problem for Mozilla trunk: Bug 279495.
No, that's a different problem.  I can reproduce that bug with Mozilla trunk,
but this one worksforme.  So this one is likely to be embedding-specific or
Depends on: 279495
I've noticed some issues with when it's called with an empty
location part (e.g.,'', 'foo');). I wonder if this is related?
Nevermind, (I think) my issue is unrelated (though this bug did help me narrow
some of my own problems down).
 Disabling javascript eliminated the blank popup window leaving only the larger
new page. The desired result is to have the content in the smaller popup window.
Oh well, at least the developers are aware of that bug and are working on a fix
(I hope.) Disabling javascript also "fixed" bug 280390. Thanks to Wevah for
finding the link.
Mike, Simon, could you answer my question from comment 7?  I'm trying to sort
out why this could happen by code inspection, but it'd help to know which code
to inspect...
Whiteboard: Ignore comments 8-12
Would the fix for bug 279495 have fixed this?
Possible, but unlikely -- see comment 9...
Attached patch Proposed patchSplinter Review
OK, I think this should fix it, assuming that Camino uses nsWebBrowser.  I did
test this in TestGtkEmbed (which was also showing this bug).

The basic issue is that the window-finding code in nsDocShellTreeOwner was just
wrong -- it skipped looking in other windows if its requestore was its child
docshell, which is exactly the case when you _do_ want to look in other

This patch makes the code be pretty similar to that in
nsChrome/ContentTreeOwner, with the modifications I added in bug 279495.
Assignee: pinkerton → bzbarsky
Attachment #173190 - Flags: superreview?(jst)
Attachment #173190 - Flags: review?(danm.moz)
Since it's a general embedding problem, moving to core....
Component: General → Embedding: Docshell
Flags: review?(danm.moz)
OS: MacOS X → All
Product: Camino → Core
Hardware: Macintosh → All
Target Milestone: Camino0.9 → ---
Version: unspecified → Trunk
Priority: -- → P1
Summary: link launches blank popup window and new page with the desired content → [FIX]link launches blank popup window and new page with the desired content
Target Milestone: --- → mozilla1.8beta
Attachment #173190 - Flags: review?(danm.moz)
Flags: blocking1.7.6+
Flags: blocking-aviary1.0.1+
Comment on attachment 173190 [details] [diff] [review]
Proposed patch

Attachment #173190 - Flags: superreview?(jst) → superreview+
Blocks: 103638
Attachment #173190 - Flags: review?(danm.moz) → review+
This patch fixes Camino -- thanks Boris! (I see another crash when closing the
DIP window on SFGate: will file separately.)
Closed: 20 years ago
Resolution: --- → FIXED
Comment on attachment 173190 [details] [diff] [review]
Proposed patch

a=caillon (on behalf of drivers) for 1.0.1 and 1.7.6
Attachment #173190 - Flags: approval1.7.6+
Attachment #173190 - Flags: approval-aviary1.0.1+
Whiteboard: Ignore comments 8-12 → Ignore comments 8-12 [needs branch landing]
Fixed on 1.0.1 and 1.7 branches.
Keywords: fixed1.7.6
Verified Fixed on Win32 with latest Aviary 1.0.1 and Mozilla 1.7.6 builds.
Whiteboard: Ignore comments 8-12 [needs branch landing] → Ignore comments 8-12
Test for this got added in bug 408052.
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.