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

Issue 2611813002: Add support for persisting CompositionUnderlines in InputMethodController (Closed)

Created:
3 years, 11 months ago by rlanday
Modified:
3 years, 11 months ago
Reviewers:
pfeldman, dcheng
CC:
aboxhall+watch_chromium.org, aboxhall, agrieve+watch_chromium.org, blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-paint_chromium.org, chromium-reviews, creis+watch_chromium.org, danakj+watch_chromium.org, darin-cc_chromium.org, dglazkov+blink, dmazzoni+watch_chromium.org, dmazzoni, dshwang, dtseng+watch_chromium.org, eae+blinkwatch, einbinder+watch-test-runner_chromium.org, haraken, jam, jbauman+watch_chromium.org, je_julie, jochen+watch_chromium.org, kalyank, kinuko+watch, mac-reviews_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-test-runner_chromium.org, nasko+codewatch_chromium.org, nektarios, nektar+watch_chromium.org, nona+watch_chromium.org, piman+watch_chromium.org, rwlbuis, shuchen+watch_chromium.org, sof, James Su, yusukes+watch_chromium.org, yuzo+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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

Patch Set 1 #

Patch Set 2 : Trying again with no-squash #

Patch Set 3 : Try one more time #

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:

Messages

Total messages: 5 (2 generated)
rlanday
pfeldman, I need your review of the changes to: - components/test_runner/text_input_controller.cc - third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp dcheng, I ...
3 years, 11 months ago (2017-01-03 21:07:03 UTC) #3
rlanday
Actually I may take back the comment about not needing to be able to remove ...
3 years, 11 months ago (2017-01-03 22:33:04 UTC) #4
rlanday
3 years, 11 months ago (2017-01-05 02:01:28 UTC) #5
Message was sent while issue was closed.
I just talked to aelias, we think we're going to go with a different approach
(having a CompositionUnderline type specifically for SuggestionSpan)

Powered by Google App Engine
This is Rietveld 408576698