| 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/paint/PaintLayerScrollableArea.h" | 5 #include "core/paint/PaintLayerScrollableArea.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/layout/LayoutBoxModelObject.h" | 8 #include "core/layout/LayoutBoxModelObject.h" |
| 9 #include "core/layout/LayoutTestHelper.h" | 9 #include "core/layout/LayoutTestHelper.h" |
| 10 #include "core/paint/PaintLayer.h" | 10 #include "core/paint/PaintLayer.h" |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 "<div id=\"scroller\"><div id=\"scrolled\"></div></div>"); | 508 "<div id=\"scroller\"><div id=\"scrolled\"></div></div>"); |
| 509 GetDocument().View()->UpdateAllLifecyclePhases(); | 509 GetDocument().View()->UpdateAllLifecyclePhases(); |
| 510 | 510 |
| 511 Element* scroller = GetDocument().GetElementById("scroller"); | 511 Element* scroller = GetDocument().GetElementById("scroller"); |
| 512 PaintLayer* paint_layer = | 512 PaintLayer* paint_layer = |
| 513 ToLayoutBoxModelObject(scroller->GetLayoutObject())->Layer(); | 513 ToLayoutBoxModelObject(scroller->GetLayoutObject())->Layer(); |
| 514 ASSERT_TRUE(paint_layer); | 514 ASSERT_TRUE(paint_layer); |
| 515 EXPECT_TRUE(paint_layer->NeedsCompositedScrolling()); | 515 EXPECT_TRUE(paint_layer->NeedsCompositedScrolling()); |
| 516 | 516 |
| 517 // Add clip to scroller. | 517 // Add clip to scroller. |
| 518 scroller->setAttribute("class", "clip", ASSERT_NO_EXCEPTION); | 518 scroller->setAttribute(HTMLNames::classAttr, "clip"); |
| 519 GetDocument().View()->UpdateAllLifecyclePhases(); | 519 GetDocument().View()->UpdateAllLifecyclePhases(); |
| 520 paint_layer = ToLayoutBoxModelObject(scroller->GetLayoutObject())->Layer(); | 520 paint_layer = ToLayoutBoxModelObject(scroller->GetLayoutObject())->Layer(); |
| 521 ASSERT_TRUE(paint_layer); | 521 ASSERT_TRUE(paint_layer); |
| 522 EXPECT_FALSE(paint_layer->NeedsCompositedScrolling()); | 522 EXPECT_FALSE(paint_layer->NeedsCompositedScrolling()); |
| 523 | 523 |
| 524 // Change the scroller to be auto clipped again. | 524 // Change the scroller to be auto clipped again. |
| 525 scroller->removeAttribute("class"); | 525 scroller->removeAttribute("class"); |
| 526 GetDocument().View()->UpdateAllLifecyclePhases(); | 526 GetDocument().View()->UpdateAllLifecyclePhases(); |
| 527 paint_layer = ToLayoutBoxModelObject(scroller->GetLayoutObject())->Layer(); | 527 paint_layer = ToLayoutBoxModelObject(scroller->GetLayoutObject())->Layer(); |
| 528 ASSERT_TRUE(paint_layer); | 528 ASSERT_TRUE(paint_layer); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 "</div>"); | 622 "</div>"); |
| 623 GetDocument().View()->UpdateAllLifecyclePhases(); | 623 GetDocument().View()->UpdateAllLifecyclePhases(); |
| 624 Element* container = GetDocument().GetElementById("container"); | 624 Element* container = GetDocument().GetElementById("container"); |
| 625 ASSERT_TRUE(container); | 625 ASSERT_TRUE(container); |
| 626 PaintLayerScrollableArea* scrollable_area = | 626 PaintLayerScrollableArea* scrollable_area = |
| 627 ToLayoutBoxModelObject(container->GetLayoutObject())->GetScrollableArea(); | 627 ToLayoutBoxModelObject(container->GetLayoutObject())->GetScrollableArea(); |
| 628 ASSERT_TRUE(scrollable_area); | 628 ASSERT_TRUE(scrollable_area); |
| 629 EXPECT_FALSE(scrollable_area->HasHorizontalScrollbar()); | 629 EXPECT_FALSE(scrollable_area->HasHorizontalScrollbar()); |
| 630 } | 630 } |
| 631 } | 631 } |
| OLD | NEW |