зеркало из https://github.com/mozilla/pjs.git
Bug 455226 - Removing the xlink:href attribute of an feImage filter does not cause it to change; r+sr=bzbarsky
This commit is contained in:
Родитель
dd8f34b6a6
Коммит
ee543b8f1d
|
@ -5195,12 +5195,11 @@ public:
|
||||||
NS_FORWARD_NSIDOMNODE(nsSVGFEImageElementBase::)
|
NS_FORWARD_NSIDOMNODE(nsSVGFEImageElementBase::)
|
||||||
NS_FORWARD_NSIDOMELEMENT(nsSVGFEImageElementBase::)
|
NS_FORWARD_NSIDOMELEMENT(nsSVGFEImageElementBase::)
|
||||||
|
|
||||||
// nsSVGElement
|
|
||||||
virtual void DidChangeString(PRUint8 aAttrEnum, PRBool aDoSetAttr);
|
|
||||||
|
|
||||||
// nsIContent
|
// nsIContent
|
||||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||||
|
|
||||||
|
virtual nsresult AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
||||||
|
const nsAString* aValue, PRBool aNotify);
|
||||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
nsIContent* aBindingParent,
|
nsIContent* aBindingParent,
|
||||||
PRBool aCompileEventHandlers);
|
PRBool aCompileEventHandlers);
|
||||||
|
@ -5316,6 +5315,22 @@ nsSVGFEImageElement::LoadSVGImage(PRBool aForce, PRBool aNotify)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// nsIContent methods:
|
// nsIContent methods:
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
nsSVGFEImageElement::AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
||||||
|
const nsAString* aValue, PRBool aNotify)
|
||||||
|
{
|
||||||
|
if (aNamespaceID == kNameSpaceID_XLink && aName == nsGkAtoms::href) {
|
||||||
|
if (aValue) {
|
||||||
|
LoadSVGImage(PR_TRUE, aNotify);
|
||||||
|
} else {
|
||||||
|
CancelImageRequests(aNotify);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nsSVGFEImageElementBase::AfterSetAttr(aNamespaceID, aName,
|
||||||
|
aValue, aNotify);
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsSVGFEImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
nsSVGFEImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
nsIContent* aBindingParent,
|
nsIContent* aBindingParent,
|
||||||
|
@ -5326,11 +5341,13 @@ nsSVGFEImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
aCompileEventHandlers);
|
aCompileEventHandlers);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
// Our base URI may have changed; claim that our URI changed, and the
|
if (HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)) {
|
||||||
// nsImageLoadingContent will decide whether a new image load is warranted.
|
// Our base URI may have changed; claim that our URI changed, and the
|
||||||
// Note: no need to notify here; since we're just now being bound
|
// nsImageLoadingContent will decide whether a new image load is warranted.
|
||||||
// we don't have any frames or anything yet.
|
// Note: no need to notify here; since we're just now being bound
|
||||||
LoadSVGImage(PR_FALSE, PR_FALSE);
|
// we don't have any frames or anything yet.
|
||||||
|
LoadSVGImage(PR_FALSE, PR_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
@ -5434,16 +5451,6 @@ nsSVGFEImageElement::GetStringInfo()
|
||||||
NS_ARRAY_LENGTH(sStringInfo));
|
NS_ARRAY_LENGTH(sStringInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
nsSVGFEImageElement::DidChangeString(PRUint8 aAttrEnum, PRBool aDoSetAttr)
|
|
||||||
{
|
|
||||||
nsSVGFEImageElementBase::DidChangeString(aAttrEnum, aDoSetAttr);
|
|
||||||
|
|
||||||
if (aAttrEnum == HREF) {
|
|
||||||
LoadSVGImage(PR_TRUE, PR_TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// imgIDecoderObserver methods
|
// imgIDecoderObserver methods
|
||||||
|
|
||||||
|
|
|
@ -81,10 +81,9 @@ public:
|
||||||
NS_FORWARD_NSIDOMELEMENT(nsSVGImageElementBase::)
|
NS_FORWARD_NSIDOMELEMENT(nsSVGImageElementBase::)
|
||||||
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGImageElementBase::)
|
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGImageElementBase::)
|
||||||
|
|
||||||
// nsSVGElement specializations:
|
|
||||||
virtual void DidChangeString(PRUint8 aAttrEnum, PRBool aDoSetAttr);
|
|
||||||
|
|
||||||
// nsIContent interface
|
// nsIContent interface
|
||||||
|
virtual nsresult AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
||||||
|
const nsAString* aValue, PRBool aNotify);
|
||||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
nsIContent* aBindingParent,
|
nsIContent* aBindingParent,
|
||||||
PRBool aCompileEventHandlers);
|
PRBool aCompileEventHandlers);
|
||||||
|
@ -249,23 +248,6 @@ nsSVGImageElement::GetLengthInfo()
|
||||||
NS_ARRAY_LENGTH(sLengthInfo));
|
NS_ARRAY_LENGTH(sLengthInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
nsSVGImageElement::DidChangeString(PRUint8 aAttrEnum, PRBool aDoSetAttr)
|
|
||||||
{
|
|
||||||
nsSVGImageElementBase::DidChangeString(aAttrEnum, aDoSetAttr);
|
|
||||||
|
|
||||||
if (aAttrEnum == HREF) {
|
|
||||||
// If caller is not chrome and dom.disable_image_src_set is true,
|
|
||||||
// prevent setting image.src by exiting early
|
|
||||||
if (nsContentUtils::GetBoolPref("dom.disable_image_src_set") &&
|
|
||||||
!nsContentUtils::IsCallerChrome()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LoadSVGImage(PR_TRUE, PR_TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
@ -286,6 +268,28 @@ nsSVGImageElement::LoadSVGImage(PRBool aForce, PRBool aNotify)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// nsIContent methods:
|
// nsIContent methods:
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
nsSVGImageElement::AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
||||||
|
const nsAString* aValue, PRBool aNotify)
|
||||||
|
{
|
||||||
|
if (aNamespaceID == kNameSpaceID_XLink && aName == nsGkAtoms::href) {
|
||||||
|
// If caller is not chrome and dom.disable_image_src_set is true,
|
||||||
|
// prevent setting image.src by exiting early
|
||||||
|
if (nsContentUtils::GetBoolPref("dom.disable_image_src_set") &&
|
||||||
|
!nsContentUtils::IsCallerChrome()) {
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aValue) {
|
||||||
|
LoadSVGImage(PR_TRUE, aNotify);
|
||||||
|
} else {
|
||||||
|
CancelImageRequests(aNotify);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nsSVGImageElementBase::AfterSetAttr(aNamespaceID, aName,
|
||||||
|
aValue, aNotify);
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsSVGImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
nsSVGImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
nsIContent* aBindingParent,
|
nsIContent* aBindingParent,
|
||||||
|
@ -296,11 +300,13 @@ nsSVGImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
aCompileEventHandlers);
|
aCompileEventHandlers);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
// Our base URI may have changed; claim that our URI changed, and the
|
if (HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)) {
|
||||||
// nsImageLoadingContent will decide whether a new image load is warranted.
|
// Our base URI may have changed; claim that our URI changed, and the
|
||||||
// Note: no need to notify here; since we're just now being bound
|
// nsImageLoadingContent will decide whether a new image load is warranted.
|
||||||
// we don't have any frames or anything yet.
|
// Note: no need to notify here; since we're just now being bound
|
||||||
LoadSVGImage(PR_FALSE, PR_FALSE);
|
// we don't have any frames or anything yet.
|
||||||
|
LoadSVGImage(PR_FALSE, PR_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче