Permalink
Browse files

Core: remove unnecessary support test for createHTMLDocument

  • Loading branch information...
timmywil committed Dec 9, 2014
1 parent 6051609 commit 59232825aa87b941dd2418a6860b64017dfec0ae
Showing with 13 additions and 36 deletions.
  1. +1 −1 src/core.js
  2. +2 −5 src/core/parseHTML.js
  3. +0 −8 src/core/support.js
  4. +10 −14 test/unit/core.js
  5. +0 −8 test/unit/support.js
View
@@ -7,7 +7,7 @@ define([
"./var/class2type", "./var/class2type",
"./var/toString", "./var/toString",
"./var/hasOwn", "./var/hasOwn",
"./core/support" "./var/support"
], function( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) { ], function( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) {
var var
View
@@ -1,10 +1,9 @@
define([ define([
"../core", "../core",
"./var/rsingleTag", "./var/rsingleTag",
"./support",
"../manipulation" // buildFragment "../manipulation" // buildFragment
], function( jQuery, rsingleTag, support ) { ], function( jQuery, rsingleTag ) {
// data: string of html // data: string of html
// context (optional): If specified, the fragment will be created in this context, // context (optional): If specified, the fragment will be created in this context,
@@ -20,9 +19,7 @@ jQuery.parseHTML = function( data, context, keepScripts ) {
} }
// document.implementation stops scripts or inline event handlers from // document.implementation stops scripts or inline event handlers from
// being executed immediately // being executed immediately
context = context || ( support.createHTMLDocument ? context = context || document.implementation.createHTMLDocument();
document.implementation.createHTMLDocument() :
document );
var parsed = rsingleTag.exec( data ), var parsed = rsingleTag.exec( data ),
scripts = !keepScripts && []; scripts = !keepScripts && [];
View

This file was deleted.

Oops, something went wrong.
View
@@ -1370,23 +1370,19 @@ test("jQuery.parseHTML", function() {
ok( jQuery.parseHTML("<#if><tr><p>This is a test.</p></tr><#/if>") || true, "Garbage input should not cause error" ); ok( jQuery.parseHTML("<#if><tr><p>This is a test.</p></tr><#/if>") || true, "Garbage input should not cause error" );
}); });
// This XSS test is optional, as it will only pass when `document.implementation.createHTMLDocument` asyncTest("jQuery.parseHTML", function() {
// is implemented. This might not be the case for older Android browsers (<= 2.x). expect ( 1 );
if ( document.implementation.createHTMLDocument ) {
asyncTest("jQuery.parseHTML", function() {
expect ( 1 );
Globals.register("parseHTMLError"); Globals.register("parseHTMLError");
jQuery.globalEval("parseHTMLError = false;"); jQuery.globalEval("parseHTMLError = false;");
jQuery.parseHTML( "<img src=x onerror='parseHTMLError = true'>" ); jQuery.parseHTML( "<img src=x onerror='parseHTMLError = true'>" );
window.setTimeout(function() { window.setTimeout(function() {
start(); start();
equal( window.parseHTMLError, false, "onerror eventhandler has not been called." ); equal( window.parseHTMLError, false, "onerror eventhandler has not been called." );
}, 2000); }, 2000);
}); });
}
test("jQuery.parseJSON", function() { test("jQuery.parseJSON", function() {
expect( 20 ); expect( 20 );
View
@@ -61,7 +61,6 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"checkOn": true, "checkOn": true,
"clearCloneStyle": true, "clearCloneStyle": true,
"cors": true, "cors": true,
"createHTMLDocument": true,
"focusinBubbles": false, "focusinBubbles": false,
"noCloneChecked": true, "noCloneChecked": true,
"optDisabled": true, "optDisabled": true,
@@ -78,7 +77,6 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"checkOn": true, "checkOn": true,
"clearCloneStyle": false, "clearCloneStyle": false,
"cors": true, "cors": true,
"createHTMLDocument": true,
"focusinBubbles": true, "focusinBubbles": true,
"noCloneChecked": false, "noCloneChecked": false,
"optDisabled": true, "optDisabled": true,
@@ -95,7 +93,6 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"checkOn": true, "checkOn": true,
"clearCloneStyle": false, "clearCloneStyle": false,
"cors": false, "cors": false,
"createHTMLDocument": true,
"focusinBubbles": true, "focusinBubbles": true,
"noCloneChecked": false, "noCloneChecked": false,
"optDisabled": true, "optDisabled": true,
@@ -112,7 +109,6 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"checkOn": true, "checkOn": true,
"clearCloneStyle": true, "clearCloneStyle": true,
"cors": true, "cors": true,
"createHTMLDocument": true,
"focusinBubbles": false, "focusinBubbles": false,
"noCloneChecked": true, "noCloneChecked": true,
"optDisabled": true, "optDisabled": true,
@@ -129,7 +125,6 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"checkOn": true, "checkOn": true,
"clearCloneStyle": true, "clearCloneStyle": true,
"cors": true, "cors": true,
"createHTMLDocument": true,
"focusinBubbles": false, "focusinBubbles": false,
"noCloneChecked": true, "noCloneChecked": true,
"optDisabled": true, "optDisabled": true,
@@ -146,7 +141,6 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"checkOn": true, "checkOn": true,
"clearCloneStyle": true, "clearCloneStyle": true,
"cors": true, "cors": true,
"createHTMLDocument": true,
"focusinBubbles": false, "focusinBubbles": false,
"noCloneChecked": true, "noCloneChecked": true,
"optDisabled": true, "optDisabled": true,
@@ -163,7 +157,6 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"checkOn": false, "checkOn": false,
"clearCloneStyle": true, "clearCloneStyle": true,
"cors": true, "cors": true,
"createHTMLDocument": true,
"focusinBubbles": false, "focusinBubbles": false,
"noCloneChecked": true, "noCloneChecked": true,
"optDisabled": true, "optDisabled": true,
@@ -180,7 +173,6 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"checkOn": false, "checkOn": false,
"clearCloneStyle": false, "clearCloneStyle": false,
"cors": true, "cors": true,
"createHTMLDocument": true,
"focusinBubbles": false, "focusinBubbles": false,
"noCloneChecked": true, "noCloneChecked": true,
"optDisabled": false, "optDisabled": false,

0 comments on commit 5923282

Please sign in to comment.