diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-11 09:43:24 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-11 09:43:24 +0200 |
commit | 1b914638db989aaa98631a1c1e02c7b2d44805d8 (patch) | |
tree | 87f4fd2c7b38db320079a5de8877890d2ca3c485 /Source/WebCore/rendering/RenderScrollbar.cpp | |
parent | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (diff) | |
download | qtwebkit-1b914638db989aaa98631a1c1e02c7b2d44805d8.tar.gz |
Imported WebKit commit 9a52e27980f47e8b0d8f8b7cc0fd7b5741bceb92 (http://svn.webkit.org/repository/webkit/trunk@116736)
New snapshot to include QDeclarative* -> QQml* build fixes
Diffstat (limited to 'Source/WebCore/rendering/RenderScrollbar.cpp')
-rw-r--r-- | Source/WebCore/rendering/RenderScrollbar.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/WebCore/rendering/RenderScrollbar.cpp b/Source/WebCore/rendering/RenderScrollbar.cpp index 0c50c0d39..68d4a3bee 100644 --- a/Source/WebCore/rendering/RenderScrollbar.cpp +++ b/Source/WebCore/rendering/RenderScrollbar.cpp @@ -34,16 +34,18 @@ namespace WebCore { -PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, RenderBox* renderer, Frame* owningFrame) +PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, Node* ownerNode, Frame* owningFrame) { - return adoptRef(new RenderScrollbar(scrollableArea, orientation, renderer, owningFrame)); + return adoptRef(new RenderScrollbar(scrollableArea, orientation, ownerNode, owningFrame)); } -RenderScrollbar::RenderScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, RenderBox* renderer, Frame* owningFrame) +RenderScrollbar::RenderScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, Node* ownerNode, Frame* owningFrame) : Scrollbar(scrollableArea, orientation, RegularScrollbar, RenderScrollbarTheme::renderScrollbarTheme()) - , m_owner(renderer) + , m_owner(ownerNode) , m_owningFrame(owningFrame) { + ASSERT(ownerNode || owningFrame); + // FIXME: We need to do this because RenderScrollbar::styleChanged is called as soon as the scrollbar is created. // Update the scrollbar size. @@ -81,7 +83,7 @@ RenderBox* RenderScrollbar::owningRenderer() const RenderBox* currentRenderer = m_owningFrame->ownerRenderer(); return currentRenderer; } - return m_owner; + return m_owner && m_owner->renderer() ? m_owner->renderer()->enclosingBox() : 0; } void RenderScrollbar::setParent(ScrollView* parent) @@ -268,9 +270,11 @@ void RenderScrollbar::updateScrollbarPart(ScrollbarPart partType, bool destroy) RenderScrollbarPart* partRenderer = m_parts.get(partType); if (!partRenderer && needRenderer) { partRenderer = new (owningRenderer()->renderArena()) RenderScrollbarPart(owningRenderer()->document(), this, partType); + partRenderer->setParent(owningRenderer()); m_parts.set(partType, partRenderer); } else if (partRenderer && !needRenderer) { m_parts.remove(partType); + partRenderer->setParent(0); partRenderer->destroy(); partRenderer = 0; } |