Closed Bug 1202918 Opened 9 years ago Closed 6 years ago

calling window.open synchronously triggers timeouts

Categories

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

40 Branch
x86_64
macOS
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: calvin.metcalf, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36

Steps to reproduce:

opening a window causes timeouts to fire synchronously

the following script (gist: https://gist.github.com/calvinmetcalf/f29eae737d52ae8fd54a) when executed on a page that allows popups and doesn't have the window open (from a previous try):

```
var called = false;
setTimeout(function (){
  console.log('should be true', called);
});
console.log('opening');

window.open('http://example.com/some/url', 'title', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=100, height=200, top=20, left=20');

console.log('opened');
called = true;
```



Actual results:

the timeout is called synchronously when window.open is called leading to the messages


prints to console 

    opening

    should be true false

    opened

being printed


Expected results:

the timeout should be called asynchronously after the code that changes the variable and print:

    opening

    opened

    should be true true
Attached file 1202918.html
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86_64
Yeah, window.open spins the event loop when it has to bring up an actual toplevel window.  We should probably suppress events on the caller for the duration or something.
Flags: needinfo?(bugs)
Priority: -- → P5

2019-03-06

This bug is part of a group of bugs which have had an open needinfo for at least 12 weeks.

The request for information has not been answered, and we can't move forward on the bug so we are closing it.

If the defect is still present, please reopen this bug with an updated report.

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INCOMPLETE

This was fixed at some point

Flags: needinfo?(bugs)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: