| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/layout/compositing/CompositedLayerMapping.h" | 5 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 6 #include "core/paint/PaintControllerPaintTest.h" | 6 #include "core/paint/PaintControllerPaintTest.h" |
| 7 #include "platform/graphics/GraphicsContext.h" | 7 #include "platform/graphics/GraphicsContext.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantOutlines()); | 465 EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantOutlines()); |
| 466 EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds()); | 466 EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds()); |
| 467 | 467 |
| 468 toHTMLElement(layerDiv.node())->setAttribute(HTMLNames::styleAttr, "width: 1
00px; height: 100px; overflow: hidden"); | 468 toHTMLElement(layerDiv.node())->setAttribute(HTMLNames::styleAttr, "width: 1
00px; height: 100px; overflow: hidden"); |
| 469 document().view()->updateAllLifecyclePhases(); | 469 document().view()->updateAllLifecyclePhases(); |
| 470 EXPECT_FALSE(layer.isSelfPaintingLayer()); | 470 EXPECT_FALSE(layer.isSelfPaintingLayer()); |
| 471 EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantOutlines()); | 471 EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantOutlines()); |
| 472 EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds()); | 472 EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds()); |
| 473 } | 473 } |
| 474 | 474 |
| 475 TEST_P(PaintLayerPainterTest, TableCollapsedBorderNeedsPaintPhaseDescendantBlock
Backgrounds) |
| 476 { |
| 477 // "position: relative" makes the table and td self-painting layers. |
| 478 // The table's layer should be marked needsPaintPhaseDescendantBlockBackgrou
nd because it |
| 479 // will paint collapsed borders in the phase. |
| 480 setBodyInnerHTML( |
| 481 "<table id='table' style='position: relative; border-collapse: collapse'
>" |
| 482 " <tr><td style='position: relative; border: 1px solid green'>Cell</td>
</tr>" |
| 483 "</table>"); |
| 484 |
| 485 LayoutBlock& table = *toLayoutBlock(getLayoutObjectByElementId("table")); |
| 486 ASSERT_TRUE(table.hasLayer()); |
| 487 PaintLayer& layer = *table.layer(); |
| 488 EXPECT_TRUE(layer.isSelfPaintingLayer()); |
| 489 EXPECT_TRUE(layer.needsPaintPhaseDescendantBlockBackgrounds()); |
| 490 } |
| 491 |
| 492 TEST_P(PaintLayerPainterTest, TableCollapsedBorderNeedsPaintPhaseDescendantBlock
BackgroundsDynamic) |
| 493 { |
| 494 setBodyInnerHTML( |
| 495 "<table id='table' style='position: relative'>" |
| 496 " <tr><td style='position: relative; border: 1px solid green'>Cell</td>
</tr>" |
| 497 "</table>"); |
| 498 |
| 499 LayoutBlock& table = *toLayoutBlock(getLayoutObjectByElementId("table")); |
| 500 ASSERT_TRUE(table.hasLayer()); |
| 501 PaintLayer& layer = *table.layer(); |
| 502 EXPECT_TRUE(layer.isSelfPaintingLayer()); |
| 503 EXPECT_FALSE(layer.needsPaintPhaseDescendantBlockBackgrounds()); |
| 504 |
| 505 toHTMLElement(table.node())->setAttribute(HTMLNames::styleAttr, "position: r
elative; border-collapse: collapse"); |
| 506 document().view()->updateAllLifecyclePhases(); |
| 507 EXPECT_TRUE(layer.needsPaintPhaseDescendantBlockBackgrounds()); |
| 508 } |
| 509 |
| 475 } // namespace blink | 510 } // namespace blink |
| OLD | NEW |