OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 return IntSize(); | 781 return IntSize(); |
782 } | 782 } |
783 | 783 |
784 PassRefPtr<Scrollbar> RenderLayerScrollableArea::createScrollbar(ScrollbarOrient
ation orientation) | 784 PassRefPtr<Scrollbar> RenderLayerScrollableArea::createScrollbar(ScrollbarOrient
ation orientation) |
785 { | 785 { |
786 RefPtr<Scrollbar> widget = Scrollbar::create(this, orientation); | 786 RefPtr<Scrollbar> widget = Scrollbar::create(this, orientation); |
787 if (orientation == HorizontalScrollbar) | 787 if (orientation == HorizontalScrollbar) |
788 didAddScrollbar(widget.get(), HorizontalScrollbar); | 788 didAddScrollbar(widget.get(), HorizontalScrollbar); |
789 else | 789 else |
790 didAddScrollbar(widget.get(), VerticalScrollbar); | 790 didAddScrollbar(widget.get(), VerticalScrollbar); |
791 box().document().view()->addChild(widget.get()); | |
792 return widget.release(); | 791 return widget.release(); |
793 } | 792 } |
794 | 793 |
795 void RenderLayerScrollableArea::destroyScrollbar(ScrollbarOrientation orientatio
n) | 794 void RenderLayerScrollableArea::destroyScrollbar(ScrollbarOrientation orientatio
n) |
796 { | 795 { |
797 RefPtr<Scrollbar>& scrollbar = orientation == HorizontalScrollbar ? m_hBar :
m_vBar; | 796 RefPtr<Scrollbar>& scrollbar = orientation == HorizontalScrollbar ? m_hBar :
m_vBar; |
798 if (!scrollbar) | 797 if (!scrollbar) |
799 return; | 798 return; |
800 | 799 |
801 if (!scrollbar->isCustomScrollbar()) | 800 if (!scrollbar->isCustomScrollbar()) |
802 willRemoveScrollbar(scrollbar.get(), orientation); | 801 willRemoveScrollbar(scrollbar.get(), orientation); |
803 | 802 |
804 scrollbar->removeFromParent(); | |
805 scrollbar->disconnectFromScrollableArea(); | 803 scrollbar->disconnectFromScrollableArea(); |
806 scrollbar = nullptr; | 804 scrollbar = nullptr; |
807 } | 805 } |
808 | 806 |
809 void RenderLayerScrollableArea::setHasHorizontalScrollbar(bool hasScrollbar) | 807 void RenderLayerScrollableArea::setHasHorizontalScrollbar(bool hasScrollbar) |
810 { | 808 { |
811 if (hasScrollbar == hasHorizontalScrollbar()) | 809 if (hasScrollbar == hasHorizontalScrollbar()) |
812 return; | 810 return; |
813 | 811 |
814 if (hasScrollbar) { | 812 if (hasScrollbar) { |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) | 1318 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) |
1321 { | 1319 { |
1322 // We only want to track the topmost scroll child for scrollable areas with | 1320 // We only want to track the topmost scroll child for scrollable areas with |
1323 // overlay scrollbars. | 1321 // overlay scrollbars. |
1324 if (!hasOverlayScrollbars()) | 1322 if (!hasOverlayScrollbars()) |
1325 return; | 1323 return; |
1326 m_nextTopmostScrollChild = scrollChild; | 1324 m_nextTopmostScrollChild = scrollChild; |
1327 } | 1325 } |
1328 | 1326 |
1329 } // namespace blink | 1327 } // namespace blink |
OLD | NEW |