| 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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 document().view()->updateAllLifecyclePhases(); | 589 document().view()->updateAllLifecyclePhases(); |
| 590 Element* outerDiv = document().getElementById("outerDiv"); | 590 Element* outerDiv = document().getElementById("outerDiv"); |
| 591 ASSERT_TRUE(outerDiv); | 591 ASSERT_TRUE(outerDiv); |
| 592 outerDiv->layoutObject()->setNeedsLayout("test"); | 592 outerDiv->layoutObject()->setNeedsLayout("test"); |
| 593 document().view()->updateAllLifecyclePhases(); | 593 document().view()->updateAllLifecyclePhases(); |
| 594 PaintLayerScrollableArea* scrollableArea = | 594 PaintLayerScrollableArea* scrollableArea = |
| 595 toLayoutBoxModelObject(outerDiv->layoutObject())->getScrollableArea(); | 595 toLayoutBoxModelObject(outerDiv->layoutObject())->getScrollableArea(); |
| 596 ASSERT_TRUE(scrollableArea); | 596 ASSERT_TRUE(scrollableArea); |
| 597 EXPECT_TRUE(scrollableArea->hasVerticalScrollbar()); | 597 EXPECT_TRUE(scrollableArea->hasVerticalScrollbar()); |
| 598 } | 598 } |
| 599 |
| 600 TEST_F(PaintLayerScrollableAreaTest, FloatOverflowInRtlContainer) { |
| 601 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(false); |
| 602 setBodyInnerHTML( |
| 603 "<!DOCTYPE html>" |
| 604 "<style>" |
| 605 "#container {" |
| 606 " width: 200px;" |
| 607 " overflow-x: auto;" |
| 608 " overflow-y: scroll;" |
| 609 " direction: rtl;" |
| 610 "}" |
| 611 "</style>" |
| 612 "<div id='container'>" |
| 613 " <div style='float:left'>" |
| 614 "lorem ipsum" |
| 615 " </div>" |
| 616 "</div>"); |
| 617 document().view()->updateAllLifecyclePhases(); |
| 618 Element* container = document().getElementById("container"); |
| 619 ASSERT_TRUE(container); |
| 620 PaintLayerScrollableArea* scrollableArea = |
| 621 toLayoutBoxModelObject(container->layoutObject())->getScrollableArea(); |
| 622 ASSERT_TRUE(scrollableArea); |
| 623 EXPECT_FALSE(scrollableArea->hasHorizontalScrollbar()); |
| 599 } | 624 } |
| 625 } |
| OLD | NEW |