From 058c37fa0e718e36c156b77a302e5c7fd76fbe1c Mon Sep 17 00:00:00 2001 From: roytam1 Date: Wed, 14 May 2025 15:08:01 +0800 Subject: [PATCH] ported from UXP: Issue #2736 - Part 2: Pass subject principal to SetAttribute and friends. (824d0cad) --- dom/base/AnonymousContent.cpp | 3 +- dom/base/AnonymousContent.h | 1 + dom/base/Attr.cpp | 5 +-- dom/base/Attr.h | 8 +++-- dom/base/DocumentFragment.h | 7 ++-- dom/base/Element.cpp | 20 ++++++++---- dom/base/Element.h | 45 ++++++++++++++++++++------ dom/base/nsGenericDOMDataNode.cpp | 1 + dom/base/nsGenericDOMDataNode.h | 7 ++-- dom/base/nsIContent.h | 17 ++++++++++ dom/base/nsStyledElement.cpp | 3 +- dom/html/HTMLAnchorElement.cpp | 7 ++-- dom/html/HTMLAnchorElement.h | 1 + dom/html/HTMLAreaElement.cpp | 6 ++-- dom/html/HTMLAreaElement.h | 1 + dom/html/HTMLButtonElement.cpp | 6 ++-- dom/html/HTMLButtonElement.h | 1 + dom/html/HTMLCanvasElement.cpp | 6 ++-- dom/html/HTMLCanvasElement.h | 1 + dom/html/HTMLFieldSetElement.cpp | 7 ++-- dom/html/HTMLFieldSetElement.h | 1 + dom/html/HTMLFormElement.cpp | 6 ++-- dom/html/HTMLFormElement.h | 1 + dom/html/HTMLIFrameElement.cpp | 10 ++++-- dom/html/HTMLIFrameElement.h | 1 + dom/html/HTMLImageElement.cpp | 13 +++++--- dom/html/HTMLImageElement.h | 2 ++ dom/html/HTMLInputElement.cpp | 5 ++- dom/html/HTMLInputElement.h | 1 + dom/html/HTMLLinkElement.cpp | 7 ++-- dom/html/HTMLLinkElement.h | 1 + dom/html/HTMLMediaElement.cpp | 8 +++-- dom/html/HTMLMediaElement.h | 1 + dom/html/HTMLMenuItemElement.cpp | 10 ++++-- dom/html/HTMLMenuItemElement.h | 1 + dom/html/HTMLMetaElement.cpp | 10 ++++-- dom/html/HTMLMetaElement.h | 1 + dom/html/HTMLObjectElement.cpp | 7 ++-- dom/html/HTMLObjectElement.h | 1 + dom/html/HTMLOptGroupElement.cpp | 7 ++-- dom/html/HTMLOptGroupElement.h | 1 + dom/html/HTMLOptionElement.cpp | 8 +++-- dom/html/HTMLOptionElement.h | 1 + dom/html/HTMLScriptElement.cpp | 10 ++++-- dom/html/HTMLScriptElement.h | 1 + dom/html/HTMLSelectElement.cpp | 5 ++- dom/html/HTMLSelectElement.h | 1 + dom/html/HTMLSharedElement.cpp | 7 ++-- dom/html/HTMLSharedElement.h | 1 + dom/html/HTMLSharedObjectElement.cpp | 3 +- dom/html/HTMLSharedObjectElement.h | 1 + dom/html/HTMLSlotElement.cpp | 4 ++- dom/html/HTMLSlotElement.h | 1 + dom/html/HTMLSourceElement.cpp | 8 +++-- dom/html/HTMLSourceElement.h | 1 + dom/html/HTMLStyleElement.cpp | 7 ++-- dom/html/HTMLStyleElement.h | 1 + dom/html/HTMLTableElement.cpp | 7 ++-- dom/html/HTMLTableElement.h | 1 + dom/html/HTMLTextAreaElement.cpp | 7 ++-- dom/html/HTMLTextAreaElement.h | 1 + dom/html/nsGenericHTMLElement.cpp | 16 ++++++--- dom/html/nsGenericHTMLElement.h | 6 ++++ dom/html/nsGenericHTMLFrameElement.cpp | 7 ++-- dom/html/nsGenericHTMLFrameElement.h | 1 + dom/mathml/nsMathMLElement.cpp | 7 ++-- dom/mathml/nsMathMLElement.h | 1 + dom/svg/SVGAElement.cpp | 4 ++- dom/svg/SVGAElement.h | 8 ++--- dom/svg/SVGAnimationElement.cpp | 7 ++-- dom/svg/SVGAnimationElement.h | 1 + dom/svg/SVGFEImageElement.cpp | 8 +++-- dom/svg/SVGFEImageElement.h | 1 + dom/svg/SVGGeometryElement.cpp | 8 +++-- dom/svg/SVGGeometryElement.h | 1 + dom/svg/SVGImageElement.cpp | 8 +++-- dom/svg/SVGImageElement.h | 1 + dom/svg/SVGScriptElement.cpp | 8 +++-- dom/svg/SVGScriptElement.h | 1 + dom/svg/SVGStyleElement.cpp | 3 +- dom/svg/SVGStyleElement.h | 8 ++--- dom/svg/nsSVGElement.cpp | 8 +++-- dom/svg/nsSVGElement.h | 1 + dom/webidl/AnonymousContent.webidl | 2 +- dom/webidl/Attr.webidl | 2 +- dom/webidl/Element.webidl | 4 +-- dom/xul/nsXULElement.cpp | 6 ++-- dom/xul/nsXULElement.h | 1 + 88 files changed, 329 insertions(+), 124 deletions(-) diff --git a/dom/base/AnonymousContent.cpp b/dom/base/AnonymousContent.cpp index aea923f2b..35e8437fd 100644 --- a/dom/base/AnonymousContent.cpp +++ b/dom/base/AnonymousContent.cpp @@ -75,6 +75,7 @@ void AnonymousContent::SetAttributeForElement(const nsAString& aElementId, const nsAString& aName, const nsAString& aValue, + nsIPrincipal* aSubjectPrincipal, ErrorResult& aRv) { Element* element = GetElementById(aElementId); @@ -83,7 +84,7 @@ AnonymousContent::SetAttributeForElement(const nsAString& aElementId, return; } - element->SetAttribute(aName, aValue, aRv); + element->SetAttribute(aName, aValue, aSubjectPrincipal, aRv); } void diff --git a/dom/base/AnonymousContent.h b/dom/base/AnonymousContent.h index b56c14595..0ef3ce467 100644 --- a/dom/base/AnonymousContent.h +++ b/dom/base/AnonymousContent.h @@ -43,6 +43,7 @@ public: void SetAttributeForElement(const nsAString& aElementId, const nsAString& aName, const nsAString& aValue, + nsIPrincipal* aSubjectPrincipal, ErrorResult& aRv); void GetAttributeForElement(const nsAString& aElementId, diff --git a/dom/base/Attr.cpp b/dom/base/Attr.cpp index a6816f3a9..1043da72a 100644 --- a/dom/base/Attr.cpp +++ b/dom/base/Attr.cpp @@ -175,7 +175,7 @@ Attr::GetValue(nsAString& aValue) } void -Attr::SetValue(const nsAString& aValue, ErrorResult& aRv) +Attr::SetValue(const nsAString& aValue, nsIPrincipal* aTriggeringPrincipal, ErrorResult& aRv) { Element* element = GetElement(); if (!element) { @@ -188,6 +188,7 @@ Attr::SetValue(const nsAString& aValue, ErrorResult& aRv) nameAtom, mNodeInfo->GetPrefixAtom(), aValue, + aTriggeringPrincipal, true); } @@ -195,7 +196,7 @@ NS_IMETHODIMP Attr::SetValue(const nsAString& aValue) { ErrorResult rv; - SetValue(aValue, rv); + SetValue(aValue, nullptr, rv); return rv.StealNSResult(); } diff --git a/dom/base/Attr.h b/dom/base/Attr.h index a88300986..5a8f6b053 100644 --- a/dom/base/Attr.h +++ b/dom/base/Attr.h @@ -85,9 +85,13 @@ public: virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) override; // XPCOM GetName() is OK - // XPCOM GetValue() is OK - void SetValue(const nsAString& aValue, ErrorResult& aRv); + void GetValue(nsString& val, nsIPrincipal&) + { + GetValue(val); + } + + void SetValue(const nsAString& aValue, nsIPrincipal* aTriggeringPrincipal, ErrorResult& aRv); bool Specified() const; diff --git a/dom/base/DocumentFragment.h b/dom/base/DocumentFragment.h index ccc233ff1..88d539631 100644 --- a/dom/base/DocumentFragment.h +++ b/dom/base/DocumentFragment.h @@ -70,13 +70,10 @@ public: virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) override; // nsIContent - nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, - const nsAString& aValue, bool aNotify) - { - return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify); - } + using nsIContent::SetAttr; virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix, const nsAString& aValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override { return NS_OK; diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 78d79c4c7..8b097abd5 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -1248,6 +1248,7 @@ Element::ToggleAttribute(const nsAString& aName, void Element::SetAttribute(const nsAString& aName, const nsAString& aValue, + nsIPrincipal* aTriggeringPrincipal, ErrorResult& aError) { aError = nsContentUtils::CheckQName(aName, false); @@ -1263,12 +1264,12 @@ Element::SetAttribute(const nsAString& aName, aError.Throw(NS_ERROR_OUT_OF_MEMORY); return; } - aError = SetAttr(kNameSpaceID_None, nameAtom, aValue, true); + aError = SetAttr(kNameSpaceID_None, nameAtom, aValue, aTriggeringPrincipal, true); return; } aError = SetAttr(name->NamespaceID(), name->LocalName(), name->GetPrefix(), - aValue, true); + aValue, aTriggeringPrincipal, true); return; } @@ -1351,6 +1352,7 @@ void Element::SetAttributeNS(const nsAString& aNamespaceURI, const nsAString& aQualifiedName, const nsAString& aValue, + nsIPrincipal* aTriggeringPrincipal, ErrorResult& aError) { RefPtr ni; @@ -1364,7 +1366,7 @@ Element::SetAttributeNS(const nsAString& aNamespaceURI, } aError = SetAttr(ni->NamespaceID(), ni->NameAtom(), ni->GetPrefixAtom(), - aValue, true); + aValue, aTriggeringPrincipal, true); } void @@ -2404,6 +2406,7 @@ Element::SetSingleClassFromParser(nsIAtom* aSingleClassName) nullptr, // prefix nullptr, // old value value, + nullptr, // subject principal static_cast(nsIDOMMutationEvent::ADDITION), false, // hasListeners false, // notify @@ -2415,6 +2418,7 @@ Element::SetSingleClassFromParser(nsIAtom* aSingleClassName) nsresult Element::SetAttr(int32_t aNamespaceID, nsIAtom* aName, nsIAtom* aPrefix, const nsAString& aValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) { // Keep this in sync with SetParsedAttr below and SetSingleClassFromParser @@ -2474,7 +2478,8 @@ Element::SetAttr(int32_t aNamespaceID, nsIAtom* aName, return SetAttrAndNotify(aNamespaceID, aName, aPrefix, oldValueSet ? &oldValue : nullptr, - attrValue, modType, hasListeners, aNotify, + attrValue, aSubjectPrincipal, modType, + hasListeners, aNotify, kCallAfterSetAttr, document, updateBatch); } @@ -2519,7 +2524,7 @@ Element::SetParsedAttr(int32_t aNamespaceID, nsIAtom* aName, mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify); return SetAttrAndNotify(aNamespaceID, aName, aPrefix, oldValueSet ? &oldValue : nullptr, - aParsedValue, modType, hasListeners, aNotify, + aParsedValue, nullptr, modType, hasListeners, aNotify, kCallAfterSetAttr, document, updateBatch); } @@ -2529,6 +2534,7 @@ Element::SetAttrAndNotify(int32_t aNamespaceID, nsIAtom* aPrefix, const nsAttrValue* aOldValue, nsAttrValue& aParsedValue, + nsIPrincipal* aSubjectPrincipal, uint8_t aModType, bool aFireMutation, bool aNotify, @@ -2635,7 +2641,7 @@ Element::SetAttrAndNotify(int32_t aNamespaceID, if (aCallAfterSetAttr) { rv = AfterSetAttr(aNamespaceID, aName, &valueForAfterSetAttr, oldValue, - aNotify); + aSubjectPrincipal, aNotify); NS_ENSURE_SUCCESS(rv, rv); if (aNamespaceID == kNameSpaceID_None && aName == nsGkAtoms::dir) { @@ -2931,7 +2937,7 @@ Element::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aName, } } - rv = AfterSetAttr(aNameSpaceID, aName, nullptr, &oldValue, aNotify); + rv = AfterSetAttr(aNameSpaceID, aName, nullptr, &oldValue, nullptr, aNotify); NS_ENSURE_SUCCESS(rv, rv); UpdateState(aNotify); diff --git a/dom/base/Element.h b/dom/base/Element.h index 154f5c3a5..17e42bac5 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -561,12 +561,7 @@ public: already_AddRefed GetExistingAttrNameFromQName(const nsAString& aStr) const; - MOZ_ALWAYS_INLINE // Avoid a crashy hook from Avast 10 Beta (Bug 1058131) - nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, - const nsAString& aValue, bool aNotify) - { - return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify); - } + using nsIContent::SetAttr; /** * Helper for SetAttr/SetParsedAttr. This method will return true if aNotify @@ -629,7 +624,8 @@ public: nsresult SetSingleClassFromParser(nsIAtom* aSingleClassName); virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix, - const nsAString& aValue, bool aNotify) override; + const nsAString& aValue, nsIPrincipal* aSubjectPrincipal, + bool aNotify) override; // aParsedValue receives the old value of the attribute. That's useful if // either the input or output value of aParsedValue is StoresOwnData. nsresult SetParsedAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix, @@ -802,11 +798,18 @@ public: bool ToggleAttribute(const nsAString& aName, const Optional& aForce, ErrorResult& aError); void SetAttribute(const nsAString& aName, const nsAString& aValue, - ErrorResult& aError); + nsIPrincipal* aTriggeringPrincipal, ErrorResult& aError); void SetAttributeNS(const nsAString& aNamespaceURI, const nsAString& aLocalName, const nsAString& aValue, + nsIPrincipal* aTriggeringPrincipal, ErrorResult& aError); + void SetAttribute(const nsAString& aName, const nsAString& aValue, + ErrorResult& aError) + { + SetAttribute(aName, aValue, nullptr, aError); + } + void RemoveAttribute(const nsAString& aName, ErrorResult& aError); void RemoveAttributeNS(const nsAString& aNamespaceURI, @@ -1245,6 +1248,11 @@ public: aError = SetAttr(kNameSpaceID_None, aAttr, aValue, true); } + void SetAttr(nsIAtom* aAttr, const nsAString& aValue, nsIPrincipal& aTriggeringPrincipal, ErrorResult& aError) + { + aError = nsIContent::SetAttr(kNameSpaceID_None, aAttr, aValue, &aTriggeringPrincipal, true); + } + /** * Set a content attribute via a reflecting nullable string IDL * attribute (e.g. a CORS attribute). If DOMStringIsNull(aValue), @@ -1322,6 +1330,14 @@ protected: * @param aParsedValue parsed new value of attribute. Replaced by the * old value of the attribute. This old value is only * useful if either it or the new value is StoresOwnData. + * @param aMaybeScriptedPrincipal + * the principal of the scripted caller responsible for + * setting the attribute, or null if no scripted caller + * can be determined. A null value here does not + * guarantee that there is no scripted caller, but a + * non-null value does guarantee that a scripted caller + * with the given principal is directly responsible for + * the attribute change. * @param aModType nsIDOMMutationEvent::MODIFICATION or ADDITION. Only * needed if aFireMutation or aNotify is true. * @param aFireMutation should mutation-events be fired? @@ -1334,6 +1350,7 @@ protected: nsIAtom* aPrefix, const nsAttrValue* aOldValue, nsAttrValue& aParsedValue, + nsIPrincipal* aMaybeScriptedPrincipal, uint8_t aModType, bool aFireMutation, bool aNotify, @@ -1425,13 +1442,21 @@ protected: * the attr was not previously set. This argument may not have the * correct value for SVG elements, or other cases in which the * attribute value doesn't store its own data + * @param aMaybeScriptedPrincipal the principal of the scripted caller + * responsible for setting the attribute, or null if no scripted caller + * can be determined, or the attribute is being unset. A null value + * here does not guarantee that there is no scripted caller, but a + * non-null value does guarantee that a scripted caller with the given + * principal is directly responsible for the attribute change. * @param aNotify Whether we plan to notify document observers. */ // Note that this is inlined so that when subclasses call it it gets // inlined. Those calls don't go through a vtable. virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aMaybeScriptedPrincipal, + bool aNotify) { return NS_OK; } @@ -1782,7 +1807,7 @@ NS_IMETHOD SetAttribute(const nsAString& name, \ const nsAString& value) override \ { \ mozilla::ErrorResult rv; \ - Element::SetAttribute(name, value, rv); \ + Element::SetAttribute(name, value, nullptr, rv); \ return rv.StealNSResult(); \ } \ using Element::HasAttribute; \ diff --git a/dom/base/nsGenericDOMDataNode.cpp b/dom/base/nsGenericDOMDataNode.cpp index ba3d6c282..33dd3e0fc 100644 --- a/dom/base/nsGenericDOMDataNode.cpp +++ b/dom/base/nsGenericDOMDataNode.cpp @@ -619,6 +619,7 @@ nsGenericDOMDataNode::GetChildren(uint32_t aFilter) nsresult nsGenericDOMDataNode::SetAttr(int32_t aNameSpaceID, nsIAtom* aAttr, nsIAtom* aPrefix, const nsAString& aValue, + nsIPrincipal* aContentPrincipal, bool aNotify) { return NS_OK; diff --git a/dom/base/nsGenericDOMDataNode.h b/dom/base/nsGenericDOMDataNode.h index 8cf4fbc08..0d673dd9a 100644 --- a/dom/base/nsGenericDOMDataNode.h +++ b/dom/base/nsGenericDOMDataNode.h @@ -117,13 +117,10 @@ public: virtual already_AddRefed GetChildren(uint32_t aFilter) override; - nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, - const nsAString& aValue, bool aNotify) - { - return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify); - } + using nsIContent::SetAttr; virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute, nsIAtom* aPrefix, const nsAString& aValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override; virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute, bool aNotify) override; diff --git a/dom/base/nsIContent.h b/dom/base/nsIContent.h index 9ff7e14f0..f218c7cfa 100644 --- a/dom/base/nsIContent.h +++ b/dom/base/nsIContent.h @@ -364,6 +364,16 @@ public: { return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify); } + nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix, + const nsAString& aValue, bool aNotify) + { + return SetAttr(aNameSpaceID, aName, aPrefix, aValue, nullptr, aNotify); + } + nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAString& aValue, + nsIPrincipal* aTriggeringPrincipal, bool aNotify) + { + return SetAttr(aNameSpaceID, aName, nullptr, aValue, aTriggeringPrincipal, aNotify); + } /** * Set attribute values. All attribute values are assumed to have a @@ -376,11 +386,18 @@ public: * @param aName the name of the attribute * @param aPrefix the prefix of the attribute * @param aValue the value to set + * @param aMaybeScriptedPrincipal the principal of the scripted caller responsible + * for setting the attribute, or null if no scripted caller can be + * determined. A null value here does not guarantee that there is no + * scripted caller, but a non-null value does guarantee that a scripted + * caller with the given principal is directly responsible for the + * attribute change. * @param aNotify specifies how whether or not the document should be * notified of the attribute change. */ virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix, const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, bool aNotify) = 0; /** diff --git a/dom/base/nsStyledElement.cpp b/dom/base/nsStyledElement.cpp index 4231adece..1ab85dee8 100644 --- a/dom/base/nsStyledElement.cpp +++ b/dom/base/nsStyledElement.cpp @@ -111,7 +111,8 @@ nsStyledElement::SetInlineStyleDeclaration(css::Declaration* aDeclaration, nsIDocument* document = GetComposedDoc(); mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify); return SetAttrAndNotify(kNameSpaceID_None, nsGkAtoms::style, nullptr, - oldValueSet ? &oldValue : nullptr, attrValue, modType, + oldValueSet ? &oldValue : nullptr, attrValue, + nullptr, modType, hasListeners, aNotify, kDontCallAfterSetAttr, document, updateBatch); } diff --git a/dom/html/HTMLAnchorElement.cpp b/dom/html/HTMLAnchorElement.cpp index 6822fe4c5..cea6eacf6 100644 --- a/dom/html/HTMLAnchorElement.cpp +++ b/dom/html/HTMLAnchorElement.cpp @@ -380,7 +380,9 @@ HTMLAnchorElement::BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName, nsresult HTMLAnchorElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { if (aNamespaceID == kNameSpaceID_None) { if (aName == nsGkAtoms::href) { @@ -392,7 +394,8 @@ HTMLAnchorElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, } return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, - aValue, aOldValue, aNotify); + aValue, aOldValue, + aSubjectPrincipal, aNotify); } EventStates diff --git a/dom/html/HTMLAnchorElement.h b/dom/html/HTMLAnchorElement.h index 087555964..efb6ceed5 100644 --- a/dom/html/HTMLAnchorElement.h +++ b/dom/html/HTMLAnchorElement.h @@ -72,6 +72,7 @@ public: virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override; virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override; diff --git a/dom/html/HTMLAreaElement.cpp b/dom/html/HTMLAreaElement.cpp index 11856c557..a752ff63d 100644 --- a/dom/html/HTMLAreaElement.cpp +++ b/dom/html/HTMLAreaElement.cpp @@ -143,7 +143,9 @@ HTMLAreaElement::UnbindFromTree(bool aDeep, bool aNullParent) nsresult HTMLAreaElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { if (aNamespaceID == kNameSpaceID_None) { // This must happen after the attribute is set. We will need the updated @@ -156,7 +158,7 @@ HTMLAreaElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, } return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue, - aOldValue, aNotify); + aOldValue, aSubjectPrincipal, aNotify); } #define IMPL_URI_PART(_part) \ diff --git a/dom/html/HTMLAreaElement.h b/dom/html/HTMLAreaElement.h index d408934c9..a44e2c3fc 100644 --- a/dom/html/HTMLAreaElement.h +++ b/dom/html/HTMLAreaElement.h @@ -179,6 +179,7 @@ protected: virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override; RefPtr mRelList; diff --git a/dom/html/HTMLButtonElement.cpp b/dom/html/HTMLButtonElement.cpp index 50e1dd0ca..94ec9dc3f 100644 --- a/dom/html/HTMLButtonElement.cpp +++ b/dom/html/HTMLButtonElement.cpp @@ -439,7 +439,9 @@ HTMLButtonElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName, nsresult HTMLButtonElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { if (aNameSpaceID == kNameSpaceID_None) { if (aName == nsGkAtoms::type) { @@ -455,7 +457,7 @@ HTMLButtonElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName, aValue, aOldValue, - aNotify); + aSubjectPrincipal, aNotify); } NS_IMETHODIMP diff --git a/dom/html/HTMLButtonElement.h b/dom/html/HTMLButtonElement.h index 34e5fd24d..18dcd0d00 100644 --- a/dom/html/HTMLButtonElement.h +++ b/dom/html/HTMLButtonElement.h @@ -89,6 +89,7 @@ public: virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override; virtual bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute, diff --git a/dom/html/HTMLCanvasElement.cpp b/dom/html/HTMLCanvasElement.cpp index 24366effd..03826ec34 100644 --- a/dom/html/HTMLCanvasElement.cpp +++ b/dom/html/HTMLCanvasElement.cpp @@ -460,12 +460,14 @@ NS_IMPL_BOOL_ATTR(HTMLCanvasElement, MozOpaque, moz_opaque) nsresult HTMLCanvasElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { AfterMaybeChangeAttr(aNamespaceID, aName, aNotify); return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue, - aOldValue, aNotify); + aOldValue, aSubjectPrincipal, aNotify); } nsresult diff --git a/dom/html/HTMLCanvasElement.h b/dom/html/HTMLCanvasElement.h index 657496a42..1e5d651d0 100644 --- a/dom/html/HTMLCanvasElement.h +++ b/dom/html/HTMLCanvasElement.h @@ -364,6 +364,7 @@ protected: virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override; virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValueOrString& aValue, diff --git a/dom/html/HTMLFieldSetElement.cpp b/dom/html/HTMLFieldSetElement.cpp index e7fb124c7..59441f7aa 100644 --- a/dom/html/HTMLFieldSetElement.cpp +++ b/dom/html/HTMLFieldSetElement.cpp @@ -84,7 +84,9 @@ HTMLFieldSetElement::GetEventTargetParent(EventChainPreVisitor& aVisitor) nsresult HTMLFieldSetElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::disabled && nsINode::GetFirstChild()) { @@ -101,7 +103,8 @@ HTMLFieldSetElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, } return nsGenericHTMLFormElement::AfterSetAttr(aNameSpaceID, aName, - aValue, aOldValue, aNotify); + aValue, aOldValue, + aSubjectPrincipal, aNotify); } // nsIDOMHTMLFieldSetElement diff --git a/dom/html/HTMLFieldSetElement.h b/dom/html/HTMLFieldSetElement.h index 7f10e4a5b..8a956f3c9 100644 --- a/dom/html/HTMLFieldSetElement.h +++ b/dom/html/HTMLFieldSetElement.h @@ -45,6 +45,7 @@ public: virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override; virtual nsresult InsertChildAt(nsIContent* aChild, uint32_t aIndex, diff --git a/dom/html/HTMLFormElement.cpp b/dom/html/HTMLFormElement.cpp index f6f3be87f..e626b524f 100644 --- a/dom/html/HTMLFormElement.cpp +++ b/dom/html/HTMLFormElement.cpp @@ -222,7 +222,9 @@ HTMLFormElement::BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName, nsresult HTMLFormElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { if (aName == nsGkAtoms::novalidate && aNameSpaceID == kNameSpaceID_None) { // Update all form elements states because they might be [no longer] @@ -239,7 +241,7 @@ HTMLFormElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, } return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue, - aOldValue, aNotify); + aOldValue, aSubjectPrincipal, aNotify); } NS_IMPL_STRING_ATTR(HTMLFormElement, AcceptCharset, acceptcharset) diff --git a/dom/html/HTMLFormElement.h b/dom/html/HTMLFormElement.h index ae6f67a94..d5e1c9d2f 100644 --- a/dom/html/HTMLFormElement.h +++ b/dom/html/HTMLFormElement.h @@ -111,6 +111,7 @@ public: virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override; /** diff --git a/dom/html/HTMLIFrameElement.cpp b/dom/html/HTMLIFrameElement.cpp index 2b66cbd26..b6ea03472 100644 --- a/dom/html/HTMLIFrameElement.cpp +++ b/dom/html/HTMLIFrameElement.cpp @@ -184,7 +184,9 @@ HTMLIFrameElement::GetAttributeMappingFunction() const nsresult HTMLIFrameElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aMaybeScriptedPrincipal, + bool aNotify) { AfterMaybeChangeAttr(aNameSpaceID, aName, aNotify); @@ -198,8 +200,10 @@ HTMLIFrameElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, } } } - return nsGenericHTMLFrameElement::AfterSetAttr(aNameSpaceID, aName, aValue, - aOldValue, aNotify); + return nsGenericHTMLFrameElement::AfterSetAttr(aNameSpaceID, aName, + aValue, aOldValue, + aMaybeScriptedPrincipal, + aNotify); } nsresult diff --git a/dom/html/HTMLIFrameElement.h b/dom/html/HTMLIFrameElement.h index e94ae0bad..f74c87ead 100644 --- a/dom/html/HTMLIFrameElement.h +++ b/dom/html/HTMLIFrameElement.h @@ -185,6 +185,7 @@ protected: virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aMaybeScriptedPrincipal, bool aNotify) override; virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValueOrString& aValue, diff --git a/dom/html/HTMLImageElement.cpp b/dom/html/HTMLImageElement.cpp index de1c112ad..f49b06088 100644 --- a/dom/html/HTMLImageElement.cpp +++ b/dom/html/HTMLImageElement.cpp @@ -395,10 +395,12 @@ HTMLImageElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName, nsresult HTMLImageElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aMaybeScriptedPrincipal, + bool aNotify) { if (aValue) { - AfterMaybeChangeAttr(aNameSpaceID, aName, aNotify); + AfterMaybeChangeAttr(aNameSpaceID, aName, aMaybeScriptedPrincipal, aNotify); } if (aNameSpaceID == kNameSpaceID_None && mForm && @@ -441,7 +443,9 @@ HTMLImageElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, } return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, - aValue, aOldValue, aNotify); + aValue, aOldValue, + aMaybeScriptedPrincipal, + aNotify); } nsresult @@ -450,7 +454,7 @@ HTMLImageElement::OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName, bool aNotify) { BeforeMaybeChangeAttr(aNamespaceID, aName, aValue, aNotify); - AfterMaybeChangeAttr(aNamespaceID, aName, aNotify); + AfterMaybeChangeAttr(aNamespaceID, aName, nullptr, aNotify); return nsGenericHTMLElement::OnAttrSetButNotChanged(aNamespaceID, aName, aValue, aNotify); @@ -532,6 +536,7 @@ HTMLImageElement::BeforeMaybeChangeAttr(int32_t aNamespaceID, nsIAtom* aName, void HTMLImageElement::AfterMaybeChangeAttr(int32_t aNamespaceID, nsIAtom* aName, + nsIPrincipal* aMaybeScriptedPrincipal, bool aNotify) { // Because we load image synchronously in non-responsive-mode, we need to do diff --git a/dom/html/HTMLImageElement.h b/dom/html/HTMLImageElement.h index 23cac4afb..49f9dc28e 100644 --- a/dom/html/HTMLImageElement.h +++ b/dom/html/HTMLImageElement.h @@ -344,6 +344,7 @@ protected: virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aMaybeScriptedPrincipal, bool aNotify) override; virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName, @@ -385,6 +386,7 @@ private: * @param aNotify Whether we plan to notify document observers. */ void AfterMaybeChangeAttr(int32_t aNamespaceID, nsIAtom* aName, + nsIPrincipal* aMaybeScriptedPrincipal, bool aNotify); /** * Used by BeforeMaybeChangeAttr and AfterMaybeChangeAttr to keep track of diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index 52681ca3e..ebad06472 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -1291,7 +1291,9 @@ HTMLInputElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName, nsresult HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { if (aNameSpaceID == kNameSpaceID_None) { // @@ -1442,6 +1444,7 @@ HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName, aValue, aOldValue, + aSubjectPrincipal, aNotify); } diff --git a/dom/html/HTMLInputElement.h b/dom/html/HTMLInputElement.h index ab461a901..0334b7473 100644 --- a/dom/html/HTMLInputElement.h +++ b/dom/html/HTMLInputElement.h @@ -982,6 +982,7 @@ protected: virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override; virtual void ResultForDialogSubmit(nsAString& aResult) override; diff --git a/dom/html/HTMLLinkElement.cpp b/dom/html/HTMLLinkElement.cpp index 5af819c1b..9a21abd91 100644 --- a/dom/html/HTMLLinkElement.cpp +++ b/dom/html/HTMLLinkElement.cpp @@ -358,7 +358,9 @@ HTMLLinkElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName, nsresult HTMLLinkElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { // It's safe to call ResetLinkState here because our new attr value has // already been set or unset. ResetLinkState needs the updated attribute @@ -452,7 +454,8 @@ HTMLLinkElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, } return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue, - aOldValue, aNotify); + aOldValue, aSubjectPrincipal, + aNotify); } nsresult diff --git a/dom/html/HTMLLinkElement.h b/dom/html/HTMLLinkElement.h index 1011d616f..27b0b64a2 100644 --- a/dom/html/HTMLLinkElement.h +++ b/dom/html/HTMLLinkElement.h @@ -67,6 +67,7 @@ public: virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override; virtual bool IsLink(nsIURI** aURI) const override; virtual already_AddRefed GetHrefURI() const override; diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 067c25c6a..048789f31 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -4219,7 +4219,9 @@ int32_t HTMLMediaElement::TabIndexDefault() nsresult HTMLMediaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aMaybeScriptedPrincipal, + bool aNotify) { if (aNameSpaceID == kNameSpaceID_None) { if (aName == nsGkAtoms::src) { @@ -4261,7 +4263,9 @@ HTMLMediaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, } return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, - aValue, aOldValue, aNotify); + aValue, aOldValue, + aMaybeScriptedPrincipal, + aNotify); } nsresult diff --git a/dom/html/HTMLMediaElement.h b/dom/html/HTMLMediaElement.h index 90650c14a..d939f81d4 100644 --- a/dom/html/HTMLMediaElement.h +++ b/dom/html/HTMLMediaElement.h @@ -1280,6 +1280,7 @@ protected: virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aMaybeScriptedPrincipal, bool aNotify) override; virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValueOrString& aValue, diff --git a/dom/html/HTMLMenuItemElement.cpp b/dom/html/HTMLMenuItemElement.cpp index 00c0b8050..4ae00a9e8 100644 --- a/dom/html/HTMLMenuItemElement.cpp +++ b/dom/html/HTMLMenuItemElement.cpp @@ -390,7 +390,9 @@ HTMLMenuItemElement::GetText(nsAString& aText) nsresult HTMLMenuItemElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { if (aNameSpaceID == kNameSpaceID_None) { if ((aName == nsGkAtoms::radiogroup || aName == nsGkAtoms::type) && @@ -413,8 +415,10 @@ HTMLMenuItemElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, } } - return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue, - aOldValue, aNotify); + return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, + aValue, aOldValue, + aSubjectPrincipal, + aNotify); } void diff --git a/dom/html/HTMLMenuItemElement.h b/dom/html/HTMLMenuItemElement.h index cb824edcc..bba12b9b1 100644 --- a/dom/html/HTMLMenuItemElement.h +++ b/dom/html/HTMLMenuItemElement.h @@ -127,6 +127,7 @@ protected: virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override; void WalkRadioGroup(Visitor* aVisitor); diff --git a/dom/html/HTMLMetaElement.cpp b/dom/html/HTMLMetaElement.cpp index 1f795bb72..9a22a2989 100644 --- a/dom/html/HTMLMetaElement.cpp +++ b/dom/html/HTMLMetaElement.cpp @@ -62,7 +62,9 @@ HTMLMetaElement::SetMetaReferrer(nsIDocument* aDocument) nsresult HTMLMetaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { if (aNameSpaceID == kNameSpaceID_None) { nsIDocument *document = GetUncomposedDoc(); @@ -83,8 +85,10 @@ HTMLMetaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, } } - return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue, - aOldValue, aNotify); + return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, + aValue, aOldValue, + aSubjectPrincipal, + aNotify); } nsresult diff --git a/dom/html/HTMLMetaElement.h b/dom/html/HTMLMetaElement.h index 0b9117e55..b1a2ac721 100644 --- a/dom/html/HTMLMetaElement.h +++ b/dom/html/HTMLMetaElement.h @@ -35,6 +35,7 @@ public: virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override; void CreateAndDispatchEvent(nsIDocument* aDoc, const nsAString& aEventName); diff --git a/dom/html/HTMLObjectElement.cpp b/dom/html/HTMLObjectElement.cpp index 029382e46..4a1d4157b 100644 --- a/dom/html/HTMLObjectElement.cpp +++ b/dom/html/HTMLObjectElement.cpp @@ -296,13 +296,16 @@ HTMLObjectElement::UnbindFromTree(bool aDeep, nsresult HTMLObjectElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { nsresult rv = AfterMaybeChangeAttr(aNamespaceID, aName, aNotify); NS_ENSURE_SUCCESS(rv, rv); return nsGenericHTMLFormElement::AfterSetAttr(aNamespaceID, aName, aValue, - aOldValue, aNotify); + aOldValue, aSubjectPrincipal, + aNotify); } nsresult diff --git a/dom/html/HTMLObjectElement.h b/dom/html/HTMLObjectElement.h index 016743c2c..6bba8f679 100644 --- a/dom/html/HTMLObjectElement.h +++ b/dom/html/HTMLObjectElement.h @@ -246,6 +246,7 @@ public: virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, bool aNotify) override; virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName, const nsAttrValueOrString& aValue, diff --git a/dom/html/HTMLOptGroupElement.cpp b/dom/html/HTMLOptGroupElement.cpp index b2597dd3d..b0ef19919 100644 --- a/dom/html/HTMLOptGroupElement.cpp +++ b/dom/html/HTMLOptGroupElement.cpp @@ -107,7 +107,9 @@ HTMLOptGroupElement::RemoveChildAt(uint32_t aIndex, bool aNotify) nsresult HTMLOptGroupElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, - const nsAttrValue* aOldValue, bool aNotify) + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::disabled) { // All our children