Index: Source/core/frame/FrameView.cpp |
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp |
index 9b2004d7a60edb737ed362c6e1c7745ee5eda06f..db747db68c28caa8773e35a6667558feaba8bc02 100644 |
--- a/Source/core/frame/FrameView.cpp |
+++ b/Source/core/frame/FrameView.cpp |
@@ -293,10 +293,8 @@ void FrameView::prepareForDetach() |
// right now, otherwise it won't be able to reach the topDocument()'s axObject cache later. |
removeFromAXObjectCache(); |
- if (m_frame->page()) { |
- if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scrollingCoordinator()) |
- scrollingCoordinator->willDestroyScrollableArea(this); |
- } |
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
+ scrollingCoordinator->willDestroyScrollableArea(this); |
#if ENABLE(OILPAN) |
// FIXME: once/if dust settles, do this always (non-Oilpan)? |
@@ -450,6 +448,12 @@ RenderView* FrameView::renderView() const |
return frame().contentRenderer(); |
} |
+ScrollingCoordinator* FrameView::scrollingCoordinator() |
+{ |
+ Page* p = page(); |
+ return p ? p->scrollingCoordinator() : nullptr; |
Rick Byers
2015/01/12 22:36:27
nit: blink style it to use '0' here, not nullptr.
majidvp
2015/01/13 16:01:56
Done.
|
+} |
+ |
void FrameView::setCanHaveScrollbars(bool canHaveScrollbars) |
{ |
m_canHaveScrollbars = canHaveScrollbars; |
@@ -1220,10 +1224,8 @@ bool FrameView::contentsInCompositedLayer() const |
void FrameView::addSlowRepaintObject() |
{ |
if (!m_slowRepaintObjectCount++) { |
- if (Page* page = m_frame->page()) { |
- if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) |
- scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange(this); |
- } |
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
+ scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange(this); |
} |
} |
@@ -1232,10 +1234,8 @@ void FrameView::removeSlowRepaintObject() |
ASSERT(m_slowRepaintObjectCount > 0); |
m_slowRepaintObjectCount--; |
if (!m_slowRepaintObjectCount) { |
- if (Page* page = m_frame->page()) { |
- if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) |
- scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange(this); |
- } |
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
+ scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange(this); |
} |
} |
@@ -1247,10 +1247,8 @@ void FrameView::addViewportConstrainedObject(RenderObject* object) |
if (!m_viewportConstrainedObjects->contains(object)) { |
m_viewportConstrainedObjects->add(object); |
- if (Page* page = m_frame->page()) { |
- if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) |
- scrollingCoordinator->frameViewFixedObjectsDidChange(this); |
- } |
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
+ scrollingCoordinator->frameViewFixedObjectsDidChange(this); |
} |
} |
@@ -1259,10 +1257,8 @@ void FrameView::removeViewportConstrainedObject(RenderObject* object) |
if (m_viewportConstrainedObjects && m_viewportConstrainedObjects->contains(object)) { |
m_viewportConstrainedObjects->remove(object); |
- if (Page* page = m_frame->page()) { |
- if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) |
- scrollingCoordinator->frameViewFixedObjectsDidChange(this); |
- } |
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
+ scrollingCoordinator->frameViewFixedObjectsDidChange(this); |
} |
} |
@@ -2098,10 +2094,8 @@ void FrameView::performPostLayoutTasks() |
scheduleUpdateWidgetsIfNecessary(); |
- if (Page* page = m_frame->page()) { |
- if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) |
- scrollingCoordinator->notifyLayoutUpdated(); |
- } |
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
+ scrollingCoordinator->notifyLayoutUpdated(); |
scrollToAnchor(); |
@@ -2573,7 +2567,7 @@ void FrameView::updateLayoutAndStyleForPainting() |
view->compositor()->updateIfNeededRecursive(); |
if (view->compositor()->inCompositingMode() && m_frame->isLocalRoot()) |
- m_frame->page()->scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); |
+ scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); |
updateCompositedSelectionBoundsIfNeeded(); |
@@ -2918,6 +2912,9 @@ void FrameView::addScrollableArea(ScrollableArea* scrollableArea) |
if (!m_scrollableAreas) |
m_scrollableAreas = adoptPtr(new ScrollableAreaSet); |
m_scrollableAreas->add(scrollableArea); |
+ |
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
+ scrollingCoordinator->scrollableAreasDidChange(); |
} |
void FrameView::removeScrollableArea(ScrollableArea* scrollableArea) |
@@ -2925,6 +2922,9 @@ void FrameView::removeScrollableArea(ScrollableArea* scrollableArea) |
if (!m_scrollableAreas) |
return; |
m_scrollableAreas->remove(scrollableArea); |
+ |
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
+ scrollingCoordinator->scrollableAreasDidChange(); |
} |
void FrameView::addAnimatingScrollableArea(ScrollableArea* scrollableArea) |