Creating custom elements is broken on IE7 and 8 using $('<...>').
|Reported by:||bmustiata||Owned by:||Rick Waldron|
Description (last modified by )
Fiddle test case: http://jsfiddle.net/nmfCy/1/
Full-Patched : http://download.androidknight.com/jquery-1.6.4-patched.js
Description. The expected nodes to be added is: <customelement>
However in IE7/8 (IE9 works fine) two elements get created after innerHtml is set: <customelement>
</customelement> (!!) - yes, with the beginning slash character as tagName,
and all the content that should belong in the <customelement> is now a sibling living between the two elements.
This needs to work, since the HTML5 elements do match the criteria of unknown elements, and creating them programatically now breaks the DOM structure in IE7/8 (same example but with a canvas element instead: http://jsfiddle.net/nmfCy/2/).
To make matters worse the added elements (via innerHtml) are unknown html elements, that do not allow creating child elements into them.
However, if we create the same element with document.createElement('customelement') and we append this one to the DOM, we can add children elements into it.
The given patch adds the check for custom elements support, and if it does not exists, it then attempts to find and fix the eventually broken newly created custom elements (in the clean method).
The patch was tested against IE7, IE8, IE9, Chrome 14.0 and Firefox 7.0.1.
Change History (20)
comment:4 Changed 6 years ago by
|Component:||unfiled → manipulation|
|Milestone:||None → 1.8|
|Status:||closed → reopened|