| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 } | 888 } |
| 889 | 889 |
| 890 PassRefPtr<Scrollbar> RenderListBox::createScrollbar() | 890 PassRefPtr<Scrollbar> RenderListBox::createScrollbar() |
| 891 { | 891 { |
| 892 RefPtr<Scrollbar> widget; | 892 RefPtr<Scrollbar> widget; |
| 893 bool hasCustomScrollbarStyle = style()->hasPseudoStyle(SCROLLBAR); | 893 bool hasCustomScrollbarStyle = style()->hasPseudoStyle(SCROLLBAR); |
| 894 if (hasCustomScrollbarStyle) | 894 if (hasCustomScrollbarStyle) |
| 895 widget = RenderScrollbar::createCustomScrollbar(this, VerticalScrollbar,
this->node()); | 895 widget = RenderScrollbar::createCustomScrollbar(this, VerticalScrollbar,
this->node()); |
| 896 else { | 896 else { |
| 897 widget = Scrollbar::create(this, VerticalScrollbar, RenderTheme::theme()
.scrollbarControlSizeForPart(ListboxPart)); | 897 widget = Scrollbar::create(this, VerticalScrollbar, RenderTheme::theme()
.scrollbarControlSizeForPart(ListboxPart)); |
| 898 didAddVerticalScrollbar(widget.get()); | 898 didAddScrollbar(widget.get(), VerticalScrollbar); |
| 899 } | 899 } |
| 900 document().view()->addChild(widget.get()); | 900 document().view()->addChild(widget.get()); |
| 901 return widget.release(); | 901 return widget.release(); |
| 902 } | 902 } |
| 903 | 903 |
| 904 void RenderListBox::destroyScrollbar() | 904 void RenderListBox::destroyScrollbar() |
| 905 { | 905 { |
| 906 if (!m_vBar) | 906 if (!m_vBar) |
| 907 return; | 907 return; |
| 908 | 908 |
| 909 if (!m_vBar->isCustomScrollbar()) | 909 if (!m_vBar->isCustomScrollbar()) |
| 910 ScrollableArea::willRemoveVerticalScrollbar(m_vBar.get()); | 910 ScrollableArea::willRemoveScrollbar(m_vBar.get(), VerticalScrollbar); |
| 911 m_vBar->removeFromParent(); | 911 m_vBar->removeFromParent(); |
| 912 m_vBar->disconnectFromScrollableArea(); | 912 m_vBar->disconnectFromScrollableArea(); |
| 913 m_vBar = 0; | 913 m_vBar = 0; |
| 914 } | 914 } |
| 915 | 915 |
| 916 void RenderListBox::setHasVerticalScrollbar(bool hasScrollbar) | 916 void RenderListBox::setHasVerticalScrollbar(bool hasScrollbar) |
| 917 { | 917 { |
| 918 if (hasScrollbar == (m_vBar != 0)) | 918 if (hasScrollbar == (m_vBar != 0)) |
| 919 return; | 919 return; |
| 920 | 920 |
| 921 if (hasScrollbar) | 921 if (hasScrollbar) |
| 922 m_vBar = createScrollbar(); | 922 m_vBar = createScrollbar(); |
| 923 else | 923 else |
| 924 destroyScrollbar(); | 924 destroyScrollbar(); |
| 925 | 925 |
| 926 if (m_vBar) | 926 if (m_vBar) |
| 927 m_vBar->styleChanged(); | 927 m_vBar->styleChanged(); |
| 928 | 928 |
| 929 // Force an update since we know the scrollbars have changed things. | 929 // Force an update since we know the scrollbars have changed things. |
| 930 if (document().hasAnnotatedRegions()) | 930 if (document().hasAnnotatedRegions()) |
| 931 document().setAnnotatedRegionsDirty(true); | 931 document().setAnnotatedRegionsDirty(true); |
| 932 } | 932 } |
| 933 | 933 |
| 934 } // namespace WebCore | 934 } // namespace WebCore |
| OLD | NEW |