diff options
Diffstat (limited to 'testing/web-platform/tests/html/dom/elements/global-attributes/dataset-prototype.html')
-rw-r--r-- | testing/web-platform/tests/html/dom/elements/global-attributes/dataset-prototype.html | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-prototype.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-prototype.html new file mode 100644 index 0000000000..6b16618461 --- /dev/null +++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-prototype.html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> + <head> + <title>Dataset - element.dataset is an instance of DOMStringMap</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <h1>Dataset - element.dataset is an instance of DOMStringMap</h1> + <div id="log"></div> + <script> + test(function() { assert_true(document.createElement("div").dataset instanceof window.DOMStringMap); }, + "An elements dataset property is an instance of a DOMStringMap"); + test(function() { + var dataset = document.createElement("div").dataset; + assert_true("toString" in dataset, '"toString" in dataset'); + assert_equals(dataset.toString, Object.prototype.toString); + assert_false("expando" in dataset, '"expando" in dataset'); + assert_equals(dataset.expando, undefined); + Object.prototype.expando = 42; + assert_true("expando" in dataset, '"expando" in dataset'); + assert_equals(dataset.expando, 42); + }, "Properties on Object.prototype should shine through."); + </script> + </body> +</html> |