Bug 18677

Summary: Synchronous event dispatch confuses the popup blocker into incorrectly blocking chat popups @ gmail.com
Product: WebKit Reporter: Geoffrey Garen <ggaren>
Component: WebCore Misc.Assignee: Mark Rowe (bdash) <mrowe>
Status: RESOLVED FIXED    
Severity: Normal CC: ggaren, mrowe
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
A patch of a layout test
ggaren: review+
Patch of kjs_events.cpp ggaren: review+

Geoffrey Garen
Reported 2008-04-22 11:31:34 PDT
Feng Qian on the GMail team provided this diagnosis. WORKS (popout escapes blocker): Click on 'New window' in conversation view Shift-C keyboard shortcut Shift-R keyboard shortcut DOES NOT WORK (grrrrr): Shift-click on 'compose mail' Shift-click on thread in threadlist view Pop out chat Looks like the issue is nested event handling. If a event handler triggers another event handler synchronizely, window.event is gone after exiting the nested event handler. The code causing trouble is in handleEvent function of kjs_events.cpp. windowWrapper->window()->setCurrentEvent(event); .... windowWrapper->window()->setCurrentEvent(0); If we save the old event and resotre it after calling the function, it should work. e.g., Event* saved_evt = windowWrapper->window()->currentEvent(); windowWrapper->window()->setCurrentEvent(event); .... windowWrapper->window()->setCurrentEvent(saved_evt);
Attachments
A patch of a layout test (1.92 KB, patch)
2008-04-22 11:59 PDT, Feng Qian
ggaren: review+
Patch of kjs_events.cpp (1.43 KB, patch)
2008-04-22 12:00 PDT, Feng Qian
ggaren: review+
Geoffrey Garen
Comment 1 2008-04-22 11:32:17 PDT
Feng Qian
Comment 2 2008-04-22 11:59:48 PDT
Created attachment 20751 [details] A patch of a layout test
Feng Qian
Comment 3 2008-04-22 12:00:49 PDT
Created attachment 20752 [details] Patch of kjs_events.cpp
Geoffrey Garen
Comment 4 2008-04-23 07:51:50 PDT
Comment on attachment 20751 [details] A patch of a layout test +if (window.layoutTestController) { + layoutTestController.dumpAsText(); +} According to our style guidelines, this one-line if body should not include braces.
Geoffrey Garen
Comment 5 2008-04-23 07:52:38 PDT
Comment on attachment 20752 [details] Patch of kjs_events.cpp + Event* saved_event = windowWrapper->window()->currentEvent(); According to our style guidelines, variable names should use camelCase, so "saved_event" should be named "savedEvent".
Geoffrey Garen
Comment 6 2008-04-23 07:52:58 PDT
Thanks for fixing this!
Feng Qian
Comment 7 2008-04-23 09:05:46 PDT
ggaren, thanks for you review. You can take the patch and make changes as you suggested and land the patch. I don't have SVN checkin right.
Mark Rowe (bdash)
Comment 8 2008-04-24 17:13:38 PDT
I'm making the requested changes and will land this shortly.
Mark Rowe (bdash)
Comment 9 2008-04-24 17:50:13 PDT
Landed in r32525.
Note You need to log in before you can comment on or make changes to this bug.