Backed out changeset f67228df9ae0 (bug 1022612)

This commit is contained in:
Carsten "Tomcat" Book 2014-07-15 10:30:18 +02:00
Родитель 4169dca7be
Коммит b004dd4d30
4 изменённых файлов: 54 добавлений и 0 удалений

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

@ -2246,6 +2246,23 @@ nsDisplayBackgroundImage::IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aCo
return false;
}
bool
nsDisplayBackgroundImage::IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame)
{
if (!mBackgroundStyle)
return false;
if (!mBackgroundStyle->HasFixedBackground())
return false;
// If aFrame is mFrame or an ancestor in this document, and aFrame is
// not the viewport frame, then moving aFrame will move mFrame
// relative to the viewport, so our fixed-pos background will change.
return aFrame->GetParent() &&
(aFrame == mFrame ||
nsLayoutUtils::IsProperAncestorFrame(aFrame, mFrame));
}
nsRect
nsDisplayBackgroundImage::GetPositioningArea()
{
@ -3102,6 +3119,13 @@ bool nsDisplayWrapList::IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aColo
return false;
}
bool nsDisplayWrapList::IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame) {
NS_WARNING("nsDisplayWrapList::IsVaryingRelativeToMovingFrame called unexpectedly");
// We could try to do something but let's conservatively just return true.
return true;
}
void nsDisplayWrapList::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) {
NS_ERROR("nsDisplayWrapList should have been flattened away for painting");

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

@ -1101,6 +1101,16 @@ public:
* bounds with the same (possibly translucent) color
*/
virtual bool IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aColor) { return false; }
/**
* @return false if the painting performed by the item is invariant
* when the item's underlying frame is moved relative to aFrame.
* In other words, if you render the item at locations P and P', the rendering
* only differs by the translation.
* It return true for all wrapped lists.
*/
virtual bool IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame)
{ return false; }
/**
* @return true if the contents of this item are rendered fixed relative
* to the nearest viewport.
@ -2169,6 +2179,8 @@ public:
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
bool* aSnap) MOZ_OVERRIDE;
virtual bool IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame) MOZ_OVERRIDE;
virtual bool IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aColor) MOZ_OVERRIDE;
/**
* GetBounds() returns the background painting area.
@ -2583,6 +2595,8 @@ public:
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
bool* aSnap) MOZ_OVERRIDE;
virtual bool IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aColor) MOZ_OVERRIDE;
virtual bool IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame) MOZ_OVERRIDE;
virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) MOZ_OVERRIDE;
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,

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

@ -1088,6 +1088,20 @@ nsDisplayTableItem::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) {
return mFrame->GetVisualOverflowRectRelativeToSelf() + ToReferenceFrame();
}
bool
nsDisplayTableItem::IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame)
{
if (!mPartHasFixedBackground)
return false;
// If aFrame is mFrame or an ancestor in this document, and aFrame is
// not the viewport frame, then moving aFrame will move mFrame
// relative to the viewport, so our fixed-pos background will change.
return mFrame == aFrame ||
nsLayoutUtils::IsProperAncestorFrame(aFrame, mFrame);
}
/* static */ void
nsDisplayTableItem::UpdateForFrameBackground(nsIFrame* aFrame)
{

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

@ -50,6 +50,8 @@ public:
nsDisplayItem(aBuilder, aFrame),
mPartHasFixedBackground(false) {}
virtual bool IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame) MOZ_OVERRIDE;
// With collapsed borders, parts of the collapsed border can extend outside
// the table part frames, so allow this display element to blow out to our
// overflow rect. This is also useful for row frames that have spanning