Bug 1434243 - Part 3: Make nsDisplayListBuilder::ToReferenceFrame and nsDisplayListBuilder::FindReferenceFrame const
MozReview-Commit-ID: 5b7Ox1cIBv0
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -1664,17 +1664,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))
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -554,34 +554,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