aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2014-04-30 10:43:39 -0400
committerDave Methvin <dave.methvin@gmail.com>2014-04-30 10:46:26 -0400
commitb8133e282ceebf502c7c08d849b176a929c9c450 (patch)
tree4f3203dedb46729cdf59a0fa44eaf759f3f1f33f /test
parentc34dbf5a8d135e0f873ab7a76d1c8f8e316f31e4 (diff)
downloadjquery-b8133e282ceebf502c7c08d849b176a929c9c450.tar.gz
jquery-b8133e282ceebf502c7c08d849b176a929c9c450.zip
Data: Work around IE11 bug with onpageshow attribute
Fixes #14894
Diffstat (limited to 'test')
-rw-r--r--test/data/data/dataAttrs.html16
-rw-r--r--test/unit/data.js6
2 files changed, 22 insertions, 0 deletions
diff --git a/test/data/data/dataAttrs.html b/test/data/data/dataAttrs.html
new file mode 100644
index 000000000..5e6e442a6
--- /dev/null
+++ b/test/data/data/dataAttrs.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>IE11 onpageshow strangeness (#14894)</title>
+ <script src="../../jquery.js"></script>
+ <script>
+ $(function(){
+ window.parent.iframeCallback( $( "body" ).data().result );
+ });
+ </script>
+</head>
+<body x-what="test" data-result="ok" onload="x=1" onpageshow="x=1">
+ Test for #14894
+</body>
+</html>
diff --git a/test/unit/data.js b/test/unit/data.js
index b63c79b92..d3ae818ed 100644
--- a/test/unit/data.js
+++ b/test/unit/data.js
@@ -801,3 +801,9 @@ test("Check proper data removal of non-element descendants nodes (#8335)", 1, fu
ok( !text.data("test"), "Be sure data is not stored in non-element" );
});
+
+testIframeWithCallback( "enumerate data attrs on body (#14894)", "data/dataAttrs.html", function( result ) {
+ expect(1);
+
+ equal(result, "ok", "enumeration of data- attrs on body" );
+}); \ No newline at end of file