https://bugs.webkit.org/show_bug.cgi?id=62762
Reviewed by Beth Dakin.
Source/WebCore:
It makes more sense for the set of scrollable areas to be per frame view instead of per page;
scrollable areas are associated with a containing frame view and their lifecycle follows the lifecycle of the
frame view much more closely. This could even fix a bunch of crashes where a scrollable area outlived its containing page.
* WebCore.exp.in:
Replace the Page member functions with FrameView member functions instead.
* page/EventHandler.cpp:
(WebCore::EventHandler::mouseMoved):
Check if the frame view contains the given layer.
(WebCore::EventHandler::updateMouseEventTargetNode):
Ditto.
* page/FocusController.cpp:
(WebCore::contentAreaDidShowOrHide):
Add helper function.
(WebCore::FocusController::setContainingWindowIsVisible):
Call contentAreaDidShowOrHide for the main frame view, and for all scrollable areas
inside all subframe views.
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
Use early returns to make the code more clear. Also, don't add the scrollable area to the set here.
(WebCore::FrameView::~FrameView):
Don't remove the scrollable area here.
(WebCore::FrameView::zoomAnimatorTransformChanged):
m_page is gone so use m_frame->page() instead.
(WebCore::FrameView::setAnimatorsAreActive):
Call ScrollAnimator::setIsActive for all the scrollable areas in this frame view. Previously we used to do
this for all scrollable areas on the page, but since setAnimatorsAreActive will be called for each document,
this will be done implicitly.
(WebCore::FrameView::notifyPageThatContentAreaWillPaint):
Call ScrollableArea::contentDidPaint for this frame view and all its immediate scrollable areas. Previously, we used
to do this for all scrollable areas on the page, but we only need to do it for this frame view.
(WebCore::FrameView::scrollAnimatorEnabled):
Get the page from m_frame since m_page is gone.
(WebCore::FrameView::addScrollableArea):
(WebCore::FrameView::removeScrollableArea):
(WebCore::FrameView::containsScrollableArea):
Move these member functions here from Page.
(WebCore::FrameView::addChild):
If we are adding a frame view, add it to the scrollable area set.
(WebCore::FrameView::removeChild):
If we are removing a frame view, remove it from the scrollable area set.
* page/FrameView.h:
Move the member function declarations and the scrollable area set member variable here from Page.
* page/Page.cpp:
(WebCore::Page::~Page):
Don't call disconnectPage on the scrollable areas anymore.
* platform/ScrollView.h:
(ScrollView):
Make addChild and removeChild virtual.
* platform/ScrollableArea.h:
Remove disconnectFromPage.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::~RenderLayer):
(WebCore::RenderLayer::styleChanged):
The frame view now keeps track of the scrollable areas.
* rendering/RenderLayer.h:
Remove the page member variable and disconnectFromPage.
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::RenderListBox):
(WebCore::RenderListBox::~RenderListBox):
The frame view now keeps track of the scrollable areas.
* rendering/RenderListBox.h:
Remove the page member variable and disconnectFromPage.
Source/WebKit/chromium:
Update for changes to WebCore now that the scrollable area set is kept per frame view.
* src/ScrollbarGroup.cpp:
(WebKit::ScrollbarGroup::ScrollbarGroup):
(WebKit::ScrollbarGroup::~ScrollbarGroup):
* src/ScrollbarGroup.h:
(WebCore):
(ScrollbarGroup):
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::scrollbarGroup):
Source/WebKit2:
* WebProcess/Plugins/PDF/BuiltInPDFView.cpp:
(WebKit::BuiltInPDFView::initialize):
Call FrameView::addScrollableArea instead.
(WebKit::BuiltInPDFView::destroy):
Call FrameView::removeScrollableArea instead.
* WebProcess/Plugins/PDF/BuiltInPDFView.h:
Remove disconnectFromPage since it no longer exists on ScrollableArea.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106977
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-06 Anders Carlsson <andersca@apple.com>
+
+ ScrollableAreaSet should be moved from Page to FrameView
+ https://bugs.webkit.org/show_bug.cgi?id=62762
+
+ Reviewed by Beth Dakin.
+
+ It makes more sense for the set of scrollable areas to be per frame view instead of per page;
+ scrollable areas are associated with a containing frame view and their lifecycle follows the lifecycle of the
+ frame view much more closely. This could even fix a bunch of crashes where a scrollable area outlived its containing page.
+
+ * WebCore.exp.in:
+ Replace the Page member functions with FrameView member functions instead.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::mouseMoved):
+ Check if the frame view contains the given layer.
+
+ (WebCore::EventHandler::updateMouseEventTargetNode):
+ Ditto.
+
+ * page/FocusController.cpp:
+ (WebCore::contentAreaDidShowOrHide):
+ Add helper function.
+
+ (WebCore::FocusController::setContainingWindowIsVisible):
+ Call contentAreaDidShowOrHide for the main frame view, and for all scrollable areas
+ inside all subframe views.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::FrameView):
+ Use early returns to make the code more clear. Also, don't add the scrollable area to the set here.
+
+ (WebCore::FrameView::~FrameView):
+ Don't remove the scrollable area here.
+
+ (WebCore::FrameView::zoomAnimatorTransformChanged):
+ m_page is gone so use m_frame->page() instead.
+
+ (WebCore::FrameView::setAnimatorsAreActive):
+ Call ScrollAnimator::setIsActive for all the scrollable areas in this frame view. Previously we used to do
+ this for all scrollable areas on the page, but since setAnimatorsAreActive will be called for each document,
+ this will be done implicitly.
+
+ (WebCore::FrameView::notifyPageThatContentAreaWillPaint):
+ Call ScrollableArea::contentDidPaint for this frame view and all its immediate scrollable areas. Previously, we used
+ to do this for all scrollable areas on the page, but we only need to do it for this frame view.
+
+ (WebCore::FrameView::scrollAnimatorEnabled):
+ Get the page from m_frame since m_page is gone.
+
+ (WebCore::FrameView::addScrollableArea):
+ (WebCore::FrameView::removeScrollableArea):
+ (WebCore::FrameView::containsScrollableArea):
+ Move these member functions here from Page.
+
+ (WebCore::FrameView::addChild):
+ If we are adding a frame view, add it to the scrollable area set.
+
+ (WebCore::FrameView::removeChild):
+ If we are removing a frame view, remove it from the scrollable area set.
+
+ * page/FrameView.h:
+ Move the member function declarations and the scrollable area set member variable here from Page.
+
+ * page/Page.cpp:
+ (WebCore::Page::~Page):
+ Don't call disconnectPage on the scrollable areas anymore.
+
+ * platform/ScrollView.h:
+ (ScrollView):
+ Make addChild and removeChild virtual.
+
+ * platform/ScrollableArea.h:
+ Remove disconnectFromPage.
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::RenderLayer):
+ (WebCore::RenderLayer::~RenderLayer):
+ (WebCore::RenderLayer::styleChanged):
+ The frame view now keeps track of the scrollable areas.
+
+ * rendering/RenderLayer.h:
+ Remove the page member variable and disconnectFromPage.
+
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::RenderListBox):
+ (WebCore::RenderListBox::~RenderListBox):
+ The frame view now keeps track of the scrollable areas.
+
+ * rendering/RenderListBox.h:
+ Remove the page member variable and disconnectFromPage.
+
2012-02-07 Matthew Delaney <mdelaney@apple.com>
Remove redundant checks in CanvasRenderingContext2D.cpp
__ZN7WebCore4Page15didMoveOnscreenEv
__ZN7WebCore4Page16setCanStartMediaEb
__ZN7WebCore4Page16setDefersLoadingEb
-__ZN7WebCore4Page17addScrollableAreaEPNS_14ScrollableAreaE
__ZN7WebCore4Page17willMoveOffscreenEv
__ZN7WebCore4Page18removeSchedulePairEN3WTF10PassRefPtrINS_12SchedulePairEEE
__ZN7WebCore4Page18setPageScaleFactorEfRKNS_8IntPointE
__ZN7WebCore4Page19visitedStateChangedEPNS_9PageGroupEy
-__ZN7WebCore4Page20removeScrollableAreaEPNS_14ScrollableAreaE
__ZN7WebCore4Page20setDeviceScaleFactorEf
__ZN7WebCore4Page20unmarkAllTextMatchesEv
__ZN7WebCore4Page21markAllMatchesForTextERKN3WTF6StringEjbj
__ZN7WebCore9FrameView14setTransparentEb
__ZN7WebCore9FrameView15setMarginHeightEi
__ZN7WebCore9FrameView16setPaintBehaviorEj
+__ZN7WebCore9FrameView17addScrollableAreaEPNS_14ScrollableAreaE
__ZN7WebCore9FrameView17paintControlTintsEv
__ZN7WebCore9FrameView17setScrollPositionERKNS_8IntPointE
__ZN7WebCore9FrameView17setTracksRepaintsEb
__ZN7WebCore9FrameView18updateControlTintsEv
__ZN7WebCore9FrameView19scrollElementToRectEPNS_7ElementERKNS_7IntRectE
__ZN7WebCore9FrameView20enterCompositingModeEv
+__ZN7WebCore9FrameView20removeScrollableAreaEPNS_14ScrollableAreaE
__ZN7WebCore9FrameView21flushDeferredRepaintsEv
__ZN7WebCore9FrameView22setBaseBackgroundColorERKNS_5ColorE
__ZN7WebCore9FrameView23updateCanHaveScrollbarsEv
return result;
if (RenderLayer* layer = layerForNode(hoveredNode.innerNode())) {
- if (page->containsScrollableArea(layer))
- layer->mouseMovedInContentArea();
+ if (FrameView* frameView = m_frame->view()) {
+ if (frameView->containsScrollableArea(layer))
+ layer->mouseMovedInContentArea();
+ }
}
if (FrameView* frameView = m_frame->view())
}
} else if (page && (layerForLastNode && (!layerForNodeUnderMouse || layerForNodeUnderMouse != layerForLastNode))) {
// The mouse has moved between layers.
- if (page->containsScrollableArea(layerForLastNode))
- layerForLastNode->mouseExitedContentArea();
+ if (Frame* frame = m_lastNodeUnderMouse->document()->frame()) {
+ if (FrameView* frameView = frame->view()) {
+ if (frameView->containsScrollableArea(layerForLastNode))
+ layerForLastNode->mouseExitedContentArea();
+ }
+ }
}
-
+
if (m_nodeUnderMouse && (!m_lastNodeUnderMouse || m_lastNodeUnderMouse->document() != m_frame->document())) {
// The mouse has moved between frames.
if (Frame* frame = m_nodeUnderMouse->document()->frame()) {
}
} else if (page && (layerForNodeUnderMouse && (!layerForLastNode || layerForNodeUnderMouse != layerForLastNode))) {
// The mouse has moved between layers.
- if (page->containsScrollableArea(layerForNodeUnderMouse))
- layerForNodeUnderMouse->mouseEnteredContentArea();
+ if (Frame* frame = m_nodeUnderMouse->document()->frame()) {
+ if (FrameView* frameView = frame->view()) {
+ if (frameView->containsScrollableArea(layerForNodeUnderMouse))
+ layerForNodeUnderMouse->mouseEnteredContentArea();
+ }
+ }
}
-
+
if (m_lastNodeUnderMouse && m_lastNodeUnderMouse->document() != m_frame->document()) {
m_lastNodeUnderMouse = 0;
m_lastScrollbarUnderMouse = 0;
dispatchEventsOnWindowAndFocusedNode(m_focusedFrame->document(), active);
}
+static void contentAreaDidShowOrHide(ScrollableArea* scrollableArea, bool didShow)
+{
+ if (didShow)
+ scrollableArea->contentAreaDidShow();
+ else
+ scrollableArea->contentAreaDidHide();
+}
+
void FocusController::setContainingWindowIsVisible(bool containingWindowIsVisible)
{
if (m_containingWindowIsVisible == containingWindowIsVisible)
if (!view)
return;
- if (const HashSet<ScrollableArea*>* scrollableAreas = m_page->scrollableAreaSet()) {
- HashSet<ScrollableArea*>::const_iterator end = scrollableAreas->end();
- for (HashSet<ScrollableArea*>::const_iterator it = scrollableAreas->begin(); it != end; ++it) {
- if (!containingWindowIsVisible)
- (*it)->contentAreaDidHide();
- else
- (*it)->contentAreaDidShow();
+ contentAreaDidShowOrHide(view, containingWindowIsVisible);
+
+ for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+ FrameView* frameView = frame->view();
+ if (!frameView)
+ continue;
+
+ const HashSet<ScrollableArea*>* scrollableAreas = frameView->scrollableAreas();
+ if (!scrollableAreas)
+ continue;
+
+ for (HashSet<ScrollableArea*>::const_iterator it = scrollableAreas->begin(), end = scrollableAreas->end(); it != end; ++it) {
+ ScrollableArea* scrollableArea = *it;
+ ASSERT(scrollableArea->isOnActivePage());
+
+ contentAreaDidShowOrHide(scrollableArea, containingWindowIsVisible);
}
}
}
{
init();
- if (m_frame) {
- if (Page* page = m_frame->page()) {
- m_page = page;
- m_page->addScrollableArea(this);
+ // FIXME: Can m_frame ever be null here?
+ if (!m_frame)
+ return;
- if (m_frame == m_page->mainFrame()) {
- ScrollableArea::setVerticalScrollElasticity(ScrollElasticityAllowed);
- ScrollableArea::setHorizontalScrollElasticity(ScrollElasticityAllowed);
- }
- }
+ Page* page = m_frame->page();
+ if (!page)
+ return;
+
+ if (m_frame == page->mainFrame()) {
+ ScrollableArea::setVerticalScrollElasticity(ScrollElasticityAllowed);
+ ScrollableArea::setHorizontalScrollElasticity(ScrollElasticityAllowed);
}
}
ASSERT(!m_scrollCorner);
ASSERT(m_actionScheduler->isEmpty());
- if (m_page)
- m_page->removeScrollableArea(this);
-
if (m_frame) {
ASSERT(m_frame->view() != this || !m_frame->contentRenderer());
RenderPart* renderer = m_frame->ownerRenderer();
void FrameView::zoomAnimatorTransformChanged(float scale, float x, float y, ZoomAnimationState state)
{
if (state == ZoomAnimationFinishing) {
- m_page->setPageScaleFactor(m_page->pageScaleFactor() * scale,
- IntPoint(scale * scrollX() - x, scale * scrollY() - y));
+ if (Page* page = m_frame->page())
+ page->setPageScaleFactor(page->pageScaleFactor() * scale, IntPoint(scale * scrollX() - x, scale * scrollY() - y));
scrollAnimator()->resetZoom();
}
if (!page)
return;
- const HashSet<ScrollableArea*>* scrollableAreas = page->scrollableAreaSet();
- if (!scrollableAreas)
+ scrollAnimator()->setIsActive();
+
+ if (!m_scrollableAreas)
return;
- HashSet<ScrollableArea*>::const_iterator end = scrollableAreas->end();
- for (HashSet<ScrollableArea*>::const_iterator it = scrollableAreas->begin(); it != end; ++it) {
- // FIXME: This extra check to make sure the ScrollableArea is on an active page needs
- // to be here as long as the ScrollableArea HashSet lives on Page. But it should really be
- // moved to the top-level Document or a similar class that really represents a single
- // web page. https://bugs.webkit.org/show_bug.cgi?id=62762
- if ((*it)->isOnActivePage())
- (*it)->scrollAnimator()->setIsActive();
+ for (HashSet<ScrollableArea*>::const_iterator it = m_scrollableAreas->begin(), end = m_scrollableAreas->end(); it != end; ++it) {
+ ScrollableArea* scrollableArea = *it;
+
+ ASSERT(scrollableArea->isOnActivePage());
+ scrollableArea->scrollAnimator()->setIsActive();
}
}
if (!page)
return;
- const HashSet<ScrollableArea*>* scrollableAreas = page->scrollableAreaSet();
- if (!scrollableAreas)
+ contentAreaWillPaint();
+
+ if (!m_scrollableAreas)
return;
- HashSet<ScrollableArea*>::const_iterator end = scrollableAreas->end();
- for (HashSet<ScrollableArea*>::const_iterator it = scrollableAreas->begin(); it != end; ++it)
- (*it)->contentAreaWillPaint();
+ for (HashSet<ScrollableArea*>::const_iterator it = m_scrollableAreas->begin(), end = m_scrollableAreas->end(); it != end; ++it) {
+ ScrollableArea* scrollableArea = *it;
+
+ ASSERT(scrollableArea->isOnActivePage());
+ scrollableArea->contentAreaWillPaint();
+ }
}
bool FrameView::scrollAnimatorEnabled() const
{
#if ENABLE(SMOOTH_SCROLLING)
- if (m_page && m_page->settings())
- return m_page->settings()->scrollAnimatorEnabled();
+ if (Page* page = m_frame->page())
+ return page->settings()->scrollAnimatorEnabled();
#endif
+
return false;
}
m_isTrackingRepaints = trackRepaints;
}
+void FrameView::addScrollableArea(ScrollableArea* scrollableArea)
+{
+ if (!m_scrollableAreas)
+ m_scrollableAreas = adoptPtr(new ScrollableAreaSet);
+ m_scrollableAreas->add(scrollableArea);
+}
+
+void FrameView::removeScrollableArea(ScrollableArea* scrollableArea)
+{
+ if (!m_scrollableAreas)
+ return;
+ m_scrollableAreas->remove(scrollableArea);
+}
+
+bool FrameView::containsScrollableArea(ScrollableArea* scrollableArea) const
+{
+ if (!m_scrollableAreas)
+ return false;
+ return m_scrollableAreas->contains(scrollableArea);
+}
+
+void FrameView::addChild(PassRefPtr<Widget> widget)
+{
+ if (widget->isFrameView())
+ addScrollableArea(static_cast<FrameView*>(widget.get()));
+
+ ScrollView::addChild(widget);
+}
+
+void FrameView::removeChild(Widget* widget)
+{
+ if (widget->isFrameView())
+ removeScrollableArea(static_cast<FrameView*>(widget));
+
+ ScrollView::removeChild(widget);
+}
+
bool FrameView::isVerticalDocument() const
{
RenderView* root = rootRenderer(this);
void resetTrackedRepaints() { m_trackedRepaintRects.clear(); }
const Vector<IntRect>& trackedRepaintRects() const { return m_trackedRepaintRects; }
+ typedef HashSet<ScrollableArea*> ScrollableAreaSet;
+ void addScrollableArea(ScrollableArea*);
+ void removeScrollableArea(ScrollableArea*);
+ bool containsScrollableArea(ScrollableArea*) const;
+ const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.get(); }
+
+ virtual void addChild(PassRefPtr<Widget>) OVERRIDE;
+ virtual void removeChild(Widget*) OVERRIDE;
+
protected:
virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
virtual void scrollContentsSlowPath(const IntRect& updateRect);
#endif
virtual void notifyPageThatContentAreaWillPaint() const;
- virtual void disconnectFromPage() { m_page = 0; }
virtual bool scrollAnimatorEnabled() const;
// Renderer to hold our custom scroll corner.
RenderScrollbarPart* m_scrollCorner;
- Page* m_page;
-
// If true, automatically resize the frame view around its content.
bool m_shouldAutoSize;
bool m_inAutoSize;
// The upper bound on the size when autosizing.
IntSize m_maxAutoSize;
+ OwnPtr<ScrollableAreaSet> m_scrollableAreas;
+
static double s_deferredRepaintDelay;
static double s_initialDeferredRepaintDelayDuringLoading;
static double s_maxDeferredRepaintDelayDuringLoading;
for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
frame->pageDestroyed();
- if (m_scrollableAreaSet) {
- ScrollableAreaSet::const_iterator end = m_scrollableAreaSet->end();
- for (ScrollableAreaSet::const_iterator it = m_scrollableAreaSet->begin(); it != end; ++it)
- (*it)->disconnectFromPage();
- }
-
m_editorClient->pageDestroyed();
#if ENABLE(INSPECTOR)
pluginViewBases[i]->privateBrowsingStateChanged(privateBrowsingEnabled);
}
-void Page::addScrollableArea(ScrollableArea* scrollableArea)
-{
- if (!m_scrollableAreaSet)
- m_scrollableAreaSet = adoptPtr(new ScrollableAreaSet);
- m_scrollableAreaSet->add(scrollableArea);
-}
-
-void Page::removeScrollableArea(ScrollableArea* scrollableArea)
-{
- if (!m_scrollableAreaSet)
- return;
- m_scrollableAreaSet->remove(scrollableArea);
-}
-
-bool Page::containsScrollableArea(ScrollableArea* scrollableArea) const
-{
- if (!m_scrollableAreaSet)
- return false;
- return m_scrollableAreaSet->contains(scrollableArea);
-}
-
#if !ASSERT_DISABLED
void Page::checkFrameCountConsistency() const
{
void setJavaScriptURLsAreAllowed(bool);
bool javaScriptURLsAreAllowed() const;
- typedef HashSet<ScrollableArea*> ScrollableAreaSet;
- void addScrollableArea(ScrollableArea*);
- void removeScrollableArea(ScrollableArea*);
- bool containsScrollableArea(ScrollableArea*) const;
- const ScrollableAreaSet* scrollableAreaSet() const { return m_scrollableAreaSet.get(); }
-
// Don't allow more than a certain number of frames in a page.
// This seems like a reasonable upper bound, and otherwise mutually
// recursive frameset pages can quickly bring the program to its knees
double m_minimumTimerInterval;
- OwnPtr<ScrollableAreaSet> m_scrollableAreaSet;
-
bool m_isEditable;
#if ENABLE(PAGE_VISIBILITY_API)
// Functions for child manipulation and inspection.
const HashSet<RefPtr<Widget> >* children() const { return &m_children; }
- void addChild(PassRefPtr<Widget>);
- void removeChild(Widget*);
+ virtual void addChild(PassRefPtr<Widget>);
+ virtual void removeChild(Widget*);
// If the scroll view does not use a native widget, then it will have cross-platform Scrollbars. These functions
// can be used to obtain those scrollbars.
virtual bool shouldRubberBandInDirection(ScrollDirection) const { return true; }
- virtual void disconnectFromPage() { }
-
virtual bool scrollAnimatorEnabled() const { return false; }
// NOTE: Only called from Internals for testing.
, m_reflection(0)
, m_scrollCorner(0)
, m_resizer(0)
- , m_scrollableAreaPage(0)
{
m_isNormalFlowOnly = shouldBeNormalFlowOnly();
frame->eventHandler()->resizeLayerDestroyed();
}
- if (m_scrollableAreaPage)
- m_scrollableAreaPage->removeScrollableArea(this);
+ if (Frame* frame = renderer()->frame()) {
+ if (FrameView* frameView = frame->view())
+ frameView->removeScrollableArea(this);
+ }
destroyScrollbar(HorizontalScrollbar);
destroyScrollbar(VerticalScrollbar);
#if ENABLE(CSS_FILTERS)
updateOrRemoveFilterEffect();
#endif
-
- if (scrollsOverflow()) {
- if (!m_scrollableAreaPage) {
- if (Frame* frame = renderer()->frame()) {
- if (Page* page = frame->page()) {
- m_scrollableAreaPage = page;
- m_scrollableAreaPage->addScrollableArea(this);
- }
- }
+
+ if (Frame* frame = renderer()->frame()) {
+ if (FrameView* frameView = frame->view()) {
+ if (scrollsOverflow())
+ frameView->addScrollableArea(this);
+ else
+ frameView->removeScrollableArea(this);
}
- } else if (m_scrollableAreaPage) {
- m_scrollableAreaPage->removeScrollableArea(this);
- m_scrollableAreaPage = 0;
}
// FIXME: Need to detect a swap from custom to native scrollbars (and vice versa).
// Rectangle encompassing the scroll corner and resizer rect.
IntRect scrollCornerAndResizerRect() const;
- virtual void disconnectFromPage() { m_scrollableAreaPage = 0; }
-
// NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
void scrollTo(int, int);
#if USE(ACCELERATED_COMPOSITING)
OwnPtr<RenderLayerBacking> m_backing;
#endif
-
- Page* m_scrollableAreaPage; // Page on which this is registered as a scrollable area.
};
inline void RenderLayer::updateZOrderLists()
ASSERT(element);
ASSERT(element->isHTMLElement());
ASSERT(element->hasTagName(HTMLNames::selectTag));
- if (Page* page = frame()->page()) {
- m_page = page;
- m_page->addScrollableArea(this);
- }
+
+ if (FrameView* frameView = frame()->view())
+ frameView->addScrollableArea(this);
}
RenderListBox::~RenderListBox()
{
setHasVerticalScrollbar(false);
- if (m_page)
- m_page->removeScrollableArea(this);
+
+ if (FrameView* frameView = frame()->view())
+ frameView->removeScrollableArea(this);
}
void RenderListBox::updateFromElement()
virtual ScrollableArea* enclosingScrollableArea() const;
- virtual void disconnectFromPage() { m_page = 0; }
-
// NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
void scrollTo(int newOffset);
int m_indexOffset;
RefPtr<Scrollbar> m_vBar;
-
- Page* m_page;
};
inline RenderListBox* toRenderListBox(RenderObject* object)
+2012-02-07 Anders Carlsson <andersca@apple.com>
+
+ ScrollableAreaSet should be moved from Page to FrameView
+ https://bugs.webkit.org/show_bug.cgi?id=62762
+
+ Reviewed by Beth Dakin.
+
+ Update for changes to WebCore now that the scrollable area set is kept per frame view.
+
+ * src/ScrollbarGroup.cpp:
+ (WebKit::ScrollbarGroup::ScrollbarGroup):
+ (WebKit::ScrollbarGroup::~ScrollbarGroup):
+ * src/ScrollbarGroup.h:
+ (WebCore):
+ (ScrollbarGroup):
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::scrollbarGroup):
+
2012-02-07 Hans Wennborg <hans@chromium.org>
Chromium: remove WebSpeechInputResult::set
#include "config.h"
#include "ScrollbarGroup.h"
-#include "Page.h"
+#include "FrameView.h"
#include "Scrollbar.h"
#include "ScrollbarTheme.h"
#include "platform/WebRect.h"
namespace WebKit {
-ScrollbarGroup::ScrollbarGroup(Page* page)
- : m_page(page)
+ScrollbarGroup::ScrollbarGroup(FrameView* frameView)
+ : m_frameView(frameView)
, m_horizontalScrollbar(0)
, m_verticalScrollbar(0)
{
- m_page->addScrollableArea(this);
+ m_frameView->addScrollableArea(this);
}
ScrollbarGroup::~ScrollbarGroup()
{
ASSERT(!m_horizontalScrollbar);
ASSERT(!m_verticalScrollbar);
- if (m_page)
- m_page->removeScrollableArea(this);
+ m_frameView->removeScrollableArea(this);
}
void ScrollbarGroup::scrollbarCreated(WebScrollbarImpl* scrollbar)
return true;
}
-void ScrollbarGroup::disconnectFromPage()
-{
- m_page = 0;
-}
-
} // namespace WebKit
#include <wtf/RefPtr.h>
namespace WebCore {
-class Page;
+class FrameView;
}
namespace WebKit {
class ScrollbarGroup : public WebCore::ScrollableArea {
public:
- explicit ScrollbarGroup(WebCore::Page*);
+ explicit ScrollbarGroup(WebCore::FrameView*);
~ScrollbarGroup();
void scrollbarCreated(WebScrollbarImpl*);
virtual bool shouldSuspendScrollAnimations() const;
virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate);
virtual bool isOnActivePage() const;
- virtual void disconnectFromPage();
private:
- WebCore::Page* m_page;
+ WebCore::FrameView* m_frameView;
WebCore::IntPoint m_lastMousePosition;
WebScrollbarImpl* m_horizontalScrollbar;
WebScrollbarImpl* m_verticalScrollbar;
ScrollbarGroup* WebPluginContainerImpl::scrollbarGroup()
{
if (!m_scrollbarGroup)
- m_scrollbarGroup = adoptPtr(new ScrollbarGroup(m_element->document()->frame()->page()));
+ m_scrollbarGroup = adoptPtr(new ScrollbarGroup(m_element->document()->frame()->view()));
return m_scrollbarGroup.get();
}
+2012-02-06 Anders Carlsson <andersca@apple.com>
+
+ ScrollableAreaSet should be moved from Page to FrameView
+ https://bugs.webkit.org/show_bug.cgi?id=62762
+
+ Reviewed by Beth Dakin.
+
+ * WebProcess/Plugins/PDF/BuiltInPDFView.cpp:
+ (WebKit::BuiltInPDFView::initialize):
+ Call FrameView::addScrollableArea instead.
+
+ (WebKit::BuiltInPDFView::destroy):
+ Call FrameView::removeScrollableArea instead.
+
+ * WebProcess/Plugins/PDF/BuiltInPDFView.h:
+ Remove disconnectFromPage since it no longer exists on ScrollableArea.
+
2012-02-07 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add cut, copy and paste methods to WebKit2 GTK+ API
bool BuiltInPDFView::initialize(const Parameters& parameters)
{
- m_frame->coreFrame()->page()->addScrollableArea(this);
+ m_frame->coreFrame()->view()->addScrollableArea(this);
// Load the src URL if needed.
m_sourceURL = parameters.url;
void BuiltInPDFView::destroy()
{
if (m_frame) {
- if (Page* page = m_frame->coreFrame()->page())
- page->removeScrollableArea(this);
+ if (FrameView* frameView = m_frame->coreFrame()->view())
+ frameView->removeScrollableArea(this);
}
destroyScrollbar(HorizontalScrollbar);
virtual WebCore::Scrollbar* horizontalScrollbar() const { return m_horizontalScrollbar.get(); }
virtual WebCore::Scrollbar* verticalScrollbar() const { return m_verticalScrollbar.get(); }
virtual bool isOnActivePage() const;
- virtual void disconnectFromPage() { m_frame = 0; }
virtual bool shouldSuspendScrollAnimations() const { return false; } // If we return true, ScrollAnimatorMac will keep cycling a timer forever, waiting for a good time to animate.
virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate);
virtual void zoomAnimatorTransformChanged(float, float, float, ZoomAnimationState) { }