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 "platform/graphics/paint/DisplayItemList.h" | 6 #include "platform/graphics/paint/DisplayItemList.h" |
7 | 7 |
8 #include "core/layout/LayoutTestHelper.h" | 8 #include "core/layout/LayoutTestHelper.h" |
9 #include "core/layout/LayoutText.h" | 9 #include "core/layout/LayoutText.h" |
10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 document().page()->focusController().setActive(true); | 221 document().page()->focusController().setActive(true); |
222 document().page()->focusController().setFocused(true); | 222 document().page()->focusController().setFocused(true); |
223 LayoutView& layoutView = *document().layoutView(); | 223 LayoutView& layoutView = *document().layoutView(); |
224 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen tElement()->layoutObject())->layer(); | 224 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen tElement()->layoutObject())->layer(); |
225 Element& div = *toElement(document().body()->firstChild()); | 225 Element& div = *toElement(document().body()->firstChild()); |
226 LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObje ct(); | 226 LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObje ct(); |
227 InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject( ))->firstTextBox(); | 227 InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject( ))->firstTextBox(); |
228 | 228 |
229 document().view()->updateAllLifecyclePhases(); | 229 document().view()->updateAllLifecyclePhases(); |
230 | 230 |
231 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 4, | 231 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 5, |
232 TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), | |
232 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 233 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
233 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 234 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
234 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground)), | 235 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground)), |
235 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 236 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
236 | 237 |
237 div.focus(); | 238 div.focus(); |
238 document().view()->updateAllLifecyclePhases(); | 239 document().view()->updateAllLifecyclePhases(); |
239 | 240 |
240 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 5, | 241 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 6, |
242 TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), | |
241 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 243 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
242 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 244 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
243 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground)), | 245 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground)), |
244 TestDisplayItem(divLayoutObject, DisplayItem::Caret), // New! | 246 TestDisplayItem(divLayoutObject, DisplayItem::Caret), // New! |
245 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 247 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
246 } | 248 } |
247 | 249 |
248 TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, InlineRelayout) | 250 TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, InlineRelayout) |
249 { | 251 { |
250 setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAA A BBBBBBBBBB</div>"); | 252 setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAA A BBBBBBBBBB</div>"); |
251 LayoutView& layoutView = *document().layoutView(); | 253 LayoutView& layoutView = *document().layoutView(); |
252 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen tElement()->layoutObject())->layer(); | 254 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen tElement()->layoutObject())->layer(); |
253 Element& div = *toElement(document().body()->firstChild()); | 255 Element& div = *toElement(document().body()->firstChild()); |
254 LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layo utObject()); | 256 LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layo utObject()); |
255 LayoutText& text = *toLayoutText(divBlock.firstChild()); | 257 LayoutText& text = *toLayoutText(divBlock.firstChild()); |
256 InlineTextBox& firstTextBox = *text.firstTextBox(); | 258 InlineTextBox& firstTextBox = *text.firstTextBox(); |
257 | 259 |
258 document().view()->updateAllLifecyclePhases(); | 260 document().view()->updateAllLifecyclePhases(); |
259 | 261 |
260 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 4, | 262 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 5, |
263 TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), | |
261 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 264 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
262 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 265 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
263 TestDisplayItem(firstTextBox, DisplayItem::paintPhaseToDrawingType(Paint PhaseForeground)), | 266 TestDisplayItem(firstTextBox, DisplayItem::paintPhaseToDrawingType(Paint PhaseForeground)), |
264 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 267 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
265 | 268 |
266 div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px"); | 269 div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px"); |
267 document().view()->updateAllLifecyclePhases(); | 270 document().view()->updateAllLifecyclePhases(); |
268 | 271 |
269 LayoutText& newText = *toLayoutText(divBlock.firstChild()); | 272 LayoutText& newText = *toLayoutText(divBlock.firstChild()); |
270 InlineTextBox& newFirstTextBox = *newText.firstTextBox(); | 273 InlineTextBox& newFirstTextBox = *newText.firstTextBox(); |
271 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); | 274 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); |
272 | 275 |
273 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 5, | 276 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 6, |
277 TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), | |
274 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 278 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
275 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 279 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
276 TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(Pa intPhaseForeground)), | 280 TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(Pa intPhaseForeground)), |
277 TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground)), | 281 TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground)), |
278 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 282 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
279 } | 283 } |
280 | 284 |
281 TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, CachedSubsequence) | 285 TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, CachedSubsequence) |
282 { | 286 { |
283 setBodyInnerHTML( | 287 setBodyInnerHTML( |
284 "<div id='container1' style='position: relative; width: 200px; height: 2 00px; background-color: blue'>" | 288 "<div id='container1' style='position: relative; width: 200px; height: 2 00px; background-color: blue'>" |
285 " <div id='content1' style='width: 100px; height: 100px; background-col or: red'></div>" | 289 " <div id='content1' style='width: 100px; height: 100px; background-col or: red'></div>" |
286 "</div>" | 290 "</div>" |
287 "<div id='container2' style='position: relative; width: 200px; height: 2 00px; background-color: blue'>" | 291 "<div id='container2' style='position: relative; width: 200px; height: 2 00px; background-color: blue'>" |
288 " <div id='content2' style='width: 100px; height: 100px; background-col or: green'></div>" | 292 " <div id='content2' style='width: 100px; height: 100px; background-col or: green'></div>" |
289 "</div>"); | 293 "</div>"); |
290 document().view()->updateAllLifecyclePhases(); | 294 document().view()->updateAllLifecyclePhases(); |
291 | 295 |
292 LayoutView& layoutView = *document().layoutView(); | 296 LayoutView& layoutView = *document().layoutView(); |
293 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen tElement()->layoutObject())->layer(); | 297 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen tElement()->layoutObject())->layer(); |
294 LayoutObject& container1 = *document().getElementById("container1")->layoutO bject(); | 298 LayoutObject& container1 = *document().getElementById("container1")->layoutO bject(); |
295 DeprecatedPaintLayer& container1Layer = *toLayoutBoxModelObject(container1). layer(); | 299 DeprecatedPaintLayer& container1Layer = *toLayoutBoxModelObject(container1). layer(); |
296 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec t(); | 300 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec t(); |
297 LayoutObject& container2 = *document().getElementById("container2")->layoutO bject(); | 301 LayoutObject& container2 = *document().getElementById("container2")->layoutO bject(); |
298 DeprecatedPaintLayer& container2Layer = *toLayoutBoxModelObject(container2). layer(); | 302 DeprecatedPaintLayer& container2Layer = *toLayoutBoxModelObject(container2). layer(); |
299 LayoutObject& content2 = *document().getElementById("content2")->layoutObjec t(); | 303 LayoutObject& content2 = *document().getElementById("content2")->layoutObjec t(); |
300 | 304 |
301 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 11, | 305 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 12, |
306 TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), | |
302 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 307 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
303 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 308 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
304 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 309 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), |
305 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 310 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), |
306 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 311 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), |
307 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 312 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), |
308 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 313 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), |
309 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 314 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), |
310 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), | 315 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), |
311 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 316 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), |
312 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 317 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
313 | 318 |
314 toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "width: 1 00px; height: 100px; background-color: green"); | 319 toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "width: 1 00px; height: 100px; background-color: green"); |
315 updateLifecyclePhasesToPaintForSlimmingPaintV2Clean(); | 320 updateLifecyclePhasesToPaintForSlimmingPaintV2Clean(); |
316 | 321 |
317 EXPECT_DISPLAY_LIST_WITH_CACHED_RED_FILL_IN_DEBUG(newDisplayItemsBeforeUpdat e(), 8, | 322 EXPECT_DISPLAY_LIST_WITH_CACHED_RED_FILL_IN_DEBUG(newDisplayItemsBeforeUpdat e(), 9, |
323 TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), | |
318 TestDisplayItem(layoutView, DisplayItem::drawingTypeToCachedDrawingType( DisplayItem::BoxDecorationBackground)), | 324 TestDisplayItem(layoutView, DisplayItem::drawingTypeToCachedDrawingType( DisplayItem::BoxDecorationBackground)), |
319 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 325 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
320 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 326 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), |
321 TestDisplayItem(container1, DisplayItem::drawingTypeToCachedDrawingType( DisplayItem::BoxDecorationBackground)), | 327 TestDisplayItem(container1, DisplayItem::drawingTypeToCachedDrawingType( DisplayItem::BoxDecorationBackground)), |
322 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 328 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), |
323 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 329 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), |
324 TestDisplayItem(container2Layer, DisplayItem::CachedSubsequence), | 330 TestDisplayItem(container2Layer, DisplayItem::CachedSubsequence), |
325 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 331 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
326 | 332 |
327 compositeForSlimmingPaintV2(); | 333 compositeForSlimmingPaintV2(); |
328 | 334 |
329 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 11, | 335 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 12, |
336 TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), | |
330 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 337 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
331 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 338 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), |
332 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 339 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), |
333 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 340 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), |
334 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 341 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), |
335 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 342 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), |
336 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 343 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), |
337 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 344 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), |
338 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), | 345 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), |
339 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 346 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), |
340 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | 347 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); |
341 } | 348 } |
342 | 349 |
350 TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, OverflowClipHierarchy) | |
pdr.
2015/09/08 04:23:54
If you'd like to keep the fixed position code in t
| |
351 { | |
352 setBodyInnerHTML( | |
353 "<div id='scroller1' style='overflow: hidden; width: 100px; height: 100p x;'>" | |
354 " <div id='scroller2' style='overflow: hidden; width: 200px; height: 20 0px;'>" | |
355 " normal flow" | |
356 " <div id='positioned' style='position:relative; width: 300px; height : 300px; border: 1px dotted black;'></div>" | |
357 " </div>" | |
358 "</div>"); | |
359 | |
360 LayoutView& layoutView = *document().layoutView(); | |
361 LayoutObject& html = *document().documentElement()->layoutObject(); | |
362 DeprecatedPaintLayer& htmlLayer = *static_cast<LayoutBoxModelObject&>(html). layer(); | |
363 LayoutObject& scroller1 = *document().getElementById("scroller1")->layoutObj ect(); | |
364 DeprecatedPaintLayer& scroller1Layer = *static_cast<LayoutBoxModelObject&>(s croller1).layer(); | |
365 LayoutObject& scroller2 = *document().getElementById("scroller2")->layoutObj ect(); | |
366 DeprecatedPaintLayer& scroller2Layer = *static_cast<LayoutBoxModelObject&>(s croller2).layer(); | |
367 InlineTextBox& normalFlow = *static_cast<LayoutText*>(scroller2.slowFirstChi ld()->slowFirstChild())->firstTextBox(); | |
368 LayoutObject& positioned = *document().getElementById("positioned")->layoutO bject(); | |
369 DeprecatedPaintLayer& positionedLayer = *static_cast<LayoutBoxModelObject&>( positioned).layer(); | |
370 | |
371 static_cast<LayoutBox&>(scroller1).scrollToOffset(DoubleSize(12, 34)); | |
372 static_cast<LayoutBox&>(scroller2).scrollToOffset(DoubleSize(56, 78)); | |
373 document().view()->updateAllLifecyclePhases(); | |
374 | |
375 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 32, | |
376 TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), | |
377 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | |
378 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | |
379 | |
380 TestDisplayItem(scroller1, DisplayItem::paintPhaseToClipBoxType(Pain tPhaseForeground)), | |
381 TestDisplayItem(scroller1, DisplayItem::paintPhaseToScrollType(P aintPhaseForeground)), | |
382 TestDisplayItem(scroller2, DisplayItem::paintPhaseToClipBoxT ype(PaintPhaseForeground)), | |
383 TestDisplayItem(scroller2, DisplayItem::paintPhaseToScro llType(PaintPhaseForeground)), | |
384 TestDisplayItem(normalFlow, DisplayItem::paintPhaseT oDrawingType(PaintPhaseForeground)), | |
385 TestDisplayItem(scroller2, DisplayItem::scrollTypeToEndS crollType(DisplayItem::paintPhaseToScrollType(PaintPhaseForeground))), | |
386 TestDisplayItem(scroller2, DisplayItem::clipTypeToEndClipTyp e(DisplayItem::paintPhaseToClipBoxType(PaintPhaseForeground))), | |
387 TestDisplayItem(scroller1, DisplayItem::scrollTypeToEndScrollTyp e(DisplayItem::paintPhaseToScrollType(PaintPhaseForeground))), | |
388 TestDisplayItem(scroller1, DisplayItem::clipTypeToEndClipType(Displa yItem::paintPhaseToClipBoxType(PaintPhaseForeground))), | |
389 | |
390 TestDisplayItem(scroller1Layer, DisplayItem::BeginSubsequence), | |
391 TestDisplayItem(scroller1, DisplayItem::ClipDescendantStackingCo ntext), | |
392 TestDisplayItem(scroller1, DisplayItem::paintPhaseToScrollTy pe(PaintPhaseBlockBackground)), | |
393 TestDisplayItem(scroller2Layer, DisplayItem::BeginSubseq uence), | |
394 TestDisplayItem(scroller2Layer, DisplayItem::EndSubseque nce), | |
395 TestDisplayItem(scroller1, DisplayItem::scrollTypeToEndScrol lType(DisplayItem::paintPhaseToScrollType(PaintPhaseBlockBackground))), | |
396 TestDisplayItem(scroller1, DisplayItem::clipTypeToEndClipType(Di splayItem::ClipDescendantStackingContext)), | |
397 TestDisplayItem(scroller1Layer, DisplayItem::EndSubsequence), | |
398 | |
399 TestDisplayItem(scroller1, DisplayItem::ClipDescendantStackingContex t), | |
400 TestDisplayItem(scroller1, DisplayItem::paintPhaseToScrollType(P aintPhaseBlockBackground)), | |
401 TestDisplayItem(scroller2, DisplayItem::ClipDescendantStacki ngContext), | |
402 TestDisplayItem(scroller2, DisplayItem::paintPhaseToScro llType(PaintPhaseBlockBackground)), | |
403 TestDisplayItem(positionedLayer, DisplayItem::BeginS ubsequence), | |
404 TestDisplayItem(positioned, DisplayItem::BoxDeco rationBackground), | |
405 TestDisplayItem(positionedLayer, DisplayItem::EndSub sequence), | |
406 TestDisplayItem(scroller2, DisplayItem::scrollTypeToEndS crollType(DisplayItem::paintPhaseToScrollType(PaintPhaseBlockBackground))), | |
407 TestDisplayItem(scroller2, DisplayItem::clipTypeToEndClipTyp e(DisplayItem::ClipDescendantStackingContext)), | |
408 TestDisplayItem(scroller1, DisplayItem::scrollTypeToEndScrollTyp e(DisplayItem::paintPhaseToScrollType(PaintPhaseBlockBackground))), | |
409 TestDisplayItem(scroller1, DisplayItem::clipTypeToEndClipType(Displa yItem::ClipDescendantStackingContext)), | |
410 | |
411 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | |
412 } | |
413 | |
414 TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, OverflowClipHierarchyPhaseInt erleave) | |
415 { | |
416 setBodyInnerHTML( | |
417 "<div id='scroller1' style='overflow: hidden; width: 100px; height: 100p x;'>" | |
418 " <div id='scroller2' style='overflow: hidden; width: 200px; height: 20 0px;'>" | |
419 " <div id='multi-phase' style='width: 300px; height: 300px; backgroun d: green; outline: 1px dotted black;'></div>" | |
420 " </div>" | |
421 "</div>" | |
422 "<div id='interleave' style='float: right; width: 300px; height: 300px; background-color: blue;'></div>"); | |
423 | |
424 LayoutView& layoutView = *document().layoutView(); | |
425 LayoutObject& html = *document().documentElement()->layoutObject(); | |
426 DeprecatedPaintLayer& htmlLayer = *static_cast<LayoutBoxModelObject&>(html). layer(); | |
427 LayoutObject& scroller1 = *document().getElementById("scroller1")->layoutObj ect(); | |
428 LayoutObject& scroller2 = *document().getElementById("scroller2")->layoutObj ect(); | |
429 LayoutObject& multiPhase = *document().getElementById("multi-phase")->layout Object(); | |
430 LayoutObject& interleave = *document().getElementById("interleave")->layoutO bject(); | |
431 | |
432 static_cast<LayoutBox&>(scroller1).scrollToOffset(DoubleSize(12, 34)); | |
433 static_cast<LayoutBox&>(scroller2).scrollToOffset(DoubleSize(56, 78)); | |
434 document().view()->updateAllLifecyclePhases(); | |
435 | |
436 EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG(rootDisplayItemList().displayItem s(), 23, | |
437 TestDisplayItem(layoutView, DisplayItem::FixedPositionContainer), | |
438 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | |
439 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | |
440 | |
441 TestDisplayItem(scroller1, DisplayItem::paintPhaseToClipBoxType(Pain tPhaseChildBlockBackgrounds)), | |
442 TestDisplayItem(scroller1, DisplayItem::paintPhaseToScrollType(P aintPhaseChildBlockBackgrounds)), | |
443 TestDisplayItem(scroller2, DisplayItem::paintPhaseToClipBoxT ype(PaintPhaseChildBlockBackgrounds)), | |
444 TestDisplayItem(scroller2, DisplayItem::paintPhaseToScro llType(PaintPhaseChildBlockBackgrounds)), | |
445 TestDisplayItem(multiPhase, DisplayItem::BoxDecorati onBackground), | |
446 TestDisplayItem(scroller2, DisplayItem::scrollTypeToEndS crollType(DisplayItem::paintPhaseToScrollType(PaintPhaseChildBlockBackgrounds))) , | |
447 TestDisplayItem(scroller2, DisplayItem::clipTypeToEndClipTyp e(DisplayItem::paintPhaseToClipBoxType(PaintPhaseChildBlockBackgrounds))), | |
448 TestDisplayItem(scroller1, DisplayItem::scrollTypeToEndScrollTyp e(DisplayItem::paintPhaseToScrollType(PaintPhaseChildBlockBackgrounds))), | |
449 TestDisplayItem(scroller1, DisplayItem::clipTypeToEndClipType(Displa yItem::paintPhaseToClipBoxType(PaintPhaseChildBlockBackgrounds))), | |
450 | |
451 TestDisplayItem(interleave, DisplayItem::BoxDecorationBackground), | |
452 | |
453 TestDisplayItem(scroller1, DisplayItem::paintPhaseToClipBoxType(Pain tPhaseChildOutlines)), | |
454 TestDisplayItem(scroller1, DisplayItem::paintPhaseToScrollType(P aintPhaseChildOutlines)), | |
455 TestDisplayItem(scroller2, DisplayItem::paintPhaseToClipBoxT ype(PaintPhaseChildOutlines)), | |
456 TestDisplayItem(scroller2, DisplayItem::paintPhaseToScro llType(PaintPhaseChildOutlines)), | |
457 TestDisplayItem(multiPhase, DisplayItem::paintPhaseT oDrawingType(PaintPhaseSelfOutline)), | |
458 TestDisplayItem(scroller2, DisplayItem::scrollTypeToEndS crollType(DisplayItem::paintPhaseToScrollType(PaintPhaseChildOutlines))), | |
459 TestDisplayItem(scroller2, DisplayItem::clipTypeToEndClipTyp e(DisplayItem::paintPhaseToClipBoxType(PaintPhaseChildOutlines))), | |
460 TestDisplayItem(scroller1, DisplayItem::scrollTypeToEndScrollTyp e(DisplayItem::paintPhaseToScrollType(PaintPhaseChildOutlines))), | |
461 TestDisplayItem(scroller1, DisplayItem::clipTypeToEndClipType(Displa yItem::paintPhaseToClipBoxType(PaintPhaseChildOutlines))), | |
462 | |
463 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence)); | |
464 } | |
465 | |
343 } // namespace blink | 466 } // namespace blink |
OLD | NEW |