summaryrefslogtreecommitdiffstats
path: root/dom/base/test/test_xbl_userdata.xhtml
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/base/test/test_xbl_userdata.xhtml
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/base/test/test_xbl_userdata.xhtml')
-rw-r--r--dom/base/test/test_xbl_userdata.xhtml56
1 files changed, 56 insertions, 0 deletions
diff --git a/dom/base/test/test_xbl_userdata.xhtml b/dom/base/test/test_xbl_userdata.xhtml
new file mode 100644
index 000000000..852298853
--- /dev/null
+++ b/dom/base/test/test_xbl_userdata.xhtml
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Test for getUserData/setUserData support in XBL</title>
+ <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+
+<style type="text/css">
+#t {
+-moz-binding: url(#xbl);
+}
+</style>
+
+<bindings xmlns="http://www.mozilla.org/xbl">
+<binding id="xbl" inheritstyle="false">
+<implementation><constructor><![CDATA[
+ this.textContent = !!(this.getUserData && this.setUserData);
+]]></constructor></implementation>
+</binding>
+</bindings>
+
+</head>
+<body>
+<p id="display"></p>
+
+<pre id="test">
+<script class="testbody">
+<![CDATA[
+"use strict";
+
+var url = 'data:text/html;charset=utf-8,' +
+ encodeURIComponent('<div id=t style="-moz-binding:url(' + location + '#xbl)"></div>');
+
+SimpleTest.waitForExplicitFinish();
+addLoadEvent(test1);
+
+function test1() {
+ var iframe = document.createElement('iframe');
+ iframe.src = url;
+ iframe.onload = function() {
+ var t = iframe.contentWindow.t;
+ is(!!(t.getUserData || t.setUserData), false,
+ "getUserData and setUserData should not be visible from the regular content");
+ is(t.textContent, "true",
+ "getUserData and setUserData should be visible from XBL");
+ document.body.removeChild(iframe);
+ SimpleTest.finish();
+ };
+ document.body.appendChild(iframe);
+}
+
+]]>
+</script>
+</pre>
+</body>
+</html>