The default bug view has changed. See this FAQ.

document.open with 3 or more arguments should call OpenJS, not Open

RESOLVED FIXED in mozilla14

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

Trunk
mozilla14
x86
Mac OS X
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Created attachment 611338 [details]
Testcase

Right now it seems to call Open(), which makes the behavior wrong when opening a sized window.  Try the attached testcase.

Changing to OpenJS here makes things work right.  Since we really only support document.open() from script, that seems like a reasonable change to me.
Created attachment 611339 [details] [diff] [review]
document.open with 3 or more arguments should invoke the scriptable version of window.open, not the noscript one.
Attachment #611339 - Flags: review?(jst)
Assignee: nobody → bzbarsky
Whiteboard: [need review]

Updated

5 years ago
Attachment #611339 - Flags: review?(jst) → review+
Comment on attachment 611339 [details] [diff] [review]
document.open with 3 or more arguments should invoke the scriptable version of window.open, not the noscript one.

Review of attachment 611339 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/html/document/test/test_bug741266.html
@@ +20,5 @@
> +
> +/** Test for Bug 741266 **/
> +var w = window.open("", "", "width=100,height=100");
> +is(w.innerHeight, 100, "Popup height should be 100 when opened with window.open");
> +is(w.innerWidth, 100, "Popup widthshould be 100 when opened with window.open");

Nit: space in the message (twice)
https://hg.mozilla.org/integration/mozilla-inbound/rev/d83c1ffb7397 with that nit fixed.
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla14
backed out cause the newly added test fails on Windows
https://hg.mozilla.org/integration/mozilla-inbound/rev/3be23dcd43e4

87069 ERROR TEST-UNEXPECTED-FAIL | /tests/content/html/document/test/test_bug741266.html | Popup width should be 100 when opened with window.open - got 114, expected 100
87071 ERROR TEST-UNEXPECTED-FAIL | /tests/content/html/document/test/test_bug741266.html | Popup width should be 100 when opened with document.open - got 114, expected 100
Bah.  That's totally broken...

I'll rework the test a bit.
With the fixed test: https://hg.mozilla.org/integration/mozilla-inbound/rev/a7ae9d421848
https://hg.mozilla.org/mozilla-central/rev/a7ae9d421848
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.