Currently, throughout the code in WebFrameWidgetImpl (and WebViewImpl when they overlap) we obtain the focused frame from page()->focusController(). Therefore, all widgets in the same process can see a focused frame whether or not it shares the same local root as that of the widgets themselves. We should have a means to identify a focused frame which "in the widget" as in they both have the same local root.
This is crucial in IME related tasks, such as WebWidget::textInputInfo(), WebWidget::selectionBounds(), WebWidget::textInputType(), etc. which obtain their required state from the focused frame. For example, in a scenario such as:
-A-------------------
| -B----------------- |
|| -A--------------- ||
||| [text] |||
|| ----------------- ||
| ------------------- |
---------------------
The TextInputState could be reported from both WebViewImpl and WebFrameWidget for the inner most frame. This will cause issues in tracking the right state (i.e., incorrect selection bounds will lead to IME drop down list to show at incorrect position).
Comment 1 by bugdroid1@chromium.org
, Jul 19 2016