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

Issue 766680 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocked on:
issue 766925



Sign in to add a comment

Cursor jump during typing in content editable div

Reported by lge-systemwebview@lge.com, Sep 19 2017

Issue description

THIS TEMPLATE IS FOR FILING BUGS ON THE ANDROID SYSTEM WEBVIEW. GENERAL WEB
BUGS SHOULD BE FILED USING A DIFFERENT TEMPLATE!

Device name: LG G5/G6, Nexus 6P
Android version: 7.x or 8.0.0
WebView version (from system settings -> Apps -> Android System WebView):60.0.3112.116
Application: Chrome browser
Application version: 60.0.3112.116

URLs (if applicable):


Precondition: LG keyboard or Swype keyboard should be selected as default keyboard

Steps to reproduce:
(1) Load attached html(sample.html) in chrome browser
(2) Long press and Select all text
(3) Type some text (Hello) and observe

Expected result: Cursor should not jump and enter text should be proper.


Actual result: Cursor jump is observed


 
Components: -Mobile>WebView UI>Input>Text>IME
Labels: Needs-Feedback
You haven't attached the sample.html.
WebView is not the right component for anything that reproduces in Chrome.

Comment 2 Deleted

This issue is reproduced in both review and chrome.
Attaching sample html.
sample.html
2.0 KB View Download
Project Member

Comment 4 by sheriffbot@chromium.org, Sep 19 2017

Cc: tobiasjs@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "tobiasjs@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: changwan@chromium.org
Cc: aelias@chromium.org
Owner: rlanday@chromium.org
Status: Assigned (was: Unconfirmed)
rlanday@, could you take a look?
Bisects to

https://codereview.chromium.org/2530843003
Introduce InsertIncrementalTextCommand to respect existing style for composition
That's one bug, I believe the one originally reported. On master, we have another, which is that we hit a CHECK and the renderer crashes:

[FATAL:LayoutObject.h(2620)] Check failed: !IsSetNeedsLayoutForbidden().

Stack Trace:
  RELADDR   FUNCTION                                                                                                                                FILE:LINE
  000a65bb  ~LogMessage                                                                                                                             /usr/local/google/code/clankium/src/base/logging.cc:560
  006d8d3f  blink::LayoutObject::SetNeedsLayout(char const*, blink::MarkingBehavior, blink::SubtreeLayoutScope*)                                    /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutObject.h:2620
  007f7dd3  blink::LayoutObject::SetNeedsLayoutAndFullPaintInvalidation(char const*, blink::MarkingBehavior, blink::SubtreeLayoutScope*)            /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutObject.h:2639
  00a2fbc7  blink::TextAutosizer::ApplyMultiplier(blink::LayoutObject*, float, blink::SubtreeLayoutScope*, blink::TextAutosizer::RelayoutBehavior)  /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/TextAutosizer.cpp:1139
  00a2f757  blink::TextAutosizer::Inflate(blink::LayoutObject*, blink::SubtreeLayoutScope*, blink::TextAutosizer::InflateBehavior, float)           /data/app/org.chromium.chrome-1/lib/arm/libblink_core.cr.so
  00a2f5b3  blink::TextAutosizer::BeginLayout(blink::LayoutBlock*, blink::SubtreeLayoutScope*)                                                      /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/TextAutosizer.cpp:353
  00a30bf1  LayoutScope                                                                                                                             /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/TextAutosizer.cpp:1300
  00a30c1d  TableLayoutScope                                                                                                                        /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/TextAutosizer.cpp:1311
  00a2bfc3  blink::TableLayoutAlgorithmAuto::ComputeIntrinsicLogicalWidths(blink::LayoutUnit&, blink::LayoutUnit&)                                  /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp:259
  00a0f003  blink::LayoutTable::ComputePreferredLogicalWidths()                                                                                     /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutTable.cpp:988
  009d375f  blink::LayoutBox::MinPreferredLogicalWidth() const                                                                                      /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBox.cpp:1348
  009bea29  blink::LayoutBlock::ComputeChildPreferredLogicalWidths(blink::LayoutObject&, blink::LayoutUnit&, blink::LayoutUnit&) const              /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlock.cpp:1571
  009be347  blink::LayoutBlock::ComputeBlockPreferredLogicalWidths(blink::LayoutUnit&, blink::LayoutUnit&) const                                    /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlock.cpp:1491
  009be0f5  blink::LayoutBlock::ComputeIntrinsicLogicalWidths(blink::LayoutUnit&, blink::LayoutUnit&) const                                         /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlock.cpp:1350
  009be6e1  blink::LayoutBlock::ComputePreferredLogicalWidths()                                                                                     /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlock.cpp:1390
  00a1162f  blink::LayoutTableCell::ComputePreferredLogicalWidths()                                                                                 /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp:194
  009d37bf  blink::LayoutBox::MaxPreferredLogicalWidth() const                                                                                      /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBox.cpp:1362
  00a2b9a1  blink::TableLayoutAlgorithmAuto::RecalcColumn(unsigned int)                                                                             /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp:67
  00a2bf2b  blink::TableLayoutAlgorithmAuto::FullRecalc()                                                                                           /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp:206
  00a2bfc9  blink::TableLayoutAlgorithmAuto::ComputeIntrinsicLogicalWidths(blink::LayoutUnit&, blink::LayoutUnit&)                                  /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp:261
  00a0f003  blink::LayoutTable::ComputePreferredLogicalWidths()                                                                                     /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutTable.cpp:988
  009d375f  blink::LayoutBox::MinPreferredLogicalWidth() const                                                                                      /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBox.cpp:1348
  00a0d8a3  blink::LayoutTable::UpdateLogicalWidth()                                                                                                /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutTable.cpp:348
  00a0e219  blink::LayoutTable::UpdateLayout()                                                                                                      /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutTable.cpp:604
  009c3b87  blink::LayoutBlockFlow::PositionAndLayoutOnceIfNeeded(blink::LayoutBox&, blink::LayoutUnit, blink::BlockChildrenLayoutInfo&)            /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:759
  009c3d5f  blink::LayoutBlockFlow::LayoutBlockChild(blink::LayoutBox&, blink::BlockChildrenLayoutInfo&)                                            /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:822
  009c356d  blink::LayoutBlockFlow::LayoutBlockChildren(bool, blink::SubtreeLayoutScope&, blink::LayoutUnit, blink::LayoutUnit)                     /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:1527
  009c2a73  blink::LayoutBlockFlow::LayoutChildren(bool, blink::SubtreeLayoutScope&)                                                                /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:567
  009c2889  blink::LayoutBlockFlow::UpdateBlockLayout(bool)                                                                                         /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:438
  009bc595  blink::LayoutBlock::UpdateLayout()                                                                                                      /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlock.cpp:427
  009c3b87  blink::LayoutBlockFlow::PositionAndLayoutOnceIfNeeded(blink::LayoutBox&, blink::LayoutUnit, blink::BlockChildrenLayoutInfo&)            /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:759
  009c3d5f  blink::LayoutBlockFlow::LayoutBlockChild(blink::LayoutBox&, blink::BlockChildrenLayoutInfo&)                                            /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:822
  009c356d  blink::LayoutBlockFlow::LayoutBlockChildren(bool, blink::SubtreeLayoutScope&, blink::LayoutUnit, blink::LayoutUnit)                     /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:1527
  009c2a73  blink::LayoutBlockFlow::LayoutChildren(bool, blink::SubtreeLayoutScope&)                                                                /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:567
  009c2889  blink::LayoutBlockFlow::UpdateBlockLayout(bool)                                                                                         /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:438
  009bc595  blink::LayoutBlock::UpdateLayout()                                                                                                      /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlock.cpp:427
  009c3b87  blink::LayoutBlockFlow::PositionAndLayoutOnceIfNeeded(blink::LayoutBox&, blink::LayoutUnit, blink::BlockChildrenLayoutInfo&)            /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:759
  009c3d5f  blink::LayoutBlockFlow::LayoutBlockChild(blink::LayoutBox&, blink::BlockChildrenLayoutInfo&)                                            /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:822
  009c356d  blink::LayoutBlockFlow::LayoutBlockChildren(bool, blink::SubtreeLayoutScope&, blink::LayoutUnit, blink::LayoutUnit)                     /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:1527
  009c2a73  blink::LayoutBlockFlow::LayoutChildren(bool, blink::SubtreeLayoutScope&)                                                                /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:567
  009c2889  blink::LayoutBlockFlow::UpdateBlockLayout(bool)                                                                                         /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:438
  009bc595  blink::LayoutBlock::UpdateLayout()                                                                                                      /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlock.cpp:427
  009c3b87  blink::LayoutBlockFlow::PositionAndLayoutOnceIfNeeded(blink::LayoutBox&, blink::LayoutUnit, blink::BlockChildrenLayoutInfo&)            /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:759
  009c3d5f  blink::LayoutBlockFlow::LayoutBlockChild(blink::LayoutBox&, blink::BlockChildrenLayoutInfo&)                                            /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:822
  009c356d  blink::LayoutBlockFlow::LayoutBlockChildren(bool, blink::SubtreeLayoutScope&, blink::LayoutUnit, blink::LayoutUnit)                     /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:1527
  009c2a73  blink::LayoutBlockFlow::LayoutChildren(bool, blink::SubtreeLayoutScope&)                                                                /usr/local/google/code/clankium/src/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:567
I've filed a separate bug for the layout DCHECK issue: https://bugs.chromium.org/p/chromium/issues/detail?id=766842

(my previous comment is slightly incorrect; it's a DCHECK, not a CHECK, and it only occurs in DCHECK builds).
I'm attaching what I believe to be a minimal test case for the same issue.
a_insert_bug.html
81 bytes View Download
Blockedon: 766925
I discovered another problem (probably similar in cause, but with different symptoms) while attempting to come up with a minimized test case:
https://bugs.chromium.org/p/chromium/issues/detail?id=766925
The problem here (testing on the a_insert_bug.html minimized test case) is that if you have markup that looks like:

<a contenteditable><img />test</a>

and do a "select all", it selects from right before the <img> to right after "test". So then whatever you replace the text with should end up as the only content inside the <a>. However, the logic that computes the incremental insertion and figures out which text needs to be replaced only selects "test":
https://chromium.googlesource.com/chromium/src/+/703c6b6cf1bcd212168721e72bc79b4afacb370e/third_party/WebKit/Source/core/editing/commands/InsertIncrementalTextCommand.cpp#160

I think the fix is to be more careful about how we construct the ending selection (which marks the content being replaced).
Cc: editing-dev@chromium.org xiaoche...@chromium.org yosin@chromium.org
Project Member

Comment 14 by bugdroid1@chromium.org, Sep 24 2017

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

commit efa491590185c7c876bbfdcece392a84318faeb3
Author: Ryan Landay <rlanday@chromium.org>
Date: Sun Sep 24 18:04:21 2017

Fix bug causing odd cursor behavior on Android when editing certain markup

InsertIncrementalTextCommand is designed so that Android IMEs that replace a
whole word (by calling InputConnection#setComposingText()) don't cause the word
to lose formatting it already has (e.g. if half the word is bolded). However,
it's a little overzealous/buggy: there are cases where the selection clearly
contains more than text, but it still tries to apply replacement text as an
incremental update, leaving the markup around the text.

For example, if we have this markup and do "select all" inside the <a>:

<a href="#" contenteditable="true"><img />test</a>

and then we type a character using setComposingText(), we currently leave the
<img /> behind. The selection is also left in an odd state (typing a second
character removes the <img> element, and appears before the first character).

The simplest fix is to emit object replacement characters for elements such as
<img /> so we can tell that the current selection is supposed to include them.


BUG= 766680 

Change-Id: Ie5a3323fe4e6e2c9beeb1e647949ee61f76bcff8
Reviewed-on: https://chromium-review.googlesource.com/676264
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Ryan Landay <rlanday@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503960}
[modify] https://crrev.com/efa491590185c7c876bbfdcece392a84318faeb3/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
[modify] https://crrev.com/efa491590185c7c876bbfdcece392a84318faeb3/third_party/WebKit/Source/core/editing/commands/InsertIncrementalTextCommand.cpp

Labels: M-63
Will be fixed in Chrome 63 (targeted for release around December 5).
Status: Fixed (was: Assigned)

Sign in to add a comment