summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/text-level-semantics/the-data-element
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 /testing/web-platform/tests/html/semantics/text-level-semantics/the-data-element
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 'testing/web-platform/tests/html/semantics/text-level-semantics/the-data-element')
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-data-element/data.value-001.html66
1 files changed, 66 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-data-element/data.value-001.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-data-element/data.value-001.html
new file mode 100644
index 000000000..9fc827b9b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-data-element/data.value-001.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTMLDataElement.value getting</title>
+ <link rel="author" title="ofekd" href="mailto:ofek@outlook.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#dom-data-value">
+ <script src=/resources/testharness.js></script>
+ <script src=/resources/testharnessreport.js></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="container">
+ <data value=""></data>
+ <data value="40">Forty</data>
+ </div>
+ <script>
+ var newData, datasArr, container;
+
+ container = document.getElementById('container')
+
+ newData = document.createElement('data');
+ newData.textContent = 'Five';
+ newData.setAttribute('value', '5');
+ container.appendChild(newData);
+
+ datasArr = container.getElementsByTagName('data');
+
+ test(function () {
+ test(function() {
+ assert_equals(datasArr[0].value, '');
+ }, 'data[value] #0 getter test');
+
+ test(function() {
+ assert_equals(datasArr[1].value, '40');
+ }, 'data[value] #1 getter test');
+
+ test(function() {
+ assert_equals(datasArr[2].value, '5');
+ }, 'data[value] #2 getter test');
+ }, 'Getter tests');
+
+ test(function () {
+ var i;
+
+ for (i = 0; i < datasArr.length; i++) {
+ datasArr[i].textContent = 'Twenty';
+ datasArr[i].value = 20;
+
+ test(function() {
+ assert_equals(datasArr[i].getAttribute('value'), '20');
+ }, 'data[value] #' + i + ' setter test');
+ }
+
+ newData = document.createElement('data');
+ newData.textContent = 'Twenty';
+ newData.value = '20';
+ container.appendChild(newData);
+
+ test(function() {
+ assert_equals(datasArr[3].getAttribute('value'), '20');
+ }, 'data[value] #3 setter test');
+
+ }, 'Setter tests');
+ </script>
+ </body>
+</html>