| 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/LayoutBlock.h" | 5 #include "core/layout/LayoutBlock.h" |
| 6 #include "core/layout/LayoutInline.h" | 6 #include "core/layout/LayoutInline.h" |
| 7 #include "core/layout/compositing/CompositedLayerMapping.h" | 7 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 8 #include "core/paint/PaintControllerPaintTest.h" | 8 #include "core/paint/PaintControllerPaintTest.h" |
| 9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
| 10 | 10 |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantOutlines()); | 496 EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantOutlines()); |
| 497 EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds()); | 497 EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds()); |
| 498 | 498 |
| 499 toHTMLElement(layerDiv.node())->setAttribute(HTMLNames::styleAttr, "width: 1
00px; height: 100px; overflow: hidden"); | 499 toHTMLElement(layerDiv.node())->setAttribute(HTMLNames::styleAttr, "width: 1
00px; height: 100px; overflow: hidden"); |
| 500 document().view()->updateAllLifecyclePhases(); | 500 document().view()->updateAllLifecyclePhases(); |
| 501 EXPECT_FALSE(layer.isSelfPaintingLayer()); | 501 EXPECT_FALSE(layer.isSelfPaintingLayer()); |
| 502 EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantOutlines()); | 502 EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantOutlines()); |
| 503 EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds()); | 503 EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds()); |
| 504 } | 504 } |
| 505 | 505 |
| 506 TEST_P(PaintLayerPainterTest, TableCollapsedBorderNeedsPaintPhaseDescendantBlock
Backgrounds) |
| 507 { |
| 508 // "position: relative" makes the table and td self-painting layers. |
| 509 // The table's layer should be marked needsPaintPhaseDescendantBlockBackgrou
nd because it |
| 510 // will paint collapsed borders in the phase. |
| 511 setBodyInnerHTML( |
| 512 "<table id='table' style='position: relative; border-collapse: collapse'
>" |
| 513 " <tr><td style='position: relative; border: 1px solid green'>Cell</td>
</tr>" |
| 514 "</table>"); |
| 515 |
| 516 LayoutBlock& table = *toLayoutBlock(getLayoutObjectByElementId("table")); |
| 517 ASSERT_TRUE(table.hasLayer()); |
| 518 PaintLayer& layer = *table.layer(); |
| 519 EXPECT_TRUE(layer.isSelfPaintingLayer()); |
| 520 EXPECT_TRUE(layer.needsPaintPhaseDescendantBlockBackgrounds()); |
| 521 } |
| 522 |
| 523 TEST_P(PaintLayerPainterTest, TableCollapsedBorderNeedsPaintPhaseDescendantBlock
BackgroundsDynamic) |
| 524 { |
| 525 setBodyInnerHTML( |
| 526 "<table id='table' style='position: relative'>" |
| 527 " <tr><td style='position: relative; border: 1px solid green'>Cell</td>
</tr>" |
| 528 "</table>"); |
| 529 |
| 530 LayoutBlock& table = *toLayoutBlock(getLayoutObjectByElementId("table")); |
| 531 ASSERT_TRUE(table.hasLayer()); |
| 532 PaintLayer& layer = *table.layer(); |
| 533 EXPECT_TRUE(layer.isSelfPaintingLayer()); |
| 534 EXPECT_FALSE(layer.needsPaintPhaseDescendantBlockBackgrounds()); |
| 535 |
| 536 toHTMLElement(table.node())->setAttribute(HTMLNames::styleAttr, "position: r
elative; border-collapse: collapse"); |
| 537 document().view()->updateAllLifecyclePhases(); |
| 538 EXPECT_TRUE(layer.needsPaintPhaseDescendantBlockBackgrounds()); |
| 539 } |
| 540 |
| 506 } // namespace blink | 541 } // namespace blink |
| OLD | NEW |