diff options
author | FranklinDM <mrmineshafter17@gmail.com> | 2022-04-04 23:01:53 +0800 |
---|---|---|
committer | FranklinDM <mrmineshafter17@gmail.com> | 2022-04-24 00:09:21 +0800 |
commit | c8b89feae8a93db677d1398d1a50bedb2094e57a (patch) | |
tree | 5641287e41c21da5b3f2d8a2445ad7530ebbd9dd /dom | |
parent | 17b2aa76508e24b937fc92666bb0513360b103cc (diff) | |
download | uxp-c8b89feae8a93db677d1398d1a50bedb2094e57a.tar.gz |
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.
Diffstat (limited to 'dom')
-rw-r--r-- | dom/svg/nsSVGElement.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/dom/svg/nsSVGElement.cpp b/dom/svg/nsSVGElement.cpp index 97578b81c7..39998c1541 100644 --- a/dom/svg/nsSVGElement.cpp +++ b/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); @@ -1330,7 +1328,7 @@ nsSVGElement::UpdateAnimatedContentStyleRule() } MappedAttrParser mappedAttrParser(doc->CSSLoader(), doc->GetDocumentURI(), - GetBaseURI(), this); + GetBaseURI(), NodePrincipal()); doc->PropertyTable(SMIL_MAPPED_ATTR_ANIMVAL)-> Enumerate(this, ParseMappedAttrAnimValueCallback, &mappedAttrParser); |