Commit 95d5f97b authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[LayoutNG] Fix PreviousOnLineInlineNG

It returned nullptr for any objects laid out by LayoutNG.

`AXPosition::AtStartOfLine()` relies on this, and that it
fails to return the correct value in LayoutNG.

This patch fixes following content_browsertests with LayoutNG:
  AccessibilityAuraLinuxBrowserTest.TestParagraphTextAtOffsetWithBoundaryLine
  AccessibilityWinBrowserTest.TestParagraphTextAtOffsetWithBoundaryLine

Change-Id: I409682232a29f84cda7e2d547ffd6a264357b3d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1608867Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarAlice Boxhall <aboxhall@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659579}
parent 316f5d95
...@@ -1318,7 +1318,7 @@ static AXObject* PreviousOnLineInlineNG(const AXObject& ax_object) { ...@@ -1318,7 +1318,7 @@ static AXObject* PreviousOnLineInlineNG(const AXObject& ax_object) {
DCHECK(!layout_object.IsListMarkerIncludingNG()) << layout_object; DCHECK(!layout_object.IsListMarkerIncludingNG()) << layout_object;
DCHECK(ShouldUseLayoutNG(layout_object)) << layout_object; DCHECK(ShouldUseLayoutNG(layout_object)) << layout_object;
const auto fragments = NGPaintFragment::InlineFragmentsFor(&layout_object); const auto fragments = NGPaintFragment::InlineFragmentsFor(&layout_object);
if (fragments.IsEmpty() || fragments.IsInLayoutNGInlineFormattingContext()) if (fragments.IsEmpty() || !fragments.IsInLayoutNGInlineFormattingContext())
return nullptr; return nullptr;
for (NGPaintFragmentTraversalContext runner = for (NGPaintFragmentTraversalContext runner =
NGPaintFragmentTraversal::PreviousInlineLeafOf( NGPaintFragmentTraversal::PreviousInlineLeafOf(
......
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