Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Side by Side Diff: Source/core/rendering/RenderListBox.cpp

Issue 65573002: Remove Scrollbar dependency on AXObjectCache (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/rendering/RenderLayerScrollableArea.cpp ('k') | Source/web/ScrollbarGroup.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerScrollableArea.cpp ('k') | Source/web/ScrollbarGroup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698