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

Unified Diff: Source/core/frame/FrameView.cpp

Issue 1209293004: WIP - improve ScrollableArea handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/frame/PinchViewport.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index d9edbb76623d1463cc760542d39dca5bbfa64672..04a583529109ec306622579ae4d2c04291543639 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -165,9 +165,7 @@ PassRefPtrWillBeRawPtr<FrameView> FrameView::create(LocalFrame* frame, const Int
FrameView::~FrameView()
{
-#if ENABLE(ASSERT)
ASSERT(m_hasBeenDisposed);
-#endif
#if !ENABLE(OILPAN)
// Verify that the LocalFrame has a different FrameView or
// that it is being detached and destructed.
@@ -181,12 +179,16 @@ DEFINE_TRACE(FrameView)
visitor->trace(m_frame);
visitor->trace(m_nodeToDraw);
visitor->trace(m_maintainScrollPositionAnchor);
+ visitor->trace(m_scrollableAreas);
+ visitor->trace(m_animatingScrollableAreas);
visitor->trace(m_autoSizeInfo);
visitor->trace(m_horizontalScrollbar);
visitor->trace(m_verticalScrollbar);
visitor->trace(m_children);
+ visitor->trace(m_viewportScrollableArea);
#endif
Widget::trace(visitor);
+ ScrollableArea::trace(visitor);
}
void FrameView::reset()
@@ -1874,7 +1876,7 @@ void FrameView::scrollToAnchor()
LayoutRect rect;
if (anchorNode != m_frame->document()) {
rect = anchorNode->boundingBox();
- } else if (m_frame->settings()->rootLayerScrolls()) {
+ } else if (m_frame->settings() && m_frame->settings()->rootLayerScrolls()) {
if (Element* documentElement = m_frame->document()->documentElement())
rect = documentElement->boundingBox();
}
@@ -2866,7 +2868,7 @@ void FrameView::addScrollableArea(ScrollableArea* scrollableArea)
{
ASSERT(scrollableArea);
if (!m_scrollableAreas)
- m_scrollableAreas = adoptPtr(new ScrollableAreaSet);
+ m_scrollableAreas = adoptPtrWillBeNoop(new ScrollableAreaSet);
m_scrollableAreas->add(scrollableArea);
if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
@@ -2887,7 +2889,7 @@ void FrameView::addAnimatingScrollableArea(ScrollableArea* scrollableArea)
{
ASSERT(scrollableArea);
if (!m_animatingScrollableAreas)
- m_animatingScrollableAreas = adoptPtr(new ScrollableAreaSet);
+ m_animatingScrollableAreas = adoptPtrWillBeNoop(new ScrollableAreaSet);
m_animatingScrollableAreas->add(scrollableArea);
}
@@ -3063,6 +3065,7 @@ void FrameView::setHasHorizontalScrollbar(bool hasBar)
if (m_horizontalScrollbar->overlapsResizer())
adjustScrollbarsAvoidingResizerCount(-1);
removeChild(m_horizontalScrollbar.get());
+ m_horizontalScrollbar->disconnectFromScrollableArea();
m_horizontalScrollbar = nullptr;
if (AXObjectCache* cache = axObjectCache())
cache->handleScrollbarUpdate(this);
@@ -3091,6 +3094,7 @@ void FrameView::setHasVerticalScrollbar(bool hasBar)
if (m_verticalScrollbar->overlapsResizer())
adjustScrollbarsAvoidingResizerCount(-1);
removeChild(m_verticalScrollbar.get());
+ m_verticalScrollbar->disconnectFromScrollableArea();
m_verticalScrollbar = nullptr;
if (AXObjectCache* cache = axObjectCache())
cache->handleScrollbarUpdate(this);
@@ -3924,6 +3928,7 @@ ScrollableArea* FrameView::layoutViewportScrollableArea()
return this;
LayoutView* layoutView = this->layoutView();
+ ASSERT(layoutView && layoutView->scrollableArea());
return layoutView ? layoutView->scrollableArea() : nullptr;
}
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/frame/PinchViewport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698