Backed out changeset 7e9751c1302a (bug 1022612)

This commit is contained in:
Carsten "Tomcat" Book 2014-07-15 10:30:01 +02:00
parent 7f4f90969e
commit 4dafc50d79
4 changed files with 46 additions and 0 deletions

View File

@ -513,6 +513,7 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
mAllowMergingAndFlattening(true),
mWillComputePluginGeometry(false),
mInTransform(false),
mInFixedPos(false),
mSyncDecodeImages(false),
mIsPaintingToWindow(false),
mIsCompositingCheap(false),

View File

@ -406,6 +406,12 @@ public:
*/
void SetInTransform(bool aInTransform) { mInTransform = aInTransform; }
/**
* Returns true if we're currently building display items that are in
* true fixed position subtree.
*/
bool IsInFixedPos() const { return mInFixedPos; }
/**
* @return true if images have been set to decode synchronously.
*/
@ -592,6 +598,25 @@ public:
bool mOldValue;
};
/**
* A helper class to temporarily set the value of mInFixedPos.
*/
class AutoInFixedPosSetter;
friend class AutoInFixedPosSetter;
class AutoInFixedPosSetter {
public:
AutoInFixedPosSetter(nsDisplayListBuilder* aBuilder, bool aInFixedPos)
: mBuilder(aBuilder), mOldValue(aBuilder->mInFixedPos) {
aBuilder->mInFixedPos = aInFixedPos;
}
~AutoInFixedPosSetter() {
mBuilder->mInFixedPos = mOldValue;
}
private:
nsDisplayListBuilder* mBuilder;
bool mOldValue;
};
/**
* A helper class to temporarily set the value of mCurrentScrollParentId.
*/
@ -765,6 +790,7 @@ private:
// True when we're building a display list that's directly or indirectly
// under an nsDisplayTransform
bool mInTransform;
bool mInFixedPos;
bool mSyncDecodeImages;
bool mIsPaintingToWindow;
bool mIsCompositingCheap;
@ -822,6 +848,7 @@ public:
nsDisplayItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
: mFrame(aFrame)
, mClip(aBuilder->ClipState().GetCurrentCombinedClip(aBuilder))
, mInFixedPos(aBuilder->IsInFixedPos())
#ifdef MOZ_DUMP_PAINTING
, mPainted(false)
#endif
@ -839,6 +866,7 @@ public:
: mFrame(aFrame)
, mClip(nullptr)
, mReferenceFrame(nullptr)
, mInFixedPos(false)
#ifdef MOZ_DUMP_PAINTING
, mPainted(false)
#endif
@ -1332,6 +1360,8 @@ public:
}
}
bool IsInFixedPos() { return mInFixedPos; }
protected:
friend class nsDisplayList;
@ -1349,6 +1379,7 @@ protected:
// of the item. Paint implementations can use this to limit their drawing.
// Guaranteed to be contained in GetBounds().
nsRect mVisibleRect;
bool mInFixedPos;
#ifdef MOZ_DUMP_PAINTING
// True if this frame has been painted.
bool mPainted;

View File

@ -2290,6 +2290,13 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
NS_ASSERTION(!isStackingContext || pseudoStackingContext,
"Stacking contexts must also be pseudo-stacking-contexts");
bool isInFixedPos = aBuilder->IsInFixedPos() ||
(isPositioned &&
disp->mPosition == NS_STYLE_POSITION_FIXED &&
nsLayoutUtils::IsReallyFixedPos(child));
nsDisplayListBuilder::AutoInFixedPosSetter
buildingInFixedPos(aBuilder, isInFixedPos);
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, child, dirty, pseudoStackingContext);
DisplayListClipState::AutoClipMultiple clipState(aBuilder);

View File

@ -444,6 +444,13 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
haveDisplayPort ||
presContext->IsRootContentDocument() || (sf && sf->IsScrollingActive());
// Don't let in fixed pos propagate down to child documents. This makes
// it a little less effective but doesn't regress an important case of a
// child document being in a fixed pos element where we would do no occlusion
// at all if we let it propagate down.
nsDisplayListBuilder::AutoInFixedPosSetter
buildingInFixedPos(aBuilder, false);
nsDisplayList childItems;
{