Bug 248023: javascript popups cause document scrolling

Instructions: First make sure you allow requested popups for mousedown event: in about:config, make sure you have mousedown in the list of events for the dom.popup_allowed_events setting.

There are 4 clickable images in this demo. 2 of them have
window.open('[URIimageFile]', '...', '[windowFeatures]'); return false;
and 2 of them have no return false. 2 of them are triggered with onclick, the other 2 are triggered with the onmousedown event attribute.

Expected results: each clickable links withOUT a return false should open/spawn a secondary popup and should bring the opener/parent window back at the top of the opener/parent document.
Each clickable links WITH a return false should open/spawn a secondary popup and should NOT bring the opener/parent window back at the top of the opener/parent document.

Filler

Filler

onmousedown links

Filler

Filler

Link #1: Krusty Burger This one does NOT have a return false: so after spawning the popup, this link should cause this document to scroll back to the top
The call and code of this link is:
<a href="#" onmousedown="MM_openBrWindow('../GRAPHICS/GIF/krusbur.gif', 'KrustyRestaurant', 'width=528,height=372');"><img src="../GRAPHICS/JPG/KrustyBurger.jpeg" width="99" height="101" alt="Krusty Burger"></a>

Filler

Filler

Link #2: Krusty is hungry This one HAS a return false: so after spawning the popup, this link should NOT cause this document to scroll back to the top
The call and code of this link is:
<a href="#" onmousedown="MM_openBrWindow('../GRAPHICS/JPG/KrustyRich.jpg', 'KrustyRich', 'width=210,height=230'); return false;"><img src="../GRAPHICS/JPG/KrustyHungry.jpeg" width="84" height="79" alt="Krusty is hungry"></a>

Filler


Filler

onclick links

Filler

Filler

Link #3: Krusty Burger This one does NOT have a return false: so after spawning the popup, this link should cause this document to scroll back to the top
The call and code of this link is:
<a href="#" onclick="MM_openBrWindow('../GRAPHICS/GIF/krusbur.gif', 'KrustyRestaurant', 'width=528,height=372');"><img src="../GRAPHICS/JPG/KrustyBurger.jpeg" width="99" height="101" alt="Krusty Burger"></a>

Filler

Filler

Link #4: Krusty is hungry This one HAS a return false: so after spawning the popup, this link should NOT cause this document to scroll back to the top
The call and code of this link is:
<a href="#" onclick="MM_openBrWindow('../GRAPHICS/JPG/KrustyRich.jpg', 'KrustyRich', 'width=210,height=230'); return false;"><img src="../GRAPHICS/JPG/KrustyHungry.jpeg" width="84" height="79" alt="Krusty is hungry"></a>

Valid HTML 4.01! Valid CSS!