Chromium Code Reviews| Index: Source/core/paint/DisplayItemListPaintTest.cpp |
| diff --git a/Source/core/paint/DisplayItemListPaintTest.cpp b/Source/core/paint/DisplayItemListPaintTest.cpp |
| index 675ea5ffb27eea969c2ccf295e7789ae21b5330d..740e19775e2dad18664695d67c1ffc09106972f7 100644 |
| --- a/Source/core/paint/DisplayItemListPaintTest.cpp |
| +++ b/Source/core/paint/DisplayItemListPaintTest.cpp |
| @@ -228,7 +228,8 @@ TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, FullDocumentPaintingWithCaret |
| document().view()->updateAllLifecyclePhases(); |
| - EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 4, |
| + EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 5, |
| + TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), |
| TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
| TestDisplayItem(html, DisplayItem::BeginSubsequence), |
| TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)), |
| @@ -237,7 +238,8 @@ TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, FullDocumentPaintingWithCaret |
| div.focus(); |
| document().view()->updateAllLifecyclePhases(); |
| - EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 5, |
| + EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 6, |
| + TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), |
| TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
| TestDisplayItem(html, DisplayItem::BeginSubsequence), |
| TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)), |
| @@ -257,7 +259,8 @@ TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, InlineRelayout) |
| document().view()->updateAllLifecyclePhases(); |
| - EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 4, |
| + EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 5, |
| + TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), |
| TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
| TestDisplayItem(html, DisplayItem::BeginSubsequence), |
| TestDisplayItem(firstTextBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)), |
| @@ -270,7 +273,8 @@ TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, InlineRelayout) |
| InlineTextBox& newFirstTextBox = *newText.firstTextBox(); |
| InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); |
| - EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 5, |
| + EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 6, |
| + TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), |
| TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
| TestDisplayItem(html, DisplayItem::BeginSubsequence), |
| TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)), |
| @@ -296,7 +300,8 @@ TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, CachedSubsequence) |
| LayoutObject& container2 = *document().getElementById("container2")->layoutObject(); |
| LayoutObject& content2 = *document().getElementById("content2")->layoutObject(); |
| - EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 11, |
| + EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 12, |
| + TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), |
| TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
| TestDisplayItem(html, DisplayItem::BeginSubsequence), |
| TestDisplayItem(container1, DisplayItem::BeginSubsequence), |
| @@ -312,7 +317,8 @@ TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, CachedSubsequence) |
| toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "width: 100px; height: 100px; background-color: green"); |
| updateLifecyclePhasesToPaintForSlimmingPaintV2Clean(); |
| - EXPECT_DISPLAY_LIST_WITH_CACHED_RED_FILL_IN_DEBUG(newDisplayItemsBeforeUpdate(), 8, |
| + EXPECT_DISPLAY_LIST_WITH_CACHED_RED_FILL_IN_DEBUG(newDisplayItemsBeforeUpdate(), 9, |
| + TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), |
| TestDisplayItem(layoutView, DisplayItem::drawingTypeToCachedDrawingType(DisplayItem::BoxDecorationBackground)), |
| TestDisplayItem(html, DisplayItem::BeginSubsequence), |
| TestDisplayItem(container1, DisplayItem::BeginSubsequence), |
| @@ -324,7 +330,8 @@ TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, CachedSubsequence) |
| compositeForSlimmingPaintV2(); |
| - EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 11, |
| + EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 12, |
| + TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), |
| TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
| TestDisplayItem(html, DisplayItem::BeginSubsequence), |
| TestDisplayItem(container1, DisplayItem::BeginSubsequence), |
| @@ -338,4 +345,65 @@ TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, CachedSubsequence) |
| TestDisplayItem(html, DisplayItem::EndSubsequence)); |
| } |
| +TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, OverflowClipHierarchy) |
| +{ |
| + setBodyInnerHTML( |
| + "<div id='scroller1' style='overflow: hidden; width: 100px; height: 100px;'>" |
| + " <div id='scroller2' style='overflow: hidden; width: 200px; height: 200px;'>" |
| + " normal flow" |
| + " <div id='positioned' style='position:relative; z-index: -1; width: 300px; height: 300px; border: 1px dotted black;'></div>" |
|
pdr.
2015/09/03 06:16:59
Is z-index: -1 needed here?
trchen
2015/09/04 06:10:15
Not important. Removal done.
|
| + " </div>" |
| + "</div>"); |
| + document().view()->updateAllLifecyclePhases(); |
|
pdr.
2015/09/03 06:16:59
This isn't necessary as setBodyInnerHTML (confusin
trchen
2015/09/04 06:10:15
Done.
|
| + |
| + LayoutView& layoutView = *document().layoutView(); |
| + LayoutObject& html = *document().documentElement()->layoutObject(); |
| + LayoutObject& scroller1 = *document().getElementById("scroller1")->layoutObject(); |
| + LayoutObject& scroller2 = *document().getElementById("scroller2")->layoutObject(); |
| + InlineTextBox& normalFlow = *static_cast<LayoutText*>(scroller2.slowFirstChild()->slowFirstChild())->firstTextBox(); |
| + LayoutObject& positioned = *document().getElementById("positioned")->layoutObject(); |
| + |
| + static_cast<LayoutBox&>(scroller1).scrollToOffset(DoubleSize(12, 34)); |
| + static_cast<LayoutBox&>(scroller2).scrollToOffset(DoubleSize(56, 78)); |
| + document().view()->updateAllLifecyclePhases(); |
| + |
| + EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItems(), 32, |
| + TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), |
| + TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
| + TestDisplayItem(html, DisplayItem::BeginSubsequence), |
| + |
| + TestDisplayItem(scroller1, DisplayItem::ClipDescendantStackingContext), |
| + TestDisplayItem(scroller1, DisplayItem::paintPhaseToScrollType(PaintPhaseBlockBackground)), |
| + TestDisplayItem(scroller2, DisplayItem::ClipDescendantStackingContext), |
| + TestDisplayItem(scroller2, DisplayItem::paintPhaseToScrollType(PaintPhaseBlockBackground)), |
| + TestDisplayItem(positioned, DisplayItem::BeginSubsequence), |
| + TestDisplayItem(positioned, DisplayItem::BoxDecorationBackground), |
| + TestDisplayItem(positioned, DisplayItem::EndSubsequence), |
| + TestDisplayItem(scroller2, DisplayItem::scrollTypeToEndScrollType(DisplayItem::paintPhaseToScrollType(PaintPhaseBlockBackground))), |
| + TestDisplayItem(scroller2, DisplayItem::clipTypeToEndClipType(DisplayItem::ClipDescendantStackingContext)), |
| + TestDisplayItem(scroller1, DisplayItem::scrollTypeToEndScrollType(DisplayItem::paintPhaseToScrollType(PaintPhaseBlockBackground))), |
| + TestDisplayItem(scroller1, DisplayItem::clipTypeToEndClipType(DisplayItem::ClipDescendantStackingContext)), |
| + |
| + TestDisplayItem(scroller1, DisplayItem::paintPhaseToClipBoxType(PaintPhaseForeground)), |
| + TestDisplayItem(scroller1, DisplayItem::paintPhaseToScrollType(PaintPhaseForeground)), |
| + TestDisplayItem(scroller2, DisplayItem::paintPhaseToClipBoxType(PaintPhaseForeground)), |
| + TestDisplayItem(scroller2, DisplayItem::paintPhaseToScrollType(PaintPhaseForeground)), |
| + TestDisplayItem(normalFlow, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)), |
| + TestDisplayItem(scroller2, DisplayItem::scrollTypeToEndScrollType(DisplayItem::paintPhaseToScrollType(PaintPhaseForeground))), |
| + TestDisplayItem(scroller2, DisplayItem::clipTypeToEndClipType(DisplayItem::paintPhaseToClipBoxType(PaintPhaseForeground))), |
| + TestDisplayItem(scroller1, DisplayItem::scrollTypeToEndScrollType(DisplayItem::paintPhaseToScrollType(PaintPhaseForeground))), |
| + TestDisplayItem(scroller1, DisplayItem::clipTypeToEndClipType(DisplayItem::paintPhaseToClipBoxType(PaintPhaseForeground))), |
| + |
| + TestDisplayItem(scroller1, DisplayItem::BeginSubsequence), |
| + TestDisplayItem(scroller1, DisplayItem::ClipDescendantStackingContext), |
| + TestDisplayItem(scroller1, DisplayItem::paintPhaseToScrollType(PaintPhaseBlockBackground)), |
| + TestDisplayItem(scroller2, DisplayItem::BeginSubsequence), |
| + TestDisplayItem(scroller2, DisplayItem::EndSubsequence), |
| + TestDisplayItem(scroller1, DisplayItem::scrollTypeToEndScrollType(DisplayItem::paintPhaseToScrollType(PaintPhaseBlockBackground))), |
| + TestDisplayItem(scroller1, DisplayItem::clipTypeToEndClipType(DisplayItem::ClipDescendantStackingContext)), |
| + TestDisplayItem(scroller1, DisplayItem::EndSubsequence), |
| + |
| + TestDisplayItem(html, DisplayItem::EndSubsequence)); |
| +} |
| + |
|
pdr.
2015/09/03 06:16:59
Can you add a second test of the following scenari
trchen
2015/09/04 06:10:15
I ran your test case locally, the drawing display
|
| } // namespace blink |