diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 50f5144a7307..29a1ec1936db 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -2683,7 +2683,8 @@ Element::SetAttr(int32_t aNamespaceID, nsAtom* aName, NS_ENSURE_SUCCESS(rv, rv); if (!preparsedAttrValue && - !ParseAttribute(aNamespaceID, aName, aValue, attrValue)) { + !ParseAttribute(aNamespaceID, aName, aValue, aSubjectPrincipal, + attrValue)) { attrValue.SetTo(aValue); } @@ -2903,6 +2904,7 @@ bool Element::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aAttribute == nsGkAtoms::lang) { diff --git a/dom/base/Element.h b/dom/base/Element.h index 5ad6d0ca55ab..07e7f470d6f3 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -1565,12 +1565,18 @@ protected: * @param aNamespaceID the namespace of the attribute to convert * @param aAttribute the attribute to convert * @param aValue the string value to convert + * @param aMaybeScriptedPrincipal the principal of the script setting the + * attribute, if one can be determined, or null otherwise. As in + * AfterSetAttr, a null value does not guarantee that the attribute was + * not set by a scripted caller, but a non-null value guarantees that + * the attribute was set by a scripted caller with the given principal. * @param aResult the nsAttrValue [OUT] * @return true if the parsing was successful, false otherwise */ virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult); /** diff --git a/dom/base/nsStyledElement.cpp b/dom/base/nsStyledElement.cpp index 158994252b03..7c78bfba91a1 100644 --- a/dom/base/nsStyledElement.cpp +++ b/dom/base/nsStyledElement.cpp @@ -39,6 +39,7 @@ bool nsStyledElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aAttribute == nsGkAtoms::style && aNamespaceID == kNameSpaceID_None) { @@ -47,7 +48,7 @@ nsStyledElement::ParseAttribute(int32_t aNamespaceID, } return nsStyledElementBase::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } nsresult diff --git a/dom/base/nsStyledElement.h b/dom/base/nsStyledElement.h index 89abe6c6fa46..0d02b08f09ec 100644 --- a/dom/base/nsStyledElement.h +++ b/dom/base/nsStyledElement.h @@ -68,7 +68,9 @@ protected: bool aForceInDataDoc); virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, - const nsAString& aValue, nsAttrValue& aResult) override; + const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, + nsAttrValue& aResult) override; friend class mozilla::dom::Element; diff --git a/dom/html/HTMLBRElement.cpp b/dom/html/HTMLBRElement.cpp index 4b517843baae..ba2bd5a2e996 100644 --- a/dom/html/HTMLBRElement.cpp +++ b/dom/html/HTMLBRElement.cpp @@ -40,6 +40,7 @@ bool HTMLBRElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aAttribute == nsGkAtoms::clear && aNamespaceID == kNameSpaceID_None) { @@ -47,7 +48,7 @@ HTMLBRElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLBRElement.h b/dom/html/HTMLBRElement.h index c1c85a6a28bd..ce28ea1e2de5 100644 --- a/dom/html/HTMLBRElement.h +++ b/dom/html/HTMLBRElement.h @@ -22,6 +22,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; diff --git a/dom/html/HTMLBodyElement.cpp b/dom/html/HTMLBodyElement.cpp index c33101254d73..366da713ac53 100644 --- a/dom/html/HTMLBodyElement.cpp +++ b/dom/html/HTMLBodyElement.cpp @@ -46,6 +46,7 @@ bool HTMLBodyElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -70,7 +71,7 @@ HTMLBodyElement::ParseAttribute(int32_t aNamespaceID, aAttribute, aValue, aResult) || nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLBodyElement.h b/dom/html/HTMLBodyElement.h index 475b5088e936..7bcace51e5f1 100644 --- a/dom/html/HTMLBodyElement.h +++ b/dom/html/HTMLBodyElement.h @@ -126,6 +126,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; diff --git a/dom/html/HTMLButtonElement.cpp b/dom/html/HTMLButtonElement.cpp index 4605193a8d30..b1958830fbbd 100644 --- a/dom/html/HTMLButtonElement.cpp +++ b/dom/html/HTMLButtonElement.cpp @@ -155,6 +155,7 @@ bool HTMLButtonElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -172,7 +173,7 @@ HTMLButtonElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } bool diff --git a/dom/html/HTMLButtonElement.h b/dom/html/HTMLButtonElement.h index 4ff8780e0a8b..7dd4d55053a6 100644 --- a/dom/html/HTMLButtonElement.h +++ b/dom/html/HTMLButtonElement.h @@ -89,6 +89,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; // nsGenericHTMLElement diff --git a/dom/html/HTMLCanvasElement.cpp b/dom/html/HTMLCanvasElement.cpp index e704d9b1a9e6..5ae191137e6a 100644 --- a/dom/html/HTMLCanvasElement.cpp +++ b/dom/html/HTMLCanvasElement.cpp @@ -642,6 +642,7 @@ bool HTMLCanvasElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None && @@ -650,7 +651,7 @@ HTMLCanvasElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } diff --git a/dom/html/HTMLCanvasElement.h b/dom/html/HTMLCanvasElement.h index dfc488d50665..c349e4a9c083 100644 --- a/dom/html/HTMLCanvasElement.h +++ b/dom/html/HTMLCanvasElement.h @@ -290,6 +290,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute, int32_t aModType) const override; diff --git a/dom/html/HTMLDivElement.cpp b/dom/html/HTMLDivElement.cpp index 664bc60c9dde..59dc4c52f051 100644 --- a/dom/html/HTMLDivElement.cpp +++ b/dom/html/HTMLDivElement.cpp @@ -31,6 +31,7 @@ bool HTMLDivElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -55,7 +56,7 @@ HTMLDivElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLDivElement.h b/dom/html/HTMLDivElement.h index d8f5247776a8..9d60687327c8 100644 --- a/dom/html/HTMLDivElement.h +++ b/dom/html/HTMLDivElement.h @@ -32,6 +32,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; diff --git a/dom/html/HTMLEmbedElement.cpp b/dom/html/HTMLEmbedElement.cpp index 219a60f874f9..daa97a68ce69 100644 --- a/dom/html/HTMLEmbedElement.cpp +++ b/dom/html/HTMLEmbedElement.cpp @@ -221,6 +221,7 @@ bool HTMLEmbedElement::ParseAttribute(int32_t aNamespaceID, nsAtom *aAttribute, const nsAString &aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue &aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -233,7 +234,7 @@ HTMLEmbedElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } static void diff --git a/dom/html/HTMLEmbedElement.h b/dom/html/HTMLEmbedElement.h index 63bd33fcc003..81349fdec4fa 100644 --- a/dom/html/HTMLEmbedElement.h +++ b/dom/html/HTMLEmbedElement.h @@ -48,6 +48,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom *aAttribute, const nsAString &aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue &aResult) override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom *aAttribute) const override; diff --git a/dom/html/HTMLFontElement.cpp b/dom/html/HTMLFontElement.cpp index 378df4e3f62d..ff4c0f9129ba 100644 --- a/dom/html/HTMLFontElement.cpp +++ b/dom/html/HTMLFontElement.cpp @@ -33,6 +33,7 @@ bool HTMLFontElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -50,7 +51,7 @@ HTMLFontElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLFontElement.h b/dom/html/HTMLFontElement.h index 06867bc5f9a8..b8976a5ab42b 100644 --- a/dom/html/HTMLFontElement.h +++ b/dom/html/HTMLFontElement.h @@ -48,6 +48,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; diff --git a/dom/html/HTMLFormElement.cpp b/dom/html/HTMLFormElement.cpp index e81e2f401b69..29f93a044cfe 100644 --- a/dom/html/HTMLFormElement.cpp +++ b/dom/html/HTMLFormElement.cpp @@ -279,6 +279,7 @@ bool HTMLFormElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -294,7 +295,7 @@ HTMLFormElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } nsresult diff --git a/dom/html/HTMLFormElement.h b/dom/html/HTMLFormElement.h index 6012cd55b046..e5e3892776e6 100644 --- a/dom/html/HTMLFormElement.h +++ b/dom/html/HTMLFormElement.h @@ -94,6 +94,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsresult GetEventTargetParent( EventChainPreVisitor& aVisitor) override; diff --git a/dom/html/HTMLFrameElement.cpp b/dom/html/HTMLFrameElement.cpp index 0b6a638bbbc9..d28e6cde9ffe 100644 --- a/dom/html/HTMLFrameElement.cpp +++ b/dom/html/HTMLFrameElement.cpp @@ -33,6 +33,7 @@ bool HTMLFrameElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -54,7 +55,7 @@ HTMLFrameElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLFrameElement::ParseAttribute(aNamespaceID, aAttribute, - aValue, aResult); + aValue, aMaybeScriptedPrincipal, aResult); } JSObject* diff --git a/dom/html/HTMLFrameElement.h b/dom/html/HTMLFrameElement.h index 3027860ec91b..6a0304467d46 100644 --- a/dom/html/HTMLFrameElement.h +++ b/dom/html/HTMLFrameElement.h @@ -31,6 +31,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult, bool aPreallocateChildren) const override; diff --git a/dom/html/HTMLFrameSetElement.cpp b/dom/html/HTMLFrameSetElement.cpp index 113ec47a18cd..f514eb77f436 100644 --- a/dom/html/HTMLFrameSetElement.cpp +++ b/dom/html/HTMLFrameSetElement.cpp @@ -137,6 +137,7 @@ bool HTMLFrameSetElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -152,7 +153,7 @@ HTMLFrameSetElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } nsChangeHint diff --git a/dom/html/HTMLFrameSetElement.h b/dom/html/HTMLFrameSetElement.h index 2ba3c34b297e..318aa9d0a31a 100644 --- a/dom/html/HTMLFrameSetElement.h +++ b/dom/html/HTMLFrameSetElement.h @@ -116,6 +116,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute, int32_t aModType) const override; diff --git a/dom/html/HTMLHRElement.cpp b/dom/html/HTMLHRElement.cpp index 885e0e713968..1329a02cb7f5 100644 --- a/dom/html/HTMLHRElement.cpp +++ b/dom/html/HTMLHRElement.cpp @@ -30,6 +30,7 @@ bool HTMLHRElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { static const nsAttrValue::EnumTable kAlignTable[] = { @@ -55,7 +56,7 @@ HTMLHRElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLHRElement.h b/dom/html/HTMLHRElement.h index ce75b248b5cc..ab05fea25825 100644 --- a/dom/html/HTMLHRElement.h +++ b/dom/html/HTMLHRElement.h @@ -27,6 +27,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; diff --git a/dom/html/HTMLHeadingElement.cpp b/dom/html/HTMLHeadingElement.cpp index e6a0ecf1033e..03006e533187 100644 --- a/dom/html/HTMLHeadingElement.cpp +++ b/dom/html/HTMLHeadingElement.cpp @@ -34,6 +34,7 @@ bool HTMLHeadingElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aAttribute == nsGkAtoms::align && aNamespaceID == kNameSpaceID_None) { @@ -41,7 +42,7 @@ HTMLHeadingElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLHeadingElement.h b/dom/html/HTMLHeadingElement.h index 56b91c926ade..e1b4779bf39c 100644 --- a/dom/html/HTMLHeadingElement.h +++ b/dom/html/HTMLHeadingElement.h @@ -24,6 +24,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; diff --git a/dom/html/HTMLIFrameElement.cpp b/dom/html/HTMLIFrameElement.cpp index 096cc06186fe..6969e0efb835 100644 --- a/dom/html/HTMLIFrameElement.cpp +++ b/dom/html/HTMLIFrameElement.cpp @@ -45,6 +45,7 @@ bool HTMLIFrameElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -76,7 +77,9 @@ HTMLIFrameElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLFrameElement::ParseAttribute(aNamespaceID, aAttribute, - aValue, aResult); + aValue, + aMaybeScriptedPrincipal, + aResult); } void diff --git a/dom/html/HTMLIFrameElement.h b/dom/html/HTMLIFrameElement.h index 6b4bf59f5193..fe6c7cd24f8d 100644 --- a/dom/html/HTMLIFrameElement.h +++ b/dom/html/HTMLIFrameElement.h @@ -35,6 +35,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; diff --git a/dom/html/HTMLImageElement.cpp b/dom/html/HTMLImageElement.cpp index f249759c4a63..e95476c8b8cb 100644 --- a/dom/html/HTMLImageElement.cpp +++ b/dom/html/HTMLImageElement.cpp @@ -225,6 +225,7 @@ bool HTMLImageElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -241,7 +242,7 @@ HTMLImageElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLImageElement.h b/dom/html/HTMLImageElement.h index bbebe01d7929..628bd2e9d14b 100644 --- a/dom/html/HTMLImageElement.h +++ b/dom/html/HTMLImageElement.h @@ -58,6 +58,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute, int32_t aModType) const override; diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index eb151b131e1b..3a4cf9893f91 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -5752,6 +5752,7 @@ bool HTMLInputElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { // We can't make these static_asserts because kInputDefaultType and @@ -5824,7 +5825,7 @@ HTMLInputElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLInputElement.h b/dom/html/HTMLInputElement.h index 3f3a0ae8a20f..0d85bbf30b13 100644 --- a/dom/html/HTMLInputElement.h +++ b/dom/html/HTMLInputElement.h @@ -195,6 +195,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute, int32_t aModType) const override; diff --git a/dom/html/HTMLLIElement.cpp b/dom/html/HTMLLIElement.cpp index ef23027def75..a3eac53d8394 100644 --- a/dom/html/HTMLLIElement.cpp +++ b/dom/html/HTMLLIElement.cpp @@ -49,6 +49,7 @@ bool HTMLLIElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -63,7 +64,7 @@ HTMLLIElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLLIElement.h b/dom/html/HTMLLIElement.h index a38cc278e2bc..118f87c22c19 100644 --- a/dom/html/HTMLLIElement.h +++ b/dom/html/HTMLLIElement.h @@ -28,6 +28,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; diff --git a/dom/html/HTMLLegendElement.cpp b/dom/html/HTMLLegendElement.cpp index 7152e57543f5..a9ef7cf1fccd 100644 --- a/dom/html/HTMLLegendElement.cpp +++ b/dom/html/HTMLLegendElement.cpp @@ -38,6 +38,7 @@ bool HTMLLegendElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { // this contains center, because IE4 does @@ -55,7 +56,7 @@ HTMLLegendElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } nsChangeHint diff --git a/dom/html/HTMLLegendElement.h b/dom/html/HTMLLegendElement.h index 265212a4496f..70f9d057d2b2 100644 --- a/dom/html/HTMLLegendElement.h +++ b/dom/html/HTMLLegendElement.h @@ -39,6 +39,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute, int32_t aModType) const override; diff --git a/dom/html/HTMLLinkElement.cpp b/dom/html/HTMLLinkElement.cpp index 1469cf49d625..0d2aaf80a7c1 100644 --- a/dom/html/HTMLLinkElement.cpp +++ b/dom/html/HTMLLinkElement.cpp @@ -192,6 +192,7 @@ bool HTMLLinkElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -217,7 +218,7 @@ HTMLLinkElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLLinkElement.h b/dom/html/HTMLLinkElement.h index 03c65ab415ee..d9a22012ad1d 100644 --- a/dom/html/HTMLLinkElement.h +++ b/dom/html/HTMLLinkElement.h @@ -69,6 +69,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual void GetLinkTarget(nsAString& aTarget) override; virtual EventStates IntrinsicState() const override; diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index d1df031ef4e7..e03f82092ec7 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -4459,6 +4459,7 @@ HTMLMediaElement::GetEventTargetParent(EventChainPreVisitor& aVisitor) bool HTMLMediaElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { // Mappings from 'preload' attribute strings to an enumeration. @@ -4484,7 +4485,7 @@ bool HTMLMediaElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void HTMLMediaElement::DoneCreatingElement() diff --git a/dom/html/HTMLMediaElement.h b/dom/html/HTMLMediaElement.h index 7daffdd4aa0f..89555fb19ad9 100644 --- a/dom/html/HTMLMediaElement.h +++ b/dom/html/HTMLMediaElement.h @@ -152,6 +152,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, diff --git a/dom/html/HTMLMenuElement.cpp b/dom/html/HTMLMenuElement.cpp index 598995817562..18c27347b0d3 100644 --- a/dom/html/HTMLMenuElement.cpp +++ b/dom/html/HTMLMenuElement.cpp @@ -128,6 +128,7 @@ bool HTMLMenuElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type) { @@ -136,7 +137,7 @@ HTMLMenuElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLMenuElement.h b/dom/html/HTMLMenuElement.h index fce9170eb5e1..6449966e9c3f 100644 --- a/dom/html/HTMLMenuElement.h +++ b/dom/html/HTMLMenuElement.h @@ -33,6 +33,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult, diff --git a/dom/html/HTMLMenuItemElement.cpp b/dom/html/HTMLMenuItemElement.cpp index be1f4a66641a..69a535ef31ad 100644 --- a/dom/html/HTMLMenuItemElement.cpp +++ b/dom/html/HTMLMenuItemElement.cpp @@ -320,6 +320,7 @@ bool HTMLMenuItemElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -335,7 +336,7 @@ HTMLMenuItemElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLMenuItemElement.h b/dom/html/HTMLMenuItemElement.h index b2cc887ad008..096137ae7ef7 100644 --- a/dom/html/HTMLMenuItemElement.h +++ b/dom/html/HTMLMenuItemElement.h @@ -43,6 +43,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual void DoneCreatingElement() override; diff --git a/dom/html/HTMLMeterElement.cpp b/dom/html/HTMLMeterElement.cpp index 4608d2b7b331..c85157f55dda 100644 --- a/dom/html/HTMLMeterElement.cpp +++ b/dom/html/HTMLMeterElement.cpp @@ -40,8 +40,11 @@ HTMLMeterElement::IntrinsicState() const } bool -HTMLMeterElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, - const nsAString& aValue, nsAttrValue& aResult) +HTMLMeterElement::ParseAttribute(int32_t aNamespaceID, + nsAtom* aAttribute, + const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, + nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { if (aAttribute == nsGkAtoms::value || aAttribute == nsGkAtoms::max || @@ -52,7 +55,9 @@ HTMLMeterElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, - aValue, aResult); + aValue, + aMaybeScriptedPrincipal, + aResult); } /* diff --git a/dom/html/HTMLMeterElement.h b/dom/html/HTMLMeterElement.h index 0eca31f986dc..fc5ed08597dc 100644 --- a/dom/html/HTMLMeterElement.h +++ b/dom/html/HTMLMeterElement.h @@ -27,8 +27,10 @@ public: nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult, bool aPreallocateChildren) const override; - bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, - const nsAString& aValue, nsAttrValue& aResult) override; + virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, + const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, + nsAttrValue& aResult) override; // WebIDL diff --git a/dom/html/HTMLObjectElement.cpp b/dom/html/HTMLObjectElement.cpp index ae551b3dd473..d16b8d81a888 100644 --- a/dom/html/HTMLObjectElement.cpp +++ b/dom/html/HTMLObjectElement.cpp @@ -453,6 +453,7 @@ bool HTMLObjectElement::ParseAttribute(int32_t aNamespaceID, nsAtom *aAttribute, const nsAString &aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue &aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -465,7 +466,7 @@ HTMLObjectElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLFormElement::ParseAttribute(aNamespaceID, aAttribute, - aValue, aResult); + aValue, aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLObjectElement.h b/dom/html/HTMLObjectElement.h index 10e2cddfd162..2a77f3c28a2b 100644 --- a/dom/html/HTMLObjectElement.h +++ b/dom/html/HTMLObjectElement.h @@ -70,6 +70,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom *aAttribute, const nsAString &aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue &aResult) override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom *aAttribute) const override; diff --git a/dom/html/HTMLOutputElement.cpp b/dom/html/HTMLOutputElement.cpp index 4a0a3d2285ef..eedf2d1bff6d 100644 --- a/dom/html/HTMLOutputElement.cpp +++ b/dom/html/HTMLOutputElement.cpp @@ -70,8 +70,11 @@ HTMLOutputElement::SubmitNamesValues(HTMLFormSubmission* aFormSubmission) } bool -HTMLOutputElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, - const nsAString& aValue, nsAttrValue& aResult) +HTMLOutputElement::ParseAttribute(int32_t aNamespaceID, + nsAtom* aAttribute, + const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, + nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { if (aAttribute == nsGkAtoms::_for) { @@ -81,7 +84,9 @@ HTMLOutputElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, } return nsGenericHTMLFormElement::ParseAttribute(aNamespaceID, aAttribute, - aValue, aResult); + aValue, + aMaybeScriptedPrincipal, + aResult); } void diff --git a/dom/html/HTMLOutputElement.h b/dom/html/HTMLOutputElement.h index 70d7ada06013..e8cabce8627d 100644 --- a/dom/html/HTMLOutputElement.h +++ b/dom/html/HTMLOutputElement.h @@ -39,8 +39,10 @@ public: nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult, bool aPreallocateChildren) const override; - bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, - const nsAString& aValue, nsAttrValue& aResult) override; + virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, + const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, + nsAttrValue& aResult) override; virtual void DoneAddingChildren(bool aHaveNotified) override; diff --git a/dom/html/HTMLParagraphElement.cpp b/dom/html/HTMLParagraphElement.cpp index 3d0ef00ba2cb..31d8992759f4 100644 --- a/dom/html/HTMLParagraphElement.cpp +++ b/dom/html/HTMLParagraphElement.cpp @@ -29,6 +29,7 @@ bool HTMLParagraphElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aAttribute == nsGkAtoms::align && aNamespaceID == kNameSpaceID_None) { @@ -36,7 +37,7 @@ HTMLParagraphElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLParagraphElement.h b/dom/html/HTMLParagraphElement.h index ddea1b477ee9..d330cbaa448c 100644 --- a/dom/html/HTMLParagraphElement.h +++ b/dom/html/HTMLParagraphElement.h @@ -28,6 +28,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; diff --git a/dom/html/HTMLPreElement.cpp b/dom/html/HTMLPreElement.cpp index 0d1eded0309c..96f30146536a 100644 --- a/dom/html/HTMLPreElement.cpp +++ b/dom/html/HTMLPreElement.cpp @@ -30,6 +30,7 @@ bool HTMLPreElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -39,7 +40,7 @@ HTMLPreElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLPreElement.h b/dom/html/HTMLPreElement.h index 719dc1b0e74f..c832e42db220 100644 --- a/dom/html/HTMLPreElement.h +++ b/dom/html/HTMLPreElement.h @@ -28,6 +28,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; diff --git a/dom/html/HTMLProgressElement.cpp b/dom/html/HTMLProgressElement.cpp index eb5b56112068..cb357619a85f 100644 --- a/dom/html/HTMLProgressElement.cpp +++ b/dom/html/HTMLProgressElement.cpp @@ -45,8 +45,11 @@ HTMLProgressElement::IntrinsicState() const } bool -HTMLProgressElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, - const nsAString& aValue, nsAttrValue& aResult) +HTMLProgressElement::ParseAttribute(int32_t aNamespaceID, + nsAtom* aAttribute, + const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, + nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { if (aAttribute == nsGkAtoms::value || aAttribute == nsGkAtoms::max) { @@ -55,7 +58,9 @@ HTMLProgressElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, - aValue, aResult); + aValue, + aMaybeScriptedPrincipal, + aResult); } double diff --git a/dom/html/HTMLProgressElement.h b/dom/html/HTMLProgressElement.h index 37ef382d8db5..f1de7347e5d5 100644 --- a/dom/html/HTMLProgressElement.h +++ b/dom/html/HTMLProgressElement.h @@ -26,8 +26,10 @@ public: nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult, bool aPreallocateChildren) const override; - bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, - const nsAString& aValue, nsAttrValue& aResult) override; + virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, + const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, + nsAttrValue& aResult) override; // WebIDL double Value() const; diff --git a/dom/html/HTMLScriptElement.cpp b/dom/html/HTMLScriptElement.cpp index ccb7accd74d5..dca545917b41 100644 --- a/dom/html/HTMLScriptElement.cpp +++ b/dom/html/HTMLScriptElement.cpp @@ -73,6 +73,7 @@ bool HTMLScriptElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -88,7 +89,7 @@ HTMLScriptElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } nsresult diff --git a/dom/html/HTMLScriptElement.h b/dom/html/HTMLScriptElement.h index a0a5ffaf915c..877bccb85b0b 100644 --- a/dom/html/HTMLScriptElement.h +++ b/dom/html/HTMLScriptElement.h @@ -45,6 +45,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult, diff --git a/dom/html/HTMLSelectElement.cpp b/dom/html/HTMLSelectElement.cpp index 4bf0ec3519c0..151be03f638b 100644 --- a/dom/html/HTMLSelectElement.cpp +++ b/dom/html/HTMLSelectElement.cpp @@ -1257,6 +1257,7 @@ bool HTMLSelectElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (kNameSpaceID_None == aNamespaceID) { @@ -1268,7 +1269,7 @@ HTMLSelectElement::ParseAttribute(int32_t aNamespaceID, } } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLSelectElement.h b/dom/html/HTMLSelectElement.h index 782df8bbae8c..2d7a19a03092 100644 --- a/dom/html/HTMLSelectElement.h +++ b/dom/html/HTMLSelectElement.h @@ -384,6 +384,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; virtual nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute, diff --git a/dom/html/HTMLSharedElement.cpp b/dom/html/HTMLSharedElement.cpp index ff7902b83aaa..6b5d5194f3b2 100644 --- a/dom/html/HTMLSharedElement.cpp +++ b/dom/html/HTMLSharedElement.cpp @@ -60,6 +60,7 @@ bool HTMLSharedElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None && @@ -73,7 +74,7 @@ HTMLSharedElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } static void diff --git a/dom/html/HTMLSharedElement.h b/dom/html/HTMLSharedElement.h index daff95083c39..ac39214148b8 100644 --- a/dom/html/HTMLSharedElement.h +++ b/dom/html/HTMLSharedElement.h @@ -33,6 +33,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, diff --git a/dom/html/HTMLSharedListElement.cpp b/dom/html/HTMLSharedListElement.cpp index 1f87523c70ba..c8ed8e8e0662 100644 --- a/dom/html/HTMLSharedListElement.cpp +++ b/dom/html/HTMLSharedListElement.cpp @@ -59,6 +59,7 @@ bool HTMLSharedListElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -75,7 +76,7 @@ HTMLSharedListElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLSharedListElement.h b/dom/html/HTMLSharedListElement.h index 02d31cb08a6d..3fa79f4fc111 100644 --- a/dom/html/HTMLSharedListElement.h +++ b/dom/html/HTMLSharedListElement.h @@ -28,6 +28,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; diff --git a/dom/html/HTMLTableCaptionElement.cpp b/dom/html/HTMLTableCaptionElement.cpp index b4e407747f91..81879881bb58 100644 --- a/dom/html/HTMLTableCaptionElement.cpp +++ b/dom/html/HTMLTableCaptionElement.cpp @@ -40,6 +40,7 @@ bool HTMLTableCaptionElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aAttribute == nsGkAtoms::align && aNamespaceID == kNameSpaceID_None) { @@ -47,7 +48,7 @@ HTMLTableCaptionElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLTableCaptionElement.h b/dom/html/HTMLTableCaptionElement.h index 1d4b7d3ccaca..06278b2f62da 100644 --- a/dom/html/HTMLTableCaptionElement.h +++ b/dom/html/HTMLTableCaptionElement.h @@ -33,6 +33,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; diff --git a/dom/html/HTMLTableCellElement.cpp b/dom/html/HTMLTableCellElement.cpp index b3d10267e985..cc4201b764e5 100644 --- a/dom/html/HTMLTableCellElement.cpp +++ b/dom/html/HTMLTableCellElement.cpp @@ -147,6 +147,7 @@ bool HTMLTableCellElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -193,7 +194,7 @@ HTMLTableCellElement::ParseAttribute(int32_t aNamespaceID, aAttribute, aValue, aResult) || nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLTableCellElement.h b/dom/html/HTMLTableCellElement.h index 0294b52f0b40..813a2934656f 100644 --- a/dom/html/HTMLTableCellElement.h +++ b/dom/html/HTMLTableCellElement.h @@ -139,6 +139,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) override; diff --git a/dom/html/HTMLTableColElement.cpp b/dom/html/HTMLTableColElement.cpp index fdfa60912a3e..4d0031497912 100644 --- a/dom/html/HTMLTableColElement.cpp +++ b/dom/html/HTMLTableColElement.cpp @@ -35,6 +35,7 @@ bool HTMLTableColElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -59,7 +60,7 @@ HTMLTableColElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLTableColElement.h b/dom/html/HTMLTableColElement.h index f248bdb3555a..ed7c02faef86 100644 --- a/dom/html/HTMLTableColElement.h +++ b/dom/html/HTMLTableColElement.h @@ -74,6 +74,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; diff --git a/dom/html/HTMLTableElement.cpp b/dom/html/HTMLTableElement.cpp index 621687ab61bd..7fecda481b80 100644 --- a/dom/html/HTMLTableElement.cpp +++ b/dom/html/HTMLTableElement.cpp @@ -891,6 +891,7 @@ bool HTMLTableElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { /* ignore summary, just a string */ @@ -932,7 +933,7 @@ HTMLTableElement::ParseAttribute(int32_t aNamespaceID, aAttribute, aValue, aResult) || nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } diff --git a/dom/html/HTMLTableElement.h b/dom/html/HTMLTableElement.h index b3a3f7892940..51c1588ada89 100644 --- a/dom/html/HTMLTableElement.h +++ b/dom/html/HTMLTableElement.h @@ -185,6 +185,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; diff --git a/dom/html/HTMLTableRowElement.cpp b/dom/html/HTMLTableRowElement.cpp index 197588720da3..e1dfebfda31e 100644 --- a/dom/html/HTMLTableRowElement.cpp +++ b/dom/html/HTMLTableRowElement.cpp @@ -221,6 +221,7 @@ bool HTMLTableRowElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { /* @@ -254,7 +255,7 @@ HTMLTableRowElement::ParseAttribute(int32_t aNamespaceID, aAttribute, aValue, aResult) || nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLTableRowElement.h b/dom/html/HTMLTableRowElement.h index fea3fb1175f7..09d24f8004f7 100644 --- a/dom/html/HTMLTableRowElement.h +++ b/dom/html/HTMLTableRowElement.h @@ -81,6 +81,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; diff --git a/dom/html/HTMLTableSectionElement.cpp b/dom/html/HTMLTableSectionElement.cpp index 724ada852df1..945c41fe52f2 100644 --- a/dom/html/HTMLTableSectionElement.cpp +++ b/dom/html/HTMLTableSectionElement.cpp @@ -130,6 +130,7 @@ bool HTMLTableSectionElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -157,7 +158,7 @@ HTMLTableSectionElement::ParseAttribute(int32_t aNamespaceID, aAttribute, aValue, aResult) || nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLTableSectionElement.h b/dom/html/HTMLTableSectionElement.h index 1e260a1ba449..cb73ac7249bc 100644 --- a/dom/html/HTMLTableSectionElement.h +++ b/dom/html/HTMLTableSectionElement.h @@ -66,6 +66,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; diff --git a/dom/html/HTMLTextAreaElement.cpp b/dom/html/HTMLTextAreaElement.cpp index ca6385c928fc..4b47ee5e05d6 100644 --- a/dom/html/HTMLTextAreaElement.cpp +++ b/dom/html/HTMLTextAreaElement.cpp @@ -425,6 +425,7 @@ bool HTMLTextAreaElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -443,7 +444,7 @@ HTMLTextAreaElement::ParseAttribute(int32_t aNamespaceID, } } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLTextAreaElement.h b/dom/html/HTMLTextAreaElement.h index e468b69330bb..1f7d9ae1e605 100644 --- a/dom/html/HTMLTextAreaElement.h +++ b/dom/html/HTMLTextAreaElement.h @@ -125,6 +125,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; virtual nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute, diff --git a/dom/html/HTMLTrackElement.cpp b/dom/html/HTMLTrackElement.cpp index ee1a5deb7726..08a6c0f334d3 100644 --- a/dom/html/HTMLTrackElement.cpp +++ b/dom/html/HTMLTrackElement.cpp @@ -218,6 +218,7 @@ bool HTMLTrackElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::kind) { @@ -230,6 +231,7 @@ HTMLTrackElement::ParseAttribute(int32_t aNamespaceID, return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, + aMaybeScriptedPrincipal, aResult); } diff --git a/dom/html/HTMLTrackElement.h b/dom/html/HTMLTrackElement.h index a440ba817755..615df846706d 100644 --- a/dom/html/HTMLTrackElement.h +++ b/dom/html/HTMLTrackElement.h @@ -97,6 +97,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; // Override BindToTree() so that we can trigger a load when we become diff --git a/dom/html/HTMLVideoElement.cpp b/dom/html/HTMLVideoElement.cpp index ecc99c99bd1e..f586cece6d8c 100644 --- a/dom/html/HTMLVideoElement.cpp +++ b/dom/html/HTMLVideoElement.cpp @@ -86,6 +86,7 @@ bool HTMLVideoElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aAttribute == nsGkAtoms::width || aAttribute == nsGkAtoms::height) { @@ -93,7 +94,7 @@ HTMLVideoElement::ParseAttribute(int32_t aNamespaceID, } return HTMLMediaElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/html/HTMLVideoElement.h b/dom/html/HTMLVideoElement.h index 1f922a37a6cd..3ba157ed6a95 100644 --- a/dom/html/HTMLVideoElement.h +++ b/dom/html/HTMLVideoElement.h @@ -38,6 +38,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp index ba1886796010..a0737711c99e 100644 --- a/dom/html/nsGenericHTMLElement.cpp +++ b/dom/html/nsGenericHTMLElement.cpp @@ -927,6 +927,7 @@ bool nsGenericHTMLElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -964,7 +965,8 @@ nsGenericHTMLElement::ParseAttribute(int32_t aNamespaceID, } return nsGenericHTMLElementBase::ParseAttribute(aNamespaceID, aAttribute, - aValue, aResult); + aValue, aMaybeScriptedPrincipal, + aResult); } bool diff --git a/dom/html/nsGenericHTMLElement.h b/dom/html/nsGenericHTMLElement.h index 1c5043bf72e2..456654903247 100644 --- a/dom/html/nsGenericHTMLElement.h +++ b/dom/html/nsGenericHTMLElement.h @@ -344,6 +344,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; bool ParseBackgroundAttribute(int32_t aNamespaceID, diff --git a/dom/mathml/nsMathMLElement.cpp b/dom/mathml/nsMathMLElement.cpp index b61af114c566..591c510d3ddc 100644 --- a/dom/mathml/nsMathMLElement.cpp +++ b/dom/mathml/nsMathMLElement.cpp @@ -145,6 +145,7 @@ bool nsMathMLElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { MOZ_ASSERT(IsMathMLElement()); @@ -177,7 +178,9 @@ nsMathMLElement::ParseAttribute(int32_t aNamespaceID, } return nsMathMLElementBase::ParseAttribute(aNamespaceID, aAttribute, - aValue, aResult); + aValue, + aMaybeScriptedPrincipal, + aResult); } static Element::MappedAttributeEntry sMtableStyles[] = { diff --git a/dom/mathml/nsMathMLElement.h b/dom/mathml/nsMathMLElement.h index 8b26a25c7f6f..5616e704ff19 100644 --- a/dom/mathml/nsMathMLElement.h +++ b/dom/mathml/nsMathMLElement.h @@ -51,6 +51,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; diff --git a/dom/svg/SVGAnimateTransformElement.cpp b/dom/svg/SVGAnimateTransformElement.cpp index ee6718746e48..686816cabc55 100644 --- a/dom/svg/SVGAnimateTransformElement.cpp +++ b/dom/svg/SVGAnimateTransformElement.cpp @@ -30,6 +30,7 @@ bool SVGAnimateTransformElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { // 'type' is an -specific attribute, and we'll handle it @@ -49,6 +50,7 @@ SVGAnimateTransformElement::ParseAttribute(int32_t aNamespaceID, return SVGAnimationElement::ParseAttribute(aNamespaceID, aAttribute, aValue, + aMaybeScriptedPrincipal, aResult); } diff --git a/dom/svg/SVGAnimateTransformElement.h b/dom/svg/SVGAnimateTransformElement.h index 4d9f25b15088..ec281af919cc 100644 --- a/dom/svg/SVGAnimateTransformElement.h +++ b/dom/svg/SVGAnimateTransformElement.h @@ -35,10 +35,11 @@ public: bool aPreallocateChildren) const override; // Element specializations - bool ParseAttribute(int32_t aNamespaceID, - nsAtom* aAttribute, - const nsAString& aValue, - nsAttrValue& aResult) override; + virtual bool ParseAttribute(int32_t aNamespaceID, + nsAtom* aAttribute, + const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, + nsAttrValue& aResult) override; // SVGAnimationElement virtual nsSMILAnimationFunction& AnimationFunction() override; diff --git a/dom/svg/SVGAnimationElement.cpp b/dom/svg/SVGAnimationElement.cpp index fa65a38e9497..d7db9f1bae86 100644 --- a/dom/svg/SVGAnimationElement.cpp +++ b/dom/svg/SVGAnimationElement.cpp @@ -244,6 +244,7 @@ bool SVGAnimationElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None) { @@ -278,7 +279,9 @@ SVGAnimationElement::ParseAttribute(int32_t aNamespaceID, } return SVGAnimationElementBase::ParseAttribute(aNamespaceID, aAttribute, - aValue, aResult); + aValue, + aMaybeScriptedPrincipal, + aResult); } nsresult diff --git a/dom/svg/SVGAnimationElement.h b/dom/svg/SVGAnimationElement.h index d4fb8d80ee42..1a1405b56531 100644 --- a/dom/svg/SVGAnimationElement.h +++ b/dom/svg/SVGAnimationElement.h @@ -57,6 +57,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsAtom* aName, const nsAttrValue* aValue, diff --git a/dom/svg/SVGMPathElement.cpp b/dom/svg/SVGMPathElement.cpp index 034e1b28b11d..134f4fda453b 100644 --- a/dom/svg/SVGMPathElement.cpp +++ b/dom/svg/SVGMPathElement.cpp @@ -119,11 +119,14 @@ bool SVGMPathElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { bool returnVal = SVGMPathElementBase::ParseAttribute(aNamespaceID, aAttribute, - aValue, aResult); + aValue, + aMaybeScriptedPrincipal, + aResult); if ((aNamespaceID == kNameSpaceID_XLink || aNamespaceID == kNameSpaceID_None ) && aAttribute == nsGkAtoms::href && diff --git a/dom/svg/SVGMPathElement.h b/dom/svg/SVGMPathElement.h index 177b70cd57d0..2e1de868c17b 100644 --- a/dom/svg/SVGMPathElement.h +++ b/dom/svg/SVGMPathElement.h @@ -55,6 +55,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; // Public helper method: If our xlink:href attribute links to a diff --git a/dom/svg/SVGMarkerElement.cpp b/dom/svg/SVGMarkerElement.cpp index 6421e9b7b881..7abc0f795017 100644 --- a/dom/svg/SVGMarkerElement.cpp +++ b/dom/svg/SVGMarkerElement.cpp @@ -211,6 +211,7 @@ SVGMarkerElement::IsAttributeMapped(const nsAtom* name) const bool SVGMarkerElement::ParseAttribute(int32_t aNameSpaceID, nsAtom* aName, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::orient) { @@ -230,7 +231,9 @@ SVGMarkerElement::ParseAttribute(int32_t aNameSpaceID, nsAtom* aName, mOrientType.SetBaseValue(SVG_MARKER_ORIENT_ANGLE); } return SVGMarkerElementBase::ParseAttribute(aNameSpaceID, aName, - aValue, aResult); + aValue, + aMaybeScriptedPrincipal, + aResult); } nsresult diff --git a/dom/svg/SVGMarkerElement.h b/dom/svg/SVGMarkerElement.h index 24ec11f79c6a..c0a0a4a24473 100644 --- a/dom/svg/SVGMarkerElement.h +++ b/dom/svg/SVGMarkerElement.h @@ -151,6 +151,7 @@ protected: virtual bool ParseAttribute(int32_t aNameSpaceID, nsAtom* aName, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; void SetParentCoordCtxProvider(SVGViewportElement *aContext); diff --git a/dom/svg/SVGScriptElement.cpp b/dom/svg/SVGScriptElement.cpp index 01a78e816cd0..b8915c0aee6f 100644 --- a/dom/svg/SVGScriptElement.cpp +++ b/dom/svg/SVGScriptElement.cpp @@ -252,6 +252,7 @@ bool SVGScriptElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None && @@ -261,7 +262,9 @@ SVGScriptElement::ParseAttribute(int32_t aNamespaceID, } return SVGScriptElementBase::ParseAttribute(aNamespaceID, aAttribute, - aValue, aResult); + aValue, + aMaybeScriptedPrincipal, + aResult); } CORSMode diff --git a/dom/svg/SVGScriptElement.h b/dom/svg/SVGScriptElement.h index a84a57245fda..0dac960a6ad4 100644 --- a/dom/svg/SVGScriptElement.h +++ b/dom/svg/SVGScriptElement.h @@ -62,6 +62,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult, diff --git a/dom/svg/SVGStyleElement.cpp b/dom/svg/SVGStyleElement.cpp index 94e08d0d2897..54c21bcf43a6 100644 --- a/dom/svg/SVGStyleElement.cpp +++ b/dom/svg/SVGStyleElement.cpp @@ -135,6 +135,7 @@ bool SVGStyleElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None && @@ -144,7 +145,7 @@ SVGStyleElement::ParseAttribute(int32_t aNamespaceID, } return SVGStyleElementBase::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } //---------------------------------------------------------------------- diff --git a/dom/svg/SVGStyleElement.h b/dom/svg/SVGStyleElement.h index d14a9f3fbe11..e3495966ef3f 100644 --- a/dom/svg/SVGStyleElement.h +++ b/dom/svg/SVGStyleElement.h @@ -54,6 +54,7 @@ public: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult, diff --git a/dom/svg/nsSVGElement.cpp b/dom/svg/nsSVGElement.cpp index 3fc236be30b1..6fbef9ec4445 100644 --- a/dom/svg/nsSVGElement.cpp +++ b/dom/svg/nsSVGElement.cpp @@ -341,6 +341,7 @@ bool nsSVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { nsresult rv = NS_OK; @@ -673,7 +674,7 @@ nsSVGElement::ParseAttribute(int32_t aNamespaceID, } return nsSVGElementBase::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult); + aMaybeScriptedPrincipal, aResult); } void diff --git a/dom/svg/nsSVGElement.h b/dom/svg/nsSVGElement.h index 0ce2dde9fa32..16478314c977 100644 --- a/dom/svg/nsSVGElement.h +++ b/dom/svg/nsSVGElement.h @@ -355,7 +355,9 @@ protected: nsIPrincipal* aSubjectPrincipal, bool aNotify) override; virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, - const nsAString& aValue, nsAttrValue& aResult) override; + const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, + nsAttrValue& aResult) override; static nsresult ReportAttributeParseFailure(nsIDocument* aDocument, nsAtom* aAttribute, const nsAString& aValue); diff --git a/dom/xul/nsXULElement.cpp b/dom/xul/nsXULElement.cpp index a8a5bc6f9063..a509e7c8d31c 100644 --- a/dom/xul/nsXULElement.cpp +++ b/dom/xul/nsXULElement.cpp @@ -1161,11 +1161,12 @@ bool nsXULElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { // Parse into a nsAttrValue if (!nsStyledElement::ParseAttribute(aNamespaceID, aAttribute, aValue, - aResult)) { + aMaybeScriptedPrincipal, aResult)) { // Fall back to parsing as atom for short values aResult.ParseStringOrAtom(aValue); } diff --git a/dom/xul/nsXULElement.h b/dom/xul/nsXULElement.h index 6f7c82f25a09..b65fe0ddad64 100644 --- a/dom/xul/nsXULElement.h +++ b/dom/xul/nsXULElement.h @@ -759,6 +759,7 @@ protected: virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) override; virtual mozilla::EventListenerManager*