From 2cdd48f8192de707ff0e768af8845451f8b818a9 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sat, 25 Jan 2020 09:05:21 -0500 Subject: [PATCH] Bug 1430034 - Fix attributeChangedCallback isn't fired with correct newValue when the attribute value is an empty string; Tag UXP Issue #1344 --- dom/base/CustomElementRegistry.cpp | 2 +- .../attribute-changed-callback.html | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp index 4fb18381fa..47601aabb0 100644 --- a/dom/base/CustomElementRegistry.cpp +++ b/dom/base/CustomElementRegistry.cpp @@ -909,7 +909,7 @@ CustomElementRegistry::Upgrade(Element* aElement, LifecycleCallbackArgs args = { nsDependentAtomString(attrName), NullString(), - (attrValue.IsEmpty() ? NullString() : attrValue), + attrValue, (namespaceURI.IsEmpty() ? NullString() : namespaceURI) }; nsContentUtils::EnqueueLifecycleCallback(nsIDocument::eAttributeChanged, diff --git a/testing/web-platform/tests/custom-elements/attribute-changed-callback.html b/testing/web-platform/tests/custom-elements/attribute-changed-callback.html index bd467912b9..5090bfbfbf 100644 --- a/testing/web-platform/tests/custom-elements/attribute-changed-callback.html +++ b/testing/web-platform/tests/custom-elements/attribute-changed-callback.html @@ -11,6 +11,7 @@
+