Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/frame/FrameView.h" | 5 #include "core/frame/FrameView.h" |
| 6 #include "core/layout/LayoutTestHelper.h" | 6 #include "core/layout/LayoutTestHelper.h" |
| 7 #include "core/layout/LayoutView.h" | 7 #include "core/layout/LayoutView.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 | 45 |
| 46 Element* container = document().getElementById("container"); | 46 Element* container = document().getElementById("container"); |
| 47 container->setAttribute(HTMLNames::styleAttr, | 47 container->setAttribute(HTMLNames::styleAttr, |
| 48 "transform: translateY(1000px);"); | 48 "transform: translateY(1000px);"); |
| 49 document().updateStyleAndLayoutTree(); | 49 document().updateStyleAndLayoutTree(); |
| 50 | 50 |
| 51 EXPECT_EQ(scrollableArea->maximumScrollOffset().height(), 1000); | 51 EXPECT_EQ(scrollableArea->maximumScrollOffset().height(), 1000); |
| 52 EXPECT_TRUE(document().layoutView()->mayNeedPaintInvalidation()); | 52 EXPECT_TRUE(document().layoutView()->mayNeedPaintInvalidation()); |
| 53 } | 53 } |
| 54 | 54 |
| 55 TEST_F(PaintInvalidationTest, UpdateVisualRectOnFrameBorderWidthChange) { | |
| 56 setBodyInnerHTML( | |
|
chrishtr
2017/03/06 22:44:27
if (REF::rootLayerScrollingEnabled())
return
?
Xianzhu
2017/03/07 00:22:08
This test should still pass for rootLayerScrolling
| |
| 57 "<style>" | |
| 58 " body { margin: 0 }" | |
| 59 " iframe { width: 100px; height: 100px; border: none; }" | |
| 60 "</style>" | |
| 61 "<iframe id='iframe'></iframe>"); | |
| 62 | |
| 63 Element* iframe = document().getElementById("iframe"); | |
| 64 LayoutView* childLayoutView = childDocument().layoutView(); | |
| 65 EXPECT_EQ(LayoutRect(0, 0, 100, 100), childLayoutView->visualRect()); | |
| 66 | |
| 67 iframe->setAttribute(HTMLNames::styleAttr, "border: 20px solid blue"); | |
| 68 document().view()->updateAllLifecyclePhases(); | |
| 69 EXPECT_EQ(LayoutRect(20, 20, 100, 100), childLayoutView->visualRect()); | |
| 70 }; | |
| 71 | |
| 55 } // namespace | 72 } // namespace |
| 56 | 73 |
| 57 } // namespace blink | 74 } // namespace blink |
| OLD | NEW |