From 4281f3eea36d29b443f7b5f0168ad9591bd4b3a5 Mon Sep 17 00:00:00 2001 From: Edgar Chen Date: Mon, 15 Jan 2018 15:24:41 +0800 Subject: [PATCH] Bug 1430034 - Fix attributeChangedCallback isn't fired with correct newValue when the attribute value is an empty string; r=smaug MozReview-Commit-ID: L3RvNPNDfUC --HG-- extra : rebase_source : dbe1d825beaec044ebb91d00a45b6feececfc46b --- dom/base/CustomElementRegistry.cpp | 2 +- testing/web-platform/meta/MANIFEST.json | 2 +- .../attribute-changed-callback.html | 31 +++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp index 213c3ef51749..617fe6b6c7b7 100644 --- a/dom/base/CustomElementRegistry.cpp +++ b/dom/base/CustomElementRegistry.cpp @@ -934,7 +934,7 @@ CustomElementRegistry::Upgrade(Element* aElement, LifecycleCallbackArgs args = { nsDependentAtomString(attrName), VoidString(), - (attrValue.IsEmpty() ? VoidString() : attrValue), + attrValue, (namespaceURI.IsEmpty() ? VoidString() : namespaceURI) }; nsContentUtils::EnqueueLifecycleCallback(nsIDocument::eAttributeChanged, diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index ec75df3790bb..701c9f098ee6 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -529241,7 +529241,7 @@ "testharness" ], "custom-elements/attribute-changed-callback.html": [ - "1ad26231aa638a0e0f9b76d77bdd93a3712dda98", + "320fb2bb26e7495d0829c39c113df3ea7ec1f4ef", "testharness" ], "custom-elements/connected-callbacks.html": [ 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 bd467912b999..5090bfbfbfec 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 @@
+