Bug 539122 - Stop restyling non-elements with SVG. r=roc

This commit is contained in:
Robert Longson 2010-01-13 11:09:58 +00:00
parent 9dc73b0d47
commit 29fa5a63d4
2 changed files with 15 additions and 10 deletions

View File

@ -365,6 +365,9 @@ nsSVGEffects::EffectProperties::GetMaskFrame(PRBool *aOK)
void
nsSVGEffects::UpdateEffects(nsIFrame *aFrame)
{
NS_ASSERTION(aFrame->GetContent()->IsNodeOfType(nsINode::eELEMENT),
"aFrame's content should be an element");
aFrame->DeleteProperty(nsGkAtoms::filter);
aFrame->DeleteProperty(nsGkAtoms::mask);
aFrame->DeleteProperty(nsGkAtoms::clipPath);
@ -392,10 +395,12 @@ nsSVGEffects::UpdateEffects(nsIFrame *aFrame)
CreateMarkerProperty);
}
nsIFrame *aKid = aFrame->GetFirstChild(nsnull);
while (aKid) {
UpdateEffects(aKid);
aKid = aKid->GetNextSibling();
nsIFrame *kid = aFrame->GetFirstChild(nsnull);
while (kid) {
if (kid->GetContent()->IsNodeOfType(nsINode::eELEMENT)) {
UpdateEffects(kid);
}
kid = kid->GetNextSibling();
}
}

View File

@ -911,19 +911,19 @@ nsSVGUtils::GetCanvasTM(nsIFrame *aFrame)
void
nsSVGUtils::NotifyChildrenOfSVGChange(nsIFrame *aFrame, PRUint32 aFlags)
{
nsIFrame *aKid = aFrame->GetFirstChild(nsnull);
nsIFrame *kid = aFrame->GetFirstChild(nsnull);
while (aKid) {
nsISVGChildFrame* SVGFrame = do_QueryFrame(aKid);
while (kid) {
nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
if (SVGFrame) {
SVGFrame->NotifySVGChanged(aFlags);
} else {
NS_ASSERTION(aKid->IsFrameOfType(nsIFrame::eSVG), "SVG frame expected");
NS_ASSERTION(kid->IsFrameOfType(nsIFrame::eSVG), "SVG frame expected");
// recurse into the children of container frames e.g. <clipPath>, <mask>
// in case they have child frames with transformation matrices
nsSVGUtils::NotifyChildrenOfSVGChange(aKid, aFlags);
nsSVGUtils::NotifyChildrenOfSVGChange(kid, aFlags);
}
aKid = aKid->GetNextSibling();
kid = kid->GetNextSibling();
}
}