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/html/HTMLIFrameElement.h" | 5 #include "core/html/HTMLIFrameElement.h" |
6 #include "core/layout/LayoutTestHelper.h" | 6 #include "core/layout/LayoutTestHelper.h" |
7 #include "core/layout/LayoutTreeAsText.h" | 7 #include "core/layout/LayoutTreeAsText.h" |
8 #include "core/layout/api/LayoutViewItem.h" | 8 #include "core/layout/api/LayoutViewItem.h" |
9 #include "core/paint/ObjectPaintProperties.h" | 9 #include "core/paint/ObjectPaintProperties.h" |
10 #include "core/paint/PaintPropertyTreePrinter.h" | 10 #include "core/paint/PaintPropertyTreePrinter.h" |
(...skipping 3208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3219 div->setAttribute(HTMLNames::styleAttr, "overflow:hidden;"); | 3219 div->setAttribute(HTMLNames::styleAttr, "overflow:hidden;"); |
3220 document().view()->updateAllLifecyclePhases(); | 3220 document().view()->updateAllLifecyclePhases(); |
3221 clipProperties = div->layoutObject()->paintProperties()->overflowClip(); | 3221 clipProperties = div->layoutObject()->paintProperties()->overflowClip(); |
3222 EXPECT_EQ(FloatRect(0, 0, 800, 0), clipProperties->clipRect().rect()); | 3222 EXPECT_EQ(FloatRect(0, 0, 800, 0), clipProperties->clipRect().rect()); |
3223 div->setAttribute(HTMLNames::styleAttr, "overflow:visible;"); | 3223 div->setAttribute(HTMLNames::styleAttr, "overflow:visible;"); |
3224 document().view()->updateAllLifecyclePhases(); | 3224 document().view()->updateAllLifecyclePhases(); |
3225 EXPECT_TRUE(!div->layoutObject()->paintProperties() || | 3225 EXPECT_TRUE(!div->layoutObject()->paintProperties() || |
3226 !div->layoutObject()->paintProperties()->overflowClip()); | 3226 !div->layoutObject()->paintProperties()->overflowClip()); |
3227 } | 3227 } |
3228 | 3228 |
3229 // crbug.com:645667: Contain paint changes fail to update paint properties. | 3229 TEST_P(PaintPropertyTreeBuilderTest, ContainPaintChangesUpdateOverflowClip) { |
3230 TEST_P(PaintPropertyTreeBuilderTest, | |
3231 DISABLED_ContainPaintChangesUpdateOverflowClip) { | |
3232 setBodyInnerHTML( | 3230 setBodyInnerHTML( |
3233 "<style>" | 3231 "<style>" |
3234 " body { margin:0 }" | 3232 " body { margin:0 }" |
3235 " #div { will-change:transform; width:7px; height:6px; }" | 3233 " #div { will-change:transform; width:7px; height:6px; }" |
3236 "</style>" | 3234 "</style>" |
3237 "<div id='div' style='contain:paint;'></div>"); | 3235 "<div id='div' style='contain:paint;'></div>"); |
3238 document().view()->updateAllLifecyclePhases(); | 3236 document().view()->updateAllLifecyclePhases(); |
3239 auto* div = document().getElementById("div"); | 3237 auto* div = document().getElementById("div"); |
3240 auto* properties = div->layoutObject()->paintProperties()->overflowClip(); | 3238 auto* properties = div->layoutObject()->paintProperties()->overflowClip(); |
3241 EXPECT_EQ(FloatRect(0, 0, 7, 6), properties->clipRect().rect()); | 3239 EXPECT_EQ(FloatRect(0, 0, 7, 6), properties->clipRect().rect()); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3277 | 3275 |
3278 auto* iframeContainer = document().getElementById("iframeContainer"); | 3276 auto* iframeContainer = document().getElementById("iframeContainer"); |
3279 iframeContainer->setAttribute(HTMLNames::styleAttr, "visibility: hidden;"); | 3277 iframeContainer->setAttribute(HTMLNames::styleAttr, "visibility: hidden;"); |
3280 frameView->updateAllLifecyclePhases(); | 3278 frameView->updateAllLifecyclePhases(); |
3281 | 3279 |
3282 EXPECT_EQ(nullptr, frameScroll(frameView)); | 3280 EXPECT_EQ(nullptr, frameScroll(frameView)); |
3283 EXPECT_EQ(nullptr, frameScroll(childFrameView)); | 3281 EXPECT_EQ(nullptr, frameScroll(childFrameView)); |
3284 } | 3282 } |
3285 | 3283 |
3286 } // namespace blink | 3284 } // namespace blink |
OLD | NEW |