# HG changeset patch # User Miko Mynttinen # Date 1517933902 -3600 # Node ID 48d8cb573cb5997521eb87eb7528e35395896a8b # Parent 8987786a1b8a08138230e2e7f3ea03560095214e Bug 1434243 - Part 3: Make nsDisplayListBuilder::ToReferenceFrame and nsDisplayListBuilder::FindReferenceFrame const r=mattwoodrow MozReview-Commit-ID: 5b7Ox1cIBv0 diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -1660,17 +1660,17 @@ nsDisplayListBuilder::CreateClipChainInt const DisplayItemClipChain* nsDisplayListBuilder::CopyWholeChain(const DisplayItemClipChain* aClipChain) { return CreateClipChainIntersection(nullptr, aClipChain, nullptr); } const nsIFrame* nsDisplayListBuilder::FindReferenceFrameFor(const nsIFrame *aFrame, - nsPoint* aOffset) + nsPoint* aOffset) const { if (aFrame == mCurrentFrame) { if (aOffset) { *aOffset = mCurrentOffsetToReferenceFrame; } return mCurrentReferenceFrame; } for (const nsIFrame* f = aFrame; f; f = nsLayoutUtils::GetCrossDocParentFrame(f)) diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h --- a/layout/painting/nsDisplayList.h +++ b/layout/painting/nsDisplayList.h @@ -524,34 +524,35 @@ public: */ nsISelection* GetBoundingSelection() { return mBoundingSelection; } /** * @return the root of given frame's (sub)tree, whose origin * establishes the coordinate system for the child display items. */ const nsIFrame* FindReferenceFrameFor(const nsIFrame *aFrame, - nsPoint* aOffset = nullptr); + nsPoint* aOffset = nullptr) const; /** * @return the root of the display list's frame (sub)tree, whose origin * establishes the coordinate system for the display list */ nsIFrame* RootReferenceFrame() { return mReferenceFrame; } /** * @return a point pt such that adding pt to a coordinate relative to aFrame * makes it relative to ReferenceFrame(), i.e., returns * aFrame->GetOffsetToCrossDoc(ReferenceFrame()). The returned point is in * the appunits of aFrame. */ - const nsPoint ToReferenceFrame(const nsIFrame* aFrame) { + const nsPoint ToReferenceFrame(const nsIFrame* aFrame) const + { nsPoint result; FindReferenceFrameFor(aFrame, &result); return result; } /** * When building the display list, the scrollframe aFrame will be "ignored" * for the purposes of clipping, and its scrollbars will be hidden. We use * this to allow RenderOffscreen to render a whole document without beign