RESOLVED FIXED Bug 113777
Actions that require user gesture don't work in window.showModalDialog in Chromium
https://bugs.webkit.org/show_bug.cgi?id=113777
Summary Actions that require user gesture don't work in window.showModalDialog in Chr...
Keishi Hattori
Reported 2013-04-02 06:48:12 PDT
It's because showModalDialog isn't modal in chromium.
Attachments
Patch (3.49 KB, patch)
2013-04-02 07:51 PDT, Keishi Hattori
no flags
Patch (3.88 KB, patch)
2013-04-03 00:14 PDT, Keishi Hattori
no flags
Patch (3.87 KB, patch)
2013-04-03 00:36 PDT, Keishi Hattori
no flags
Patch (4.18 KB, patch)
2013-04-03 05:42 PDT, Keishi Hattori
no flags
jochen
Comment 1 2013-04-02 06:54:45 PDT
Can you give an example?
jochen
Comment 2 2013-04-02 07:07:52 PDT
Saw the example on the crbug entry. Hum hum. The real solution is to actually make the modal dialog modal, and render it in a different process. Until then, I guess we need a hack, maybe something like clearing the token in showModalDialog and resetting it once the nested message loop exits.
Keishi Hattori
Comment 3 2013-04-02 07:51:20 PDT
jochen
Comment 4 2013-04-02 07:56:29 PDT
Comment on attachment 196140 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196140&action=review > Source/WebCore/ChangeLog:13 > + No new tests. Impossible to tell if a file dialog is open in layout test. you could use the eventSender to click somewhere and try to open a new window from the event handler (with testRunner.setCanOpenWindows(), testRunner.setPopupBlockingEnabled(true);). This should return a non-NULL if the user gesture was correctly updated.
Adam Barth
Comment 5 2013-04-02 10:39:40 PDT
Comment on attachment 196140 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196140&action=review > Source/WebCore/page/DOMWindow.cpp:2002 > + UserGestureIndicator* savedIndicator = UserGestureIndicator::topmostIndicator(); > + UserGestureIndicator::forceResetTopmostIndicator(0); If we're going to use this approach, we should have a RAII object to control it.
Keishi Hattori
Comment 6 2013-04-03 00:14:33 PDT
Keishi Hattori
Comment 7 2013-04-03 00:20:23 PDT
(In reply to comment #4) > (From update of attachment 196140 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=196140&action=review > > > Source/WebCore/ChangeLog:13 > > + No new tests. Impossible to tell if a file dialog is open in layout test. > > you could use the eventSender to click somewhere and try to open a new window from the event handler (with testRunner.setCanOpenWindows(), testRunner.setPopupBlockingEnabled(true);). This should return a non-NULL if the user gesture was correctly updated. I tried to write a test but eventSender.mouseDown/eventSender.keyDown don't seem to run inside a showModalDialog window.
WebKit Review Bot
Comment 8 2013-04-03 00:33:34 PDT
Attachment 196291 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/dom/UserGestureIndicator.cpp', u'Source/WebCore/dom/UserGestureIndicator.h', u'Source/WebCore/page/DOMWindow.cpp']" exit_code: 1 Source/WebCore/dom/UserGestureIndicator.cpp:136: Use 0 instead of NULL. [readability/null] [5] Total errors found: 1 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Keishi Hattori
Comment 9 2013-04-03 00:36:31 PDT
jochen
Comment 10 2013-04-03 01:17:18 PDT
Comment on attachment 196291 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196291&action=review > Source/WebCore/dom/UserGestureIndicator.h:50 > +class UserGestureIndicatorDisabler { Please make this class non-copyable > Source/WebCore/dom/UserGestureIndicator.h:56 > + UserGestureIndicator* m_savedIndicator; We should also store the s_state
jochen
Comment 11 2013-04-03 02:03:18 PDT
(In reply to comment #7) > (In reply to comment #4) > > (From update of attachment 196140 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=196140&action=review > > > > > Source/WebCore/ChangeLog:13 > > > + No new tests. Impossible to tell if a file dialog is open in layout test. > > > > you could use the eventSender to click somewhere and try to open a new window from the event handler (with testRunner.setCanOpenWindows(), testRunner.setPopupBlockingEnabled(true);). This should return a non-NULL if the user gesture was correctly updated. > > I tried to write a test but eventSender.mouseDown/eventSender.keyDown don't seem to run inside a showModalDialog window. ah yes, the eventSender always sends the events to the main window :-/
Keishi Hattori
Comment 12 2013-04-03 05:42:15 PDT
jochen
Comment 13 2013-04-03 07:00:53 PDT
Comment on attachment 196335 [details] Patch r=me
WebKit Review Bot
Comment 14 2013-04-03 08:02:54 PDT
Comment on attachment 196335 [details] Patch Clearing flags on attachment: 196335 Committed r147554: <http://trac.webkit.org/changeset/147554>
WebKit Review Bot
Comment 15 2013-04-03 08:02:58 PDT
All reviewed patches have been landed. Closing bug.
Alexey L. Lakutin
Comment 16 2013-04-03 21:59:44 PDT
Thanks, all! Are there any workarounds for this issue? This feature is very important for our customers.
Note You need to log in before you can comment on or make changes to this bug.