Commit b03cd9b0 authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

[layoutng] Fix PaintControllerPaintTest.InlineRelayout

For NG, we need to get the DisplayItemClient ID from the
paint fragment, not the InlineTextBox.

R=kojii@chromium.org

Change-Id: I0363ad1fdeb09e3f2422abb33516b3ffc713338e
Reviewed-on: https://chromium-review.googlesource.com/c/1334418Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607805}
parent b1e70b9c
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "third_party/blink/renderer/core/layout/layout_text.h" #include "third_party/blink/renderer/core/layout/layout_text.h"
#include "third_party/blink/renderer/core/layout/line/inline_text_box.h" #include "third_party/blink/renderer/core/layout/line/inline_text_box.h"
#include "third_party/blink/renderer/core/page/focus_controller.h" #include "third_party/blink/renderer/core/page/focus_controller.h"
#include "third_party/blink/renderer/core/paint/ng/ng_paint_fragment.h"
#include "third_party/blink/renderer/core/paint/object_paint_properties.h" #include "third_party/blink/renderer/core/paint/object_paint_properties.h"
#include "third_party/blink/renderer/core/paint/paint_layer_painter.h" #include "third_party/blink/renderer/core/paint/paint_layer_painter.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h" #include "third_party/blink/renderer/platform/graphics/graphics_context.h"
...@@ -57,7 +58,10 @@ TEST_P(PaintControllerPaintTest, InlineRelayout) { ...@@ -57,7 +58,10 @@ TEST_P(PaintControllerPaintTest, InlineRelayout) {
LayoutBlock& div_block = LayoutBlock& div_block =
*ToLayoutBlock(GetDocument().body()->firstChild()->GetLayoutObject()); *ToLayoutBlock(GetDocument().body()->firstChild()->GetLayoutObject());
LayoutText& text = *ToLayoutText(div_block.FirstChild()); LayoutText& text = *ToLayoutText(div_block.FirstChild());
InlineTextBox& first_text_box = *text.FirstTextBox(); DisplayItemClient& first_text_box =
text.FirstInlineFragment()
? (DisplayItemClient&)*text.FirstInlineFragment()
: (DisplayItemClient&)*text.FirstTextBox();
EXPECT_THAT(RootPaintController().GetDisplayItemList(), EXPECT_THAT(RootPaintController().GetDisplayItemList(),
ElementsAre(IsSameId(&ViewScrollingBackgroundClient(), ElementsAre(IsSameId(&ViewScrollingBackgroundClient(),
...@@ -68,9 +72,17 @@ TEST_P(PaintControllerPaintTest, InlineRelayout) { ...@@ -68,9 +72,17 @@ TEST_P(PaintControllerPaintTest, InlineRelayout) {
UpdateAllLifecyclePhasesForTest(); UpdateAllLifecyclePhasesForTest();
LayoutText& new_text = *ToLayoutText(div_block.FirstChild()); LayoutText& new_text = *ToLayoutText(div_block.FirstChild());
InlineTextBox& new_first_text_box = *new_text.FirstTextBox(); DisplayItemClient& new_first_text_box =
InlineTextBox& second_text_box = new_text.FirstInlineFragment()
*new_text.FirstTextBox()->NextForSameLayoutObject(); ? (DisplayItemClient&)*new_text.FirstInlineFragment()
: (DisplayItemClient&)*text.FirstTextBox();
DisplayItemClient& second_text_box =
new_text.FirstInlineFragment()
? (DisplayItemClient&)*NGPaintFragment::
TraverseNextForSameLayoutObject::Next(
new_text.FirstInlineFragment())
: (DisplayItemClient&)*new_text.FirstTextBox()
->NextForSameLayoutObject();
EXPECT_THAT(RootPaintController().GetDisplayItemList(), EXPECT_THAT(RootPaintController().GetDisplayItemList(),
ElementsAre(IsSameId(&ViewScrollingBackgroundClient(), ElementsAre(IsSameId(&ViewScrollingBackgroundClient(),
......
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