Closed Bug 286844 Opened 20 years ago Closed 3 years ago

Single window mode behaves incorrectly on the page http://www.ophiuchus.org/photos/fosdem05/

Categories

(SeaMonkey :: Tabbed Browser, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: bugmail-mozilla, Unassigned)

References

()

Details

Attachments

(1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050318 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050318 Firefox/1.0+

The firefox built-in single window mode can be turned on by checking the "Force
links that open new windows to open in:" option of the "Tab" options menu (In
firefox 1.0.x you have to activate the pref
browser.tabs.showSingleWindowModePrefs first, and it is in the "Advanced" options.)

If you choose to open links in the same tab/window as the link and go to the
page http://www.ophiuchus.org/photos/fosdem05/ you will see a strange behaviour.
When you click on a photo to see it in bigger size, a script
(http://www.ophiuchus.org/scripts/popup.js) tries to open a popup window.

This new window is blocked by Firefox. But instead of opening the maximized
image in a new blank page in the same tab, Firefox replaces the first thumbnail
of the page with it. If you click on another image in the page, it closes the
page. You cannot press the "back" button.

Reproducible: Always

Steps to Reproduce:
1. Turn on the built-in single window mode
2. go on the page http://www.ophiuchus.org/photos/fosdem05/
3. click on a thumbnail image to view it maximized

Actual Results:  
Firefox replaces the first image of the page by the maximized image.

Expected Results:  
It should have moved to the location of the image and showed only the image in a
blank page in the same tab.

Sometimes you need to view several images before the bug occurs. Once it has
occured, you'll see it every time.

If you use a tabbed browsing extension like Tabbrowser Extensions, Tabbrowser
Preferences, Tab Mix or Single Window for example, it is possible that the bug
doesn't occurs. You will have to inactivate theese extensions or to try with a
new profile.

Please note that there are also problems if you choose to opens the links in "a
new tab" instead of in the same tab/window. On this page, it opens a new blank
tab without the image.
There is a HTML minimal testcase. Actually the minimal things really needed are
the script and a link with class="popup".

After clicking the link (and normally opened the popup), the following code is
parsed : 

  // Check if there is already an image in case of recycling
  if (!w.document.images[0])
    // Create a new image in the document
    w.document.body.appendChild(w.document.createElement("IMG"));

It looks like Firefox is handling this exactly in the same way that if a popup
was previously opened, but the current page is modified instead of the popup.

Furthermore the window.close function seems to be allowed, even if in facts the
window was not a popup opened by a script but was a normal window.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b2) Gecko/20050505

This occurs with a trunk build of the suite as well, at least when enough JS
actions are allowed, so I guess this is really a Core bug.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Product: Firefox → Core
Version: unspecified → Trunk
You need to have browser.link.open_newwindow.restriction set to 0 to see this bug.

In Firefox it's now on 2 by default and here the popup opens as it is a resized one. Thus the bug doesn't appear.

But if you put the pref on 2, the bug is still here (and still here in seamonkey too, where the pref is on 0 by default).
Comment on attachment 178035 [details]
Minimal HTML Testcase with english comments

I think this testcase is not good. There it really does what the script tells it to (to add an IMG element at the end). I don't know why I didn't notice this earlier.

If there is a problem, it is really that on the FOSDEM page the IMG element is added within the first <TD> instead of at the end of the body. This may not really be Mozilla's fault but somehow an error of the script because it does not handle the non-popup case correctly. Not sure what the w variable is, when the popup fails...
Attachment #178035 - Attachment is obsolete: true
-> product/component default assignee/qa
Assignee: bugs → nobody
QA Contact: tabbed.browser → tabbed-browser
Product: Core → SeaMonkey

Site no longer available

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: