зеркало из https://github.com/mozilla/pjs.git
Bug 373634 - adding a viewBox attribute to outer SVG not working.
r=jwatt, sr=roc
This commit is contained in:
Родитель
d877247f1c
Коммит
660df3209b
|
@ -1106,6 +1106,23 @@ nsSVGSVGElement::IsAttributeMapped(const nsIAtom* name) const
|
|||
nsSVGSVGElementBase::IsAttributeMapped(name);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSVGSVGElement::AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString* aValue, PRBool aNotify)
|
||||
{
|
||||
nsSVGSVGElementBase::AfterSetAttr(aNameSpaceID, aName, aValue, aNotify);
|
||||
|
||||
// We need to do this here because the calling
|
||||
// InvalidateTransformNotifyFrame in DidModifySVGObservable would
|
||||
// happen too early, before HasAttr(viewBox) returns true (important
|
||||
// in the case of adding a viewBox)
|
||||
if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::viewBox) {
|
||||
InvalidateTransformNotifyFrame();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSVGSVGElement::UnsetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
||||
PRBool aNotify)
|
||||
|
@ -1186,7 +1203,11 @@ nsSVGSVGElement::DidModifySVGObservable (nsISVGValue* observable,
|
|||
}
|
||||
}
|
||||
|
||||
InvalidateTransformNotifyFrame();
|
||||
// Deal with viewBox in AfterSetAttr (see comment there for reason)
|
||||
nsCOMPtr<nsIDOMSVGAnimatedRect> r = do_QueryInterface(observable);
|
||||
if (r != mViewBox) {
|
||||
InvalidateTransformNotifyFrame();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -102,6 +102,8 @@ public:
|
|||
// nsIContent interface
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
|
||||
virtual nsresult AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString* aValue, PRBool aNotify);
|
||||
virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
PRBool aNotify);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче