| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/html/HTMLIFrameElement.h" | 5 #include "core/html/HTMLIFrameElement.h" |
| 6 #include "core/paint/PaintPropertyTreeBuilderTest.h" | 6 #include "core/paint/PaintPropertyTreeBuilderTest.h" |
| 7 #include "core/paint/PaintPropertyTreePrinter.h" | 7 #include "core/paint/PaintPropertyTreePrinter.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 auto* clip = getLayoutObjectByElementId("clip"); | 672 auto* clip = getLayoutObjectByElementId("clip"); |
| 673 EXPECT_EQ(FloatRect(45, 50, 105, 100), | 673 EXPECT_EQ(FloatRect(45, 50, 105, 100), |
| 674 clip->paintProperties()->cssClip()->clipRect().rect()); | 674 clip->paintProperties()->cssClip()->clipRect().rect()); |
| 675 | 675 |
| 676 outer->setAttribute(HTMLNames::styleAttr, "height: 200px"); | 676 outer->setAttribute(HTMLNames::styleAttr, "height: 200px"); |
| 677 document().view()->updateAllLifecyclePhases(); | 677 document().view()->updateAllLifecyclePhases(); |
| 678 EXPECT_EQ(FloatRect(45, 50, 105, 200), | 678 EXPECT_EQ(FloatRect(45, 50, 105, 200), |
| 679 clip->paintProperties()->cssClip()->clipRect().rect()); | 679 clip->paintProperties()->cssClip()->clipRect().rect()); |
| 680 } | 680 } |
| 681 | 681 |
| 682 TEST_P(PaintPropertyTreeUpdateTest, ScrollBounds) { |
| 683 setBodyInnerHTML( |
| 684 "<div id='container'" |
| 685 " style='width: 100px; height: 100px; overflow: scroll'>" |
| 686 " <div id='content' style='width: 200px; height: 200px'></div>" |
| 687 "</div>"); |
| 688 |
| 689 auto* container = getLayoutObjectByElementId("container"); |
| 690 auto* scrollNode = |
| 691 container->paintProperties()->scrollTranslation()->scrollNode(); |
| 692 EXPECT_EQ(IntSize(100, 100), scrollNode->clip()); |
| 693 EXPECT_EQ(IntSize(200, 200), scrollNode->bounds()); |
| 694 |
| 695 document().getElementById("content")->setAttribute( |
| 696 HTMLNames::styleAttr, "width: 200px; height: 300px"); |
| 697 document().view()->updateAllLifecyclePhases(); |
| 698 EXPECT_EQ(scrollNode, |
| 699 container->paintProperties()->scrollTranslation()->scrollNode()); |
| 700 EXPECT_EQ(IntSize(100, 100), scrollNode->clip()); |
| 701 EXPECT_EQ(IntSize(200, 300), scrollNode->bounds()); |
| 702 } |
| 703 |
| 682 } // namespace blink | 704 } // namespace blink |
| OLD | NEW |