using importNode on XML document will lead to unpredictable stripping of attributes: Testcase: var oXml = new DOMParser().parseFromString('<div newAttr="Hello World"></div>', 'text/xml'); var oDiv = document.importNode(oXml.documentElement, true); alert(oDiv.getAttribute('newAttr') == 'Hello World');
Created attachment 17123 [details] Testcase
See <http://bugs.webkit.org/show_bug.cgi?id=15276#c22> for a workaround. *** This bug has been marked as a duplicate of 12187 ***