Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Issue 235039: Fix conflicts between accelerator keys and HTML DOM accesskeys.... (Closed)

Created:
11 years, 2 months ago by James Su
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, ben+cc_chromium.org, John Grabowski, Erik does not do reviews, jam, pam+watch_chromium.org, Paweł Hajdan Jr., darin (slow to review), brettw, tim (not reviewing), arv (Not doing code reviews)
Visibility:
Public.

Description

Fix conflicts between accelerator keys and HTML DOM accesskeys. This CL fixes conflicts between accelerator keys and HTML DOM accesskeys by suppressing Char events if corresponding RawKeyDown event was handled by the browser after returning from the renderer unhandled. This CL not only fixes this conflict issue, but also makes the behavior of handling accelerator keys similar than IE, which also suppresses a key press event if the key down event was handled as an accelerator key. BUG=21624 accesskey attributes conflict with browser shortcuts (like tab-switching) TEST=Open http://djmitche.github.com/buildbot/docs/0.7.11/ in one of opened multiple tabs, switch to another tab by pressing an alt-# key binding, then switch back to the original page to see if it's just as you left it before switching tabs.

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+553 lines, -74 lines) Patch
M chrome/browser/chromeos/main_menu.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/cocoa/chrome_event_processing_window.h View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/cocoa/chrome_event_processing_window.mm View 1 chunk +9 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_host.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/gtk/browser_window_gtk.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/gtk/browser_window_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -2 lines 2 comments Download
M chrome/browser/renderer_host/render_view_host.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +43 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +154 lines, -7 lines 6 comments Download
M chrome/browser/renderer_host/render_widget_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +286 lines, -18 lines 0 comments Download
M chrome/browser/tab_contents/interstitial_page.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents_view_gtk.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/tab_contents_view_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents_view_mac.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/tab_contents_view_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +12 lines, -11 lines 0 comments Download
M chrome/browser/views/tab_contents/tab_contents_view_gtk.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/views/tab_contents/tab_contents_view_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/views/tab_contents/tab_contents_view_win.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/views/tab_contents/tab_contents_view_win.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +13 lines, -8 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
James Su
Hi all, I think this CL is in good shape for review. Though it lacks ...
11 years, 2 months ago (2009-09-30 15:46:20 UTC) #1
jam
Not sure what's the status of this patch/bug? Just wanted to point out that after ...
11 years, 2 months ago (2009-10-06 21:51:48 UTC) #2
James Su
I'm still waiting for your feedback of this CL. These days (Oct. 1-8) are our ...
11 years, 2 months ago (2009-10-07 04:17:31 UTC) #3
Evan Stade
ping Darin (?)
11 years, 2 months ago (2009-10-09 22:59:41 UTC) #4
Evan Martin
I think John is the right reviewer for this, since he did work on browser ...
11 years, 2 months ago (2009-10-16 00:58:26 UTC) #5
jam
Sorry for the delay, I thought more qualified reviewers would respond first. I have done ...
11 years, 2 months ago (2009-10-16 06:49:28 UTC) #6
James Su
I added hbono and avi to reviewers, hope they can help. Regards James Su On ...
11 years, 2 months ago (2009-10-16 09:53:06 UTC) #7
James Su
And the test code for this CL: http://codereview.chromium.org/268035/show
11 years, 2 months ago (2009-10-16 09:54:04 UTC) #8
James Su
Can anybody help review this CL? It's already pending for quite a long time. Thanks ...
11 years, 2 months ago (2009-10-20 10:16:59 UTC) #9
Evan Martin
Another try on finding a reviewer: erg. Though this looks like it touches a ton ...
11 years, 2 months ago (2009-10-20 17:12:32 UTC) #10
Elliot Glaysher
I want to NACK this patch. It's really complicated, and it's not obvious that it ...
11 years, 2 months ago (2009-10-20 18:37:38 UTC) #11
James Su
Thanks for your valuable feedback. On 2009/10/20 18:37:38, Elliot Glaysher wrote: > I want to ...
11 years, 2 months ago (2009-10-21 02:12:41 UTC) #12
James Su
Hi, Unit tests have been added, please help review. Regards James Su
11 years, 2 months ago (2009-10-21 14:41:24 UTC) #13
jam
What are the effects of this TODO in the Windows code? i.e. will it result ...
11 years, 2 months ago (2009-10-21 15:36:46 UTC) #14
Elliot Glaysher
Thanks for the unit tests. They're really comprehensive! On 2009/10/21 15:36:46, John Abd-El-Malek wrote: > ...
11 years, 2 months ago (2009-10-21 17:37:46 UTC) #15
James Su
I just updated this CL to implement the Mac part. For Windows, according to: http://msdn.microsoft.com/en-us/library/ms646267(VS.85).aspx ...
11 years, 2 months ago (2009-10-22 10:38:19 UTC) #16
Elliot Glaysher
I still don't like how complex this patch is, but I can't think of anything ...
11 years, 2 months ago (2009-10-23 00:53:14 UTC) #17
Nico
James, thanks so much for taking this on! Writing this was on my list, so ...
11 years, 2 months ago (2009-10-24 02:31:10 UTC) #18
James Su
Hi, For the emacs like keyboard sequences, if you want to input a ctrl character, ...
11 years, 2 months ago (2009-10-24 10:53:47 UTC) #19
darin (slow to review)
Is there no other way to solve this bug without queuing key events in the ...
11 years, 1 month ago (2009-11-24 07:47:35 UTC) #20
darin (slow to review)
http://codereview.chromium.org/235039/diff/26023/26044 File chrome/browser/renderer_host/render_widget_host.cc (right): http://codereview.chromium.org/235039/diff/26023/26044#newcode451 chrome/browser/renderer_host/render_widget_host.cc:451: if (suppress_next_char_events_) { couldn't we implement this discarding of ...
11 years, 1 month ago (2009-11-24 07:51:45 UTC) #21
James Su
11 years, 1 month ago (2009-11-24 09:10:55 UTC) #22
Thanks for your feedback. Please see my comments below.

- James Su

http://codereview.chromium.org/235039/diff/26023/26044
File chrome/browser/renderer_host/render_widget_host.cc (right):

http://codereview.chromium.org/235039/diff/26023/26044#newcode89
chrome/browser/renderer_host/render_widget_host.cc:89: if (death_flag_)
On 2009/11/24 07:47:36, darin wrote:
> this seems like a very ugly hack for the fact that we don't have the lifetime
> management worked out properly.

I don't like it either, but I don't know how to fix the lifetime management.
IMHO, this approach is simple enough to live with for now.

http://codereview.chromium.org/235039/diff/26023/26044#newcode410
chrome/browser/renderer_host/render_widget_host.cc:410: // There are to
different situations for us to handle key events:
On 2009/11/24 07:47:36, darin wrote:
> nit: "There are two..."

This is fixed in CL 400012.

http://codereview.chromium.org/235039/diff/26023/26044#newcode451
chrome/browser/renderer_host/render_widget_host.cc:451: if
(suppress_next_char_events_) {
On 2009/11/24 07:51:45, darin wrote:
> couldn't we implement this discarding of events in the renderer?  if the
> renderer decides not to handle a RawKeyDown, then it could queue incoming
input
> events until it receives acknowledgement from the browser that the RawKeyDown
> was consumed as an accelerator.
> 
> that way we only queue events if the renderer decides not to handle the event.
> 
> in other words, the case of typing into an edit field remains unchanged.  the
> renderer would continue consuming input events as fast as it can.

Good suggestion. I'll look into this approach to see if it's feasible. The two
issues I can see for now are:
1. We need send at least one extra message for each RawKeyDown event.
2. We still can't solve http://crbug.com/27932 without adding things similar
than CL 435002. Because no matter where we queue the events, the renderer can't
process the events in batch without waiting for the ack messages.

So I think no matter we implement this logic in the host or the renderer, the
complexity should have no big difference.

Powered by Google App Engine
This is Rietveld 408576698