summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis')
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-all.html52
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html95
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-02.html53
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-03.html53
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-04.html47
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/heading-obsolete-attributes-01.html18
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/nothing.html27
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/original-id.json1
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/script-IDL-event-htmlfor.html57
9 files changed, 403 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-all.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-all.html
new file mode 100644
index 0000000000..37a92bb09f
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-all.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>document.all</title>
+<link rel="author" title="Corey Farwell" href="mailto:coreyf@rwell.org">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-all">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function () {
+ assert_false(Boolean(document.all));
+
+ assert_true(document.all == undefined);
+ assert_true(document.all == null);
+ assert_false(document.all != undefined);
+ assert_false(document.all != null);
+
+ assert_true(document.all !== undefined);
+ assert_true(document.all !== null);
+ assert_false(document.all === undefined);
+ assert_false(document.all === null);
+
+ assert_equals(typeof document.all, "undefined");
+
+ if (document.all) { assert_true(false); }
+
+ if (!document.all) {}
+ else { assert_true(false); }
+}, "'unusual behaviors' of document.all")
+
+test(function() {
+ var all = document.all;
+
+ assert_false(Boolean(all));
+
+ assert_true(all == undefined);
+ assert_true(all == null);
+ assert_false(all != undefined);
+ assert_false(all != null);
+
+ assert_true(all !== undefined);
+ assert_true(all !== null);
+ assert_false(all === undefined);
+ assert_false(all === null);
+
+ assert_equals(typeof all, "undefined");
+
+ if (all) { assert_true(false); }
+
+ if (!all) {}
+ else { assert_true(false); }
+}, "'unusual behaviors' of document.all with assignment")
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html
new file mode 100644
index 0000000000..e6f0c2b573
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html
@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+<title>document: fg/bg/link/vlink/alink-color</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-fgcolor">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-body-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+function setColorAttributes(doc, color) {
+ doc.fgColor = color;
+ doc.bgColor = color;
+ doc.linkColor = color;
+ doc.vlinkColor = color;
+ doc.alinkColor = color;
+}
+
+function checkColorAttributes(doc, expected) {
+ assert_equals(document.fgColor, expected);
+ assert_equals(document.bgColor, expected);
+ assert_equals(document.linkColor, expected);
+ assert_equals(document.vlinkColor, expected);
+ assert_equals(document.alinkColor, expected);
+}
+
+test(function() {
+ setColorAttributes(document, 'green');
+
+ var body = document.documentElement.removeChild(document.body);
+ this.add_cleanup(function() {
+ // Re-add body and reset color attributes.
+ document.body = body;
+ setColorAttributes(document, '');
+ });
+ // When there is no body element, the color attributes return an
+ // empty string upon getting.
+ checkColorAttributes(document, '');
+}, "getting document color attributes with no body");
+
+test(function() {
+ var body = document.documentElement.removeChild(document.body);
+ this.add_cleanup(function() {
+ document.body = body;
+ });
+
+ // When there is no body element, setting the color attributes has no effect.
+ setColorAttributes(document, 'red');
+ checkColorAttributes(document, '');
+}, "setting document color attributes with no body");
+
+function testBogusRootElement(doc) {
+ doc.replaceChild(doc.createElement('test'), doc.documentElement);
+ var new_body = doc.createElement('body');
+ doc.documentElement.appendChild(new_body);
+
+ setColorAttributes(doc, 'red');
+
+ assert_equals(new_body.attributes.length, 0, 'new_body.attributes.length');
+ checkColorAttributes(doc, '');
+}
+
+function createIframeDoc(markup) {
+ var iframe = document.createElement('iframe');
+ document.body.appendChild(iframe);
+ var doc = iframe.contentDocument;
+ doc.open();
+ doc.write(markup);
+ doc.close();
+ return doc;
+}
+
+test(function() {
+ // Use standards mode for doc
+ var doc = createIframeDoc('<!doctype html>');
+ testBogusRootElement(doc);
+}, "document color attributes when the root element is a test element (iframe)");
+
+test(function() {
+ var doc = document.implementation.createHTMLDocument();
+ testBogusRootElement(doc);
+}, "document color attributes when the root element is a test element (createHTMLDocument)");
+
+test(function() {
+ var doc = createIframeDoc('<!doctype html><frameset text=red link=red vlink=red alink=red bgcolor=red>');
+ assert_equals(doc.body.attributes.length, 5, 'attributes.length on the frameset');
+ checkColorAttributes(doc, '');
+}, "getting document color attributes when document.body is a frameset");
+
+test(function() {
+ var doc = createIframeDoc('<!doctype html><frameset>');
+ setColorAttributes(doc, 'red');
+ assert_equals(doc.body.attributes.length, 0, 'attributes.length on the frameset');
+ checkColorAttributes(doc, '');
+}, "setting document color attributes when document.body is a frameset");
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-02.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-02.html
new file mode 100644
index 0000000000..ebf15e79cd
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-02.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>document: fg/bg/link/vlink/alink-color</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-fgcolor">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-body-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.fgColor, document.body.text);
+ assert_equals(document.bgColor, document.body.bgColor);
+ assert_equals(document.linkColor, document.body.link);
+ assert_equals(document.vlinkColor, document.body.vLink);
+ assert_equals(document.alinkColor, document.body.aLink);
+})
+test(function() {
+ document.fgColor = null;
+ assert_equals(document.fgColor, "");
+ assert_equals(document.body.text, "");
+ assert_equals(document.body.getAttribute("text"), "");
+})
+test(function() {
+ document.fgColor = "blue";
+ assert_equals(document.fgColor, "blue");
+ assert_equals(document.body.text, "blue");
+ assert_equals(document.body.getAttribute("text"), "blue");
+})
+test(function() {
+ document.bgColor = "green";
+ assert_equals(document.bgColor, "green");
+ assert_equals(document.body.bgColor, "green");
+ assert_equals(document.body.getAttribute("bgcolor"), "green");
+})
+test(function() {
+ document.linkColor = "red";
+ assert_equals(document.linkColor, "red");
+ assert_equals(document.body.link, "red");
+ assert_equals(document.body.getAttribute("link"), "red");
+})
+test(function() {
+ document.vlinkColor = "yellow";
+ assert_equals(document.vlinkColor, "yellow");
+ assert_equals(document.body.vLink, "yellow");
+ assert_equals(document.body.getAttribute("vlink"), "yellow");
+})
+test(function() {
+ document.alinkColor = "silver";
+ assert_equals(document.alinkColor, "silver");
+ assert_equals(document.body.aLink, "silver");
+ assert_equals(document.body.getAttribute("alink"), "silver");
+})
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-03.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-03.html
new file mode 100644
index 0000000000..629c24627c
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-03.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>document: fg/bg/link/vlink/alink-color</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-fgcolor">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-body-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.fgColor, document.body.text);
+ assert_equals(document.bgColor, document.body.bgColor);
+ assert_equals(document.linkColor, document.body.link);
+ assert_equals(document.vlinkColor, document.body.vLink);
+ assert_equals(document.alinkColor, document.body.aLink);
+})
+test(function() {
+ document.body.text = null;
+ assert_equals(document.fgColor, "");
+ assert_equals(document.body.text, "");
+ assert_equals(document.body.getAttribute("text"), "");
+})
+test(function() {
+ document.body.text = "blue";
+ assert_equals(document.fgColor, "blue");
+ assert_equals(document.body.text, "blue");
+ assert_equals(document.body.getAttribute("text"), "blue");
+})
+test(function() {
+ document.body.bgColor = "green";
+ assert_equals(document.bgColor, "green");
+ assert_equals(document.body.bgColor, "green");
+ assert_equals(document.body.getAttribute("bgcolor"), "green");
+})
+test(function() {
+ document.body.link = "red";
+ assert_equals(document.linkColor, "red");
+ assert_equals(document.body.link, "red");
+ assert_equals(document.body.getAttribute("link"), "red");
+})
+test(function() {
+ document.body.vLink = "yellow";
+ assert_equals(document.vlinkColor, "yellow");
+ assert_equals(document.body.vLink, "yellow");
+ assert_equals(document.body.getAttribute("vlink"), "yellow");
+})
+test(function() {
+ document.body.aLink = "silver";
+ assert_equals(document.alinkColor, "silver");
+ assert_equals(document.body.aLink, "silver");
+ assert_equals(document.body.getAttribute("alink"), "silver");
+})
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-04.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-04.html
new file mode 100644
index 0000000000..ca9fc21d85
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-04.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>document: fg/bg/link/vlink/alink-color</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-fgcolor">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-body-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.fgColor, document.body.text);
+ assert_equals(document.bgColor, document.body.bgColor);
+ assert_equals(document.linkColor, document.body.link);
+ assert_equals(document.vlinkColor, document.body.vLink);
+ assert_equals(document.alinkColor, document.body.aLink);
+})
+test(function() {
+ document.body.setAttribute("text", "blue");
+ assert_equals(document.fgColor, "blue");
+ assert_equals(document.body.text, "blue");
+ assert_equals(document.body.getAttribute("text"), "blue");
+})
+test(function() {
+ document.body.setAttribute("bgcolor", "green");
+ assert_equals(document.bgColor, "green");
+ assert_equals(document.body.bgColor, "green");
+ assert_equals(document.body.getAttribute("bgcolor"), "green");
+})
+test(function() {
+ document.body.setAttribute("link", "red");
+ assert_equals(document.linkColor, "red");
+ assert_equals(document.body.link, "red");
+ assert_equals(document.body.getAttribute("link"), "red");
+})
+test(function() {
+ document.body.setAttribute("vlink", "yellow");
+ assert_equals(document.vlinkColor, "yellow");
+ assert_equals(document.body.vLink, "yellow");
+ assert_equals(document.body.getAttribute("vlink"), "yellow");
+})
+test(function() {
+ document.body.setAttribute("alink", "silver");
+ assert_equals(document.alinkColor, "silver");
+ assert_equals(document.body.aLink, "silver");
+ assert_equals(document.body.getAttribute("alink"), "silver");
+})
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/heading-obsolete-attributes-01.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/heading-obsolete-attributes-01.html
new file mode 100644
index 0000000000..8b541f2041
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/heading-obsolete-attributes-01.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<title>HTMLHeadingElement: obsolete attribute reflecting</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-hx-align">
+<link rel="help" href="https://webidl.spec.whatwg.org/#es-DOMString">
+<link rel="help" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf#page=57">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var el = document.createElement("h7");
+ el.align = "left";
+ assert_equals(el.align, "left");
+ assert_false(el.hasAttribute("align"));
+ assert_equals(el.getAttribute("align"), null);
+}, "IDL attributes for HTMLHeadingElement should not apply to h7.")
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/nothing.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/nothing.html
new file mode 100644
index 0000000000..039495d78d
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/nothing.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Methods that must do nothing: clear(), captureEvents(), and releaseEvents()</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function() {
+ assert_equals(document.clear(), undefined);
+}, "document.clear");
+
+test(function() {
+ assert_equals(document.captureEvents(), undefined);
+}, "document.captureEvents");
+
+test(function() {
+ assert_equals(document.releaseEvents(), undefined);
+}, "document.releaseEvents");
+
+test(function() {
+ assert_equals(window.captureEvents(), undefined);
+}, "window.captureEvents");
+
+test(function() {
+ assert_equals(window.releaseEvents(), undefined);
+}, "window.releaseEvents");
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/original-id.json b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/original-id.json
new file mode 100644
index 0000000000..601a7c08d1
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/original-id.json
@@ -0,0 +1 @@
+{"original_id":"other-elements,-attributes-and-apis"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/script-IDL-event-htmlfor.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/script-IDL-event-htmlfor.html
new file mode 100644
index 0000000000..1a8c4a2f85
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/script-IDL-event-htmlfor.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<title>event and htmlFor IDL attributes of HTMLScriptElement</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-event">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-htmlfor">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var script = document.createElement("script");
+ assert_equals(script.event, "");
+ assert_equals(script.htmlFor, "");
+})
+test(function() {
+ var script = document.createElement("script");
+ script.setAttribute("event", "blah");
+ script.setAttribute("for", "blah");
+ assert_equals(script.event, "blah");
+ assert_equals(script.htmlFor, "blah");
+ assert_equals(script.getAttribute("event"), "blah");
+ assert_equals(script.getAttribute("for"), "blah");
+})
+test(function() {
+ var script = document.createElement("script");
+ script.setAttribute("event", "blah");
+ script.setAttribute("for", "blah");
+ script.event = "foo";
+ script.htmlFor = "foo";
+ assert_equals(script.event, "foo");
+ assert_equals(script.htmlFor, "foo");
+ assert_equals(script.getAttribute("event"), "foo");
+ assert_equals(script.getAttribute("for"), "foo");
+})
+test(function() {
+ var script = document.createElement("script");
+ script.setAttribute("event", "blah");
+ script.setAttribute("for", "blah");
+ script.event = null;
+ script.htmlFor = null;
+ assert_equals(script.event, "null");
+ assert_equals(script.htmlFor, "null");
+ assert_equals(script.getAttribute("event"), "null");
+ assert_equals(script.getAttribute("for"), "null");
+})
+test(function() {
+ var script = document.createElement("script");
+ script.setAttribute("event", "blah");
+ script.setAttribute("for", "blah");
+ script.event = undefined;
+ script.htmlFor = undefined;
+ assert_equals(script.event, "undefined");
+ assert_equals(script.htmlFor, "undefined");
+ assert_equals(script.getAttribute("event"), "undefined");
+ assert_equals(script.getAttribute("for"), "undefined");
+})
+</script>