From e922a71604fb57146c1909b4ffe002d66462d7c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Mon, 19 Feb 2024 18:31:08 +0200 Subject: [PATCH] Return the old attribute value when swapping even if it has a namespace. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently this will always "swap" the value with NULL since it gets reset, and the element's SetAttrAndNotify uses the swapped value as the oldValue for mutation observer notifications, so it's always NULL, which does not match IE. Signed-off-by: Gabriel Ivăncescu --- dom/base/nsAttrAndChildArray.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/dom/base/nsAttrAndChildArray.cpp b/dom/base/nsAttrAndChildArray.cpp index c1e360d36c0..4013aef3df0 100644 --- a/dom/base/nsAttrAndChildArray.cpp +++ b/dom/base/nsAttrAndChildArray.cpp @@ -427,7 +427,6 @@ nsAttrAndChildArray::SetAndSwapAttr(mozilla::dom::NodeInfo* aName, nsAttrValue& for (i = 0; i < slotCount && AttrSlotIsTaken(i); ++i) { if (ATTRS(mImpl)[i].mName.Equals(localName, namespaceID)) { ATTRS(mImpl)[i].mName.SetTo(aName); - ATTRS(mImpl)[i].mValue.Reset(); ATTRS(mImpl)[i].mValue.SwapValueWith(aValue); return NS_OK;