summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/historical.html
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/dom/historical.html
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/dom/historical.html')
-rw-r--r--testing/web-platform/tests/dom/historical.html132
1 files changed, 132 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/historical.html b/testing/web-platform/tests/dom/historical.html
new file mode 100644
index 000000000..cec309308
--- /dev/null
+++ b/testing/web-platform/tests/dom/historical.html
@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+<title>Historical DOM features must be removed</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+function isInterfaceNuked(name) {
+ test(function() {
+ assert_equals(window[name], undefined)
+ }, "Historical DOM features must be removed: " + name)
+}
+var nukedInterfaces = [
+ "DOMConfiguration",
+ "DOMError",
+ "DOMErrorHandler",
+ "DOMImplementationList",
+ "DOMImplementationSource",
+ "DOMLocator",
+ "DOMObject",
+ "DOMSettableTokenList",
+ "DOMUserData",
+ "Entity",
+ "EntityReference",
+ "EventException", // DOM Events
+ "NameList",
+ "Notation",
+ "TypeInfo",
+ "UserDataHandler",
+ "RangeException" // DOM Range
+]
+nukedInterfaces.forEach(isInterfaceNuked)
+
+function isNukedFromDocument(name) {
+ test(function() {
+ var doc = document.implementation.createDocument(null,null,null)
+ assert_equals(document[name], undefined)
+ assert_equals(doc[name], undefined)
+ }, "Historical DOM features must be removed: " + name)
+}
+var documentNuked = [
+ "createEntityReference",
+ "xmlEncoding",
+ "xmlStandalone",
+ "xmlVersion",
+ "strictErrorChecking",
+ "domConfig",
+ "normalizeDocument",
+ "renameNode",
+ "defaultCharset",
+ "height",
+ "width"
+]
+documentNuked.forEach(isNukedFromDocument)
+
+test(function() {
+ assert_equals(document.implementation["getFeature"], undefined)
+}, "DOMImplementation.getFeature() must be nuked.")
+
+function isNukedFromElement(name) {
+ test(function() {
+ var ele = document.createElementNS("test", "test")
+ assert_equals(document.body[name], undefined)
+ assert_equals(ele[name], undefined)
+ }, "Historical DOM features must be removed: " + name)
+}
+var elementNuked = [
+ "schemaTypeInfo",
+ "setIdAttribute",
+ "setIdAttributeNS",
+ "setIdAttributeNode"
+]
+elementNuked.forEach(isNukedFromElement)
+
+function isNukedFromDoctype(name) {
+ test(function() {
+ var doctype = document.implementation.createDocumentType("test", "", "")
+ assert_equals(doctype[name], undefined)
+ }, "DocumentType member must be nuked: " + name)
+}
+var doctypeNuked = [
+ "entities",
+ "notations",
+ "internalSubset"
+]
+doctypeNuked.forEach(isNukedFromDoctype)
+
+function isNukedFromText(name) {
+ test(function() {
+ var text = document.createTextNode("test")
+ assert_equals(text[name], undefined)
+ }, "Text member must be nuked: " + name)
+}
+var textNuked = [
+ "isElementContentWhitespace",
+ "replaceWholeText"
+]
+textNuked.forEach(isNukedFromText)
+
+function isNukedFromNode(name) {
+ test(function() {
+ var doc = document.implementation.createDocument(null,null,null)
+ var doctype = document.implementation.createDocumentType("test", "", "")
+ var text = document.createTextNode("test")
+ assert_equals(doc[name], undefined)
+ assert_equals(doctype[name], undefined)
+ assert_equals(text[name], undefined)
+ }, "Node member must be nuked: " + name)
+}
+var nodeNuked = [
+ "hasAttributes",
+ "attributes",
+ "namespaceURI",
+ "prefix",
+ "localName",
+ "isSupported",
+ "getFeature",
+ "getUserData",
+ "setUserData",
+ "rootNode",
+]
+nodeNuked.forEach(isNukedFromNode)
+
+function isNukedFromWindow(name) {
+ test(function() {
+ assert_equals(window[name], undefined)
+ }, "Window member must be nuked: " + name)
+}
+var windowNuked = [
+ "attachEvent"
+]
+windowNuked.forEach(isNukedFromWindow)
+</script>