Skip to content

Commit 6a4672c

Browse files
committed
Core: Remove inline check for createHTMLDocument, add to 'support'
See #1505 (comment)
1 parent adec44f commit 6a4672c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/core/parseHTML.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ define([
22
"../core",
33
"./var/rsingleTag",
44
"../manipulation" // buildFragment
5-
], function( jQuery, rsingleTag ) {
5+
], function( jQuery, rsingleTag, support ) {
66

77
// data: string of html
88
// context (optional): If specified, the fragment will be created in this context,
@@ -16,8 +16,9 @@ jQuery.parseHTML = function( data, context, keepScripts ) {
1616
keepScripts = context;
1717
context = false;
1818
}
19-
// document.implementation stops scripts or inline event handlers from being executed immediately
20-
context = context || ( jQuery.isFunction( document.implementation.createHTMLDocument ) ?
19+
// document.implementation stops scripts or inline event handlers from
20+
// being executed immediately
21+
context = context || ( support.createHTMLDocument ?
2122
document.implementation.createHTMLDocument() :
2223
document );
2324

src/var/support.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
define(function() {
22
// All support tests are defined in their respective modules.
3-
return {};
3+
return {
4+
createHTMLDocument: jQuery.isFunction( document.implementation.createHTMLDocument )
5+
};
46
});

0 commit comments

Comments
 (0)