mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-02 05:17:31 +09:00
Issue #2736 - Part 2: Pass subject principal to SetAttribute and friends.
In order to tailor certain security checks to the caller that is attempting to load a particular piece of content, we need to be able to attach an appropriate triggering principal to the corresponding requests. Since most HTML content is loaded based on attribute values, this means capturing the subject principal of the caller who sets those attributes, which in turn means we need to make it available to `AfterSetAttr` hooks on all relevant element types.
This commit is contained in:
parent
9ad680cfc4
commit
824d0cad58
88 changed files with 337 additions and 132 deletions
|
|
@ -74,6 +74,7 @@ void
|
||||||
AnonymousContent::SetAttributeForElement(const nsAString& aElementId,
|
AnonymousContent::SetAttributeForElement(const nsAString& aElementId,
|
||||||
const nsAString& aName,
|
const nsAString& aName,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
ErrorResult& aRv)
|
ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
Element* element = GetElementById(aElementId);
|
Element* element = GetElementById(aElementId);
|
||||||
|
|
@ -82,7 +83,7 @@ AnonymousContent::SetAttributeForElement(const nsAString& aElementId,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
element->SetAttribute(aName, aValue, aRv);
|
element->SetAttribute(aName, aValue, aSubjectPrincipal, aRv);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ public:
|
||||||
void SetAttributeForElement(const nsAString& aElementId,
|
void SetAttributeForElement(const nsAString& aElementId,
|
||||||
const nsAString& aName,
|
const nsAString& aName,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
ErrorResult& aRv);
|
ErrorResult& aRv);
|
||||||
|
|
||||||
void GetAttributeForElement(const nsAString& aElementId,
|
void GetAttributeForElement(const nsAString& aElementId,
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ Attr::GetValue(nsAString& aValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Attr::SetValue(const nsAString& aValue, ErrorResult& aRv)
|
Attr::SetValue(const nsAString& aValue, nsIPrincipal* aTriggeringPrincipal, ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
Element* element = GetElement();
|
Element* element = GetElement();
|
||||||
if (!element) {
|
if (!element) {
|
||||||
|
|
@ -187,6 +187,7 @@ Attr::SetValue(const nsAString& aValue, ErrorResult& aRv)
|
||||||
nameAtom,
|
nameAtom,
|
||||||
mNodeInfo->GetPrefixAtom(),
|
mNodeInfo->GetPrefixAtom(),
|
||||||
aValue,
|
aValue,
|
||||||
|
aTriggeringPrincipal,
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -194,7 +195,7 @@ NS_IMETHODIMP
|
||||||
Attr::SetValue(const nsAString& aValue)
|
Attr::SetValue(const nsAString& aValue)
|
||||||
{
|
{
|
||||||
ErrorResult rv;
|
ErrorResult rv;
|
||||||
SetValue(aValue, rv);
|
SetValue(aValue, nullptr, rv);
|
||||||
return rv.StealNSResult();
|
return rv.StealNSResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,9 +84,13 @@ public:
|
||||||
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||||
|
|
||||||
// XPCOM GetName() is OK
|
// 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;
|
bool Specified() const;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,13 +69,10 @@ public:
|
||||||
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
|
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||||
|
|
||||||
// nsIContent
|
// nsIContent
|
||||||
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
using nsIContent::SetAttr;
|
||||||
const nsAString& aValue, bool aNotify)
|
|
||||||
{
|
|
||||||
return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
|
|
||||||
}
|
|
||||||
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsIAtom* aPrefix, const nsAString& aValue,
|
nsIAtom* aPrefix, const nsAString& aValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override
|
bool aNotify) override
|
||||||
{
|
{
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
||||||
|
|
@ -1254,6 +1254,7 @@ Element::ToggleAttribute(const nsAString& aName,
|
||||||
void
|
void
|
||||||
Element::SetAttribute(const nsAString& aName,
|
Element::SetAttribute(const nsAString& aName,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
|
nsIPrincipal* aTriggeringPrincipal,
|
||||||
ErrorResult& aError)
|
ErrorResult& aError)
|
||||||
{
|
{
|
||||||
aError = nsContentUtils::CheckQName(aName, false);
|
aError = nsContentUtils::CheckQName(aName, false);
|
||||||
|
|
@ -1269,12 +1270,12 @@ Element::SetAttribute(const nsAString& aName,
|
||||||
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
|
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
aError = SetAttr(kNameSpaceID_None, nameAtom, aValue, true);
|
aError = SetAttr(kNameSpaceID_None, nameAtom, aValue, aTriggeringPrincipal, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
aError = SetAttr(name->NamespaceID(), name->LocalName(), name->GetPrefix(),
|
aError = SetAttr(name->NamespaceID(), name->LocalName(), name->GetPrefix(),
|
||||||
aValue, true);
|
aValue, aTriggeringPrincipal, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1357,6 +1358,7 @@ void
|
||||||
Element::SetAttributeNS(const nsAString& aNamespaceURI,
|
Element::SetAttributeNS(const nsAString& aNamespaceURI,
|
||||||
const nsAString& aQualifiedName,
|
const nsAString& aQualifiedName,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
|
nsIPrincipal* aTriggeringPrincipal,
|
||||||
ErrorResult& aError)
|
ErrorResult& aError)
|
||||||
{
|
{
|
||||||
RefPtr<mozilla::dom::NodeInfo> ni;
|
RefPtr<mozilla::dom::NodeInfo> ni;
|
||||||
|
|
@ -1370,7 +1372,7 @@ Element::SetAttributeNS(const nsAString& aNamespaceURI,
|
||||||
}
|
}
|
||||||
|
|
||||||
aError = SetAttr(ni->NamespaceID(), ni->NameAtom(), ni->GetPrefixAtom(),
|
aError = SetAttr(ni->NamespaceID(), ni->NameAtom(), ni->GetPrefixAtom(),
|
||||||
aValue, true);
|
aValue, aTriggeringPrincipal, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2419,6 +2421,7 @@ Element::SetSingleClassFromParser(nsIAtom* aSingleClassName)
|
||||||
nullptr, // prefix
|
nullptr, // prefix
|
||||||
nullptr, // old value
|
nullptr, // old value
|
||||||
value,
|
value,
|
||||||
|
nullptr, // subject principal
|
||||||
static_cast<uint8_t>(nsIDOMMutationEvent::ADDITION),
|
static_cast<uint8_t>(nsIDOMMutationEvent::ADDITION),
|
||||||
false, // hasListeners
|
false, // hasListeners
|
||||||
false, // notify
|
false, // notify
|
||||||
|
|
@ -2430,6 +2433,7 @@ Element::SetSingleClassFromParser(nsIAtom* aSingleClassName)
|
||||||
nsresult
|
nsresult
|
||||||
Element::SetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
Element::SetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
nsIAtom* aPrefix, const nsAString& aValue,
|
nsIAtom* aPrefix, const nsAString& aValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify)
|
bool aNotify)
|
||||||
{
|
{
|
||||||
// Keep this in sync with SetParsedAttr below and SetSingleClassFromParser
|
// Keep this in sync with SetParsedAttr below and SetSingleClassFromParser
|
||||||
|
|
@ -2489,7 +2493,8 @@ Element::SetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
|
|
||||||
return SetAttrAndNotify(aNamespaceID, aName, aPrefix,
|
return SetAttrAndNotify(aNamespaceID, aName, aPrefix,
|
||||||
oldValueSet ? &oldValue : nullptr,
|
oldValueSet ? &oldValue : nullptr,
|
||||||
attrValue, modType, hasListeners, aNotify,
|
attrValue, aSubjectPrincipal, modType,
|
||||||
|
hasListeners, aNotify,
|
||||||
kCallAfterSetAttr, document, updateBatch);
|
kCallAfterSetAttr, document, updateBatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2534,7 +2539,7 @@ Element::SetParsedAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);
|
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);
|
||||||
return SetAttrAndNotify(aNamespaceID, aName, aPrefix,
|
return SetAttrAndNotify(aNamespaceID, aName, aPrefix,
|
||||||
oldValueSet ? &oldValue : nullptr,
|
oldValueSet ? &oldValue : nullptr,
|
||||||
aParsedValue, modType, hasListeners, aNotify,
|
aParsedValue, nullptr, modType, hasListeners, aNotify,
|
||||||
kCallAfterSetAttr, document, updateBatch);
|
kCallAfterSetAttr, document, updateBatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2544,6 +2549,7 @@ Element::SetAttrAndNotify(int32_t aNamespaceID,
|
||||||
nsIAtom* aPrefix,
|
nsIAtom* aPrefix,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
nsAttrValue& aParsedValue,
|
nsAttrValue& aParsedValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
uint8_t aModType,
|
uint8_t aModType,
|
||||||
bool aFireMutation,
|
bool aFireMutation,
|
||||||
bool aNotify,
|
bool aNotify,
|
||||||
|
|
@ -2650,7 +2656,7 @@ Element::SetAttrAndNotify(int32_t aNamespaceID,
|
||||||
|
|
||||||
if (aCallAfterSetAttr) {
|
if (aCallAfterSetAttr) {
|
||||||
rv = AfterSetAttr(aNamespaceID, aName, &valueForAfterSetAttr, oldValue,
|
rv = AfterSetAttr(aNamespaceID, aName, &valueForAfterSetAttr, oldValue,
|
||||||
aNotify);
|
aSubjectPrincipal, aNotify);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
if (aNamespaceID == kNameSpaceID_None && aName == nsGkAtoms::dir) {
|
if (aNamespaceID == kNameSpaceID_None && aName == nsGkAtoms::dir) {
|
||||||
|
|
@ -2946,7 +2952,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);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
UpdateState(aNotify);
|
UpdateState(aNotify);
|
||||||
|
|
|
||||||
|
|
@ -542,12 +542,7 @@ public:
|
||||||
already_AddRefed<mozilla::dom::NodeInfo>
|
already_AddRefed<mozilla::dom::NodeInfo>
|
||||||
GetExistingAttrNameFromQName(const nsAString& aStr) const;
|
GetExistingAttrNameFromQName(const nsAString& aStr) const;
|
||||||
|
|
||||||
MOZ_ALWAYS_INLINE // Avoid a crashy hook from Avast 10 Beta (Bug 1058131)
|
using nsIContent::SetAttr;
|
||||||
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
|
||||||
const nsAString& aValue, bool aNotify)
|
|
||||||
{
|
|
||||||
return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper for SetAttr/SetParsedAttr. This method will return true if aNotify
|
* Helper for SetAttr/SetParsedAttr. This method will return true if aNotify
|
||||||
|
|
@ -610,7 +605,8 @@ public:
|
||||||
nsresult SetSingleClassFromParser(nsIAtom* aSingleClassName);
|
nsresult SetSingleClassFromParser(nsIAtom* aSingleClassName);
|
||||||
|
|
||||||
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
|
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
|
// aParsedValue receives the old value of the attribute. That's useful if
|
||||||
// either the input or output value of aParsedValue is StoresOwnData.
|
// either the input or output value of aParsedValue is StoresOwnData.
|
||||||
nsresult SetParsedAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
|
nsresult SetParsedAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
|
||||||
|
|
@ -783,11 +779,18 @@ public:
|
||||||
bool ToggleAttribute(const nsAString& aName, const Optional<bool>& aForce,
|
bool ToggleAttribute(const nsAString& aName, const Optional<bool>& aForce,
|
||||||
ErrorResult& aError);
|
ErrorResult& aError);
|
||||||
void SetAttribute(const nsAString& aName, const nsAString& aValue,
|
void SetAttribute(const nsAString& aName, const nsAString& aValue,
|
||||||
ErrorResult& aError);
|
nsIPrincipal* aTriggeringPrincipal, ErrorResult& aError);
|
||||||
void SetAttributeNS(const nsAString& aNamespaceURI,
|
void SetAttributeNS(const nsAString& aNamespaceURI,
|
||||||
const nsAString& aLocalName,
|
const nsAString& aLocalName,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
|
nsIPrincipal* aTriggeringPrincipal,
|
||||||
ErrorResult& aError);
|
ErrorResult& aError);
|
||||||
|
void SetAttribute(const nsAString& aName, const nsAString& aValue,
|
||||||
|
ErrorResult& aError)
|
||||||
|
{
|
||||||
|
SetAttribute(aName, aValue, nullptr, aError);
|
||||||
|
}
|
||||||
|
|
||||||
void RemoveAttribute(const nsAString& aName,
|
void RemoveAttribute(const nsAString& aName,
|
||||||
ErrorResult& aError);
|
ErrorResult& aError);
|
||||||
void RemoveAttributeNS(const nsAString& aNamespaceURI,
|
void RemoveAttributeNS(const nsAString& aNamespaceURI,
|
||||||
|
|
@ -1232,6 +1235,11 @@ public:
|
||||||
aError = SetAttr(kNameSpaceID_None, aAttr, aValue, true);
|
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
|
* Set a content attribute via a reflecting nullable string IDL
|
||||||
* attribute (e.g. a CORS attribute). If DOMStringIsNull(aValue),
|
* attribute (e.g. a CORS attribute). If DOMStringIsNull(aValue),
|
||||||
|
|
@ -1309,6 +1317,14 @@ protected:
|
||||||
* @param aParsedValue parsed new value of attribute. Replaced by the
|
* @param aParsedValue parsed new value of attribute. Replaced by the
|
||||||
* old value of the attribute. This old value is only
|
* old value of the attribute. This old value is only
|
||||||
* useful if either it or the new value is StoresOwnData.
|
* 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
|
* @param aModType nsIDOMMutationEvent::MODIFICATION or ADDITION. Only
|
||||||
* needed if aFireMutation or aNotify is true.
|
* needed if aFireMutation or aNotify is true.
|
||||||
* @param aFireMutation should mutation-events be fired?
|
* @param aFireMutation should mutation-events be fired?
|
||||||
|
|
@ -1321,6 +1337,7 @@ protected:
|
||||||
nsIAtom* aPrefix,
|
nsIAtom* aPrefix,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
nsAttrValue& aParsedValue,
|
nsAttrValue& aParsedValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
uint8_t aModType,
|
uint8_t aModType,
|
||||||
bool aFireMutation,
|
bool aFireMutation,
|
||||||
bool aNotify,
|
bool aNotify,
|
||||||
|
|
@ -1412,13 +1429,21 @@ protected:
|
||||||
* the attr was not previously set. This argument may not have the
|
* the attr was not previously set. This argument may not have the
|
||||||
* correct value for SVG elements, or other cases in which the
|
* correct value for SVG elements, or other cases in which the
|
||||||
* attribute value doesn't store its own data
|
* 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.
|
* @param aNotify Whether we plan to notify document observers.
|
||||||
*/
|
*/
|
||||||
// Note that this is inlined so that when subclasses call it it gets
|
// Note that this is inlined so that when subclasses call it it gets
|
||||||
// inlined. Those calls don't go through a vtable.
|
// inlined. Those calls don't go through a vtable.
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
@ -1801,7 +1826,7 @@ NS_IMETHOD SetAttribute(const nsAString& name, \
|
||||||
const nsAString& value) override \
|
const nsAString& value) override \
|
||||||
{ \
|
{ \
|
||||||
mozilla::ErrorResult rv; \
|
mozilla::ErrorResult rv; \
|
||||||
Element::SetAttribute(name, value, rv); \
|
Element::SetAttribute(name, value, nullptr, rv); \
|
||||||
return rv.StealNSResult(); \
|
return rv.StealNSResult(); \
|
||||||
} \
|
} \
|
||||||
NS_IMETHOD SetAttributeNS(const nsAString& namespaceURI, \
|
NS_IMETHOD SetAttributeNS(const nsAString& namespaceURI, \
|
||||||
|
|
@ -1809,22 +1834,22 @@ NS_IMETHOD SetAttributeNS(const nsAString& namespaceURI, \
|
||||||
const nsAString& value) final override \
|
const nsAString& value) final override \
|
||||||
{ \
|
{ \
|
||||||
mozilla::ErrorResult rv; \
|
mozilla::ErrorResult rv; \
|
||||||
Element::SetAttributeNS(namespaceURI, qualifiedName, value, rv); \
|
Element::SetAttributeNS(namespaceURI, qualifiedName, value, nullptr, rv); \
|
||||||
return rv.StealNSResult(); \
|
return rv.StealNSResult(); \
|
||||||
} \
|
} \
|
||||||
using Element::RemoveAttribute; \
|
using Element::RemoveAttribute; \
|
||||||
NS_IMETHOD RemoveAttribute(const nsAString& name) final override \
|
NS_IMETHOD RemoveAttribute(const nsAString& name) final override \
|
||||||
{ \
|
{ \
|
||||||
mozilla::ErrorResult rv; \
|
mozilla::ErrorResult rv; \
|
||||||
RemoveAttribute(name, rv); \
|
RemoveAttribute(name, rv); \
|
||||||
return rv.StealNSResult(); \
|
return rv.StealNSResult(); \
|
||||||
} \
|
} \
|
||||||
NS_IMETHOD RemoveAttributeNS(const nsAString& namespaceURI, \
|
NS_IMETHOD RemoveAttributeNS(const nsAString& namespaceURI, \
|
||||||
const nsAString& localName) final override \
|
const nsAString& localName) final override \
|
||||||
{ \
|
{ \
|
||||||
mozilla::ErrorResult rv; \
|
mozilla::ErrorResult rv; \
|
||||||
Element::RemoveAttributeNS(namespaceURI, localName, rv); \
|
Element::RemoveAttributeNS(namespaceURI, localName, rv); \
|
||||||
return rv.StealNSResult(); \
|
return rv.StealNSResult(); \
|
||||||
} \
|
} \
|
||||||
using Element::HasAttribute; \
|
using Element::HasAttribute; \
|
||||||
NS_IMETHOD HasAttribute(const nsAString& name, \
|
NS_IMETHOD HasAttribute(const nsAString& name, \
|
||||||
|
|
@ -1860,7 +1885,7 @@ NS_IMETHOD SetAttributeNode(nsIDOMAttr* newAttr, \
|
||||||
mozilla::ErrorResult rv; \
|
mozilla::ErrorResult rv; \
|
||||||
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(newAttr); \
|
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(newAttr); \
|
||||||
*_retval = Element::SetAttributeNode(*attr, rv).take(); \
|
*_retval = Element::SetAttributeNode(*attr, rv).take(); \
|
||||||
return rv.StealNSResult(); \
|
return rv.StealNSResult(); \
|
||||||
} \
|
} \
|
||||||
NS_IMETHOD RemoveAttributeNode(nsIDOMAttr* oldAttr, \
|
NS_IMETHOD RemoveAttributeNode(nsIDOMAttr* oldAttr, \
|
||||||
nsIDOMAttr** _retval) final override \
|
nsIDOMAttr** _retval) final override \
|
||||||
|
|
@ -1871,7 +1896,7 @@ NS_IMETHOD RemoveAttributeNode(nsIDOMAttr* oldAttr, \
|
||||||
mozilla::ErrorResult rv; \
|
mozilla::ErrorResult rv; \
|
||||||
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(oldAttr); \
|
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(oldAttr); \
|
||||||
*_retval = Element::RemoveAttributeNode(*attr, rv).take(); \
|
*_retval = Element::RemoveAttributeNode(*attr, rv).take(); \
|
||||||
return rv.StealNSResult(); \
|
return rv.StealNSResult(); \
|
||||||
} \
|
} \
|
||||||
NS_IMETHOD GetAttributeNodeNS(const nsAString& namespaceURI, \
|
NS_IMETHOD GetAttributeNodeNS(const nsAString& namespaceURI, \
|
||||||
const nsAString& localName, \
|
const nsAString& localName, \
|
||||||
|
|
@ -1887,7 +1912,7 @@ NS_IMETHOD SetAttributeNodeNS(nsIDOMAttr* newAttr, \
|
||||||
mozilla::ErrorResult rv; \
|
mozilla::ErrorResult rv; \
|
||||||
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(newAttr); \
|
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(newAttr); \
|
||||||
*_retval = Element::SetAttributeNodeNS(*attr, rv).take(); \
|
*_retval = Element::SetAttributeNodeNS(*attr, rv).take(); \
|
||||||
return rv.StealNSResult(); \
|
return rv.StealNSResult(); \
|
||||||
} \
|
} \
|
||||||
NS_IMETHOD GetElementsByTagName(const nsAString& name, \
|
NS_IMETHOD GetElementsByTagName(const nsAString& name, \
|
||||||
nsIDOMHTMLCollection** _retval) final \
|
nsIDOMHTMLCollection** _retval) final \
|
||||||
|
|
@ -2055,7 +2080,7 @@ NS_IMETHOD ReleaseCapture(void) final override \
|
||||||
NS_IMETHOD MozRequestFullScreen(void) final override \
|
NS_IMETHOD MozRequestFullScreen(void) final override \
|
||||||
{ \
|
{ \
|
||||||
mozilla::ErrorResult rv; \
|
mozilla::ErrorResult rv; \
|
||||||
Element::RequestFullscreen(rv); \
|
Element::RequestFullscreen(rv); \
|
||||||
return rv.StealNSResult(); \
|
return rv.StealNSResult(); \
|
||||||
} \
|
} \
|
||||||
NS_IMETHOD MozRequestPointerLock(void) final override \
|
NS_IMETHOD MozRequestPointerLock(void) final override \
|
||||||
|
|
|
||||||
|
|
@ -625,6 +625,7 @@ nsGenericDOMDataNode::GetChildren(uint32_t aFilter)
|
||||||
nsresult
|
nsresult
|
||||||
nsGenericDOMDataNode::SetAttr(int32_t aNameSpaceID, nsIAtom* aAttr,
|
nsGenericDOMDataNode::SetAttr(int32_t aNameSpaceID, nsIAtom* aAttr,
|
||||||
nsIAtom* aPrefix, const nsAString& aValue,
|
nsIAtom* aPrefix, const nsAString& aValue,
|
||||||
|
nsIPrincipal* aContentPrincipal,
|
||||||
bool aNotify)
|
bool aNotify)
|
||||||
{
|
{
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
||||||
|
|
@ -117,13 +117,10 @@ public:
|
||||||
virtual already_AddRefed<nsINodeList> GetChildren(uint32_t aFilter) override;
|
virtual already_AddRefed<nsINodeList> GetChildren(uint32_t aFilter) override;
|
||||||
|
|
||||||
|
|
||||||
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
using nsIContent::SetAttr;
|
||||||
const nsAString& aValue, bool aNotify)
|
|
||||||
{
|
|
||||||
return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
|
|
||||||
}
|
|
||||||
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
||||||
nsIAtom* aPrefix, const nsAString& aValue,
|
nsIAtom* aPrefix, const nsAString& aValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
|
||||||
|
|
@ -363,6 +363,16 @@ public:
|
||||||
{
|
{
|
||||||
return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
|
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
|
* Set attribute values. All attribute values are assumed to have a
|
||||||
|
|
@ -375,11 +385,18 @@ public:
|
||||||
* @param aName the name of the attribute
|
* @param aName the name of the attribute
|
||||||
* @param aPrefix the prefix of the attribute
|
* @param aPrefix the prefix of the attribute
|
||||||
* @param aValue the value to set
|
* @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
|
* @param aNotify specifies how whether or not the document should be
|
||||||
* notified of the attribute change.
|
* notified of the attribute change.
|
||||||
*/
|
*/
|
||||||
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsIAtom* aPrefix, const nsAString& aValue,
|
nsIAtom* aPrefix, const nsAString& aValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
bool aNotify) = 0;
|
bool aNotify) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,8 @@ nsStyledElement::SetInlineStyleDeclaration(css::Declaration* aDeclaration,
|
||||||
nsIDocument* document = GetComposedDoc();
|
nsIDocument* document = GetComposedDoc();
|
||||||
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);
|
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);
|
||||||
return SetAttrAndNotify(kNameSpaceID_None, nsGkAtoms::style, nullptr,
|
return SetAttrAndNotify(kNameSpaceID_None, nsGkAtoms::style, nullptr,
|
||||||
oldValueSet ? &oldValue : nullptr, attrValue, modType,
|
oldValueSet ? &oldValue : nullptr, attrValue,
|
||||||
|
nullptr, modType,
|
||||||
hasListeners, aNotify, kDontCallAfterSetAttr,
|
hasListeners, aNotify, kDontCallAfterSetAttr,
|
||||||
document, updateBatch);
|
document, updateBatch);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,9 @@ HTMLAnchorElement::BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
nsresult
|
nsresult
|
||||||
HTMLAnchorElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
HTMLAnchorElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNamespaceID == kNameSpaceID_None) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
if (aName == nsGkAtoms::href) {
|
if (aName == nsGkAtoms::href) {
|
||||||
|
|
@ -398,7 +400,8 @@ HTMLAnchorElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName,
|
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aSubjectPrincipal, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
EventStates
|
EventStates
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,9 @@ HTMLAreaElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||||
nsresult
|
nsresult
|
||||||
HTMLAreaElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
HTMLAreaElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNamespaceID == kNameSpaceID_None) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
// This must happen after the attribute is set. We will need the updated
|
// This must happen after the attribute is set. We will need the updated
|
||||||
|
|
@ -155,7 +157,7 @@ HTMLAreaElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define IMPL_URI_PART(_part) \
|
#define IMPL_URI_PART(_part) \
|
||||||
|
|
|
||||||
|
|
@ -178,6 +178,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
RefPtr<nsDOMTokenList > mRelList;
|
RefPtr<nsDOMTokenList > mRelList;
|
||||||
|
|
|
||||||
|
|
@ -438,7 +438,9 @@ HTMLButtonElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsresult
|
nsresult
|
||||||
HTMLButtonElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLButtonElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNameSpaceID == kNameSpaceID_None) {
|
if (aNameSpaceID == kNameSpaceID_None) {
|
||||||
if (aName == nsGkAtoms::type) {
|
if (aName == nsGkAtoms::type) {
|
||||||
|
|
@ -454,7 +456,7 @@ HTMLButtonElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
|
|
||||||
return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName,
|
return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName,
|
||||||
aValue, aOldValue,
|
aValue, aOldValue,
|
||||||
aNotify);
|
aSubjectPrincipal, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual bool ParseAttribute(int32_t aNamespaceID,
|
virtual bool ParseAttribute(int32_t aNamespaceID,
|
||||||
nsIAtom* aAttribute,
|
nsIAtom* aAttribute,
|
||||||
|
|
|
||||||
|
|
@ -443,12 +443,14 @@ NS_IMPL_BOOL_ATTR(HTMLCanvasElement, MozOpaque, moz_opaque)
|
||||||
nsresult
|
nsresult
|
||||||
HTMLCanvasElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
HTMLCanvasElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
|
AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -361,6 +361,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValueOrString& aValue,
|
const nsAttrValueOrString& aValue,
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,9 @@ HTMLFieldSetElement::GetEventTargetParent(EventChainPreVisitor& aVisitor)
|
||||||
nsresult
|
nsresult
|
||||||
HTMLFieldSetElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLFieldSetElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::disabled &&
|
if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::disabled &&
|
||||||
nsINode::GetFirstChild()) {
|
nsINode::GetFirstChild()) {
|
||||||
|
|
@ -100,7 +102,8 @@ HTMLFieldSetElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLFormElement::AfterSetAttr(aNameSpaceID, aName,
|
return nsGenericHTMLFormElement::AfterSetAttr(aNameSpaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aSubjectPrincipal, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
// nsIDOMHTMLFieldSetElement
|
// nsIDOMHTMLFieldSetElement
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
virtual nsresult InsertChildAt(nsIContent* aChild, uint32_t aIndex,
|
virtual nsresult InsertChildAt(nsIContent* aChild, uint32_t aIndex,
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,9 @@ HTMLFormElement::BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
nsresult
|
nsresult
|
||||||
HTMLFormElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLFormElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aName == nsGkAtoms::novalidate && aNameSpaceID == kNameSpaceID_None) {
|
if (aName == nsGkAtoms::novalidate && aNameSpaceID == kNameSpaceID_None) {
|
||||||
// Update all form elements states because they might be [no longer]
|
// Update all form elements states because they might be [no longer]
|
||||||
|
|
@ -235,7 +237,7 @@ HTMLFormElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_STRING_ATTR(HTMLFormElement, AcceptCharset, acceptcharset)
|
NS_IMPL_STRING_ATTR(HTMLFormElement, AcceptCharset, acceptcharset)
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,9 @@ HTMLIFrameElement::GetAttributeMappingFunction() const
|
||||||
nsresult
|
nsresult
|
||||||
HTMLIFrameElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLIFrameElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
AfterMaybeChangeAttr(aNameSpaceID, aName, aNotify);
|
AfterMaybeChangeAttr(aNameSpaceID, aName, aNotify);
|
||||||
|
|
||||||
|
|
@ -197,8 +199,10 @@ HTMLIFrameElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nsGenericHTMLFrameElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
return nsGenericHTMLFrameElement::AfterSetAttr(aNameSpaceID, aName,
|
||||||
aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aMaybeScriptedPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValueOrString& aValue,
|
const nsAttrValueOrString& aValue,
|
||||||
|
|
|
||||||
|
|
@ -393,10 +393,12 @@ HTMLImageElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsresult
|
nsresult
|
||||||
HTMLImageElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLImageElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aValue) {
|
if (aValue) {
|
||||||
AfterMaybeChangeAttr(aNameSpaceID, aName, aNotify);
|
AfterMaybeChangeAttr(aNameSpaceID, aName, aMaybeScriptedPrincipal, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aNameSpaceID == kNameSpaceID_None && mForm &&
|
if (aNameSpaceID == kNameSpaceID_None && mForm &&
|
||||||
|
|
@ -439,7 +441,9 @@ HTMLImageElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aMaybeScriptedPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
@ -448,7 +452,7 @@ HTMLImageElement::OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
bool aNotify)
|
bool aNotify)
|
||||||
{
|
{
|
||||||
BeforeMaybeChangeAttr(aNamespaceID, aName, aValue, aNotify);
|
BeforeMaybeChangeAttr(aNamespaceID, aName, aValue, aNotify);
|
||||||
AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
|
AfterMaybeChangeAttr(aNamespaceID, aName, nullptr, aNotify);
|
||||||
|
|
||||||
return nsGenericHTMLElement::OnAttrSetButNotChanged(aNamespaceID, aName,
|
return nsGenericHTMLElement::OnAttrSetButNotChanged(aNamespaceID, aName,
|
||||||
aValue, aNotify);
|
aValue, aNotify);
|
||||||
|
|
@ -530,6 +534,7 @@ HTMLImageElement::BeforeMaybeChangeAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
|
|
||||||
void
|
void
|
||||||
HTMLImageElement::AfterMaybeChangeAttr(int32_t aNamespaceID, nsIAtom* aName,
|
HTMLImageElement::AfterMaybeChangeAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
bool aNotify)
|
bool aNotify)
|
||||||
{
|
{
|
||||||
// Because we load image synchronously in non-responsive-mode, we need to do
|
// Because we load image synchronously in non-responsive-mode, we need to do
|
||||||
|
|
|
||||||
|
|
@ -337,6 +337,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
|
|
@ -378,6 +379,7 @@ private:
|
||||||
* @param aNotify Whether we plan to notify document observers.
|
* @param aNotify Whether we plan to notify document observers.
|
||||||
*/
|
*/
|
||||||
void AfterMaybeChangeAttr(int32_t aNamespaceID, nsIAtom* aName,
|
void AfterMaybeChangeAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
bool aNotify);
|
bool aNotify);
|
||||||
/**
|
/**
|
||||||
* Used by BeforeMaybeChangeAttr and AfterMaybeChangeAttr to keep track of
|
* Used by BeforeMaybeChangeAttr and AfterMaybeChangeAttr to keep track of
|
||||||
|
|
|
||||||
|
|
@ -1285,7 +1285,9 @@ HTMLInputElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsresult
|
nsresult
|
||||||
HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNameSpaceID == kNameSpaceID_None) {
|
if (aNameSpaceID == kNameSpaceID_None) {
|
||||||
//
|
//
|
||||||
|
|
@ -1436,6 +1438,7 @@ HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
|
|
||||||
return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName,
|
return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName,
|
||||||
aValue, aOldValue,
|
aValue, aOldValue,
|
||||||
|
aSubjectPrincipal,
|
||||||
aNotify);
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -966,6 +966,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
virtual void ResultForDialogSubmit(nsAString& aResult) override;
|
virtual void ResultForDialogSubmit(nsAString& aResult) override;
|
||||||
|
|
|
||||||
|
|
@ -357,7 +357,9 @@ HTMLLinkElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsresult
|
nsresult
|
||||||
HTMLLinkElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLLinkElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
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
|
// It's safe to call ResetLinkState here because our new attr value has
|
||||||
// already been set or unset. ResetLinkState needs the updated attribute
|
// already been set or unset. ResetLinkState needs the updated attribute
|
||||||
|
|
@ -451,7 +453,8 @@ HTMLLinkElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual bool IsLink(nsIURI** aURI) const override;
|
virtual bool IsLink(nsIURI** aURI) const override;
|
||||||
virtual already_AddRefed<nsIURI> GetHrefURI() const override;
|
virtual already_AddRefed<nsIURI> GetHrefURI() const override;
|
||||||
|
|
|
||||||
|
|
@ -3727,7 +3727,9 @@ int32_t HTMLMediaElement::TabIndexDefault()
|
||||||
nsresult
|
nsresult
|
||||||
HTMLMediaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLMediaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNameSpaceID == kNameSpaceID_None) {
|
if (aNameSpaceID == kNameSpaceID_None) {
|
||||||
if (aName == nsGkAtoms::src) {
|
if (aName == nsGkAtoms::src) {
|
||||||
|
|
@ -3769,7 +3771,9 @@ HTMLMediaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aMaybeScriptedPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -1301,6 +1301,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValueOrString& aValue,
|
const nsAttrValueOrString& aValue,
|
||||||
|
|
|
||||||
|
|
@ -389,7 +389,9 @@ HTMLMenuItemElement::GetText(nsAString& aText)
|
||||||
nsresult
|
nsresult
|
||||||
HTMLMenuItemElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLMenuItemElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNameSpaceID == kNameSpaceID_None) {
|
if (aNameSpaceID == kNameSpaceID_None) {
|
||||||
if ((aName == nsGkAtoms::radiogroup || aName == nsGkAtoms::type) &&
|
if ((aName == nsGkAtoms::radiogroup || aName == nsGkAtoms::type) &&
|
||||||
|
|
@ -412,8 +414,10 @@ HTMLMenuItemElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName,
|
||||||
aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
void WalkRadioGroup(Visitor* aVisitor);
|
void WalkRadioGroup(Visitor* aVisitor);
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,9 @@ HTMLMetaElement::SetMetaReferrer(nsIDocument* aDocument)
|
||||||
nsresult
|
nsresult
|
||||||
HTMLMetaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLMetaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNameSpaceID == kNameSpaceID_None) {
|
if (aNameSpaceID == kNameSpaceID_None) {
|
||||||
nsIDocument *document = GetUncomposedDoc();
|
nsIDocument *document = GetUncomposedDoc();
|
||||||
|
|
@ -82,8 +84,10 @@ HTMLMetaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName,
|
||||||
aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
void CreateAndDispatchEvent(nsIDocument* aDoc, const nsAString& aEventName);
|
void CreateAndDispatchEvent(nsIDocument* aDoc, const nsAString& aEventName);
|
||||||
|
|
|
||||||
|
|
@ -299,13 +299,16 @@ HTMLObjectElement::UnbindFromTree(bool aDeep,
|
||||||
nsresult
|
nsresult
|
||||||
HTMLObjectElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
HTMLObjectElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
nsresult rv = AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
|
nsresult rv = AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return nsGenericHTMLFormElement::AfterSetAttr(aNamespaceID, aName, aValue,
|
return nsGenericHTMLFormElement::AfterSetAttr(aNamespaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -245,6 +245,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValueOrString& aValue,
|
const nsAttrValueOrString& aValue,
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,9 @@ HTMLOptGroupElement::RemoveChildAt(uint32_t aIndex, bool aNotify)
|
||||||
nsresult
|
nsresult
|
||||||
HTMLOptGroupElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLOptGroupElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::disabled) {
|
if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::disabled) {
|
||||||
// All our children <option> have their :disabled state depending on our
|
// All our children <option> have their :disabled state depending on our
|
||||||
|
|
@ -121,7 +123,8 @@ HTMLOptGroupElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
EventStates
|
EventStates
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
virtual nsIDOMNode* AsDOMNode() override { return this; }
|
virtual nsIDOMNode* AsDOMNode() override { return this; }
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,9 @@ HTMLOptionElement::BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
nsresult
|
nsresult
|
||||||
HTMLOptionElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLOptionElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNameSpaceID == kNameSpaceID_None &&
|
if (aNameSpaceID == kNameSpaceID_None &&
|
||||||
aName == nsGkAtoms::value && Selected()) {
|
aName == nsGkAtoms::value && Selected()) {
|
||||||
|
|
@ -258,7 +260,9 @@ HTMLOptionElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
void SetSelectedInternal(bool aValue, bool aNotify);
|
void SetSelectedInternal(bool aValue, bool aNotify);
|
||||||
|
|
|
||||||
|
|
@ -232,13 +232,17 @@ HTMLScriptElement::SetNoModule(bool aValue, ErrorResult& aRv)
|
||||||
nsresult
|
nsresult
|
||||||
HTMLScriptElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
HTMLScriptElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (nsGkAtoms::async == aName && kNameSpaceID_None == aNamespaceID) {
|
if (nsGkAtoms::async == aName && kNameSpaceID_None == aNamespaceID) {
|
||||||
mForceAsync = false;
|
mForceAsync = false;
|
||||||
}
|
}
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName,
|
||||||
aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aMaybeScriptedPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
// WebIDL
|
// WebIDL
|
||||||
|
|
|
||||||
|
|
@ -1296,7 +1296,9 @@ HTMLSelectElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsresult
|
nsresult
|
||||||
HTMLSelectElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLSelectElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNameSpaceID == kNameSpaceID_None) {
|
if (aNameSpaceID == kNameSpaceID_None) {
|
||||||
if (aName == nsGkAtoms::disabled) {
|
if (aName == nsGkAtoms::disabled) {
|
||||||
|
|
@ -1317,6 +1319,7 @@ HTMLSelectElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
|
|
||||||
return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName,
|
return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName,
|
||||||
aValue, aOldValue,
|
aValue, aOldValue,
|
||||||
|
aSubjectPrincipal,
|
||||||
aNotify);
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -379,6 +379,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
virtual void DoneAddingChildren(bool aHaveNotified) override;
|
virtual void DoneAddingChildren(bool aHaveNotified) override;
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,9 @@ SetBaseTargetUsingFirstBaseWithTarget(nsIDocument* aDocument,
|
||||||
nsresult
|
nsresult
|
||||||
HTMLSharedElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
HTMLSharedElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNamespaceID == kNameSpaceID_None) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
if (aName == nsGkAtoms::href) {
|
if (aName == nsGkAtoms::href) {
|
||||||
|
|
@ -256,7 +258,8 @@ HTMLSharedElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,7 @@ nsresult
|
||||||
HTMLSharedObjectElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
HTMLSharedObjectElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify)
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aValue) {
|
if (aValue) {
|
||||||
|
|
@ -172,7 +173,7 @@ HTMLSharedObjectElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -201,6 +201,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValueOrString& aValue,
|
const nsAttrValueOrString& aValue,
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,7 @@ nsresult
|
||||||
HTMLSlotElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLSlotElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify)
|
bool aNotify)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -119,7 +120,8 @@ HTMLSlotElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
// WebIDL
|
// WebIDL
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,9 @@ HTMLSourceElement::UpdateMediaList(const nsAttrValue* aValue)
|
||||||
nsresult
|
nsresult
|
||||||
HTMLSourceElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLSourceElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
// If we are associated with a <picture> with a valid <img>, notify it of
|
// If we are associated with a <picture> with a valid <img>, notify it of
|
||||||
// responsive parameter changes
|
// responsive parameter changes
|
||||||
|
|
@ -143,7 +145,9 @@ HTMLSourceElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aMaybeScriptedPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,9 @@ HTMLStyleElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||||
nsresult
|
nsresult
|
||||||
HTMLStyleElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLStyleElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNameSpaceID == kNameSpaceID_None) {
|
if (aNameSpaceID == kNameSpaceID_None) {
|
||||||
if (aName == nsGkAtoms::title ||
|
if (aName == nsGkAtoms::title ||
|
||||||
|
|
@ -185,7 +187,8 @@ HTMLStyleElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
||||||
|
|
|
||||||
|
|
@ -1005,13 +1005,16 @@ HTMLTableElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsresult
|
nsresult
|
||||||
HTMLTableElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLTableElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aName == nsGkAtoms::cellpadding && aNameSpaceID == kNameSpaceID_None) {
|
if (aName == nsGkAtoms::cellpadding && aNameSpaceID == kNameSpaceID_None) {
|
||||||
BuildInheritedAttributes();
|
BuildInheritedAttributes();
|
||||||
}
|
}
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace dom
|
} // namespace dom
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLTableElement,
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLTableElement,
|
||||||
|
|
|
||||||
|
|
@ -1330,7 +1330,9 @@ HTMLTextAreaElement::ContentChanged(nsIContent* aContent)
|
||||||
nsresult
|
nsresult
|
||||||
HTMLTextAreaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
HTMLTextAreaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNameSpaceID == kNameSpaceID_None) {
|
if (aNameSpaceID == kNameSpaceID_None) {
|
||||||
if (aName == nsGkAtoms::required || aName == nsGkAtoms::disabled ||
|
if (aName == nsGkAtoms::required || aName == nsGkAtoms::disabled ||
|
||||||
|
|
@ -1349,7 +1351,8 @@ HTMLTextAreaElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName, aValue,
|
return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -358,6 +358,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom *aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom *aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -692,7 +692,9 @@ nsGenericHTMLElement::BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
nsresult
|
nsresult
|
||||||
nsGenericHTMLElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
nsGenericHTMLElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNamespaceID == kNameSpaceID_None) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
if (IsEventAttributeName(aName) && aValue) {
|
if (IsEventAttributeName(aName) && aValue) {
|
||||||
|
|
@ -782,7 +784,9 @@ nsGenericHTMLElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElementBase::AfterSetAttr(aNamespaceID, aName,
|
return nsGenericHTMLElementBase::AfterSetAttr(aNamespaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aMaybeScriptedPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
EventListenerManager*
|
EventListenerManager*
|
||||||
|
|
@ -2042,7 +2046,9 @@ nsGenericHTMLFormElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsresult
|
nsresult
|
||||||
nsGenericHTMLFormElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
nsGenericHTMLFormElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNameSpaceID == kNameSpaceID_None) {
|
if (aNameSpaceID == kNameSpaceID_None) {
|
||||||
// add the control to the hashtable as needed
|
// add the control to the hashtable as needed
|
||||||
|
|
@ -2091,7 +2097,9 @@ nsGenericHTMLFormElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aMaybeScriptedPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -914,6 +914,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
virtual mozilla::EventListenerManager*
|
virtual mozilla::EventListenerManager*
|
||||||
|
|
@ -959,6 +960,10 @@ protected:
|
||||||
{
|
{
|
||||||
mozilla::dom::Element::SetAttr(aName, aValue, aError);
|
mozilla::dom::Element::SetAttr(aName, aValue, aError);
|
||||||
}
|
}
|
||||||
|
void SetHTMLAttr(nsIAtom* aName, const nsAString& aValue, nsIPrincipal& aTriggeringPrincipal, mozilla::ErrorResult& aError)
|
||||||
|
{
|
||||||
|
mozilla::dom::Element::SetAttr(aName, aValue, aTriggeringPrincipal, aError);
|
||||||
|
}
|
||||||
void UnsetHTMLAttr(nsIAtom* aName, mozilla::ErrorResult& aError)
|
void UnsetHTMLAttr(nsIAtom* aName, mozilla::ErrorResult& aError)
|
||||||
{
|
{
|
||||||
mozilla::dom::Element::UnsetAttr(aName, aError);
|
mozilla::dom::Element::UnsetAttr(aName, aError);
|
||||||
|
|
@ -1270,6 +1275,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -337,7 +337,9 @@ PrincipalAllowsBrowserFrame(nsIPrincipal* aPrincipal)
|
||||||
/* virtual */ nsresult
|
/* virtual */ nsresult
|
||||||
nsGenericHTMLFrameElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
nsGenericHTMLFrameElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aValue) {
|
if (aValue) {
|
||||||
nsAttrValueOrString value(aValue);
|
nsAttrValueOrString value(aValue);
|
||||||
|
|
@ -376,7 +378,8 @@ nsGenericHTMLFrameElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult OnAttrSetButNotChanged(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValueOrString& aValue,
|
const nsAttrValueOrString& aValue,
|
||||||
|
|
|
||||||
|
|
@ -1086,7 +1086,9 @@ nsMathMLElement::GetHrefURI() const
|
||||||
nsresult
|
nsresult
|
||||||
nsMathMLElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
nsMathMLElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
// It is important that this be done after the attribute is set/unset.
|
// It is important that this be done after the attribute is set/unset.
|
||||||
// We will need the updated attribute value because notifying the document
|
// We will need the updated attribute value because notifying the document
|
||||||
|
|
@ -1104,7 +1106,8 @@ nsMathMLElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsMathMLElementBase::AfterSetAttr(aNameSpaceID, aName, aValue,
|
return nsMathMLElementBase::AfterSetAttr(aNameSpaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSObject*
|
JSObject*
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -293,10 +293,12 @@ SVGAElement::IntrinsicState() const
|
||||||
nsresult
|
nsresult
|
||||||
SVGAElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
SVGAElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsIAtom* aPrefix, const nsAString& aValue,
|
nsIAtom* aPrefix, const nsAString& aValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify)
|
bool aNotify)
|
||||||
{
|
{
|
||||||
nsresult rv = SVGAElementBase::SetAttr(aNameSpaceID, aName, aPrefix,
|
nsresult rv = SVGAElementBase::SetAttr(aNameSpaceID, aName, aPrefix,
|
||||||
aValue, aNotify);
|
aValue, aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
|
|
||||||
// The ordering of the parent class's SetAttr call and Link::ResetLinkState
|
// The ordering of the parent class's SetAttr call and Link::ResetLinkState
|
||||||
// is important here! The attribute is not set until SetAttr returns, and
|
// is important here! The attribute is not set until SetAttr returns, and
|
||||||
|
|
|
||||||
|
|
@ -54,13 +54,11 @@ public:
|
||||||
virtual void GetLinkTarget(nsAString& aTarget) override;
|
virtual void GetLinkTarget(nsAString& aTarget) override;
|
||||||
virtual already_AddRefed<nsIURI> GetHrefURI() const override;
|
virtual already_AddRefed<nsIURI> GetHrefURI() const override;
|
||||||
virtual EventStates IntrinsicState() const override;
|
virtual EventStates IntrinsicState() const override;
|
||||||
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
|
||||||
const nsAString& aValue, bool aNotify)
|
using nsIContent::SetAttr;
|
||||||
{
|
|
||||||
return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
|
|
||||||
}
|
|
||||||
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsIAtom* aPrefix, const nsAString& aValue,
|
nsIAtom* aPrefix, const nsAString& aValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
|
||||||
|
|
@ -299,11 +299,14 @@ SVGAnimationElement::ParseAttribute(int32_t aNamespaceID,
|
||||||
nsresult
|
nsresult
|
||||||
SVGAnimationElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
SVGAnimationElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
nsresult rv =
|
nsresult rv =
|
||||||
SVGAnimationElementBase::AfterSetAttr(aNamespaceID, aName, aValue,
|
SVGAnimationElementBase::AfterSetAttr(aNamespaceID, aName, aValue,
|
||||||
aOldValue, aNotify);
|
aOldValue, aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
|
|
||||||
if (SVGTests::IsConditionalProcessingAttribute(aName)) {
|
if (SVGTests::IsConditionalProcessingAttribute(aName)) {
|
||||||
bool isDisabled = !SVGTests::PassesConditionalProcessingTests();
|
bool isDisabled = !SVGTests::PassesConditionalProcessingTests();
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
const nsAttrValue* GetAnimAttr(nsIAtom* aName) const;
|
const nsAttrValue* GetAnimAttr(nsIAtom* aName) const;
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,9 @@ SVGFEImageElement::IsAttributeMapped(const nsIAtom* name) const
|
||||||
nsresult
|
nsresult
|
||||||
SVGFEImageElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
SVGFEImageElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aName == nsGkAtoms::href &&
|
if (aName == nsGkAtoms::href &&
|
||||||
(aNamespaceID == kNameSpaceID_XLink ||
|
(aNamespaceID == kNameSpaceID_XLink ||
|
||||||
|
|
@ -139,7 +141,9 @@ SVGFEImageElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return SVGFEImageElementBase::AfterSetAttr(aNamespaceID, aName,
|
return SVGFEImageElementBase::AfterSetAttr(aNamespaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
nsIContent* aBindingParent,
|
nsIContent* aBindingParent,
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,9 @@ SVGGeometryElement::GetNumberInfo()
|
||||||
nsresult
|
nsresult
|
||||||
SVGGeometryElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
SVGGeometryElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (mCachedPath &&
|
if (mCachedPath &&
|
||||||
aNamespaceID == kNameSpaceID_None &&
|
aNamespaceID == kNameSpaceID_None &&
|
||||||
|
|
@ -44,7 +46,9 @@ SVGGeometryElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
mCachedPath = nullptr;
|
mCachedPath = nullptr;
|
||||||
}
|
}
|
||||||
return SVGGeometryElementBase::AfterSetAttr(aNamespaceID, aName,
|
return SVGGeometryElementBase::AfterSetAttr(aNamespaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,9 @@ SVGImageElement::AsyncEventRunning(AsyncEventDispatcher* aEvent)
|
||||||
nsresult
|
nsresult
|
||||||
SVGImageElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
SVGImageElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aName == nsGkAtoms::href &&
|
if (aName == nsGkAtoms::href &&
|
||||||
(aNamespaceID == kNameSpaceID_None ||
|
(aNamespaceID == kNameSpaceID_None ||
|
||||||
|
|
@ -169,7 +171,9 @@ SVGImageElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return SVGImageElementBase::AfterSetAttr(aNamespaceID, aName,
|
return SVGImageElementBase::AfterSetAttr(aNamespaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
nsIContent* aBindingParent,
|
nsIContent* aBindingParent,
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,9 @@ SVGScriptElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
nsresult
|
nsresult
|
||||||
SVGScriptElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
SVGScriptElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if ((aNamespaceID == kNameSpaceID_XLink ||
|
if ((aNamespaceID == kNameSpaceID_XLink ||
|
||||||
aNamespaceID == kNameSpaceID_None) &&
|
aNamespaceID == kNameSpaceID_None) &&
|
||||||
|
|
@ -219,7 +221,9 @@ SVGScriptElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
MaybeProcessScript();
|
MaybeProcessScript();
|
||||||
}
|
}
|
||||||
return SVGScriptElementBase::AfterSetAttr(aNamespaceID, aName,
|
return SVGScriptElementBase::AfterSetAttr(aNamespaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue,
|
||||||
|
aSubjectPrincipal,
|
||||||
|
aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ public:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual bool ParseAttribute(int32_t aNamespaceID,
|
virtual bool ParseAttribute(int32_t aNamespaceID,
|
||||||
nsIAtom* aAttribute,
|
nsIAtom* aAttribute,
|
||||||
|
|
|
||||||
|
|
@ -94,10 +94,11 @@ SVGStyleElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||||
nsresult
|
nsresult
|
||||||
SVGStyleElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
SVGStyleElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsIAtom* aPrefix, const nsAString& aValue,
|
nsIAtom* aPrefix, const nsAString& aValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify)
|
bool aNotify)
|
||||||
{
|
{
|
||||||
nsresult rv = SVGStyleElementBase::SetAttr(aNameSpaceID, aName, aPrefix,
|
nsresult rv = SVGStyleElementBase::SetAttr(aNameSpaceID, aName, aPrefix,
|
||||||
aValue, aNotify);
|
aValue, aSubjectPrincipal, aNotify);
|
||||||
if (NS_SUCCEEDED(rv) && aNameSpaceID == kNameSpaceID_None) {
|
if (NS_SUCCEEDED(rv) && aNameSpaceID == kNameSpaceID_None) {
|
||||||
if (aName == nsGkAtoms::title ||
|
if (aName == nsGkAtoms::title ||
|
||||||
aName == nsGkAtoms::media ||
|
aName == nsGkAtoms::media ||
|
||||||
|
|
|
||||||
|
|
@ -43,13 +43,11 @@ public:
|
||||||
bool aCompileEventHandlers) override;
|
bool aCompileEventHandlers) override;
|
||||||
virtual void UnbindFromTree(bool aDeep = true,
|
virtual void UnbindFromTree(bool aDeep = true,
|
||||||
bool aNullParent = true) override;
|
bool aNullParent = true) override;
|
||||||
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
|
||||||
const nsAString& aValue, bool aNotify)
|
using nsIContent::SetAttr;
|
||||||
{
|
|
||||||
return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
|
|
||||||
}
|
|
||||||
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
nsIAtom* aPrefix, const nsAString& aValue,
|
nsIAtom* aPrefix, const nsAString& aValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,9 @@ nsSVGElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
nsresult
|
nsresult
|
||||||
nsSVGElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
nsSVGElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
// We don't currently use nsMappedAttributes within SVG. If this changes, we
|
// We don't currently use nsMappedAttributes within SVG. If this changes, we
|
||||||
// need to be very careful because some nsAttrValues used by SVG point to
|
// need to be very careful because some nsAttrValues used by SVG point to
|
||||||
|
|
@ -312,7 +314,7 @@ nsSVGElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsSVGElementBase::AfterSetAttr(aNamespaceID, aName, aValue, aOldValue,
|
return nsSVGElementBase::AfterSetAttr(aNamespaceID, aName, aValue, aOldValue,
|
||||||
aNotify);
|
aSubjectPrincipal, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -1480,7 +1482,7 @@ nsSVGElement::DidChangeValue(nsIAtom* aName,
|
||||||
// attribute, but currently SVG elements do not even use the old attribute
|
// attribute, but currently SVG elements do not even use the old attribute
|
||||||
// value in |AfterSetAttr|, so this should be ok.
|
// value in |AfterSetAttr|, so this should be ok.
|
||||||
SetAttrAndNotify(kNameSpaceID_None, aName, nullptr, &aEmptyOrOldValue,
|
SetAttrAndNotify(kNameSpaceID_None, aName, nullptr, &aEmptyOrOldValue,
|
||||||
aNewValue, modType, hasListeners, kNotifyDocumentObservers,
|
aNewValue, nullptr, modType, hasListeners, kNotifyDocumentObservers,
|
||||||
kCallAfterSetAttr, document, updateBatch);
|
kCallAfterSetAttr, document, updateBatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -337,6 +337,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
virtual bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
|
virtual bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
|
||||||
const nsAString& aValue, nsAttrValue& aResult) override;
|
const nsAString& aValue, nsAttrValue& aResult) override;
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ interface AnonymousContent {
|
||||||
* Set the value of an attribute of an element inside this custom anonymous
|
* Set the value of an attribute of an element inside this custom anonymous
|
||||||
* content.
|
* content.
|
||||||
*/
|
*/
|
||||||
[Throws]
|
[NeedsSubjectPrincipal, Throws]
|
||||||
void setAttributeForElement(DOMString elementId,
|
void setAttributeForElement(DOMString elementId,
|
||||||
DOMString attributeName,
|
DOMString attributeName,
|
||||||
DOMString value);
|
DOMString value);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
interface Attr : Node {
|
interface Attr : Node {
|
||||||
readonly attribute DOMString localName;
|
readonly attribute DOMString localName;
|
||||||
[CEReactions, SetterThrows]
|
[CEReactions, NeedsSubjectPrincipal, SetterThrows]
|
||||||
attribute DOMString value;
|
attribute DOMString value;
|
||||||
|
|
||||||
[Constant]
|
[Constant]
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,9 @@ interface Element : Node {
|
||||||
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
|
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
|
||||||
[CEReactions, Throws]
|
[CEReactions, Throws]
|
||||||
boolean toggleAttribute(DOMString name, optional boolean force);
|
boolean toggleAttribute(DOMString name, optional boolean force);
|
||||||
[CEReactions, Throws]
|
[CEReactions, NeedsSubjectPrincipal, Throws]
|
||||||
void setAttribute(DOMString name, DOMString value);
|
void setAttribute(DOMString name, DOMString value);
|
||||||
[CEReactions, Throws]
|
[CEReactions, NeedsSubjectPrincipal, Throws]
|
||||||
void setAttributeNS(DOMString? namespace, DOMString name, DOMString value);
|
void setAttributeNS(DOMString? namespace, DOMString name, DOMString value);
|
||||||
[CEReactions, Throws]
|
[CEReactions, Throws]
|
||||||
void removeAttribute(DOMString name);
|
void removeAttribute(DOMString name);
|
||||||
|
|
|
||||||
|
|
@ -1046,7 +1046,9 @@ nsXULElement::BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
nsresult
|
nsresult
|
||||||
nsXULElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
nsXULElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue, bool aNotify)
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
|
bool aNotify)
|
||||||
{
|
{
|
||||||
if (aNamespaceID == kNameSpaceID_None) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
if (aValue) {
|
if (aValue) {
|
||||||
|
|
@ -1167,7 +1169,7 @@ nsXULElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsStyledElement::AfterSetAttr(aNamespaceID, aName,
|
return nsStyledElement::AfterSetAttr(aNamespaceID, aName,
|
||||||
aValue, aOldValue, aNotify);
|
aValue, aOldValue, aSubjectPrincipal, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -628,6 +628,7 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue,
|
const nsAttrValue* aValue,
|
||||||
const nsAttrValue* aOldValue,
|
const nsAttrValue* aOldValue,
|
||||||
|
nsIPrincipal* aSubjectPrincipal,
|
||||||
bool aNotify) override;
|
bool aNotify) override;
|
||||||
|
|
||||||
virtual void UpdateEditableState(bool aNotify) override;
|
virtual void UpdateEditableState(bool aNotify) override;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue