Commit 61dc1430 authored by akling@apple.com's avatar akling@apple.com
Browse files

RenderView::frameView() should return a reference.

<https://webkit.org/b/120208>

Reviewed by Antti Koivisto.

A RenderView should always have a corresponding FrameView, so make frameView()
return a reference. Also remove a myriad of now-impossible null checks.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2fa57408
2013-08-23 Andreas Kling <akling@apple.com>
RenderView::frameView() should return a reference.
<https://webkit.org/b/120208>
Reviewed by Antti Koivisto.
A RenderView should always have a corresponding FrameView, so make frameView()
return a reference. Also remove a myriad of now-impossible null checks.
2013-08-23 Allan Sandfeld Jensen <allan.jensen@digia.com>
 
REGRESSION(r153939) Fix typo in Qt build-files
......@@ -1345,7 +1345,7 @@ int AccessibilityRenderObject::layoutCount() const
{
if (!m_renderer->isRenderView())
return 0;
return toRenderView(m_renderer)->frameView()->layoutCount();
return toRenderView(m_renderer)->frameView().layoutCount();
}
String AccessibilityRenderObject::text() const
......@@ -1700,7 +1700,7 @@ FrameView* AccessibilityRenderObject::topDocumentFrameView() const
RenderView* renderView = topRenderer();
if (!renderView || !renderView->view())
return 0;
return renderView->view()->frameView();
return &renderView->view()->frameView();
}
Widget* AccessibilityRenderObject::widget() const
......@@ -1770,7 +1770,7 @@ FrameView* AccessibilityRenderObject::frameViewIfRenderView() const
if (!m_renderer->isRenderView())
return 0;
// this is the RenderObject's Document's renderer's FrameView
return m_renderer->view()->frameView();
return &m_renderer->view()->frameView();
}
// This function is like a cross-platform version of - (WebCoreTextMarkerRange*)textMarkerRange. It returns
......@@ -1983,9 +1983,9 @@ VisiblePosition AccessibilityRenderObject::visiblePositionForPoint(const IntPoin
if (!renderView)
return VisiblePosition();
FrameView* frameView = renderView->frameView();
if (!frameView)
return VisiblePosition();
#if PLATFORM(MAC)
FrameView* frameView = &renderView->frameView();
#endif
Node* innerNode = 0;
......@@ -2022,7 +2022,9 @@ VisiblePosition AccessibilityRenderObject::visiblePositionForPoint(const IntPoin
break;
Frame& frame = toFrameView(widget)->frame();
renderView = frame.document()->renderView();
#if PLATFORM(MAC)
frameView = toFrameView(widget);
#endif
}
return innerNode->renderer()->positionForPoint(pointResult);
......
......@@ -1411,7 +1411,7 @@ bool FrameSelection::recomputeCaretRect()
bool CaretBase::shouldRepaintCaret(const RenderView* view, bool isContentEditable) const
{
ASSERT(view);
Frame* frame = view->frameView() ? &view->frameView()->frame() : 0; // The frame where the selection started.
Frame* frame = &view->frameView().frame(); // The frame where the selection started.
bool caretBrowsing = frame && frame->settings().caretBrowsingEnabled();
return (caretBrowsing || isContentEditable);
}
......
......@@ -1386,7 +1386,7 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffs
// Figure out if we need to push a transparency layer to render our mask.
bool pushTransparencyLayer = false;
bool compositedMask = renderer()->hasLayer() && boxModelObject()->layer()->hasCompositedMask();
bool flattenCompositingLayers = renderer()->view()->frameView() && renderer()->view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers;
bool flattenCompositingLayers = renderer()->view()->frameView().paintBehavior() & PaintBehaviorFlattenCompositingLayers;
CompositeOperator compositeOp = CompositeSourceOver;
if (!compositedMask || flattenCompositingLayers) {
if ((maskBoxImage && renderer()->style()->maskLayers()->hasImage()) || renderer()->style()->maskLayers()->next())
......
......@@ -5233,7 +5233,7 @@ bool RenderBlock::hitTestFloats(const HitTestRequest& request, HitTestResult& re
LayoutPoint adjustedLocation = accumulatedOffset;
if (isRenderView()) {
adjustedLocation += toLayoutSize(toRenderView(this)->frameView()->scrollPosition());
adjustedLocation += toLayoutSize(toRenderView(this)->frameView().scrollPosition());
}
const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
......
......@@ -1403,7 +1403,7 @@ void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& pa
// Figure out if we need to push a transparency layer to render our mask.
bool pushTransparencyLayer = false;
bool compositedMask = hasLayer() && layer()->hasCompositedMask();
bool flattenCompositingLayers = view()->frameView() && view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers;
bool flattenCompositingLayers = view()->frameView().paintBehavior() & PaintBehaviorFlattenCompositingLayers;
CompositeOperator compositeOp = CompositeSourceOver;
bool allMaskImagesLoaded = true;
......@@ -1555,16 +1555,9 @@ bool RenderBox::repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer
if (drawingRootBackground) {
layerRenderer = view();
LayoutUnit rw;
LayoutUnit rh;
LayoutUnit rw = toRenderView(layerRenderer)->frameView().contentsWidth();
LayoutUnit rh = toRenderView(layerRenderer)->frameView().contentsHeight();
if (FrameView* frameView = toRenderView(layerRenderer)->frameView()) {
rw = frameView->contentsWidth();
rh = frameView->contentsHeight();
} else {
rw = layerRenderer->width();
rh = layerRenderer->height();
}
rendererRect = LayoutRect(-layerRenderer->marginLeft(),
-layerRenderer->marginTop(),
max(layerRenderer->width() + layerRenderer->marginWidth() + layerRenderer->borderLeft() + layerRenderer->borderRight(), rw),
......@@ -1805,7 +1798,7 @@ LayoutUnit RenderBox::perpendicularContainingBlockLogicalHeight() const
// FIXME: For now just support fixed heights. Eventually should support percentage heights as well.
if (!logicalHeightLength.isFixed()) {
LayoutUnit fillFallbackExtent = containingBlockStyle->isHorizontalWritingMode() ? view()->frameView()->visibleHeight() : view()->frameView()->visibleWidth();
LayoutUnit fillFallbackExtent = containingBlockStyle->isHorizontalWritingMode() ? view()->frameView().visibleHeight() : view()->frameView().visibleWidth();
LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadding);
return min(fillAvailableExtent, fillFallbackExtent);
}
......@@ -2193,7 +2186,7 @@ void RenderBox::computeLogicalWidthInRegion(LogicalExtentComputedValues& compute
}
// If layout is limited to a subtree, the subtree root's logical width does not change.
if (node() && view()->frameView() && view()->frameView()->layoutRoot(true) == this)
if (node() && view()->frameView().layoutRoot(true) == this)
return;
// The parent box is flexing us, so it has increased or decreased our
......@@ -2922,7 +2915,7 @@ LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightTy
LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogicalHeightType heightType) const
{
if (isRenderView())
return isHorizontalWritingMode() ? toRenderView(this)->frameView()->visibleHeight() : toRenderView(this)->frameView()->visibleWidth();
return isHorizontalWritingMode() ? toRenderView(this)->frameView().visibleHeight() : toRenderView(this)->frameView().visibleWidth();
// We need to stop here, since we don't want to increase the height of the table
// artificially. We're going to rely on this cell getting expanded to some new
......@@ -2994,7 +2987,7 @@ LayoutUnit RenderBox::containingBlockLogicalWidthForPositioned(const RenderBoxMo
{
// Container for position:fixed is the frame.
Frame* frame = view() ? view()->frame(): 0;
FrameView* frameView = view() ? view()->frameView() : 0;
FrameView* frameView = view() ? &view()->frameView() : 0;
if (fixedElementLaysOutRelativeToFrame(frame, frameView))
return (view()->isHorizontalWritingMode() ? frameView->visibleWidth() : frameView->visibleHeight()) / frame->frameScaleFactor();
......@@ -3050,7 +3043,7 @@ LayoutUnit RenderBox::containingBlockLogicalWidthForPositioned(const RenderBoxMo
LayoutUnit RenderBox::containingBlockLogicalHeightForPositioned(const RenderBoxModelObject* containingBlock, bool checkForPerpendicularWritingMode) const
{
Frame* frame = view() ? view()->frame(): 0;
FrameView* frameView = view() ? view()->frameView() : 0;
FrameView* frameView = view() ? &view()->frameView() : 0;
if (fixedElementLaysOutRelativeToFrame(frame, frameView))
return (view()->isHorizontalWritingMode() ? frameView->visibleHeight() : frameView->visibleWidth()) / frame->frameScaleFactor();
......
......@@ -620,8 +620,8 @@ LayoutSize RenderBoxModelObject::stickyPositionOffset() const
FloatPoint scrollOffset = FloatPoint() + enclosingClippingLayer->scrollOffset();
constrainingRect.setLocation(scrollOffset);
} else {
LayoutRect viewportRect = view()->frameView()->viewportConstrainedVisibleContentRect();
float scale = view()->frameView()->frame().frameScaleFactor();
LayoutRect viewportRect = view()->frameView().viewportConstrainedVisibleContentRect();
float scale = view()->frameView().frame().frameScaleFactor();
viewportRect.scale(1 / scale);
constrainingRect = viewportRect;
}
......@@ -922,7 +922,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
bool isOpaqueRoot = false;
if (isRoot) {
isOpaqueRoot = true;
if (!bgLayer->next() && !(bgColor.isValid() && bgColor.alpha() == 255) && view()->frameView()) {
if (!bgLayer->next() && !(bgColor.isValid() && bgColor.alpha() == 255)) {
Element* ownerElement = document()->ownerElement();
if (ownerElement) {
if (!ownerElement->hasTagName(frameTag)) {
......@@ -943,9 +943,9 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
#endif
}
} else
isOpaqueRoot = !view()->frameView()->isTransparent();
isOpaqueRoot = !view()->frameView().isTransparent();
}
view()->frameView()->setContentIsOpaque(isOpaqueRoot);
view()->frameView().setContentIsOpaque(isOpaqueRoot);
}
// Paint the color first underneath all images, culled if background image occludes it.
......@@ -962,7 +962,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
Color baseColor;
bool shouldClearBackground = false;
if (isOpaqueRoot) {
baseColor = view()->frameView()->baseBackgroundColor();
baseColor = view()->frameView().baseBackgroundColor();
if (!baseColor.alpha())
shouldClearBackground = true;
}
......@@ -1212,7 +1212,7 @@ bool RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates() const
if (!isRoot())
return false;
if (view()->frameView() && view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers)
if (view()->frameView().paintBehavior() & PaintBehaviorFlattenCompositingLayers)
return false;
RenderLayer* rootLayer = view()->layer();
......@@ -1239,7 +1239,7 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const RenderLayerMod
bool fixedAttachment = fillLayer->attachment() == FixedBackgroundAttachment;
#if ENABLE(FAST_MOBILE_SCROLLING)
if (view()->frameView() && view()->frameView()->canBlitOnScroll()) {
if (view()->frameView().canBlitOnScroll()) {
// As a side effect of an optimization to blit on scroll, we do not honor the CSS
// property "background-attachment: fixed" because it may result in rendering
// artifacts. Note, these artifacts only appear if we are blitting on scroll of
......@@ -1282,8 +1282,8 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const RenderLayerMod
IntRect viewportRect = pixelSnappedIntRect(viewRect());
if (fixedBackgroundPaintsInLocalCoordinates())
viewportRect.setLocation(IntPoint());
else if (FrameView* frameView = view()->frameView())
viewportRect.setLocation(IntPoint(frameView->scrollOffsetForFixedPosition()));
else
viewportRect.setLocation(IntPoint(view()->frameView().scrollOffsetForFixedPosition()));
if (paintContainer) {
IntPoint absoluteContainerOffset = roundedIntPoint(paintContainer->localToAbsolute(FloatPoint()));
......
......@@ -109,7 +109,7 @@ RenderEmbeddedObject::RenderEmbeddedObject(Element* element)
, m_mouseDownWasInUnavailablePluginIndicator(false)
{
// Actual size is not known yet, report the default intrinsic size.
view()->frameView()->incrementVisuallyNonEmptyPixelCount(roundedIntSize(intrinsicSize()));
view()->frameView().incrementVisuallyNonEmptyPixelCount(roundedIntSize(intrinsicSize()));
}
RenderEmbeddedObject::~RenderEmbeddedObject()
......
......@@ -45,7 +45,7 @@ RenderHTMLCanvas::RenderHTMLCanvas(HTMLCanvasElement* element)
: RenderReplaced(element, element->size())
{
// Actual size is not known yet, report the default intrinsic size.
view()->frameView()->incrementVisuallyNonEmptyPixelCount(roundedIntSize(intrinsicSize()));
view()->frameView().incrementVisuallyNonEmptyPixelCount(roundedIntSize(intrinsicSize()));
}
bool RenderHTMLCanvas::requiresLayer() const
......
......@@ -174,7 +174,7 @@ void RenderImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect)
if (!m_didIncrementVisuallyNonEmptyPixelCount) {
// At a zoom level of 1 the image is guaranteed to have an integer size.
view()->frameView()->incrementVisuallyNonEmptyPixelCount(flooredIntSize(m_imageResource->imageSize(1.0f)));
view()->frameView().incrementVisuallyNonEmptyPixelCount(flooredIntSize(m_imageResource->imageSize(1.0f)));
m_didIncrementVisuallyNonEmptyPixelCount = true;
}
......
......@@ -1421,7 +1421,7 @@ bool RenderLayer::scrollbarAnimationsAreSuppressed() const
RenderView* view = renderer()->view();
if (!view)
return false;
return view->frameView()->scrollbarAnimationsAreSuppressed();
return view->frameView().scrollbarAnimationsAreSuppressed();
}
RenderLayer* RenderLayer::enclosingTransformedAncestor() const
......@@ -2069,8 +2069,7 @@ void RenderLayer::updateNeedsCompositedScrolling()
{
bool oldNeedsCompositedScrolling = m_needsCompositedScrolling;
FrameView* frameView = renderer()->view()->frameView();
if (!frameView || !frameView->containsScrollableArea(this))
if (!renderer()->view()->frameView().containsScrollableArea(this))
m_needsCompositedScrolling = false;
else {
bool forceUseCompositedScrolling = acceleratedCompositingForOverflowScrollEnabled()
......@@ -2172,10 +2171,10 @@ void RenderLayer::scrollByRecursively(const IntSize& delta, ScrollOffsetClamping
if (frame)
frame->eventHandler().updateAutoscrollRenderer();
}
} else if (renderer()->view()->frameView()) {
} else {
// If we are here, we were called on a renderer that can be programmatically scrolled, but doesn't
// have an overflow clip. Which means that it is a document node that can be scrolled.
renderer()->view()->frameView()->scrollBy(delta);
renderer()->view()->frameView().scrollBy(delta);
// FIXME: If we didn't scroll the whole way, do we want to try looking at the frames ownerElement?
// https://bugs.webkit.org/show_bug.cgi?id=28237
......@@ -2234,14 +2233,14 @@ void RenderLayer::scrollTo(int x, int y)
// Update the positions of our child layers (if needed as only fixed layers should be impacted by a scroll).
// We don't update compositing layers, because we need to do a deep update from the compositing ancestor.
bool inLayout = view ? view->frameView()->isInLayout() : false;
bool inLayout = view ? view->frameView().isInLayout() : false;
if (!inLayout) {
// If we're in the middle of layout, we'll just update layers once layout has finished.
updateLayerPositionsAfterOverflowScroll();
if (view) {
// Update regions, scrolling may change the clip of a particular region.
#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION)
view->frameView()->updateAnnotatedRegions();
view->frameView().updateAnnotatedRegions();
#endif
view->updateWidgetPositions();
}
......@@ -2715,7 +2714,7 @@ IntRect RenderLayer::convertFromScrollbarToContainingView(const Scrollbar* scrol
IntRect rect = scrollbarRect;
rect.move(scrollbarOffset(scrollbar));
return view->frameView()->convertFromRenderer(renderer(), rect);
return view->frameView().convertFromRenderer(renderer(), rect);
}
IntRect RenderLayer::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
......@@ -2724,7 +2723,7 @@ IntRect RenderLayer::convertFromContainingViewToScrollbar(const Scrollbar* scrol
if (!view)
return parentRect;
IntRect rect = view->frameView()->convertToRenderer(renderer(), parentRect);
IntRect rect = view->frameView().convertToRenderer(renderer(), parentRect);
rect.move(-scrollbarOffset(scrollbar));
return rect;
}
......@@ -2737,7 +2736,7 @@ IntPoint RenderLayer::convertFromScrollbarToContainingView(const Scrollbar* scro
IntPoint point = scrollbarPoint;
point.move(scrollbarOffset(scrollbar));
return view->frameView()->convertFromRenderer(renderer(), point);
return view->frameView().convertFromRenderer(renderer(), point);
}
IntPoint RenderLayer::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
......@@ -2746,7 +2745,7 @@ IntPoint RenderLayer::convertFromContainingViewToScrollbar(const Scrollbar* scro
if (!view)
return parentPoint;
IntPoint point = view->frameView()->convertToRenderer(renderer(), parentPoint);
IntPoint point = view->frameView().convertToRenderer(renderer(), parentPoint);
point.move(-scrollbarOffset(scrollbar));
return point;
......@@ -2772,7 +2771,7 @@ bool RenderLayer::shouldSuspendScrollAnimations() const
RenderView* view = renderer()->view();
if (!view)
return true;
return view->frameView()->shouldSuspendScrollAnimations();
return view->frameView().shouldSuspendScrollAnimations();
}
bool RenderLayer::scrollbarsCanBeActive() const
......@@ -2780,7 +2779,7 @@ bool RenderLayer::scrollbarsCanBeActive() const
RenderView* view = renderer()->view();
if (!view)
return false;
return view->frameView()->scrollbarsCanBeActive();
return view->frameView().scrollbarsCanBeActive();
}
IntPoint RenderLayer::lastKnownMousePosition() const
......@@ -5087,7 +5086,7 @@ void RenderLayer::calculateClipRects(const ClipRectsContext& clipRectsContext, C
RenderView* view = renderer()->view();
ASSERT(view);
if (view && clipRects.fixed() && clipRectsContext.rootLayer->renderer() == view) {
offset -= view->frameView()->scrollOffsetForFixedPosition();
offset -= view->frameView().scrollOffsetForFixedPosition();
}
if (renderer()->hasOverflowClip()) {
......@@ -5151,7 +5150,7 @@ ClipRect RenderLayer::backgroundClipRect(const ClipRectsContext& clipRectsContex
// Note: infinite clipRects should not be scrolled here, otherwise they will accidentally no longer be considered infinite.
if (parentRects.fixed() && clipRectsContext.rootLayer->renderer() == view && backgroundClipRect != PaintInfo::infiniteRect())
backgroundClipRect.move(view->frameView()->scrollOffsetForFixedPosition());
backgroundClipRect.move(view->frameView().scrollOffsetForFixedPosition());
return backgroundClipRect;
}
......@@ -5432,13 +5431,9 @@ LayoutRect RenderLayer::calculateLayerBounds(const RenderLayer* ancestorLayer, c
// If the root layer becomes composited (e.g. because some descendant with negative z-index is composited),
// then it has to be big enough to cover the viewport in order to display the background. This is akin
// to the code in RenderBox::paintRootBoxFillLayers().
if (FrameView* frameView = renderer->view()->frameView()) {
LayoutUnit contentsWidth = frameView->contentsWidth();
LayoutUnit contentsHeight = frameView->contentsHeight();
boundingBoxRect.setWidth(max(boundingBoxRect.width(), contentsWidth - boundingBoxRect.x()));
boundingBoxRect.setHeight(max(boundingBoxRect.height(), contentsHeight - boundingBoxRect.y()));
}
const FrameView& frameView = renderer->view()->frameView();
boundingBoxRect.setWidth(max(boundingBoxRect.width(), frameView.contentsWidth() - boundingBoxRect.x()));
boundingBoxRect.setHeight(max(boundingBoxRect.height(), frameView.contentsHeight() - boundingBoxRect.y()));
}
LayoutRect unionBounds = boundingBoxRect;
......
......@@ -120,7 +120,7 @@ RenderLayerBacking::RenderLayerBacking(RenderLayer* layer)
, m_didSwitchToFullTileCoverageDuringLoading(false)
{
if (layer->isRootLayer()) {
Frame& frame = toRenderView(renderer())->frameView()->frame();
Frame& frame = toRenderView(renderer())->frameView().frame();
Page* page = frame.page();
if (page && page->mainFrame() == &frame) {
m_isMainFrameRenderViewLayer = true;
......@@ -435,7 +435,7 @@ void RenderLayerBacking::updateCompositedBounds()
LayoutRect clippingBounds;
if (renderer()->style()->position() == FixedPosition && renderer()->container() == view)
clippingBounds = view->frameView()->viewportConstrainedVisibleContentRect();
clippingBounds = view->frameView().viewportConstrainedVisibleContentRect();
else
clippingBounds = view->unscaledDocumentRect();
......@@ -786,9 +786,9 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
FloatPoint backgroundPosition;
FloatSize backgroundSize = contentsSize;
if (backgroundLayerPaintsFixedRootBackground()) {
FrameView* frameView = toRenderView(renderer())->frameView();
backgroundPosition = IntPoint(frameView->scrollOffsetForFixedPosition());
backgroundSize = frameView->visibleContentRect().size();
const FrameView& frameView = toRenderView(renderer())->frameView();
backgroundPosition = IntPoint(frameView.scrollOffsetForFixedPosition());
backgroundSize = frameView.visibleContentRect().size();
}
m_backgroundLayer->setPosition(backgroundPosition);
m_backgroundLayer->setSize(backgroundSize);
......
......@@ -172,15 +172,13 @@ void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt
setChildNeedsLayout(true);
}
if (FrameView *frameView = view()->frameView()) {
bool newStyleIsViewportConstained = style()->hasViewportConstrainedPosition();
bool oldStyleIsViewportConstrained = oldStyle && oldStyle->hasViewportConstrainedPosition();
if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) {
if (newStyleIsViewportConstained && layer())
frameView->addViewportConstrainedObject(this);
else
frameView->removeViewportConstrainedObject(this);
}
bool newStyleIsViewportConstained = style()->hasViewportConstrainedPosition();
bool oldStyleIsViewportConstrained = oldStyle && oldStyle->hasViewportConstrainedPosition();
if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) {
if (newStyleIsViewportConstained && layer())
view()->frameView().addViewportConstrainedObject(this);
else
view()->frameView().removeViewportConstrainedObject(this);
}
}
......
......@@ -753,7 +753,7 @@ IntRect RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scr
int scrollbarTop = borderTop();
rect.move(scrollbarLeft, scrollbarTop);
return view->frameView()->convertFromRenderer(this, rect);
return view->frameView().convertFromRenderer(this, rect);
}
IntRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
......@@ -762,7 +762,7 @@ IntRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scr
if (!view)
return parentRect;
IntRect rect = view->frameView()->convertToRenderer(this, parentRect);
IntRect rect = view->frameView().convertToRenderer(this, parentRect);
int scrollbarLeft = width() - borderRight() - scrollbar->width();
int scrollbarTop = borderTop();
......@@ -782,7 +782,7 @@ IntPoint RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* sc
int scrollbarTop = borderTop();
point.move(scrollbarLeft, scrollbarTop);
return view->frameView()->convertFromRenderer(this, point);
return view->frameView().convertFromRenderer(this, point);
}
IntPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
......@@ -791,7 +791,7 @@ IntPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* sc
if (!view)
return parentPoint;
IntPoint point = view->frameView()->convertToRenderer(this, parentPoint);
IntPoint point = view->frameView().convertToRenderer(this, parentPoint);
int scrollbarLeft = width() - borderRight() - scrollbar->width();
int scrollbarTop = borderTop();
......@@ -819,7 +819,7 @@ IntPoint RenderListBox::lastKnownMousePosition() const
RenderView* view = this->view();
if (!view)
return IntPoint();
return view->frameView()->lastKnownMousePosition();
return view->frameView().lastKnownMousePosition();
}
bool RenderListBox::isHandlingWheelEvent() const
......@@ -827,7 +827,7 @@ bool RenderListBox::isHandlingWheelEvent() const
RenderView* view = this->view();
if (!view)
return false;
return view->frameView()->isHandlingWheelEvent();
return view->frameView().isHandlingWheelEvent();
}
bool RenderListBox::shouldSuspendScrollAnimations() const
......@@ -835,7 +835,7 @@ bool RenderListBox::shouldSuspendScrollAnimations() const
RenderView* view = this->view();
if (!view)
return true;
return view->frameView()->shouldSuspendScrollAnimations();
return view->frameView().shouldSuspendScrollAnimations();
}
bool RenderListBox::scrollbarsCanBeActive() const
......@@ -843,7 +843,7 @@ bool RenderListBox::scrollbarsCanBeActive() const
RenderView* view = this->view();
if (!view)
return false;
return view->frameView()->scrollbarsCanBeActive();
return view->frameView().scrollbarsCanBeActive();
}
bool RenderListBox::scrollbarAnimationsAreSuppressed() const
......@@ -851,7 +851,7 @@ bool RenderListBox::scrollbarAnimationsAreSuppressed() const
RenderView* view = this->view();
if (!view)
return false;
return view->frameView()->scrollbarAnimationsAreSuppressed();
return view->frameView().scrollbarAnimationsAreSuppressed();
}
ScrollableArea* RenderListBox::enclosingScrollableArea() const
......
......@@ -1964,31 +1964,29 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newS
s_noLongerAffectsParentBlock = false;
}
if (FrameView* frameView = view()->frameView()) {
bool repaintFixedBackgroundsOnScroll = shouldRepaintFixedBackgroundsOnScroll(frameView);
bool repaintFixedBackgroundsOnScroll = shouldRepaintFixedBackgroundsOnScroll(&view()->frameView());
bool newStyleSlowScroll = newStyle && repaintFixedBackgroundsOnScroll && newStyle->hasFixedBackgroundImage();
bool oldStyleSlowScroll = m_style && repaintFixedBackgroundsOnScroll && m_style->hasFixedBackgroundImage();
bool newStyleSlowScroll = newStyle && repaintFixedBackgroundsOnScroll && newStyle->hasFixedBackgroundImage();
bool oldStyleSlowScroll = m_style && repaintFixedBackgroundsOnScroll && m_style->hasFixedBackgroundImage();
#if USE(ACCELERATED_COMPOSITING)
bool drawsRootBackground = isRoot() || (isBody() && !rendererHasBackground(document()->documentElement()->renderer()));
if (drawsRootBackground && repaintFixedBackgroundsOnScroll) {
if (view()->compositor()->supportsFixedRootBackgroundCompositing()) {
if (newStyleSlowScroll && newStyle->hasEntirelyFixedBackground())
newStyleSlowScroll = false;
if (oldStyleSlowScroll && m_style->hasEntirelyFixedBackground())
oldStyleSlowScroll = false;
}
bool drawsRootBackground = isRoot() || (isBody() && !rendererHasBackground(document()->documentElement()->renderer()));
if (drawsRootBackground && repaintFixedBackgroundsOnScroll) {
if (view()->compositor()->supportsFixedRootBackgroundCompositing()) {
if (newStyleSlowScroll && newStyle->hasEntirelyFixedBackground())
newStyleSlowScroll = false;
if (oldStyleSlowScroll && m_style->hasEntirelyFixedBackground())
oldStyleSlowScroll = false;
}
}
#endif
if (oldStyleSlowScroll != newStyleSlowScroll) {
if (oldStyleSlowScroll)
frameView->removeSlowRepaintObject(this);
if (oldStyleSlowScroll != newStyleSlowScroll) {
if (oldStyleSlowScroll)
view()->frameView().removeSlowRepaintObject(this);
if (newStyleSlowScroll)
frameView->addSlowRepaintObject(this);
}
if (newStyleSlowScroll)
view()->frameView().addSlowRepaintObject(this);
}
}
......@@ -2541,11 +2539,9 @@ void RenderObject::willBeRemovedFromTree()
// FIXME: We should ASSERT(isRooted()) but we have some out-of-order removals which would need to be fixed first.