Creating custom elements is broken on IE7 and 8 using $('<...>').
|Reported by:||bmustiata||Owned by:||rwaldron|
Description (last modified by rwaldron)
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:1 Changed 5 years ago by ajpiano
- Resolution set to duplicate
- Status changed from new to closed
comment:4 Changed 5 years ago by ajpiano
- Component changed from unfiled to manipulation
- Keywords 1.8-discuss added
- Milestone changed from None to 1.8
- Resolution duplicate deleted
- Status changed from closed to reopened
comment:13 Changed 5 years ago by rwaldron
- Owner set to rwaldron
- Status changed from open to assigned
comment:19 Changed 5 years ago by rwaldron
- Resolution set to invalid
- Status changed from assigned to closed