Bug 364811 - svg:svg not live to length modifications. r=jwatt, sr=roc
git-svn-id: svn://10.0.0.236/trunk@217723 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
5ac72b9307
commit
9a3460d709
@ -1193,26 +1193,8 @@ nsSVGSVGElement::DidModifySVGObservable (nsISVGValue* observable,
|
||||
}
|
||||
}
|
||||
|
||||
// invalidate viewbox -> viewport xform & inform frames
|
||||
mViewBoxToViewportTransform = nsnull;
|
||||
InvalidateTransformNotifyFrame();
|
||||
|
||||
nsIFrame* frame = presShell->GetPrimaryFrameFor(this);
|
||||
if (frame) {
|
||||
nsISVGSVGFrame* svgframe;
|
||||
CallQueryInterface(frame, &svgframe);
|
||||
if (svgframe) {
|
||||
svgframe->NotifyViewportChange();
|
||||
}
|
||||
#ifdef DEBUG
|
||||
else {
|
||||
// XXX we get here during nsSVGOuterSVGFrame::Init() since that
|
||||
// function is called before the presshell association between us
|
||||
// and our frame is established.
|
||||
NS_WARNING("wrong frame type");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1317,6 +1299,34 @@ void nsSVGSVGElement::GetOffsetToAncestor(nsIContent* ancestor,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGSVGElement::InvalidateTransformNotifyFrame()
|
||||
{
|
||||
nsIDocument* doc = GetCurrentDoc();
|
||||
if (!doc) return;
|
||||
nsIPresShell* presShell = doc->GetShellAt(0);
|
||||
if (!presShell) return;
|
||||
|
||||
mViewBoxToViewportTransform = nsnull;
|
||||
|
||||
nsIFrame* frame = presShell->GetPrimaryFrameFor(this);
|
||||
if (frame) {
|
||||
nsISVGSVGFrame* svgframe;
|
||||
CallQueryInterface(frame, &svgframe);
|
||||
if (svgframe) {
|
||||
svgframe->NotifyViewportChange();
|
||||
}
|
||||
#ifdef DEBUG
|
||||
else {
|
||||
// XXX we get here during nsSVGOuterSVGFrame::Init() since that
|
||||
// function is called before the presshell association between us
|
||||
// and our frame is established.
|
||||
NS_WARNING("wrong frame type");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGContent methods
|
||||
|
||||
@ -1351,6 +1361,8 @@ nsSVGSVGElement::DidChangeLength(PRUint8 aAttrEnum, PRBool aDoSetAttr)
|
||||
mViewBox->GetAnimVal(getter_AddRefs(vb));
|
||||
vb->SetWidth(mLengthAttributes[WIDTH].GetAnimValue(mCoordCtx));
|
||||
vb->SetHeight(mLengthAttributes[HEIGHT].GetAnimValue(mCoordCtx));
|
||||
} else {
|
||||
InvalidateTransformNotifyFrame();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -125,6 +125,9 @@ protected:
|
||||
// implementation helpers:
|
||||
void GetOffsetToAncestor(nsIContent* ancestor, float &x, float &y);
|
||||
|
||||
// invalidate viewbox -> viewport xform & inform frames
|
||||
void InvalidateTransformNotifyFrame();
|
||||
|
||||
virtual LengthAttributesInfo GetLengthInfo();
|
||||
|
||||
enum { X, Y, WIDTH, HEIGHT };
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user