New issue
Advanced search Search tips

Issue 774213 link

Starred by 1 user

Issue metadata

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

Blocked on:
issue 774229



Sign in to add a comment

MostBackwardCaretPosition returns wrong result when remaining text starts with collapsed whitespace

Project Member Reported by xiaoche...@chromium.org, Oct 12 2017

Issue description

Version: ToT at r508367

Repro in a unit test:

TEST_F(VisibleUnitsTest,
       MostBackwardCaretPositionInRemainingTextWithLeadingCollapsedSpace) {
  InsertStyleElement(
      "div {white-space: pre-line}"
      "div::first-letter {color:red}");
  SetBodyContent("<div>F \nbar</div>");
  const Node* text = GetDocument().QuerySelector("div")->firstChild();

  EXPECT_EQ(Position(text, 1), MostBackwardCaretPosition(Position(text, 2)));
} 

However, current implementation returns text@2.

The root cause is that, CanBeBackwardCaretPosition() assumes that the remaining text always starts with non-collapsed character, which is incorrect as in our example.
 
Hmm... Seems that fixing CanBeBackwardCaretPosition doesn't fix the issue because the legacy layout doesn't collapse the space after 'F', as can be seen in https://jsfiddle.net/9twgry47/.

Firefox is doing it correctly.
Blockedon: 774229
Project Member

Comment 3 by sheriffbot@chromium.org, Oct 15

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment