Bug 780963 - Make UpdateOverflow() on filter primitive frames a no-op. r=roc.

This commit is contained in:
Jonathan Watt 2012-08-14 10:04:24 +01:00
parent fc75b382a6
commit 522fc0f166
6 changed files with 32 additions and 4 deletions

View File

@ -5058,6 +5058,10 @@ nsIFrame::GetPreEffectsVisualOverflowRect() const
/* virtual */ bool
nsFrame::UpdateOverflow()
{
MOZ_ASSERT(!(mState & NS_FRAME_SVG_LAYOUT) ||
!(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
"Non-display SVG do not maintain visual overflow rects");
nsRect rect(nsPoint(0, 0), GetSize());
nsOverflowAreas overflowAreas(rect, rect);

View File

@ -25,7 +25,7 @@ protected:
SVGFEContainerFrame(nsStyleContext* aContext)
: SVGFEContainerFrameBase(aContext)
{
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
AddStateBits(NS_FRAME_SVG_LAYOUT | NS_STATE_SVG_NONDISPLAY_CHILD);
}
public:
@ -61,6 +61,11 @@ public:
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType);
virtual bool UpdateOverflow() {
// We don't maintain a visual overflow rect
return false;
}
};
nsIFrame*

View File

@ -23,7 +23,7 @@ protected:
SVGFEImageFrame(nsStyleContext* aContext)
: SVGFEImageFrameBase(aContext)
{
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
AddStateBits(NS_FRAME_SVG_LAYOUT | NS_STATE_SVG_NONDISPLAY_CHILD);
}
public:
@ -58,6 +58,11 @@ public:
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType);
virtual bool UpdateOverflow() {
// We don't maintain a visual overflow rect
return false;
}
};
nsIFrame*

View File

@ -23,7 +23,7 @@ protected:
SVGFELeafFrame(nsStyleContext* aContext)
: SVGFELeafFrameBase(aContext)
{
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
AddStateBits(NS_FRAME_SVG_LAYOUT | NS_STATE_SVG_NONDISPLAY_CHILD);
}
public:
@ -59,6 +59,11 @@ public:
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType);
virtual bool UpdateOverflow() {
// We don't maintain a visual overflow rect
return false;
}
};
nsIFrame*

View File

@ -19,7 +19,7 @@ protected:
SVGFEUnstyledLeafFrame(nsStyleContext* aContext)
: SVGFEUnstyledLeafFrameBase(aContext)
{
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
AddStateBits(NS_FRAME_SVG_LAYOUT | NS_STATE_SVG_NONDISPLAY_CHILD);
}
public:
@ -53,6 +53,11 @@ public:
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType);
virtual bool UpdateOverflow() {
// We don't maintain a visual overflow rect
return false;
}
};
nsIFrame*

View File

@ -503,6 +503,10 @@ nsSVGFilterFrame::GetPostFilterBounds(nsIFrame *aFilteredFrame,
const gfxRect *aOverrideBBox,
const nsRect *aPreFilterBounds)
{
MOZ_ASSERT(!(aFilteredFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) ||
!(aFilteredFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
"Non-display SVG do not maintain visual overflow rects");
nsAutoFilterInstance instance(aFilteredFrame, this, nullptr, nullptr,
aPreFilterBounds, aPreFilterBounds,
aOverrideBBox);