From 2d4f5b7712a4481bb1d538ed9fa3488d9a39088f Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Fri, 6 Jun 2014 21:23:22 -0500 Subject: [PATCH] Bug 1002992. Part 6. Rename ExpandRect to ExpandToNearlyVisibleRect. r=addressingreviewcomment --- layout/base/nsPresShell.cpp | 8 ++++---- layout/generic/nsGfxScrollFrame.cpp | 6 +++--- layout/generic/nsGfxScrollFrame.h | 10 +++++----- layout/generic/nsIScrollableFrame.h | 2 +- layout/generic/nsSubDocumentFrame.cpp | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 49d4bb7d242e..ada79b855a93 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -5765,7 +5765,7 @@ PresShell::MarkImagesInSubtreeVisible(nsIFrame* aFrame, const nsRect& aRect) } else { rect = rect.Intersect(scrollFrame->GetScrollPortRect()); } - rect = scrollFrame->ExpandRect(rect); + rect = scrollFrame->ExpandRectToNearlyVisible(rect); } bool preserves3DChildren = aFrame->Preserves3DChildren(); @@ -5871,10 +5871,10 @@ PresShell::UpdateImageVisibility() if (IgnoringViewportScrolling()) { builder.SetIgnoreScrollFrame(rootScroll); - // The ExpandRect that the root scroll frame would do gets short circuited - // due to us ignoring the root scroll frame, so we do it here. + // The ExpandRectToNearlyVisible that the root scroll frame would do gets short + // circuited due to us ignoring the root scroll frame, so we do it here. nsIScrollableFrame* rootScrollable = do_QueryFrame(rootScroll); - updateRect = rootScrollable->ExpandRect(updateRect); + updateRect = rootScrollable->ExpandRectToNearlyVisible(updateRect); } } builder.IgnorePaintSuppression(); diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index cb608e44e839..79236f66a9ff 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -2276,7 +2276,7 @@ ScrollFrameHelper::EnsureImageVisPrefsCached() } nsRect -ScrollFrameHelper::ExpandRect(const nsRect& aRect) const +ScrollFrameHelper::ExpandRectToNearlyVisible(const nsRect& aRect) const { // We don't want to expand a rect in a direction that we can't scroll, so we // check the scroll range. @@ -2527,7 +2527,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, // We use the dirty rect instead of the whole scroll port to prevent // too much expansion in the presence of very large (bigger than the // viewport) scroll ports. - dirtyRect = ExpandRect(dirtyRect); + dirtyRect = ExpandRectToNearlyVisible(dirtyRect); } // Since making new layers is expensive, only use nsDisplayScrollLayer @@ -2663,7 +2663,7 @@ ScrollFrameHelper::IsRectNearlyVisible(const nsRect& aRect) const // Use the right rect depending on if a display port is set. nsRect displayPort; bool usingDisplayport = nsLayoutUtils::GetDisplayPort(mOuter->GetContent(), &displayPort); - return aRect.Intersects(ExpandRect(usingDisplayport ? displayPort : mScrollPort)); + return aRect.Intersects(ExpandRectToNearlyVisible(usingDisplayport ? displayPort : mScrollPort)); } static void HandleScrollPref(nsIScrollable *aScrollable, int32_t aOrientation, diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index 3a3aa8cbd9b8..e6bfb02ad4f5 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -279,7 +279,7 @@ public: void UpdateSticky(); bool IsRectNearlyVisible(const nsRect& aRect) const; - nsRect ExpandRect(const nsRect& aRect) const; + nsRect ExpandRectToNearlyVisible(const nsRect& aRect) const; // adjust the scrollbar rectangle aRect to account for any visible resizer. // aHasResizer specifies if there is a content resizer, however this method @@ -671,8 +671,8 @@ public: virtual bool IsRectNearlyVisible(const nsRect& aRect) MOZ_OVERRIDE { return mHelper.IsRectNearlyVisible(aRect); } - virtual nsRect ExpandRect(const nsRect& aRect) const MOZ_OVERRIDE { - return mHelper.ExpandRect(aRect); + virtual nsRect ExpandRectToNearlyVisible(const nsRect& aRect) const MOZ_OVERRIDE { + return mHelper.ExpandRectToNearlyVisible(aRect); } virtual nsIAtom* OriginOfLastScroll() MOZ_OVERRIDE { return mHelper.OriginOfLastScroll(); @@ -990,8 +990,8 @@ public: virtual bool IsRectNearlyVisible(const nsRect& aRect) MOZ_OVERRIDE { return mHelper.IsRectNearlyVisible(aRect); } - virtual nsRect ExpandRect(const nsRect& aRect) const MOZ_OVERRIDE { - return mHelper.ExpandRect(aRect); + virtual nsRect ExpandRectToNearlyVisible(const nsRect& aRect) const MOZ_OVERRIDE { + return mHelper.ExpandRectToNearlyVisible(aRect); } virtual nsIAtom* OriginOfLastScroll() MOZ_OVERRIDE { return mHelper.OriginOfLastScroll(); diff --git a/layout/generic/nsIScrollableFrame.h b/layout/generic/nsIScrollableFrame.h index 5a0ef6b5fea9..1e1f65276571 100644 --- a/layout/generic/nsIScrollableFrame.h +++ b/layout/generic/nsIScrollableFrame.h @@ -290,7 +290,7 @@ public: * Expand the given rect taking into account which directions we can scroll * and how far we want to expand for image visibility purposes. */ - virtual nsRect ExpandRect(const nsRect& aRect) const = 0; + virtual nsRect ExpandRectToNearlyVisible(const nsRect& aRect) const = 0; /** * Returns the origin passed in to the last ScrollToImpl call that took * effect. diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index 0925c1d4d700..4fca61ee89c7 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -420,10 +420,10 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, aBuilder->SetIgnoreScrollFrame(rootScrollFrame); if (aBuilder->IsForImageVisibility()) { - // The ExpandRect that the root scroll frame would do gets short circuited - // due to us ignoring the root scroll frame, so we do it here. + // The ExpandRectToNearlyVisible that the root scroll frame would do gets short + // circuited due to us ignoring the root scroll frame, so we do it here. nsIScrollableFrame* rootScrollableFrame = do_QueryFrame(rootScrollFrame); - dirty = rootScrollableFrame->ExpandRect(dirty); + dirty = rootScrollableFrame->ExpandRectToNearlyVisible(dirty); } } }