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

Issue 2608293002: [reland, refactor] - Move textInputInfo() and textInputType() from WebWidget to WebInputMethodContr… (Closed)

Created:
3 years, 11 months ago by EhsanK
Modified:
3 years, 11 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, dcheng, dglazkov+blink, jam, kinuko+watch, mlamouri+watch-blink_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[reland, refactor] - Move textInputInfo() and textInputType() from WebWidget to WebInputMethodController This CL tries to reland the original CL https://codereview.chromium.org/2508363003 which was reverted since it was making WebViewInteractiveTest.Focus_FocusRestored flake. The issue in the initial attempt was that WebFrameWidget::getActiveInputMethodController() would return nullptr when the WebFrameWidget did not have page focus (m_imeAcceptEvents == false). This assumption is not correct and resulted into reporting ui::TEXT_INPUT_TYPE_NONE for TextInputState right after losing page focus, e.g., by moving focus from a <webview> to its embedder (in the reverted CL). On the other hand, when WebFrameWidget does not have page focus, any IME calls received from browser should be dropped. Specifically, by not doing so, a call to WebInputMethodController::finishComposingText would lead to a second commit for the last ongoing composition. This happens when switching tabs or moving focus to another WebFrameWidget in OOPIFs. Returning nullptr for active controller was used as the solution to this problem in the original CL that landed WebInputMethodController (https://codereview.chromium.org/2333813002/). This is however incorrect since an unfocused WebFrameWidget could still have IME state such as TextInputState. The new attempt will reland the reverted CL and fix the issues by: 1- Returning WebInputMethodController iff there is a focused local frame inside WebFrameWidget. Page focus will not affect this value. 2- Will not process IME events if RenderWidget::has_focus_ is false. This is achieved by adding a new method ShouldHandleImeEvents() which will return false when there is no WebFrameWidget or page focus. This CL also adds a RenderWidgetTest to prevent future regressions of this kind. BUG=629721 Review-Url: https://codereview.chromium.org/2608293002 Cr-Commit-Position: refs/heads/master@{#441788} Committed: https://chromium.googlesource.com/chromium/src/+/5aff1941d0f7a2a68e07fd000592de295944fcea

Patch Set 1 : Original #

Patch Set 2 : Rebased #

Patch Set 3 : Applied the fix. #

Total comments: 8

Patch Set 4 : Addressing wjmaclean@'s comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+251 lines, -166 lines) Patch
M content/renderer/render_frame_impl.cc View 1 3 chunks +5 lines, -2 lines 0 comments Download
M content/renderer/render_view_browsertest.cc View 1 4 chunks +16 lines, -9 lines 0 comments Download
M content/renderer/render_widget.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 8 chunks +22 lines, -6 lines 0 comments Download
M content/renderer/render_widget_browsertest.cc View 1 2 3 3 chunks +62 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebFrameWidgetImpl.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp View 1 2 3 chunks +2 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/web/WebInputMethodControllerImpl.h View 1 chunk +2 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/web/WebInputMethodControllerImpl.cpp View 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.h View 1 3 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebViewFrameWidget.h View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewFrameWidget.cpp View 1 chunk +0 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.h View 1 2 3 3 chunks +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 2 chunks +1 line, -16 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebViewTest.cpp View 1 57 chunks +99 lines, -76 lines 0 comments Download
M third_party/WebKit/public/web/WebFrameWidget.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/public/web/WebInputMethodController.h View 2 chunks +13 lines, -2 lines 0 comments Download
M third_party/WebKit/public/web/WebLocalFrame.h View 1 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebView.h View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/public/web/WebWidget.h View 1 chunk +0 lines, -9 lines 0 comments Download

Messages

Total messages: 22 (13 generated)
EhsanK
Dimitri, Charlie, could you please take a look (as the the owner reviewers of the ...
3 years, 11 months ago (2017-01-04 20:26:53 UTC) #6
Charlie Reis
Sorry, I'm not knowledgeable enough about input events to offer a useful review on the ...
3 years, 11 months ago (2017-01-05 01:01:56 UTC) #10
dglazkov
lgtm
3 years, 11 months ago (2017-01-05 16:27:50 UTC) #11
wjmaclean
lgtm, with comments https://codereview.chromium.org/2608293002/diff/60001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/2608293002/diff/60001/content/renderer/render_widget.cc#newcode2127 content/renderer/render_widget.cc:2127: blink::WebInputMethodController* controller = GetInputMethodController(); Why do ...
3 years, 11 months ago (2017-01-05 21:24:57 UTC) #12
EhsanK
Thank you all for the review! PTAL. https://codereview.chromium.org/2608293002/diff/60001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/2608293002/diff/60001/content/renderer/render_widget.cc#newcode2127 content/renderer/render_widget.cc:2127: blink::WebInputMethodController* controller ...
3 years, 11 months ago (2017-01-05 21:46:43 UTC) #14
Charlie Reis
Thanks for taking a look, James. RS LGTM for content/. https://codereview.chromium.org/2608293002/diff/60001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/2608293002/diff/60001/content/renderer/render_widget.cc#newcode2127 ...
3 years, 11 months ago (2017-01-05 22:25:03 UTC) #15
EhsanK
Thanks everyone for the reviews! I will try to CQ and hopefully this CL will ...
3 years, 11 months ago (2017-01-05 23:20:13 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2608293002/80001
3 years, 11 months ago (2017-01-05 23:21:25 UTC) #19
commit-bot: I haz the power
3 years, 11 months ago (2017-01-06 01:27:19 UTC) #22
Message was sent while issue was closed.
Committed patchset #4 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/5aff1941d0f7a2a68e07fd000592...

Powered by Google App Engine
This is Rietveld 408576698