Commit 9d6bfbc1 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Make NGInlineCursor::PositionForPointInChild() to call...

Make NGInlineCursor::PositionForPointInChild() to call NGFragmentItem::PositionForPoint() with child local offset

This patch changes |NGInlineCursor::PositionForPointInChild()| to call
|NGFragmentItem::PositionForPoint()| with child local offset instead of offset
in container because |NGFragmentItem::PositionForPoint()| expects local offset
as |NGPaintFragment:: PositionForPointInText()|.


This patch fixes following tests (at least):
- fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-user-select-none.html
- fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-before-style.html
- fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-first-letter-style.html

Failure counts is decreased to 206 from 215.

Bug: 982194
Change-Id: I839e9f480bb98501fb463da0dae6b42b2eb2b0e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2038590
Commit-Queue: Kent Tamura <tkent@chromium.org>
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738777}
parent 5fe339c3
......@@ -806,7 +806,8 @@ PositionWithAffinity NGInlineCursor::PositionForPointInChild(
DCHECK_EQ(&child_item, CurrentItem());
switch (child_item.Type()) {
case NGFragmentItem::kText:
return child_item.PositionForPointInText(point, *this);
return child_item.PositionForPointInText(
point - child_item.OffsetInContainerBlock(), *this);
case NGFragmentItem::kGeneratedText:
break;
case NGFragmentItem::kBox:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment