--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -1019,18 +1019,16 @@ public:
nsDisplayItem* MergeItems(nsTArray<nsDisplayItem*>& aMergedItems);
/**
* A helper class to temporarily set the value of
* mIsAtRootOfPseudoStackingContext, and temporarily
* set mCurrentFrame and related state. Also temporarily sets mDirtyRect.
* aDirtyRect is relative to aForChild.
*/
- class AutoBuildingDisplayList;
- friend class AutoBuildingDisplayList;
class AutoBuildingDisplayList {
public:
AutoBuildingDisplayList(nsDisplayListBuilder* aBuilder,
nsIFrame* aForChild,
const nsRect& aVisibleRect,
const nsRect& aDirtyRect,
bool aIsRoot)
: mBuilder(aBuilder),
@@ -1112,18 +1110,16 @@ public:
bool mPrevAncestorHasApzAwareEventHandler;
bool mPrevBuildingInvisibleItems;
bool mPrevInInvalidSubtree;
};
/**
* A helper class to temporarily set the value of mInTransform.
*/
- class AutoInTransformSetter;
- friend class AutoInTransformSetter;
class AutoInTransformSetter {
public:
AutoInTransformSetter(nsDisplayListBuilder* aBuilder, bool aInTransform)
: mBuilder(aBuilder), mOldValue(aBuilder->mInTransform) {
aBuilder->mInTransform = aInTransform;
}
~AutoInTransformSetter() {
mBuilder->mInTransform = mOldValue;
@@ -1131,18 +1127,16 @@ public:
private:
nsDisplayListBuilder* mBuilder;
bool mOldValue;
};
/**
* A helper class to temporarily set the value of mFilterASR.
*/
- class AutoFilterASRSetter;
- friend class AutoFilterASRSetter;
class AutoFilterASRSetter {
public:
AutoFilterASRSetter(nsDisplayListBuilder* aBuilder, bool aUsingFilter)
: mBuilder(aBuilder), mOldValue(aBuilder->mFilterASR)
{
if (!aBuilder->mFilterASR && aUsingFilter) {
aBuilder->mFilterASR = aBuilder->CurrentActiveScrolledRoot();
}
@@ -1150,18 +1144,16 @@ public:
~AutoFilterASRSetter() {
mBuilder->mFilterASR = mOldValue;
}
private:
nsDisplayListBuilder* mBuilder;
const ActiveScrolledRoot* mOldValue;
};
- class AutoSaveRestorePerspectiveIndex;
- friend class AutoSaveRestorePerspectiveIndex;
class AutoSaveRestorePerspectiveIndex {
public:
AutoSaveRestorePerspectiveIndex(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
: mBuilder(nullptr)
{
if (aFrame->ChildrenHavePerspective()) {
mBuilder = aBuilder;
mCachedItemIndex = aBuilder->mPerspectiveItemIndex;
@@ -1179,18 +1171,16 @@ public:
private:
nsDisplayListBuilder* mBuilder;
uint32_t mCachedItemIndex;
};
/**
* A helper class to temporarily set the value of mCurrentScrollParentId.
*/
- class AutoCurrentScrollParentIdSetter;
- friend class AutoCurrentScrollParentIdSetter;
class AutoCurrentScrollParentIdSetter {
public:
AutoCurrentScrollParentIdSetter(nsDisplayListBuilder* aBuilder, ViewID aScrollId)
: mBuilder(aBuilder)
, mOldValue(aBuilder->mCurrentScrollParentId)
, mOldForceLayer(aBuilder->mForceLayerForScrollParent) {
// If this AutoCurrentScrollParentIdSetter has the same scrollId as the
// previous one on the stack, then that means the scrollframe that
@@ -1225,18 +1215,16 @@ public:
bool mOldForceLayer;
bool mCanBeScrollParent;
};
/**
* Used to update the current active scrolled root on the display list
* builder, and to create new active scrolled roots.
*/
- class AutoCurrentActiveScrolledRootSetter;
- friend class AutoCurrentActiveScrolledRootSetter;
class AutoCurrentActiveScrolledRootSetter {
public:
explicit AutoCurrentActiveScrolledRootSetter(nsDisplayListBuilder* aBuilder)
: mBuilder(aBuilder)
, mSavedActiveScrolledRoot(aBuilder->mCurrentActiveScrolledRoot)
, mContentClipASR(aBuilder->ClipState().GetContentClipASR())
, mDescendantsStartIndex(aBuilder->mActiveScrolledRoots.Length())
, mUsed(false)
@@ -1291,18 +1279,16 @@ public:
/**
* Keeps track of the innermost ASR that can be used as the ASR for a
* container item that wraps all items that were created while this
* object was on the stack.
* The rule is: all child items of the container item need to have
* clipped bounds with respect to the container ASR.
*/
- class AutoContainerASRTracker;
- friend class AutoContainerASRTracker;
class AutoContainerASRTracker {
public:
explicit AutoContainerASRTracker(nsDisplayListBuilder* aBuilder)
: mBuilder(aBuilder)
, mSavedContainerASR(aBuilder->mCurrentContainerASR)
{
mBuilder->mCurrentContainerASR = ActiveScrolledRoot::PickDescendant(
mBuilder->ClipState().GetContentClipASR(),
@@ -1324,18 +1310,16 @@ public:
nsDisplayListBuilder* mBuilder;
const ActiveScrolledRoot* mSavedContainerASR;
};
/**
* A helper class to temporarily set the value of mCurrentScrollbarTarget
* and mCurrentScrollbarFlags.
*/
- class AutoCurrentScrollbarInfoSetter;
- friend class AutoCurrentScrollbarInfoSetter;
class AutoCurrentScrollbarInfoSetter {
public:
AutoCurrentScrollbarInfoSetter(nsDisplayListBuilder* aBuilder, ViewID aScrollTargetID,
nsDisplayOwnLayerFlags aScrollbarFlags, bool aWillHaveLayer)
: mBuilder(aBuilder) {
aBuilder->mIsBuildingScrollbar = true;
aBuilder->mCurrentScrollbarTarget = aScrollTargetID;
aBuilder->mCurrentScrollbarFlags = aScrollbarFlags;
@@ -1356,18 +1340,16 @@ public:
* A helper class to track current effective transform for items.
*
* For frames that is Combines3DTransformWithAncestors(), we need to
* apply all transforms of ancestors on the same preserves3D chain
* on the bounds of current frame to the coordination of the 3D
* context root. The 3D context root computes it's bounds from
* these transformed bounds.
*/
- class AutoAccumulateTransform;
- friend class AutoAccumulateTransform;
class AutoAccumulateTransform {
public:
typedef mozilla::gfx::Matrix4x4 Matrix4x4;
explicit AutoAccumulateTransform(nsDisplayListBuilder* aBuilder)
: mBuilder(aBuilder)
, mSavedTransform(aBuilder->mPreserves3DCtx.mAccumulatedTransform) {}
@@ -1397,18 +1379,16 @@ public:
* A helper class to collect bounds rects of descendants.
*
* For a 3D context root, it's bounds is computed from the bounds of
* descendants. If we transform bounds frame by frame applying
* transforms, the bounds may turn to empty for any singular
* transform on the path, but it is not empty for the accumulated
* transform.
*/
- class AutoAccumulateRect;
- friend class AutoAccumulateRect;
class AutoAccumulateRect {
public:
explicit AutoAccumulateRect(nsDisplayListBuilder* aBuilder)
: mBuilder(aBuilder)
, mSavedRect(aBuilder->mPreserves3DCtx.mAccumulatedRect) {
aBuilder->mPreserves3DCtx.mAccumulatedRect = nsRect();
aBuilder->mPreserves3DCtx.mAccumulatedRectLevels++;
}
@@ -1681,18 +1661,16 @@ public:
* A helper class to install/restore nsDisplayListBuilder::mPreserves3DCtx.
*
* mPreserves3DCtx is used by class AutoAccumulateTransform &
* AutoAccumulateRect to passing data between frames in the 3D
* context. If a frame create a new 3D context, it should restore
* the value of mPreserves3DCtx before returning back to the parent.
* This class do it for the users.
*/
- class AutoPreserves3DContext;
- friend class AutoPreserves3DContext;
class AutoPreserves3DContext {
public:
explicit AutoPreserves3DContext(nsDisplayListBuilder* aBuilder)
: mBuilder(aBuilder)
, mSavedCtx(aBuilder->mPreserves3DCtx) {}
~AutoPreserves3DContext() {
mBuilder->mPreserves3DCtx = mSavedCtx;
}