Skip to content

Return the old attribute value when swapping even if it has a namespace.

Gabriel Ivăncescu requested to merge insn/wine-gecko:attr-oldval into master

From an element's SetAttr (in dom/base/Element.cpp), eventually SetAttrAndNotify ends up called to notify the observers. It uses SetAndSwapAttr to assign the value to the attribute and obtain (swap) with the old one. This works fine for the case where there's no namespace. When there's a namespace, it goes to the path that obtains the NodeInfo first before calling SetAndSwapAttr. Which is basically nsAttrAndChildArray::SetAndSwapAttr in dom/base/nsAttrAndChildArray.cpp with a NodeInfo as first arg, which has a namespace. For whatever reason, in this particular case, it calls Reset() on the value which empties it before swapping so the oldValue is always null.

Merge request reports

Loading