New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 629721 link

Starred by 6 users

Issue metadata

Status: Closed
Owner:
Closed: Nov 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature



Sign in to add a comment

De-dupe the common IME code in WebFrameWidgetImpl and WebViewImpl.

Project Member Reported by ekaramad@chromium.org, Jul 20 2016

Issue description

Currently, there is a lot of duplication in IME code between WebFrameWidgetImpl and WebViewImpl. Since the logic, as well as the code, are almost identical, we should remove the duplicate code by either moving parts of it to a base class (WebFrameWidgetBase) or introduce a third helper class to hold the code/logic.

 
Cc: dglazkov@chromium.org
Labels: -Pri-3 Hotlist-Refactoring Pri-2
cc-ing dglazkov@ for the recent issue on code duplication (See https://codereview.chromium.org/2301173005/). Also, raising the priority of this bug. I will get started on the refactor asap.
One thing that might be useful is maybe introducing WebInputMethodController abstraction, a wrapper around InputMethodController?
I was thinking about adding something to the public interface. I think for the most part there will be on implementation of the class which can be owned by both WebFrameWidgetImpl and WebViewImpl.
Project Member

Comment 4 by bugdroid1@chromium.org, Sep 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ad901b8d9ac484364a22be270bfe1cd6ab317b47

commit ad901b8d9ac484364a22be270bfe1cd6ab317b47
Author: ekaramad <ekaramad@chromium.org>
Date: Fri Sep 09 19:36:49 2016

[refactor] - Remove unused WebTextInputType from WebViewImpl.

WebViewImpl also implements WebWidget::textInputType() and, unfortunately,
until it is fully separated from WebWidget, IME related methods should be
duplicated.

BUG= 629721 

Review-Url: https://codereview.chromium.org/2301173005
Cr-Commit-Position: refs/heads/master@{#417671}

[modify] https://crrev.com/ad901b8d9ac484364a22be270bfe1cd6ab317b47/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/ad901b8d9ac484364a22be270bfe1cd6ab317b47/third_party/WebKit/Source/web/WebViewImpl.cpp

Cc: dtapu...@chromium.org
has any work gone on here? I am looking to add another member related to this duplicated code and I'd prefer it was cleaned up before adding it :-)

Can the WebWidget return some type of WebInputMethodController as dglazkov@ recommends? And we can move the methods to that. And then the two classes can instantiate that object and return it.

There is an ongoing CL here:
https://codereview.chromium.org/2333813002/

Which adds a getActiveWebInputMethodController() to WebFrameWidget. This will be the proposed WebInputMethodController per WebLocalFrame.

The CL is under review and I need either dglazkov@ or dchecng@ or some other eligible blink reviewer review it :).
The original fix landed but unfortunately I forgot to add the bug number to it. So I am including the CL description here:
Introduce WebInputMethodController to blink

Input method editing is currently handled by WebWidget
which has almost fully duplicate code in both WebFrameWidgetImpl
and WebViewImpl.

The code duplication on one hand, and the reliance of all
IME results on the frame level objects such as
InputMethodController, FrameSelection, etc. on the other
hand gave rise to proposing a refactoring to include most
of such IME code in a separate class owned by a
WebLocalFrameImpl.

The WebInputMethodController is intended to become a
wrapper class around the blink::InputMethodController (and
more) to expose the required APIs for WebKit embedders
using IME and text input. It will implement the logic in
text and IME related methods in WebWidget and possibly removes
those from WebWidget altogether. This patch, specifically,
implements the following WebWidget methods:
setComposition()
commitText()
finishComposingText()

Design document
(Google.com access): https://docs.google.com/a/google.com/document/d/1okeoZVyUZqc8z7oSIPiu-k6zKI0eLYQ9S9c4lgqpzn8/edit?usp=sharing

(Chromium.org access): https://docs.google.com/document/d/13Nidlg5yIsxQRqXgBPqmb-KcT8q85Z1ds9Z1-Vo1XQQ/edit?usp=sharing

Committed: https://crrev.com/2daaf676340283726a05cb1b387a9ff328e020e8
Cr-Commit-Position: refs/heads/master@{#431340}
Status: Started (was: Assigned)
Project Member

Comment 9 by bugdroid1@chromium.org, Dec 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/59cd849d12cffcc4f31281e758deb18111717796

commit 59cd849d12cffcc4f31281e758deb18111717796
Author: ekaramad <ekaramad@chromium.org>
Date: Wed Dec 21 07:01:24 2016

[refactor] - Move textInputInfo() and textInputType() from WebWidget to WebInputMethodController

In line with refactoring the duplicated IME code, the implementation of
WebWidget::textInputInfo() and WebWidget::textInputType() have been
moved to WebINputMethodController. The benefits of this refactor are:

 1- This is compliant by the fact that the actual logic lives in
 InputMethodController class. Therefore, it makes sense to have the
 calles use the public wrapper instead of WebWidget.

 2- This helps with the separation of WebView and WebWidget as the
 refactored methods are removed from both.

This CL follows up on the original refactoring CL which landed
WebInputMethodController (https://codereview.chromium.org/2333813002/).

Doc:
https://docs.google.com/document/d/13Nidlg5yIsxQRqXgBPqmb-KcT8q85Z1ds9Z1-Vo1XQQ/edit?usp=sharing

BUG= 629721 

Review-Url: https://codereview.chromium.org/2508363003
Cr-Commit-Position: refs/heads/master@{#440046}

[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/content/renderer/render_view_browsertest.cc
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/content/renderer/render_view_impl.cc
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/content/renderer/render_widget.cc
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/Source/web/WebFrameWidgetImpl.h
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/Source/web/WebInputMethodControllerImpl.cpp
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/Source/web/WebInputMethodControllerImpl.h
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/Source/web/WebLocalFrameImpl.h
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/Source/web/WebViewFrameWidget.cpp
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/Source/web/WebViewFrameWidget.h
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/Source/web/WebViewImpl.cpp
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/Source/web/WebViewImpl.h
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/Source/web/tests/WebViewTest.cpp
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/public/web/WebInputMethodController.h
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/public/web/WebLocalFrame.h
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/public/web/WebView.h
[modify] https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796/third_party/WebKit/public/web/WebWidget.h

Project Member

Comment 10 by bugdroid1@chromium.org, Dec 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d2d9be2c99afab15fbd262945400cc1d9c5945c9

commit d2d9be2c99afab15fbd262945400cc1d9c5945c9
Author: shimazu <shimazu@chromium.org>
Date: Wed Dec 21 08:39:52 2016

Revert of [refactor] - Move textInputInfo() and textInputType() from WebWidget to WebInputMethodController (patchset #10 id:180001 of https://codereview.chromium.org/2508363003/ )

Reason for revert:
WebViewFocusInteractiveTest.Focus_FocusRestored got flaky:
https://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20%281%29/builds/61498

Original issue's description:
> [refactor] - Move textInputInfo() and textInputType() from WebWidget to WebInputMethodController
>
> In line with refactoring the duplicated IME code, the implementation of
> WebWidget::textInputInfo() and WebWidget::textInputType() have been
> moved to WebINputMethodController. The benefits of this refactor are:
>
>  1- This is compliant by the fact that the actual logic lives in
>  InputMethodController class. Therefore, it makes sense to have the
>  calles use the public wrapper instead of WebWidget.
>
>  2- This helps with the separation of WebView and WebWidget as the
>  refactored methods are removed from both.
>
> This CL follows up on the original refactoring CL which landed
> WebInputMethodController (https://codereview.chromium.org/2333813002/).
>
> Doc:
> https://docs.google.com/document/d/13Nidlg5yIsxQRqXgBPqmb-KcT8q85Z1ds9Z1-Vo1XQQ/edit?usp=sharing
>
> BUG= 629721 
>
> Committed: https://crrev.com/59cd849d12cffcc4f31281e758deb18111717796
> Cr-Commit-Position: refs/heads/master@{#440046}

TBR=dcheng@chromium.org,dglazkov@chromium.org,dtapuska@chromium.org,lfg@chromium.org,creis@chromium.org,ekaramad@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 629721 

Review-Url: https://codereview.chromium.org/2592953003
Cr-Commit-Position: refs/heads/master@{#440054}

[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/content/renderer/render_view_browsertest.cc
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/content/renderer/render_view_impl.cc
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/content/renderer/render_widget.cc
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/Source/web/WebFrameWidgetImpl.h
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/Source/web/WebInputMethodControllerImpl.cpp
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/Source/web/WebInputMethodControllerImpl.h
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/Source/web/WebLocalFrameImpl.h
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/Source/web/WebViewFrameWidget.cpp
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/Source/web/WebViewFrameWidget.h
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/Source/web/WebViewImpl.cpp
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/Source/web/WebViewImpl.h
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/Source/web/tests/WebViewTest.cpp
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/public/web/WebInputMethodController.h
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/public/web/WebLocalFrame.h
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/public/web/WebView.h
[modify] https://crrev.com/d2d9be2c99afab15fbd262945400cc1d9c5945c9/third_party/WebKit/public/web/WebWidget.h

Project Member

Comment 11 by bugdroid1@chromium.org, Jan 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5aff1941d0f7a2a68e07fd000592de295944fcea

commit 5aff1941d0f7a2a68e07fd000592de295944fcea
Author: ekaramad <ekaramad@chromium.org>
Date: Fri Jan 06 01:26:35 2017

[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}

[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/content/renderer/render_view_browsertest.cc
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/content/renderer/render_widget.cc
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/content/renderer/render_widget.h
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/content/renderer/render_widget_browsertest.cc
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/Source/web/WebFrameWidgetImpl.h
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/Source/web/WebInputMethodControllerImpl.cpp
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/Source/web/WebInputMethodControllerImpl.h
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/Source/web/WebLocalFrameImpl.h
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/Source/web/WebViewFrameWidget.cpp
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/Source/web/WebViewFrameWidget.h
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/Source/web/WebViewImpl.cpp
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/Source/web/WebViewImpl.h
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/Source/web/tests/WebViewTest.cpp
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/public/web/WebFrameWidget.h
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/public/web/WebInputMethodController.h
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/public/web/WebLocalFrame.h
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/public/web/WebView.h
[modify] https://crrev.com/5aff1941d0f7a2a68e07fd000592de295944fcea/third_party/WebKit/public/web/WebWidget.h

Project Member

Comment 12 by bugdroid1@chromium.org, Feb 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0

commit ce32ef9fc7230bbba732162c60cdc90f18fbbbc0
Author: ekaramad <ekaramad@chromium.org>
Date: Thu Feb 09 17:33:56 2017

Remove WebWidget::applyReplacementRange

The method WebWidget::applyReplacementRange was added to accomodate the
support for IME in OOPIFs. Before, the IME logic in content/renderer used to
live in RenderViewImpl which has access to the frame tree on the renderer side.
To accomodate this transition, some methods were added to the blink
public API.

Specifically, applyReplacement range selects a range to be later replaceed by
the next call to set or commit composition. This simple task could be
part of the implementation of those methods to the newly added
WebInputMethodController instead. Moreover, the method does not do
anything special to be used outside the scope of handling the IME
events so it should not be part of the public API.

Specifically, this CL will:
  1- Remove WebWidget::applyReplacementRange which will also remove it
  from WebFrameWidgetImpl, WebViewFrameWidget, WebViewImpl.

  2- Adds a new argument, replacementRange to
  WebInputMethodController::setComposition and
  WebInputMethodController::commitText.

The benefits of this change are:
  1- Removing a layering violation inside applyReplacementRange.
  2- Further deduplicate the IME code inside WebFrameWidgetImpl and
  WebViewImpl.
  2- Help with the separation of WebWidget and WebViewImpl.
  3- Reducing some lines of code.

BUG= 639320 , 629721 

Review-Url: https://codereview.chromium.org/2674253004
Cr-Commit-Position: refs/heads/master@{#449339}

[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/components/test_runner/text_input_controller.cc
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/content/renderer/render_widget.cc
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/content/renderer/render_widget_browsertest.cc
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/third_party/WebKit/Source/web/WebFrameWidgetImpl.h
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/third_party/WebKit/Source/web/WebInputMethodControllerImpl.cpp
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/third_party/WebKit/Source/web/WebInputMethodControllerImpl.h
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/third_party/WebKit/Source/web/WebViewFrameWidget.cpp
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/third_party/WebKit/Source/web/WebViewFrameWidget.h
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/third_party/WebKit/Source/web/WebViewImpl.cpp
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/third_party/WebKit/Source/web/WebViewImpl.h
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/third_party/WebKit/Source/web/tests/WebViewTest.cpp
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/third_party/WebKit/public/web/WebInputMethodController.h
[modify] https://crrev.com/ce32ef9fc7230bbba732162c60cdc90f18fbbbc0/third_party/WebKit/public/web/WebWidget.h

Project Member

Comment 13 by bugdroid1@chromium.org, Jul 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7

commit d503ac6073fad15a95d4eb5d9f1343a315c7a9d7
Author: ekaramad <ekaramad@chromium.org>
Date: Wed Jul 19 23:26:32 2017

[refactor] - Rename and Move WebWidget::CaretOrSelectionRange to WebInputMethodController::GetSelectionOffsets

Reasons for move:
1- This is a frame concept given (the two nontrivial calls are from
   render_frame_impl.cc and frame_input_handler_impl.cc).

2- It cleans up WebViewImpl/WebFrameWidgetImpl (and helps with the split)

3- The logic is simply calling the corresponding method on
   InputMethodController of the focused LocalFrame.

4- Jumping from RenderFrameImpl to RenderWidget for getting selection is futile
   and expecting a focused frame is incorrect. Note that
   GestureManager::HandleGestureLongPress first passes the hit test result to
   SelectionController and then to MouseEventManager where the former generates
   selection updates and the latter updates frame focus. Therefore, right now,
   long pressing text on an unfocused OOPIF will lead to an empty selection
   update which is incorrect.

Reason for rename:
1- The method calls GetSelectionOffsets on InputMethodController (core) and it
   makes sense to make the wrapper variant have the same name.

  This CL also adds a small change to TextSelectionControllerClientChildFrame
to use selection range instead of selection bounds (now that the update is
fixed after the refactor).

BUG= 629721 ,  723790 

Review-Url: https://codereview.chromium.org/2910223003
Cr-Commit-Position: refs/heads/master@{#488035}

[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/content/renderer/input/frame_input_handler_impl.cc
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/third_party/WebKit/Source/core/exported/WebInputMethodControllerImpl.cpp
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/third_party/WebKit/Source/core/exported/WebInputMethodControllerImpl.h
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/third_party/WebKit/Source/core/exported/WebViewTest.cpp
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/third_party/WebKit/Source/core/frame/WebViewFrameWidget.cpp
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/third_party/WebKit/Source/core/frame/WebViewFrameWidget.h
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/third_party/WebKit/Source/web/WebViewImpl.cpp
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/third_party/WebKit/Source/web/WebViewImpl.h
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/third_party/WebKit/public/web/WebInputMethodController.h
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/third_party/WebKit/public/web/WebView.h
[modify] https://crrev.com/d503ac6073fad15a95d4eb5d9f1343a315c7a9d7/third_party/WebKit/public/web/WebWidget.h

Project Member

Comment 14 by bugdroid1@chromium.org, Nov 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cdee7b72afd2560db2584b0b3195722df0a9ad97

commit cdee7b72afd2560db2584b0b3195722df0a9ad97
Author: EhsanK <ekaramad@chromium.org>
Date: Wed Nov 08 21:30:09 2017

[refactor] Move WebWidget::CompositionRange() to
WebInputMethodController

The logic in the implementation is duplicated inside WebViewImpl and
WebFrameWidgetImpl. Besides this is a frame related concept which
eventually calls into InputMethodController. Therefore it makes sense to
move it to its public facing wrapper.

This also helps with further de-duping the IME code as well as
separation of WebWidget and WebView.

Bug:  629721 
Change-Id: I696a1c026aa0e2b59fb0a63698e0ba0280029947
Reviewed-on: https://chromium-review.googlesource.com/757046
Reviewed-by: Dimitri Glazkov <dglazkov@chromium.org>
Commit-Queue: Ehsan Karamad <ekaramad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514945}
[modify] https://crrev.com/cdee7b72afd2560db2584b0b3195722df0a9ad97/content/renderer/render_widget.cc
[modify] https://crrev.com/cdee7b72afd2560db2584b0b3195722df0a9ad97/third_party/WebKit/Source/core/exported/WebInputMethodControllerImpl.cpp
[modify] https://crrev.com/cdee7b72afd2560db2584b0b3195722df0a9ad97/third_party/WebKit/Source/core/exported/WebInputMethodControllerImpl.h
[modify] https://crrev.com/cdee7b72afd2560db2584b0b3195722df0a9ad97/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
[modify] https://crrev.com/cdee7b72afd2560db2584b0b3195722df0a9ad97/third_party/WebKit/Source/core/exported/WebViewImpl.h
[modify] https://crrev.com/cdee7b72afd2560db2584b0b3195722df0a9ad97/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/cdee7b72afd2560db2584b0b3195722df0a9ad97/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h
[modify] https://crrev.com/cdee7b72afd2560db2584b0b3195722df0a9ad97/third_party/WebKit/Source/core/frame/WebViewFrameWidget.cpp
[modify] https://crrev.com/cdee7b72afd2560db2584b0b3195722df0a9ad97/third_party/WebKit/Source/core/frame/WebViewFrameWidget.h
[modify] https://crrev.com/cdee7b72afd2560db2584b0b3195722df0a9ad97/third_party/WebKit/public/web/WebInputMethodController.h
[modify] https://crrev.com/cdee7b72afd2560db2584b0b3195722df0a9ad97/third_party/WebKit/public/web/WebView.h
[modify] https://crrev.com/cdee7b72afd2560db2584b0b3195722df0a9ad97/third_party/WebKit/public/web/WebWidget.h

Project Member

Comment 15 by bugdroid1@chromium.org, Nov 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/76dd5a9c6f723b56973cc79608f0fe6ce446a956

commit 76dd5a9c6f723b56973cc79608f0fe6ce446a956
Author: Dmitry Gozman <dgozman@chromium.org>
Date: Tue Nov 21 17:52:20 2017

Extract FrameSelection::ComputeAbsoluteBounds method

To be used in WebViewImpl and WebFrameWidgetImpl, which
currently implement it almost identically.

This will also allow to call ComputeAbsoluteBounds from
core/, reducing dependencies from core/ to core/exported.

Bug:  629721 
Change-Id: I6ad23dba7af2126d85f8a300deefb467d1dcd185
Reviewed-on: https://chromium-review.googlesource.com/779863
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Ehsan Karamad <ekaramad@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518301}
[modify] https://crrev.com/76dd5a9c6f723b56973cc79608f0fe6ce446a956/third_party/WebKit/Source/core/editing/FrameSelection.cpp
[modify] https://crrev.com/76dd5a9c6f723b56973cc79608f0fe6ce446a956/third_party/WebKit/Source/core/editing/FrameSelection.h
[modify] https://crrev.com/76dd5a9c6f723b56973cc79608f0fe6ce446a956/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
[modify] https://crrev.com/76dd5a9c6f723b56973cc79608f0fe6ce446a956/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp

Project Member

Comment 16 by bugdroid1@chromium.org, Nov 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/955ba583f11e21c4be789358a1e0dda4649ec7f3

commit 955ba583f11e21c4be789358a1e0dda4649ec7f3
Author: EhsanK <ekaramad@chromium.org>
Date: Thu Nov 30 21:14:40 2017

[refactor] Move Some Editing Related Methods from WebWidget to WebLocalFrame

This CL moves some editing methods from WebWidget to WebLocalFrame. The
immediate benefit of this move is deduping the code in between
WebViewImpl and WebFrameWidgetImpl. Furthermore, most other editing
methods are already defined per frame. The logic inside the methods moved
in this CL also act on the focused frame inside a widget.

Bug:  629721 
Change-Id: Iad9c291268aeab65965b016cf50b8863e3a0729f
Reviewed-on: https://chromium-review.googlesource.com/789530
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Commit-Queue: Ehsan Karamad <ekaramad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520688}
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/content/renderer/render_widget.cc
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/content/renderer/render_widget.h
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/content/shell/test_runner/test_runner_for_specific_view.cc
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/Source/core/exported/WebViewImpl.h
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/Source/core/exported/WebViewTest.cpp
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.cpp
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.h
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.h
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/Source/core/frame/WebViewFrameWidget.cpp
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/Source/core/frame/WebViewFrameWidget.h
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/public/web/WebFrameWidget.h
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/public/web/WebLocalFrame.h
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/public/web/WebView.h
[modify] https://crrev.com/955ba583f11e21c4be789358a1e0dda4649ec7f3/third_party/WebKit/public/web/WebWidget.h

Project Member

Comment 17 by bugdroid1@chromium.org, Feb 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4975af6d7ad5a505d6a1ef9634efbe2c08226998

commit 4975af6d7ad5a505d6a1ef9634efbe2c08226998
Author: Ehsan Karamad <ekaramad@chromium.org>
Date: Fri Feb 09 16:58:16 2018

[refactor] - Move GetCompositionCharacterBounds to WebInputMethodController

This is yet another case of IME code duplication between WebView and WebFrameWidget(s).

The CL removes this duplciation by moving the logic to WebInputMethodController altogether.

Bug:  629721 
Change-Id: I353dd0f05797a33cccc0898e1157441fad7194af
Reviewed-on: https://chromium-review.googlesource.com/908096
Commit-Queue: Ehsan Karamad <ekaramad@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#535736}
[modify] https://crrev.com/4975af6d7ad5a505d6a1ef9634efbe2c08226998/content/renderer/render_widget.cc
[modify] https://crrev.com/4975af6d7ad5a505d6a1ef9634efbe2c08226998/third_party/WebKit/Source/core/exported/WebInputMethodControllerImpl.cpp
[modify] https://crrev.com/4975af6d7ad5a505d6a1ef9634efbe2c08226998/third_party/WebKit/Source/core/exported/WebInputMethodControllerImpl.h
[modify] https://crrev.com/4975af6d7ad5a505d6a1ef9634efbe2c08226998/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
[modify] https://crrev.com/4975af6d7ad5a505d6a1ef9634efbe2c08226998/third_party/WebKit/Source/core/exported/WebViewImpl.h
[modify] https://crrev.com/4975af6d7ad5a505d6a1ef9634efbe2c08226998/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/4975af6d7ad5a505d6a1ef9634efbe2c08226998/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h
[modify] https://crrev.com/4975af6d7ad5a505d6a1ef9634efbe2c08226998/third_party/WebKit/Source/core/frame/WebViewFrameWidget.cpp
[modify] https://crrev.com/4975af6d7ad5a505d6a1ef9634efbe2c08226998/third_party/WebKit/Source/core/frame/WebViewFrameWidget.h
[modify] https://crrev.com/4975af6d7ad5a505d6a1ef9634efbe2c08226998/third_party/WebKit/public/web/WebInputMethodController.h
[modify] https://crrev.com/4975af6d7ad5a505d6a1ef9634efbe2c08226998/third_party/WebKit/public/web/WebWidget.h

Status: Closed (was: Started)
Following refactors above and works such as https://chromium-review.googlesource.com/779863 for selection bounds there is no longer any OOPIF-IME code duplication in between WebViewImpl and WebFrameWidget. Closing this bug.

Sign in to add a comment