summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dom/base/CustomElementRegistry.cpp2
-rw-r--r--dom/base/CustomElementRegistry.h1
-rw-r--r--dom/base/Element.cpp11
-rw-r--r--dom/webidl/WebComponents.webidl5
4 files changed, 15 insertions, 4 deletions
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp
index e619ad599..cc6264b03 100644
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -52,7 +52,7 @@ CustomElementCallback::Call()
break;
case nsIDocument::eAttributeChanged:
static_cast<LifecycleAttributeChangedCallback *>(mCallback.get())->Call(mThisObject,
- mArgs.name, mArgs.oldValue, mArgs.newValue, rv);
+ mArgs.name, mArgs.oldValue, mArgs.newValue, mArgs.namespaceURI, rv);
break;
}
}
diff --git a/dom/base/CustomElementRegistry.h b/dom/base/CustomElementRegistry.h
index c45f3f70c..b5903f978 100644
--- a/dom/base/CustomElementRegistry.h
+++ b/dom/base/CustomElementRegistry.h
@@ -34,6 +34,7 @@ struct LifecycleCallbackArgs
nsString name;
nsString oldValue;
nsString newValue;
+ nsString namespaceURI;
};
class CustomElementCallback
diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp
index 81cc41210..247fbe79e 100644
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -2590,11 +2590,15 @@ Element::SetAttrAndNotify(int32_t aNamespaceID,
if (ownerDoc && GetCustomElementData()) {
nsCOMPtr<nsIAtom> oldValueAtom = oldValue->GetAsAtom();
nsCOMPtr<nsIAtom> newValueAtom = valueForAfterSetAttr.GetAsAtom();
+ nsAutoString ns;
+ nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNamespaceID, ns);
+
LifecycleCallbackArgs args = {
nsDependentAtomString(aName),
aModType == nsIDOMMutationEvent::ADDITION ?
NullString() : nsDependentAtomString(oldValueAtom),
- nsDependentAtomString(newValueAtom)
+ nsDependentAtomString(newValueAtom),
+ (ns.IsEmpty() ? NullString() : ns)
};
nsContentUtils::EnqueueLifecycleCallback(
@@ -2845,11 +2849,14 @@ Element::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aName,
nsIDocument* ownerDoc = OwnerDoc();
if (ownerDoc && GetCustomElementData()) {
+ nsAutoString ns;
+ nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNameSpaceID, ns);
nsCOMPtr<nsIAtom> oldValueAtom = oldValue.GetAsAtom();
LifecycleCallbackArgs args = {
nsDependentAtomString(aName),
nsDependentAtomString(oldValueAtom),
- NullString()
+ NullString(),
+ (ns.IsEmpty() ? NullString() : ns)
};
nsContentUtils::EnqueueLifecycleCallback(
diff --git a/dom/webidl/WebComponents.webidl b/dom/webidl/WebComponents.webidl
index 3dfb960bc..19ca38c0d 100644
--- a/dom/webidl/WebComponents.webidl
+++ b/dom/webidl/WebComponents.webidl
@@ -13,7 +13,10 @@
callback LifecycleCreatedCallback = void();
callback LifecycleAttachedCallback = void();
callback LifecycleDetachedCallback = void();
-callback LifecycleAttributeChangedCallback = void(DOMString attrName, DOMString? oldValue, DOMString? newValue);
+callback LifecycleAttributeChangedCallback = void(DOMString attrName,
+ DOMString? oldValue,
+ DOMString? newValue,
+ DOMString? namespaceURI);
dictionary LifecycleCallbacks {
LifecycleCreatedCallback? createdCallback;