Cloning XMLDoc's with HTML5 nodeName's breaks on IE
|Reported by:||adebree||Owned by:|
var xmlStr = "<root><meter /></root>"; var xmlDoc = jQuery.parseXML( xmlStr ); var $xmlDoc = jQuery( xmlDoc ); var $meter = $xmlDoc.find( "meter" ).clone();
Due to "meter" being in the list of HTML5 nodeNames jQuery incorrectly uses the shimCloneNode() function for cloning. This results in $meter being a textNode (nodeType 3) and having the data 'undefined'.
And since the regex to detect the node names is only checking the start of the node name this also causes problems for elements in a HTMLDoc like <metering />
Patch is already done, will place a pull request.
Change History (6)
comment:3 Changed 4 years ago by timmywil
- Component changed from unfiled to manipulation
- Priority changed from undecided to low
- Status changed from new to open
comment:5 Changed 4 years ago by Arne de Bree
- Resolution set to fixed
- Status changed from open to closed