Core: re-introduce createHTMLDocument in parseHTML; Safari 8 left out

Close gh-1505
This commit is contained in:
Timmy Willison
2014-12-10 09:48:55 -05:00
parent 8653068dd6
commit cfe468f29c
5 changed files with 67 additions and 6 deletions

View File

@@ -235,7 +235,7 @@ test( "globalEval execution after script injection (#7862)", 1, function() {
});
// This is not run in AMD mode
if (jQuery.noConflict) {
if ( jQuery.noConflict ) {
test("noConflict", function() {
expect(7);
@@ -1370,6 +1370,22 @@ test("jQuery.parseHTML", function() {
ok( jQuery.parseHTML("<#if><tr><p>This is a test.</p></tr><#/if>") || true, "Garbage input should not cause error" );
});
if ( jQuery.support.createHTMLDocument ) {
asyncTest("jQuery.parseHTML", function() {
expect ( 1 );
Globals.register("parseHTMLError");
jQuery.globalEval("parseHTMLError = false;");
jQuery.parseHTML( "<img src=x onerror='parseHTMLError = true'>" );
window.setTimeout(function() {
start();
equal( window.parseHTMLError, false, "onerror eventhandler has not been called." );
}, 2000);
});
}
test("jQuery.parseJSON", function() {
expect( 20 );