mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Landing pull request 490. 1.7 HTML5 Support for innerHTML, clone & style. Fixes #6485.
More Details: - https://github.com/jquery/jquery/pull/490 - http://bugs.jquery.com/ticket/6485
This commit is contained in:
@@ -20,7 +20,23 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
|
||||
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
|
||||
area: [ 1, "<map>", "</map>" ],
|
||||
_default: [ 0, "", "" ]
|
||||
};
|
||||
},
|
||||
safeFragment = (function() {
|
||||
var nodeNames = (
|
||||
"abbr article aside audio canvas datalist details figcaption figure footer " +
|
||||
"header hgroup mark meter nav output progress section summary time video"
|
||||
).split( " " ),
|
||||
safeFrag = document.createDocumentFragment();
|
||||
|
||||
if ( safeFrag.createElement ) {
|
||||
while ( nodeNames.length ) {
|
||||
safeFrag.createElement(
|
||||
nodeNames.pop()
|
||||
);
|
||||
}
|
||||
}
|
||||
return safeFrag;
|
||||
})();
|
||||
|
||||
wrapMap.optgroup = wrapMap.option;
|
||||
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
|
||||
@@ -625,6 +641,9 @@ jQuery.extend({
|
||||
depth = wrap[0],
|
||||
div = context.createElement("div");
|
||||
|
||||
// Append wrapper element to unknown element safe doc fragment
|
||||
safeFragment.appendChild( div );
|
||||
|
||||
// Go to html and back, then peel off extra wrappers
|
||||
div.innerHTML = wrap[1] + elem + wrap[2];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user