Permalink
Browse files

Manipulation: don't test data-URI with script element in IE8

Since, apparently, it doesn't support it. Couldn't find more relevant info
then this - http://msdn.microsoft.com/en-us/library/cc848897(v=vs.85).aspx

No guard for older IE, since support for them will be removed soon anyway
  • Loading branch information...
markelog committed Dec 3, 2014
1 parent bc1902d commit 503e54564a8a88b7e968b64a920f2eeceffb0b74
Showing with 12 additions and 8 deletions.
  1. +12 −8 test/unit/manipulation.js
View
@@ -2462,11 +2462,15 @@ test( "Make sure jQuery.fn.remove can work on elements in documentFragment", 1,
equal( fragment.childNodes.length, 0, "div element was removed from documentFragment" );
});
-asyncTest( "Insert script with data-URI (gh-1887)", 1, function() {
- Globals.register( "testFoo" );
- jQuery( "#qunit-fixture" ).append( "<script src=\"data:text/javascript,testFoo = 'foo';\"></script>" );
- setTimeout(function (){
- strictEqual( window[ "testFoo" ], "foo", "data-URI script executed" );
- start();
- }, 100 );
-});
+// IE8 doesn't support data-URI in src attribute of script element
+// Relevant - http://msdn.microsoft.com/en-us/library/cc848897(v=vs.85).aspx
+if ( !/msie 8\.0/i.test( navigator.userAgent ) ) {
+ asyncTest( "Insert script with data-URI (gh-1887)", 1, function() {
+ Globals.register( "testFoo" );
+ jQuery( "#qunit-fixture" ).append( "<script src=\"data:text/javascript,testFoo = 'foo';\"></script>" );
+ setTimeout(function (){
+ strictEqual( window[ "testFoo" ], "foo", "data-URI script executed" );
+ start();
+ }, 100 );
+ });
+}

3 comments on commit 503e545

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Dec 4, 2014

Member

This test also fails in Android 2.3 although it supports data-URIs; not sure if it just doesn't support them in scripts.

Member

mgol replied Dec 4, 2014

This test also fails in Android 2.3 although it supports data-URIs; not sure if it just doesn't support them in scripts.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Dec 4, 2014

Member

Actually, it fails in most Android Browsers:
http://swarm.jquery.org/job/3915
http://swarm.jquery.org/job/3914

It's weird that it fails in Android 4.2 only in one branch.

Member

mgol replied Dec 4, 2014

Actually, it fails in most Android Browsers:
http://swarm.jquery.org/job/3915
http://swarm.jquery.org/job/3914

It's weird that it fails in Android 4.2 only in one branch.

@markelog

This comment has been minimized.

Show comment
Hide comment
@markelog

markelog Dec 5, 2014

Member

Probably the same thing as with IE8 since data-uri in test is valid, so like you said:

doesn't support them in scripts.

Need to add a additional guard for them

Member

markelog replied Dec 5, 2014

Probably the same thing as with IE8 since data-uri in test is valid, so like you said:

doesn't support them in scripts.

Need to add a additional guard for them

Please sign in to comment.