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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 GetDocument().View()->UpdateAllLifecyclePhases(); | 329 GetDocument().View()->UpdateAllLifecyclePhases(); |
330 | 330 |
331 // In SPv2 mode, VisualRects are in the space of the containing transform | 331 // In SPv2 mode, VisualRects are in the space of the containing transform |
332 // node without applying any ancestor property nodes, including clip. | 332 // node without applying any ancestor property nodes, including clip. |
333 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 333 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
334 EXPECT_EQ(200, grandchild->VisualRect().Height()); | 334 EXPECT_EQ(200, grandchild->VisualRect().Height()); |
335 else | 335 else |
336 EXPECT_EQ(75, grandchild->VisualRect().Height()); | 336 EXPECT_EQ(75, grandchild->VisualRect().Height()); |
337 } | 337 } |
338 | 338 |
| 339 TEST_P(PrePaintTreeWalkTest, ClipChangeHasRadius) { |
| 340 SetBodyInnerHTML( |
| 341 "<style>" |
| 342 " #target {" |
| 343 " position: absolute;" |
| 344 " z-index: 0;" |
| 345 " overflow: hidden;" |
| 346 " width: 50px;" |
| 347 " height: 50px;" |
| 348 " }" |
| 349 "</style>" |
| 350 "<div id='target'></div>"); |
| 351 |
| 352 auto* target = GetDocument().GetElementById("target"); |
| 353 auto* target_object = ToLayoutBoxModelObject(target->GetLayoutObject()); |
| 354 target->setAttribute(HTMLNames::styleAttr, "border-radius: 5px"); |
| 355 GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint(); |
| 356 EXPECT_TRUE(target_object->Layer()->NeedsRepaint()); |
| 357 // And should not trigger any assert failure. |
| 358 GetDocument().View()->UpdateAllLifecyclePhases(); |
| 359 } |
| 360 |
339 } // namespace blink | 361 } // namespace blink |
OLD | NEW |