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/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/PaintLayer.h" | 9 #include "core/paint/PaintLayer.h" |
10 #include "core/paint/PaintPropertyTreePrinter.h" | 10 #include "core/paint/PaintPropertyTreePrinter.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 EXPECT_FALSE(child_paint_layer->NeedsPaintPhaseFloat()); | 254 EXPECT_FALSE(child_paint_layer->NeedsPaintPhaseFloat()); |
255 | 255 |
256 // This changes clips for absolute-positioned descendants of "child" but not | 256 // This changes clips for absolute-positioned descendants of "child" but not |
257 // normal-position ones, which are already clipped to 50x50. | 257 // normal-position ones, which are already clipped to 50x50. |
258 parent->setAttribute(HTMLNames::classAttr, "clip"); | 258 parent->setAttribute(HTMLNames::classAttr, "clip"); |
259 GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint(); | 259 GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint(); |
260 | 260 |
261 EXPECT_TRUE(child_paint_layer->NeedsRepaint()); | 261 EXPECT_TRUE(child_paint_layer->NeedsRepaint()); |
262 } | 262 } |
263 | 263 |
| 264 TEST_P(PrePaintTreeWalkTest, ClipChangeHasRadius) { |
| 265 SetBodyInnerHTML( |
| 266 "<style>" |
| 267 " #target {" |
| 268 " position: absolute;" |
| 269 " z-index: 0;" |
| 270 " overflow: hidden;" |
| 271 " width: 50px;" |
| 272 " height: 50px;" |
| 273 " }" |
| 274 "</style>" |
| 275 "<div id='target'></div>"); |
| 276 |
| 277 auto* target = GetDocument().GetElementById("target"); |
| 278 auto* target_object = ToLayoutBoxModelObject(target->GetLayoutObject()); |
| 279 target->setAttribute(HTMLNames::styleAttr, "border-radius: 5px"); |
| 280 GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint(); |
| 281 EXPECT_TRUE(target_object->Layer()->NeedsRepaint()); |
| 282 // And should not trigger any assert failure. |
| 283 GetDocument().View()->UpdateAllLifecyclePhases(); |
| 284 } |
| 285 |
264 } // namespace blink | 286 } // namespace blink |
OLD | NEW |