Chromium Code Reviews| 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 331 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), |
| 332 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 332 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), |
| 333 TestDisplayItem(container1, DisplayItem::EndSubsequence), | 333 TestDisplayItem(container1, DisplayItem::EndSubsequence), |
| 334 TestDisplayItem(container2, DisplayItem::BeginSubsequence), | 334 TestDisplayItem(container2, DisplayItem::BeginSubsequence), |
| 335 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 335 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), |
| 336 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), | 336 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), |
| 337 TestDisplayItem(container2, DisplayItem::EndSubsequence), | 337 TestDisplayItem(container2, DisplayItem::EndSubsequence), |
| 338 TestDisplayItem(html, DisplayItem::EndSubsequence)); | 338 TestDisplayItem(html, DisplayItem::EndSubsequence)); |
| 339 } | 339 } |
| 340 | 340 |
| 341 // TODO(wangxianzhu): Create a version for slimming paint v2 when it supports in terest rect | |
| 342 TEST_F(DisplayItemListPaintTest, TableCellBackgroundInterestRect) | |
|
chrishtr
2015/09/03 17:25:34
Put this in a new TableCellTest?
Xianzhu
2015/09/04 16:52:56
Done.
| |
| 343 { | |
| 344 setBodyInnerHTML( | |
| 345 "<style>" | |
| 346 " td { width: 200px; height: 200px; border: none; }" | |
| 347 " tr { background-color: blue; }" | |
| 348 " table { border: none; border-spacing: 0; border-collapse: collapse; } " | |
| 349 "</style>" | |
| 350 "<table>" | |
| 351 " <tr><td id='cell1'></td></tr>" | |
| 352 " <tr><td id='cell2'></td></tr>" | |
| 353 "</table>"); | |
| 354 | |
| 355 LayoutView& layoutView = *document().layoutView(); | |
| 356 DeprecatedPaintLayer& rootLayer = *layoutView.layer(); | |
| 357 LayoutObject& cell1 = *document().getElementById("cell1")->layoutObject(); | |
| 358 LayoutObject& cell2 = *document().getElementById("cell2")->layoutObject(); | |
| 359 | |
| 360 GraphicsContext context(&rootDisplayItemList()); | |
| 361 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 2 00, 200), GlobalPaintNormalPhase, LayoutSize()); | |
| 362 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting Info, PaintLayerPaintingCompositingAllPhases); | |
| 363 rootDisplayItemList().commitNewDisplayItems(); | |
| 364 | |
| 365 EXPECT_DISPLAY_LIST_BASE(rootDisplayItemList().displayItems(), 2, | |
| 366 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | |
| 367 TestDisplayItem(cell1, DisplayItem::TableCellBackgroundFromContainers)); | |
| 368 | |
| 369 DeprecatedPaintLayerPaintingInfo paintingInfo1(&rootLayer, LayoutRect(0, 300 , 200, 200), GlobalPaintNormalPhase, LayoutSize()); | |
| 370 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting Info1, PaintLayerPaintingCompositingAllPhases); | |
| 371 rootDisplayItemList().commitNewDisplayItems(); | |
| 372 | |
| 373 EXPECT_DISPLAY_LIST_BASE(rootDisplayItemList().displayItems(), 2, | |
| 374 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | |
| 375 TestDisplayItem(cell2, DisplayItem::TableCellBackgroundFromContainers)); | |
| 376 } | |
| 377 | |
| 341 } // namespace blink | 378 } // namespace blink |
| OLD | NEW |