Bug 1334051 - Part 1: Include namespace in attributeChangedCallback.

Per spec [1], we should include namesapce in attributeChangedCallback argurment list.
[1] https://html.spec.whatwg.org/multipage/custom-elements.html#concept-upgrade-an-element, step 3

Tag UXP Issue #1344
This commit is contained in:
Gaming4JC 2020-01-05 11:25:37 -05:00 committed by Roy Tam
commit 4408e19e96
4 changed files with 15 additions and 4 deletions

View file

@ -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(