| 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/api/LayoutViewItem.h" | 7 #include "core/layout/api/LayoutViewItem.h" |
| 8 #include "core/paint/ObjectPaintProperties.h" | 8 #include "core/paint/ObjectPaintProperties.h" |
| 9 #include "core/paint/PaintPropertyTreePrinter.h" | 9 #include "core/paint/PaintPropertyTreePrinter.h" |
| 10 #include "platform/graphics/paint/GeometryMapper.h" | 10 #include "platform/graphics/paint/GeometryMapper.h" |
| (...skipping 2911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2922 EXPECT_TRUE(childLayoutView->descendantNeedsPaintPropertyUpdate()); | 2922 EXPECT_TRUE(childLayoutView->descendantNeedsPaintPropertyUpdate()); |
| 2923 EXPECT_TRUE(innerDivWithTransform->needsPaintPropertyUpdate()); | 2923 EXPECT_TRUE(innerDivWithTransform->needsPaintPropertyUpdate()); |
| 2924 EXPECT_FALSE(innerDivWithTransform->descendantNeedsPaintPropertyUpdate()); | 2924 EXPECT_FALSE(innerDivWithTransform->descendantNeedsPaintPropertyUpdate()); |
| 2925 | 2925 |
| 2926 // After a lifecycle update, no nodes should need a descendant update. | 2926 // After a lifecycle update, no nodes should need a descendant update. |
| 2927 frameView->updateAllLifecyclePhases(); | 2927 frameView->updateAllLifecyclePhases(); |
| 2928 EXPECT_FALSE(document().layoutView()->descendantNeedsPaintPropertyUpdate()); | 2928 EXPECT_FALSE(document().layoutView()->descendantNeedsPaintPropertyUpdate()); |
| 2929 EXPECT_FALSE(divWithTransform->descendantNeedsPaintPropertyUpdate()); | 2929 EXPECT_FALSE(divWithTransform->descendantNeedsPaintPropertyUpdate()); |
| 2930 EXPECT_FALSE(childLayoutView->descendantNeedsPaintPropertyUpdate()); | 2930 EXPECT_FALSE(childLayoutView->descendantNeedsPaintPropertyUpdate()); |
| 2931 EXPECT_FALSE(innerDivWithTransform->descendantNeedsPaintPropertyUpdate()); | 2931 EXPECT_FALSE(innerDivWithTransform->descendantNeedsPaintPropertyUpdate()); |
| 2932 |
| 2933 // A child frame marked as needing a paint property update should not be |
| 2934 // skipped if the owning layout tree does not need an update. |
| 2935 FrameView* childFrameView = childDocument().view(); |
| 2936 childFrameView->setNeedsPaintPropertyUpdate(); |
| 2937 EXPECT_TRUE(document().layoutView()->descendantNeedsPaintPropertyUpdate()); |
| 2938 frameView->updateAllLifecyclePhases(); |
| 2939 EXPECT_FALSE(document().layoutView()->descendantNeedsPaintPropertyUpdate()); |
| 2940 EXPECT_FALSE(frameView->needsPaintPropertyUpdate()); |
| 2941 EXPECT_FALSE(childFrameView->needsPaintPropertyUpdate()); |
| 2932 } | 2942 } |
| 2933 | 2943 |
| 2934 TEST_P(PaintPropertyTreeBuilderTest, UpdatingFrameViewContentClip) { | 2944 TEST_P(PaintPropertyTreeBuilderTest, UpdatingFrameViewContentClip) { |
| 2935 setBodyInnerHTML("hello world."); | 2945 setBodyInnerHTML("hello world."); |
| 2936 EXPECT_EQ(FloatRoundedRect(0, 0, 800, 600), frameContentClip()->clipRect()); | 2946 EXPECT_EQ(FloatRoundedRect(0, 0, 800, 600), frameContentClip()->clipRect()); |
| 2937 document().view()->resize(800, 599); | 2947 document().view()->resize(800, 599); |
| 2938 document().view()->updateAllLifecyclePhases(); | 2948 document().view()->updateAllLifecyclePhases(); |
| 2939 EXPECT_EQ(FloatRoundedRect(0, 0, 800, 599), frameContentClip()->clipRect()); | 2949 EXPECT_EQ(FloatRoundedRect(0, 0, 800, 599), frameContentClip()->clipRect()); |
| 2940 document().view()->resize(800, 600); | 2950 document().view()->resize(800, 600); |
| 2941 document().view()->updateAllLifecyclePhases(); | 2951 document().view()->updateAllLifecyclePhases(); |
| 2942 EXPECT_EQ(FloatRoundedRect(0, 0, 800, 600), frameContentClip()->clipRect()); | 2952 EXPECT_EQ(FloatRoundedRect(0, 0, 800, 600), frameContentClip()->clipRect()); |
| 2943 document().view()->resize(5, 5); | 2953 document().view()->resize(5, 5); |
| 2944 document().view()->updateAllLifecyclePhases(); | 2954 document().view()->updateAllLifecyclePhases(); |
| 2945 EXPECT_EQ(FloatRoundedRect(0, 0, 5, 5), frameContentClip()->clipRect()); | 2955 EXPECT_EQ(FloatRoundedRect(0, 0, 5, 5), frameContentClip()->clipRect()); |
| 2946 } | 2956 } |
| 2947 | 2957 |
| 2948 } // namespace blink | 2958 } // namespace blink |
| OLD | NEW |