| 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/LayoutTestHelper.h" | 5 #include "core/layout/LayoutTestHelper.h" |
| 6 #include "core/layout/LayoutTreeAsText.h" | 6 #include "core/layout/LayoutTreeAsText.h" |
| 7 #include "core/layout/LayoutView.h" | 7 #include "core/layout/LayoutView.h" |
| 8 #include "core/paint/ObjectPaintProperties.h" | 8 #include "core/paint/ObjectPaintProperties.h" |
| 9 #include "platform/graphics/paint/TransformPaintPropertyNode.h" | 9 #include "platform/graphics/paint/TransformPaintPropertyNode.h" |
| 10 #include "platform/testing/UnitTestHelpers.h" | 10 #include "platform/testing/UnitTestHelpers.h" |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 LayoutObject& scroller = *document().getElementById("scroller")->layoutObjec
t(); | 672 LayoutObject& scroller = *document().getElementById("scroller")->layoutObjec
t(); |
| 673 ObjectPaintProperties* scrollerProperties = scroller.objectPaintProperties()
; | 673 ObjectPaintProperties* scrollerProperties = scroller.objectPaintProperties()
; |
| 674 LayoutObject& child = *document().getElementById("child")->layoutObject(); | 674 LayoutObject& child = *document().getElementById("child")->layoutObject(); |
| 675 ObjectPaintProperties* childProperties = child.objectPaintProperties(); | 675 ObjectPaintProperties* childProperties = child.objectPaintProperties(); |
| 676 | 676 |
| 677 EXPECT_EQ(frameView->contentClip(), childProperties->localBorderBoxPropertie
s()->clip); | 677 EXPECT_EQ(frameView->contentClip(), childProperties->localBorderBoxPropertie
s()->clip); |
| 678 EXPECT_EQ(frameView->scrollTranslation(), childProperties->localBorderBoxPro
perties()->transform); | 678 EXPECT_EQ(frameView->scrollTranslation(), childProperties->localBorderBoxPro
perties()->transform); |
| 679 EXPECT_EQ(scrollerProperties->effect(), childProperties->localBorderBoxPrope
rties()->effect); | 679 EXPECT_EQ(scrollerProperties->effect(), childProperties->localBorderBoxPrope
rties()->effect); |
| 680 } | 680 } |
| 681 | 681 |
| 682 TEST_F(PaintPropertyTreeBuilderTest, TableCellLayoutLocation) |
| 683 { |
| 684 // This test verifies that the border box space of a table cell is being cor
rectly computed. |
| 685 // Table cells have weird location adjustment in our layout/paint implementa
tion. |
| 686 setBodyInnerHTML( |
| 687 "<style>" |
| 688 " body {" |
| 689 " margin: 0;" |
| 690 " }" |
| 691 " table {" |
| 692 " border-spacing: 0;" |
| 693 " margin: 20px;" |
| 694 " padding: 40px;" |
| 695 " border: 10px solid black;" |
| 696 " }" |
| 697 " td {" |
| 698 " width: 100px;" |
| 699 " height: 100px;" |
| 700 " padding: 0;" |
| 701 " }" |
| 702 " #target {" |
| 703 " position: relative;" |
| 704 " width: 100px;" |
| 705 " height: 100px;" |
| 706 " }" |
| 707 "</style>" |
| 708 "<table>" |
| 709 " <tr><td></td><td></td></tr>" |
| 710 " <tr><td></td><td><div id='target'></div></td></tr>" |
| 711 "</table>" |
| 712 ); |
| 713 |
| 714 FrameView* frameView = document().view(); |
| 715 LayoutObject& target = *document().getElementById("target")->layoutObject(); |
| 716 ObjectPaintProperties* targetProperties = target.objectPaintProperties(); |
| 717 |
| 718 EXPECT_EQ(LayoutPoint(170, 170), targetProperties->localBorderBoxProperties(
)->paintOffset); |
| 719 EXPECT_EQ(frameView->scrollTranslation(), targetProperties->localBorderBoxPr
operties()->transform); |
| 720 } |
| 721 |
| 682 } // namespace blink | 722 } // namespace blink |
| OLD | NEW |