RESOLVED FIXED Bug 45071
Only intercept ESC key press when autocorrection UI is visible.
https://bugs.webkit.org/show_bug.cgi?id=45071
Summary Only intercept ESC key press when autocorrection UI is visible.
Jia Pu
Reported 2010-09-01 16:58:35 PDT
This is related to autocorrection UI implemented in bug 44958, and <rdar://problem/8378285>. Currently we dismiss autocorrection panel and return true whenever executeCancelOperation() is called. However, the regular functionality of ESC key is to stop loading. We should return false in executeCancelOperation() when correction panel isn't visible. By doing so, we allow the ESC key event to be handled by the upstream of responder chain.
Attachments
Proposed patch (v1) (10.66 KB, patch)
2010-09-03 15:07 PDT, Jia Pu
no flags
proposed patch (v2) (10.77 KB, patch)
2010-09-13 11:32 PDT, Jia Pu
mitz: review-
Proposed patch (v3) (10.74 KB, patch)
2010-09-13 11:51 PDT, Jia Pu
mitz: review+
Proposed patch (v4) (11.68 KB, patch)
2010-09-14 14:39 PDT, Jia Pu
mitz: review-
Proposed patch (v5) (11.72 KB, patch)
2010-09-14 17:39 PDT, Jia Pu
mitz: review+
mitz: commit-queue+
Proposed patch (v6) (11.80 KB, patch)
2010-09-14 19:59 PDT, Jia Pu
no flags
Jia Pu
Comment 1 2010-09-03 15:07:59 PDT
Created attachment 66555 [details] Proposed patch (v1) Provided supportedDismissCorrectionUI() as the isSupported() function for the executeCancelOperation() command. This function returns true only when the autocorrection UI is shown.
Jia Pu
Comment 2 2010-09-03 15:47:24 PDT
mitz
Comment 3 2010-09-09 10:09:09 PDT
Comment on attachment 66555 [details] Proposed patch (v1) View in context: https://bugs.webkit.org/attachment.cgi?id=66555&action=prettypatch > WebCore/editing/Editor.cpp:2822 > +bool Editor::isCorrectionUIShown() Is there a reason for calling it “correction UI” here when everywhere else it’s “correction panel”? I would name this (and the client method) isShowingCorrectionPanel(), so that editor->isShowingCorrectionPanel() reads like a sentence with editor being the subject. > WebCore/editing/EditorCommand.cpp:1125 > +static bool supportedDismissCorrectionUI(Frame* frame, EditorCommandSource) > +{ > + return frame->editor()->isCorrectionUIShown(); > +} Perhaps in addition to checking this we should still limit to menu and key binding? I don’t think we want to expose this through the execCommand DOM interface, for example.
Jia Pu
Comment 4 2010-09-09 19:19:04 PDT
(In reply to comment #3) > (From update of attachment 66555 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=66555&action=prettypatch > > > WebCore/editing/Editor.cpp:2822 > > +bool Editor::isCorrectionUIShown() > Is there a reason for calling it “correction UI” here when everywhere else it’s “correction panel”? I would name this (and the client method) isShowingCorrectionPanel(), so that editor->isShowingCorrectionPanel() reads like a sentence with editor being the subject. > Actually I wonder if we should change all occurrence of "correction panel" to "correction UI", since the term "panel" really originated from AppKit. It may not be considered appropriate on other platforms. > > WebCore/editing/EditorCommand.cpp:1125 > > +static bool supportedDismissCorrectionUI(Frame* frame, EditorCommandSource) > > +{ > > + return frame->editor()->isCorrectionUIShown(); > > +} > Perhaps in addition to checking this we should still limit to menu and key binding? I don’t think we want to expose this through the execCommand DOM interface, for example. Ok, I will change this.
Jia Pu
Comment 5 2010-09-13 11:32:38 PDT
Created attachment 67441 [details] proposed patch (v2) updated according to comment #3.
mitz
Comment 6 2010-09-13 11:38:05 PDT
Comment on attachment 67441 [details] proposed patch (v2) View in context: https://bugs.webkit.org/attachment.cgi?id=67441&action=prettypatch > WebCore/editing/EditorCommand.cpp:1130 > +static bool supportedDismissCorrectionPanel(Frame* frame, EditorCommandSource source) > +{ > + if (supportedFromMenuOrKeyBinding(frame, source)) > + return frame->editor()->isShowingCorrectionPanel(); > + return false; > +} Personally, I would write this as return supportedFromMenuOrKeyBinding(frame, source) && frame->editor()->isShowingCorrectionPanel(); > WebKit/mac/WebCoreSupport/WebEditorClient.mm:842 > +bool WebEditorClient::isShowingCorrectionPanel() { > + return m_correctionPanelTag != InvalidCorrectionPanelTag; > +} The opening brace should go on its own line. r- so you can fix that style issue and consider the other comment.
Jia Pu
Comment 7 2010-09-13 11:51:51 PDT
Created attachment 67445 [details] Proposed patch (v3) updated according to comment #6.
mitz
Comment 8 2010-09-14 00:46:16 PDT
Comment on attachment 67445 [details] Proposed patch (v3) I didn’t notice the missing reviewer line. This means that the commit-queue script can’t process this patch.
mitz
Comment 9 2010-09-14 00:56:02 PDT
Committed revision 67451.
WebKit Review Bot
Comment 10 2010-09-14 01:01:58 PDT
mitz
Comment 11 2010-09-14 01:03:36 PDT
Build fix in r67452.
Eric Seidel (no email)
Comment 12 2010-09-14 04:02:06 PDT
This appears to ahve broken leopard tests :(
Eric Seidel (no email)
Comment 13 2010-09-14 04:07:42 PDT
Eric Seidel (no email)
Comment 14 2010-09-14 04:08:21 PDT
Rolled out r67451 and r67451 as this change broke a whole bunch of builders and is blocking the commit-queue.
Eric Seidel (no email)
Comment 15 2010-09-14 04:16:05 PDT
As far as I can tell from the buildbots this was the right patch, but it's not immediately obvious from this change or the test why it was failing. The failure was clearly consistant and across multiple platforms. Hopefully it will be easy to spot for you two. My sincerest apologies if my rollout was in error and I'm happy to re-land. But the buildbots seem pretty certain that this change was at fault.
Eric Seidel (no email)
Comment 16 2010-09-14 04:16:16 PDT
The diff: --- /Volumes/Data/WebKit-BuildSlave/snowleopard-intel-release-tests/build/layout-test-results/fast/events/event-input-contentEditable-expected.txt 2010-09-14 03:07:36.000000000 -0700 +++ /Volumes/Data/WebKit-BuildSlave/snowleopard-intel-release-tests/build/layout-test-results/fast/events/event-input-contentEditable-actual.txt 2010-09-14 03:07:36.000000000 -0700 @@ -12,7 +12,7 @@ PASS event.target.id is 'target4' PASS event.target.innerHTML is '<a href="http://www.example.com/">This text should be a link.</a>' PASS event.target.id is 'target6parent' -PASS event.target.innerHTML is '<span id="target6start"><a href="http://www.example.com/">Start,</a></span><span id="target6middle"><a href="http://www.example.com/">Middle,</a></span><span id="target6end"><a href="http://www.example.com/">End.</a></span>' +FAIL event.target.innerHTML should be <span id="target6start"><a href="http://www.example.com/">Start,</a></span><span id="target6middle"><a href="http://www.example.com/">Middle,</a></span><span id="target6end"><a href="http://www.example.com/">End.</a></span>. Was <span id="target6start"><a href="http://www.example.com/">Start,</a></span><a href="http://www.example.com/"><span id="target6middle">Middle,</span><span id="target6end">End.</span></a>. PASS event.target.id is 'target7' PASS event.target.innerHTML is 'X' PASS event.target.id is 'target8'
Csaba Osztrogonác
Comment 17 2010-09-14 05:09:57 PDT
(In reply to comment #14) > Rolled out r67451 and r67451 as this change broke a whole bunch of builders and is blocking the commit-queue. s/r67451 and r67451/r67451 and r67452 ;) Thx for rolling out, these changesets broke fast/events/event-input-contentEditable.html on Qt and on GTK: http://build.webkit.org/results/Qt%20Linux%20Release/r67453%20%2819915%29/fast/events/event-input-contentEditable-pretty-diff.html http://build.webkit.org/results/GTK%20Linux%2032-bit%20Release/r67453
WebKit Review Bot
Comment 18 2010-09-14 06:35:19 PDT
http://trac.webkit.org/changeset/67458 might have broken GTK Linux 32-bit Debug
Jia Pu
Comment 19 2010-09-14 14:39:14 PDT
Created attachment 67607 [details] Proposed patch (v4) Fixed build warning/error on non-mac platforms.
Eric Seidel (no email)
Comment 20 2010-09-14 14:41:16 PDT
bug 45616 is also claiming responsibility for the test break. It's possible I simply read the buildbot wrong last night at 4 am...
mitz
Comment 21 2010-09-14 17:13:14 PDT
Comment on attachment 67607 [details] Proposed patch (v4) r- because this will fail the commit-queue again. Please leave in (or in this case, add back) the line that says Reviewed by NOBODY (OOPS!). Thanks!
Jia Pu
Comment 22 2010-09-14 17:39:18 PDT
Created attachment 67623 [details] Proposed patch (v5) Added back "Reviewed by NOBODY (OOPS!)." line, so that build doesn't fail.
Jia Pu
Comment 23 2010-09-14 19:39:14 PDT
Comment on attachment 67623 [details] Proposed patch (v5) I manually added "Reviewed by NOBODY (OOPS)." line without changing the line range. So the patch is malformed. I will submit another patch.
Jia Pu
Comment 24 2010-09-14 19:59:15 PDT
Created attachment 67637 [details] Proposed patch (v6) Updated all three ChangeLog files with "Reviewed by NOBODY (OOPS!)." line.
WebKit Commit Bot
Comment 25 2010-09-14 21:39:22 PDT
Comment on attachment 67637 [details] Proposed patch (v6) Clearing flags on attachment: 67637 Committed r67534: <http://trac.webkit.org/changeset/67534>
WebKit Commit Bot
Comment 26 2010-09-14 21:39:28 PDT
All reviewed patches have been landed. Closing bug.
WebKit Review Bot
Comment 27 2010-09-15 01:35:00 PDT
http://trac.webkit.org/changeset/67539 might have broken GTK Linux 32-bit Debug
Note You need to log in before you can comment on or make changes to this bug.