Skip to content

Commit b779831

Browse files
committed
Core: revert addition of createHTMLDocument. Thanks, Safari 8.
- Safari 8 has issues when the HTML string contains forms. Closing tags are not respected.
1 parent 4ab7431 commit b779831

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

src/core/parseHTML.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ jQuery.parseHTML = function( data, context, keepScripts ) {
1717
keepScripts = context;
1818
context = false;
1919
}
20-
// document.implementation stops scripts or inline event handlers from
21-
// being executed immediately
22-
context = context || document.implementation.createHTMLDocument( "" );
20+
context = context || document;
2321

2422
var parsed = rsingleTag.exec( data ),
2523
scripts = !keepScripts && [];

test/unit/core.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,20 +1370,6 @@ test("jQuery.parseHTML", function() {
13701370
ok( jQuery.parseHTML("<#if><tr><p>This is a test.</p></tr><#/if>") || true, "Garbage input should not cause error" );
13711371
});
13721372

1373-
asyncTest("jQuery.parseHTML", function() {
1374-
expect ( 1 );
1375-
1376-
Globals.register("parseHTMLError");
1377-
1378-
jQuery.globalEval("parseHTMLError = false;");
1379-
jQuery.parseHTML( "<img src=x onerror='parseHTMLError = true'>" );
1380-
1381-
window.setTimeout(function() {
1382-
start();
1383-
equal( window.parseHTMLError, false, "onerror eventhandler has not been called." );
1384-
}, 2000);
1385-
});
1386-
13871373
test("jQuery.parseJSON", function() {
13881374
expect( 20 );
13891375

0 commit comments

Comments
 (0)