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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 m_needsCompositedScrolling(false), | 100 m_needsCompositedScrolling(false), |
| 101 m_rebuildHorizontalScrollbarLayer(false), | 101 m_rebuildHorizontalScrollbarLayer(false), |
| 102 m_rebuildVerticalScrollbarLayer(false), | 102 m_rebuildVerticalScrollbarLayer(false), |
| 103 m_needsScrollOffsetClamp(false), | 103 m_needsScrollOffsetClamp(false), |
| 104 m_needsRelayout(false), | 104 m_needsRelayout(false), |
| 105 m_hadHorizontalScrollbarBeforeRelayout(false), | 105 m_hadHorizontalScrollbarBeforeRelayout(false), |
| 106 m_hadVerticalScrollbarBeforeRelayout(false), | 106 m_hadVerticalScrollbarBeforeRelayout(false), |
| 107 m_scrollbarManager(*this), | 107 m_scrollbarManager(*this), |
| 108 m_scrollCorner(nullptr), | 108 m_scrollCorner(nullptr), |
| 109 m_resizer(nullptr), | 109 m_resizer(nullptr), |
| 110 m_scrollAnchor(this) | 110 m_scrollAnchor(this), |
| 111 m_reasons(0) | |
| 111 #if DCHECK_IS_ON() | 112 #if DCHECK_IS_ON() |
| 112 , | 113 , |
| 113 m_hasBeenDisposed(false) | 114 m_hasBeenDisposed(false) |
| 114 #endif | 115 #endif |
| 115 { | 116 { |
| 116 Node* node = box().node(); | 117 Node* node = box().node(); |
| 117 if (node && node->isElementNode()) { | 118 if (node && node->isElementNode()) { |
| 118 // We save and restore only the scrollOffset as the other scroll values are | 119 // We save and restore only the scrollOffset as the other scroll values are |
| 119 // recalculated. | 120 // recalculated. |
| 120 Element* element = toElement(node); | 121 Element* element = toElement(node); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 140 | 141 |
| 141 if (LocalFrame* frame = box().frame()) { | 142 if (LocalFrame* frame = box().frame()) { |
| 142 if (FrameView* frameView = frame->view()) { | 143 if (FrameView* frameView = frame->view()) { |
| 143 frameView->removeScrollableArea(this); | 144 frameView->removeScrollableArea(this); |
| 144 frameView->removeAnimatingScrollableArea(this); | 145 frameView->removeAnimatingScrollableArea(this); |
| 145 } | 146 } |
| 146 } | 147 } |
| 147 | 148 |
| 148 if (box().frame() && box().frame()->page()) { | 149 if (box().frame() && box().frame()->page()) { |
| 149 if (ScrollingCoordinator* scrollingCoordinator = | 150 if (ScrollingCoordinator* scrollingCoordinator = |
| 150 box().frame()->page()->scrollingCoordinator()) | 151 box().frame()->page()->scrollingCoordinator()) { |
| 152 // Decrese the number of layer that has any main thread | |
| 153 // scrolling reasons stored in ScrollingCoordinator | |
| 154 for (uint32_t i = 0; | |
| 155 i < MainThreadScrollingReason::kMainThreadScrollingReasonCount; | |
| 156 ++i) { | |
| 157 if (hasMainThreadScrollingReason(1 << i)) { | |
| 158 scrollingCoordinator->adjustMainThreadReasonsFromStyle(1 << i, false); | |
| 159 } | |
| 160 } | |
| 151 scrollingCoordinator->willDestroyScrollableArea(this); | 161 scrollingCoordinator->willDestroyScrollableArea(this); |
|
bokan
2016/12/14 13:28:59
Actually, since we already have this willDestroySc
yigu
2016/12/14 21:17:33
Done.
| |
| 162 } | |
| 152 } | 163 } |
| 153 | 164 |
| 154 if (!box().documentBeingDestroyed()) { | 165 if (!box().documentBeingDestroyed()) { |
| 155 Node* node = box().node(); | 166 Node* node = box().node(); |
| 156 // FIXME: Make setSavedLayerScrollOffset take DoubleSize. crbug.com/414283. | 167 // FIXME: Make setSavedLayerScrollOffset take DoubleSize. crbug.com/414283. |
| 157 if (node && node->isElementNode()) | 168 if (node && node->isElementNode()) |
| 158 toElement(node)->setSavedLayerScrollOffset(m_scrollOffset); | 169 toElement(node)->setSavedLayerScrollOffset(m_scrollOffset); |
| 159 } | 170 } |
| 160 | 171 |
| 161 if (LocalFrame* frame = box().frame()) { | 172 if (LocalFrame* frame = box().frame()) { |
| (...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2033 | 2044 |
| 2034 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: | 2045 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: |
| 2035 clampScrollableAreas() { | 2046 clampScrollableAreas() { |
| 2036 for (auto& scrollableArea : *s_needsClamp) | 2047 for (auto& scrollableArea : *s_needsClamp) |
| 2037 scrollableArea->clampScrollOffsetAfterOverflowChange(); | 2048 scrollableArea->clampScrollOffsetAfterOverflowChange(); |
| 2038 delete s_needsClamp; | 2049 delete s_needsClamp; |
| 2039 s_needsClamp = nullptr; | 2050 s_needsClamp = nullptr; |
| 2040 } | 2051 } |
| 2041 | 2052 |
| 2042 } // namespace blink | 2053 } // namespace blink |
| OLD | NEW |