Commit 1be36d4d authored by mrowe@apple.com's avatar mrowe@apple.com

2008-04-22 Feng Qian <ian.eng.webkit@gmail.com>

        Reviewed by Geoff Garen.

        Fix https://bugs.webkit.org/show_bug.cgi?id=18677
        Bug 18677: Synchronous event dispatch confuses the popup blocker into incorrectly blocking chat popups in gmail.com.

        Test: fast/events/nested-window-event.html

        * bindings/js/kjs_events.cpp:
        (WebCore::JSAbstractEventListener::handleEvent): Save and restore the current event around the event dispatch.

2008-04-22  Feng Qian  <ian.eng.webkit@gmail.com>

        Reviewed by Geoff Garen.

        Test for nested event handlers.

        * fast/events/nested-window-event-expected.txt: Added.
        * fast/events/nested-window-event.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32525 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ab528fba
2008-04-22 Feng Qian <ian.eng.webkit@gmail.com>
Reviewed by Geoff Garen.
Test for nested event handlers.
* fast/events/nested-window-event-expected.txt: Added.
* fast/events/nested-window-event.html: Added.
2008-04-24 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler.
This tests window.event was kept the same when nested event handling was called. You should see 'PASS' if the test passes.
PASS
<html>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
function run_test() {
var oldEvent = window.event;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {}
xhr.open("GET", "test.html");
xhr.send();
// window.event should exist, and same as oldEvent.
document.getElementById('console').innerHTML = oldEvent == window.event ? 'PASS' : 'FAIL';
}
</script>
<body onload="run_test()">
This tests window.event was kept the same when nested event
handling was called. You should see 'PASS' if the test passes.
<br>
<div id='console'></div>
</body>
</html>
2008-04-22 Feng Qian <ian.eng.webkit@gmail.com>
Reviewed by Geoff Garen.
Fix https://bugs.webkit.org/show_bug.cgi?id=18677
Bug 18677: Synchronous event dispatch confuses the popup blocker into incorrectly blocking chat popups in gmail.com.
Test: fast/events/nested-window-event.html
* bindings/js/kjs_events.cpp:
(WebCore::JSAbstractEventListener::handleEvent): Save and restore the current event around the event dispatch.
2008-04-24 Brady Eidson <beidson@apple.com>
Reviewed by Teh Mitzpettel
......@@ -83,6 +83,7 @@ void JSAbstractEventListener::handleEvent(Event* ele, bool isWindowEvent)
List args;
args.append(toJS(exec, event));
Event* savedEvent = windowWrapper->window()->currentEvent();
windowWrapper->window()->setCurrentEvent(event);
JSValue* retval;
......@@ -100,7 +101,7 @@ void JSAbstractEventListener::handleEvent(Event* ele, bool isWindowEvent)
}
windowWrapper->window()->stopTimeoutCheck();
windowWrapper->window()->setCurrentEvent(0);
windowWrapper->window()->setCurrentEvent(savedEvent);
if (exec->hadException()) {
JSObject* exception = exec->exception()->toObject(exec);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment