Index: third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.cpp |
diff --git a/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.cpp b/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.cpp |
index b2f5309a7c47d6ed764e225b98e4a5c8efeeb177..b9532fa4289c9a3d075909aee9bb7ff9793be509 100644 |
--- a/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.cpp |
+++ b/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.cpp |
@@ -31,8 +31,8 @@ TEST_F(DisplayItemListPaintTest, FullDocumentPaintingWithCaret) |
rootDisplayItemList().commitNewDisplayItems(); |
EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2, |
- TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
- TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground))); |
+ TestDisplayItem(layoutView(), backgroundType), |
+ TestDisplayItem(textInlineBox, foregroundType)); |
div.focus(); |
document().view()->updateAllLifecyclePhases(); |
@@ -43,8 +43,8 @@ TEST_F(DisplayItemListPaintTest, FullDocumentPaintingWithCaret) |
rootDisplayItemList().commitNewDisplayItems(); |
EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3, |
- TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
- TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)), |
+ TestDisplayItem(layoutView(), backgroundType), |
+ TestDisplayItem(textInlineBox, foregroundType), |
TestDisplayItem(divLayoutObject, DisplayItem::Caret)); // New! |
} |
@@ -64,8 +64,8 @@ TEST_F(DisplayItemListPaintTest, InlineRelayout) |
rootDisplayItemList().commitNewDisplayItems(); |
EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2, |
- TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
- TestDisplayItem(firstTextBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground))); |
+ TestDisplayItem(layoutView(), backgroundType), |
+ TestDisplayItem(firstTextBox, foregroundType)); |
div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px"); |
document().view()->updateAllLifecyclePhases(); |
@@ -80,9 +80,9 @@ TEST_F(DisplayItemListPaintTest, InlineRelayout) |
InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); |
EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3, |
- TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
- TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)), |
- TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground))); |
+ TestDisplayItem(layoutView(), backgroundType), |
+ TestDisplayItem(newFirstTextBox, foregroundType), |
+ TestDisplayItem(secondTextBox, foregroundType)); |
} |
TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, FullDocumentPaintingWithCaret) |
@@ -91,52 +91,45 @@ TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, FullDocumentPaintingWithCaret |
document().page()->focusController().setActive(true); |
document().page()->focusController().setFocused(true); |
DeprecatedPaintLayer& rootLayer = *layoutView().layer(); |
- DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documentElement()->layoutObject())->layer(); |
Element& div = *toElement(document().body()->firstChild()); |
LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObject(); |
InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject())->firstTextBox(); |
document().view()->updateAllLifecyclePhases(); |
- EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 6, |
- TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), |
- TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
- TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
- TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)), |
- TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), |
- TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); |
+ EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 4, |
+ TestDisplayItem(layoutView(), backgroundType), |
+ TestDisplayItem(rootLayer, subsequenceType), |
+ TestDisplayItem(textInlineBox, foregroundType), |
+ TestDisplayItem(rootLayer, endSubsequenceType)); |
div.focus(); |
document().view()->updateAllLifecyclePhases(); |
- EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 7, |
- TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), |
- TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
- TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
- TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)), |
+ EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 5, |
+ TestDisplayItem(layoutView(), backgroundType), |
+ TestDisplayItem(rootLayer, subsequenceType), |
+ TestDisplayItem(textInlineBox, foregroundType), |
TestDisplayItem(divLayoutObject, DisplayItem::Caret), // New! |
- TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), |
- TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); |
+ TestDisplayItem(rootLayer, endSubsequenceType)); |
} |
TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, InlineRelayout) |
{ |
setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAAA BBBBBBBBBB</div>"); |
DeprecatedPaintLayer& rootLayer = *layoutView().layer(); |
- DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documentElement()->layoutObject())->layer(); |
Element& div = *toElement(document().body()->firstChild()); |
LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layoutObject()); |
LayoutText& text = *toLayoutText(divBlock.firstChild()); |
InlineTextBox& firstTextBox = *text.firstTextBox(); |
document().view()->updateAllLifecyclePhases(); |
- EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 6, |
- TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), |
- TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
- TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
- TestDisplayItem(firstTextBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)), |
- TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), |
- TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); |
+ |
+ EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 4, |
+ TestDisplayItem(layoutView(), backgroundType), |
+ TestDisplayItem(rootLayer, subsequenceType), |
+ TestDisplayItem(firstTextBox, foregroundType), |
+ TestDisplayItem(rootLayer, endSubsequenceType)); |
div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px"); |
document().view()->updateAllLifecyclePhases(); |
@@ -145,14 +138,12 @@ TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, InlineRelayout) |
InlineTextBox& newFirstTextBox = *newText.firstTextBox(); |
InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); |
- EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 7, |
- TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), |
- TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
- TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
- TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)), |
- TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)), |
- TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), |
- TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); |
+ EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 5, |
+ TestDisplayItem(layoutView(), backgroundType), |
+ TestDisplayItem(rootLayer, subsequenceType), |
+ TestDisplayItem(newFirstTextBox, foregroundType), |
+ TestDisplayItem(secondTextBox, foregroundType), |
+ TestDisplayItem(rootLayer, endSubsequenceType)); |
} |
} // namespace blink |