aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authortimmywil <timmywillisn@gmail.com>2012-06-19 11:35:45 -0400
committertimmywil <timmywillisn@gmail.com>2012-06-19 11:35:45 -0400
commit7692ae419d4c19bd06a0ba01fc2af8d21035873c (patch)
tree6ed28d4e9d8a0e362deee6a86c637a9a2c84d03e /test
parent868a9cea08579ae635ce258aed3062705a8d2379 (diff)
downloadjquery-7692ae419d4c19bd06a0ba01fc2af8d21035873c.tar.gz
jquery-7692ae419d4c19bd06a0ba01fc2af8d21035873c.zip
When detecting html in init, ignore html characters within quotes, brackets, and parens as well as escaped characters which are valid in selectors. Fixes #11290.
Diffstat (limited to 'test')
-rw-r--r--test/unit/core.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index 9950228e8..0b392adf1 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -605,7 +605,7 @@ test("isWindow", function() {
});
test("jQuery('html')", function() {
- expect(18);
+ expect( 22 );
QUnit.reset();
jQuery.foo = false;
@@ -638,6 +638,11 @@ test("jQuery('html')", function() {
ok( jQuery("<div></div>")[0], "Create a div with closing tag." );
ok( jQuery("<table></table>")[0], "Create a table with closing tag." );
+ equal( jQuery("element[attribute='<div></div>']").length, 0, "When html is within brackets, do not recognize as html." );
+ equal( jQuery("element[attribute=<div></div>]").length, 0, "When html is within brackets, do not recognize as html." );
+ equal( jQuery("element:not(<div></div>)").length, 0, "When html is within parens, do not recognize as html." );
+ equal( jQuery("\\<div\\>").length, 0, "Ignore escaped html characters" );
+
// Test very large html string #7990
var i;
var li = "<li>very large html string</li>";