TextIterator::RangeLength() returns wrong value for ::first-letter in legacy layout tree |
|||
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"
,
Feb 9 2018
Is it legacy-only, or does it occur in NG?
,
Feb 9 2018
>#c2, Is it legacy-only, or does it occur in NG? Yes, this is legacy only. I updated title of this issue.
,
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
,
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
,
Feb 15 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by yosin@chromium.org
, Feb 9 2018