New issue
Advanced search Search tips

Issue 810623 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 778507



Sign in to add a comment

TextIterator::RangeLength() returns wrong value for ::first-letter in legacy layout tree

Project Member Reported by yosin@chromium.org, Feb 9 2018

Issue description

Following HTML, where "|" denotes offset should return 0 instead of 8

TextIterator::RangeLength(Position(p->firstChild(), 0), position) 
<style>p::p::first-letter {font-size:200%;}</style>
<p> |(1) abc def</p>


EXPECT_EQ("|(1) abc def", TestRangeLength("<p> |(1) abc def</p>"));
But got "(1) abc |def"

 

Comment 1 by yosin@chromium.org, Feb 9 2018

Blocking: 778507
Is it legacy-only, or does it occur in NG?

Comment 3 by yosin@chromium.org, Feb 9 2018

Summary: TextIterator::RangeLength() returns wrong value for ::first-letter in legacy layout tree (was: TextIterator::RangeLength() returns wrong value for ::first-letter)
>#c2, Is it legacy-only, or does it occur in NG?
Yes, this is legacy only. I updated title of this issue.
Project Member

Comment 4 by bugdroid1@chromium.org, Feb 14 2018

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

commit 0eb00ed931b6a91b8d5bd6bd0cc2849f5dbaf374
Author: Yoshifumi Inoue <yosin@chromium.org>
Date: Wed Feb 14 09:00:28 2018

Add test cases for TextIterator::RangeLength()

This patch introduces test cases for |TextIterator::RangeLength()| to record
current behavior as a preparation of fixing ::first-letter bug[1].


[1]  http://crbug.com/810623  TextIterator::RangeLength() returns wrong value for
::first-letter

Bug:  810623 
Change-Id: I59b80f4f0a2b260bbcb7a02915ead354f796d3fb
Reviewed-on: https://chromium-review.googlesource.com/908271
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536683}
[modify] https://crrev.com/0eb00ed931b6a91b8d5bd6bd0cc2849f5dbaf374/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp

Project Member

Comment 5 by bugdroid1@chromium.org, Feb 15 2018

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

commit 7df9529c3bd71b5cdef2b89c8ccbfe5cb685a9c6
Author: Yoshifumi Inoue <yosin@chromium.org>
Date: Thu Feb 15 01:24:53 2018

Make TextIterator::RangeLength() to return valid value when ending in ::first-letter

This patch changes |TextIteratorTextNodeHandler::HandleTextBox()| to handle
range ends at end of leading collapsed whitespace of first-letter part, e.g.
"<p>^ |(1) foo</p>" where P has ::first-letter.

Bug:  810623 
Change-Id: I6888bf0cba305d33c193b6cd4c3f191c8dcf36bd
Reviewed-on: https://chromium-review.googlesource.com/910543
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536916}
[modify] https://crrev.com/7df9529c3bd71b5cdef2b89c8ccbfe5cb685a9c6/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
[modify] https://crrev.com/7df9529c3bd71b5cdef2b89c8ccbfe5cb685a9c6/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp

Comment 6 by yosin@chromium.org, Feb 15 2018

Status: Fixed (was: Started)

Sign in to add a comment