[Webkit-unassigned] [Bug 28716] Event listeners installed on a window object returned from window.open() don't work

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 3 19:49:55 PDT 2009


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


Dmitry Titov <dimich at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #39033|                            |review?
               Flag|                            |




--- Comment #5 from Dmitry Titov <dimich at chromium.org>  2009-09-03 19:49:54 PDT ---
Created an attachment (id=39033)
 --> (https://bugs.webkit.org/attachment.cgi?id=39033)
Proposed patch

The proposed fix makes WebKit behavior match both html5 spec and FF 3.5. Also
adds tests.

Now we don't remove event listeners on DOMWindow in case of transitioning from
empty temporary document (created by FrameLoader::init()) to final document.
This is accomplished by the check in FrameLoader::stopLoading that checks for
the safe transiotion (similar to the one in FrameLoader::begin(..) that
prevents erasing window properties).

Another place that was removing all the event handlers was Document::clear(),
invoked from Document::implicitOpen() which is called in 2 cases: when
transition document is replaced with loaded content (case of this bug) and when
document.open() is used from JS. In latter case we actually need to clean event
handlers - if only to avoid firing 'load' upon subsequent document.close(), or
things will fail on the web. So I've split clear() and moved clearing handlers
code to Document::open(..) and the rest to implicitOpen() and removed the
Document::clear() at all.

Also FrameLoader::closeURL() was called 2 times during regular navigation -
from transitionToCommitted and then immediately after it returns to
commitProvisionalLoad via didOpenURL. The problem with that is closeURL calls
stopLoading and that tries to fire unload again - so the old code, by blowing
all the event handlers,  was making unload fire once, so it was ok to call it
twice. Now that we don't always blow the event handlers, that would cause 2
unload events fired - so I move it out of didOpenURL.

-- 
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