diff options
Diffstat (limited to 'testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis')
10 files changed, 361 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/.gitkeep b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/.gitkeep 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 000000000..37a92bb09 --- /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 000000000..38364cd3e --- /dev/null +++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.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() { + document.fgColor = "green"; + document.bgColor = "green"; + document.linkColor = "green"; + document.vlinkColor = "green"; + document.alinkColor = "green"; + + var body = document.documentElement.removeChild(document.body); + + // When there is no body element, the color attributes return an + // empty string upon getting. + assert_equals(document.fgColor, ""); + assert_equals(document.bgColor, ""); + assert_equals(document.linkColor, ""); + assert_equals(document.vlinkColor, ""); + assert_equals(document.alinkColor, ""); + + // Re-add body and reset color attributes. + document.body = body; + document.fgColor = ""; + document.bgColor = ""; + document.linkColor = ""; + document.vlinkColor = ""; + document.alinkColor = ""; +}, "getting document color attributes with no body"); + +test(function() { + var body = document.documentElement.removeChild(document.body); + + // When there is no body element, setting the color attributes has no effect. + document.fgColor = "red"; + document.bgColor = "red"; + document.linkColor = "red"; + document.vlinkColor = "red"; + document.alinkColor = "red"; + assert_equals(document.fgColor, ""); + assert_equals(document.bgColor, ""); + assert_equals(document.linkColor, ""); + assert_equals(document.vlinkColor, ""); + assert_equals(document.alinkColor, ""); + + document.body = body; +}, "setting document color attributes with no body"); +</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 000000000..ebf15e79c --- /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 000000000..629c24627 --- /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 000000000..ca9fc21d8 --- /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 000000000..84c66b4c5 --- /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://heycam.github.io/webidl/#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 000000000..039495d78 --- /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 000000000..601a7c08d --- /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 000000000..1a8c4a2f8 --- /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> |