mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 854329 - Part b: Import more tests; rs=mounir
This commit is contained in:
parent
529b339870
commit
5ed305dd22
@ -0,0 +1,19 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_window-indexed-properties-strict.html.json \
|
||||
test_window-named-properties.html.json \
|
||||
test_window-properties.html.json \
|
||||
test_window-prototype-chain.html.json \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"Indexed properties of the window object (strict mode) 1": true,
|
||||
"Indexed properties of the window object (strict mode) 2": true
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"Static name on the prototype": true,
|
||||
"constructor": true,
|
||||
"Ghost name": true
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
{
|
||||
"EventTarget method: addEventListener": true,
|
||||
"EventTarget method: removeEventListener": true,
|
||||
"EventTarget method: dispatchEvent": true,
|
||||
"Window readonly attribute: history": true,
|
||||
"Window readonly attribute: parent": true,
|
||||
"Window readonly attribute: frameElement": true,
|
||||
"Window readonly attribute: navigator": true,
|
||||
"Window readonly attribute: external": true,
|
||||
"Window readonly attribute: applicationCache": true,
|
||||
"Window readonly attribute: sessionStorage": true,
|
||||
"Window readonly attribute: localStorage": true,
|
||||
"Window readonly attribute: screen": true,
|
||||
"Window readonly attribute: innerWidth": true,
|
||||
"Window readonly attribute: innerHeight": true,
|
||||
"Window readonly attribute: scrollX": true,
|
||||
"Window readonly attribute: pageXOffset": true,
|
||||
"Window readonly attribute: scrollY": true,
|
||||
"Window readonly attribute: pageYOffset": true,
|
||||
"Window readonly attribute: screenX": true,
|
||||
"Window readonly attribute: screenY": true,
|
||||
"Window readonly attribute: outerWidth": true,
|
||||
"Window readonly attribute: outerHeight": true,
|
||||
"Window attribute: oncancel": true,
|
||||
"Window attribute: onclose": true,
|
||||
"Window attribute: oncuechange": true,
|
||||
"Window attribute: onmousewheel": true,
|
||||
"Window attribute: onstorage": true,
|
||||
"Window unforgeable attribute: window": true,
|
||||
"Window unforgeable attribute: document": true,
|
||||
"Window unforgeable attribute: location": true,
|
||||
"Window unforgeable attribute: top": true,
|
||||
"Window replaceable attribute: locationbar": true,
|
||||
"Window replaceable attribute: menubar": true,
|
||||
"Window replaceable attribute: personalbar": true,
|
||||
"Window replaceable attribute: scrollbars": true,
|
||||
"Window replaceable attribute: statusbar": true,
|
||||
"Window replaceable attribute: toolbar": true,
|
||||
"Window replaceable attribute: frames": true,
|
||||
"Window replaceable attribute: length": true,
|
||||
"constructor": true
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"Window.prototype": true,
|
||||
"Global scope polluter": true,
|
||||
"EventTarget.prototype": true,
|
||||
"Object.prototype": true
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_document.body-getter-frameset-and-body.html.json \
|
||||
test_document.title-03.html.json \
|
||||
test_document.title-04.xhtml.json \
|
||||
test_document.title-06.html.json \
|
||||
test_document.title-07.html.json \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,16 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_document.getElementsByName-newelements.html.json \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"getElementsByName and newly introduced HTML elements": true
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"document.body and framesets": true
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
" document.title and space normalization ": true
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
" document.title and space normalization ": true
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"document.title and the empty string": true
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"Document.title and DOMImplementation.createHTMLDocument 6": true
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_document-dir.html.json \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"Setting the idl attribute to a garbage value": true,
|
||||
"Setting the idl attribute to the empty sting": true
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_script-IDL-event-htmlfor.html.json \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"event and htmlFor IDL attributes of HTMLScriptElement 1": true,
|
||||
"event and htmlFor IDL attributes of HTMLScriptElement 2": true,
|
||||
"event and htmlFor IDL attributes of HTMLScriptElement 3": true,
|
||||
"event and htmlFor IDL attributes of HTMLScriptElement 4": true
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_form-elements-interfaces-01.html.json \
|
||||
test_form-elements-nameditem-01.html.json \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"Testing interface HTMLFormControlsCollection": true
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"RadioNodeList should exist": true
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_option-text-spaces.html.json \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,15 @@
|
||||
{
|
||||
"option.text should strip leading space characters (\"\\f\")": true,
|
||||
"option.text should strip trailing space characters (\"\\f\")": true,
|
||||
"option.text should strip leading and trailing space characters (\"\\f\")": true,
|
||||
"option.text should replace single internal space characters (\"\\f\")": true,
|
||||
"option.text should replace multiple internal space characters (\" \", \"\\f\")": true,
|
||||
"option.text should replace multiple internal space characters (\"\\t\", \"\\f\")": true,
|
||||
"option.text should replace multiple internal space characters (\"\\n\", \"\\f\")": true,
|
||||
"option.text should replace multiple internal space characters (\"\\f\", \" \")": true,
|
||||
"option.text should replace multiple internal space characters (\"\\f\", \"\\t\")": true,
|
||||
"option.text should replace multiple internal space characters (\"\\f\", \"\\n\")": true,
|
||||
"option.text should replace multiple internal space characters (\"\\f\", \"\\f\")": true,
|
||||
"option.text should replace multiple internal space characters (\"\\f\", \"\\r\")": true,
|
||||
"option.text should replace multiple internal space characters (\"\\r\", \"\\f\")": true
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_table-insertRow.html.json \
|
||||
test_table-rows.html.json \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"insertRow should not copy prefixes": true,
|
||||
"insertRow should insert into a tbody, not into a thead, if table.rows is empty": true,
|
||||
"insertRow should insert into a tbody, not into a tfoot, if table.rows is empty": true
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"Complicated case": true
|
||||
}
|
16
dom/imptests/failures/html/html/webappapis/atob/Makefile.in
Normal file
16
dom/imptests/failures/html/html/webappapis/atob/Makefile.in
Normal file
@ -0,0 +1,16 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_base64.html.json \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,14 @@
|
||||
{
|
||||
"btoa(null) == \"bnVsbA==\"": true,
|
||||
"atob(\" abcd\") == \"i\u00b7\\x1d\"": true,
|
||||
"atob(\"abcd \") == \"i\u00b7\\x1d\"": true,
|
||||
"atob(\"ab\\tcd\") == \"i\u00b7\\x1d\"": true,
|
||||
"atob(\"ab\\ncd\") == \"i\u00b7\\x1d\"": true,
|
||||
"atob(\"ab\\fcd\") == \"i\u00b7\\x1d\"": true,
|
||||
"atob(\"ab\\rcd\") == \"i\u00b7\\x1d\"": true,
|
||||
"atob(\"ab cd\") == \"i\u00b7\\x1d\"": true,
|
||||
"atob(\"ab\\t\\n\\f\\r cd\") == \"i\u00b7\\x1d\"": true,
|
||||
"atob(\" \\t\\n\\f\\r ab\\t\\n\\f\\r cd\\t\\n\\f\\r \") == \"i\u00b7\\x1d\"": true,
|
||||
"atob(\"ab\\t\\n\\f\\r =\\t\\n\\f\\r =\\t\\n\\f\\r \") == \"i\"": true,
|
||||
"atob(null) == \"\u009e\u00e9e\"": true
|
||||
}
|
@ -3,10 +3,21 @@
|
||||
DIRS += [
|
||||
'html/domxpath',
|
||||
'html/html/browsers/browsing-the-web/read-media',
|
||||
'html/html/browsers/the-window-object',
|
||||
'html/html/dom/documents/dom-tree-accessors',
|
||||
'html/html/dom/elements/global-attributes',
|
||||
'html/html/editing/the-hidden-attribute',
|
||||
'html/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis',
|
||||
'html/html/semantics/document-metadata/the-title-element',
|
||||
'html/html/semantics/forms/the-form-element',
|
||||
'html/html/semantics/forms/the-option-element',
|
||||
'html/html/semantics/scripting-1/the-script-element',
|
||||
'html/html/semantics/tabular-data/the-table-element',
|
||||
'html/html/semantics/text-level-semantics/the-time-element',
|
||||
'html/html/webappapis/atob',
|
||||
'html/html/webappapis/scripting/events',
|
||||
'html/html/webappapis/scripting/processing-model-2',
|
||||
'html/html/webappapis/timers',
|
||||
'html/js/builtins',
|
||||
'html/old-tests/submission/Opera/microdata',
|
||||
'html/typedarrays',
|
||||
|
@ -1,10 +1,21 @@
|
||||
git+ssh://git@github.com:w3c/web-platform-tests.git|html
|
||||
domxpath
|
||||
html/browsers/browsing-the-web/read-media
|
||||
html/browsers/the-window-object
|
||||
html/dom/documents/dom-tree-accessors
|
||||
html/dom/elements/global-attributes
|
||||
html/editing/the-hidden-attribute
|
||||
html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis
|
||||
html/semantics/document-metadata/the-title-element
|
||||
html/semantics/forms/the-form-element
|
||||
html/semantics/forms/the-option-element
|
||||
html/semantics/scripting-1/the-script-element
|
||||
html/semantics/tabular-data/the-table-element
|
||||
html/semantics/text-level-semantics/the-time-element
|
||||
html/webappapis/atob
|
||||
html/webappapis/scripting/events
|
||||
html/webappapis/scripting/processing-model-2
|
||||
html/webappapis/timers
|
||||
js/builtins
|
||||
old-tests/submission/Opera/microdata
|
||||
typedarrays
|
||||
|
@ -0,0 +1,20 @@
|
||||
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_window-indexed-properties.html \
|
||||
test_window-indexed-properties-strict.html \
|
||||
test_window-named-properties.html \
|
||||
test_window-properties.html \
|
||||
test_window-prototype-chain.html \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,43 @@
|
||||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Indexed properties of the window object (strict mode)</title>
|
||||
<link rel="author" title="Ms2ger" href="ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html/#window">
|
||||
<link rel="help" href="http://www.whatwg.org/html/#dom-window-item">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#getownproperty">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#defineownproperty">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<iframe></iframe>
|
||||
<script>
|
||||
test(function() {
|
||||
"use strict";
|
||||
assert_false("-1" in window, "-1 not in window");
|
||||
assert_equals(window[-1], undefined);
|
||||
window[-1] = "foo";
|
||||
assert_equals(window[-1], "foo");
|
||||
});
|
||||
test(function() {
|
||||
"use strict";
|
||||
assert_throws(new TypeError(), function() {
|
||||
window[0] = "foo";
|
||||
});
|
||||
assert_equals(window[0],
|
||||
document.getElementsByTagName("iframe")[0].contentWindow);
|
||||
});
|
||||
test(function() {
|
||||
"use strict";
|
||||
assert_throws(new TypeError(), function() {
|
||||
window[1] = "foo";
|
||||
});
|
||||
assert_equals(window[1], undefined);
|
||||
});
|
||||
test(function() {
|
||||
"use strict";
|
||||
var proto = Window.prototype;
|
||||
[-1, 0, 1].forEach(function(idx) {
|
||||
assert_false(idx in proto, idx + " in proto");
|
||||
});
|
||||
});
|
||||
</script>
|
@ -0,0 +1,35 @@
|
||||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Indexed properties of the window object (non-strict mode)</title>
|
||||
<link rel="author" title="Ms2ger" href="ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html/#window">
|
||||
<link rel="help" href="http://www.whatwg.org/html/#dom-window-item">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#getownproperty">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#defineownproperty">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<iframe></iframe>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_false("-1" in window, "-1 not in window");
|
||||
assert_equals(window[-1], undefined);
|
||||
window[-1] = "foo";
|
||||
assert_equals(window[-1], "foo");
|
||||
});
|
||||
test(function() {
|
||||
window[0] = "foo";
|
||||
assert_equals(window[0],
|
||||
document.getElementsByTagName("iframe")[0].contentWindow);
|
||||
});
|
||||
test(function() {
|
||||
window[1] = "foo";
|
||||
assert_equals(window[1], undefined);
|
||||
});
|
||||
test(function() {
|
||||
var proto = Window.prototype;
|
||||
[-1, 0, 1].forEach(function(idx) {
|
||||
assert_false(idx in proto, idx + " in proto");
|
||||
});
|
||||
});
|
||||
</script>
|
@ -0,0 +1,70 @@
|
||||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Changes to named properties of the window object</title>
|
||||
<link rel="author" title="Ms2ger" href="ms2ger@gmail.com">
|
||||
<link rel="author" title="Boris Zbarsky" href="bzbarsky@mit.edu">
|
||||
<link rel="help" href="http://www.whatwg.org/html/#window">
|
||||
<link rel="help" href="http://www.whatwg.org/html/#dom-window-nameditem">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#named-properties-object">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<iframe name="bar"></iframe>
|
||||
<iframe name="constructor"></iframe>
|
||||
<script>
|
||||
function assert_data_propdesc(pd, Writable, Enumerable, Configurable) {
|
||||
assert_equals(typeof pd, "object");
|
||||
assert_equals(pd.writable, Writable);
|
||||
assert_equals(pd.enumerable, Enumerable);
|
||||
assert_equals(pd.configurable, Configurable);
|
||||
}
|
||||
test(function() {
|
||||
assert_true("bar" in window, "bar not in window");
|
||||
assert_equals(window["bar"],
|
||||
document.getElementsByTagName("iframe")[0].contentWindow);
|
||||
}, "Static name");
|
||||
test(function() {
|
||||
assert_true("bar" in Window.prototype, "bar in Window.prototype");
|
||||
assert_false(Window.prototype.hasOwnProperty("bar"), "Window.prototype.hasOwnProperty(\"bar\")");
|
||||
|
||||
var gsp = Object.getPrototypeOf(Object.getPrototypeOf(window));
|
||||
assert_true("bar" in gsp, "bar in gsp");
|
||||
assert_true(gsp.hasOwnProperty("bar"), "gsp.hasOwnProperty(\"bar\")");
|
||||
assert_data_propdesc(Object.getOwnPropertyDescriptor(gsp, "bar"),
|
||||
false, true, true);
|
||||
}, "Static name on the prototype");
|
||||
test(function() {
|
||||
assert_equals(window.constructor, Window);
|
||||
assert_false(window.hasOwnProperty("constructor"), "window.constructor should not be an own property.");
|
||||
|
||||
var proto = Object.getPrototypeOf(window);
|
||||
assert_equals(proto.constructor, Window);
|
||||
assert_true("constructor" in proto, "constructor in proto");
|
||||
assert_data_propdesc(Object.getOwnPropertyDescriptor(proto, "constructor"),
|
||||
true, false, true);
|
||||
|
||||
var gsp = Object.getPrototypeOf(proto);
|
||||
assert_true("constructor" in gsp, "constructor in gsp");
|
||||
assert_true(gsp.hasOwnProperty("constructor"), "gsp.hasOwnProperty(\"constructor\")");
|
||||
assert_data_propdesc(Object.getOwnPropertyDescriptor(gsp, "constructor"),
|
||||
false, true, true);
|
||||
}, "constructor");
|
||||
var t = async_test("Dynamic name")
|
||||
var t2 = async_test("Ghost name")
|
||||
t.step(function() {
|
||||
var iframe = document.getElementsByTagName("iframe")[0];
|
||||
iframe.setAttribute("src", "data:text/html,<script>window.name='foo'<\/script>");
|
||||
iframe.onload = function() {
|
||||
t.step(function() {
|
||||
assert_true("foo" in window, "foo not in window");
|
||||
assert_equals(window["foo"], iframe.contentWindow);
|
||||
});
|
||||
t.done();
|
||||
t2.step(function() {
|
||||
assert_false("bar" in window, "bar still in window");
|
||||
assert_equals(window["bar"], undefined);
|
||||
});
|
||||
t2.done();
|
||||
};
|
||||
});
|
||||
</script>
|
@ -0,0 +1,315 @@
|
||||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Properties of the window object</title>
|
||||
<link rel="author" title="Ms2ger" href="ms2ger@gmail.com">
|
||||
<link rel="help" href="http://ecma-international.org/ecma-262/5.1/#sec-15.1">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#interface-prototype-object">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#es-attributes">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#es-operations">
|
||||
<link rel="help" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#eventtarget">
|
||||
<link rel="help" href="http://www.whatwg.org/html/#window">
|
||||
<link rel="help" href="http://www.whatwg.org/html/#windowtimers">
|
||||
<link rel="help" href="http://www.whatwg.org/html/#windowbase64">
|
||||
<link rel="help" href="http://www.whatwg.org/html/#windowsessionstorage">
|
||||
<link rel="help" href="http://www.whatwg.org/html/#windowlocalstorage">
|
||||
<link rel="help" href="https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-window-getselection">
|
||||
<link rel="help" href="http://dev.w3.org/csswg/cssom/#widl-def-Window">
|
||||
<link rel="help" href="http://dev.w3.org/csswg/cssom-view/#widl-def-Window">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
function assert_data_propdesc(pd, Writable, Enumerable, Configurable) {
|
||||
assert_equals(typeof pd, "object");
|
||||
assert_equals(pd.writable, Writable);
|
||||
assert_equals(pd.enumerable, Enumerable);
|
||||
assert_equals(pd.configurable, Configurable);
|
||||
}
|
||||
function assert_accessor_propdesc(pd, hasSetter, Enumerable, Configurable) {
|
||||
assert_equals(typeof pd, "object");
|
||||
assert_equals(typeof pd.get, "function");
|
||||
assert_equals("set" in pd, hasSetter,
|
||||
"Should have a setter for writable and replaceable attributes");
|
||||
assert_equals(typeof pd.set, hasSetter ? "function" : "undefined");
|
||||
assert_equals(pd.enumerable, Enumerable);
|
||||
assert_equals(pd.configurable, Configurable);
|
||||
}
|
||||
|
||||
var unforgeableAttributes = [
|
||||
"window",
|
||||
"document",
|
||||
"location",
|
||||
"top"
|
||||
];
|
||||
|
||||
var replacableAttributes = [
|
||||
"self",
|
||||
"locationbar",
|
||||
"menubar",
|
||||
"personalbar",
|
||||
"scrollbars",
|
||||
"statusbar",
|
||||
"toolbar",
|
||||
"frames",
|
||||
"length"
|
||||
];
|
||||
|
||||
var methods = [
|
||||
"close",
|
||||
"stop",
|
||||
"focus",
|
||||
"blur",
|
||||
"open",
|
||||
"alert",
|
||||
"confirm",
|
||||
"prompt",
|
||||
"print",
|
||||
"showModalDialog",
|
||||
"postMessage",
|
||||
|
||||
// WindowBase64
|
||||
"btoa",
|
||||
"atob",
|
||||
|
||||
// WindowTimers
|
||||
"setTimeout",
|
||||
"clearTimeout",
|
||||
"setInterval",
|
||||
"clearInterval",
|
||||
|
||||
// HTML Editing APIs
|
||||
"getSelection",
|
||||
|
||||
// CSSOM
|
||||
"getComputedStyle",
|
||||
|
||||
// CSSOM-View
|
||||
"matchMedia",
|
||||
"scroll",
|
||||
"scrollTo",
|
||||
"scrollBy"
|
||||
];
|
||||
|
||||
var readonlyAttributes = [
|
||||
"history",
|
||||
"parent",
|
||||
"frameElement",
|
||||
"navigator",
|
||||
"external",
|
||||
"applicationCache",
|
||||
|
||||
// WindowSessionStorage
|
||||
"sessionStorage",
|
||||
|
||||
// WindowLocalStorage
|
||||
"localStorage",
|
||||
|
||||
// CSSOM-View
|
||||
"screen",
|
||||
"innerWidth",
|
||||
"innerHeight",
|
||||
"scrollX",
|
||||
"pageXOffset",
|
||||
"scrollY",
|
||||
"pageYOffset",
|
||||
"screenX",
|
||||
"screenY",
|
||||
"outerWidth",
|
||||
"outerHeight"
|
||||
];
|
||||
|
||||
var writableAttributes = [
|
||||
"name",
|
||||
"status",
|
||||
"opener",
|
||||
"onabort",
|
||||
"onafterprint",
|
||||
"onbeforeprint",
|
||||
"onbeforeunload",
|
||||
"onblur",
|
||||
"oncancel",
|
||||
"oncanplay",
|
||||
"oncanplaythrough",
|
||||
"onchange",
|
||||
"onclick",
|
||||
"onclose",
|
||||
"oncontextmenu",
|
||||
"oncuechange",
|
||||
"ondblclick",
|
||||
"ondrag",
|
||||
"ondragend",
|
||||
"ondragenter",
|
||||
"ondragleave",
|
||||
"ondragover",
|
||||
"ondragstart",
|
||||
"ondrop",
|
||||
"ondurationchange",
|
||||
"onemptied",
|
||||
"onended",
|
||||
"onerror",
|
||||
"onfocus",
|
||||
"onhashchange",
|
||||
"oninput",
|
||||
"oninvalid",
|
||||
"onkeydown",
|
||||
"onkeypress",
|
||||
"onkeyup",
|
||||
"onload",
|
||||
"onloadeddata",
|
||||
"onloadedmetadata",
|
||||
"onloadstart",
|
||||
"onmessage",
|
||||
"onmousedown",
|
||||
"onmousemove",
|
||||
"onmouseout",
|
||||
"onmouseover",
|
||||
"onmouseup",
|
||||
"onmousewheel",
|
||||
"onoffline",
|
||||
"ononline",
|
||||
"onpause",
|
||||
"onplay",
|
||||
"onplaying",
|
||||
"onpagehide",
|
||||
"onpageshow",
|
||||
"onpopstate",
|
||||
"onprogress",
|
||||
"onratechange",
|
||||
"onreset",
|
||||
"onresize",
|
||||
"onscroll",
|
||||
"onseeked",
|
||||
"onseeking",
|
||||
"onselect",
|
||||
"onshow",
|
||||
"onstalled",
|
||||
"onstorage",
|
||||
"onsubmit",
|
||||
"onsuspend",
|
||||
"ontimeupdate",
|
||||
"onunload",
|
||||
"onvolumechange",
|
||||
"onwaiting"
|
||||
];
|
||||
|
||||
test(function() {
|
||||
// 15.1.1 Value Properties of the Global Object
|
||||
["NaN", "Infinity", "undefined"].forEach(function(id) {
|
||||
test(function() {
|
||||
assert_true(id in window, id + " in window");
|
||||
assert_data_propdesc(Object.getOwnPropertyDescriptor(window, id),
|
||||
false, false, false);
|
||||
}, "Value Property: " + id);
|
||||
});
|
||||
}, "Value Properties of the Global Object");
|
||||
test(function() {
|
||||
// 15.1.2 Function Properties of the Global Object
|
||||
["eval", "parseInt", "parseFloat", "isNaN", "isFinite"].forEach(function(id) {
|
||||
test(function() {
|
||||
assert_true(id in window, id + " in window");
|
||||
assert_data_propdesc(Object.getOwnPropertyDescriptor(window, id),
|
||||
true, false, true);
|
||||
}, "Function Property: " + id);
|
||||
});
|
||||
}, "Function Properties of the Global Object");
|
||||
test(function() {
|
||||
// 15.1.3 URI Handling Function Properties
|
||||
["decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent"].forEach(function(id) {
|
||||
test(function() {
|
||||
assert_true(id in window, id + " in window");
|
||||
assert_data_propdesc(Object.getOwnPropertyDescriptor(window, id),
|
||||
true, false, true);
|
||||
}, "URI Handling Function Property: " + id);
|
||||
});
|
||||
}, "URI Handling Function Properties");
|
||||
test(function() {
|
||||
// 15.1.4 Constructor Properties of the Global Object
|
||||
["Object", "Function", "Array", "String", "Boolean", "Number", "Date",
|
||||
"RegExp", "Error", "EvalError", "RangeError", "ReferenceError",
|
||||
"SyntaxError", "TypeError", "URIError"].forEach(function(id) {
|
||||
test(function() {
|
||||
assert_true(id in window, id + " in window");
|
||||
assert_data_propdesc(Object.getOwnPropertyDescriptor(window, id),
|
||||
true, false, true);
|
||||
}, "Constructor Property: " + id);
|
||||
});
|
||||
}, "Constructor Properties of the Global Object");
|
||||
test(function() {
|
||||
// 15.1.5 Other Properties of the Global Object
|
||||
["Math", "JSON"].forEach(function(id) {
|
||||
test(function() {
|
||||
assert_true(id in window, id + " in window");
|
||||
assert_data_propdesc(Object.getOwnPropertyDescriptor(window, id),
|
||||
true, false, true);
|
||||
}, "Other Property: " + id);
|
||||
});
|
||||
}, "Other Properties of the Global Object");
|
||||
test(function() {
|
||||
// EventTarget interface
|
||||
["addEventListener", "removeEventListener", "dispatchEvent"].forEach(function(id) {
|
||||
test(function() {
|
||||
var EventTargetProto = EventTarget.prototype;
|
||||
assert_true(id in window, id + " in window");
|
||||
assert_equals(window[id], EventTargetProto[id]);
|
||||
assert_data_propdesc(Object.getOwnPropertyDescriptor(EventTargetProto, id),
|
||||
true, true, true);
|
||||
}, "EventTarget method: " + id);
|
||||
});
|
||||
}, "EventTarget interface");
|
||||
test(function() {
|
||||
// Window interface
|
||||
methods.forEach(function(id) {
|
||||
test(function() {
|
||||
var WindowProto = Window.prototype;
|
||||
assert_true(id in window, id + " in window");
|
||||
assert_true(id in WindowProto, id + " in Window.prototype");
|
||||
assert_equals(window[id], WindowProto[id]);
|
||||
assert_data_propdesc(Object.getOwnPropertyDescriptor(WindowProto, id),
|
||||
true, true, true);
|
||||
}, "Window method: " + id);
|
||||
});
|
||||
readonlyAttributes.forEach(function(id) {
|
||||
test(function() {
|
||||
var WindowProto = Window.prototype;
|
||||
assert_true(id in window, id + " in window");
|
||||
assert_true(id in WindowProto, id + " in Window.prototype");
|
||||
assert_accessor_propdesc(Object.getOwnPropertyDescriptor(WindowProto, id),
|
||||
false, true, true);
|
||||
}, "Window readonly attribute: " + id);
|
||||
});
|
||||
writableAttributes.forEach(function(id) {
|
||||
test(function() {
|
||||
var WindowProto = Window.prototype;
|
||||
assert_true(id in window, id + " in window");
|
||||
assert_true(id in WindowProto, id + " in Window.prototype");
|
||||
assert_accessor_propdesc(Object.getOwnPropertyDescriptor(WindowProto, id),
|
||||
true, true, true);
|
||||
}, "Window attribute: " + id);
|
||||
});
|
||||
unforgeableAttributes.forEach(function(id) {
|
||||
test(function() {
|
||||
var WindowProto = Window.prototype;
|
||||
assert_true(id in window, id + " in window");
|
||||
// location has a [PutForwards] extended attribute.
|
||||
assert_accessor_propdesc(Object.getOwnPropertyDescriptor(window, id),
|
||||
id === "location", true, false);
|
||||
assert_false(id in WindowProto, id + " in Window.prototype");
|
||||
}, "Window unforgeable attribute: " + id);
|
||||
});
|
||||
replacableAttributes.forEach(function(id) {
|
||||
test(function() {
|
||||
var WindowProto = Window.prototype;
|
||||
assert_true(id in window, id + " in window");
|
||||
assert_true(id in WindowProto, id + " in Window.prototype");
|
||||
assert_accessor_propdesc(Object.getOwnPropertyDescriptor(WindowProto, id),
|
||||
true, true, true);
|
||||
}, "Window replaceable attribute: " + id);
|
||||
});
|
||||
}, "Window interface");
|
||||
test(function() {
|
||||
assert_equals(window.constructor, Window);
|
||||
assert_false(window.hasOwnProperty("constructor"), "window.constructor should not be an own property.");
|
||||
assert_data_propdesc(Object.getOwnPropertyDescriptor(Window.prototype, "constructor"),
|
||||
true, false, true);
|
||||
}, "constructor");
|
||||
</script>
|
@ -0,0 +1,35 @@
|
||||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Prototype chain of the window object</title>
|
||||
<link rel="author" title="Ms2ger" href="ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html/#window">
|
||||
<link rel="help" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#eventtarget">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#interface-prototype-object">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#named-properties-object">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_class_string(window, "Window");
|
||||
}, "window object");
|
||||
test(function() {
|
||||
var proto = Object.getPrototypeOf(window);
|
||||
assert_class_string(proto, "WindowPrototype");
|
||||
assert_equals(proto, Window.prototype);
|
||||
}, "Window.prototype");
|
||||
test(function() {
|
||||
var gsp = Object.getPrototypeOf(Object.getPrototypeOf(window));
|
||||
assert_class_string(gsp, "WindowProperties");
|
||||
}, "Global scope polluter");
|
||||
test(function() {
|
||||
var protoproto = Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(window)));
|
||||
assert_class_string(protoproto, "EventTargetPrototype");
|
||||
assert_equals(protoproto, EventTarget.prototype);
|
||||
}, "EventTarget.prototype");
|
||||
test(function() {
|
||||
var protoprotoproto = Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(window))));
|
||||
assert_class_string(protoprotoproto, "Object");
|
||||
assert_equals(protoprotoproto, Object.prototype);
|
||||
}, "Object.prototype");
|
||||
</script>
|
@ -0,0 +1,33 @@
|
||||
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_document.body-getter-body-and-frameset.html \
|
||||
test_document.body-getter-foreign-frameset.html \
|
||||
test_document.body-getter-frameset-and-body.html \
|
||||
test_document.body-setter-01.html \
|
||||
test_document.embeds-document.plugins-01.html \
|
||||
test_Document.getElementsByClassName-null-undef.html \
|
||||
test_document.getElementsByClassName-same.html \
|
||||
test_document.head-01.html \
|
||||
test_document.head-02.html \
|
||||
test_document.title-01.html \
|
||||
test_document.title-02.xhtml \
|
||||
test_document.title-03.html \
|
||||
test_document.title-04.xhtml \
|
||||
test_document.title-05.html \
|
||||
test_document.title-06.html \
|
||||
test_document.title-07.html \
|
||||
test_Element.getElementsByClassName-null-undef.html \
|
||||
test_nameditem-01.html \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,28 @@
|
||||
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_document.getElementsByName-case.html \
|
||||
test_document.getElementsByName-case.xhtml \
|
||||
test_document.getElementsByName-id.html \
|
||||
test_document.getElementsByName-id.xhtml \
|
||||
test_document.getElementsByName-namespace.html \
|
||||
test_document.getElementsByName-namespace.xhtml \
|
||||
test_document.getElementsByName-newelements.html \
|
||||
test_document.getElementsByName-newelements.xhtml \
|
||||
test_document.getElementsByName-null-undef.html \
|
||||
test_document.getElementsByName-null-undef.xhtml \
|
||||
test_document.getElementsByName-param.html \
|
||||
test_document.getElementsByName-param.xhtml \
|
||||
test_document.getElementsByName-same.html \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<title>getElementsByName and case</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<div name="abcd"></div>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByName("ABCD").length, 0);
|
||||
assert_equals(document.getElementsByName("abcd").length, 1);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,22 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>getElementsByName and case</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname"/>
|
||||
<link rel="stylesheet" href="/resources/testharness.css"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<div name="abcd"></div>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByName("ABCD").length, 0);
|
||||
assert_equals(document.getElementsByName("abcd").length, 1);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<title>getElementsByName and ids</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<div id="abcd"></div>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByName("abcd").length, 0);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,21 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>getElementsByName and ids</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname"/>
|
||||
<link rel="stylesheet" href="/resources/testharness.css"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<div id="abcd"></div>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByName("abcd").length, 0);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<title>getElementsByName and foreign namespaces</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<p name="math"><math name="math">
|
||||
<mi>a</mi>
|
||||
<mo>+</mo>
|
||||
<mi>b</mi>
|
||||
</math>
|
||||
<p name="svg"><svg width="300" height="100" name="svg">
|
||||
<rect width="300" height="100" fill="rgb(0,0,255)"/>
|
||||
</svg>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
var ps = document.getElementById("test")
|
||||
.getElementsByTagName("p");
|
||||
assert_equals(document.getElementsByName("math").length, 1);
|
||||
assert_equals(document.getElementsByName("math")[0], ps[0]);
|
||||
assert_equals(document.getElementsByName("svg").length, 1);
|
||||
assert_equals(document.getElementsByName("svg")[0], ps[1]);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,33 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>getElementsByName and foreign namespaces</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname"/>
|
||||
<link rel="stylesheet" href="/resources/testharness.css"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<p name="math"><math name="math" xmlns="http://www.w3.org/1998/Math/MathML">
|
||||
<mi>a</mi>
|
||||
<mo>+</mo>
|
||||
<mi>b</mi>
|
||||
</math></p>
|
||||
<p name="svg"><svg width="300" height="100" name="svg" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="300" height="100" fill="rgb(0,0,255)"/>
|
||||
</svg></p>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
var ps = document.getElementById("test")
|
||||
.getElementsByTagName("p");
|
||||
assert_equals(document.getElementsByName("math").length, 1);
|
||||
assert_equals(document.getElementsByName("math")[0], ps[0]);
|
||||
assert_equals(document.getElementsByName("svg").length, 1);
|
||||
assert_equals(document.getElementsByName("svg")[0], ps[1]);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,122 @@
|
||||
<!DOCTYPE html>
|
||||
<title>getElementsByName and newly introduced HTML elements</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<section name="section"></section>
|
||||
<article name="article"></article>
|
||||
<aside name="aside"></aside>
|
||||
<hgroup name="hgroup"></hgroup>
|
||||
<header name="header"></header>
|
||||
<footer name="footer"></footer>
|
||||
<nav name="nav"></nav>
|
||||
<dialog name="dialog"></dialog>
|
||||
<figure name="figure"></figure>
|
||||
<audio name="audio"></audio>
|
||||
<video name="video"></video>
|
||||
<embed name="embed"></embed>
|
||||
<mark name="mark"></mark>
|
||||
<meter name="meter"></meter>
|
||||
<progress name="progress"></progress>
|
||||
<time name="time"></time>
|
||||
<canvas name="canvas"></canvas>
|
||||
<command name="command"></command>
|
||||
<menu name="menu"></menu>
|
||||
<details name="details"></details>
|
||||
<datalist name="datalist"></datalist>
|
||||
<keygen name="keygen"></keygen>
|
||||
<output name="output"></output>
|
||||
<ruby name="ruby"></ruby>
|
||||
<rt name="rt"></rt>
|
||||
<rp name="rp"></rp>
|
||||
<source name="source">
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByName("section").length, 1);
|
||||
assert_equals(document.getElementsByName("section")[0],
|
||||
document.getElementsByTagName("section")[0]);
|
||||
assert_equals(document.getElementsByName("article").length, 1);
|
||||
assert_equals(document.getElementsByName("article")[0],
|
||||
document.getElementsByTagName("article")[0]);
|
||||
assert_equals(document.getElementsByName("aside").length, 1);
|
||||
assert_equals(document.getElementsByName("aside")[0],
|
||||
document.getElementsByTagName("aside")[0]);
|
||||
assert_equals(document.getElementsByName("hgroup").length, 1);
|
||||
assert_equals(document.getElementsByName("hgroup")[0],
|
||||
document.getElementsByTagName("hgroup")[0]);
|
||||
assert_equals(document.getElementsByName("header").length, 1);
|
||||
assert_equals(document.getElementsByName("header")[0],
|
||||
document.getElementsByTagName("header")[0]);
|
||||
assert_equals(document.getElementsByName("footer").length, 1);
|
||||
assert_equals(document.getElementsByName("footer")[0],
|
||||
document.getElementsByTagName("footer")[0]);
|
||||
assert_equals(document.getElementsByName("nav").length, 1);
|
||||
assert_equals(document.getElementsByName("nav")[0],
|
||||
document.getElementsByTagName("nav")[0]);
|
||||
assert_equals(document.getElementsByName("dialog").length, 1);
|
||||
assert_equals(document.getElementsByName("dialog")[0],
|
||||
document.getElementsByTagName("dialog")[0]);
|
||||
assert_equals(document.getElementsByName("figure").length, 1);
|
||||
assert_equals(document.getElementsByName("figure")[0],
|
||||
document.getElementsByTagName("figure")[0]);
|
||||
assert_equals(document.getElementsByName("audio").length, 1);
|
||||
assert_equals(document.getElementsByName("audio")[0],
|
||||
document.getElementsByTagName("audio")[0]);
|
||||
assert_equals(document.getElementsByName("video").length, 1);
|
||||
assert_equals(document.getElementsByName("video")[0],
|
||||
document.getElementsByTagName("video")[0]);
|
||||
assert_equals(document.getElementsByName("embed").length, 1);
|
||||
assert_equals(document.getElementsByName("embed")[0],
|
||||
document.getElementsByTagName("embed")[0]);
|
||||
assert_equals(document.getElementsByName("mark").length, 1);
|
||||
assert_equals(document.getElementsByName("mark")[0],
|
||||
document.getElementsByTagName("mark")[0]);
|
||||
assert_equals(document.getElementsByName("meter").length, 1);
|
||||
assert_equals(document.getElementsByName("meter")[0],
|
||||
document.getElementsByTagName("meter")[0]);
|
||||
assert_equals(document.getElementsByName("progress").length, 1);
|
||||
assert_equals(document.getElementsByName("progress")[0],
|
||||
document.getElementsByTagName("progress")[0]);
|
||||
assert_equals(document.getElementsByName("time").length, 1);
|
||||
assert_equals(document.getElementsByName("time")[0],
|
||||
document.getElementsByTagName("time")[0]);
|
||||
assert_equals(document.getElementsByName("canvas").length, 1);
|
||||
assert_equals(document.getElementsByName("canvas")[0],
|
||||
document.getElementsByTagName("canvas")[0]);
|
||||
assert_equals(document.getElementsByName("command").length, 1);
|
||||
assert_equals(document.getElementsByName("command")[0],
|
||||
document.getElementsByTagName("command")[0]);
|
||||
assert_equals(document.getElementsByName("menu").length, 1);
|
||||
assert_equals(document.getElementsByName("menu")[0],
|
||||
document.getElementsByTagName("menu")[0]);
|
||||
assert_equals(document.getElementsByName("details").length, 1);
|
||||
assert_equals(document.getElementsByName("details")[0],
|
||||
document.getElementsByTagName("details")[0]);
|
||||
assert_equals(document.getElementsByName("datalist").length, 1);
|
||||
assert_equals(document.getElementsByName("datalist")[0],
|
||||
document.getElementsByTagName("datalist")[0]);
|
||||
assert_equals(document.getElementsByName("keygen").length, 1);
|
||||
assert_equals(document.getElementsByName("keygen")[0],
|
||||
document.getElementsByTagName("keygen")[0]);
|
||||
assert_equals(document.getElementsByName("output").length, 1);
|
||||
assert_equals(document.getElementsByName("output")[0],
|
||||
document.getElementsByTagName("output")[0]);
|
||||
assert_equals(document.getElementsByName("ruby").length, 1);
|
||||
assert_equals(document.getElementsByName("ruby")[0],
|
||||
document.getElementsByTagName("ruby")[0]);
|
||||
assert_equals(document.getElementsByName("rt").length, 1);
|
||||
assert_equals(document.getElementsByName("rt")[0],
|
||||
document.getElementsByTagName("rt")[0]);
|
||||
assert_equals(document.getElementsByName("rp").length, 1);
|
||||
assert_equals(document.getElementsByName("rp")[0],
|
||||
document.getElementsByTagName("rp")[0]);
|
||||
assert_equals(document.getElementsByName("source").length, 1);
|
||||
assert_equals(document.getElementsByName("source")[0],
|
||||
document.getElementsByTagName("source")[0]);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,127 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>getElementsByName and newly introduced HTML elements</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname"/>
|
||||
<link rel="stylesheet" href="/resources/testharness.css"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<section name="section"></section>
|
||||
<article name="article"></article>
|
||||
<aside name="aside"></aside>
|
||||
<hgroup name="hgroup"></hgroup>
|
||||
<header name="header"></header>
|
||||
<footer name="footer"></footer>
|
||||
<nav name="nav"></nav>
|
||||
<dialog name="dialog"></dialog>
|
||||
<figure name="figure"></figure>
|
||||
<audio name="audio"></audio>
|
||||
<video name="video"></video>
|
||||
<embed name="embed"></embed>
|
||||
<mark name="mark"></mark>
|
||||
<meter name="meter"></meter>
|
||||
<progress name="progress"></progress>
|
||||
<time name="time"></time>
|
||||
<canvas name="canvas"></canvas>
|
||||
<command name="command"></command>
|
||||
<menu name="menu"></menu>
|
||||
<details name="details"></details>
|
||||
<datalist name="datalist"></datalist>
|
||||
<keygen name="keygen"></keygen>
|
||||
<output name="output"></output>
|
||||
<ruby name="ruby"></ruby>
|
||||
<rt name="rt"></rt>
|
||||
<rp name="rp"></rp>
|
||||
<source name="source"/>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByName("section").length, 1);
|
||||
assert_equals(document.getElementsByName("section")[0],
|
||||
document.getElementsByTagName("section")[0]);
|
||||
assert_equals(document.getElementsByName("article").length, 1);
|
||||
assert_equals(document.getElementsByName("article")[0],
|
||||
document.getElementsByTagName("article")[0]);
|
||||
assert_equals(document.getElementsByName("aside").length, 1);
|
||||
assert_equals(document.getElementsByName("aside")[0],
|
||||
document.getElementsByTagName("aside")[0]);
|
||||
assert_equals(document.getElementsByName("hgroup").length, 1);
|
||||
assert_equals(document.getElementsByName("hgroup")[0],
|
||||
document.getElementsByTagName("hgroup")[0]);
|
||||
assert_equals(document.getElementsByName("header").length, 1);
|
||||
assert_equals(document.getElementsByName("header")[0],
|
||||
document.getElementsByTagName("header")[0]);
|
||||
assert_equals(document.getElementsByName("footer").length, 1);
|
||||
assert_equals(document.getElementsByName("footer")[0],
|
||||
document.getElementsByTagName("footer")[0]);
|
||||
assert_equals(document.getElementsByName("nav").length, 1);
|
||||
assert_equals(document.getElementsByName("nav")[0],
|
||||
document.getElementsByTagName("nav")[0]);
|
||||
assert_equals(document.getElementsByName("dialog").length, 1);
|
||||
assert_equals(document.getElementsByName("dialog")[0],
|
||||
document.getElementsByTagName("dialog")[0]);
|
||||
assert_equals(document.getElementsByName("figure").length, 1);
|
||||
assert_equals(document.getElementsByName("figure")[0],
|
||||
document.getElementsByTagName("figure")[0]);
|
||||
assert_equals(document.getElementsByName("audio").length, 1);
|
||||
assert_equals(document.getElementsByName("audio")[0],
|
||||
document.getElementsByTagName("audio")[0]);
|
||||
assert_equals(document.getElementsByName("video").length, 1);
|
||||
assert_equals(document.getElementsByName("video")[0],
|
||||
document.getElementsByTagName("video")[0]);
|
||||
assert_equals(document.getElementsByName("embed").length, 1);
|
||||
assert_equals(document.getElementsByName("embed")[0],
|
||||
document.getElementsByTagName("embed")[0]);
|
||||
assert_equals(document.getElementsByName("mark").length, 1);
|
||||
assert_equals(document.getElementsByName("mark")[0],
|
||||
document.getElementsByTagName("mark")[0]);
|
||||
assert_equals(document.getElementsByName("meter").length, 1);
|
||||
assert_equals(document.getElementsByName("meter")[0],
|
||||
document.getElementsByTagName("meter")[0]);
|
||||
assert_equals(document.getElementsByName("progress").length, 1);
|
||||
assert_equals(document.getElementsByName("progress")[0],
|
||||
document.getElementsByTagName("progress")[0]);
|
||||
assert_equals(document.getElementsByName("time").length, 1);
|
||||
assert_equals(document.getElementsByName("time")[0],
|
||||
document.getElementsByTagName("time")[0]);
|
||||
assert_equals(document.getElementsByName("canvas").length, 1);
|
||||
assert_equals(document.getElementsByName("canvas")[0],
|
||||
document.getElementsByTagName("canvas")[0]);
|
||||
assert_equals(document.getElementsByName("command").length, 1);
|
||||
assert_equals(document.getElementsByName("command")[0],
|
||||
document.getElementsByTagName("command")[0]);
|
||||
assert_equals(document.getElementsByName("menu").length, 1);
|
||||
assert_equals(document.getElementsByName("menu")[0],
|
||||
document.getElementsByTagName("menu")[0]);
|
||||
assert_equals(document.getElementsByName("details").length, 1);
|
||||
assert_equals(document.getElementsByName("details")[0],
|
||||
document.getElementsByTagName("details")[0]);
|
||||
assert_equals(document.getElementsByName("datalist").length, 1);
|
||||
assert_equals(document.getElementsByName("datalist")[0],
|
||||
document.getElementsByTagName("datalist")[0]);
|
||||
assert_equals(document.getElementsByName("keygen").length, 1);
|
||||
assert_equals(document.getElementsByName("keygen")[0],
|
||||
document.getElementsByTagName("keygen")[0]);
|
||||
assert_equals(document.getElementsByName("output").length, 1);
|
||||
assert_equals(document.getElementsByName("output")[0],
|
||||
document.getElementsByTagName("output")[0]);
|
||||
assert_equals(document.getElementsByName("ruby").length, 1);
|
||||
assert_equals(document.getElementsByName("ruby")[0],
|
||||
document.getElementsByTagName("ruby")[0]);
|
||||
assert_equals(document.getElementsByName("rt").length, 1);
|
||||
assert_equals(document.getElementsByName("rt")[0],
|
||||
document.getElementsByTagName("rt")[0]);
|
||||
assert_equals(document.getElementsByName("rp").length, 1);
|
||||
assert_equals(document.getElementsByName("rp")[0],
|
||||
document.getElementsByTagName("rp")[0]);
|
||||
assert_equals(document.getElementsByName("source").length, 1);
|
||||
assert_equals(document.getElementsByName("source")[0],
|
||||
document.getElementsByTagName("source")[0]);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<title>Calling getElementsByName with null and undefined</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#es-DOMString">
|
||||
<link rel="help" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf#page=57">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var n = document.createElement("div");
|
||||
n.setAttribute("name", "null");
|
||||
document.body.appendChild(n);
|
||||
var u = document.createElement("div");
|
||||
u.setAttribute("name", "undefined");
|
||||
document.body.appendChild(u);
|
||||
|
||||
// assert_equals(document.getElementsByName(null)[0], n);
|
||||
assert_equals(document.getElementsByName(undefined)[0], u);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,29 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Calling getElementsByName with null and undefined</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname"/>
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#es-DOMString"/>
|
||||
<link rel="help" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf#page=57"/>
|
||||
<link rel="stylesheet" href="/resources/testharness.css"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var n = document.createElement("div");
|
||||
n.setAttribute("name", "null");
|
||||
document.body.appendChild(n);
|
||||
var u = document.createElement("div");
|
||||
u.setAttribute("name", "undefined");
|
||||
document.body.appendChild(u);
|
||||
|
||||
// assert_equals(document.getElementsByName(null)[0], n);
|
||||
assert_equals(document.getElementsByName(undefined)[0], u);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<title>getElementsByName and the param element</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<param name="test1">
|
||||
<object>
|
||||
<param name="test2">
|
||||
</object>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByName("test1").length, 1);
|
||||
assert_equals(document.getElementsByName("test1")[0],
|
||||
document.getElementsByTagName("param")[0]);
|
||||
assert_equals(document.getElementsByName("test2").length, 1);
|
||||
assert_equals(document.getElementsByName("test2")[0],
|
||||
document.getElementsByTagName("param")[1]);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,29 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>getElementsByName and the param element</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname"/>
|
||||
<link rel="stylesheet" href="/resources/testharness.css"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<param name="test1"/>
|
||||
<object>
|
||||
<param name="test2"/>
|
||||
</object>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByName("test1").length, 1);
|
||||
assert_equals(document.getElementsByName("test1")[0],
|
||||
document.getElementsByTagName("param")[0]);
|
||||
assert_equals(document.getElementsByName("test2").length, 1);
|
||||
assert_equals(document.getElementsByName("test2")[0],
|
||||
document.getElementsByTagName("param")[1]);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<title>Calling getElementsByName with the same argument</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-getelementsbyname">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<div name="abcd"></div>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
var list1 = document.getElementsByName("abcd");
|
||||
var list2 = document.getElementsByName("abcd");
|
||||
assert_true(list1 === list2 || list1 !== list2);
|
||||
}, "The user agent may return the same object as the object returned by the earlier call.");
|
||||
</script>
|
@ -0,0 +1,5 @@
|
||||
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
'document.getElementsByName',
|
||||
]
|
@ -0,0 +1,31 @@
|
||||
<!doctype html>
|
||||
<title>getElementsByClassName and null/undefined</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-getelementsbyclassname">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<p id="p1"></p>
|
||||
<p class="undefined" id="p2"></p>
|
||||
<p class="null" id="p3"></p>
|
||||
<p class="undefined null" id="p4"></p>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
var wrapper = document.getElementById("test");
|
||||
assert_equals(document.getElementsByClassName(undefined).length, 2);
|
||||
assert_equals(document.getElementsByClassName(undefined)[0],
|
||||
document.getElementById("p2"));
|
||||
assert_equals(document.getElementsByClassName(undefined)[1],
|
||||
document.getElementById("p4"));
|
||||
/*
|
||||
assert_equals(document.getElementsByClassName(null).length, 2);
|
||||
assert_equals(document.getElementsByClassName(null)[0],
|
||||
document.getElementById("p3"));
|
||||
assert_equals(document.getElementsByClassName(null)[1],
|
||||
document.getElementById("p4"));
|
||||
*/
|
||||
});
|
||||
</script>
|
@ -0,0 +1,31 @@
|
||||
<!doctype html>
|
||||
<title>getElementsByClassName and null/undefined</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-getelementsbyclassname">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<p id="p1"></p>
|
||||
<p class="undefined" id="p2"></p>
|
||||
<p class="null" id="p3"></p>
|
||||
<p class="undefined null" id="p4"></p>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
var wrapper = document.getElementById("test");
|
||||
assert_equals(wrapper.getElementsByClassName(undefined).length, 2);
|
||||
assert_equals(wrapper.getElementsByClassName(undefined)[0],
|
||||
document.getElementById("p2"));
|
||||
assert_equals(wrapper.getElementsByClassName(undefined)[1],
|
||||
document.getElementById("p4"));
|
||||
/*
|
||||
assert_equals(wrapper.getElementsByClassName(null).length, 2);
|
||||
assert_equals(wrapper.getElementsByClassName(null)[0],
|
||||
document.getElementById("p3"));
|
||||
assert_equals(wrapper.getElementsByClassName(null)[1],
|
||||
document.getElementById("p4"));
|
||||
*/
|
||||
});
|
||||
</script>
|
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<title>document.body and framesets</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-body">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var b =
|
||||
document.documentElement.appendChild(document.createElement("body"));
|
||||
document.documentElement.appendChild(document.createElement("frameset"));
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.body, b);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<title>document.body and a frameset in a foreign namespace</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-body">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
document.documentElement.appendChild(
|
||||
document.createElementNS("http://example.org/test", "frameset"));
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.body, document.getElementsByTagName("body")[0]);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<title>document.body and framesets</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-body">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var f =
|
||||
document.documentElement.appendChild(document.createElement("frameset"));
|
||||
document.documentElement.appendChild(document.createElement("body"));
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.body, f);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<title>Setting document.body to incorrect values</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-body">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#es-interface">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_throws(new TypeError(), function() { document.body = "text" })
|
||||
}, "Should throw a TypeError.");
|
||||
test(function() {
|
||||
assert_throws("HIERARCHY_REQUEST_ERR", function() { document.body = document.createElement("div") })
|
||||
}, "Should throw a HIERARCHY_REQUEST_ERR.");
|
||||
</script>
|
@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<title>document.embeds and document.plugins</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-embeds">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-plugins">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.embeds, document.plugins);
|
||||
assert_equals(document.embeds.length, 0);
|
||||
assert_equals(document.plugins.length, 0);
|
||||
});
|
||||
test(function() {
|
||||
document.body.appendChild(document.createElement("embed"));
|
||||
assert_equals(document.embeds, document.plugins);
|
||||
assert_equals(document.embeds.length, 1);
|
||||
assert_equals(document.plugins.length, 1);
|
||||
assert_equals(document.embeds[0], document.getElementsByTagName("embed")[0]);
|
||||
assert_equals(document.plugins[0], document.getElementsByTagName("embed")[0]);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<title>Calling getElementsByClassName with the same argument</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-getelementsbyclassname">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<div class="abcd"></div>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
var list1 = document.getElementsByClassName("abcd");
|
||||
var list2 = document.getElementsByClassName("abcd");
|
||||
assert_true(list1 === list2 || list1 !== list2);
|
||||
}, "The user agent may return the same object as the object returned by the earlier call.");
|
||||
</script>
|
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<title>document.head</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-head">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var head = document.getElementsByTagName("head")[0];
|
||||
assert_equals(document.head, head);
|
||||
document.head = "";
|
||||
assert_equals(document.head, head);
|
||||
document.head = document.createElement("head");
|
||||
assert_equals(document.head, head);
|
||||
document.documentElement.appendChild(document.createElement("head"));
|
||||
assert_equals(document.head, head);
|
||||
var head2 = document.createElement("head");
|
||||
document.documentElement.insertBefore(head2, head);
|
||||
assert_equals(document.head, head2);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<title>document.head</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-head">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var HTML = "http://www.w3.org/1999/xhtml";
|
||||
test(function() {
|
||||
var head = document.getElementsByTagName("head")[0];
|
||||
assert_equals(document.head, head);
|
||||
var head2 = document.createElementNS(HTML, "blah:head");
|
||||
document.documentElement.insertBefore(head2, head);
|
||||
assert_equals(document.head, head2);
|
||||
var head3 = document.createElementNS("http://www.example.org/", "blah:head");
|
||||
document.documentElement.insertBefore(head3, head2);
|
||||
assert_equals(document.head, head2);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<title>document.title with head blown away</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#document.title">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.title, "document.title with head blown away");
|
||||
})
|
||||
test(function() {
|
||||
var head = document.getElementsByTagName("head")[0];
|
||||
assert_true(!!head, "Head gone?!")
|
||||
head.parentNode.removeChild(head);
|
||||
assert_false(!!document.getElementsByTagName("head")[0], "Head still there?!")
|
||||
document.title = "FAIL";
|
||||
assert_equals(document.title, "");
|
||||
})
|
||||
test(function() {
|
||||
var title2 = document.createElement("title");
|
||||
title2.appendChild(document.createTextNode("PASS"));
|
||||
document.body.appendChild(title2);
|
||||
assert_equals(document.title, "PASS");
|
||||
})
|
||||
test(function() {
|
||||
var title3 = document.createElement("title");
|
||||
title3.appendChild(document.createTextNode("PASS2"));
|
||||
document.documentElement.insertBefore(title3, document.body);
|
||||
assert_equals(document.title, "PASS2");
|
||||
})
|
||||
</script>
|
@ -0,0 +1,38 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>document.title with head blown away</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#document.title"/>
|
||||
<link rel="stylesheet" href="/resources/testharness.css"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.title, "document.title with head blown away");
|
||||
})
|
||||
test(function() {
|
||||
var head = document.getElementsByTagName("head")[0];
|
||||
assert_true(!!head, "Head gone?!")
|
||||
head.parentNode.removeChild(head);
|
||||
assert_false(!!document.getElementsByTagName("head")[0], "Head still there?!")
|
||||
document.title = "FAIL";
|
||||
assert_equals(document.title, "");
|
||||
})
|
||||
test(function() {
|
||||
var title2 = document.createElement("title");
|
||||
title2.appendChild(document.createTextNode("PASS"));
|
||||
document.body.appendChild(title2);
|
||||
assert_equals(document.title, "PASS");
|
||||
})
|
||||
test(function() {
|
||||
var title3 = document.createElement("title");
|
||||
title3.appendChild(document.createTextNode("PASS2"));
|
||||
document.documentElement.insertBefore(title3, document.body);
|
||||
assert_equals(document.title, "PASS2");
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<title> document.title and space normalization </title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#document.title">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
// Single space characters must be normalized. (WHATWG r4353)
|
||||
assert_equals(document.title, "document.title and space normalization");
|
||||
|
||||
document.title = "one space";
|
||||
assert_equals(document.title, "one space");
|
||||
|
||||
document.title = "two spaces";
|
||||
assert_equals(document.title, "two spaces");
|
||||
|
||||
document.title = "one\ttab";
|
||||
assert_equals(document.title, "one tab");
|
||||
|
||||
document.title = "two\t\ttabs";
|
||||
assert_equals(document.title, "two tabs");
|
||||
|
||||
document.title = "one\nnewline";
|
||||
assert_equals(document.title, "one newline");
|
||||
|
||||
document.title = "two\n\nnewlines";
|
||||
assert_equals(document.title, "two newlines");
|
||||
|
||||
document.title = "one\fform feed";
|
||||
assert_equals(document.title, "one form feed");
|
||||
|
||||
document.title = "two\f\fform feeds";
|
||||
assert_equals(document.title, "two form feeds");
|
||||
|
||||
document.title = "one\rcarriage return";
|
||||
assert_equals(document.title, "one carriage return");
|
||||
|
||||
document.title = "two\r\rcarriage returns";
|
||||
assert_equals(document.title, "two carriage returns");
|
||||
});
|
||||
</script>
|
@ -0,0 +1,49 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title> document.title and space normalization </title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#document.title"/>
|
||||
<link rel="stylesheet" href="/resources/testharness.css"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
// Single space characters must be normalized. (WHATWG r4353)
|
||||
assert_equals(document.title, "document.title and space normalization");
|
||||
|
||||
document.title = "one space";
|
||||
assert_equals(document.title, "one space");
|
||||
|
||||
document.title = "two spaces";
|
||||
assert_equals(document.title, "two spaces");
|
||||
|
||||
document.title = "one\ttab";
|
||||
assert_equals(document.title, "one tab");
|
||||
|
||||
document.title = "two\t\ttabs";
|
||||
assert_equals(document.title, "two tabs");
|
||||
|
||||
document.title = "one\nnewline";
|
||||
assert_equals(document.title, "one newline");
|
||||
|
||||
document.title = "two\n\nnewlines";
|
||||
assert_equals(document.title, "two newlines");
|
||||
|
||||
document.title = "one\fform feed";
|
||||
assert_equals(document.title, "one form feed");
|
||||
|
||||
document.title = "two\f\fform feeds";
|
||||
assert_equals(document.title, "two form feeds");
|
||||
|
||||
document.title = "one\rcarriage return";
|
||||
assert_equals(document.title, "one carriage return");
|
||||
|
||||
document.title = "two\r\rcarriage returns";
|
||||
assert_equals(document.title, "two carriage returns");
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,41 @@
|
||||
<!doctype html>
|
||||
<title>document.title and White_Space characters</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#document.title">
|
||||
<meta name="assert" content="Only HTML white space characters should be normalised.">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var White_Space = [
|
||||
"\u000B",
|
||||
"\u0085",
|
||||
"\u00A0",
|
||||
"\u1680",
|
||||
"\u180E",
|
||||
"\u2000",
|
||||
"\u2001",
|
||||
"\u2002",
|
||||
"\u2003",
|
||||
"\u2004",
|
||||
"\u2005",
|
||||
"\u2006",
|
||||
"\u2007",
|
||||
"\u2008",
|
||||
"\u2009",
|
||||
"\u200A",
|
||||
"\u2028",
|
||||
"\u2029",
|
||||
"\u202F",
|
||||
"\u205F",
|
||||
"\u3000"];
|
||||
for (var i = 0, il = White_Space.length; i < il; ++i) {
|
||||
document.title = "a" + White_Space[i] + White_Space[i] + "b" +
|
||||
White_Space[i] + "c" + i;
|
||||
assert_equals(document.title, "a" + White_Space[i] + White_Space[i] + "b" +
|
||||
White_Space[i] + "c" + i);
|
||||
}
|
||||
});
|
||||
</script>
|
@ -0,0 +1,24 @@
|
||||
<!doctype html>
|
||||
<title>document.title and the empty string</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#document.title">
|
||||
<meta name="assert" content="On setting document.title, a text node must be created.">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
document.documentElement.firstChild.removeChild(
|
||||
document.documentElement.firstChild.firstChild);
|
||||
assert_equals(document.title, "");
|
||||
document.title = "";
|
||||
assert_equals(document.title, "");
|
||||
assert_true(document.documentElement.firstChild.lastChild instanceof
|
||||
HTMLTitleElement, "Need a title element.");
|
||||
var title = document.documentElement.firstChild.lastChild.firstChild;
|
||||
assert_true(title, "Need a node.");
|
||||
assert_true(title instanceof Text, "Should be a text node");
|
||||
assert_equals(title.value, "");
|
||||
});
|
||||
</script>
|
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<title>Document.title and DOMImplementation.createHTMLDocument</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function checkDoc(title, expectedtitle, normalizedtitle) {
|
||||
test(function() {
|
||||
var doc = document.implementation.createHTMLDocument(title);
|
||||
assert_equals(doc.title, normalizedtitle)
|
||||
})
|
||||
}
|
||||
checkDoc("", "", "")
|
||||
checkDoc(null, "null", "null")
|
||||
checkDoc(undefined, "undefined", "undefined")
|
||||
checkDoc("foo bar baz", "foo bar baz", "foo bar baz")
|
||||
checkDoc("foo\t\tbar baz", "foo\t\tbar baz", "foo bar baz")
|
||||
checkDoc("foo\n\nbar baz", "foo\n\nbar baz", "foo bar baz")
|
||||
checkDoc("foo\f\fbar baz", "foo\f\fbar baz", "foo bar baz")
|
||||
checkDoc("foo\r\rbar baz", "foo\r\rbar baz", "foo bar baz")
|
||||
</script>
|
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<title>Named items: img id & name</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-nameditem">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<img id="a" name="b">
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.a, document.getElementsByTagName("img")[0]);
|
||||
assert_equals(document['a'], document.getElementsByTagName("img")[0]);
|
||||
assert_equals(document.b, document.getElementsByTagName("img")[0]);
|
||||
assert_equals(document['b'], document.getElementsByTagName("img")[0]);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,25 @@
|
||||
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_classlist-nonstring.html \
|
||||
test_dataset-delete.html \
|
||||
test_dataset-enumeration.html \
|
||||
test_dataset-get.html \
|
||||
test_dataset.html \
|
||||
test_dataset-instanceof.html \
|
||||
test_dataset-set.html \
|
||||
test_document-dir.html \
|
||||
test_id-attribute.html \
|
||||
test_id-name.html \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<title>classList: non-string contains</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#classes">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#domtokenlist">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/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>
|
||||
<div id="test">
|
||||
<ul>
|
||||
<li class=undefined>
|
||||
<li class=null>
|
||||
<li class=0>
|
||||
<li class=NaN>
|
||||
<li class=Infinity>
|
||||
<li class=-Infinity>
|
||||
</ul>
|
||||
<script>
|
||||
var items = document.getElementById("test")
|
||||
.getElementsByTagName("li");
|
||||
var tests = [undefined, null, -0, +0, NaN, +Infinity, -Infinity];
|
||||
var results = [
|
||||
[true, false, false, false, false, false, false], // "undefined"
|
||||
[false, true, false, false, false, false, false], // "null"
|
||||
[false, false, true, true, false, false, false], // "0"
|
||||
[false, false, false, false, true, false, false], // "NaN"
|
||||
[false, false, false, false, false, true, false], // "Infinity"
|
||||
[false, false, false, false, false, false, true ] // "-Infinity"
|
||||
];
|
||||
</script>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
for (var i = 0, il = items.length; i < il; ++i) {
|
||||
test(function() {
|
||||
for (var j = 0, jl = tests.length; j < jl; ++j) {
|
||||
assert_equals(items[i].classList.contains(tests[j]), results[i][j]);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Dataset - Delete</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Dataset - Delete</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function testDelete(attr, prop)
|
||||
{
|
||||
var d = document.createElement("div");
|
||||
d.setAttribute(attr, "value");
|
||||
delete d.dataset[prop];
|
||||
return d.hasAttribute(attr) === false && d.getAttribute(attr) != "value";
|
||||
}
|
||||
|
||||
function testDeleteNoAdd(prop)
|
||||
{
|
||||
var d = document.createElement("div");
|
||||
delete d.dataset[prop];
|
||||
return true;
|
||||
}
|
||||
|
||||
test(function() { assert_true(testDelete('data-foo', 'foo')); },
|
||||
"Deleting element.dataset['foo'] should also remove an attribute with name 'data-foo' should it exist.");
|
||||
test(function() { assert_true(testDelete('data-foo-bar', 'fooBar')); },
|
||||
"Deleting element.dataset['fooBar'] should also remove an attribute with name 'data-foo-bar' should it exist.");
|
||||
test(function() { assert_true(testDelete('data--', '-')); },
|
||||
"Deleting element.dataset['-'] should also remove an attribute with name 'data--' should it exist.");
|
||||
test(function() { assert_true(testDelete('data--foo', 'Foo')); },
|
||||
"Deleting element.dataset['Foo'] should also remove an attribute with name 'data--foo' should it exist.");
|
||||
test(function() { assert_true(testDeleteNoAdd('data--foo', '-foo')); },
|
||||
"Deleting element.dataset['-foo'] should also remove an attribute with name 'data--foo' should it exist.");
|
||||
test(function() { assert_true(testDelete('data---foo', '-Foo')); },
|
||||
"Deleting element.dataset['-Foo'] should also remove an attribute with name 'data---foo' should it exist.");
|
||||
test(function() { assert_true(testDelete('data-', '')); },
|
||||
"Deleting element.dataset[''] should also remove an attribute with name 'data-' should it exist.");
|
||||
test(function() { assert_true(testDelete('data-\xE0', '\xE0')); },
|
||||
"Deleting element.dataset['\xE0'] should also remove an attribute with name 'data-\xE0' should it exist.");
|
||||
test(function() { assert_true(testDeleteNoAdd('foo')); },
|
||||
"Deleting element.dataset['foo'] should not throw if even if the element does now have an attribute with the name data-foo.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Dataset - Enumeration</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Dataset - Enumeration</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function testEnumeration(array)
|
||||
{
|
||||
var d = document.createElement("div");
|
||||
for (var i = 0; i < array.length; ++i)
|
||||
d.setAttribute(array[i], "value");
|
||||
|
||||
var count = 0;
|
||||
for (var item in d.dataset)
|
||||
count++;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
test(function() { assert_equals(testEnumeration(['data-foo', 'data-bar', 'data-baz']), 3); },
|
||||
"A dataset should be enumeratable.");
|
||||
test(function() { assert_equals(testEnumeration(['data-foo', 'data-bar', 'dataFoo']), 2); },
|
||||
"Only attributes who qualify as dataset properties should be enumeratable in the dataset.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Dataset - Get</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Dataset - Get</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function testGet(attr, expected)
|
||||
{
|
||||
var d = document.createElement("div");
|
||||
d.setAttribute(attr, "value");
|
||||
return d.dataset[expected] == "value";
|
||||
}
|
||||
|
||||
test(function() { assert_true(testGet('data-foo', 'foo')); },
|
||||
"Getting element.dataset['foo'] should return the value of element.getAttribute('data-foo')'");
|
||||
test(function() { assert_true(testGet('data-foo-bar', 'fooBar')); },
|
||||
"Getting element.dataset['fooBar'] should return the value of element.getAttribute('data-foo-bar')'");
|
||||
test(function() { assert_true(testGet('data--', '-')); },
|
||||
"Getting element.dataset['-'] should return the value of element.getAttribute('data--')'");
|
||||
test(function() { assert_true(testGet('data--foo', 'Foo')); },
|
||||
"Getting element.dataset['Foo'] should return the value of element.getAttribute('data--foo')'");
|
||||
test(function() { assert_true(testGet('data---foo', '-Foo')); },
|
||||
"Getting element.dataset['-Foo'] should return the value of element.getAttribute('data---foo')'");
|
||||
test(function() { assert_true(testGet('data-Foo', 'foo')); },
|
||||
"Getting element.dataset['foo'] should return the value of element.getAttribute('data-Foo')'");
|
||||
test(function() { assert_true(testGet('data-', '')); },
|
||||
"Getting element.dataset[''] should return the value of element.getAttribute('data-')'");
|
||||
test(function() { assert_true(testGet('data-\xE0', '\xE0')); },
|
||||
"Getting element.dataset['\xE0'] should return the value of element.getAttribute('data-\xE0')'");
|
||||
|
||||
function matchesNothingInDataset(attr)
|
||||
{
|
||||
var d = document.createElement("div");
|
||||
d.setAttribute(attr, "value");
|
||||
|
||||
if (!d.dataset)
|
||||
return false;
|
||||
|
||||
var count = 0;
|
||||
for (var item in d.dataset)
|
||||
count++;
|
||||
return count == 0;
|
||||
}
|
||||
|
||||
test(function() { assert_true(matchesNothingInDataset('dataFoo')); },
|
||||
"Tests that an attribute named dataFoo does not make an entry in the dataset DOMStringMap.");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,16 @@
|
||||
<!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");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Dataset - Set</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Dataset - Set</h1>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function testSet(prop, expected)
|
||||
{
|
||||
var d = document.createElement("div");
|
||||
d.dataset[prop] = "value";
|
||||
return d.getAttribute(expected) == "value";
|
||||
}
|
||||
|
||||
test(function() { assert_true(testSet('foo', 'data-foo')); },
|
||||
"Setting element.dataset['foo'] should also change the value of element.getAttribute('data-foo')'");
|
||||
test(function() { assert_true(testSet('fooBar', 'data-foo-bar')); },
|
||||
"Setting element.dataset['fooBar'] should also change the value of element.getAttribute('data-foo-bar')'");
|
||||
test(function() { assert_true(testSet('-', 'data--')); },
|
||||
"Setting element.dataset['-'] should also change the value of element.getAttribute('data--')'");
|
||||
test(function() { assert_true(testSet('Foo', 'data--foo')); },
|
||||
"Setting element.dataset['Foo'] should also change the value of element.getAttribute('data--foo')'");
|
||||
test(function() { assert_true(testSet('-Foo', 'data---foo')); },
|
||||
"Setting element.dataset['-Foo'] should also change the value of element.getAttribute('data---foo')'");
|
||||
test(function() { assert_true(testSet('', 'data-')); },
|
||||
"Setting element.dataset[''] should also change the value of element.getAttribute('data-')'");
|
||||
test(function() { assert_true(testSet('\xE0', 'data-\xE0')); },
|
||||
"Setting element.dataset['\xE0'] should also change the value of element.getAttribute('data-\xE0')'");
|
||||
test(function() { assert_throws('SYNTAX_ERR', function() { testSet('-foo', 'dummy') }); },
|
||||
"Setting element.dataset['-foo'] should throw a SYNTAX_ERR'");
|
||||
test(function() { assert_throws('INVALID_CHARACTER_ERR', function() { testSet('foo\x20', 'dummy') }); },
|
||||
"Setting element.dataset['foo\x20'] should throw an INVALID_CHARACTER_ERR'");
|
||||
test(function() { assert_throws('INVALID_CHARACTER_ERR', function() { testSet('foo\uF900', 'dummy') }); },
|
||||
"Setting element.dataset['foo\uF900'] should throw an INVALID_CHARACTER_ERR'");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<title>dataset: should return 'undefined' for non-existent properties</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var div = document.createElement("div");
|
||||
test(function() {
|
||||
assert_false("foo" in div.dataset);
|
||||
assert_equals(div.dataset.foo, undefined);
|
||||
}, "Should return 'undefined' before setting an attribute")
|
||||
test(function() {
|
||||
div.setAttribute("data-foo", "value");
|
||||
assert_true("foo" in div.dataset);
|
||||
assert_equals(div.dataset.foo, "value");
|
||||
}, "Should return 'value' if that's the value")
|
||||
test(function() {
|
||||
div.setAttribute("data-foo", "");
|
||||
assert_true("foo" in div.dataset);
|
||||
assert_equals(div.dataset.foo, "");
|
||||
}, "Should return the empty string if that's the value")
|
||||
test(function() {
|
||||
div.removeAttribute("data-foo");
|
||||
assert_false("foo" in div.dataset);
|
||||
assert_equals(div.dataset.foo, undefined);
|
||||
}, "Should return 'undefined' after removing an attribute")
|
||||
</script>
|
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="LTR">
|
||||
<title>document.dir</title>
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-dir">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#reflect">
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.dir, "ltr");
|
||||
assert_equals(document.documentElement.getAttribute("dir"), "LTR");
|
||||
}, "Markup attribute")
|
||||
test(function() {
|
||||
document.dir = "x-garbage";
|
||||
assert_equals(document.dir, "");
|
||||
assert_equals(document.documentElement.getAttribute("dir"), "x-garbage");
|
||||
}, "Setting the idl attribute to a garbage value")
|
||||
test(function() {
|
||||
document.dir = "";
|
||||
assert_equals(document.documentElement.hasAttribute("dir"), false, "Attribute should be gone");
|
||||
}, "Setting the idl attribute to the empty sting")
|
||||
</script>
|
@ -0,0 +1,130 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>The id attribute</title>
|
||||
<meta charset=utf8>
|
||||
<link rel="help" href="http://www.w3.org/TR/html5/global-attributes.html#the-id-attribute">
|
||||
<style>
|
||||
|
||||
#abcd {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
#ABCD {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
#a\ b {
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
#xyz {
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
#foobar {
|
||||
position: absolute;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
#åèiöú {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>The id attribute</h1>
|
||||
<div id="log"></div>
|
||||
<i id="abcd"></i>
|
||||
<i id="ABCD"></i>
|
||||
<i id="a b"></i>
|
||||
<i id="åèiöú"></i>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
// id is associated for purposes of getElementById
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("abcd"), document.getElementsByTagName("i")[0]);
|
||||
}, "User agents must associate the element with an id value for purposes of getElementById.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("ABCD"), document.getElementsByTagName("i")[1]);
|
||||
}, "Association is exact and therefore case-sensitive for getElementById.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("a b"), document.getElementsByTagName("i")[2]);
|
||||
}, "Spaces are allowed in an id and still make an association for getElementByID.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("åèiöú"), document.getElementsByTagName("i")[3]);
|
||||
}, "Non-ASCII is allowed in an id and still make an association for getElementById.");
|
||||
|
||||
|
||||
// id is associated for purposes of CSS
|
||||
test(function() {
|
||||
assert_equals(document.defaultView.getComputedStyle(document.getElementById("abcd"), false).zIndex, "1");
|
||||
}, "User agents must associate the element with an id value for purposes of CSS.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.defaultView.getComputedStyle(document.getElementById("ABCD"), false).zIndex, "2");
|
||||
}, "Association for CSS is exact and therefore case-sensitive.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.defaultView.getComputedStyle(document.getElementById("a b"), false).zIndex, "3");
|
||||
}, "Spaces are allowed in an id and still make an association.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.defaultView.getComputedStyle(document.getElementById("åèiöú"), false).zIndex, "6");
|
||||
}, "Non-ASCII is allowed in an id and still make an association for CSS.");
|
||||
|
||||
|
||||
// id IDL attribute reflects the content attribute
|
||||
var firstSpan = document.getElementById("abcd");
|
||||
|
||||
test(function() {
|
||||
assert_equals(firstSpan.id, "abcd");
|
||||
}, "The id IDL attribute must reflect the id content attribute, for getting.");
|
||||
|
||||
test(function() {
|
||||
firstSpan.id = "xyz";
|
||||
assert_equals(firstSpan.getAttribute("id"), "xyz");
|
||||
}, "The id IDL attribute must reflect the id content attribute, for setting via IDL attribute.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("xyz"), firstSpan);
|
||||
}, "After setting id via id attribute, getElementById find the element by the new id.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("abcd"), null);
|
||||
}, "After setting id via id attribute, getElementById doesn't find the element by the old id.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.defaultView.getComputedStyle(firstSpan, false).zIndex, "4");
|
||||
}, "After setting id via id attribute, CSS association is via the new ID.");
|
||||
|
||||
test(function() {
|
||||
firstSpan.setAttribute("id", "foobar");
|
||||
assert_equals(firstSpan.id, "foobar");
|
||||
}, "The id IDL attribute must reflect the id content attribute, for setting via setAttribute.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("foobar"), firstSpan);
|
||||
}, "After setting id via setAttribute attribute, getElementById find the element by the new id.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("xyz"), null);
|
||||
}, "After setting id via setAttribute attribute, getElementById doesn't find the element by the old id.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.defaultView.getComputedStyle(firstSpan, false).zIndex, "5");
|
||||
}, "After setting id via setAttribute attribute, CSS association is via the new ID.");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<title>id and name attributes and getElementById</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#the-id-attribute">
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<div name="abcd"></div>
|
||||
<p name="abcd" id="abcd"></p>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("abcd").nodeName, "P");
|
||||
assert_equals(document.getElementById("abcd").localName, "p");
|
||||
});
|
||||
</script>
|
@ -0,0 +1,14 @@
|
||||
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,21 @@
|
||||
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_document-color-01.html \
|
||||
test_document-color-02.html \
|
||||
test_document-color-03.html \
|
||||
test_document-color-04.html \
|
||||
test_heading-obsolete-attributes-01.html \
|
||||
test_script-IDL-event-htmlfor.html \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -0,0 +1,4 @@
|
||||
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
||||
|
||||
DIRS += [
|
||||
]
|
@ -0,0 +1,18 @@
|
||||
<!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="http://www.whatwg.org/html5/#dom-document-fgcolor">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#dom-body-text">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
document.documentElement.removeChild(document.body);
|
||||
assert_equals(document.fgColor, "");
|
||||
assert_equals(document.bgColor, "");
|
||||
assert_equals(document.linkColor, "");
|
||||
assert_equals(document.vlinkColor, "");
|
||||
assert_equals(document.alinkColor, "");
|
||||
})
|
||||
</script>
|
@ -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="http://www.whatwg.org/html5/#dom-document-fgcolor">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#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 = "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>
|
@ -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="http://www.whatwg.org/html5/#dom-document-fgcolor">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#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 = "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>
|
@ -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="http://www.whatwg.org/html5/#dom-document-fgcolor">
|
||||
<link rel="help" href="http://www.whatwg.org/html5/#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>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user