Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * Other contributors: | 7 * Other contributors: |
| 8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 10 * Christian Biesinger <cbiesinger@gmail.com> | 10 * Christian Biesinger <cbiesinger@gmail.com> |
| (...skipping 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1984 } else { | 1984 } else { |
| 1985 ScrollbarControlSize scrollbar_size = kRegularScrollbar; | 1985 ScrollbarControlSize scrollbar_size = kRegularScrollbar; |
| 1986 if (style_source.StyleRef().HasAppearance()) { | 1986 if (style_source.StyleRef().HasAppearance()) { |
| 1987 scrollbar_size = LayoutTheme::GetTheme().ScrollbarControlSizeForPart( | 1987 scrollbar_size = LayoutTheme::GetTheme().ScrollbarControlSizeForPart( |
| 1988 style_source.StyleRef().Appearance()); | 1988 style_source.StyleRef().Appearance()); |
| 1989 } | 1989 } |
| 1990 scrollbar = Scrollbar::Create( | 1990 scrollbar = Scrollbar::Create( |
| 1991 ScrollableArea(), orientation, scrollbar_size, | 1991 ScrollableArea(), orientation, scrollbar_size, |
| 1992 &ScrollableArea()->Box().GetFrame()->GetPage()->GetChromeClient()); | 1992 &ScrollableArea()->Box().GetFrame()->GetPage()->GetChromeClient()); |
| 1993 } | 1993 } |
| 1994 ScrollableArea()->Box().GetDocument().View()->AddChild(scrollbar); | 1994 ScrollableArea()->Box().GetDocument().View()->AddScrollbar(scrollbar); |
| 1995 return scrollbar; | 1995 return scrollbar; |
| 1996 } | 1996 } |
| 1997 | 1997 |
| 1998 void PaintLayerScrollableArea::ScrollbarManager::DestroyScrollbar( | 1998 void PaintLayerScrollableArea::ScrollbarManager::DestroyScrollbar( |
| 1999 ScrollbarOrientation orientation) { | 1999 ScrollbarOrientation orientation) { |
| 2000 Member<Scrollbar>& scrollbar = | 2000 Member<Scrollbar>& scrollbar = |
| 2001 orientation == kHorizontalScrollbar ? h_bar_ : v_bar_; | 2001 orientation == kHorizontalScrollbar ? h_bar_ : v_bar_; |
| 2002 DCHECK(orientation == kHorizontalScrollbar ? !h_bar_is_attached_ | 2002 DCHECK(orientation == kHorizontalScrollbar ? !h_bar_is_attached_ |
| 2003 : !v_bar_is_attached_); | 2003 : !v_bar_is_attached_); |
| 2004 if (!scrollbar) | 2004 if (!scrollbar) |
| 2005 return; | 2005 return; |
| 2006 | 2006 |
| 2007 ScrollableArea()->SetScrollbarNeedsPaintInvalidation(orientation); | 2007 ScrollableArea()->SetScrollbarNeedsPaintInvalidation(orientation); |
| 2008 if (orientation == kHorizontalScrollbar) | 2008 if (orientation == kHorizontalScrollbar) |
| 2009 ScrollableArea()->rebuild_horizontal_scrollbar_layer_ = true; | 2009 ScrollableArea()->rebuild_horizontal_scrollbar_layer_ = true; |
| 2010 else | 2010 else |
| 2011 ScrollableArea()->rebuild_vertical_scrollbar_layer_ = true; | 2011 ScrollableArea()->rebuild_vertical_scrollbar_layer_ = true; |
| 2012 | 2012 |
| 2013 if (!scrollbar->IsCustomScrollbar()) | 2013 if (!scrollbar->IsCustomScrollbar()) |
| 2014 ScrollableArea()->WillRemoveScrollbar(*scrollbar, orientation); | 2014 ScrollableArea()->WillRemoveScrollbar(*scrollbar, orientation); |
| 2015 | 2015 |
| 2016 ToFrameView(scrollbar->Parent())->RemoveChild(scrollbar.Get()); | 2016 ScrollableArea()->Box().GetDocument().View()->RemoveScrollbar(scrollbar); |
|
szager1
2017/04/21 08:37:52
Can't this still be accessed via scrollbar->Parent
joelhockey
2017/04/21 09:56:10
No. The visibility between core and platform is a
szager1
2017/04/21 10:22:36
I think the proper fix is to define Scrollbar owne
szager1
2017/04/21 10:42:30
Just to be totally clear, this line of code would
joelhockey
2017/04/21 12:22:05
Yes, nice idea. I'll have a go at that. I still
| |
| 2017 scrollbar->DisconnectFromScrollableArea(); | 2017 scrollbar->DisconnectFromScrollableArea(); |
| 2018 scrollbar = nullptr; | 2018 scrollbar = nullptr; |
| 2019 } | 2019 } |
| 2020 | 2020 |
| 2021 uint64_t PaintLayerScrollableArea::Id() const { | 2021 uint64_t PaintLayerScrollableArea::Id() const { |
| 2022 return DOMNodeIds::IdForNode(Box().GetNode()); | 2022 return DOMNodeIds::IdForNode(Box().GetNode()); |
| 2023 } | 2023 } |
| 2024 | 2024 |
| 2025 int PaintLayerScrollableArea::PreventRelayoutScope::count_ = 0; | 2025 int PaintLayerScrollableArea::PreventRelayoutScope::count_ = 0; |
| 2026 SubtreeLayoutScope* | 2026 SubtreeLayoutScope* |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2124 | 2124 |
| 2125 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: | 2125 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: |
| 2126 ClampScrollableAreas() { | 2126 ClampScrollableAreas() { |
| 2127 for (auto& scrollable_area : *needs_clamp_) | 2127 for (auto& scrollable_area : *needs_clamp_) |
| 2128 scrollable_area->ClampScrollOffsetAfterOverflowChange(); | 2128 scrollable_area->ClampScrollOffsetAfterOverflowChange(); |
| 2129 delete needs_clamp_; | 2129 delete needs_clamp_; |
| 2130 needs_clamp_ = nullptr; | 2130 needs_clamp_ = nullptr; |
| 2131 } | 2131 } |
| 2132 | 2132 |
| 2133 } // namespace blink | 2133 } // namespace blink |
| OLD | NEW |