[Webkit-unassigned] [Bug 77484] New: Safari/WebKit is a bit aggressive when it comes to closing popups.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 31 15:14:43 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=77484

           Summary: Safari/WebKit is a bit aggressive when it comes to
                    closing popups.
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.7
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ruairi at thecomb.net


Created an attachment (id=124832)
 --> (https://bugs.webkit.org/attachment.cgi?id=124832&action=review)
Contains test case.

Safari on Mac OS X seems to be a bit aggressive when told to close browser windows in javascript. I'm not exactly sure whether this is a bug or a feature. 

The case is the following:

I open a doc in Safari, this document opens a popup. From the popup a click on a button calls a function that calls window.close() and after that calls a few other methods among them alert(). The function is as following:

    function test () {
      self.close();
      alert("It's a long way to Tipperary.");
      window.opener.document.getElementById("test-results").innerHTML += "<br/>At least we're not in Kansas anymore.";
      return false;
    }

Expected behaviour (the behaviour in Safari iOS, Firefox, Opera, and IE. Chrome bombs out) :

- The popup shows an alert "It's a long way to Tipperary." which has to be dismissed by the user for the rest of the script to execute.
- "At least we're not in Kansas anymore." should be added to the #test-results <div> in the window that opened the popup
- The popup should close

Real behaviour:

- The popup closes
- "At least we're not in Kansas anymore." is added to the #test-results <div> in the window that opened the popup


I know this seems kinda silly, but we've got a framework where the basic flow is the following:

- someone clicks a submit button
- a function is called in the following manner

    function (funcName, evSrc, evArg, validate, target) {
      var retValue = true;
      try {
        retValue = window[funcName](evSrc, evArg, validate);
      }
      catch (e) {
      }
      if (retValue != false) {
        return _bcfui.pb(evSrc, evArg, validate, target);
      }
      return false;
    }

the function `funcName` may or may not call window.close(). after that a form (the framework is based on the postback model) is submitted via form.submit() and the window closes. Safari on Mac OS X closes the window as soon as the try block has executed, the other browsers do not close the window until the form was submitted.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list