|
Add support for persisting CompositionUnderlines in InputMethodController
This is needed to properly support the Android Voice IME. This IME uses
commitText() to underline certain pieces of text, and it expects these
underlines to persist until it replaces the text with a non-underlined string.
My current plan is for the Java ImeAdapter to keep track of all the
SuggestionSpans that the IME has created, and create a corresponding
PersistingCompositionUnderline for each one. The DocumentMarker infrastructure
will update the start/end locations of each span as the text is edited, and I
will add an API that ImeAdapter can call in response to touch events to get a
list of active CompositionUnderlines, which will have been tagged in such a way
that they can be mapped back to the SuggestionSpan. I've written code to do this
and verified that this approach works but I'm not including it in this CL.
An interesting question is whether we need to have an API for removing these
spans (since they otherwise persist). Using DOM ranges as an example, there is
no way to remove a DOM range from the DOM once attached (there used to be
range.detach(), but it has since been turned into a no-op). So I suspect that
adding an API to remove these ranges isn't really necessary. Replacing an entire
underlined span will collapse the span to be of zero-length but will not remove
it. Once we add support for tagging the spans, as mentioned above, we could add
a way to remove spans by tag, but I'm not convinced that that will really solve
any actual problems, at least for my use case. Or we could potentially make
zero-length spans just disappear, but this is not how DOM ranges behave, and
might break some other future use case for these CompositionUnderlines.
Note: this is unlikely to work correctly without this bug fix:
https://codereview.chromium.org/2594123003
BUG= 672259
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+316 lines, -98 lines) |
Patch |
 |
M |
components/test_runner/text_input_controller.cc
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/ime_adapter_android.cc
|
View
|
1
2
|
4 chunks |
+9 lines, -14 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_view_aura.cc
|
View
|
1
2
|
1 chunk |
+4 lines, -6 lines |
0 comments
|
Download
|
 |
M |
content/common/content_param_traits_macros.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/dom/Document.cpp
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/CompositionUnderline.h
|
View
|
|
2 chunks |
+4 lines, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/CompositionUnderline.cpp
|
View
|
|
1 chunk |
+6 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/CompositionUnderlineTest.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/InputMethodController.cpp
|
View
|
1
2
|
3 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
|
View
|
1
2
|
30 chunks |
+189 lines, -30 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
|
View
|
|
1 chunk |
+6 lines, -3 lines |
1 comment
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
|
View
|
|
4 chunks |
+6 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
|
View
|
|
1 chunk |
+9 lines, -4 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h
|
View
|
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
|
View
|
1
2
|
5 chunks |
+36 lines, -11 lines |
1 comment
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp
|
View
|
|
2 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
|
View
|
|
3 chunks |
+10 lines, -5 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/testing/Internals.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/CompositionUnderlineBuilder.h
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/tests/WebViewTest.cpp
|
View
|
1
2
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/public/web/WebCompositionUnderline.h
|
View
|
|
2 chunks |
+11 lines, -3 lines |
0 comments
|
Download
|
Depends on Patchset:
Total messages: 5 (2 generated)
|