New issue
Advanced search Search tips

Issue 875155 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 892513



Sign in to add a comment

InputMethodController::TextInputInfo() should return correct text offset

Project Member Reported by yosin@chromium.org, Aug 17

Issue description

InputMethodController::TextInputInfo() returns wrong text offset for selection and composition.
It should return offsets in PlainText() with EmitsObjectReplacementCharacter and                            EmitsSpaceForNbsp TextIteratorBefore. But, selection and composition use default TextIteratorBehavior.

Current implementation:

  info.value = PlainText(EphemeralRange::RangeOfContents(*element),
                         TextIteratorBehavior::Builder()
                             .SetEmitsObjectReplacementCharacter(true)
                             .SetEmitsSpaceForNbsp(true)
                             .Build());

  EphemeralRange first_range = FirstEphemeralRangeOf(
      GetFrame().Selection().ComputeVisibleSelectionInDOMTreeDeprecated());
  PlainTextRange selection_plain_text_range =
      PlainTextRangeForEphemeralRange(first_range).second;
  if (selection_plain_text_range.IsNotNull()) {
    info.selection_start = selection_plain_text_range.Start();
    info.selection_end = selection_plain_text_range.End();
  }

  EphemeralRange range = CompositionEphemeralRange();
  PlainTextRange composition_plain_text_range =
      PlainTextRangeForEphemeralRange(range).second;
  if (composition_plain_text_range.IsNotNull()) {
    info.composition_start = composition_plain_text_range.Start();
    info.composition_end = composition_plain_text_range.End();
  }

 
See also 875184
Blocking: 892513
Labels: Performance-Responsiveness

Sign in to add a comment