Bug 1459696 - Improve const-correctness of nsIFrame methods and functions that accept an nsIFrame* argument. r=mstange

MozReview-Commit-ID: 9IcL8kfMdIH

--HG--
extra : rebase_source : f8f19f528fe42aa119659ed9cb3340a257bb3716
This commit is contained in:
Botond Ballo 2018-05-28 19:58:25 -04:00
Родитель 8595564f3a
Коммит f5745eb2a5
6 изменённых файлов: 20 добавлений и 20 удалений

Просмотреть файл

@ -2525,7 +2525,7 @@ nsLayoutUtils::PostTranslate(Matrix4x4& aTransform, const nsPoint& aOrigin, floa
// We want to this return true for the scroll frame, but not the
// scrolled frame (which has the same content).
bool
nsLayoutUtils::FrameHasDisplayPort(nsIFrame* aFrame, nsIFrame* aScrolledFrame)
nsLayoutUtils::FrameHasDisplayPort(nsIFrame* aFrame, const nsIFrame* aScrolledFrame)
{
if (!aFrame->GetContent() || !HasDisplayPort(aFrame->GetContent())) {
return false;
@ -2541,7 +2541,7 @@ nsLayoutUtils::FrameHasDisplayPort(nsIFrame* aFrame, nsIFrame* aScrolledFrame)
}
Matrix4x4Flagged
nsLayoutUtils::GetTransformToAncestor(nsIFrame *aFrame,
nsLayoutUtils::GetTransformToAncestor(const nsIFrame *aFrame,
const nsIFrame *aAncestor,
uint32_t aFlags,
nsIFrame** aOutAncestor)
@ -2864,7 +2864,7 @@ TransformGfxPointFromAncestor(nsIFrame *aFrame,
}
static Rect
TransformGfxRectToAncestor(nsIFrame *aFrame,
TransformGfxRectToAncestor(const nsIFrame *aFrame,
const Rect &aRect,
const nsIFrame *aAncestor,
bool* aPreservesAxisAlignedRectangles = nullptr,
@ -2904,7 +2904,7 @@ TransformGfxRectToAncestor(nsIFrame *aFrame,
}
static SVGTextFrame*
GetContainingSVGTextFrame(nsIFrame* aFrame)
GetContainingSVGTextFrame(const nsIFrame* aFrame)
{
if (!nsSVGUtils::IsInSVGTextSubtree(aFrame)) {
return nullptr;
@ -2941,7 +2941,7 @@ nsLayoutUtils::TransformAncestorPointToFrame(nsIFrame* aFrame,
}
nsRect
nsLayoutUtils::TransformFrameRectToAncestor(nsIFrame* aFrame,
nsLayoutUtils::TransformFrameRectToAncestor(const nsIFrame* aFrame,
const nsRect& aRect,
const nsIFrame* aAncestor,
bool* aPreservesAxisAlignedRectangles /* = nullptr */,
@ -7279,13 +7279,13 @@ nsLayoutUtils::GetFrameTransparency(nsIFrame* aBackgroundFrame,
return eTransparencyOpaque;
}
static bool IsPopupFrame(nsIFrame* aFrame)
static bool IsPopupFrame(const nsIFrame* aFrame)
{
// aFrame is a popup it's the list control frame dropdown for a combobox.
LayoutFrameType frameType = aFrame->Type();
if (!nsLayoutUtils::IsContentSelectEnabled() &&
frameType == LayoutFrameType::ListControl) {
nsListControlFrame* lcf = static_cast<nsListControlFrame*>(aFrame);
const nsListControlFrame* lcf = static_cast<const nsListControlFrame*>(aFrame);
return lcf->IsInDropDownMode();
}
@ -7294,7 +7294,7 @@ static bool IsPopupFrame(nsIFrame* aFrame)
}
/* static */ bool
nsLayoutUtils::IsPopup(nsIFrame* aFrame)
nsLayoutUtils::IsPopup(const nsIFrame* aFrame)
{
// Optimization: the frame can't possibly be a popup if it has no view.
if (!aFrame->HasView()) {

Просмотреть файл

@ -223,7 +223,7 @@ public:
* Optionally pass the child, and it only returns true if the child is the
* scrolled frame for the displayport.
*/
static bool FrameHasDisplayPort(nsIFrame* aFrame, nsIFrame* aScrolledFrame = nullptr);
static bool FrameHasDisplayPort(nsIFrame* aFrame, const nsIFrame* aScrolledFrame = nullptr);
/**
* Check if the given element has a margins based displayport but is missing a
@ -854,7 +854,7 @@ public:
* non-null pointer to a non-empty Matrix4x4 - The provided matrix will be used
* as the transform matrix and applied to the rect.
*/
static nsRect TransformFrameRectToAncestor(nsIFrame* aFrame,
static nsRect TransformFrameRectToAncestor(const nsIFrame* aFrame,
const nsRect& aRect,
const nsIFrame* aAncestor,
bool* aPreservesAxisAlignedRectangles = nullptr,
@ -868,7 +868,7 @@ public:
* aAncestor to go up to the root frame. aInCSSUnits set to true will
* return CSS units, set to false (the default) will return App units.
*/
static Matrix4x4Flagged GetTransformToAncestor(nsIFrame *aFrame,
static Matrix4x4Flagged GetTransformToAncestor(const nsIFrame *aFrame,
const nsIFrame *aAncestor,
uint32_t aFlags = 0,
nsIFrame** aOutAncestor = nullptr);
@ -2029,7 +2029,7 @@ public:
* A frame is a popup if it has its own floating window. Menus, panels
* and combobox dropdowns are popups.
*/
static bool IsPopup(nsIFrame* aFrame);
static bool IsPopup(const nsIFrame* aFrame);
/**
* Find the nearest "display root". This is the nearest enclosing

Просмотреть файл

@ -6809,7 +6809,7 @@ nsIFrame::GetNearestWidget(nsPoint& aOffset) const
Matrix4x4Flagged
nsIFrame::GetTransformMatrix(const nsIFrame* aStopAtAncestor,
nsIFrame** aOutAncestor,
uint32_t aFlags)
uint32_t aFlags) const
{
MOZ_ASSERT(aOutAncestor, "Need a place to put the ancestor!");
@ -6892,7 +6892,7 @@ nsIFrame::GetTransformMatrix(const nsIFrame* aStopAtAncestor,
return Matrix4x4();
/* Keep iterating while the frame can't possibly be transformed. */
nsIFrame* current = this;
const nsIFrame* current = this;
while (!(*aOutAncestor)->IsTransformed() &&
!nsLayoutUtils::IsPopup(*aOutAncestor) &&
*aOutAncestor != aStopAtAncestor &&

Просмотреть файл

@ -2832,7 +2832,7 @@ public:
};
Matrix4x4Flagged GetTransformMatrix(const nsIFrame* aStopAtAncestor,
nsIFrame **aOutAncestor,
uint32_t aFlags = 0);
uint32_t aFlags = 0) const;
/**
* Bit-flags to pass to IsFrameOfType()

Просмотреть файл

@ -1560,7 +1560,7 @@ public:
* Constructs a TextFrameIterator for the specified SVGTextFrame
* with an optional frame subtree to restrict iterated text frames to.
*/
explicit TextFrameIterator(SVGTextFrame* aRoot, nsIFrame* aSubtree = nullptr)
explicit TextFrameIterator(SVGTextFrame* aRoot, const nsIFrame* aSubtree = nullptr)
: mRootFrame(aRoot),
mSubtree(aSubtree),
mCurrentFrame(aRoot),
@ -1699,7 +1699,7 @@ private:
/**
* The frame for the subtree we are also interested in tracking.
*/
nsIFrame* mSubtree;
const nsIFrame* mSubtree;
/**
* The current value of the iterator.
@ -1873,7 +1873,7 @@ public:
*/
explicit TextRenderedRunIterator(SVGTextFrame* aSVGTextFrame,
RenderedRunFilter aFilter = eAllFrames,
nsIFrame* aSubtree = nullptr)
const nsIFrame* aSubtree = nullptr)
: mFrameIterator(FrameIfAnonymousChildReflowed(aSVGTextFrame), aSubtree),
mFilter(aFilter),
mTextElementCharIndex(0),
@ -5745,7 +5745,7 @@ SVGTextFrame::TransformFramePointToTextChild(const Point& aPoint,
*/
gfxRect
SVGTextFrame::TransformFrameRectFromTextChild(const nsRect& aRect,
nsIFrame* aChildFrame)
const nsIFrame* aChildFrame)
{
NS_ASSERTION(aChildFrame &&
nsLayoutUtils::GetClosestFrameOfType

Просмотреть файл

@ -353,7 +353,7 @@ public:
* rectangle.
*/
gfxRect TransformFrameRectFromTextChild(const nsRect& aRect,
nsIFrame* aChildFrame);
const nsIFrame* aChildFrame);
// Return our ::-moz-svg-text anonymous box.
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;