Browse Source

Issue #21 - Change MappedAttrParser to store its nsIPrincipal instead of nsSVGElement

This reverts part 2 of Bug 968923 since this was only modified to accommodate use counters.
pull/28/head
FranklinDM 4 months ago committed by roytam1
parent
commit
cee60fb824
  1. 16
      dom/svg/nsSVGElement.cpp

16
dom/svg/nsSVGElement.cpp

@ -1150,7 +1150,7 @@ public:
MappedAttrParser(css::Loader* aLoader,
nsIURI* aDocURI,
already_AddRefed<nsIURI> aBaseURI,
nsSVGElement* aElement);
nsIPrincipal* aNodePrincipal);
~MappedAttrParser();
// Parses a mapped attribute value.
@ -1170,20 +1170,18 @@ private:
// Arguments for nsCSSParser::ParseProperty
nsIURI* mDocURI;
nsCOMPtr<nsIURI> mBaseURI;
nsIPrincipal* mNodePrincipal;
// Declaration for storing parsed values (lazily initialized)
css::Declaration* mDecl;
// For reporting use counters
nsSVGElement* mElement;
};
MappedAttrParser::MappedAttrParser(css::Loader* aLoader,
nsIURI* aDocURI,
already_AddRefed<nsIURI> aBaseURI,
nsSVGElement* aElement)
nsIPrincipal* aNodePrincipal)
: mParser(aLoader), mDocURI(aDocURI), mBaseURI(aBaseURI),
mDecl(nullptr), mElement(aElement)
mNodePrincipal(aNodePrincipal), mDecl(nullptr)
{
}
@ -1210,7 +1208,7 @@ MappedAttrParser::ParseMappedAttrValue(nsIAtom* aMappedAttrName,
if (propertyID != eCSSProperty_UNKNOWN) {
bool changed; // outparam for ParseProperty. (ignored)
mParser.ParseProperty(propertyID, aMappedAttrValue, mDocURI, mBaseURI,
mElement->NodePrincipal(), mDecl, &changed, false, true);
mNodePrincipal, mDecl, &changed, false, true);
return;
}
MOZ_ASSERT(aMappedAttrName == nsGkAtoms::lang,
@ -1257,7 +1255,7 @@ nsSVGElement::UpdateContentStyleRule()
nsIDocument* doc = OwnerDoc();
MappedAttrParser mappedAttrParser(doc->CSSLoader(), doc->GetDocumentURI(),
GetBaseURI(), this);
GetBaseURI(), NodePrincipal());
for (uint32_t i = 0; i < attrCount; ++i) {
const nsAttrName* attrName = mAttrsAndChildren.AttrNameAt(i);
@ -1348,7 +1346,7 @@ nsSVGElement::UpdateAnimatedContentStyleRule()
}
MappedAttrParser mappedAttrParser(doc->CSSLoader(), doc->GetDocumentURI(),
GetBaseURI(), this);
GetBaseURI(), NodePrincipal());
doc->PropertyTable(SMIL_MAPPED_ATTR_ANIMVAL)->
Enumerate(this, ParseMappedAttrAnimValueCallback, &mappedAttrParser);

Loading…
Cancel
Save