Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 RefPtrWillBeRawPtr<FrameView> view = adoptRefWillBeNoop(new FrameView(frame) ); | 158 RefPtrWillBeRawPtr<FrameView> view = adoptRefWillBeNoop(new FrameView(frame) ); |
| 159 view->Widget::setFrameRect(IntRect(view->location(), initialSize)); | 159 view->Widget::setFrameRect(IntRect(view->location(), initialSize)); |
| 160 view->setLayoutSizeInternal(initialSize); | 160 view->setLayoutSizeInternal(initialSize); |
| 161 | 161 |
| 162 view->show(); | 162 view->show(); |
| 163 return view.release(); | 163 return view.release(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 FrameView::~FrameView() | 166 FrameView::~FrameView() |
| 167 { | 167 { |
| 168 #if ENABLE(ASSERT) | |
| 169 ASSERT(m_hasBeenDisposed); | 168 ASSERT(m_hasBeenDisposed); |
| 170 #endif | |
| 171 #if !ENABLE(OILPAN) | 169 #if !ENABLE(OILPAN) |
| 172 // Verify that the LocalFrame has a different FrameView or | 170 // Verify that the LocalFrame has a different FrameView or |
| 173 // that it is being detached and destructed. | 171 // that it is being detached and destructed. |
| 174 ASSERT(frame().view() != this || !layoutView()); | 172 ASSERT(frame().view() != this || !layoutView()); |
| 175 #endif | 173 #endif |
| 176 } | 174 } |
| 177 | 175 |
| 178 DEFINE_TRACE(FrameView) | 176 DEFINE_TRACE(FrameView) |
| 179 { | 177 { |
| 180 #if ENABLE(OILPAN) | 178 #if ENABLE(OILPAN) |
| 181 visitor->trace(m_frame); | 179 visitor->trace(m_frame); |
| 182 visitor->trace(m_nodeToDraw); | 180 visitor->trace(m_nodeToDraw); |
| 183 visitor->trace(m_maintainScrollPositionAnchor); | 181 visitor->trace(m_maintainScrollPositionAnchor); |
| 182 visitor->trace(m_scrollableAreas); | |
| 183 visitor->trace(m_animatingScrollableAreas); | |
| 184 visitor->trace(m_autoSizeInfo); | 184 visitor->trace(m_autoSizeInfo); |
| 185 visitor->trace(m_horizontalScrollbar); | 185 visitor->trace(m_horizontalScrollbar); |
| 186 visitor->trace(m_verticalScrollbar); | 186 visitor->trace(m_verticalScrollbar); |
| 187 visitor->trace(m_children); | 187 visitor->trace(m_children); |
| 188 visitor->trace(m_viewportScrollableArea); | |
| 188 #endif | 189 #endif |
| 189 Widget::trace(visitor); | 190 Widget::trace(visitor); |
| 191 ScrollableArea::trace(visitor); | |
| 190 } | 192 } |
| 191 | 193 |
| 192 void FrameView::reset() | 194 void FrameView::reset() |
| 193 { | 195 { |
| 194 m_hasPendingLayout = false; | 196 m_hasPendingLayout = false; |
| 195 m_doFullPaintInvalidation = false; | 197 m_doFullPaintInvalidation = false; |
| 196 m_layoutSchedulingEnabled = true; | 198 m_layoutSchedulingEnabled = true; |
| 197 m_inPerformLayout = false; | 199 m_inPerformLayout = false; |
| 198 m_inSynchronousPostLayout = false; | 200 m_inSynchronousPostLayout = false; |
| 199 m_layoutCount = 0; | 201 m_layoutCount = 0; |
| (...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1867 RefPtrWillBeRawPtr<Node> anchorNode = m_maintainScrollPositionAnchor; | 1869 RefPtrWillBeRawPtr<Node> anchorNode = m_maintainScrollPositionAnchor; |
| 1868 if (!anchorNode) | 1870 if (!anchorNode) |
| 1869 return; | 1871 return; |
| 1870 | 1872 |
| 1871 if (!anchorNode->layoutObject()) | 1873 if (!anchorNode->layoutObject()) |
| 1872 return; | 1874 return; |
| 1873 | 1875 |
| 1874 LayoutRect rect; | 1876 LayoutRect rect; |
| 1875 if (anchorNode != m_frame->document()) { | 1877 if (anchorNode != m_frame->document()) { |
| 1876 rect = anchorNode->boundingBox(); | 1878 rect = anchorNode->boundingBox(); |
| 1877 } else if (m_frame->settings()->rootLayerScrolls()) { | 1879 } else if (m_frame->settings() && m_frame->settings()->rootLayerScrolls()) { |
| 1878 if (Element* documentElement = m_frame->document()->documentElement()) | 1880 if (Element* documentElement = m_frame->document()->documentElement()) |
| 1879 rect = documentElement->boundingBox(); | 1881 rect = documentElement->boundingBox(); |
| 1880 } | 1882 } |
| 1881 | 1883 |
| 1882 RefPtrWillBeRawPtr<Frame> boundaryFrame = m_frame->findUnsafeParentScrollPro pagationBoundary(); | 1884 RefPtrWillBeRawPtr<Frame> boundaryFrame = m_frame->findUnsafeParentScrollPro pagationBoundary(); |
| 1883 | 1885 |
| 1884 // FIXME: Handle RemoteFrames | 1886 // FIXME: Handle RemoteFrames |
| 1885 if (boundaryFrame && boundaryFrame->isLocalFrame()) | 1887 if (boundaryFrame && boundaryFrame->isLocalFrame()) |
| 1886 toLocalFrame(boundaryFrame.get())->view()->setSafeToPropagateScrollToPar ent(false); | 1888 toLocalFrame(boundaryFrame.get())->view()->setSafeToPropagateScrollToPar ent(false); |
| 1887 | 1889 |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2859 | 2861 |
| 2860 ResizerAreaSet::iterator it = m_resizerAreas->find(&resizerBox); | 2862 ResizerAreaSet::iterator it = m_resizerAreas->find(&resizerBox); |
| 2861 if (it != m_resizerAreas->end()) | 2863 if (it != m_resizerAreas->end()) |
| 2862 m_resizerAreas->remove(it); | 2864 m_resizerAreas->remove(it); |
| 2863 } | 2865 } |
| 2864 | 2866 |
| 2865 void FrameView::addScrollableArea(ScrollableArea* scrollableArea) | 2867 void FrameView::addScrollableArea(ScrollableArea* scrollableArea) |
| 2866 { | 2868 { |
| 2867 ASSERT(scrollableArea); | 2869 ASSERT(scrollableArea); |
| 2868 if (!m_scrollableAreas) | 2870 if (!m_scrollableAreas) |
| 2869 m_scrollableAreas = adoptPtr(new ScrollableAreaSet); | 2871 m_scrollableAreas = adoptPtrWillBeNoop(new ScrollableAreaSet); |
| 2870 m_scrollableAreas->add(scrollableArea); | 2872 m_scrollableAreas->add(scrollableArea); |
| 2871 | 2873 |
| 2872 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator( )) | 2874 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator( )) |
| 2873 scrollingCoordinator->scrollableAreasDidChange(); | 2875 scrollingCoordinator->scrollableAreasDidChange(); |
| 2874 } | 2876 } |
| 2875 | 2877 |
| 2876 void FrameView::removeScrollableArea(ScrollableArea* scrollableArea) | 2878 void FrameView::removeScrollableArea(ScrollableArea* scrollableArea) |
| 2877 { | 2879 { |
| 2878 if (!m_scrollableAreas) | 2880 if (!m_scrollableAreas) |
| 2879 return; | 2881 return; |
| 2880 m_scrollableAreas->remove(scrollableArea); | 2882 m_scrollableAreas->remove(scrollableArea); |
| 2881 | 2883 |
| 2882 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator( )) | 2884 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator( )) |
| 2883 scrollingCoordinator->scrollableAreasDidChange(); | 2885 scrollingCoordinator->scrollableAreasDidChange(); |
| 2884 } | 2886 } |
| 2885 | 2887 |
| 2886 void FrameView::addAnimatingScrollableArea(ScrollableArea* scrollableArea) | 2888 void FrameView::addAnimatingScrollableArea(ScrollableArea* scrollableArea) |
| 2887 { | 2889 { |
| 2888 ASSERT(scrollableArea); | 2890 ASSERT(scrollableArea); |
| 2889 if (!m_animatingScrollableAreas) | 2891 if (!m_animatingScrollableAreas) |
| 2890 m_animatingScrollableAreas = adoptPtr(new ScrollableAreaSet); | 2892 m_animatingScrollableAreas = adoptPtrWillBeNoop(new ScrollableAreaSet); |
| 2891 m_animatingScrollableAreas->add(scrollableArea); | 2893 m_animatingScrollableAreas->add(scrollableArea); |
| 2892 } | 2894 } |
| 2893 | 2895 |
| 2894 void FrameView::removeAnimatingScrollableArea(ScrollableArea* scrollableArea) | 2896 void FrameView::removeAnimatingScrollableArea(ScrollableArea* scrollableArea) |
| 2895 { | 2897 { |
| 2896 if (!m_animatingScrollableAreas) | 2898 if (!m_animatingScrollableAreas) |
| 2897 return; | 2899 return; |
| 2898 m_animatingScrollableAreas->remove(scrollableArea); | 2900 m_animatingScrollableAreas->remove(scrollableArea); |
| 2899 } | 2901 } |
| 2900 | 2902 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3056 m_horizontalScrollbar->styleChanged(); | 3058 m_horizontalScrollbar->styleChanged(); |
| 3057 } else { | 3059 } else { |
| 3058 willRemoveScrollbar(m_horizontalScrollbar.get(), HorizontalScrollbar); | 3060 willRemoveScrollbar(m_horizontalScrollbar.get(), HorizontalScrollbar); |
| 3059 if (AXObjectCache* cache = axObjectCache()) | 3061 if (AXObjectCache* cache = axObjectCache()) |
| 3060 cache->remove(m_horizontalScrollbar.get()); | 3062 cache->remove(m_horizontalScrollbar.get()); |
| 3061 // If the scrollbar has been marked as overlapping the window resizer, | 3063 // If the scrollbar has been marked as overlapping the window resizer, |
| 3062 // then its removal should reduce the count. | 3064 // then its removal should reduce the count. |
| 3063 if (m_horizontalScrollbar->overlapsResizer()) | 3065 if (m_horizontalScrollbar->overlapsResizer()) |
| 3064 adjustScrollbarsAvoidingResizerCount(-1); | 3066 adjustScrollbarsAvoidingResizerCount(-1); |
| 3065 removeChild(m_horizontalScrollbar.get()); | 3067 removeChild(m_horizontalScrollbar.get()); |
| 3068 m_horizontalScrollbar->disconnectFromScrollableArea(); | |
|
haraken
2015/06/30 10:30:35
Shall we add #if !ENABLE(OILPAN)?
sof
2015/06/30 11:34:09
No, I don't think it is worth adding the CPPery at
| |
| 3066 m_horizontalScrollbar = nullptr; | 3069 m_horizontalScrollbar = nullptr; |
| 3067 if (AXObjectCache* cache = axObjectCache()) | 3070 if (AXObjectCache* cache = axObjectCache()) |
| 3068 cache->handleScrollbarUpdate(this); | 3071 cache->handleScrollbarUpdate(this); |
| 3069 } | 3072 } |
| 3070 | 3073 |
| 3071 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) | 3074 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) |
| 3072 invalidateScrollCorner(scrollCornerRect()); | 3075 invalidateScrollCorner(scrollCornerRect()); |
| 3073 } | 3076 } |
| 3074 | 3077 |
| 3075 void FrameView::setHasVerticalScrollbar(bool hasBar) | 3078 void FrameView::setHasVerticalScrollbar(bool hasBar) |
| 3076 { | 3079 { |
| 3077 if (hasBar == !!m_verticalScrollbar) | 3080 if (hasBar == !!m_verticalScrollbar) |
| 3078 return; | 3081 return; |
| 3079 | 3082 |
| 3080 if (hasBar) { | 3083 if (hasBar) { |
| 3081 m_verticalScrollbar = createScrollbar(VerticalScrollbar); | 3084 m_verticalScrollbar = createScrollbar(VerticalScrollbar); |
| 3082 addChild(m_verticalScrollbar.get()); | 3085 addChild(m_verticalScrollbar.get()); |
| 3083 didAddScrollbar(m_verticalScrollbar.get(), VerticalScrollbar); | 3086 didAddScrollbar(m_verticalScrollbar.get(), VerticalScrollbar); |
| 3084 m_verticalScrollbar->styleChanged(); | 3087 m_verticalScrollbar->styleChanged(); |
| 3085 } else { | 3088 } else { |
| 3086 willRemoveScrollbar(m_verticalScrollbar.get(), VerticalScrollbar); | 3089 willRemoveScrollbar(m_verticalScrollbar.get(), VerticalScrollbar); |
| 3087 if (AXObjectCache* cache = axObjectCache()) | 3090 if (AXObjectCache* cache = axObjectCache()) |
| 3088 cache->remove(m_verticalScrollbar.get()); | 3091 cache->remove(m_verticalScrollbar.get()); |
| 3089 // If the scrollbar has been marked as overlapping the window resizer, | 3092 // If the scrollbar has been marked as overlapping the window resizer, |
| 3090 // then its removal should reduce the count. | 3093 // then its removal should reduce the count. |
| 3091 if (m_verticalScrollbar->overlapsResizer()) | 3094 if (m_verticalScrollbar->overlapsResizer()) |
| 3092 adjustScrollbarsAvoidingResizerCount(-1); | 3095 adjustScrollbarsAvoidingResizerCount(-1); |
| 3093 removeChild(m_verticalScrollbar.get()); | 3096 removeChild(m_verticalScrollbar.get()); |
| 3097 m_verticalScrollbar->disconnectFromScrollableArea(); | |
|
haraken
2015/06/30 10:30:35
#if !ENABLE(OILPAN)
| |
| 3094 m_verticalScrollbar = nullptr; | 3098 m_verticalScrollbar = nullptr; |
| 3095 if (AXObjectCache* cache = axObjectCache()) | 3099 if (AXObjectCache* cache = axObjectCache()) |
| 3096 cache->handleScrollbarUpdate(this); | 3100 cache->handleScrollbarUpdate(this); |
| 3097 } | 3101 } |
| 3098 | 3102 |
| 3099 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) | 3103 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) |
| 3100 invalidateScrollCorner(scrollCornerRect()); | 3104 invalidateScrollCorner(scrollCornerRect()); |
| 3101 } | 3105 } |
| 3102 | 3106 |
| 3103 void FrameView::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode ve rticalMode, | 3107 void FrameView::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode ve rticalMode, |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3972 | 3976 |
| 3973 if (!graphicsLayer) | 3977 if (!graphicsLayer) |
| 3974 return; | 3978 return; |
| 3975 | 3979 |
| 3976 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); | 3980 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); |
| 3977 | 3981 |
| 3978 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); | 3982 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); |
| 3979 } | 3983 } |
| 3980 | 3984 |
| 3981 } // namespace blink | 3985 } // namespace blink |
| OLD | NEW |