ASSERT(!m_scrollCorner);
ASSERT(m_actionScheduler->isEmpty());
- if (m_frame) {
- ASSERT(m_frame->view() != this || !m_frame->contentRenderer());
- RenderPart* renderer = m_frame->ownerRenderer();
- if (renderer && renderer->widget() == this)
- renderer->setWidget(0);
- }
+ ASSERT(frame().view() != this || !frame().contentRenderer());
+ RenderPart* renderer = frame().ownerRenderer();
+ if (renderer && renderer->widget() == this)
+ renderer->setWidget(0);
}
void FrameView::reset()
cache->remove(this);
}
-void FrameView::clearFrame()
-{
- m_frame = 0;
-}
-
void FrameView::resetScrollbars()
{
// Reset the document's scrollbars back to our defaults before we yield the floor.
m_size = LayoutSize();
// Propagate the marginwidth/height and scrolling modes to the view.
- Element* ownerElement = m_frame ? m_frame->ownerElement() : 0;
+ Element* ownerElement = frame().ownerElement();
if (ownerElement && (ownerElement->hasTagName(frameTag) || ownerElement->hasTagName(iframeTag))) {
HTMLFrameElementBase* frameElt = toHTMLFrameElementBase(ownerElement);
if (frameElt->scrollingMode() == ScrollbarAlwaysOff)
setMarginHeight(marginHeight);
}
- Page* page = frame() ? frame()->page() : 0;
+ Page* page = frame().page();
if (page && page->chrome().client()->shouldPaintEntireContents())
setPaintsEntireContents(true);
}
// right now, otherwise it won't be able to reach the topDocument()'s axObject cache later.
removeFromAXObjectCache();
- if (m_frame && m_frame->page()) {
- if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scrollingCoordinator())
+ if (frame().page()) {
+ if (ScrollingCoordinator* scrollingCoordinator = frame().page()->scrollingCoordinator())
scrollingCoordinator->willDestroyScrollableArea(this);
}
}
reset();
- if (m_frame) {
- if (RenderPart* renderer = m_frame->ownerRenderer())
- renderer->viewCleared();
- }
+ if (RenderPart* renderer = frame().ownerRenderer())
+ renderer->viewCleared();
setScrollbarsSuppressed(true);
}
bool FrameView::isMainFrameView() const
{
- return m_frame && m_frame->page() && m_frame->page()->mainFrame() == m_frame;
+ return frame().page() && frame().page()->mainFrame() == &frame();
}
bool FrameView::didFirstLayout() const
return;
}
- if (!m_frame)
- return;
-
- RenderPart* renderer = m_frame->ownerRenderer();
+ RenderPart* renderer = frame().ownerRenderer();
if (!renderer)
return;
#if ENABLE(TEXT_AUTOSIZING)
// Autosized font sizes depend on the width of the viewing area.
if (newRect.width() != oldRect.width()) {
- Page* page = m_frame ? m_frame->page() : 0;
+ Page* page = frame().page();
if (isMainFrameView() && page->settings().textAutosizingEnabled()) {
for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
- m_frame->document()->textAutosizer()->recalculateMultipliers();
+ frame().document()->textAutosizer()->recalculateMultipliers();
}
}
#endif
bool FrameView::frameFlatteningEnabled() const
{
- Settings* settings = frame() ? frame()->settings() : 0;
- if (!settings)
- return false;
-
- return settings->frameFlatteningEnabled();
+ if (Settings* settings = frame().settings())
+ return settings->frameFlatteningEnabled();
+ return false;
}
bool FrameView::isFrameFlatteningValidForThisFrame() const
if (!frameFlatteningEnabled())
return false;
- HTMLFrameOwnerElement* owner = frame() ? frame()->ownerElement() : 0;
+ HTMLFrameOwnerElement* owner = frame().ownerElement();
if (!owner)
return false;
bool FrameView::avoidScrollbarCreation() const
{
- ASSERT(m_frame);
// with frame flattening no subframe can have scrollbars
// but we also cannot turn scrollbars off as we determine
// our flattening policy using that.
PassRefPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientation orientation)
{
- if (Settings* settings = m_frame->settings()) {
+ if (Settings* settings = frame().settings()) {
if (!settings->allowCustomScrollbarInMainFrame() && isMainFrameView())
return ScrollView::createScrollbar(orientation);
}
// FIXME: We need to update the scrollbar dynamically as documents change (or as doc elements and bodies get discovered that have custom styles).
- Document* doc = m_frame->document();
+ Document* doc = frame().document();
// Try the <body> element first as a scrollbar source.
Element* body = doc ? doc->body() : 0;
return RenderScrollbar::createCustomScrollbar(this, orientation, docElement);
// If we have an owning iframe/frame element, then it can set the custom scrollbar also.
- RenderPart* frameRenderer = m_frame->ownerRenderer();
+ RenderPart* frameRenderer = frame().ownerRenderer();
if (frameRenderer && frameRenderer->style()->hasPseudoStyle(SCROLLBAR))
- return RenderScrollbar::createCustomScrollbar(this, orientation, 0, m_frame.get());
+ return RenderScrollbar::createCustomScrollbar(this, orientation, 0, &frame());
// Nobody set a custom style, so we just use a native scrollbar.
return ScrollView::createScrollbar(orientation);
ScrollView::setContentsSize(size);
ScrollView::contentsResized();
- Page* page = frame() ? frame()->page() : 0;
+ Page* page = frame().page();
if (!page)
return;
updateScrollableAreaSet();
- page->chrome().contentsSizeChanged(frame(), size); // Notify only.
+ page->chrome().contentsSizeChanged(&frame(), size); // Notify only.
m_deferSetNeedsLayouts--;
if (!renderView)
return;
- ASSERT(m_frame->view() == this);
+ ASSERT(frame().view() == this);
const IntRect rect = renderView->documentRect();
const IntSize& size = rect.size();
- ScrollView::setScrollOrigin(IntPoint(-rect.x(), -rect.y()), !m_frame->document()->printing(), size == contentsSize());
+ ScrollView::setScrollOrigin(IntPoint(-rect.x(), -rect.y()), !frame().document()->printing(), size == contentsSize());
setContentsSize(size);
}
// there is a frameScaleFactor that is greater than one on the main frame. Also disregard hidden if there is a
// header or footer.
- bool overrideHidden = isMainFrameView() && ((m_frame->frameScaleFactor() > 1) || headerHeight() || footerHeight());
+ bool overrideHidden = isMainFrameView() && ((frame().frameScaleFactor() > 1) || headerHeight() || footerHeight());
EOverflow overflowX = o->style()->overflowX();
EOverflow overflowY = o->style()->overflowY();
void FrameView::applyPaginationToViewport()
{
- Document* document = m_frame->document();
+ Document* document = frame().document();
Node* documentElement = document->documentElement();
RenderObject* documentRenderer = documentElement ? documentElement->renderer() : 0;
RenderObject* documentOrBodyRenderer = documentRenderer;
{
m_viewportRenderer = 0;
- const HTMLFrameOwnerElement* owner = m_frame->ownerElement();
+ const HTMLFrameOwnerElement* owner = frame().ownerElement();
if (owner && (owner->scrollingMode() == ScrollbarAlwaysOff)) {
hMode = ScrollbarAlwaysOff;
vMode = ScrollbarAlwaysOff;
// Seamless documents begin with heights of 0; we special case that here
// to correctly render documents that don't need scrollbars.
IntSize fullVisibleSize = visibleContentRect(IncludeScrollbars).size();
- bool isSeamlessDocument = frame() && frame()->document() && frame()->document()->shouldDisplaySeamlesslyWithParent();
+ bool isSeamlessDocument = frame().document() && frame().document()->shouldDisplaySeamlesslyWithParent();
vMode = (isSeamlessDocument && !fullVisibleSize.height()) ? ScrollbarAlwaysOff : ScrollbarAuto;
} else {
hMode = ScrollbarAlwaysOff;
}
if (!m_layoutRoot) {
- Document* document = m_frame->document();
+ Document* document = frame().document();
Node* documentElement = document->documentElement();
RenderObject* rootRenderer = documentElement ? documentElement->renderer() : 0;
Node* body = document->body();
RenderView* renderView = this->renderView();
if (!renderView)
return false;
- if (m_frame->settings() && m_frame->settings()->compositedScrollingForFramesEnabled())
+ if (frame().settings() && frame().settings()->compositedScrollingForFramesEnabled())
return renderView->compositor()->inForcedCompositingMode();
return false;
}
bool FrameView::scrollbarAnimationsAreSuppressed() const
{
- Page* page = frame() ? frame()->page() : 0;
- if (!page)
- return true;
- return page->shouldSuppressScrollbarAnimations();
+ if (Page* page = frame().page())
+ return page->shouldSuppressScrollbarAnimations();
+ return true;
}
bool FrameView::flushCompositingStateForThisFrame(Frame* rootFrameForFlush)
if (!renderView)
return true; // We don't want to keep trying to update layers if we have no renderer.
- ASSERT(m_frame->view() == this);
+ ASSERT(frame().view() == this);
// If we sync compositing layers when a layout is pending, we may cause painting of compositing
// layer content to occur before layout has happened, which will cause paintContents() to bail.
// visible flash to occur. Instead, stop the deferred repaint timer and repaint immediately.
flushDeferredRepaints();
- renderView->compositor()->flushPendingLayerChanges(rootFrameForFlush == m_frame);
+ renderView->compositor()->flushPendingLayerChanges(rootFrameForFlush == &frame());
return true;
}
void FrameView::setNeedsOneShotDrawingSynchronization()
{
- Page* page = frame() ? frame()->page() : 0;
- if (page)
+ if (Page* page = frame().page())
page->chrome().client()->setNeedsOneShotDrawingSynchronization();
}
void FrameView::setHeaderHeight(int headerHeight)
{
- if (m_frame && m_frame->page())
+ if (frame().page())
ASSERT(isMainFrameView());
m_headerHeight = headerHeight;
void FrameView::setFooterHeight(int footerHeight)
{
- if (m_frame && m_frame->page())
+ if (frame().page())
ASSERT(isMainFrameView());
m_footerHeight = footerHeight;
bool FrameView::hasCompositingAncestor() const
{
#if USE(ACCELERATED_COMPOSITING)
- for (Frame* frame = m_frame->tree()->parent(); frame; frame = frame->tree()->parent()) {
+ for (Frame* frame = this->frame().tree()->parent(); frame; frame = frame->tree()->parent()) {
if (FrameView* view = frame->view()) {
if (view->hasCompositedContent())
return true;
bool FrameView::isEnclosedInCompositingLayer() const
{
#if USE(ACCELERATED_COMPOSITING)
- RenderObject* frameOwnerRenderer = m_frame->ownerRenderer();
+ RenderObject* frameOwnerRenderer = frame().ownerRenderer();
if (frameOwnerRenderer && frameOwnerRenderer->containerForRepaint())
return true;
bool FrameView::flushCompositingStateIncludingSubframes()
{
#if USE(ACCELERATED_COMPOSITING)
- bool allFramesFlushed = flushCompositingStateForThisFrame(m_frame.get());
+ bool allFramesFlushed = flushCompositingStateForThisFrame(&frame());
- for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->traverseNext(m_frame.get())) {
- bool flushed = child->view()->flushCompositingStateForThisFrame(m_frame.get());
+ for (Frame* child = frame().tree()->firstChild(); child; child = child->tree()->traverseNext(&frame())) {
+ bool flushed = child->view()->flushCompositingStateForThisFrame(&frame());
allFramesFlushed &= flushed;
}
return allFramesFlushed;
// Drawing models which cache painted content while out-of-window (WebKit2's composited drawing areas, etc.)
// require that we repaint animated images to kickstart the animation loop.
- CachedImage::resumeAnimatingImagesForLoader(frame()->document()->cachedResourceLoader());
+ CachedImage::resumeAnimatingImagesForLoader(frame().document()->cachedResourceLoader());
}
RenderObject* FrameView::layoutRoot(bool onlyDuringLayout) const
inline void FrameView::forceLayoutParentViewIfNeeded()
{
#if ENABLE(SVG)
- RenderPart* ownerRenderer = m_frame->ownerRenderer();
+ RenderPart* ownerRenderer = frame().ownerRenderer();
if (!ownerRenderer || !ownerRenderer->frame())
return;
m_layoutTimer.stop();
m_delayedLayout = false;
m_setNeedsLayoutWasDeferred = false;
-
- if (!m_frame) {
- // FIXME: Do we need to set m_size.width here?
- // FIXME: Should we set m_size.height here too?
- m_size.setWidth(layoutWidth());
- return;
- }
// we shouldn't enter layout() while painting
ASSERT(!isPainting());
if (isPainting())
return;
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::willLayout(m_frame.get());
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::willLayout(&frame());
if (!allowSubtree && m_layoutRoot) {
m_layoutRoot->markContainingBlocksForLayout(false);
m_layoutRoot = 0;
}
- ASSERT(m_frame->view() == this);
+ ASSERT(frame().view() == this);
- Document* document = m_frame->document();
+ Document* document = frame().document();
ASSERT(!document->inPageCache());
bool subtree;
RenderObject* root;
m_nestedLayoutCount++;
if (!m_layoutRoot) {
- Document* document = m_frame->document();
+ Document* document = frame().document();
Node* body = document->body();
if (body && body->renderer()) {
if (body->hasTagName(framesetTag) && !frameFlatteningEnabled()) {
}
#ifdef INSTRUMENT_LAYOUT_SCHEDULING
- if (m_firstLayout && !m_frame->ownerElement())
+ if (m_firstLayout && !frame().ownerElement())
printf("Elapsed time before first layout: %d\n", document->elapsedTime());
#endif
}
if (m_nestedLayoutCount)
return;
- Page* page = frame() ? frame()->page() : 0;
- if (!page)
- return;
-
- page->chrome().client()->layoutUpdated(frame());
+ if (Page* page = frame().page())
+ page->chrome().client()->layoutUpdated(&frame());
}
RenderBox* FrameView::embeddedContentBox() const
String FrameView::mediaType() const
{
// See if we have an override type.
- String overrideType = m_frame->loader().client()->overrideMediaType();
- InspectorInstrumentation::applyEmulatedMedia(m_frame.get(), &overrideType);
+ String overrideType = frame().loader().client()->overrideMediaType();
+ InspectorInstrumentation::applyEmulatedMedia(&frame(), &overrideType);
if (!overrideType.isNull())
return overrideType;
return m_mediaType;
if (!hadSlowRepaintObjects) {
updateCanBlitOnScrollRecursively();
- if (Page* page = m_frame->page()) {
+ if (Page* page = frame().page()) {
if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange(this);
}
m_slowRepaintObjects = nullptr;
updateCanBlitOnScrollRecursively();
- if (Page* page = m_frame->page()) {
+ if (Page* page = frame().page()) {
if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange(this);
}
if (platformWidget())
updateCanBlitOnScrollRecursively();
- if (Page* page = m_frame->page()) {
+ if (Page* page = frame().page()) {
if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
scrollingCoordinator->frameViewFixedObjectsDidChange(this);
}
{
if (m_viewportConstrainedObjects && m_viewportConstrainedObjects->contains(object)) {
m_viewportConstrainedObjects->remove(object);
- if (Page* page = m_frame->page()) {
+ if (Page* page = frame().page()) {
if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
scrollingCoordinator->frameViewFixedObjectsDidChange(this);
}
IntSize totalContentsSize = this->totalContentsSize();
IntPoint scrollPosition = this->scrollPosition();
IntPoint scrollOrigin = this->scrollOrigin();
- float frameScaleFactor = m_frame ? m_frame->frameScaleFactor() : 1;
+ float frameScaleFactor = frame().frameScaleFactor();
return scrollOffsetForFixedPosition(visibleContentRect, totalContentsSize, scrollPosition, scrollOrigin, frameScaleFactor, fixedElementsLayoutRelativeToFrame(), headerHeight(), footerHeight());
}
bool FrameView::fixedElementsLayoutRelativeToFrame() const
{
- ASSERT(m_frame);
- if (!m_frame->settings())
+ if (!frame().settings())
return false;
- return m_frame->settings()->fixedElementsLayoutRelativeToFrame();
+ return frame().settings()->fixedElementsLayoutRelativeToFrame();
}
IntPoint FrameView::lastKnownMousePosition() const
{
- return m_frame ? m_frame->eventHandler().lastKnownMousePosition() : IntPoint();
+ return frame().eventHandler().lastKnownMousePosition();
}
bool FrameView::isHandlingWheelEvent() const
{
- return m_frame ? m_frame->eventHandler().isHandlingWheelEvent() : false;
+ return frame().eventHandler().isHandlingWheelEvent();
}
bool FrameView::shouldSetCursor() const
{
- Page* page = frame()->page();
+ Page* page = frame().page();
return page && page->isOnscreen() && page->focusController().isActive();
}
// Make sure to "apply" the scale factor here since we're converting from frame view
// coordinates to layer backing coordinates.
- updateRect.scale(1 / m_frame->frameScaleFactor());
+ updateRect.scale(1 / frame().frameScaleFactor());
ASSERT(renderView());
renderView()->layer()->setBackingNeedsRepaintInRect(updateRect);
repaintSlowRepaintObjects();
- if (RenderPart* frameRenderer = m_frame->ownerRenderer()) {
+ if (RenderPart* frameRenderer = frame().ownerRenderer()) {
if (isEnclosedInCompositingLayer()) {
LayoutRect rect(frameRenderer->borderLeft() + frameRenderer->paddingLeft(),
frameRenderer->borderTop() + frameRenderer->paddingTop(),
if (hasCompositedContentIncludingDescendants()) {
// Overlap can affect compositing tests, so if it changes, we need to trigger
// a layer update in the parent document.
- if (Frame* parentFrame = m_frame->tree()->parent()) {
+ if (Frame* parentFrame = frame().tree()->parent()) {
if (RenderView* parentView = parentFrame->contentRenderer()) {
RenderLayerCompositor* compositor = parentView->compositor();
compositor->setCompositingLayersNeedRebuild();
// OTOH If CSS target was set previously, we want to set it to 0, recalc
// and possibly repaint because :target pseudo class may have been
// set (see bug 11321).
- if (!url.hasFragmentIdentifier() && !m_frame->document()->cssTarget())
+ if (!url.hasFragmentIdentifier() && !frame().document()->cssTarget())
return false;
String fragmentIdentifier = url.fragmentIdentifier();
return true;
// Try again after decoding the ref, based on the document's encoding.
- if (TextResourceDecoder* decoder = m_frame->document()->decoder())
+ if (TextResourceDecoder* decoder = frame().document()->decoder())
return scrollToAnchor(decodeURLEscapeSequences(fragmentIdentifier, decoder->encoding()));
return false;
bool FrameView::scrollToAnchor(const String& name)
{
- ASSERT(m_frame->document());
+ ASSERT(frame().document());
- if (!m_frame->document()->haveStylesheetsLoaded()) {
- m_frame->document()->setGotoAnchorNeededAfterStylesheetsLoad(true);
+ if (!frame().document()->haveStylesheetsLoaded()) {
+ frame().document()->setGotoAnchorNeededAfterStylesheetsLoad(true);
return false;
}
- m_frame->document()->setGotoAnchorNeededAfterStylesheetsLoad(false);
+ frame().document()->setGotoAnchorNeededAfterStylesheetsLoad(false);
- Element* anchorElement = m_frame->document()->findAnchor(name);
+ Element* anchorElement = frame().document()->findAnchor(name);
// Setting to null will clear the current target.
- m_frame->document()->setCSSTarget(anchorElement);
+ frame().document()->setCSSTarget(anchorElement);
#if ENABLE(SVG)
- if (m_frame->document()->isSVGDocument()) {
- if (SVGSVGElement* svg = toSVGDocument(m_frame->document())->rootElement()) {
+ if (frame().document()->isSVGDocument()) {
+ if (SVGSVGElement* svg = toSVGDocument(frame().document())->rootElement()) {
svg->setupInitialView(name, anchorElement);
if (!anchorElement)
return true;
if (!anchorElement && !(name.isEmpty() || equalIgnoringCase(name, "top")))
return false;
- maintainScrollPositionAtAnchor(anchorElement ? static_cast<Node*>(anchorElement) : m_frame->document());
+ maintainScrollPositionAtAnchor(anchorElement ? static_cast<Node*>(anchorElement) : frame().document());
// If the anchor accepts keyboard focus, move focus there to aid users relying on keyboard navigation.
if (anchorElement && anchorElement->isFocusable())
- m_frame->document()->setFocusedElement(anchorElement);
+ frame().document()->setFocusedElement(anchorElement);
return true;
}
// We need to update the layout before scrolling, otherwise we could
// really mess things up if an anchor scroll comes at a bad moment.
- m_frame->document()->updateStyleIfNeeded();
+ frame().document()->updateStyleIfNeeded();
// Only do a layout if changes have occurred that make it necessary.
RenderView* renderView = this->renderView();
if (renderView && renderView->needsLayout())
void FrameView::scrollElementToRect(Element* element, const IntRect& rect)
{
- m_frame->document()->updateLayoutIgnorePendingStylesheets();
+ frame().document()->updateLayoutIgnorePendingStylesheets();
LayoutRect bounds = element->boundingBox();
int centeringOffsetX = (rect.width() - bounds.width()) / 2;
ScrollView::setFixedVisibleContentRect(visibleContentRect);
if (offset != scrollOffset()) {
repaintFixedElementsAfterScrolling();
- if (m_frame->page()->settings().acceleratedCompositingForFixedPositionEnabled())
+ if (frame().page()->settings().acceleratedCompositingForFixedPositionEnabled())
updateFixedElementsAfterScrolling();
scrollAnimator()->setCurrentPosition(scrollPosition());
scrollPositionChanged();
// Update the scroll-bars to calculate new page-step size.
updateScrollbars(scrollOffset());
}
- frame()->loader().client()->didChangeScrollOffset();
+ frame().loader().client()->didChangeScrollOffset();
}
void FrameView::setViewportConstrainedObjectsNeedLayout()
void FrameView::scrollPositionChanged()
{
- frame()->eventHandler().sendScrollEvent();
- frame()->eventHandler().dispatchFakeMouseMoveEventSoon();
+ frame().eventHandler().sendScrollEvent();
+ frame().eventHandler().dispatchFakeMouseMoveEventSoon();
#if USE(ACCELERATED_COMPOSITING)
if (RenderView* renderView = this->renderView()) {
bool FrameView::shouldUpdateFixedElementsAfterScrolling()
{
#if ENABLE(THREADED_SCROLLING)
- Page* page = m_frame->page();
+ Page* page = frame().page();
if (!page)
return true;
// If the scrolling thread is updating the fixed elements, then the FrameView should not update them as well.
- if (page->mainFrame() != m_frame)
+ if (page->mainFrame() != &frame())
return true;
ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator();
bool FrameView::shouldRubberBandInDirection(ScrollDirection direction) const
{
- Page* page = frame() ? frame()->page() : 0;
- if (!page)
- return ScrollView::shouldRubberBandInDirection(direction);
- return page->chrome().client()->shouldRubberBandInDirection(direction);
+ if (Page* page = frame().page())
+ return page->chrome().client()->shouldRubberBandInDirection(direction);
+ return ScrollView::shouldRubberBandInDirection(direction);
}
bool FrameView::isRubberBandInProgress() const
// If the scrolling thread updates the scroll position for this FrameView, then we should return
// ScrollingCoordinator::isRubberBandInProgress().
- if (Page* page = m_frame->page()) {
+ if (Page* page = frame().page()) {
if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) {
if (!scrollingCoordinator->shouldUpdateScrollLayerPositionOnMainThread())
return scrollingCoordinator->isRubberBandInProgress();
tiledBacking->prepopulateRect(visibleRect);
}
- if (Page* page = m_frame->page()) {
+ if (Page* page = frame().page()) {
if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
return scrollingCoordinator->requestScrollPositionUpdate(this, position);
}
HostWindow* FrameView::hostWindow() const
{
- Page* page = frame() ? frame()->page() : 0;
- if (!page)
- return 0;
- return &page->chrome();
+ if (Page* page = frame().page())
+ return &page->chrome();
+ return 0;
}
const unsigned cRepaintRectUnionThreshold = 25;
void FrameView::repaintContentRectangle(const IntRect& r, bool immediate)
{
- ASSERT(!m_frame->ownerElement());
+ ASSERT(!frame().ownerElement());
if (m_isTrackingRepaints) {
IntRect repaintRect = r;
return;
#if USE(TILED_BACKING_STORE)
- if (frame()->tiledBackingStore()) {
- frame()->tiledBackingStore()->invalidate(r);
+ if (frame().tiledBackingStore()) {
+ frame().tiledBackingStore()->invalidate(r);
return;
}
#endif
{
// Can be triggered before the view is set, see comment in FrameView::visibleContentsResized().
// An ASSERT is triggered when a view schedules a layout before being attached to a frame.
- if (!frame()->view())
+ if (!frame().view())
return;
ScrollView::fixedLayoutSizeChanged();
}
// be triggered before the view is attached by Frame::createView(...) setting
// various values such as setScrollBarModes(...) for example. An ASSERT is
// triggered when a view is layout before being attached to a frame().
- if (!frame()->view())
+ if (!frame().view())
return;
if (!useFixedLayout() && needsLayout())
void FrameView::beginDeferredRepaints()
{
- Page* page = m_frame->page();
- if (page->mainFrame() != m_frame) {
+ Page* page = frame().page();
+ if (page->mainFrame() != &frame()) {
page->mainFrame()->view()->beginDeferredRepaints();
return;
}
void FrameView::endDeferredRepaints()
{
- Page* page = m_frame->page();
- if (page->mainFrame() != m_frame) {
+ Page* page = frame().page();
+ if (page->mainFrame() != &frame()) {
page->mainFrame()->view()->endDeferredRepaints();
return;
}
unsigned size = m_repaintRects.size();
for (unsigned i = 0; i < size; i++) {
#if USE(TILED_BACKING_STORE)
- if (frame()->tiledBackingStore()) {
- frame()->tiledBackingStore()->invalidate(pixelSnappedIntRect(m_repaintRects[i]));
+ if (frame().tiledBackingStore()) {
+ frame().tiledBackingStore()->invalidate(pixelSnappedIntRect(m_repaintRects[i]));
continue;
}
#endif
bool FrameView::shouldUseLoadTimeDeferredRepaintDelay() const
{
// Don't defer after the initial load of the page has been completed.
- if (m_frame->tree()->top()->loader().isComplete())
+ if (frame().tree()->top()->loader().isComplete())
return false;
- Document* document = m_frame->document();
+ Document* document = frame().document();
if (!document)
return false;
if (document->parsing())
void FrameView::updateLayerFlushThrottlingInAllFrames()
{
#if USE(ACCELERATED_COMPOSITING)
- bool isMainLoadProgressing = m_frame->page()->progress()->isMainLoadProgressing();
+ bool isMainLoadProgressing = frame().page()->progress()->isMainLoadProgressing();
for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get())) {
if (RenderView* renderView = frame->contentRenderer())
renderView->compositor()->setLayerFlushThrottlingEnabled(isMainLoadProgressing);
void FrameView::layoutTimerFired(Timer<FrameView>*)
{
#ifdef INSTRUMENT_LAYOUT_SCHEDULING
- if (!m_frame->document()->ownerElement())
- printf("Layout timer fired at %d\n", m_frame->document()->elapsedTime());
+ if (!frame().document()->ownerElement())
+ printf("Layout timer fired at %d\n", frame().document()->elapsedTime());
#endif
layout();
}
{
// FIXME: We should assert the page is not in the page cache, but that is causing
// too many false assertions. See <rdar://problem/7218118>.
- ASSERT(m_frame->view() == this);
+ ASSERT(frame().view() == this);
if (m_layoutRoot) {
m_layoutRoot->markContainingBlocksForLayout(false);
return;
if (!needsLayout())
return;
- if (!m_frame->document()->shouldScheduleLayout())
+ if (!frame().document()->shouldScheduleLayout())
return;
- InspectorInstrumentation::didInvalidateLayout(m_frame.get());
+ InspectorInstrumentation::didInvalidateLayout(&frame());
// When frame flattening is enabled, the contents of the frame could affect the layout of the parent frames.
// Also invalidate parent frame starting from the owner element of this frame.
- if (m_frame->ownerRenderer() && isInChildFrameWithFrameFlattening())
- m_frame->ownerRenderer()->setNeedsLayout(true, MarkContainingBlockChain);
+ if (frame().ownerRenderer() && isInChildFrameWithFrameFlattening())
+ frame().ownerRenderer()->setNeedsLayout(true, MarkContainingBlockChain);
- int delay = m_frame->document()->minimumLayoutDelay();
+ int delay = frame().document()->minimumLayoutDelay();
if (m_layoutTimer.isActive() && m_delayedLayout && !delay)
unscheduleRelayout();
if (m_layoutTimer.isActive())
m_delayedLayout = delay != 0;
#ifdef INSTRUMENT_LAYOUT_SCHEDULING
- if (!m_frame->document()->ownerElement())
+ if (!frame().document()->ownerElement())
printf("Scheduling layout for %d\n", delay);
#endif
void FrameView::scheduleRelayoutOfSubtree(RenderObject* relayoutRoot)
{
- ASSERT(m_frame->view() == this);
+ ASSERT(frame().view() == this);
RenderView* renderView = this->renderView();
if (renderView && renderView->needsLayout()) {
m_layoutRoot->markContainingBlocksForLayout(false, relayoutRoot);
m_layoutRoot = relayoutRoot;
ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout());
- InspectorInstrumentation::didInvalidateLayout(m_frame.get());
+ InspectorInstrumentation::didInvalidateLayout(&frame());
} else {
// Just do a full relayout
if (m_layoutRoot)
m_layoutRoot->markContainingBlocksForLayout(false);
m_layoutRoot = 0;
relayoutRoot->markContainingBlocksForLayout(false);
- InspectorInstrumentation::didInvalidateLayout(m_frame.get());
+ InspectorInstrumentation::didInvalidateLayout(&frame());
}
}
} else if (m_layoutSchedulingEnabled) {
- int delay = m_frame->document()->minimumLayoutDelay();
+ int delay = frame().document()->minimumLayoutDelay();
m_layoutRoot = relayoutRoot;
ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout());
- InspectorInstrumentation::didInvalidateLayout(m_frame.get());
+ InspectorInstrumentation::didInvalidateLayout(&frame());
m_delayedLayout = delay != 0;
m_layoutTimer.startOneShot(delay * 0.001);
}
// This can return true in cases where the document does not have a body yet.
// Document::shouldScheduleLayout takes care of preventing us from scheduling
// layout in that case.
- if (!m_frame)
- return false;
-
RenderView* renderView = this->renderView();
return layoutPending()
|| (renderView && renderView->needsLayout())
return;
#ifdef INSTRUMENT_LAYOUT_SCHEDULING
- if (!m_frame->document()->ownerElement())
- printf("Layout timer unscheduled at %d\n", m_frame->document()->elapsedTime());
+ if (!frame().document()->ownerElement())
+ printf("Layout timer unscheduled at %d\n", frame().document()->elapsedTime());
#endif
m_layoutTimer.stop();
return;
LayoutRect rect;
- if (anchorNode != m_frame->document())
+ if (anchorNode != frame().document())
rect = anchorNode->boundingBox();
// Scroll nested layers and frames to reveal the anchor.
// Align to the top and to the closest side (this matches other browsers).
anchorNode->renderer()->scrollRectToVisible(rect, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);
- if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache())
+ if (AXObjectCache* cache = frame().document()->existingAXObjectCache())
cache->handleScrolledToAnchor(anchorNode.get());
// scrollRectToVisible can call into setScrollPosition(), which resets m_maintainScrollPositionAnchor.
Vector<RenderObject*> objects;
objects.reserveInitialCapacity(size);
// Protect RendereArena from getting wiped out, when Document is detached during updateWidget().
- RefPtr<RenderArena> protectedArena = m_frame->document()->renderArena();
+ RefPtr<RenderArena> protectedArena = frame().document()->renderArena();
RenderObjectSet::const_iterator end = m_widgetUpdateSet->end();
for (RenderObjectSet::const_iterator it = m_widgetUpdateSet->begin(); it != end; ++it) {
{
m_postLayoutTasksTimer.stop();
- m_frame->selection()->setCaretRectNeedsUpdate();
- m_frame->selection()->updateAppearance();
+ frame().selection()->setCaretRectNeedsUpdate();
+ frame().selection()->updateAppearance();
LayoutMilestones requestedMilestones = 0;
LayoutMilestones milestonesAchieved = 0;
- Page* page = m_frame->page();
+ Page* page = frame().page();
if (page)
requestedMilestones = page->requestedLayoutMilestones();
- if (m_nestedLayoutCount <= 1 && m_frame->document()->documentElement()) {
+ if (m_nestedLayoutCount <= 1 && frame().document()->documentElement()) {
if (m_firstLayoutCallbackPending) {
m_firstLayoutCallbackPending = false;
- m_frame->loader().didFirstLayout();
+ frame().loader().didFirstLayout();
if (requestedMilestones & DidFirstLayout)
milestonesAchieved |= DidFirstLayout;
if (isMainFrameView())
updateIsVisuallyNonEmpty();
// If the layout was done with pending sheets, we are not in fact visually non-empty yet.
- if (m_isVisuallyNonEmpty && !m_frame->document()->didLayoutWithPendingStylesheets() && m_firstVisuallyNonEmptyLayoutCallbackPending) {
+ if (m_isVisuallyNonEmpty && !frame().document()->didLayoutWithPendingStylesheets() && m_firstVisuallyNonEmptyLayoutCallbackPending) {
m_firstVisuallyNonEmptyLayoutCallbackPending = false;
if (requestedMilestones & DidFirstVisuallyNonEmptyLayout)
milestonesAchieved |= DidFirstVisuallyNonEmptyLayout;
}
}
- if (milestonesAchieved && page && page->mainFrame() == m_frame)
- m_frame->loader().didLayout(milestonesAchieved);
+ if (milestonesAchieved && page && page->mainFrame() == &frame())
+ frame().loader().didLayout(milestonesAchieved);
#if ENABLE(FONT_LOAD_EVENTS)
if (RuntimeEnabledFeatures::fontLoadEventsEnabled())
- m_frame->document()->fontloader()->didLayout();
+ frame().document()->fontloader()->didLayout();
#endif
// FIXME: We should consider adding DidLayout as a LayoutMilestone. That would let us merge this
// with didLayout(LayoutMilestones).
- m_frame->loader().client()->dispatchDidLayout();
+ frame().loader().client()->dispatchDidLayout();
if (RenderView* renderView = this->renderView())
renderView->updateWidgetPositions();
void FrameView::sendResizeEventIfNeeded()
{
- ASSERT(m_frame);
-
RenderView* renderView = this->renderView();
if (!renderView || renderView->printing())
return;
// If we resized during layout, queue up a resize event for later, otherwise fire it right away.
RefPtr<Event> resizeEvent = Event::create(eventNames().resizeEvent, false, false);
if (canSendResizeEventSynchronously)
- m_frame->document()->dispatchWindowEvent(resizeEvent.release(), m_frame->document()->domWindow());
+ frame().document()->dispatchWindowEvent(resizeEvent.release(), frame().document()->domWindow());
else
- m_frame->document()->enqueueWindowEvent(resizeEvent.release());
+ frame().document()->enqueueWindowEvent(resizeEvent.release());
#if ENABLE(INSPECTOR)
- Page* page = m_frame->page();
+ Page* page = frame().page();
if (InspectorInstrumentation::hasFrontends() && isMainFrame) {
if (InspectorClient* inspectorClient = page ? page->inspectorController()->inspectorClient() : 0)
- inspectorClient->didResizeMainFrame(m_frame.get());
+ inspectorClient->didResizeMainFrame(&frame());
}
#endif
}
TemporaryChange<bool> changeInAutoSize(m_inAutoSize, true);
- Document* document = frame()->document();
+ Document* document = frame().document();
if (!document)
return;
// While loading only allow the size to increase (to avoid twitching during intermediate smaller states)
// unless autoresize has just been turned on or the maximum size is smaller than the current size.
if (m_didRunAutosize && size.height() <= m_maxAutoSize.height() && size.width() <= m_maxAutoSize.width()
- && !frame()->loader().isComplete() && (newSize.height() < size.height() || newSize.width() < size.width()))
+ && !frame().loader().isComplete() && (newSize.height() < size.height() || newSize.width() < size.width()))
break;
resize(newSize.width(), newSize.height());
return m_pagination;
if (isMainFrameView())
- return m_frame->page()->pagination();
+ return frame().page()->pagination();
return m_pagination;
}
m_pagination = pagination;
- if (m_frame)
- m_frame->document()->styleResolverChanged(DeferRecalcStyle);
+ frame().document()->styleResolverChanged(DeferRecalcStyle);
}
IntRect FrameView::windowClipRect(bool clipToContents) const
{
- ASSERT(m_frame->view() == this);
+ ASSERT(frame().view() == this);
if (paintsEntireContents())
return IntRect(IntPoint(), totalContentsSize());
// Set our clip rect to be our contents.
IntRect clipRect = contentsToWindow(visibleContentRect(clipToContents ? ExcludeScrollbars : IncludeScrollbars));
- if (!m_frame || !m_frame->ownerElement())
+ if (!frame().ownerElement())
return clipRect;
// Take our owner element and get its clip rect.
- HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement();
+ HTMLFrameOwnerElement* ownerElement = frame().ownerElement();
FrameView* parentView = ownerElement->document()->view();
if (parentView)
clipRect.intersect(parentView->windowClipRectForFrameOwner(ownerElement, true));
bool FrameView::isActive() const
{
- Page* page = frame()->page();
+ Page* page = frame().page();
return page && page->focusController().isActive();
}
ScrollView::scrollTo(newOffset);
if (offset != scrollOffset())
scrollPositionChanged();
- frame()->loader().client()->didChangeScrollOffset();
+ frame().loader().client()->didChangeScrollOffset();
}
void FrameView::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect& rect)
void FrameView::getTickmarks(Vector<IntRect>& tickmarks) const
{
- tickmarks = frame()->document()->markers()->renderedRectsForMarkers(DocumentMarker::TextMatch);
+ tickmarks = frame().document()->markers()->renderedRectsForMarkers(DocumentMarker::TextMatch);
}
IntRect FrameView::windowResizerRect() const
{
- Page* page = frame() ? frame()->page() : 0;
- if (!page)
- return IntRect();
- return page->chrome().windowResizerRect();
+ if (Page* page = frame().page())
+ return page->chrome().windowResizerRect();
+ return IntRect();
}
float FrameView::visibleContentScaleFactor() const
{
- if (!isMainFrameView() || !m_frame->settings()->applyPageScaleFactorInCompositor())
+ if (!isMainFrameView() || !frame().settings()->applyPageScaleFactorInCompositor())
return 1;
- return m_frame->page()->pageScaleFactor();
+ return frame().page()->pageScaleFactor();
}
void FrameView::setVisibleScrollerThumbRect(const IntRect& scrollerThumb)
if (!isMainFrameView())
return;
- m_frame->page()->chrome().client()->notifyScrollerThumbIsVisibleInRect(scrollerThumb);
+ frame().page()->chrome().client()->notifyScrollerThumbIsVisibleInRect(scrollerThumb);
}
bool FrameView::scrollbarsCanBeActive() const
{
- if (!m_frame)
+ if (frame().view() != this)
return false;
- if (m_frame->view() != this)
- return false;
-
- if (Page* page = m_frame->page()) {
+ if (Page* page = frame().page()) {
if (page->shouldSuppressScrollbarAnimations())
return false;
}
- if (Document* document = m_frame->document())
+ if (Document* document = frame().document())
return !document->inPageCache();
return false;
IntRect FrameView::scrollableAreaBoundingBox() const
{
- RenderPart* ownerRenderer = frame()->ownerRenderer();
+ RenderPart* ownerRenderer = frame().ownerRenderer();
if (!ownerRenderer)
return frameRect();
return false;
// Covers #2.
- HTMLFrameOwnerElement* owner = m_frame->ownerElement();
+ HTMLFrameOwnerElement* owner = frame().ownerElement();
if (owner && (!owner->renderer() || !owner->renderer()->visibleToHitTesting()))
return false;
bool FrameView::shouldSuspendScrollAnimations() const
{
- return m_frame->loader().state() != FrameStateComplete;
+ return frame().loader().state() != FrameStateComplete;
}
void FrameView::scrollbarStyleChanged(int newStyle, bool forceUpdate)
if (!isMainFrameView())
return;
- m_frame->page()->chrome().client()->recommendedScrollbarStyleDidChange(newStyle);
+ frame().page()->chrome().client()->recommendedScrollbarStyleDidChange(newStyle);
if (forceUpdate)
ScrollView::scrollbarStyleChanged(newStyle, forceUpdate);
void FrameView::setAnimatorsAreActive()
{
- Page* page = m_frame->page();
+ Page* page = frame().page();
if (!page)
return;
void FrameView::notifyPageThatContentAreaWillPaint() const
{
- Page* page = m_frame->page();
+ Page* page = frame().page();
if (!page)
return;
bool FrameView::scrollAnimatorEnabled() const
{
#if ENABLE(SMOOTH_SCROLLING)
- if (Page* page = m_frame->page())
+ if (Page* page = frame().page())
return page->settings().scrollAnimatorEnabled();
#endif
#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION)
void FrameView::updateAnnotatedRegions()
{
- Document* document = m_frame->document();
+ Document* document = frame().document();
if (!document->hasAnnotatedRegions())
return;
Vector<AnnotatedRegionValue> newRegions;
if (newRegions == document->annotatedRegions())
return;
document->setAnnotatedRegions(newRegions);
- Page* page = m_frame->page();
+ Page* page = frame().page();
if (!page)
return;
page->chrome().client()->annotatedRegionsChanged();
if (!cornerRect.isEmpty()) {
// Try the <body> element first as a scroll corner source.
- Document* doc = m_frame->document();
+ Document* doc = frame().document();
Element* body = doc ? doc->body() : 0;
if (body && body->renderer()) {
renderer = body->renderer();
if (!cornerStyle) {
// If we have an owning iframe/frame element, then it can set the custom scrollbar also.
- if (RenderPart* renderer = m_frame->ownerRenderer())
+ if (RenderPart* renderer = frame().ownerRenderer())
cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), renderer->style());
}
}
// Background images are unfortunately impractical to include.
// Return invalid Color objects whenever there is insufficient information.
- if (!frame()->document())
+ if (!frame().document())
return Color();
- Element* htmlElement = frame()->document()->documentElement();
- Element* bodyElement = frame()->document()->body();
+ Element* htmlElement = frame().document()->documentElement();
+ Element* bodyElement = frame().document()->body();
// Start with invalid colors.
Color htmlBackgroundColor;
if (!parent())
return 0;
- if (Frame* parentFrame = m_frame->tree()->parent())
+ if (Frame* parentFrame = frame().tree()->parent())
return parentFrame->view();
return 0;
bool FrameView::isInChildFrameWithFrameFlattening() const
{
- if (!parent() || !m_frame->ownerElement())
+ if (!parent() || !frame().ownerElement())
return false;
// Frame flattening applies when the owner element is either in a frameset or
// an iframe with flattening parameters.
- if (m_frame->ownerElement()->hasTagName(iframeTag)) {
- RenderIFrame* iframeRenderer = toRenderIFrame(m_frame->ownerElement()->renderPart());
+ if (frame().ownerElement()->hasTagName(iframeTag)) {
+ RenderIFrame* iframeRenderer = toRenderIFrame(frame().ownerElement()->renderPart());
if (iframeRenderer->flattenFrame() || iframeRenderer->isSeamless())
return true;
}
if (!frameFlatteningEnabled())
return false;
- if (m_frame->ownerElement()->hasTagName(frameTag))
+ if (frame().ownerElement()->hasTagName(frameTag))
return true;
return false;
parentView->layout(allowSubtree);
- RenderObject* root = m_layoutRoot ? m_layoutRoot : m_frame->document()->renderer();
+ RenderObject* root = m_layoutRoot ? m_layoutRoot : frame().document()->renderer();
ASSERT_UNUSED(root, !root->needsLayout());
return true;
// to define when controls get the tint and to call this function when that changes.
// Optimize the common case where we bring a window to the front while it's still empty.
- if (!m_frame || m_frame->document()->url().isEmpty())
+ if (frame().document()->url().isEmpty())
return;
RenderView* renderView = this->renderView();
void FrameView::paintContents(GraphicsContext* p, const IntRect& rect)
{
- if (!frame())
- return;
-
- Document* document = m_frame->document();
+ Document* document = frame().document();
#ifndef NDEBUG
bool fillWithRed;
if (document->printing())
fillWithRed = false; // Printing, don't fill with red (can't remember why).
- else if (m_frame->ownerElement())
+ else if (frame().ownerElement())
fillWithRed = false; // Subframe, don't fill with red.
else if (isTransparent())
fillWithRed = false; // Transparent, don't fill with red.
#if USE(ACCELERATED_COMPOSITING)
if (!p->paintingDisabled() && !document->printing())
- flushCompositingStateForThisFrame(m_frame.get());
+ flushCompositingStateForThisFrame(&frame());
#endif
PaintBehavior oldPaintBehavior = m_paintBehavior;
m_paintBehavior |= PaintBehaviorFlattenCompositingLayers;
bool flatteningPaint = m_paintBehavior & PaintBehaviorFlattenCompositingLayers;
- bool isRootFrame = !m_frame->ownerElement();
+ bool isRootFrame = !frame().ownerElement();
if (flatteningPaint && isRootFrame)
notifyWidgetsInAllFrames(WillPaintFlattened);
if (context->paintingDisabled())
return;
- if (m_frame->document()->printing())
+ if (frame().document()->printing())
return;
- if (isMainFrameView() && m_frame->page()->chrome().client()->paintCustomOverhangArea(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect))
+ if (isMainFrameView() && frame().page()->chrome().client()->paintCustomOverhangArea(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect))
return;
ScrollView::paintOverhangAreas(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect);
// region but then become included later by the second frame adding rects to the dirty region
// when it lays out.
- m_frame->document()->updateStyleIfNeeded();
+ frame().document()->updateStyleIfNeeded();
if (needsLayout())
layout();
bool FrameView::qualifiesAsVisuallyNonEmpty() const
{
// No content yet.
- Element* documentElement = m_frame->document()->documentElement();
+ Element* documentElement = frame().document()->documentElement();
if (!documentElement || !documentElement->renderer())
return false;
// Ensure that we always get marked visually non-empty eventually.
- if (!m_frame->document()->parsing() && m_frame->loader().stateMachine()->committedFirstRealDocumentLoad())
+ if (!frame().document()->parsing() && frame().loader().stateMachine()->committedFirstRealDocumentLoad())
return true;
// Require the document to grow a bit.
void FrameView::forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkFactor, AdjustViewSizeOrNot shouldAdjustViewSize)
{
- // Dumping externalRepresentation(m_frame->renderer()).ascii() is a good trick to see
+ // Dumping externalRepresentation(frame().renderer()).ascii() is a good trick to see
// the state of things before and after the layout
if (RenderView* renderView = this->renderView()) {
float pageLogicalWidth = renderView->style()->isHorizontalWritingMode() ? pageSize.width() : pageSize.height();
if (docLogicalWidth > pageLogicalWidth) {
int expectedPageWidth = std::min<float>(documentRect.width(), pageSize.width() * maximumShrinkFactor);
int expectedPageHeight = std::min<float>(documentRect.height(), pageSize.height() * maximumShrinkFactor);
- FloatSize maxPageSize = m_frame->resizePageRectsKeepingRatio(FloatSize(originalPageSize.width(), originalPageSize.height()), FloatSize(expectedPageWidth, expectedPageHeight));
+ FloatSize maxPageSize = frame().resizePageRectsKeepingRatio(FloatSize(originalPageSize.width(), originalPageSize.height()), FloatSize(expectedPageWidth, expectedPageHeight));
pageLogicalWidth = horizontalWritingMode ? maxPageSize.width() : maxPageSize.height();
pageLogicalHeight = horizontalWritingMode ? maxPageSize.height() : maxPageSize.width();
if (parentScrollView->isFrameView()) {
const FrameView* parentView = toFrameView(parentScrollView);
// Get our renderer in the parent view
- RenderPart* renderer = m_frame->ownerRenderer();
+ RenderPart* renderer = frame().ownerRenderer();
if (!renderer)
return localRect;
const FrameView* parentView = toFrameView(parentScrollView);
// Get our renderer in the parent view
- RenderPart* renderer = m_frame->ownerRenderer();
+ RenderPart* renderer = frame().ownerRenderer();
if (!renderer)
return parentRect;
const FrameView* parentView = toFrameView(parentScrollView);
// Get our renderer in the parent view
- RenderPart* renderer = m_frame->ownerRenderer();
+ RenderPart* renderer = frame().ownerRenderer();
if (!renderer)
return localPoint;
const FrameView* parentView = toFrameView(parentScrollView);
// Get our renderer in the parent view
- RenderPart* renderer = m_frame->ownerRenderer();
+ RenderPart* renderer = frame().ownerRenderer();
if (!renderer)
return parentPoint;
// Force layout to flush out any pending repaints.
if (trackRepaints) {
- if (frame() && frame()->document())
- frame()->document()->updateLayout();
+ if (frame().document())
+ frame().document()->updateLayout();
}
#if USE(ACCELERATED_COMPOSITING)
String FrameView::trackedRepaintRectsAsText() const
{
- if (frame() && frame()->document())
- frame()->document()->updateLayout();
+ if (frame().document())
+ frame().document()->updateLayout();
TextStream ts;
if (!m_trackedRepaintRects.isEmpty()) {
if (offset != newOffset) {
ScrollView::scrollTo(newOffset);
scrollPositionChanged();
- frame()->loader().client()->didChangeScrollOffset();
+ frame().loader().client()->didChangeScrollOffset();
}
return true;
}
return false;
#if ENABLE(THREADED_SCROLLING)
- if (Page* page = m_frame->page()) {
+ if (Page* page = frame().page()) {
if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) {
if (scrollingCoordinator->coordinatesScrollingForFrameView(this))
return scrollingCoordinator->handleWheelEvent(this, wheelEvent);
AXObjectCache* FrameView::axObjectCache() const
{
- if (frame() && frame()->document())
- return frame()->document()->existingAXObjectCache();
+ if (frame().document())
+ return frame().document()->existingAXObjectCache();
return 0;
}
void FrameView::firePaintRelatedMilestones()
{
- Page* page = m_frame->page();
+ Page* page = frame().page();
if (!page)
return;
m_visualUpdatesAllowedByClient = visualUpdatesAllowed;
- m_frame->document()->setVisualUpdatesAllowedByClient(visualUpdatesAllowed);
+ frame().document()->setVisualUpdatesAllowedByClient(visualUpdatesAllowed);
}
void FrameView::setScrollPinningBehavior(ScrollPinningBehavior pinning)
{
m_scrollPinningBehavior = pinning;
- if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scrollingCoordinator())
+ if (ScrollingCoordinator* scrollingCoordinator = frame().page()->scrollingCoordinator())
scrollingCoordinator->setScrollPinningBehavior(pinning);
updateScrollbars(scrollOffset());