| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/DisplayItemListPaintTest.h" | 6 #include "core/paint/DisplayItemListPaintTest.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutText.h" | 8 #include "core/layout/LayoutText.h" |
| 9 #include "core/layout/line/InlineTextBox.h" | 9 #include "core/layout/line/InlineTextBox.h" |
| 10 #include "core/page/FocusController.h" | 10 #include "core/page/FocusController.h" |
| 11 #include "core/paint/DeprecatedPaintLayerPainter.h" | 11 #include "core/paint/DeprecatedPaintLayerPainter.h" |
| 12 #include "core/paint/LayerClipRecorder.h" | 12 #include "core/paint/LayerClipRecorder.h" |
| 13 #include "core/paint/LayoutObjectDrawingRecorder.h" | 13 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| 14 #include "core/paint/ScopeRecorder.h" | 14 #include "core/paint/ScopeRecorder.h" |
| 15 #include "platform/graphics/GraphicsContext.h" | 15 #include "platform/graphics/GraphicsContext.h" |
| 16 #include "platform/graphics/paint/DrawingDisplayItem.h" | 16 #include "platform/graphics/paint/DrawingDisplayItem.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 TEST_F(DisplayItemListPaintTest, FullDocumentPaintingWithCaret) | 20 TEST_F(DisplayItemListPaintTest, FullDocumentPaintingWithCaret) |
| 21 { | 21 { |
| 22 setBodyInnerHTML("<div id='div' contentEditable='true' style='outline:none'>
XYZ</div>"); | 22 setBodyInnerHTML("<div id='div' contentEditable='true' style='outline:none'>
XYZ</div>"); |
| 23 document().page()->focusController().setActive(true); | 23 document().page()->focusController().setActive(true); |
| 24 document().page()->focusController().setFocused(true); | 24 document().page()->focusController().setFocused(true); |
| 25 LayoutView& layoutView = *document().layoutView(); | 25 DeprecatedPaintLayer& rootLayer = *layoutView().layer(); |
| 26 DeprecatedPaintLayer& rootLayer = *layoutView.layer(); | |
| 27 Element& div = *toElement(document().body()->firstChild()); | 26 Element& div = *toElement(document().body()->firstChild()); |
| 28 LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObje
ct(); | 27 LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObje
ct(); |
| 29 InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject(
))->firstTextBox(); | 28 InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject(
))->firstTextBox(); |
| 30 | 29 |
| 31 GraphicsContext context(&rootDisplayItemList()); | 30 GraphicsContext context(&rootDisplayItemList()); |
| 32 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 8
00, 600), GlobalPaintNormalPhase, LayoutSize()); | 31 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 8
00, 600), GlobalPaintNormalPhase, LayoutSize()); |
| 33 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); | 32 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); |
| 34 rootDisplayItemList().commitNewDisplayItems(); | 33 rootDisplayItemList().commitNewDisplayItems(); |
| 35 | 34 |
| 36 EXPECT_DISPLAY_LIST_BASE(rootDisplayItemList().displayItems(), 2, | 35 EXPECT_DISPLAY_LIST_BASE(rootDisplayItemList().displayItems(), 2, |
| 37 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 36 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
| 38 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground))); | 37 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground))); |
| 39 | 38 |
| 40 div.focus(); | 39 div.focus(); |
| 41 document().view()->updateAllLifecyclePhases(); | 40 document().view()->updateAllLifecyclePhases(); |
| 42 EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView.displayItemC
lient())); | 41 EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView().displayIte
mClient())); |
| 43 EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divLayoutObject.displa
yItemClient())); | 42 EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divLayoutObject.displa
yItemClient())); |
| 44 EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(textInlineBox.displayIt
emClient())); | 43 EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(textInlineBox.displayIt
emClient())); |
| 45 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); | 44 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); |
| 46 rootDisplayItemList().commitNewDisplayItems(); | 45 rootDisplayItemList().commitNewDisplayItems(); |
| 47 | 46 |
| 48 EXPECT_DISPLAY_LIST_BASE(rootDisplayItemList().displayItems(), 3, | 47 EXPECT_DISPLAY_LIST_BASE(rootDisplayItemList().displayItems(), 3, |
| 49 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 48 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
| 50 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground)), | 49 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground)), |
| 51 TestDisplayItem(divLayoutObject, DisplayItem::Caret)); // New! | 50 TestDisplayItem(divLayoutObject, DisplayItem::Caret)); // New! |
| 52 } | 51 } |
| 53 | 52 |
| 54 TEST_F(DisplayItemListPaintTest, InlineRelayout) | 53 TEST_F(DisplayItemListPaintTest, InlineRelayout) |
| 55 { | 54 { |
| 56 setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAA
A BBBBBBBBBB</div>"); | 55 setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAA
A BBBBBBBBBB</div>"); |
| 57 LayoutView& layoutView = *document().layoutView(); | 56 DeprecatedPaintLayer& rootLayer = *layoutView().layer(); |
| 58 DeprecatedPaintLayer& rootLayer = *layoutView.layer(); | |
| 59 Element& div = *toElement(document().body()->firstChild()); | 57 Element& div = *toElement(document().body()->firstChild()); |
| 60 LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layo
utObject()); | 58 LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layo
utObject()); |
| 61 LayoutText& text = *toLayoutText(divBlock.firstChild()); | 59 LayoutText& text = *toLayoutText(divBlock.firstChild()); |
| 62 InlineTextBox& firstTextBox = *text.firstTextBox(); | 60 InlineTextBox& firstTextBox = *text.firstTextBox(); |
| 63 DisplayItemClient firstTextBoxDisplayItemClient = firstTextBox.displayItemCl
ient(); | 61 DisplayItemClient firstTextBoxDisplayItemClient = firstTextBox.displayItemCl
ient(); |
| 64 | 62 |
| 65 GraphicsContext context(&rootDisplayItemList()); | 63 GraphicsContext context(&rootDisplayItemList()); |
| 66 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 8
00, 600), GlobalPaintNormalPhase, LayoutSize()); | 64 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 8
00, 600), GlobalPaintNormalPhase, LayoutSize()); |
| 67 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); | 65 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); |
| 68 rootDisplayItemList().commitNewDisplayItems(); | 66 rootDisplayItemList().commitNewDisplayItems(); |
| 69 | 67 |
| 70 EXPECT_DISPLAY_LIST_BASE(rootDisplayItemList().displayItems(), 2, | 68 EXPECT_DISPLAY_LIST_BASE(rootDisplayItemList().displayItems(), 2, |
| 71 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 69 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
| 72 TestDisplayItem(firstTextBox, DisplayItem::paintPhaseToDrawingType(Paint
PhaseForeground))); | 70 TestDisplayItem(firstTextBox, DisplayItem::paintPhaseToDrawingType(Paint
PhaseForeground))); |
| 73 | 71 |
| 74 div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px"); | 72 div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px"); |
| 75 document().view()->updateAllLifecyclePhases(); | 73 document().view()->updateAllLifecyclePhases(); |
| 76 EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView.displayItemC
lient())); | 74 EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView().displayIte
mClient())); |
| 77 EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divBlock.displayItemCl
ient())); | 75 EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divBlock.displayItemCl
ient())); |
| 78 EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(firstTextBoxDisplayIte
mClient)); | 76 EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(firstTextBoxDisplayIte
mClient)); |
| 79 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); | 77 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); |
| 80 rootDisplayItemList().commitNewDisplayItems(); | 78 rootDisplayItemList().commitNewDisplayItems(); |
| 81 | 79 |
| 82 LayoutText& newText = *toLayoutText(divBlock.firstChild()); | 80 LayoutText& newText = *toLayoutText(divBlock.firstChild()); |
| 83 InlineTextBox& newFirstTextBox = *newText.firstTextBox(); | 81 InlineTextBox& newFirstTextBox = *newText.firstTextBox(); |
| 84 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); | 82 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); |
| 85 | 83 |
| 86 EXPECT_DISPLAY_LIST_BASE(rootDisplayItemList().displayItems(), 3, | 84 EXPECT_DISPLAY_LIST_BASE(rootDisplayItemList().displayItems(), 3, |
| 87 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 85 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
| 88 TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(Pa
intPhaseForeground)), | 86 TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(Pa
intPhaseForeground)), |
| 89 TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground))); | 87 TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground))); |
| 90 } | 88 } |
| 91 | 89 |
| 92 TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, FullDocumentPaintingWithCaret
) | 90 TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, FullDocumentPaintingWithCaret
) |
| 93 { | 91 { |
| 94 setBodyInnerHTML("<div id='div' contentEditable='true' style='outline:none'>
XYZ</div>"); | 92 setBodyInnerHTML("<div id='div' contentEditable='true' style='outline:none'>
XYZ</div>"); |
| 95 document().page()->focusController().setActive(true); | 93 document().page()->focusController().setActive(true); |
| 96 document().page()->focusController().setFocused(true); | 94 document().page()->focusController().setFocused(true); |
| 97 LayoutView& layoutView = *document().layoutView(); | |
| 98 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); | 95 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); |
| 99 Element& div = *toElement(document().body()->firstChild()); | 96 Element& div = *toElement(document().body()->firstChild()); |
| 100 LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObje
ct(); | 97 LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObje
ct(); |
| 101 InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject(
))->firstTextBox(); | 98 InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject(
))->firstTextBox(); |
| 102 | 99 |
| 103 document().view()->updateAllLifecyclePhases(); | 100 document().view()->updateAllLifecyclePhases(); |
| 104 | 101 |
| 105 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem
s(), 4, | 102 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem
s(), 4, |
| 106 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 103 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
| 107 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 104 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
| 108 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground)), | 105 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground)), |
| 109 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 106 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
| 110 | 107 |
| 111 div.focus(); | 108 div.focus(); |
| 112 document().view()->updateAllLifecyclePhases(); | 109 document().view()->updateAllLifecyclePhases(); |
| 113 | 110 |
| 114 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem
s(), 5, | 111 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem
s(), 5, |
| 115 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 112 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
| 116 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 113 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
| 117 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground)), | 114 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground)), |
| 118 TestDisplayItem(divLayoutObject, DisplayItem::Caret), // New! | 115 TestDisplayItem(divLayoutObject, DisplayItem::Caret), // New! |
| 119 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 116 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
| 120 } | 117 } |
| 121 | 118 |
| 122 TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, InlineRelayout) | 119 TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, InlineRelayout) |
| 123 { | 120 { |
| 124 setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAA
A BBBBBBBBBB</div>"); | 121 setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAA
A BBBBBBBBBB</div>"); |
| 125 LayoutView& layoutView = *document().layoutView(); | |
| 126 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); | 122 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); |
| 127 Element& div = *toElement(document().body()->firstChild()); | 123 Element& div = *toElement(document().body()->firstChild()); |
| 128 LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layo
utObject()); | 124 LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layo
utObject()); |
| 129 LayoutText& text = *toLayoutText(divBlock.firstChild()); | 125 LayoutText& text = *toLayoutText(divBlock.firstChild()); |
| 130 InlineTextBox& firstTextBox = *text.firstTextBox(); | 126 InlineTextBox& firstTextBox = *text.firstTextBox(); |
| 131 | 127 |
| 132 document().view()->updateAllLifecyclePhases(); | 128 document().view()->updateAllLifecyclePhases(); |
| 133 | 129 |
| 134 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem
s(), 4, | 130 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem
s(), 4, |
| 135 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 131 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
| 136 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 132 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
| 137 TestDisplayItem(firstTextBox, DisplayItem::paintPhaseToDrawingType(Paint
PhaseForeground)), | 133 TestDisplayItem(firstTextBox, DisplayItem::paintPhaseToDrawingType(Paint
PhaseForeground)), |
| 138 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 134 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
| 139 | 135 |
| 140 div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px"); | 136 div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px"); |
| 141 document().view()->updateAllLifecyclePhases(); | 137 document().view()->updateAllLifecyclePhases(); |
| 142 | 138 |
| 143 LayoutText& newText = *toLayoutText(divBlock.firstChild()); | 139 LayoutText& newText = *toLayoutText(divBlock.firstChild()); |
| 144 InlineTextBox& newFirstTextBox = *newText.firstTextBox(); | 140 InlineTextBox& newFirstTextBox = *newText.firstTextBox(); |
| 145 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); | 141 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); |
| 146 | 142 |
| 147 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem
s(), 5, | 143 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem
s(), 5, |
| 148 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 144 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
| 149 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 145 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
| 150 TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(Pa
intPhaseForeground)), | 146 TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(Pa
intPhaseForeground)), |
| 151 TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground)), | 147 TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground)), |
| 152 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 148 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
| 153 } | 149 } |
| 154 | 150 |
| 155 TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, CachedSubsequence) | 151 TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, CachedSubsequence) |
| 156 { | 152 { |
| 157 setBodyInnerHTML( | 153 setBodyInnerHTML( |
| 158 "<div id='container1' style='position: relative; width: 200px; height: 2
00px; background-color: blue'>" | 154 "<div id='container1' style='position: relative; width: 200px; height: 2
00px; background-color: blue'>" |
| 159 " <div id='content1' style='width: 100px; height: 100px; background-col
or: red'></div>" | 155 " <div id='content1' style='width: 100px; height: 100px; background-col
or: red'></div>" |
| 160 "</div>" | 156 "</div>" |
| 161 "<div id='container2' style='position: relative; width: 200px; height: 2
00px; background-color: blue'>" | 157 "<div id='container2' style='position: relative; width: 200px; height: 2
00px; background-color: blue'>" |
| 162 " <div id='content2' style='width: 100px; height: 100px; background-col
or: green'></div>" | 158 " <div id='content2' style='width: 100px; height: 100px; background-col
or: green'></div>" |
| 163 "</div>"); | 159 "</div>"); |
| 164 document().view()->updateAllLifecyclePhases(); | 160 document().view()->updateAllLifecyclePhases(); |
| 165 | 161 |
| 166 LayoutView& layoutView = *document().layoutView(); | |
| 167 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); | 162 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); |
| 168 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); | 163 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); |
| 169 DeprecatedPaintLayer& container1Layer = *toLayoutBoxModelObject(container1).
layer(); | 164 DeprecatedPaintLayer& container1Layer = *toLayoutBoxModelObject(container1).
layer(); |
| 170 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec
t(); | 165 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec
t(); |
| 171 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); | 166 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); |
| 172 DeprecatedPaintLayer& container2Layer = *toLayoutBoxModelObject(container2).
layer(); | 167 DeprecatedPaintLayer& container2Layer = *toLayoutBoxModelObject(container2).
layer(); |
| 173 LayoutObject& content2 = *document().getElementById("content2")->layoutObjec
t(); | 168 LayoutObject& content2 = *document().getElementById("content2")->layoutObjec
t(); |
| 174 | 169 |
| 175 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem
s(), 11, | 170 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem
s(), 11, |
| 176 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 171 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
| 177 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 172 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
| 178 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 173 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), |
| 179 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 174 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), |
| 180 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 175 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), |
| 181 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 176 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), |
| 182 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 177 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), |
| 183 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 178 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), |
| 184 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), | 179 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), |
| 185 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 180 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), |
| 186 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 181 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
| 187 | 182 |
| 188 toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "width: 1
00px; height: 100px; background-color: green"); | 183 toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "width: 1
00px; height: 100px; background-color: green"); |
| 189 updateLifecyclePhasesToPaintForSlimmingPaintV2Clean(); | 184 updateLifecyclePhasesToPaintForSlimmingPaintV2Clean(); |
| 190 | 185 |
| 191 EXPECT_DISPLAY_LIST_WITH_CACHED_RED_FILL_IN_DEBUG(newDisplayItemsBeforeUpdat
e(), 8, | 186 EXPECT_DISPLAY_LIST_WITH_CACHED_RED_FILL_IN_DEBUG(rootDisplayItemList().newD
isplayItems(), 8, |
| 192 TestDisplayItem(layoutView, DisplayItem::drawingTypeToCachedDrawingType(
DisplayItem::BoxDecorationBackground)), | 187 TestDisplayItem(layoutView(), DisplayItem::drawingTypeToCachedDrawingTyp
e(DisplayItem::BoxDecorationBackground)), |
| 193 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 188 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
| 194 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 189 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), |
| 195 TestDisplayItem(container1, DisplayItem::drawingTypeToCachedDrawingType(
DisplayItem::BoxDecorationBackground)), | 190 TestDisplayItem(container1, DisplayItem::drawingTypeToCachedDrawingType(
DisplayItem::BoxDecorationBackground)), |
| 196 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 191 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), |
| 197 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 192 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), |
| 198 TestDisplayItem(container2Layer, DisplayItem::CachedSubsequence), | 193 TestDisplayItem(container2Layer, DisplayItem::CachedSubsequence), |
| 199 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 194 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
| 200 | 195 |
| 201 compositeForSlimmingPaintV2(); | 196 compositeForSlimmingPaintV2(); |
| 202 | 197 |
| 203 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem
s(), 11, | 198 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem
s(), 11, |
| 204 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 199 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), |
| 205 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 200 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
| 206 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 201 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), |
| 207 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 202 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), |
| 208 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 203 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), |
| 209 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 204 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), |
| 210 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 205 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), |
| 211 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 206 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), |
| 212 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), | 207 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), |
| 213 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 208 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), |
| 214 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 209 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
| 215 } | 210 } |
| 216 | 211 |
| 217 } // namespace blink | 212 } // namespace blink |
| OLD | NEW |