| Index: Source/core/paint/ViewDisplayListTest.cpp
|
| diff --git a/Source/core/paint/ViewDisplayListTest.cpp b/Source/core/paint/ViewDisplayListTest.cpp
|
| index b095b4e06cbc4f6d77b82ebb3e5b2cab37aa7682..8e2429c6caa48d6555657c914cdc90552178b4e2 100644
|
| --- a/Source/core/paint/ViewDisplayListTest.cpp
|
| +++ b/Source/core/paint/ViewDisplayListTest.cpp
|
| @@ -519,5 +519,57 @@ TEST_F(ViewDisplayListTest, FullDocumentPaintingWithCaret)
|
| TestDisplayItem(divRenderer, DisplayItem::DrawingPaintPhaseCaret));
|
| }
|
|
|
| +TEST_F(ViewDisplayListTest, ComplexUpdateSwapOrder)
|
| +{
|
| + setBodyInnerHTML("<div id='container1'><div id='content1'></div></div>"
|
| + "<div id='container2'><div id='content2'></div></div>");
|
| + RenderObject* container1 = document().body()->firstChild()->renderer();
|
| + RenderObject* content1 = document().body()->firstChild()->firstChild()->renderer();
|
| + RenderObject* container2 = document().body()->firstChild()->nextSibling()->renderer();
|
| + RenderObject* content2 = document().body()->firstChild()->nextSibling()->firstChild()->renderer();
|
| + GraphicsContext context(nullptr, &rootDisplayItemList());
|
| +
|
| + drawRect(&context, container1, PaintPhaseBlockBackground, FloatRect(100, 100, 100, 100));
|
| + drawRect(&context, content1, PaintPhaseBlockBackground, FloatRect(100, 100, 50, 200));
|
| + drawRect(&context, content1, PaintPhaseForeground, FloatRect(100, 100, 50, 200));
|
| + drawRect(&context, container1, PaintPhaseForeground, FloatRect(100, 100, 100, 100));
|
| + drawRect(&context, container2, PaintPhaseBlockBackground, FloatRect(100, 200, 100, 100));
|
| + drawRect(&context, content2, PaintPhaseBlockBackground, FloatRect(100, 200, 50, 200));
|
| + drawRect(&context, content2, PaintPhaseForeground, FloatRect(100, 200, 50, 200));
|
| + drawRect(&context, container2, PaintPhaseForeground, FloatRect(100, 200, 100, 100));
|
| + rootDisplayItemList().endNewPaints();
|
| +
|
| + EXPECT_DISPLAY_LIST(rootDisplayItemList().paintList(), 8,
|
| + TestDisplayItem(container1, DisplayItem::DrawingPaintPhaseBlockBackground),
|
| + TestDisplayItem(content1, DisplayItem::DrawingPaintPhaseBlockBackground),
|
| + TestDisplayItem(content1, DisplayItem::DrawingPaintPhaseForeground),
|
| + TestDisplayItem(container1, DisplayItem::DrawingPaintPhaseForeground),
|
| + TestDisplayItem(container2, DisplayItem::DrawingPaintPhaseBlockBackground),
|
| + TestDisplayItem(content2, DisplayItem::DrawingPaintPhaseBlockBackground),
|
| + TestDisplayItem(content2, DisplayItem::DrawingPaintPhaseForeground),
|
| + TestDisplayItem(container2, DisplayItem::DrawingPaintPhaseForeground));
|
| +
|
| + rootDisplayItemList().invalidate(container1->displayItemClient());
|
| + drawRect(&context, container2, PaintPhaseBlockBackground, FloatRect(100, 200, 100, 100));
|
| + drawRect(&context, content2, PaintPhaseBlockBackground, FloatRect(100, 200, 50, 200));
|
| + drawRect(&context, content2, PaintPhaseForeground, FloatRect(100, 200, 50, 200));
|
| + drawRect(&context, container2, PaintPhaseForeground, FloatRect(100, 200, 100, 100));
|
| + drawRect(&context, container1, PaintPhaseBlockBackground, FloatRect(100, 100, 100, 100));
|
| + drawRect(&context, content1, PaintPhaseBlockBackground, FloatRect(100, 100, 50, 200));
|
| + drawRect(&context, content1, PaintPhaseForeground, FloatRect(100, 100, 50, 200));
|
| + drawRect(&context, container1, PaintPhaseForeground, FloatRect(100, 100, 100, 100));
|
| + rootDisplayItemList().endNewPaints();
|
| +
|
| + EXPECT_DISPLAY_LIST(rootDisplayItemList().paintList(), 8,
|
| + TestDisplayItem(container2, DisplayItem::DrawingPaintPhaseBlockBackground),
|
| + TestDisplayItem(content2, DisplayItem::DrawingPaintPhaseBlockBackground),
|
| + TestDisplayItem(content2, DisplayItem::DrawingPaintPhaseForeground),
|
| + TestDisplayItem(container2, DisplayItem::DrawingPaintPhaseForeground),
|
| + TestDisplayItem(container1, DisplayItem::DrawingPaintPhaseBlockBackground),
|
| + TestDisplayItem(content1, DisplayItem::DrawingPaintPhaseBlockBackground),
|
| + TestDisplayItem(content1, DisplayItem::DrawingPaintPhaseForeground),
|
| + TestDisplayItem(container1, DisplayItem::DrawingPaintPhaseForeground));
|
| +}
|
| +
|
| } // anonymous namespace
|
| } // namespace blink
|
|
|