Bug 1118722 - Update web-platform-tests to revision a4f1782fd9e93746364ed219e60a8c2bafd0910e, a=testonly
authorJames Graham <james@hoppipolla.co.uk>
Wed, 07 Jan 2015 13:12:56 +0000
changeset 222490 03e253651e75244f1774815de7592565acc13a75
parent 222489 9ff1c6ac21d4536aad425a90f069dab7b237e6cb
child 222491 68b02c34090ca44e2efc5a91aaa1e15a5ba00668
push id28067
push userkwierso@gmail.com
push dateWed, 07 Jan 2015 23:41:38 +0000
treeherdermozilla-central@70de2960aa87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1118722
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1118722 - Update web-platform-tests to revision a4f1782fd9e93746364ed219e60a8c2bafd0910e, a=testonly
testing/web-platform/tests/.gitignore
testing/web-platform/tests/.gitmodules
testing/web-platform/tests/.travis.yml
testing/web-platform/tests/IndexedDB/idbobjectstore_get6.htm
testing/web-platform/tests/IndexedDB/idbobjectstore_get7.htm
testing/web-platform/tests/IndexedDB/interfaces.html
testing/web-platform/tests/README.md
testing/web-platform/tests/XMLHttpRequest/resources/img.jpg
testing/web-platform/tests/XMLHttpRequest/security-consideration.sub.html
testing/web-platform/tests/battery-status/battery-promise.html
testing/web-platform/tests/common/failing-test.html
testing/web-platform/tests/content-security-policy/img-src/img-src-4_1.html
testing/web-platform/tests/content-security-policy/img-src/img-src-4_1.html.sub.headers
testing/web-platform/tests/content-security-policy/media-src/media-src-7_1.html
testing/web-platform/tests/content-security-policy/media-src/media-src-7_1.html.sub.headers
testing/web-platform/tests/content-security-policy/media-src/media-src-7_1_2.html
testing/web-platform/tests/content-security-policy/media-src/media-src-7_1_2.html.sub.headers
testing/web-platform/tests/content-security-policy/media-src/media-src-7_2.html
testing/web-platform/tests/content-security-policy/media-src/media-src-7_2.html.sub.headers
testing/web-platform/tests/content-security-policy/media-src/media-src-7_2_2.html
testing/web-platform/tests/content-security-policy/media-src/media-src-7_2_2.html.sub.headers
testing/web-platform/tests/content-security-policy/media-src/media-src-7_3.html
testing/web-platform/tests/content-security-policy/media-src/media-src-7_3.html.sub.headers
testing/web-platform/tests/content-security-policy/media-src/media-src-7_3_2.html
testing/web-platform/tests/content-security-policy/media-src/media-src-7_3_2.html.sub.headers
testing/web-platform/tests/content-security-policy/script-src/10_1_support_1.js
testing/web-platform/tests/content-security-policy/script-src/10_1_support_2.js
testing/web-platform/tests/content-security-policy/script-src/buildInlineWorker.js
testing/web-platform/tests/content-security-policy/script-src/script-src-1_10.html
testing/web-platform/tests/content-security-policy/script-src/script-src-1_10.html.sub.headers
testing/web-platform/tests/content-security-policy/script-src/script-src-1_10_1.html
testing/web-platform/tests/content-security-policy/script-src/script-src-1_10_1.html.sub.headers
testing/web-platform/tests/content-security-policy/script-src/script-src-1_9.html
testing/web-platform/tests/content-security-policy/script-src/script-src-1_9.html.sub.headers
testing/web-platform/tests/content-security-policy/style-src/3_3.css
testing/web-platform/tests/content-security-policy/style-src/style-src-3_3.html
testing/web-platform/tests/content-security-policy/style-src/style-src-3_3.html.sub.headers
testing/web-platform/tests/content-security-policy/support/fail.png
testing/web-platform/tests/content-security-policy/support/pass.png
testing/web-platform/tests/cors/testrunner.html
testing/web-platform/tests/docs/test-format-guidelines.md
testing/web-platform/tests/dom/common.js
testing/web-platform/tests/dom/historical.html
testing/web-platform/tests/dom/interfaces.html
testing/web-platform/tests/dom/nodes/DOMImplementation-createDocument.html
testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.html
testing/web-platform/tests/dom/nodes/Document-Element-getElementsByTagName.js
testing/web-platform/tests/dom/nodes/Document-Element-getElementsByTagNameNS.js
testing/web-platform/tests/dom/nodes/Document-URL.sub.html
testing/web-platform/tests/dom/nodes/Document-characterSet-normalization.html
testing/web-platform/tests/dom/nodes/Document-constructor.html
testing/web-platform/tests/dom/nodes/Document-getElementsByTagName.html
testing/web-platform/tests/dom/nodes/Document-getElementsByTagNameNS.html
testing/web-platform/tests/dom/nodes/Element-getElementsByTagName.html
testing/web-platform/tests/dom/nodes/Element-getElementsByTagNameNS.html
testing/web-platform/tests/dom/nodes/Node-parentNode-iframe.html
testing/web-platform/tests/dom/nodes/Node-parentNode.html
testing/web-platform/tests/dom/nodes/Node-properties.html
testing/web-platform/tests/dom/ranges/Range-insertNode.html
testing/web-platform/tests/domparsing/DOMParser-parseFromString-html.html
testing/web-platform/tests/encoding/single-byte-decoder.html
testing/web-platform/tests/gamepad/events-manual.html
testing/web-platform/tests/gamepad/getgamepads-polling-manual.html
testing/web-platform/tests/gamepad/idlharness-manual.html
testing/web-platform/tests/gamepad/idlharness.html
testing/web-platform/tests/gamepad/timestamp-manual.html
testing/web-platform/tests/html/dom/elements-misc.js
testing/web-platform/tests/html/dom/elements/global-attributes/custom-attrs.html
testing/web-platform/tests/html/dom/interfaces.html
testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/css-tmpl.py
testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py
testing/web-platform/tests/html/rendering/bindings/the-select-element-0/option-label-ref.html
testing/web-platform/tests/html/rendering/bindings/the-select-element-0/option-label.html
testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_text_00ffff-ref.html
testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_text_00ffff.xhtml
testing/web-platform/tests/html/semantics/document-metadata/the-style-element/html_style_in_comment-ref.html
testing/web-platform/tests/html/semantics/document-metadata/the-style-element/html_style_in_comment.xhtml
testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py
testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_001.htm
testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_002.htm
testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_content-ref.htm
testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html
testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-attributes.html
testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/form.html
testing/web-platform/tests/js/builtins/WeakMap.prototype-properties.html
testing/web-platform/tests/media/foo.vtt
testing/web-platform/tests/media/foo.vtt.headers
testing/web-platform/tests/old-tests/submission/Infraware/Forms/contents/Forms/button_form.html
testing/web-platform/tests/old-tests/submission/Infraware/Forms/contents/Forms/datalist_options.html
testing/web-platform/tests/old-tests/submission/Infraware/Forms/contents/Forms/fieldset_form.html
testing/web-platform/tests/old-tests/submission/Infraware/Forms/contents/Forms/form_getterindex_2.html
testing/web-platform/tests/old-tests/submission/Infraware/Forms/contents/Forms/input_form.html
testing/web-platform/tests/old-tests/submission/Infraware/Forms/contents/Forms/keygen_form.html
testing/web-platform/tests/pointerevents/pointerevent_pointerout_received_once-manual.html
testing/web-platform/tests/pointerevents/pointerevent_pointertype_mouse-manual.html
testing/web-platform/tests/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html
testing/web-platform/tests/pointerevents/pointerevent_setpointercapture_disconnected-manual.html
testing/web-platform/tests/progress-events/tests/submissions/Samsung/resources/img.jpg
testing/web-platform/tests/progress-events/tests/submissions/Samsung/security-consideration.sub.html
testing/web-platform/tests/quirks-mode/active-and-hover-manual.html
testing/web-platform/tests/quirks-mode/blocks-ignore-line-height.html
testing/web-platform/tests/quirks-mode/font-element-text-decoration-color/001-a.html
testing/web-platform/tests/quirks-mode/font-element-text-decoration-color/001-q.html
testing/web-platform/tests/quirks-mode/font-element-text-decoration-color/001-s.html
testing/web-platform/tests/quirks-mode/font-element-text-decoration-color/001-x.xhtml
testing/web-platform/tests/quirks-mode/hashless-hex-color.html
testing/web-platform/tests/quirks-mode/line-height-calculation.html
testing/web-platform/tests/quirks-mode/percentage-height-calculation.html
testing/web-platform/tests/quirks-mode/table-cell-nowrap-minimum-width-calculation.html
testing/web-platform/tests/quirks-mode/table-cell-width-calculation.html
testing/web-platform/tests/quirks-mode/unitless-length.html
testing/web-platform/tests/resources/apisample-error-worker.js
testing/web-platform/tests/resources/apisample-worker.js
testing/web-platform/tests/resources/apisample11.html
testing/web-platform/tests/resources/apisample12.html
testing/web-platform/tests/resources/apisample13.html
testing/web-platform/tests/resources/apisample14.html
testing/web-platform/tests/resources/apisample15.html
testing/web-platform/tests/resources/apisample16.html
testing/web-platform/tests/resources/docs/api.md
testing/web-platform/tests/resources/idlharness.js
testing/web-platform/tests/resources/testharness.js
testing/web-platform/tests/serve.py
testing/web-platform/tests/subresource-integrity/loads-scripts-with-base64-encoded-sha-digests.js
testing/web-platform/tests/subresource-integrity/loads-scripts-with-correct-content-type.js
testing/web-platform/tests/subresource-integrity/loads-scripts-with-improper-integrity-uri-scheme.js
testing/web-platform/tests/subresource-integrity/loads-scripts-with-incorrect-content-type.js
testing/web-platform/tests/subresource-integrity/loads-scripts-with-matching-digest.js
testing/web-platform/tests/subresource-integrity/loads-scripts-with-non-matching-digest.js
testing/web-platform/tests/subresource-integrity/loads-scripts-with-unhyphenated-digest-name.js
testing/web-platform/tests/subresource-integrity/loads-scripts-with-weak-digest-algorithms.js
testing/web-platform/tests/subresource-integrity/subresource-integrity.html
testing/web-platform/tests/subresource-integrity/tools/generate_javascript.py
testing/web-platform/tests/tools/__init__.py
testing/web-platform/tests/tools/html5lib/.gitignore
testing/web-platform/tests/tools/html5lib/.gitmodules
testing/web-platform/tests/tools/html5lib/.travis.yml
testing/web-platform/tests/tools/html5lib/AUTHORS.rst
testing/web-platform/tests/tools/html5lib/CHANGES.rst
testing/web-platform/tests/tools/html5lib/CONTRIBUTING.rst
testing/web-platform/tests/tools/html5lib/LICENSE
testing/web-platform/tests/tools/html5lib/MANIFEST.in
testing/web-platform/tests/tools/html5lib/README.rst
testing/web-platform/tests/tools/html5lib/debug-info.py
testing/web-platform/tests/tools/html5lib/doc/Makefile
testing/web-platform/tests/tools/html5lib/doc/changes.rst
testing/web-platform/tests/tools/html5lib/doc/conf.py
testing/web-platform/tests/tools/html5lib/doc/html5lib.filters.rst
testing/web-platform/tests/tools/html5lib/doc/html5lib.rst
testing/web-platform/tests/tools/html5lib/doc/html5lib.serializer.rst
testing/web-platform/tests/tools/html5lib/doc/html5lib.treebuilders.rst
testing/web-platform/tests/tools/html5lib/doc/html5lib.treewalkers.rst
testing/web-platform/tests/tools/html5lib/doc/index.rst
testing/web-platform/tests/tools/html5lib/doc/license.rst
testing/web-platform/tests/tools/html5lib/doc/make.bat
testing/web-platform/tests/tools/html5lib/doc/modules.rst
testing/web-platform/tests/tools/html5lib/doc/movingparts.rst
testing/web-platform/tests/tools/html5lib/flake8-run.sh
testing/web-platform/tests/tools/html5lib/html5lib/__init__.py
testing/web-platform/tests/tools/html5lib/html5lib/constants.py
testing/web-platform/tests/tools/html5lib/html5lib/filters/__init__.py
testing/web-platform/tests/tools/html5lib/html5lib/filters/_base.py
testing/web-platform/tests/tools/html5lib/html5lib/filters/alphabeticalattributes.py
testing/web-platform/tests/tools/html5lib/html5lib/filters/inject_meta_charset.py
testing/web-platform/tests/tools/html5lib/html5lib/filters/lint.py
testing/web-platform/tests/tools/html5lib/html5lib/filters/optionaltags.py
testing/web-platform/tests/tools/html5lib/html5lib/filters/sanitizer.py
testing/web-platform/tests/tools/html5lib/html5lib/filters/whitespace.py
testing/web-platform/tests/tools/html5lib/html5lib/html5parser.py
testing/web-platform/tests/tools/html5lib/html5lib/ihatexml.py
testing/web-platform/tests/tools/html5lib/html5lib/inputstream.py
testing/web-platform/tests/tools/html5lib/html5lib/sanitizer.py
testing/web-platform/tests/tools/html5lib/html5lib/serializer/__init__.py
testing/web-platform/tests/tools/html5lib/html5lib/serializer/htmlserializer.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/README
testing/web-platform/tests/tools/html5lib/html5lib/tests/__init__.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/mockParser.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/performance/concatenation.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/support.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/test_encoding.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/test_parser.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/test_parser2.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/test_sanitizer.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/test_serializer.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/test_stream.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/test_tokenizer.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/test_treeadapters.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/test_treewalkers.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/test_whitespace_filter.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/AUTHORS.rst
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/LICENSE
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/encoding/chardet/test_big5.txt
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/encoding/test-yahoo-jp.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/encoding/tests1.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/encoding/tests2.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/sanitizer/tests1.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/serializer/core.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/serializer/injectmeta.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/serializer/optionaltags.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/serializer/options.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/serializer/whitespace.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/sniffer/htmlOrFeed.json
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/README.md
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/contentModelFlags.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/domjs.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/entities.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/escapeFlag.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/namedEntities.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/numericEntities.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/pendingSpecChanges.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/test1.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/test2.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/test3.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/test4.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/unicodeChars.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/unicodeCharsProblematic.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tokenizer/xmlViolation.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/README.md
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/adoption01.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/adoption02.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/comments01.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/doctype01.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/domjs-unsafe.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/entities01.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/entities02.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/html5test-com.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/inbody01.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/isindex.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/main-element.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/pending-spec-changes-plain-text-unsafe.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/pending-spec-changes.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/plain-text-unsafe.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/ruby.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/scriptdata01.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/scripted/adoption01.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/scripted/ark.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/scripted/webkit01.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tables01.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/template.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests1.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests10.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests11.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests12.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests14.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests15.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests16.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests17.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests18.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests19.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests2.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests20.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests21.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests22.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests23.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests24.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests25.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests26.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests3.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests4.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests5.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests6.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests7.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests8.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests9.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tests_innerHTML_1.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/tricky01.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/webkit01.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/tree-construction/webkit02.dat
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/attributes.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/base-href-attribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/base-target-attribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/blockquote-cite-attribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/classattribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/contenteditableattribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/contextmenuattribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/dirattribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/draggableattribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/html-xmlns-attribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/idattribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/inputattributes.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/irrelevantattribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/langattribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/li-value-attribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/link-href-attribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/link-hreflang-attribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/link-rel-attribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/ol-start-attribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/starttags.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/style-scoped-attribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/testdata/validator/tabindexattribute.test
testing/web-platform/tests/tools/html5lib/html5lib/tests/tokenizertotree.py
testing/web-platform/tests/tools/html5lib/html5lib/tests/us-ascii.html
testing/web-platform/tests/tools/html5lib/html5lib/tests/utf-8-bom.html
testing/web-platform/tests/tools/html5lib/html5lib/tokenizer.py
testing/web-platform/tests/tools/html5lib/html5lib/treeadapters/__init__.py
testing/web-platform/tests/tools/html5lib/html5lib/treeadapters/sax.py
testing/web-platform/tests/tools/html5lib/html5lib/treebuilders/__init__.py
testing/web-platform/tests/tools/html5lib/html5lib/treebuilders/_base.py
testing/web-platform/tests/tools/html5lib/html5lib/treebuilders/dom.py
testing/web-platform/tests/tools/html5lib/html5lib/treebuilders/etree.py
testing/web-platform/tests/tools/html5lib/html5lib/treebuilders/etree_lxml.py
testing/web-platform/tests/tools/html5lib/html5lib/treewalkers/__init__.py
testing/web-platform/tests/tools/html5lib/html5lib/treewalkers/_base.py
testing/web-platform/tests/tools/html5lib/html5lib/treewalkers/dom.py
testing/web-platform/tests/tools/html5lib/html5lib/treewalkers/etree.py
testing/web-platform/tests/tools/html5lib/html5lib/treewalkers/genshistream.py
testing/web-platform/tests/tools/html5lib/html5lib/treewalkers/lxmletree.py
testing/web-platform/tests/tools/html5lib/html5lib/treewalkers/pulldom.py
testing/web-platform/tests/tools/html5lib/html5lib/trie/__init__.py
testing/web-platform/tests/tools/html5lib/html5lib/trie/_base.py
testing/web-platform/tests/tools/html5lib/html5lib/trie/datrie.py
testing/web-platform/tests/tools/html5lib/html5lib/trie/py.py
testing/web-platform/tests/tools/html5lib/html5lib/utils.py
testing/web-platform/tests/tools/html5lib/parse.py
testing/web-platform/tests/tools/html5lib/requirements-install.sh
testing/web-platform/tests/tools/html5lib/requirements-optional-2.6.txt
testing/web-platform/tests/tools/html5lib/requirements-optional-cpython.txt
testing/web-platform/tests/tools/html5lib/requirements-optional.txt
testing/web-platform/tests/tools/html5lib/requirements-test.txt
testing/web-platform/tests/tools/html5lib/requirements.txt
testing/web-platform/tests/tools/html5lib/setup.py
testing/web-platform/tests/tools/html5lib/tox.ini
testing/web-platform/tests/tools/html5lib/utils/entities.py
testing/web-platform/tests/tools/html5lib/utils/iana_parse.py
testing/web-platform/tests/tools/html5lib/utils/spider.py
testing/web-platform/tests/tools/runner/update_manifest.py
testing/web-platform/tests/tools/scripts/_env.py
testing/web-platform/tests/tools/scripts/lint.py
testing/web-platform/tests/tools/scripts/lint.whitelist
testing/web-platform/tests/tools/scripts/manifest.py
testing/web-platform/tests/tools/six/.gitignore
testing/web-platform/tests/tools/six/.hgignore
testing/web-platform/tests/tools/six/CHANGES
testing/web-platform/tests/tools/six/CONTRIBUTORS
testing/web-platform/tests/tools/six/LICENSE
testing/web-platform/tests/tools/six/MANIFEST.in
testing/web-platform/tests/tools/six/README
testing/web-platform/tests/tools/six/documentation/Makefile
testing/web-platform/tests/tools/six/documentation/conf.py
testing/web-platform/tests/tools/six/documentation/index.rst
testing/web-platform/tests/tools/six/setup.cfg
testing/web-platform/tests/tools/six/setup.py
testing/web-platform/tests/tools/six/six.py
testing/web-platform/tests/tools/six/test_six.py
testing/web-platform/tests/tools/six/tox.ini
testing/web-platform/tests/tools/wptserve/wptserve/server.py
testing/web-platform/tests/url/urltestdata.txt
testing/web-platform/tests/web-animations/animation-node/animation-node-next-sibling.html
testing/web-platform/tests/web-animations/animation-node/animation-node-parent.html
testing/web-platform/tests/web-animations/animation-node/animation-node-previous-sibling.html
testing/web-platform/tests/web-animations/animation-timeline/animation-timeline.html
testing/web-platform/tests/web-animations/animation-timeline/idlharness.html
testing/web-platform/tests/webmessaging/Channel_MessagePort_initial_disabled.htm
testing/web-platform/tests/webmessaging/Channel_MessagePort_onmessage_start.htm
testing/web-platform/tests/webmessaging/Channel_postMessage_DataCloneErr.htm
testing/web-platform/tests/webmessaging/Channel_postMessage_clone_port.htm
testing/web-platform/tests/webmessaging/Channel_postMessage_clone_port_error.htm
testing/web-platform/tests/webmessaging/Channel_postMessage_event_properties.htm
testing/web-platform/tests/webmessaging/Channel_postMessage_ports_readonly_array.htm
testing/web-platform/tests/webmessaging/Channel_postMessage_target_source.htm
testing/web-platform/tests/webmessaging/MessageEvent_properties.htm
testing/web-platform/tests/webmessaging/Transferred_objects_unusable.sub.htm
testing/web-platform/tests/webmessaging/event.data.sub.htm
testing/web-platform/tests/webmessaging/event.origin.sub.htm
testing/web-platform/tests/webmessaging/event.ports.sub.htm
testing/web-platform/tests/webmessaging/event.source.htm
testing/web-platform/tests/webmessaging/event.source.xorigin.sub.htm
testing/web-platform/tests/webmessaging/postMessage_ArrayBuffer.sub.htm
testing/web-platform/tests/webmessaging/postMessage_Date.sub.htm
testing/web-platform/tests/webmessaging/postMessage_Document.htm
testing/web-platform/tests/webmessaging/postMessage_Function.htm
testing/web-platform/tests/webmessaging/postMessage_MessagePorts_sorigin.htm
testing/web-platform/tests/webmessaging/postMessage_MessagePorts_xorigin.sub.htm
testing/web-platform/tests/webmessaging/postMessage_arrays.sub.htm
testing/web-platform/tests/webmessaging/postMessage_asterisk_xorigin.sub.htm
testing/web-platform/tests/webmessaging/postMessage_dup_transfer_objects.htm
testing/web-platform/tests/webmessaging/postMessage_invalid_targetOrigin.htm
testing/web-platform/tests/webmessaging/postMessage_objects.sub.htm
testing/web-platform/tests/webmessaging/postMessage_origin_mismatch.sub.htm
testing/web-platform/tests/webmessaging/postMessage_origin_mismatch_xorigin.sub.htm
testing/web-platform/tests/webmessaging/postMessage_solidus_sorigin.htm
testing/web-platform/tests/webmessaging/postMessage_solidus_xorigin.sub.htm
testing/web-platform/tests/webmessaging/support/ChildWindowPostMessage.htm
testing/web-platform/tests/webmessaging/with-ports/010.html
testing/web-platform/tests/webmessaging/with-ports/025.html
testing/web-platform/tests/webmessaging/with-ports/026.html
testing/web-platform/tests/webmessaging/without-ports/008.html
testing/web-platform/tests/webmessaging/without-ports/009.html
testing/web-platform/tests/webmessaging/without-ports/010.html
testing/web-platform/tests/webmessaging/without-ports/025.html
testing/web-platform/tests/webmessaging/without-ports/026.html
testing/web-platform/tests/webmessaging/without-ports/029.html
testing/web-platform/tests/workers/MessagePort_initial_disabled.htm
testing/web-platform/tests/workers/MessagePort_onmessage_start.htm
testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_colno.htm
testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_filename.htm
testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_lineno.htm
testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_message.htm
testing/web-platform/tests/workers/WorkerGlobalScope_EventTarget.htm
testing/web-platform/tests/workers/WorkerGlobalScope_XMLHttpRequest.htm
testing/web-platform/tests/workers/WorkerGlobalScope_addEventListener.htm
testing/web-platform/tests/workers/WorkerGlobalScope_close.htm
testing/web-platform/tests/workers/WorkerGlobalScope_importScripts.htm
testing/web-platform/tests/workers/WorkerGlobalScope_importScripts_NetworkErr.htm
testing/web-platform/tests/workers/WorkerGlobalScope_nested_Worker.htm
testing/web-platform/tests/workers/WorkerGlobalScope_removeEventListener.htm
testing/web-platform/tests/workers/WorkerGlobalScope_setInterval.htm
testing/web-platform/tests/workers/WorkerGlobalScope_setTimeout.htm
testing/web-platform/tests/workers/WorkerLocation.htm
testing/web-platform/tests/workers/WorkerLocation_hash.htm
testing/web-platform/tests/workers/WorkerLocation_hash_encoding.htm
testing/web-platform/tests/workers/WorkerLocation_hash_nonexist.htm
testing/web-platform/tests/workers/WorkerLocation_host.htm
testing/web-platform/tests/workers/WorkerLocation_hostname.htm
testing/web-platform/tests/workers/WorkerLocation_href.htm
testing/web-platform/tests/workers/WorkerLocation_pathname.htm
testing/web-platform/tests/workers/WorkerLocation_port.htm
testing/web-platform/tests/workers/WorkerLocation_protocol.htm
testing/web-platform/tests/workers/WorkerLocation_search.htm
testing/web-platform/tests/workers/WorkerLocation_search_empty.htm
testing/web-platform/tests/workers/WorkerLocation_search_fragment.htm
testing/web-platform/tests/workers/WorkerLocation_search_nonexist.htm
testing/web-platform/tests/workers/WorkerNavigator_appName.htm
testing/web-platform/tests/workers/WorkerNavigator_appVersion.htm
testing/web-platform/tests/workers/WorkerNavigator_onLine.htm
testing/web-platform/tests/workers/WorkerNavigator_platform.htm
testing/web-platform/tests/workers/WorkerNavigator_userAgent.htm
testing/web-platform/tests/workers/Worker_ErrorEvent_filename.htm
testing/web-platform/tests/workers/Worker_ErrorEvent_lineno.htm
testing/web-platform/tests/workers/Worker_ErrorEvent_message.htm
testing/web-platform/tests/workers/Worker_ErrorEvent_type.htm
testing/web-platform/tests/workers/Worker_basic.htm
testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm
testing/web-platform/tests/workers/Worker_dispatchEvent_ErrorEvent.htm
testing/web-platform/tests/workers/Worker_script_mimetype.htm
testing/web-platform/tests/workers/Worker_terminate_event_queue.htm
testing/web-platform/tests/workers/postMessage_DataCloneErr.htm
testing/web-platform/tests/workers/postMessage_clone_port.htm
testing/web-platform/tests/workers/postMessage_clone_port_error.htm
testing/web-platform/tests/workers/postMessage_event_properties.htm
testing/web-platform/tests/workers/postMessage_ports_readonly_array.htm
testing/web-platform/tests/workers/postMessage_target_source.htm
testing/web-platform/tests/workers/support/ErrorEvent.js
testing/web-platform/tests/workers/support/ImportScripts.js
--- a/testing/web-platform/tests/.gitignore
+++ b/testing/web-platform/tests/.gitignore
@@ -1,9 +1,10 @@
-node_modules
-scratch
+*#
 *.py[co]
 *.sw[po]
 *~
-*#
+MANIFEST.json
 \#*
 config.json
-MANIFEST.json
\ No newline at end of file
+node_modules
+scratch
+testharness_runner.html
--- a/testing/web-platform/tests/.gitmodules
+++ b/testing/web-platform/tests/.gitmodules
@@ -5,8 +5,14 @@
 [submodule "tools/wptserve"]
 	path = tools/wptserve
 	url = https://github.com/w3c/wptserve.git
 	ignore = dirty
 [submodule "tools/pywebsocket"]
 	path = tools/pywebsocket
 	url = https://github.com/w3c/pywebsocket.git
 	ignore = dirty
+[submodule "html5lib"]
+	path = tools/html5lib
+	url = https://github.com/html5lib/html5lib-python.git
+[submodule "tools/six"]
+	path = tools/six
+	url = https://github.com/jgraham/six.git
--- a/testing/web-platform/tests/.travis.yml
+++ b/testing/web-platform/tests/.travis.yml
@@ -1,7 +1,5 @@
 language: python
 python:
   - "2.7"
-# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
-install: pip install html5lib
 # command to run tests, e.g. python setup.py test
 script:  python tools/scripts/lint.py
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/IndexedDB/idbobjectstore_get6.htm
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>IDBObjectStore.get() - throw TransactionInactiveError on aborted transaction </title>
+<link rel="author" title="YuichiNukiyama" href="https://github.com/YuichiNukiyama">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support.js"></script>
+
+<script>
+    var db,
+      t = async_test();
+
+    var open_rq = createdb(t);
+    open_rq.onupgradeneeded = function(e) {
+        db = e.target.result;
+        db.createObjectStore("store", { keyPath: "key" })
+    }
+
+    open_rq.onsuccess = function (e) {
+        var store = db.transaction("store")
+                      .objectStore("store");
+        store.transaction.abort();
+        assert_throws("TransactionInactiveError", function () {
+            store.get(1);
+        }, "throw TransactionInactiveError on aborted transaction.");
+        t.done();
+    }
+</script>
+
+<div id="log"></div>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/IndexedDB/idbobjectstore_get7.htm
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>IDBObjectStore.get() - throw DataError when using invalid key </title>
+<link rel="author" title="YuichiNukiyama" href="https://github.com/YuichiNukiyama">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support.js"></script>
+
+<script>
+    var db,
+      t = async_test();
+
+    var open_rq = createdb(t);
+    open_rq.onupgradeneeded = function(e) {
+        db = e.target.result;
+        db.createObjectStore("store", { keyPath: "key" })
+    }
+
+    open_rq.onsuccess = function(e) {
+        var store = db.transaction("store")
+                      .objectStore("store")
+        assert_throws("DataError", function () {
+            store.get(null)
+        }, "throw DataError when using invalid key.");
+        t.done();
+    }
+</script>
+
+<div id="log"></div>
--- a/testing/web-platform/tests/IndexedDB/interfaces.html
+++ b/testing/web-platform/tests/IndexedDB/interfaces.html
@@ -161,16 +161,18 @@ interface IDBTransaction : EventTarget {
 };
 </script>
 
 <script type="text/plain" class="untested">
 interface Window { };
 
 interface WorkerUtils { };
 
+interface Event { };
+
 interface EventTarget { };
 </script>
 
 <script>
 "use strict";
 setup(function() {
   var idlArray = new IdlArray();
 
@@ -195,9 +197,8 @@ setup(function() {
     IDBCursor: [],
     IDBCursorWithValue: [],
     IDBTransaction: []
   });
 
   idlArray.test();
 });
 </script>
-
--- a/testing/web-platform/tests/README.md
+++ b/testing/web-platform/tests/README.md
@@ -171,21 +171,45 @@ branch (but not to `CR`).
 We can sometimes take a little while to go through pull requests
 because we have to go through all the tests and ensure that they match
 the specification correctly. But we look at all of them, and take
 everything that we can.
 
 If you wish to contribute actively, you're very welcome to join the
 public-test-infra@w3.org mailing list (low traffic) by
 [signing up to our mailing list](mailto:public-test-infra-request@w3.org?subject=subscribe).
+The mailing list is [archived][mailarchive].
 
 Join us on irc #testing ([irc.w3.org][ircw3org], port 6665). The channel
 is [archived][ircarchive].
 
 [contributing]: https://github.com/w3c/web-platform-tests/blob/master/CONTRIBUTING.md
 [ircw3org]: https://www.w3.org/wiki/IRC
 [ircarchive]: http://krijnhoetmer.nl/irc-logs/testing/
+[mailarchive]: http://lists.w3.org/Archives/Public/public-test-infra/
+
+Adding command-line scripts ("tools" subdirs)
+----------------------------------------------------
+Sometimes you may want to add a script to the repository that's meant to be used from the
+command line, not from a browser (e.g., a script for generating test files). If you want to
+ensure (e.g., or security reasons) that such scripts won't be handled by the HTTP server,
+but will instead only be usable from the command line, then place them in either:
+
+* the `tools` subdir at the root of the repository, or
+* the `tools` subdir at the root of any top-level directory in the repository which
+  contains the tests the script is meant to be used with
+
+Any files in those `tools` directories won't be handled by the HTTP server; instead the
+server will return a 404 if a user navigates to the URL for a file within them.
+
+If you want to add a script for use with a particular set of tests but there isn't yet any
+`tools` subdir at the root of a top-level directory in the repository containing those
+tests, you can create a `tools` subdir at the root of that top-level directory and place
+your scripts there.
+
+For example, if you wanted to add a script for use with tests in the `notifications`
+directory, create the `notifications/tools` subdir and put your script there.
 
 Documentation
 -------------
 
 * [How to write and review tests](http://testthewebforward.org/docs/)
 * [Documentation for the wptserve server](http://wptserve.readthedocs.org/en/latest/)
rename from testing/web-platform/tests/progress-events/tests/submissions/Samsung/resources/img.jpg
rename to testing/web-platform/tests/XMLHttpRequest/resources/img.jpg
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/XMLHttpRequest/security-consideration.sub.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html>
+  <head>
+    <title>ProgressEvent: security consideration</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <link rel="help" href="https://xhr.spec.whatwg.org/#security-considerations" data-tested-assertations="/following-sibling::p" />
+    <link rel="help" href="https://fetch.spec.whatwg.org/#http-fetch" data-tested-assertations="/following-sibling::ol[1]/li[3]/ol[1]/li[6]" />
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+      async_test(function() {
+        var xhr = new XMLHttpRequest();
+
+        xhr.onprogress = this.unreached_func("MUST NOT dispatch progress event.");
+        xhr.onload = this.unreached_func("MUST NOT dispatch load event.");
+        xhr.onerror = this.step_func(function(pe) {
+          assert_equals(pe.type, "error");
+          assert_equals(pe.loaded, 0, "loaded is zero.");
+          assert_false(pe.lengthComputable, "lengthComputable is false.");
+          assert_equals(pe.total, 0, "total is zero.");
+        });
+        xhr.onloadend = this.step_func_done();
+        xhr.open("GET", "http://{{host}}:{{ports[http][1]}}/XMLHttpRequest/resources/img.jpg", true);
+        xhr.send(null);
+      })
+    </script>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/battery-status/battery-promise.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<title>navigator.getBattery() - navigator.getBattery()'s returnvalue is Promise<BatteryManager>. </title>
+<link rel="author" title="YuichiNukiyama" href="https://github.com/YuichiNukiyama">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<script>
+    function returnBattery() {
+        return navigator.getBattery();
+    }
+
+    promise_test(function () {
+        return returnBattery()
+          .then(function (result) {
+              assert_class_string(result, "BatteryManager", "getBattery should return BatteryManager Object.");
+          });
+    }, "navigator.getBattery() return BatteryManager");
+
+</script>
+
+<div id="log"></div>
copy from testing/web-platform/tests/webmessaging/without-ports/009.html
copy to testing/web-platform/tests/common/failing-test.html
--- a/testing/web-platform/tests/webmessaging/without-ports/009.html
+++ b/testing/web-platform/tests/common/failing-test.html
@@ -1,12 +1,10 @@
-<!doctype html>
-<title>zero arguments</title>
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Failing test</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
-<div id="log"></div>
 <script>
 test(function() {
-  assert_throws('NOT_SUPPORTED_ERR', function() {
-    postMessage();
-  });
+  assert_unreached("Expected failure");
 });
 </script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/img-src/img-src-4_1.html
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title>img element src attribute must match src list.</title>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+</head>
+<body>
+    <h1>img element src attribute must match src list.</h1>
+    <p>
+    <div id='log'></div>
+
+    <script type="text/javascript">
+      var t1 = async_test("img-src for relative path should load.");
+      var t2 = async_test("img-src from unapproved domains should not load");
+      var t3 = async_test("img-src from approved domains should load");
+    </script>
+
+    <img src='/content-security-policy/support/pass.png'
+    onerror='t1.step(function() { assert_unreached("The img should have loaded."); t1.done() });'
+    onload='t1.done();'>
+
+    <img src='http://www1.web-platform.test/content-security-policy/support/fail.png'
+    onerror='t2.done();'
+    onload='t2.step(function() { assert_unreached("Image from unapproved domain was loaded."); t2.done()} );'>
+
+    <div id='t3'></div>
+
+    <script>
+      var t3img = document.createElement('img');
+      t3img.onerror = function() {t3.step(function() { assert_unreached(); t3.done();})}
+      t3img.onload = function() {t3.done();}
+      t3img.src = location.protocol + '//www.' + location.hostname + ':' + location.port +
+           '/content-security-policy/support/pass.png';
+      var t3div = document.getElementById('t3');
+      t3div.appendChild(t3img);
+
+      var report = document.createElement('script');
+      report.src = '../support/checkReport.sub.js?reportField=violated-directive&reportValue=img-src%20%27self%27%20www.' + location.hostname + (location.port ? ':' + location.port : '');
+      t3div.appendChild(report);
+
+    </script>
+
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/img-src/img-src-4_1.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: img-src-4_1={{$id:uuid()}}; Path=/content-security-policy/img-src/
+Content-Security-Policy: img-src 'self' www.{{host}}:{{ports[http][0]}};  report-uri  ../support/report.py?op=put&reportID={{$id}}
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/media-src/media-src-7_1.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title>Video element src attribute must match src list - positive test</title>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+</head>
+<body>
+    <h1>Video element src attribute must match src list - positive test</h1>
+    <div id='log'></div>
+
+  <script>
+    var src_test = async_test("In-policy async video src");
+    var source_test = async_test("In-policy async video source element");
+
+    function media_loaded(t) {
+      t.done();
+    }
+
+    function media_error_handler(t) {
+      t.step( function () {
+          assert_unreached("Media error handler should be triggered for non-allowed domain.");
+      });
+      t.done();
+    }
+  </script>
+
+    <video id="videoObject" width="320" height="240" controls
+           onloadeddata="media_loaded(source_test)">
+        <source id="videoSourceObject"
+                type="video/mp4"
+                onerror="media_error_handler(source_test)"
+                src="/media/white.mp4">
+    </video>
+    <video id="videoObject2" width="320" height="240" controls
+           onerror="media_error_handler(src_test)"
+           onloadeddata="media_loaded(src_test)"
+           src="/media/white.mp4">
+
+  <script async defer src="../support/checkReport.sub.js?reportExists=false">
+  </script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/media-src/media-src-7_1.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: media-src-7_1={{$id:uuid()}}; Path=/content-security-policy/media-src/
+Content-Security-Policy: script-src * 'unsafe-inline'; media-src 'self'; report-uri  ../support/report.py?op=put&reportID={{$id}}
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/media-src/media-src-7_1_2.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title>Video element src attribute must match src list - negative test</title>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+</head>
+<body>
+    <h1>Video element src attribute must match src list - negative test</h1>
+    <div id='log'></div>
+
+  <script>
+      var src_test = async_test("Disallowed async video src");
+      var source_test = async_test("Disallowed async video source element");
+
+      // we assume tests are run from 'hostname' and 'www.hostname' or 'www2.hostname' is a valid alias
+      var mediaURL = location.protocol +
+        "//www2." +
+        location.hostname +
+        ":" +
+        location.port +
+        "/media/white.mp4";
+
+    function media_loaded(t) {
+      t.step( function () {
+          assert_unreached("Media error handler should be triggered for non-allowed domain.");
+      });
+      t.done();
+    }
+
+    function media_error_handler(t) {
+      t.done();
+    }
+  </script>
+
+    <video id="videoObject" width="320" height="240" controls
+           onloadeddata="media_loaded(source_test)">
+        <source id="videoSourceObject"
+                type="video/mp4"
+                onerror="media_error_handler(source_test)">
+    </video>
+    <video id="videoObject2" width="320" height="240" controls
+           onerror="media_error_handler(src_test)"
+           onloadeddata="media_loaded(src_test)">
+
+    <script>
+        document.getElementById("videoSourceObject").src = mediaURL;
+        document.getElementById("videoObject2").src = mediaURL;
+    </script>
+
+    <script async defer src='../support/checkReport.sub.js?reportField=violated-directive&reportValue=media-src%20%27self%27'></script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/media-src/media-src-7_1_2.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: media-src-7_1_2={{$id:uuid()}}; Path=/content-security-policy/media-src/
+Content-Security-Policy: script-src * 'unsafe-inline'; media-src 'self'; report-uri  ../support/report.py?op=put&reportID={{$id}}
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/media-src/media-src-7_2.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title>Audio element src attribute must match src list - positive test</title>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+</head>
+<body>
+    <h1>Audio element src attribute must match src list - positive test</h1>
+    <div id='log'></div>
+
+  <script>
+    var src_test = async_test("In-policy audio src");
+    var source_test = async_test("In-policy audio source element");
+
+    function media_loaded(t) {
+      t.done();
+    }
+
+    function media_error_handler(t) {
+      t.step( function () {
+          assert_unreached("Media error handler should be triggered for non-allowed domain.");
+      });
+      t.done();
+    }
+  </script>
+
+    <audio id="audioObject" width="320" height="240" controls
+           onloadeddata="media_loaded(source_test)">
+        <source id="audioSourceObject"
+                type="audio/mpeg"
+                onerror="media_error_handler(source_test)"
+                src="/media/sound_5.mp3">
+    </audio>
+    <audio id="audioObject2" width="320" height="240" controls
+           onerror="media_error_handler(src_test)"
+           onloadeddata="media_loaded(src_test)"
+           src="/media/sound_5.mp3">
+
+  <script async defer src="../support/checkReport.sub.js?reportExists=false">
+  </script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/media-src/media-src-7_2.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: media-src-7_2={{$id:uuid()}}; Path=/content-security-policy/media-src/
+Content-Security-Policy: script-src * 'unsafe-inline'; media-src 'self'; report-uri  ../support/report.py?op=put&reportID={{$id}}
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/media-src/media-src-7_2_2.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title>Audio element src attribute must match src list - negative test</title>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+</head>
+<body>
+    <h1>Audio element src attribute must match src list - negative test</h1>
+    <div id='log'></div>
+
+  <script>
+      var src_test = async_test("Disallaowed audio src");
+      var source_test = async_test("Disallowed audio source element");
+
+      // we assume tests are run from 'hostname' and 'www.hostname' or 'www2.hostname' is a valid alias
+      var mediaURL = location.protocol +
+        "//www2." +
+        location.hostname +
+        ":" +
+        location.port +
+        "/media/sound_5.mp3";
+
+    function media_loaded(t) {
+      t.step( function () {
+          assert_unreached("Media error handler should be triggered for non-allowed domain.");
+      });
+      t.done();
+    }
+
+    function media_error_handler(t) {
+      t.done();
+    }
+  </script>
+
+    <audio id="audioObject" width="320" height="240" controls
+           onloadeddata="media_loaded(source_test)">
+        <source id="audioSourceObject"
+                type="audio/mpeg"
+                onerror="media_error_handler(source_test)">
+    </audio>
+    <audio id="audioObject2" width="320" height="240" controls
+           onerror="media_error_handler(src_test)"
+           onloadeddata="media_loaded(src_test)">
+
+    <script>
+        document.getElementById("audioSourceObject").src = mediaURL;
+        document.getElementById("audioObject2").src = mediaURL;
+    </script>
+
+    <script async defer src='../support/checkReport.sub.js?reportField=violated-directive&reportValue=media-src%20%27self%27'></script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/media-src/media-src-7_2_2.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: media-src-7_2_2={{$id:uuid()}}; Path=/content-security-policy/media-src/
+Content-Security-Policy: script-src * 'unsafe-inline'; media-src 'self'; report-uri  ../support/report.py?op=put&reportID={{$id}}
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/media-src/media-src-7_3.html
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title>Video track src attribute must match src list - positive test</title>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+</head>
+<body>
+    <h1>Video track src attribute must match src list - positive test</h1>
+    <div id='log'></div>
+
+  <script>
+    var source_test = async_test("In-policy track element");
+
+      var trackURL = location.protocol +
+        "//www." +
+        location.hostname +
+        ":" +
+        location.port +
+        "/media/foo.vtt";
+
+    function media_loaded(t) {
+      t.done();
+    }
+
+    function media_error_handler(t) {
+      t.step( function () {
+          assert_unreached("Error handler called for allowed track source.");
+      });
+      t.done();
+    }
+  </script>
+
+    <video id="videoObject" width="320" height="240" controls
+           onloadeddata="media_loaded(source_test)" crossorigin>
+        <source id="audioSourceObject"
+                type="audio/mpeg"
+                src="/media/white.mp4">
+        <track id="trackObject"
+               kind="subtitles"
+               srclang="en"
+               label="English"
+               onerror="media_error_handler(source_test)">
+    </video>
+    <script>
+        document.getElementById("trackObject").src = trackURL;
+    </script>
+
+  <script async defer src="../support/checkReport.sub.js?reportExists=false">
+  </script>
+
+</body>
+</html>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/media-src/media-src-7_3.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: media-src-7_3={{$id:uuid()}}; Path=/content-security-policy/media-src/
+Content-Security-Policy: script-src * 'unsafe-inline'; media-src 'self' www.{{host}}:{{ports[http][0]}}; report-uri  ../support/report.py?op=put&reportID={{$id}}
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/media-src/media-src-7_3_2.html
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title>Video track src attribute must match src list - negative test</title>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+</head>
+<body>
+    <h1>Video track src attribute must match src list - negative test</h1>
+    <div id='log'></div>
+
+  <script>
+    var source_test = async_test("Disallowed track element");
+
+      var trackURL = location.protocol +
+        "//www." +
+        location.hostname +
+        ":" +
+        location.port +
+        "/media/foo.vtt";
+
+    function media_loaded(t) {
+     t.step( function () {
+          assert_unreached("Disllowed track source loaded.");
+      });
+      t.done();
+    }
+
+    function media_error_handler(t) {
+      t.done();
+    }
+  </script>
+
+    <video id="videoObject" width="320" height="240" controls
+           onloadeddata="media_loaded(source_test)" crossorigin>
+        <source id="audioSourceObject"
+                type="audio/mpeg"
+                src="/media/white.mp4">
+        <track id="trackObject"
+               kind="subtitles"
+               srclang="en"
+               label="English"
+               onerror="media_error_handler(source_test)">
+    </video>
+    <script>
+        document.getElementById("trackObject").src = trackURL;
+    </script>
+
+  <script async defer src="../support/checkReport.sub.js?reportField=violated-directive&reportValue=media-src%20%27self%27">
+  </script>
+
+</body>
+</html>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/media-src/media-src-7_3_2.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: media-src-7_3_2={{$id:uuid()}}; Path=/content-security-policy/media-src/
+Content-Security-Policy: script-src * 'unsafe-inline'; media-src 'self'; report-uri  ../support/report.py?op=put&reportID={{$id}}
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/script-src/10_1_support_1.js
@@ -0,0 +1,1 @@
+var dataScriptRan = false;
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/script-src/10_1_support_2.js
@@ -0,0 +1,3 @@
+test(function () {
+            assert_true(dataScriptRan, "data script ran");
+        }, "Verify that data: as script src runs with this policy");
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/script-src/buildInlineWorker.js
@@ -0,0 +1,21 @@
+(function ()
+{
+ var test = new async_test("test inline worker");
+ var workerSource = document.getElementById('inlineWorker');
+
+ var blob = new Blob([workerSource.textContent]);
+
+ // can I create a new script tag like this? ack...
+ var url = window.URL.createObjectURL(blob);
+
+ var worker = new Worker(url);
+
+ worker.addEventListener('message', function(e) {
+    test.step(function () {
+        assert_not_equals(e.data, 'fail', 'inline script ran');
+        test.done();
+    })
+ }, false);
+
+ worker.postMessage('');
+})();
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/script-src/script-src-1_10.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title>data: as script src should not run with a policy that doesn't specify data: as an allowed source</title>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+</head>
+<body>
+    <h1>data: as script src should not run with a policy that doesn't specify data: as an allowed source</h1>
+    <div id='log'></div>
+
+    <script>
+        var dataScriptRan = false;
+    </script>
+
+    <!-- This is our test case, but we don't expect it to actually execute if CSP is working. -->
+    <script src="data:text/javascript;charset=utf-8;base64,ZGF0YVNjcmlwdFJhbiA9IHRydWU7"></script>
+
+    <script>
+        test(function () {
+            assert_false(dataScriptRan, "data script ran");
+        }, "Verify that data: as script src doesn't run with this policy");
+    </script>
+
+    <script async defer src='../support/checkReport.sub.js?reportField=violated-directive&reportValue=default-src%20%27self%27+%27unsafe-inline%27'></script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/script-src/script-src-1_10.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: script-src-1_10={{$id:uuid()}}; Path=/content-security-policy/script-src/
+Content-Security-Policy: default-src 'self' 'unsafe-inline'; report-uri  ../support/report.py?op=put&reportID={{$id}}
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/script-src/script-src-1_10_1.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title>data: as script src should run with a policy that specifies data: as an allowed source but not 'unsafe-inline'</title>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+</head>
+<body>
+    <h1>data: as script src should run with a policy that specifies data: as an allowed source but not 'unsafe-inline'</h1>
+    <div id='log'></div>
+
+    <script src="10_1_support_1.js"></script>
+
+    <script src="data:text/javascript;charset=utf-8;base64,ZGF0YVNjcmlwdFJhbiA9IHRydWU7"></script>
+
+    <script src="10_1_support_2.js"></script>
+
+    <script async defer src='../support/checkReport.sub.js?reportExists=false'></script>
+</body>
+</html>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/script-src/script-src-1_10_1.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: script-src-1_10_1={{$id:uuid()}}; Path=/content-security-policy/script-src/
+Content-Security-Policy: script-src 'self' data:; report-uri  ../support/report.py?op=put&reportID={{$id}}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/script-src/script-src-1_9.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title>Worker created from inline text and loaded via blob URI should not run with policy default-src *</title>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+</head>
+<body>
+    <h1>Worker created from inline text and loaded via blob URI should not run with policy default-src *</h1>
+    <div id='log'></div>
+
+    <script id="inlineWorker" type="app/worker">
+    addEventListener('message', function() {
+        postMessage('fail');
+    }, false);
+    </script>
+
+    <script src="buildInlineWorker.js"></script>
+    <script async defer src='../support/checkReport.sub.js?reportField=violated-directive&reportValue=default-src%20*'></script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/script-src/script-src-1_9.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: script-src-1_9={{$id:uuid()}}; Path=/content-security-policy/script-src/
+Content-Security-Policy: default-src *; report-uri  ../support/report.py?op=put&reportID={{$id}}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/style-src/3_3.css
@@ -0,0 +1,1 @@
+#content {margin-left: 2px;}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/style-src/style-src-3_3.html
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title>href of link with rel=stylesheet must be in src list</title>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+    <script>
+        var head = document.getElementsByTagName('head')[0];
+        var link = document.createElement('link');
+        link.setAttribute('rel', 'stylesheet');
+        link.setAttribute('type', 'text/css');
+        link.setAttribute('href', location.protocol +
+                            '//www1.' +
+                            location.hostname +
+                            ':' +
+                            location.port +
+                            '/content-security-policy/style-src/3_3.css');
+        head.appendChild(link);
+
+       onload = function doTest() {
+         test(function() {
+           var text = document.getElementById("content");
+           assert_true(getComputedStyle(text).marginLeft != "2px", "Style sheet loaded from origin not in style-src directive should be blocked");
+         });
+       }
+    </script>
+</head>
+<body>
+    <h1>href of link with rel=stylesheet must be in src list</h1>
+    <div id='log'></div>
+
+    <div id="content">This text should not have a margin-left of 2</div>
+
+    <script async defer src='../support/checkReport.sub.js?reportField=violated-directive&reportValue=style-src%20%27self%27'></script>
+
+</body>
+</html>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/style-src/style-src-3_3.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: style-src-3_3={{$id:uuid()}}; Path=/content-security-policy/style-src/
+Content-Security-Policy: script-src 'self' 'unsafe-inline'; style-src 'self'; report-uri  ../support/report.py?op=put&reportID={{$id}}
\ No newline at end of file
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b5933803338f770bdb1e6a7d433aeb640be85b08
GIT binary patch
literal 759
zc%17D@N?(olHy`uVBq!ia0vp^D}dO6gAGXb#n?mxDb50q$YKTtZeb8+WSBKa0w~B{
z;_2(kewB-dL*MksU){?<A=whwh!W@g+}zZ>5(ej@)Wnk16ovB4k_?5Aj8p}8Pv3y|
zDXMu43{1J6E{-7;x8BaS%@zq1aX7D`vWR1%iBiXn6*D4KmuwVRZ6Y@7kiW;G{|+bk
zH+(2R(xCX?L14><2`o)qT*vrDTwFI^a1&6Pwe^JVJZH0W=iZ!aso>+;WB&Wzxp#Lr
ze=qv3obAXxQTG&|vjUgaq6Lc<D8VTZ14^L_mtN8;%sKY;&aIhU{VPw+`rnch{XcWv
z8ROGtJKstcD9v2Y;4CT^9G2KC8S*d5L|y$rVZxaU8X4hPt_K&(hEM(&HT(0T1-%#e
zW4xZ3Px|PZFkLa|f|@1!o9>U&57a)GJ!3x50uu2&{UgT2uy|VK?jLz&A5(WfY(B8N
zLVG=9dqcnU9DANU+q=!1ubmAMT3W5Bet`W!ozPKD=cNlmH)qb|f4O|}$DDWDZr<7D
zvry+_s&~!8j3>{QH?SN2W0PSBE57^p`I1Jfxofr`neCXJ+b333B=nhewyJT4u<xaN
zC;F<B?3iqBCfw!tpmEH;;qQTR;}w!yuFvs*Qgh4Aui^NbdUyT}(mN7foLNwsa-sde
zNuld8e~#N3uV@OZTiDOAUMuFi#)l|J-H)Xv?!IrtS#wYOB^b?|zx2lX1?N<%)gITm
zIPN}Y@p^taQw`%gkvrw)yXunu?^qaeA#VEj$_L>GYxg(ao>n<~Nt~Hy^8xh*`p*s@
z_{_JioTozY@%)LN`@?c3S=G6oU2uE4cITYavZpvd2t{-i$`{<6pp~)y)bF*EzE6C&
wJIzD)V-lNaV1OX2C@YWxGoTbJc45wc3_^xo3K8>w2^R=FUHx3vIVCg!0Mx!fX#fBK
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2fa1e0ac0663a65deae6602621521cc2844b93de
GIT binary patch
literal 1689
zc${^WX*3&n7smf;t))z9sgk5hM+alnTMSWZso0lN)UJe5)ig;FstDDQvBcI2qNSm=
zjeV*WYKe6;5{-sx^pH_gOD457Z_qdM{hbfbea`uvd+wKe?sI?faC1<QRhI<-C^#bQ
zyhQ#?Bx{*NqAGTwL0)8sZz25A0LUr-BQZd#P!mCEjH9c)G)q=q#_$y9dqJ}ZX=3dC
zFt+h=agjGM!1i`z7$!0TmT(;t4fBqUggH36dhjB2ZUP{s=xBG*J8^EE6zfvttCqIF
zl%qAvYS}b+!ye?!uhv_u+UN`-{HCC1Y$a8Ky3#f?a@1?eNsoUSRea#7?a^bW+)k6r
z$&r6l?Tklg9xti(D3Kj?Rch&6PpzPYQ9AacBY#Y;3W<O7GcUpIzue@$-B@RQ6%ard
zGofNR4j%A~#qU(|A16xCPU}K0@@4)7*&G{=!m1CZ4ze#c1;00C)~$KY)W;B@$4#km
zZMU+ToVy?dt4oWT$1L(V7BNdRWDR=flUSYJ!jEPB(?PWs#ueEewv{{!pZ)sbH^VP?
zUXo@=T?Z!FpAG`1E;LvLkdDRMq&LD=uasV@GqMn_WIOa5;~g7Uy!7F{Q}^@JN)6s{
zpzT$Yp#lB^<H_`Hzt7K!XUE|siQ{W;wGOmuus~)@MrHD-KQ%NgJnRiqqhVQtOrUVa
z_xmy7U%K}wsm=+61flz`bXxJ0%5{84edoA#Y!KW0=!ydFdy?`ABDK_?t!o5B*$zn^
zwOUOrHJtbj=gFE`Flp388nYo9icsGwCA!inceN$urPqP_+sn?>*@4kWRO}2ZGdWBA
zb+;A0Nr0VP@sE1hj(atiyDkNU^*fpmECINC`fg7kXLN+fzoQ=#)ceQ16JY*EcNyl?
z*nrc>a`^MQ*J()DE3NV&PmbrAcD>_`u$dCeaoav<%wKV0z_)94TvE><5Y1nsX|wO3
zPx_#DxYda<^T|p162T#fxxSw$3SQ!BPZhk1Q0*>QveTi+{KC&+Yh(6&<-59S2aIpY
z?%R2rgwyW3UP)&`u}Se~1so{&>Lf8Ou@qF7{H$E!qA~s%xt|=U;;wKli<h`ygoB^g
zFTtRX(e;9<$&$cuf!edbX9CO^6<)TNn@S4?h6a9~UUq5RbAhSSE~gE0HS#QOe0ieG
z9AF|m_FC9x(Z5a)Frz~c&YSb{;o@q*dQ{ou8#`tDeM4Eb3qzkMH%R-Ov^GX-=HPtk
zq8+{H@vCB6hO8gHr3k~L>Xv>8@h&t&y18Jlo(Eg<yMLnvPz-c<N6<=XWi_#orXSiO
zoHyQeKMhr5oWSJ#NUQ9!ct{ScPw{jltLIJH^N~XV!`vV@lC}=5$NEak^OWh863Gd<
zbG?6nwCOL?&mRsOd?mJ@R&+Yzl%j)_!?!t<Vf9wWr}d7|?fEK0RVlY_qXo#NxXDNq
z>pe^3j5Ns18o*)qS7<immW@~DK#h4MNpo9$O5X29TPP`1F#l(Gx><(mcON0vbqojk
z#!KodVx8ztBrJ~X6Kn51?W6oox#APR^kA}Q&2T1`aOz6A7AQy<9dyggb$xixP?0Y$
zmX_;ldYq*?n|M_9KB2(S<xzP7gt%cu69@94N~#1`oLu&&MPtrP)qggc`%bQF#$8i}
z1ZlW#BW~XKy^VYBiwVjTg<{csii!w9RGmZf;x{_nf+cgQPu92cwvd5zSgRk5+!3e}
ze|TbHe727~^>%yL3Lrj^JLcVGm-=EW-D>JGYYWW&vSI#N_i!Yj>?hMF`rY!t%jWXV
zL6>jTl;>PD=hr0dmid$Ba8+L7=8$k?vpWT>Brc$u1f;AI(_+)N_!#gJE#M#Ui|>>T
zR1~UKIV?)AE1oeB^{--uYc=iAZKy%x+Y^{5Zq%JiJZ=AX<-eV*^A7Oote?YSsnyPm
znT1-2hhmIWC(a;yjE~+d`s#GfzAW`-YDDXpbGl_Wo8{ipkdT0ir^iGw{DBe%zJhvp
zZDREk{n0`(LjtH*-mjYAK{jf)N{F*v^JLMvDo0>PW5R=Wt|D3H0G=e|9yAES>+1GG
ze9_r;3gi0ijb-g`h46IrT#+a@yebW^>$VzExM7amH3aa3_Ff1nb(fM%%FyLKlL@wa
z?C?0hK{0<~sqKY}Ioi)+5BYa)wX^4kt9N_(DMD)@TkfARkbbX!i`JU|hq>rw!}q$g
Vg^jxe1<?-yj`nVL%{HMK{{w#RF>?R_
deleted file mode 100644
--- a/testing/web-platform/tests/cors/testrunner.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE html>
-<html lang=en>
-<meta charset=UTF-8>
-<title>Web tests</title>
-<link rel=stylesheet href=/resources/test-runner/runner.css>
-<script src=/resources/test-runner/runner.js></script>
-
-<p><button value=./>Run tests in this dir</button>
--- a/testing/web-platform/tests/docs/test-format-guidelines.md
+++ b/testing/web-platform/tests/docs/test-format-guidelines.md
@@ -135,25 +135,51 @@ support directory:
 
  * 1x1 color swatches
  * 15x15 color swatches
  * 15x15 bordered color swatches
  * assorted rulers and red/green grids
  * a cat
  * a 4-part picture
 
+## Tools
+Sometimes you may want to add a script to the repository that's meant
+to be used from the command line, not from a browser (e.g., a script
+for generating test files). If you want to ensure (e.g., or security
+reasons) that such scripts won't be handled by the HTTP server, but
+will instead only be usable from the command line, then place them
+in either:
+
+* the `tools` subdir at the root of the repository, or
+* the `tools` subdir at the root of any top-level directory in the
+  repo which contains the tests the script is meant to be used with
+
+Any files in those `tools` directories won't be handled by the HTTP
+server; instead the server will return a 404 if a user navigates to
+the URL for a file within them.
+
+If you want to add a script for use with a particular set of tests
+but there isn't yet any `tools` subdir at the root of a top-level
+directory in the repository containing those tests, you can create
+a `tools` subdir at the root of that top-level directory and place
+your scripts there.
+
+For example, if you wanted to add a script for use with tests in the
+`notifications` directory, create the `notifications/tools` subdir
+and put your script there.
+
 ## Style Rules
 
 A number of style rules should be applied to the test file. These are
 not uniformly enforced throughout the existing tests, but will be for
 new tests. Any of these rules may be broken if the test demands it:
 
  * No trailing whitespace
 
- * Use tabs rather than spaces for indentation
+ * Use spaces rather than tabs for indentation
 
  * Use UNIX-style line endings (i.e. no CR characters at EOL).
 
 ## Advanced Testing Features
 
 Certain test scenarios require more than just static HTML
 generation. This is supported through the
 [wptserve](http://github.com/w3c/wptserve) server. Several scenarios
--- a/testing/web-platform/tests/dom/common.js
+++ b/testing/web-platform/tests/dom/common.js
@@ -1,968 +1,968 @@
 "use strict";
 // Written by Aryeh Gregor <ayg@aryeh.name>
 
 // TODO: iframes, contenteditable/designMode
 
 // Everything is done in functions in this test harness, so we have to declare
 // all the variables before use to make sure they can be reused.
 var testDiv, paras, detachedDiv, detachedPara1, detachedPara2,
-	foreignDoc, foreignPara1, foreignPara2, xmlDoc, xmlElement,
-	detachedXmlElement, detachedTextNode, foreignTextNode,
-	detachedForeignTextNode, xmlTextNode, detachedXmlTextNode,
-	processingInstruction, detachedProcessingInstruction, comment,
-	detachedComment, foreignComment, detachedForeignComment, xmlComment,
-	detachedXmlComment, docfrag, foreignDocfrag, xmlDocfrag, doctype,
-	foreignDoctype, xmlDoctype;
+    foreignDoc, foreignPara1, foreignPara2, xmlDoc, xmlElement,
+    detachedXmlElement, detachedTextNode, foreignTextNode,
+    detachedForeignTextNode, xmlTextNode, detachedXmlTextNode,
+    processingInstruction, detachedProcessingInstruction, comment,
+    detachedComment, foreignComment, detachedForeignComment, xmlComment,
+    detachedXmlComment, docfrag, foreignDocfrag, xmlDocfrag, doctype,
+    foreignDoctype, xmlDoctype;
 var testRangesShort, testRanges, testPoints, testNodesShort, testNodes;
 
 function setupRangeTests() {
-	testDiv = document.querySelector("#test");
-	if (testDiv) {
-		testDiv.parentNode.removeChild(testDiv);
-	}
-	testDiv = document.createElement("div");
-	testDiv.id = "test";
-	document.body.insertBefore(testDiv, document.body.firstChild);
+    testDiv = document.querySelector("#test");
+    if (testDiv) {
+        testDiv.parentNode.removeChild(testDiv);
+    }
+    testDiv = document.createElement("div");
+    testDiv.id = "test";
+    document.body.insertBefore(testDiv, document.body.firstChild);
 
-	paras = [];
-	paras.push(document.createElement("p"));
-	paras[0].setAttribute("id", "a");
-	// Test some diacritics, to make sure browsers are using code units here
-	// and not something like grapheme clusters.
-	paras[0].textContent = "A\u0308b\u0308c\u0308d\u0308e\u0308f\u0308g\u0308h\u0308\n";
-	testDiv.appendChild(paras[0]);
+    paras = [];
+    paras.push(document.createElement("p"));
+    paras[0].setAttribute("id", "a");
+    // Test some diacritics, to make sure browsers are using code units here
+    // and not something like grapheme clusters.
+    paras[0].textContent = "A\u0308b\u0308c\u0308d\u0308e\u0308f\u0308g\u0308h\u0308\n";
+    testDiv.appendChild(paras[0]);
 
-	paras.push(document.createElement("p"));
-	paras[1].setAttribute("id", "b");
-	paras[1].setAttribute("style", "display:none");
-	paras[1].textContent = "Ijklmnop\n";
-	testDiv.appendChild(paras[1]);
+    paras.push(document.createElement("p"));
+    paras[1].setAttribute("id", "b");
+    paras[1].setAttribute("style", "display:none");
+    paras[1].textContent = "Ijklmnop\n";
+    testDiv.appendChild(paras[1]);
 
-	paras.push(document.createElement("p"));
-	paras[2].setAttribute("id", "c");
-	paras[2].textContent = "Qrstuvwx";
-	testDiv.appendChild(paras[2]);
+    paras.push(document.createElement("p"));
+    paras[2].setAttribute("id", "c");
+    paras[2].textContent = "Qrstuvwx";
+    testDiv.appendChild(paras[2]);
 
-	paras.push(document.createElement("p"));
-	paras[3].setAttribute("id", "d");
-	paras[3].setAttribute("style", "display:none");
-	paras[3].textContent = "Yzabcdef";
-	testDiv.appendChild(paras[3]);
+    paras.push(document.createElement("p"));
+    paras[3].setAttribute("id", "d");
+    paras[3].setAttribute("style", "display:none");
+    paras[3].textContent = "Yzabcdef";
+    testDiv.appendChild(paras[3]);
 
-	paras.push(document.createElement("p"));
-	paras[4].setAttribute("id", "e");
-	paras[4].setAttribute("style", "display:none");
-	paras[4].textContent = "Ghijklmn";
-	testDiv.appendChild(paras[4]);
+    paras.push(document.createElement("p"));
+    paras[4].setAttribute("id", "e");
+    paras[4].setAttribute("style", "display:none");
+    paras[4].textContent = "Ghijklmn";
+    testDiv.appendChild(paras[4]);
 
-	detachedDiv = document.createElement("div");
-	detachedPara1 = document.createElement("p");
-	detachedPara1.appendChild(document.createTextNode("Opqrstuv"));
-	detachedPara2 = document.createElement("p");
-	detachedPara2.appendChild(document.createTextNode("Wxyzabcd"));
-	detachedDiv.appendChild(detachedPara1);
-	detachedDiv.appendChild(detachedPara2);
+    detachedDiv = document.createElement("div");
+    detachedPara1 = document.createElement("p");
+    detachedPara1.appendChild(document.createTextNode("Opqrstuv"));
+    detachedPara2 = document.createElement("p");
+    detachedPara2.appendChild(document.createTextNode("Wxyzabcd"));
+    detachedDiv.appendChild(detachedPara1);
+    detachedDiv.appendChild(detachedPara2);
 
-	// Opera doesn't automatically create a doctype for a new HTML document,
-	// contrary to spec.  It also doesn't let you add doctypes to documents
-	// after the fact through any means I've tried.  So foreignDoc in Opera
-	// will have no doctype, foreignDoctype will be null, and Opera will fail
-	// some tests somewhat mysteriously as a result.
-	foreignDoc = document.implementation.createHTMLDocument("");
-	foreignPara1 = foreignDoc.createElement("p");
-	foreignPara1.appendChild(foreignDoc.createTextNode("Efghijkl"));
-	foreignPara2 = foreignDoc.createElement("p");
-	foreignPara2.appendChild(foreignDoc.createTextNode("Mnopqrst"));
-	foreignDoc.body.appendChild(foreignPara1);
-	foreignDoc.body.appendChild(foreignPara2);
+    // Opera doesn't automatically create a doctype for a new HTML document,
+    // contrary to spec.  It also doesn't let you add doctypes to documents
+    // after the fact through any means I've tried.  So foreignDoc in Opera
+    // will have no doctype, foreignDoctype will be null, and Opera will fail
+    // some tests somewhat mysteriously as a result.
+    foreignDoc = document.implementation.createHTMLDocument("");
+    foreignPara1 = foreignDoc.createElement("p");
+    foreignPara1.appendChild(foreignDoc.createTextNode("Efghijkl"));
+    foreignPara2 = foreignDoc.createElement("p");
+    foreignPara2.appendChild(foreignDoc.createTextNode("Mnopqrst"));
+    foreignDoc.body.appendChild(foreignPara1);
+    foreignDoc.body.appendChild(foreignPara2);
 
-	// Now we get to do really silly stuff, which nobody in the universe is
-	// ever going to actually do, but the spec defines behavior, so too bad.
-	// Testing is fun!
-	xmlDoctype = document.implementation.createDocumentType("qorflesnorf", "abcde", "x\"'y");
-	xmlDoc = document.implementation.createDocument(null, null, xmlDoctype);
-	detachedXmlElement = xmlDoc.createElement("everyone-hates-hyphenated-element-names");
-	detachedTextNode = document.createTextNode("Uvwxyzab");
-	detachedForeignTextNode = foreignDoc.createTextNode("Cdefghij");
-	detachedXmlTextNode = xmlDoc.createTextNode("Klmnopqr");
-	// PIs only exist in XML documents, so don't bother with document or
-	// foreignDoc.
-	detachedProcessingInstruction = xmlDoc.createProcessingInstruction("whippoorwill", "chirp chirp chirp");
-	detachedComment = document.createComment("Stuvwxyz");
-	// Hurrah, we finally got to "z" at the end!
-	detachedForeignComment = foreignDoc.createComment("אריה יהודה");
-	detachedXmlComment = xmlDoc.createComment("בן חיים אליעזר");
+    // Now we get to do really silly stuff, which nobody in the universe is
+    // ever going to actually do, but the spec defines behavior, so too bad.
+    // Testing is fun!
+    xmlDoctype = document.implementation.createDocumentType("qorflesnorf", "abcde", "x\"'y");
+    xmlDoc = document.implementation.createDocument(null, null, xmlDoctype);
+    detachedXmlElement = xmlDoc.createElement("everyone-hates-hyphenated-element-names");
+    detachedTextNode = document.createTextNode("Uvwxyzab");
+    detachedForeignTextNode = foreignDoc.createTextNode("Cdefghij");
+    detachedXmlTextNode = xmlDoc.createTextNode("Klmnopqr");
+    // PIs only exist in XML documents, so don't bother with document or
+    // foreignDoc.
+    detachedProcessingInstruction = xmlDoc.createProcessingInstruction("whippoorwill", "chirp chirp chirp");
+    detachedComment = document.createComment("Stuvwxyz");
+    // Hurrah, we finally got to "z" at the end!
+    detachedForeignComment = foreignDoc.createComment("אריה יהודה");
+    detachedXmlComment = xmlDoc.createComment("בן חיים אליעזר");
 
-	// We should also test with document fragments that actually contain stuff
-	// . . . but, maybe later.
-	docfrag = document.createDocumentFragment();
-	foreignDocfrag = foreignDoc.createDocumentFragment();
-	xmlDocfrag = xmlDoc.createDocumentFragment();
+    // We should also test with document fragments that actually contain stuff
+    // . . . but, maybe later.
+    docfrag = document.createDocumentFragment();
+    foreignDocfrag = foreignDoc.createDocumentFragment();
+    xmlDocfrag = xmlDoc.createDocumentFragment();
 
-	xmlElement = xmlDoc.createElement("igiveuponcreativenames");
-	xmlTextNode = xmlDoc.createTextNode("do re mi fa so la ti");
-	xmlElement.appendChild(xmlTextNode);
-	processingInstruction = xmlDoc.createProcessingInstruction("somePI", 'Did you know that ":syn sync fromstart" is very useful when using vim to edit large amounts of JavaScript embedded in HTML?');
-	xmlDoc.appendChild(xmlElement);
-	xmlDoc.appendChild(processingInstruction);
-	xmlComment = xmlDoc.createComment("I maliciously created a comment that will break incautious XML serializers, but Firefox threw an exception, so all I got was this lousy T-shirt");
-	xmlDoc.appendChild(xmlComment);
+    xmlElement = xmlDoc.createElement("igiveuponcreativenames");
+    xmlTextNode = xmlDoc.createTextNode("do re mi fa so la ti");
+    xmlElement.appendChild(xmlTextNode);
+    processingInstruction = xmlDoc.createProcessingInstruction("somePI", 'Did you know that ":syn sync fromstart" is very useful when using vim to edit large amounts of JavaScript embedded in HTML?');
+    xmlDoc.appendChild(xmlElement);
+    xmlDoc.appendChild(processingInstruction);
+    xmlComment = xmlDoc.createComment("I maliciously created a comment that will break incautious XML serializers, but Firefox threw an exception, so all I got was this lousy T-shirt");
+    xmlDoc.appendChild(xmlComment);
 
-	comment = document.createComment("Alphabet soup?");
-	testDiv.appendChild(comment);
+    comment = document.createComment("Alphabet soup?");
+    testDiv.appendChild(comment);
 
-	foreignComment = foreignDoc.createComment('"Commenter" and "commentator" mean different things.  I\'ve seen non-native speakers trip up on this.');
-	foreignDoc.appendChild(foreignComment);
-	foreignTextNode = foreignDoc.createTextNode("I admit that I harbor doubts about whether we really need so many things to test, but it's too late to stop now.");
-	foreignDoc.body.appendChild(foreignTextNode);
+    foreignComment = foreignDoc.createComment('"Commenter" and "commentator" mean different things.  I\'ve seen non-native speakers trip up on this.');
+    foreignDoc.appendChild(foreignComment);
+    foreignTextNode = foreignDoc.createTextNode("I admit that I harbor doubts about whether we really need so many things to test, but it's too late to stop now.");
+    foreignDoc.body.appendChild(foreignTextNode);
 
-	doctype = document.doctype;
-	foreignDoctype = foreignDoc.doctype;
+    doctype = document.doctype;
+    foreignDoctype = foreignDoc.doctype;
 
-	testRangesShort = [
-		// Various ranges within the text node children of different
-		// paragraphs.  All should be valid.
-		"[paras[0].firstChild, 0, paras[0].firstChild, 0]",
-		"[paras[0].firstChild, 0, paras[0].firstChild, 1]",
-		"[paras[0].firstChild, 2, paras[0].firstChild, 8]",
-		"[paras[0].firstChild, 2, paras[0].firstChild, 9]",
-		"[paras[1].firstChild, 0, paras[1].firstChild, 0]",
-		"[paras[1].firstChild, 2, paras[1].firstChild, 9]",
-		"[detachedPara1.firstChild, 0, detachedPara1.firstChild, 0]",
-		"[detachedPara1.firstChild, 2, detachedPara1.firstChild, 8]",
-		"[foreignPara1.firstChild, 0, foreignPara1.firstChild, 0]",
-		"[foreignPara1.firstChild, 2, foreignPara1.firstChild, 8]",
-		// Now try testing some elements, not just text nodes.
-		"[document.documentElement, 0, document.documentElement, 1]",
-		"[document.documentElement, 0, document.documentElement, 2]",
-		"[document.documentElement, 1, document.documentElement, 2]",
-		"[document.head, 1, document.head, 1]",
-		"[document.body, 4, document.body, 5]",
-		"[foreignDoc.documentElement, 0, foreignDoc.documentElement, 1]",
-		"[paras[0], 0, paras[0], 1]",
-		"[detachedPara1, 0, detachedPara1, 1]",
-		// Now try some ranges that span elements.
-		"[paras[0].firstChild, 0, paras[1].firstChild, 0]",
-		"[paras[0].firstChild, 0, paras[1].firstChild, 8]",
-		"[paras[0].firstChild, 3, paras[3], 1]",
-		// How about something that spans a node and its descendant?
-		"[paras[0], 0, paras[0].firstChild, 7]",
-		"[testDiv, 2, paras[4], 1]",
-		// Then a few more interesting things just for good measure.
-		"[document, 0, document, 1]",
-		"[document, 0, document, 2]",
-		"[comment, 2, comment, 3]",
-		"[testDiv, 0, comment, 5]",
-		"[foreignDoc, 1, foreignComment, 2]",
-		"[foreignDoc.body, 0, foreignTextNode, 36]",
-		"[xmlDoc, 1, xmlComment, 0]",
-		"[detachedTextNode, 0, detachedTextNode, 8]",
-		"[detachedForeignTextNode, 0, detachedForeignTextNode, 8]",
-		"[detachedXmlTextNode, 0, detachedXmlTextNode, 8]",
-		"[detachedComment, 3, detachedComment, 4]",
-		"[detachedForeignComment, 0, detachedForeignComment, 1]",
-		"[detachedXmlComment, 2, detachedXmlComment, 6]",
-		"[docfrag, 0, docfrag, 0]",
-	];
+    testRangesShort = [
+        // Various ranges within the text node children of different
+        // paragraphs.  All should be valid.
+        "[paras[0].firstChild, 0, paras[0].firstChild, 0]",
+        "[paras[0].firstChild, 0, paras[0].firstChild, 1]",
+        "[paras[0].firstChild, 2, paras[0].firstChild, 8]",
+        "[paras[0].firstChild, 2, paras[0].firstChild, 9]",
+        "[paras[1].firstChild, 0, paras[1].firstChild, 0]",
+        "[paras[1].firstChild, 2, paras[1].firstChild, 9]",
+        "[detachedPara1.firstChild, 0, detachedPara1.firstChild, 0]",
+        "[detachedPara1.firstChild, 2, detachedPara1.firstChild, 8]",
+        "[foreignPara1.firstChild, 0, foreignPara1.firstChild, 0]",
+        "[foreignPara1.firstChild, 2, foreignPara1.firstChild, 8]",
+        // Now try testing some elements, not just text nodes.
+        "[document.documentElement, 0, document.documentElement, 1]",
+        "[document.documentElement, 0, document.documentElement, 2]",
+        "[document.documentElement, 1, document.documentElement, 2]",
+        "[document.head, 1, document.head, 1]",
+        "[document.body, 4, document.body, 5]",
+        "[foreignDoc.documentElement, 0, foreignDoc.documentElement, 1]",
+        "[paras[0], 0, paras[0], 1]",
+        "[detachedPara1, 0, detachedPara1, 1]",
+        // Now try some ranges that span elements.
+        "[paras[0].firstChild, 0, paras[1].firstChild, 0]",
+        "[paras[0].firstChild, 0, paras[1].firstChild, 8]",
+        "[paras[0].firstChild, 3, paras[3], 1]",
+        // How about something that spans a node and its descendant?
+        "[paras[0], 0, paras[0].firstChild, 7]",
+        "[testDiv, 2, paras[4], 1]",
+        // Then a few more interesting things just for good measure.
+        "[document, 0, document, 1]",
+        "[document, 0, document, 2]",
+        "[comment, 2, comment, 3]",
+        "[testDiv, 0, comment, 5]",
+        "[foreignDoc, 1, foreignComment, 2]",
+        "[foreignDoc.body, 0, foreignTextNode, 36]",
+        "[xmlDoc, 1, xmlComment, 0]",
+        "[detachedTextNode, 0, detachedTextNode, 8]",
+        "[detachedForeignTextNode, 0, detachedForeignTextNode, 8]",
+        "[detachedXmlTextNode, 0, detachedXmlTextNode, 8]",
+        "[detachedComment, 3, detachedComment, 4]",
+        "[detachedForeignComment, 0, detachedForeignComment, 1]",
+        "[detachedXmlComment, 2, detachedXmlComment, 6]",
+        "[docfrag, 0, docfrag, 0]",
+    ];
 
-	testRanges = testRangesShort.concat([
-		"[paras[1].firstChild, 0, paras[1].firstChild, 1]",
-		"[paras[1].firstChild, 2, paras[1].firstChild, 8]",
-		"[detachedPara1.firstChild, 0, detachedPara1.firstChild, 1]",
-		"[foreignPara1.firstChild, 0, foreignPara1.firstChild, 1]",
-		"[foreignDoc.head, 1, foreignDoc.head, 1]",
-		"[foreignDoc.body, 0, foreignDoc.body, 0]",
-		"[paras[0], 0, paras[0], 0]",
-		"[detachedPara1, 0, detachedPara1, 0]",
-		"[testDiv, 1, paras[2].firstChild, 5]",
-		"[document.documentElement, 1, document.body, 0]",
-		"[foreignDoc.documentElement, 1, foreignDoc.body, 0]",
-		"[document, 1, document, 2]",
-		"[paras[2].firstChild, 4, comment, 2]",
-		"[paras[3], 1, comment, 8]",
-		"[foreignDoc, 0, foreignDoc, 0]",
-		"[xmlDoc, 0, xmlDoc, 0]",
-		"[detachedForeignTextNode, 7, detachedForeignTextNode, 7]",
-		"[detachedXmlTextNode, 7, detachedXmlTextNode, 7]",
-		"[detachedComment, 5, detachedComment, 5]",
-		"[detachedForeignComment, 4, detachedForeignComment, 4]",
-		"[foreignDocfrag, 0, foreignDocfrag, 0]",
-		"[xmlDocfrag, 0, xmlDocfrag, 0]",
-	]);
+    testRanges = testRangesShort.concat([
+        "[paras[1].firstChild, 0, paras[1].firstChild, 1]",
+        "[paras[1].firstChild, 2, paras[1].firstChild, 8]",
+        "[detachedPara1.firstChild, 0, detachedPara1.firstChild, 1]",
+        "[foreignPara1.firstChild, 0, foreignPara1.firstChild, 1]",
+        "[foreignDoc.head, 1, foreignDoc.head, 1]",
+        "[foreignDoc.body, 0, foreignDoc.body, 0]",
+        "[paras[0], 0, paras[0], 0]",
+        "[detachedPara1, 0, detachedPara1, 0]",
+        "[testDiv, 1, paras[2].firstChild, 5]",
+        "[document.documentElement, 1, document.body, 0]",
+        "[foreignDoc.documentElement, 1, foreignDoc.body, 0]",
+        "[document, 1, document, 2]",
+        "[paras[2].firstChild, 4, comment, 2]",
+        "[paras[3], 1, comment, 8]",
+        "[foreignDoc, 0, foreignDoc, 0]",
+        "[xmlDoc, 0, xmlDoc, 0]",
+        "[detachedForeignTextNode, 7, detachedForeignTextNode, 7]",
+        "[detachedXmlTextNode, 7, detachedXmlTextNode, 7]",
+        "[detachedComment, 5, detachedComment, 5]",
+        "[detachedForeignComment, 4, detachedForeignComment, 4]",
+        "[foreignDocfrag, 0, foreignDocfrag, 0]",
+        "[xmlDocfrag, 0, xmlDocfrag, 0]",
+    ]);
 
-	testPoints = [
-		// Various positions within the page, some invalid.  Remember that
-		// paras[0] is visible, and paras[1] is display: none.
-		"[paras[0].firstChild, -1]",
-		"[paras[0].firstChild, 0]",
-		"[paras[0].firstChild, 1]",
-		"[paras[0].firstChild, 2]",
-		"[paras[0].firstChild, 8]",
-		"[paras[0].firstChild, 9]",
-		"[paras[0].firstChild, 10]",
-		"[paras[0].firstChild, 65535]",
-		"[paras[1].firstChild, -1]",
-		"[paras[1].firstChild, 0]",
-		"[paras[1].firstChild, 1]",
-		"[paras[1].firstChild, 2]",
-		"[paras[1].firstChild, 8]",
-		"[paras[1].firstChild, 9]",
-		"[paras[1].firstChild, 10]",
-		"[paras[1].firstChild, 65535]",
-		"[detachedPara1.firstChild, 0]",
-		"[detachedPara1.firstChild, 1]",
-		"[detachedPara1.firstChild, 8]",
-		"[detachedPara1.firstChild, 9]",
-		"[foreignPara1.firstChild, 0]",
-		"[foreignPara1.firstChild, 1]",
-		"[foreignPara1.firstChild, 8]",
-		"[foreignPara1.firstChild, 9]",
-		// Now try testing some elements, not just text nodes.
-		"[document.documentElement, -1]",
-		"[document.documentElement, 0]",
-		"[document.documentElement, 1]",
-		"[document.documentElement, 2]",
-		"[document.documentElement, 7]",
-		"[document.head, 1]",
-		"[document.body, 3]",
-		"[foreignDoc.documentElement, 0]",
-		"[foreignDoc.documentElement, 1]",
-		"[foreignDoc.head, 0]",
-		"[foreignDoc.body, 1]",
-		"[paras[0], 0]",
-		"[paras[0], 1]",
-		"[paras[0], 2]",
-		"[paras[1], 0]",
-		"[paras[1], 1]",
-		"[paras[1], 2]",
-		"[detachedPara1, 0]",
-		"[detachedPara1, 1]",
-		"[testDiv, 0]",
-		"[testDiv, 3]",
-		// Then a few more interesting things just for good measure.
-		"[document, -1]",
-		"[document, 0]",
-		"[document, 1]",
-		"[document, 2]",
-		"[document, 3]",
-		"[comment, -1]",
-		"[comment, 0]",
-		"[comment, 4]",
-		"[comment, 96]",
-		"[foreignDoc, 0]",
-		"[foreignDoc, 1]",
-		"[foreignComment, 2]",
-		"[foreignTextNode, 0]",
-		"[foreignTextNode, 36]",
-		"[xmlDoc, -1]",
-		"[xmlDoc, 0]",
-		"[xmlDoc, 1]",
-		"[xmlDoc, 5]",
-		"[xmlComment, 0]",
-		"[xmlComment, 4]",
-		"[processingInstruction, 0]",
-		"[processingInstruction, 5]",
-		"[processingInstruction, 9]",
-		"[detachedTextNode, 0]",
-		"[detachedTextNode, 8]",
-		"[detachedForeignTextNode, 0]",
-		"[detachedForeignTextNode, 8]",
-		"[detachedXmlTextNode, 0]",
-		"[detachedXmlTextNode, 8]",
-		"[detachedProcessingInstruction, 12]",
-		"[detachedComment, 3]",
-		"[detachedComment, 5]",
-		"[detachedForeignComment, 0]",
-		"[detachedForeignComment, 4]",
-		"[detachedXmlComment, 2]",
-		"[docfrag, 0]",
-		"[foreignDocfrag, 0]",
-		"[xmlDocfrag, 0]",
-		"[doctype, 0]",
-		"[doctype, -17]",
-		"[doctype, 1]",
-		"[foreignDoctype, 0]",
-		"[xmlDoctype, 0]",
-	];
+    testPoints = [
+        // Various positions within the page, some invalid.  Remember that
+        // paras[0] is visible, and paras[1] is display: none.
+        "[paras[0].firstChild, -1]",
+        "[paras[0].firstChild, 0]",
+        "[paras[0].firstChild, 1]",
+        "[paras[0].firstChild, 2]",
+        "[paras[0].firstChild, 8]",
+        "[paras[0].firstChild, 9]",
+        "[paras[0].firstChild, 10]",
+        "[paras[0].firstChild, 65535]",
+        "[paras[1].firstChild, -1]",
+        "[paras[1].firstChild, 0]",
+        "[paras[1].firstChild, 1]",
+        "[paras[1].firstChild, 2]",
+        "[paras[1].firstChild, 8]",
+        "[paras[1].firstChild, 9]",
+        "[paras[1].firstChild, 10]",
+        "[paras[1].firstChild, 65535]",
+        "[detachedPara1.firstChild, 0]",
+        "[detachedPara1.firstChild, 1]",
+        "[detachedPara1.firstChild, 8]",
+        "[detachedPara1.firstChild, 9]",
+        "[foreignPara1.firstChild, 0]",
+        "[foreignPara1.firstChild, 1]",
+        "[foreignPara1.firstChild, 8]",
+        "[foreignPara1.firstChild, 9]",
+        // Now try testing some elements, not just text nodes.
+        "[document.documentElement, -1]",
+        "[document.documentElement, 0]",
+        "[document.documentElement, 1]",
+        "[document.documentElement, 2]",
+        "[document.documentElement, 7]",
+        "[document.head, 1]",
+        "[document.body, 3]",
+        "[foreignDoc.documentElement, 0]",
+        "[foreignDoc.documentElement, 1]",
+        "[foreignDoc.head, 0]",
+        "[foreignDoc.body, 1]",
+        "[paras[0], 0]",
+        "[paras[0], 1]",
+        "[paras[0], 2]",
+        "[paras[1], 0]",
+        "[paras[1], 1]",
+        "[paras[1], 2]",
+        "[detachedPara1, 0]",
+        "[detachedPara1, 1]",
+        "[testDiv, 0]",
+        "[testDiv, 3]",
+        // Then a few more interesting things just for good measure.
+        "[document, -1]",
+        "[document, 0]",
+        "[document, 1]",
+        "[document, 2]",
+        "[document, 3]",
+        "[comment, -1]",
+        "[comment, 0]",
+        "[comment, 4]",
+        "[comment, 96]",
+        "[foreignDoc, 0]",
+        "[foreignDoc, 1]",
+        "[foreignComment, 2]",
+        "[foreignTextNode, 0]",
+        "[foreignTextNode, 36]",
+        "[xmlDoc, -1]",
+        "[xmlDoc, 0]",
+        "[xmlDoc, 1]",
+        "[xmlDoc, 5]",
+        "[xmlComment, 0]",
+        "[xmlComment, 4]",
+        "[processingInstruction, 0]",
+        "[processingInstruction, 5]",
+        "[processingInstruction, 9]",
+        "[detachedTextNode, 0]",
+        "[detachedTextNode, 8]",
+        "[detachedForeignTextNode, 0]",
+        "[detachedForeignTextNode, 8]",
+        "[detachedXmlTextNode, 0]",
+        "[detachedXmlTextNode, 8]",
+        "[detachedProcessingInstruction, 12]",
+        "[detachedComment, 3]",
+        "[detachedComment, 5]",
+        "[detachedForeignComment, 0]",
+        "[detachedForeignComment, 4]",
+        "[detachedXmlComment, 2]",
+        "[docfrag, 0]",
+        "[foreignDocfrag, 0]",
+        "[xmlDocfrag, 0]",
+        "[doctype, 0]",
+        "[doctype, -17]",
+        "[doctype, 1]",
+        "[foreignDoctype, 0]",
+        "[xmlDoctype, 0]",
+    ];
 
-	testNodesShort = [
-		"paras[0]",
-		"paras[0].firstChild",
-		"paras[1].firstChild",
-		"foreignPara1",
-		"foreignPara1.firstChild",
-		"detachedPara1",
-		"detachedPara1.firstChild",
-		"document",
-		"detachedDiv",
-		"foreignDoc",
-		"foreignPara2",
-		"xmlDoc",
-		"xmlElement",
-		"detachedTextNode",
-		"foreignTextNode",
-		"processingInstruction",
-		"detachedProcessingInstruction",
-		"comment",
-		"detachedComment",
-		"docfrag",
-		"doctype",
-		"foreignDoctype",
-	];
+    testNodesShort = [
+        "paras[0]",
+        "paras[0].firstChild",
+        "paras[1].firstChild",
+        "foreignPara1",
+        "foreignPara1.firstChild",
+        "detachedPara1",
+        "detachedPara1.firstChild",
+        "document",
+        "detachedDiv",
+        "foreignDoc",
+        "foreignPara2",
+        "xmlDoc",
+        "xmlElement",
+        "detachedTextNode",
+        "foreignTextNode",
+        "processingInstruction",
+        "detachedProcessingInstruction",
+        "comment",
+        "detachedComment",
+        "docfrag",
+        "doctype",
+        "foreignDoctype",
+    ];
 
-	testNodes = testNodesShort.concat([
-		"paras[1]",
-		"detachedPara2",
-		"detachedPara2.firstChild",
-		"testDiv",
-		"detachedXmlElement",
-		"detachedForeignTextNode",
-		"xmlTextNode",
-		"detachedXmlTextNode",
-		"xmlComment",
-		"foreignComment",
-		"detachedForeignComment",
-		"detachedXmlComment",
-		"foreignDocfrag",
-		"xmlDocfrag",
-		"xmlDoctype",
-	]);
+    testNodes = testNodesShort.concat([
+        "paras[1]",
+        "detachedPara2",
+        "detachedPara2.firstChild",
+        "testDiv",
+        "detachedXmlElement",
+        "detachedForeignTextNode",
+        "xmlTextNode",
+        "detachedXmlTextNode",
+        "xmlComment",
+        "foreignComment",
+        "detachedForeignComment",
+        "detachedXmlComment",
+        "foreignDocfrag",
+        "xmlDocfrag",
+        "xmlDoctype",
+    ]);
 }
 if ("setup" in window) {
-	setup(setupRangeTests);
+    setup(setupRangeTests);
 } else {
-	// Presumably we're running from within an iframe or something
-	setupRangeTests();
+    // Presumably we're running from within an iframe or something
+    setupRangeTests();
 }
 
 /**
  * The "length" of a node as defined by the Ranges section of DOM4.
  */
 function nodeLength(node) {
-	// "The length of a node node depends on node:
-	//
-	// "DocumentType
-	//   "0."
-	if (node.nodeType == Node.DOCUMENT_TYPE_NODE) {
-		return 0;
-	}
-	// "Text
-	// "ProcessingInstruction
-	// "Comment
-	//   "Its length attribute value."
-	// Browsers don't historically support the length attribute on
-	// ProcessingInstruction, so to avoid spurious failures, do
-	// node.data.length instead of node.length.
-	if (node.nodeType == Node.TEXT_NODE || node.nodeType == Node.PROCESSING_INSTRUCTION_NODE || node.nodeType == Node.COMMENT_NODE) {
-		return node.data.length;
-	}
-	// "Any other node
-	//   "Its number of children."
-	return node.childNodes.length;
+    // "The length of a node node depends on node:
+    //
+    // "DocumentType
+    //   "0."
+    if (node.nodeType == Node.DOCUMENT_TYPE_NODE) {
+        return 0;
+    }
+    // "Text
+    // "ProcessingInstruction
+    // "Comment
+    //   "Its length attribute value."
+    // Browsers don't historically support the length attribute on
+    // ProcessingInstruction, so to avoid spurious failures, do
+    // node.data.length instead of node.length.
+    if (node.nodeType == Node.TEXT_NODE || node.nodeType == Node.PROCESSING_INSTRUCTION_NODE || node.nodeType == Node.COMMENT_NODE) {
+        return node.data.length;
+    }
+    // "Any other node
+    //   "Its number of children."
+    return node.childNodes.length;
 }
 
 /**
  * Returns the furthest ancestor of a Node as defined by the spec.
  */
 function furthestAncestor(node) {
-	var root = node;
-	while (root.parentNode != null) {
-		root = root.parentNode;
-	}
-	return root;
+    var root = node;
+    while (root.parentNode != null) {
+        root = root.parentNode;
+    }
+    return root;
 }
 
 /**
  * "The ancestor containers of a Node are the Node itself and all its
  * ancestors."
  *
  * Is node1 an ancestor container of node2?
  */
 function isAncestorContainer(node1, node2) {
-	return node1 == node2 ||
-		(node2.compareDocumentPosition(node1) & Node.DOCUMENT_POSITION_CONTAINS);
+    return node1 == node2 ||
+        (node2.compareDocumentPosition(node1) & Node.DOCUMENT_POSITION_CONTAINS);
 }
 
 /**
  * Returns the first Node that's after node in tree order, or null if node is
  * the last Node.
  */
 function nextNode(node) {
-	if (node.hasChildNodes()) {
-		return node.firstChild;
-	}
-	return nextNodeDescendants(node);
+    if (node.hasChildNodes()) {
+        return node.firstChild;
+    }
+    return nextNodeDescendants(node);
 }
 
 /**
  * Returns the last Node that's before node in tree order, or null if node is
  * the first Node.
  */
 function previousNode(node) {
-	if (node.previousSibling) {
-		node = node.previousSibling;
-		while (node.hasChildNodes()) {
-			node = node.lastChild;
-		}
-		return node;
-	}
-	return node.parentNode;
+    if (node.previousSibling) {
+        node = node.previousSibling;
+        while (node.hasChildNodes()) {
+            node = node.lastChild;
+        }
+        return node;
+    }
+    return node.parentNode;
 }
 
 /**
  * Returns the next Node that's after node and all its descendants in tree
  * order, or null if node is the last Node or an ancestor of it.
  */
 function nextNodeDescendants(node) {
-	while (node && !node.nextSibling) {
-		node = node.parentNode;
-	}
-	if (!node) {
-		return null;
-	}
-	return node.nextSibling;
+    while (node && !node.nextSibling) {
+        node = node.parentNode;
+    }
+    if (!node) {
+        return null;
+    }
+    return node.nextSibling;
 }
 
 /**
  * Returns the ownerDocument of the Node, or the Node itself if it's a
  * Document.
  */
 function ownerDocument(node) {
-	return node.nodeType == Node.DOCUMENT_NODE
-		? node
-		: node.ownerDocument;
+    return node.nodeType == Node.DOCUMENT_NODE
+        ? node
+        : node.ownerDocument;
 }
 
 /**
  * Returns true if ancestor is an ancestor of descendant, false otherwise.
  */
 function isAncestor(ancestor, descendant) {
-	if (!ancestor || !descendant) {
-		return false;
-	}
-	while (descendant && descendant != ancestor) {
-		descendant = descendant.parentNode;
-	}
-	return descendant == ancestor;
+    if (!ancestor || !descendant) {
+        return false;
+    }
+    while (descendant && descendant != ancestor) {
+        descendant = descendant.parentNode;
+    }
+    return descendant == ancestor;
 }
 
 /**
  * Returns true if ancestor is an inclusive ancestor of descendant, false
  * otherwise.
  */
 function isInclusiveAncestor(ancestor, descendant) {
-	return ancestor === descendant || isAncestor(ancestor, descendant);
+    return ancestor === descendant || isAncestor(ancestor, descendant);
 }
 
 /**
  * Returns true if descendant is a descendant of ancestor, false otherwise.
  */
 function isDescendant(descendant, ancestor) {
-	return isAncestor(ancestor, descendant);
+    return isAncestor(ancestor, descendant);
 }
 
 /**
  * Returns true if descendant is an inclusive descendant of ancestor, false
  * otherwise.
  */
 function isInclusiveDescendant(descendant, ancestor) {
-	return descendant === ancestor || isDescendant(descendant, ancestor);
+    return descendant === ancestor || isDescendant(descendant, ancestor);
 }
 
 /**
  * The position of two boundary points relative to one another, as defined by
  * the spec.
  */
 function getPosition(nodeA, offsetA, nodeB, offsetB) {
-	// "If node A is the same as node B, return equal if offset A equals offset
-	// B, before if offset A is less than offset B, and after if offset A is
-	// greater than offset B."
-	if (nodeA == nodeB) {
-		if (offsetA == offsetB) {
-			return "equal";
-		}
-		if (offsetA < offsetB) {
-			return "before";
-		}
-		if (offsetA > offsetB) {
-			return "after";
-		}
-	}
+    // "If node A is the same as node B, return equal if offset A equals offset
+    // B, before if offset A is less than offset B, and after if offset A is
+    // greater than offset B."
+    if (nodeA == nodeB) {
+        if (offsetA == offsetB) {
+            return "equal";
+        }
+        if (offsetA < offsetB) {
+            return "before";
+        }
+        if (offsetA > offsetB) {
+            return "after";
+        }
+    }
 
-	// "If node A is after node B in tree order, compute the position of (node
-	// B, offset B) relative to (node A, offset A). If it is before, return
-	// after. If it is after, return before."
-	if (nodeB.compareDocumentPosition(nodeA) & Node.DOCUMENT_POSITION_FOLLOWING) {
-		var pos = getPosition(nodeB, offsetB, nodeA, offsetA);
-		if (pos == "before") {
-			return "after";
-		}
-		if (pos == "after") {
-			return "before";
-		}
-	}
+    // "If node A is after node B in tree order, compute the position of (node
+    // B, offset B) relative to (node A, offset A). If it is before, return
+    // after. If it is after, return before."
+    if (nodeB.compareDocumentPosition(nodeA) & Node.DOCUMENT_POSITION_FOLLOWING) {
+        var pos = getPosition(nodeB, offsetB, nodeA, offsetA);
+        if (pos == "before") {
+            return "after";
+        }
+        if (pos == "after") {
+            return "before";
+        }
+    }
 
-	// "If node A is an ancestor of node B:"
-	if (nodeB.compareDocumentPosition(nodeA) & Node.DOCUMENT_POSITION_CONTAINS) {
-		// "Let child equal node B."
-		var child = nodeB;
+    // "If node A is an ancestor of node B:"
+    if (nodeB.compareDocumentPosition(nodeA) & Node.DOCUMENT_POSITION_CONTAINS) {
+        // "Let child equal node B."
+        var child = nodeB;
 
-		// "While child is not a child of node A, set child to its parent."
-		while (child.parentNode != nodeA) {
-			child = child.parentNode;
-		}
+        // "While child is not a child of node A, set child to its parent."
+        while (child.parentNode != nodeA) {
+            child = child.parentNode;
+        }
 
-		// "If the index of child is less than offset A, return after."
-		if (indexOf(child) < offsetA) {
-			return "after";
-		}
-	}
+        // "If the index of child is less than offset A, return after."
+        if (indexOf(child) < offsetA) {
+            return "after";
+        }
+    }
 
-	// "Return before."
-	return "before";
+    // "Return before."
+    return "before";
 }
 
 /**
  * "contained" as defined by DOM Range: "A Node node is contained in a range
  * range if node's furthest ancestor is the same as range's root, and (node, 0)
  * is after range's start, and (node, length of node) is before range's end."
  */
 function isContained(node, range) {
-	var pos1 = getPosition(node, 0, range.startContainer, range.startOffset);
-	var pos2 = getPosition(node, nodeLength(node), range.endContainer, range.endOffset);
+    var pos1 = getPosition(node, 0, range.startContainer, range.startOffset);
+    var pos2 = getPosition(node, nodeLength(node), range.endContainer, range.endOffset);
 
-	return furthestAncestor(node) == furthestAncestor(range.startContainer)
-		&& pos1 == "after"
-		&& pos2 == "before";
+    return furthestAncestor(node) == furthestAncestor(range.startContainer)
+        && pos1 == "after"
+        && pos2 == "before";
 }
 
 /**
  * "partially contained" as defined by DOM Range: "A Node is partially
  * contained in a range if it is an ancestor container of the range's start but
  * not its end, or vice versa."
  */
 function isPartiallyContained(node, range) {
-	var cond1 = isAncestorContainer(node, range.startContainer);
-	var cond2 = isAncestorContainer(node, range.endContainer);
-	return (cond1 && !cond2) || (cond2 && !cond1);
+    var cond1 = isAncestorContainer(node, range.startContainer);
+    var cond2 = isAncestorContainer(node, range.endContainer);
+    return (cond1 && !cond2) || (cond2 && !cond1);
 }
 
 /**
  * Index of a node as defined by the spec.
  */
 function indexOf(node) {
-	if (!node.parentNode) {
-		// No preceding sibling nodes, right?
-		return 0;
-	}
-	var i = 0;
-	while (node != node.parentNode.childNodes[i]) {
-		i++;
-	}
-	return i;
+    if (!node.parentNode) {
+        // No preceding sibling nodes, right?
+        return 0;
+    }
+    var i = 0;
+    while (node != node.parentNode.childNodes[i]) {
+        i++;
+    }
+    return i;
 }
 
 /**
  * extractContents() implementation, following the spec.  If an exception is
  * supposed to be thrown, will return a string with the name (e.g.,
  * "HIERARCHY_REQUEST_ERR") instead of a document fragment.  It might also
  * return an arbitrary human-readable string if a condition is hit that implies
  * a spec bug.
  */
 function myExtractContents(range) {
-	// "If the context object's detached flag is set, raise an
-	// INVALID_STATE_ERR exception and abort these steps."
-	try {
-		range.collapsed;
-	} catch (e) {
-		return "INVALID_STATE_ERR";
-	}
+    // "If the context object's detached flag is set, raise an
+    // INVALID_STATE_ERR exception and abort these steps."
+    try {
+        range.collapsed;
+    } catch (e) {
+        return "INVALID_STATE_ERR";
+    }
 
-	// "Let frag be a new DocumentFragment whose ownerDocument is the same as
-	// the ownerDocument of the context object's start node."
-	var ownerDoc = range.startContainer.nodeType == Node.DOCUMENT_NODE
-		? range.startContainer
-		: range.startContainer.ownerDocument;
-	var frag = ownerDoc.createDocumentFragment();
+    // "Let frag be a new DocumentFragment whose ownerDocument is the same as
+    // the ownerDocument of the context object's start node."
+    var ownerDoc = range.startContainer.nodeType == Node.DOCUMENT_NODE
+        ? range.startContainer
+        : range.startContainer.ownerDocument;
+    var frag = ownerDoc.createDocumentFragment();
 
-	// "If the context object's start and end are the same, abort this method,
-	// returning frag."
-	if (range.startContainer == range.endContainer
-	&& range.startOffset == range.endOffset) {
-		return frag;
-	}
+    // "If the context object's start and end are the same, abort this method,
+    // returning frag."
+    if (range.startContainer == range.endContainer
+    && range.startOffset == range.endOffset) {
+        return frag;
+    }
 
-	// "Let original start node, original start offset, original end node, and
-	// original end offset be the context object's start and end nodes and
-	// offsets, respectively."
-	var originalStartNode = range.startContainer;
-	var originalStartOffset = range.startOffset;
-	var originalEndNode = range.endContainer;
-	var originalEndOffset = range.endOffset;
+    // "Let original start node, original start offset, original end node, and
+    // original end offset be the context object's start and end nodes and
+    // offsets, respectively."
+    var originalStartNode = range.startContainer;
+    var originalStartOffset = range.startOffset;
+    var originalEndNode = range.endContainer;
+    var originalEndOffset = range.endOffset;
 
-	// "If original start node and original end node are the same, and they are
-	// a Text or Comment node:"
-	if (range.startContainer == range.endContainer
-	&& (range.startContainer.nodeType == Node.TEXT_NODE
-	|| range.startContainer.nodeType == Node.COMMENT_NODE)) {
-		// "Let clone be the result of calling cloneNode(false) on original
-		// start node."
-		var clone = originalStartNode.cloneNode(false);
+    // "If original start node and original end node are the same, and they are
+    // a Text or Comment node:"
+    if (range.startContainer == range.endContainer
+    && (range.startContainer.nodeType == Node.TEXT_NODE
+    || range.startContainer.nodeType == Node.COMMENT_NODE)) {
+        // "Let clone be the result of calling cloneNode(false) on original
+        // start node."
+        var clone = originalStartNode.cloneNode(false);
 
-		// "Set the data of clone to the result of calling
-		// substringData(original start offset, original end offset − original
-		// start offset) on original start node."
-		clone.data = originalStartNode.substringData(originalStartOffset,
-			originalEndOffset - originalStartOffset);
+        // "Set the data of clone to the result of calling
+        // substringData(original start offset, original end offset − original
+        // start offset) on original start node."
+        clone.data = originalStartNode.substringData(originalStartOffset,
+            originalEndOffset - originalStartOffset);
 
-		// "Append clone as the last child of frag."
-		frag.appendChild(clone);
+        // "Append clone as the last child of frag."
+        frag.appendChild(clone);
 
-		// "Call deleteData(original start offset, original end offset −
-		// original start offset) on original start node."
-		originalStartNode.deleteData(originalStartOffset,
-			originalEndOffset - originalStartOffset);
+        // "Call deleteData(original start offset, original end offset −
+        // original start offset) on original start node."
+        originalStartNode.deleteData(originalStartOffset,
+            originalEndOffset - originalStartOffset);
 
-		// "Abort this method, returning frag."
-		return frag;
-	}
+        // "Abort this method, returning frag."
+        return frag;
+    }
 
-	// "Let common ancestor equal original start node."
-	var commonAncestor = originalStartNode;
+    // "Let common ancestor equal original start node."
+    var commonAncestor = originalStartNode;
 
-	// "While common ancestor is not an ancestor container of original end
-	// node, set common ancestor to its own parent."
-	while (!isAncestorContainer(commonAncestor, originalEndNode)) {
-		commonAncestor = commonAncestor.parentNode;
-	}
+    // "While common ancestor is not an ancestor container of original end
+    // node, set common ancestor to its own parent."
+    while (!isAncestorContainer(commonAncestor, originalEndNode)) {
+        commonAncestor = commonAncestor.parentNode;
+    }
 
-	// "If original start node is an ancestor container of original end node,
-	// let first partially contained child be null."
-	var firstPartiallyContainedChild;
-	if (isAncestorContainer(originalStartNode, originalEndNode)) {
-		firstPartiallyContainedChild = null;
-	// "Otherwise, let first partially contained child be the first child of
-	// common ancestor that is partially contained in the context object."
-	} else {
-		for (var i = 0; i < commonAncestor.childNodes.length; i++) {
-			if (isPartiallyContained(commonAncestor.childNodes[i], range)) {
-				firstPartiallyContainedChild = commonAncestor.childNodes[i];
-				break;
-			}
-		}
-		if (!firstPartiallyContainedChild) {
-			throw "Spec bug: no first partially contained child!";
-		}
-	}
+    // "If original start node is an ancestor container of original end node,
+    // let first partially contained child be null."
+    var firstPartiallyContainedChild;
+    if (isAncestorContainer(originalStartNode, originalEndNode)) {
+        firstPartiallyContainedChild = null;
+    // "Otherwise, let first partially contained child be the first child of
+    // common ancestor that is partially contained in the context object."
+    } else {
+        for (var i = 0; i < commonAncestor.childNodes.length; i++) {
+            if (isPartiallyContained(commonAncestor.childNodes[i], range)) {
+                firstPartiallyContainedChild = commonAncestor.childNodes[i];
+                break;
+            }
+        }
+        if (!firstPartiallyContainedChild) {
+            throw "Spec bug: no first partially contained child!";
+        }
+    }
 
-	// "If original end node is an ancestor container of original start node,
-	// let last partially contained child be null."
-	var lastPartiallyContainedChild;
-	if (isAncestorContainer(originalEndNode, originalStartNode)) {
-		lastPartiallyContainedChild = null;
-	// "Otherwise, let last partially contained child be the last child of
-	// common ancestor that is partially contained in the context object."
-	} else {
-		for (var i = commonAncestor.childNodes.length - 1; i >= 0; i--) {
-			if (isPartiallyContained(commonAncestor.childNodes[i], range)) {
-				lastPartiallyContainedChild = commonAncestor.childNodes[i];
-				break;
-			}
-		}
-		if (!lastPartiallyContainedChild) {
-			throw "Spec bug: no last partially contained child!";
-		}
-	}
+    // "If original end node is an ancestor container of original start node,
+    // let last partially contained child be null."
+    var lastPartiallyContainedChild;
+    if (isAncestorContainer(originalEndNode, originalStartNode)) {
+        lastPartiallyContainedChild = null;
+    // "Otherwise, let last partially contained child be the last child of
+    // common ancestor that is partially contained in the context object."
+    } else {
+        for (var i = commonAncestor.childNodes.length - 1; i >= 0; i--) {
+            if (isPartiallyContained(commonAncestor.childNodes[i], range)) {
+                lastPartiallyContainedChild = commonAncestor.childNodes[i];
+                break;
+            }
+        }
+        if (!lastPartiallyContainedChild) {
+            throw "Spec bug: no last partially contained child!";
+        }
+    }
 
-	// "Let contained children be a list of all children of common ancestor
-	// that are contained in the context object, in tree order."
-	//
-	// "If any member of contained children is a DocumentType, raise a
-	// HIERARCHY_REQUEST_ERR exception and abort these steps."
-	var containedChildren = [];
-	for (var i = 0; i < commonAncestor.childNodes.length; i++) {
-		if (isContained(commonAncestor.childNodes[i], range)) {
-			if (commonAncestor.childNodes[i].nodeType
-			== Node.DOCUMENT_TYPE_NODE) {
-				return "HIERARCHY_REQUEST_ERR";
-			}
-			containedChildren.push(commonAncestor.childNodes[i]);
-		}
-	}
+    // "Let contained children be a list of all children of common ancestor
+    // that are contained in the context object, in tree order."
+    //
+    // "If any member of contained children is a DocumentType, raise a
+    // HIERARCHY_REQUEST_ERR exception and abort these steps."
+    var containedChildren = [];
+    for (var i = 0; i < commonAncestor.childNodes.length; i++) {
+        if (isContained(commonAncestor.childNodes[i], range)) {
+            if (commonAncestor.childNodes[i].nodeType
+            == Node.DOCUMENT_TYPE_NODE) {
+                return "HIERARCHY_REQUEST_ERR";
+            }
+            containedChildren.push(commonAncestor.childNodes[i]);
+        }
+    }
 
-	// "If original start node is an ancestor container of original end node,
-	// set new node to original start node and new offset to original start
-	// offset."
-	var newNode, newOffset;
-	if (isAncestorContainer(originalStartNode, originalEndNode)) {
-		newNode = originalStartNode;
-		newOffset = originalStartOffset;
-	// "Otherwise:"
-	} else {
-		// "Let reference node equal original start node."
-		var referenceNode = originalStartNode;
+    // "If original start node is an ancestor container of original end node,
+    // set new node to original start node and new offset to original start
+    // offset."
+    var newNode, newOffset;
+    if (isAncestorContainer(originalStartNode, originalEndNode)) {
+        newNode = originalStartNode;
+        newOffset = originalStartOffset;
+    // "Otherwise:"
+    } else {
+        // "Let reference node equal original start node."
+        var referenceNode = originalStartNode;
 
-		// "While reference node's parent is not null and is not an ancestor
-		// container of original end node, set reference node to its parent."
-		while (referenceNode.parentNode
-		&& !isAncestorContainer(referenceNode.parentNode, originalEndNode)) {
-			referenceNode = referenceNode.parentNode;
-		}
+        // "While reference node's parent is not null and is not an ancestor
+        // container of original end node, set reference node to its parent."
+        while (referenceNode.parentNode
+        && !isAncestorContainer(referenceNode.parentNode, originalEndNode)) {
+            referenceNode = referenceNode.parentNode;
+        }
 
-		// "Set new node to the parent of reference node, and new offset to one
-		// plus the index of reference node."
-		newNode = referenceNode.parentNode;
-		newOffset = 1 + indexOf(referenceNode);
-	}
+        // "Set new node to the parent of reference node, and new offset to one
+        // plus the index of reference node."
+        newNode = referenceNode.parentNode;
+        newOffset = 1 + indexOf(referenceNode);
+    }
 
-	// "If first partially contained child is a Text or Comment node:"
-	if (firstPartiallyContainedChild
-	&& (firstPartiallyContainedChild.nodeType == Node.TEXT_NODE
-	|| firstPartiallyContainedChild.nodeType == Node.COMMENT_NODE)) {
-		// "Let clone be the result of calling cloneNode(false) on original
-		// start node."
-		var clone = originalStartNode.cloneNode(false);
+    // "If first partially contained child is a Text or Comment node:"
+    if (firstPartiallyContainedChild
+    && (firstPartiallyContainedChild.nodeType == Node.TEXT_NODE
+    || firstPartiallyContainedChild.nodeType == Node.COMMENT_NODE)) {
+        // "Let clone be the result of calling cloneNode(false) on original
+        // start node."
+        var clone = originalStartNode.cloneNode(false);
 
-		// "Set the data of clone to the result of calling substringData() on
-		// original start node, with original start offset as the first
-		// argument and (length of original start node − original start offset)
-		// as the second."
-		clone.data = originalStartNode.substringData(originalStartOffset,
-			nodeLength(originalStartNode) - originalStartOffset);
+        // "Set the data of clone to the result of calling substringData() on
+        // original start node, with original start offset as the first
+        // argument and (length of original start node − original start offset)
+        // as the second."
+        clone.data = originalStartNode.substringData(originalStartOffset,
+            nodeLength(originalStartNode) - originalStartOffset);
 
-		// "Append clone as the last child of frag."
-		frag.appendChild(clone);
+        // "Append clone as the last child of frag."
+        frag.appendChild(clone);
 
-		// "Call deleteData() on original start node, with original start
-		// offset as the first argument and (length of original start node −
-		// original start offset) as the second."
-		originalStartNode.deleteData(originalStartOffset,
-			nodeLength(originalStartNode) - originalStartOffset);
-	// "Otherwise, if first partially contained child is not null:"
-	} else if (firstPartiallyContainedChild) {
-		// "Let clone be the result of calling cloneNode(false) on first
-		// partially contained child."
-		var clone = firstPartiallyContainedChild.cloneNode(false);
+        // "Call deleteData() on original start node, with original start
+        // offset as the first argument and (length of original start node −
+        // original start offset) as the second."
+        originalStartNode.deleteData(originalStartOffset,
+            nodeLength(originalStartNode) - originalStartOffset);
+    // "Otherwise, if first partially contained child is not null:"
+    } else if (firstPartiallyContainedChild) {
+        // "Let clone be the result of calling cloneNode(false) on first
+        // partially contained child."
+        var clone = firstPartiallyContainedChild.cloneNode(false);
 
-		// "Append clone as the last child of frag."
-		frag.appendChild(clone);
+        // "Append clone as the last child of frag."
+        frag.appendChild(clone);
 
-		// "Let subrange be a new Range whose start is (original start node,
-		// original start offset) and whose end is (first partially contained
-		// child, length of first partially contained child)."
-		var subrange = ownerDoc.createRange();
-		subrange.setStart(originalStartNode, originalStartOffset);
-		subrange.setEnd(firstPartiallyContainedChild,
-			nodeLength(firstPartiallyContainedChild));
+        // "Let subrange be a new Range whose start is (original start node,
+        // original start offset) and whose end is (first partially contained
+        // child, length of first partially contained child)."
+        var subrange = ownerDoc.createRange();
+        subrange.setStart(originalStartNode, originalStartOffset);
+        subrange.setEnd(firstPartiallyContainedChild,
+            nodeLength(firstPartiallyContainedChild));
 
-		// "Let subfrag be the result of calling extractContents() on
-		// subrange."
-		var subfrag = myExtractContents(subrange);
+        // "Let subfrag be the result of calling extractContents() on
+        // subrange."
+        var subfrag = myExtractContents(subrange);
 
-		// "For each child of subfrag, in order, append that child to clone as
-		// its last child."
-		for (var i = 0; i < subfrag.childNodes.length; i++) {
-			clone.appendChild(subfrag.childNodes[i]);
-		}
-	}
+        // "For each child of subfrag, in order, append that child to clone as
+        // its last child."
+        for (var i = 0; i < subfrag.childNodes.length; i++) {
+            clone.appendChild(subfrag.childNodes[i]);
+        }
+    }
 
-	// "For each contained child in contained children, append contained child
-	// as the last child of frag."
-	for (var i = 0; i < containedChildren.length; i++) {
-		frag.appendChild(containedChildren[i]);
-	}
+    // "For each contained child in contained children, append contained child
+    // as the last child of frag."
+    for (var i = 0; i < containedChildren.length; i++) {
+        frag.appendChild(containedChildren[i]);
+    }
 
-	// "If last partially contained child is a Text or Comment node:"
-	if (lastPartiallyContainedChild
-	&& (lastPartiallyContainedChild.nodeType == Node.TEXT_NODE
-	|| lastPartiallyContainedChild.nodeType == Node.COMMENT_NODE)) {
-		// "Let clone be the result of calling cloneNode(false) on original
-		// end node."
-		var clone = originalEndNode.cloneNode(false);
+    // "If last partially contained child is a Text or Comment node:"
+    if (lastPartiallyContainedChild
+    && (lastPartiallyContainedChild.nodeType == Node.TEXT_NODE
+    || lastPartiallyContainedChild.nodeType == Node.COMMENT_NODE)) {
+        // "Let clone be the result of calling cloneNode(false) on original
+        // end node."
+        var clone = originalEndNode.cloneNode(false);
 
-		// "Set the data of clone to the result of calling substringData(0,
-		// original end offset) on original end node."
-		clone.data = originalEndNode.substringData(0, originalEndOffset);
+        // "Set the data of clone to the result of calling substringData(0,
+        // original end offset) on original end node."
+        clone.data = originalEndNode.substringData(0, originalEndOffset);
 
-		// "Append clone as the last child of frag."
-		frag.appendChild(clone);
+        // "Append clone as the last child of frag."
+        frag.appendChild(clone);
 
-		// "Call deleteData(0, original end offset) on original end node."
-		originalEndNode.deleteData(0, originalEndOffset);
-	// "Otherwise, if last partially contained child is not null:"
-	} else if (lastPartiallyContainedChild) {
-		// "Let clone be the result of calling cloneNode(false) on last
-		// partially contained child."
-		var clone = lastPartiallyContainedChild.cloneNode(false);
+        // "Call deleteData(0, original end offset) on original end node."
+        originalEndNode.deleteData(0, originalEndOffset);
+    // "Otherwise, if last partially contained child is not null:"
+    } else if (lastPartiallyContainedChild) {
+        // "Let clone be the result of calling cloneNode(false) on last
+        // partially contained child."
+        var clone = lastPartiallyContainedChild.cloneNode(false);
 
-		// "Append clone as the last child of frag."
-		frag.appendChild(clone);
+        // "Append clone as the last child of frag."
+        frag.appendChild(clone);
 
-		// "Let subrange be a new Range whose start is (last partially
-		// contained child, 0) and whose end is (original end node, original
-		// end offset)."
-		var subrange = ownerDoc.createRange();
-		subrange.setStart(lastPartiallyContainedChild, 0);
-		subrange.setEnd(originalEndNode, originalEndOffset);
+        // "Let subrange be a new Range whose start is (last partially
+        // contained child, 0) and whose end is (original end node, original
+        // end offset)."
+        var subrange = ownerDoc.createRange();
+        subrange.setStart(lastPartiallyContainedChild, 0);
+        subrange.setEnd(originalEndNode, originalEndOffset);
 
-		// "Let subfrag be the result of calling extractContents() on
-		// subrange."
-		var subfrag = myExtractContents(subrange);
+        // "Let subfrag be the result of calling extractContents() on
+        // subrange."
+        var subfrag = myExtractContents(subrange);
 
-		// "For each child of subfrag, in order, append that child to clone as
-		// its last child."
-		for (var i = 0; i < subfrag.childNodes.length; i++) {
-			clone.appendChild(subfrag.childNodes[i]);
-		}
-	}
+        // "For each child of subfrag, in order, append that child to clone as
+        // its last child."
+        for (var i = 0; i < subfrag.childNodes.length; i++) {
+            clone.appendChild(subfrag.childNodes[i]);
+        }
+    }
 
-	// "Set the context object's start and end to (new node, new offset)."
-	range.setStart(newNode, newOffset);
-	range.setEnd(newNode, newOffset);
+    // "Set the context object's start and end to (new node, new offset)."
+    range.setStart(newNode, newOffset);
+    range.setEnd(newNode, newOffset);
 
-	// "Return frag."
-	return frag;
+    // "Return frag."
+    return frag;
 }
 
 /**
  * insertNode() implementation, following the spec.  If an exception is
  * supposed to be thrown, will return a string with the name (e.g.,
  * "HIERARCHY_REQUEST_ERR") instead of a document fragment.  It might also
  * return an arbitrary human-readable string if a condition is hit that implies
  * a spec bug.
  */
 function myInsertNode(range, node) {
-	// "If the detached flag is set, throw an "InvalidStateError" exception and
-	// terminate these steps."
-	//
-	// Assume that if accessing collapsed throws, it's detached.
-	try {
-		range.collapsed;
-	} catch (e) {
-		return "INVALID_STATE_ERR";
-	}
+    // "If the detached flag is set, throw an "InvalidStateError" exception and
+    // terminate these steps."
+    //
+    // Assume that if accessing collapsed throws, it's detached.
+    try {
+        range.collapsed;
+    } catch (e) {
+        return "INVALID_STATE_ERR";
+    }
 
-	// "If start node is a Comment node, or a Text node whose parent is null,
-	// throw an "HierarchyRequestError" exception and terminate these steps."
-	if (range.startContainer.nodeType == Node.COMMENT_NODE
-	|| (range.startContainer.nodeType == Node.TEXT_NODE
-	&& !range.startContainer.parentNode)) {
-		return "HIERARCHY_REQUEST_ERR";
-	}
+    // "If start node is a Comment node, or a Text node whose parent is null,
+    // throw an "HierarchyRequestError" exception and terminate these steps."
+    if (range.startContainer.nodeType == Node.COMMENT_NODE
+    || (range.startContainer.nodeType == Node.TEXT_NODE
+    && !range.startContainer.parentNode)) {
+        return "HIERARCHY_REQUEST_ERR";
+    }
 
-	// "If start node is a Text node, split it with offset context object's
-	// start offset, and let reference node be the result."
-	var referenceNode;
-	if (range.startContainer.nodeType == Node.TEXT_NODE) {
-		// We aren't testing how ranges vary under mutations, and browsers vary
-		// in how they mutate for splitText, so let's just force the correct
-		// way.
-		var start = [range.startContainer, range.startOffset];
-		var end = [range.endContainer, range.endOffset];
+    // "If start node is a Text node, split it with offset context object's
+    // start offset, and let reference node be the result."
+    var referenceNode;
+    if (range.startContainer.nodeType == Node.TEXT_NODE) {
+        // We aren't testing how ranges vary under mutations, and browsers vary
+        // in how they mutate for splitText, so let's just force the correct
+        // way.
+        var start = [range.startContainer, range.startOffset];
+        var end = [range.endContainer, range.endOffset];
 
-		referenceNode = range.startContainer.splitText(range.startOffset);
+        referenceNode = range.startContainer.splitText(range.startOffset);
 
-		if (start[0] == end[0]
-		&& end[1] > start[1]) {
-			end[0] = referenceNode;
-			end[1] -= start[1];
-		} else if (end[0] == start[0].parentNode
-		&& end[1] > indexOf(referenceNode)) {
-			end[1]++;
-		}
-		range.setStart(start[0], start[1]);
-		range.setEnd(end[0], end[1]);
+        if (start[0] == end[0]
+        && end[1] > start[1]) {
+            end[0] = referenceNode;
+            end[1] -= start[1];
+        } else if (end[0] == start[0].parentNode
+        && end[1] > indexOf(referenceNode)) {
+            end[1]++;
+        }
+        range.setStart(start[0], start[1]);
+        range.setEnd(end[0], end[1]);
 
-	// "Otherwise, let reference node be the child of start node whose index is
-	// start offset, or null if there is no such child."
-	} else {
-		referenceNode = range.startContainer.childNodes[range.startOffset];
-		if (typeof referenceNode == "undefined") {
-			referenceNode = null;
-		}
-	}
+    // "Otherwise, let reference node be the child of start node whose index is
+    // start offset, or null if there is no such child."
+    } else {
+        referenceNode = range.startContainer.childNodes[range.startOffset];
+        if (typeof referenceNode == "undefined") {
+            referenceNode = null;
+        }
+    }
 
-	// "If reference node is null, let parent be start node."
-	var parent_;
-	if (!referenceNode) {
-		parent_ = range.startContainer;
+    // "If reference node is null, let parent be start node."
+    var parent_;
+    if (!referenceNode) {
+        parent_ = range.startContainer;
 
-	// "Otherwise, let parent be the parent of reference node."
-	} else {
-		parent_ = referenceNode.parentNode;
-	}
+    // "Otherwise, let parent be the parent of reference node."
+    } else {
+        parent_ = referenceNode.parentNode;
+    }
 
-	// "Let new offset be the index of reference node, or parent's length if
-	// reference node is null."
-	var newOffset = referenceNode ? indexOf(referenceNode) : nodeLength(parent_);
+    // "Let new offset be the index of reference node, or parent's length if
+    // reference node is null."
+    var newOffset = referenceNode ? indexOf(referenceNode) : nodeLength(parent_);
 
-	// "Add node's length to new offset, if node is a DocumentFragment.
-	// Otherwise add one to new offset."
-	newOffset += node.nodeType == Node.DOCUMENT_FRAGMENT_NODE
-		? nodeLength(node)
-		: 1;
+    // "Add node's length to new offset, if node is a DocumentFragment.
+    // Otherwise add one to new offset."
+    newOffset += node.nodeType == Node.DOCUMENT_FRAGMENT_NODE
+        ? nodeLength(node)
+        : 1;
 
-	// "Pre-insert node into parent before reference node."
-	try {
-		parent_.insertBefore(node, referenceNode);
-	} catch (e) {
-		return getDomExceptionName(e);
-	}
+    // "Pre-insert node into parent before reference node."
+    try {
+        parent_.insertBefore(node, referenceNode);
+    } catch (e) {
+        return getDomExceptionName(e);
+    }
 
-	// "If start and end are the same, set end to (parent, new offset)."
-	if (range.collapsed) {
-		range.setEnd(parent_, newOffset);
-	}
+    // "If start and end are the same, set end to (parent, new offset)."
+    if (range.collapsed) {
+        range.setEnd(parent_, newOffset);
+    }
 }
 
 /**
  * Asserts that two nodes are equal, in the sense of isEqualNode().  If they
  * aren't, tries to print a relatively informative reason why not.  TODO: Move
  * this to testharness.js?
  */
 function assertNodesEqual(actual, expected, msg) {
-	if (!actual.isEqualNode(expected)) {
-		msg = "Actual and expected mismatch for " + msg + ".  ";
+    if (!actual.isEqualNode(expected)) {
+        msg = "Actual and expected mismatch for " + msg + ".  ";
 
-		while (actual && expected) {
-			assert_true(actual.nodeType === expected.nodeType
-				&& actual.nodeName === expected.nodeName
-				&& actual.nodeValue === expected.nodeValue
-				&& actual.childNodes.length === expected.childNodes.length,
-				"First differing node: expected " + format_value(expected)
-				+ ", got " + format_value(actual));
-			actual = nextNode(actual);
-			expected = nextNode(expected);
-		}
+        while (actual && expected) {
+            assert_true(actual.nodeType === expected.nodeType
+                && actual.nodeName === expected.nodeName
+                && actual.nodeValue === expected.nodeValue
+                && actual.childNodes.length === expected.childNodes.length,
+                "First differing node: expected " + format_value(expected)
+                + ", got " + format_value(actual) + " [" + msg + "]");
+            actual = nextNode(actual);
+            expected = nextNode(expected);
+        }
 
-		assert_unreached("DOMs were not equal but we couldn't figure out why");
-	}
+        assert_unreached("DOMs were not equal but we couldn't figure out why");
+    }
 }
 
 /**
  * Given a DOMException, return the name (e.g., "HIERARCHY_REQUEST_ERR").
  */
 function getDomExceptionName(e) {
-	var ret = null;
-	for (var prop in e) {
-		if (/^[A-Z_]+_ERR$/.test(prop) && e[prop] == e.code) {
-			return prop;
-		}
-	}
+    var ret = null;
+    for (var prop in e) {
+        if (/^[A-Z_]+_ERR$/.test(prop) && e[prop] == e.code) {
+            return prop;
+        }
+    }
 
-	throw "Exception seems to not be a DOMException?  " + e;
+    throw "Exception seems to not be a DOMException?  " + e;
 }
 
 /**
  * Given an array of endpoint data [start container, start offset, end
  * container, end offset], returns a Range with those endpoints.
  */
 function rangeFromEndpoints(endpoints) {
-	// If we just use document instead of the ownerDocument of endpoints[0],
-	// WebKit will throw on setStart/setEnd.  This is a WebKit bug, but it's in
-	// range, not selection, so we don't want to fail anything for it.
-	var range = ownerDocument(endpoints[0]).createRange();
-	range.setStart(endpoints[0], endpoints[1]);
-	range.setEnd(endpoints[2], endpoints[3]);
-	return range;
+    // If we just use document instead of the ownerDocument of endpoints[0],
+    // WebKit will throw on setStart/setEnd.  This is a WebKit bug, but it's in
+    // range, not selection, so we don't want to fail anything for it.
+    var range = ownerDocument(endpoints[0]).createRange();
+    range.setStart(endpoints[0], endpoints[1]);
+    range.setEnd(endpoints[2], endpoints[3]);
+    return range;
 }
--- a/testing/web-platform/tests/dom/historical.html
+++ b/testing/web-platform/tests/dom/historical.html
@@ -7,16 +7,17 @@
 function isInterfaceNuked(name) {
   test(function() {
     assert_equals(window[name], undefined)
   }, "Historical DOM features must be removed: " + name)
 }
 var nukedInterfaces = [
   "CDATASection",
   "DOMConfiguration",
+  "DOMError",
   "DOMErrorHandler",
   "DOMImplementationList",
   "DOMImplementationSource",
   "DOMLocator",
   "DOMObject",
   "DOMUserData",
   "Entity",
   "EntityReference",
@@ -34,17 +35,16 @@ function isNukedFromDocument(name) {
     var doc = document.implementation.createDocument(null,null,null)
     assert_equals(document[name], undefined)
     assert_equals(doc[name], undefined)
   }, "Historical DOM features must be removed: " + name)
 }
 var documentNuked = [
   "createCDATASection",
   "createEntityReference",
-  "inputEncoding",
   "xmlEncoding",
   "xmlStandalone",
   "xmlVersion",
   "strictErrorChecking",
   "domConfig",
   "normalizeDocument",
   "renameNode",
   "charset",
--- a/testing/web-platform/tests/dom/interfaces.html
+++ b/testing/web-platform/tests/dom/interfaces.html
@@ -34,22 +34,16 @@ exception DOMException {
   const unsigned short URL_MISMATCH_ERR = 21;
   const unsigned short QUOTA_EXCEEDED_ERR = 22;
   const unsigned short TIMEOUT_ERR = 23;
   const unsigned short INVALID_NODE_TYPE_ERR = 24;
   const unsigned short DATA_CLONE_ERR = 25;
   unsigned short code;
 };
 
-[Constructor(DOMString name, optional DOMString message = "")]
-interface DOMError {
-  readonly attribute DOMString name;
-  readonly attribute DOMString message;
-};
-
 [Constructor(DOMString type, optional EventInit eventInitDict),
  Exposed=Window,Worker]
 interface Event {
   readonly attribute DOMString type;
   readonly attribute EventTarget? target;
   readonly attribute EventTarget? currentTarget;
 
   const unsigned short NONE = 0;
@@ -253,16 +247,17 @@ interface Node : EventTarget {
 [Constructor]
 interface Document : Node {
   [SameObject] readonly attribute DOMImplementation implementation;
   readonly attribute DOMString URL;
   readonly attribute DOMString documentURI;
   readonly attribute DOMString origin;
   readonly attribute DOMString compatMode;
   readonly attribute DOMString characterSet;
+  readonly attribute DOMString inputEncoding; // legacy alias of .characterSet
   readonly attribute DOMString contentType;
 
   readonly attribute DocumentType? doctype;
   readonly attribute Element? documentElement;
   HTMLCollection getElementsByTagName(DOMString localName);
   HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
   HTMLCollection getElementsByClassName(DOMString classNames);
 
--- a/testing/web-platform/tests/dom/nodes/DOMImplementation-createDocument.html
+++ b/testing/web-platform/tests/dom/nodes/DOMImplementation-createDocument.html
@@ -97,18 +97,18 @@ test(function() {
         assert_equals(doc.childNodes.length, !omitRootElement + !!doctype)
       }
     }, "createDocument test " + i + ": " + t.map(function(el) { return format_value(el) }))
 
     if (expected === null) {
       test(function() {
         var doc = document.implementation.createDocument(namespace, qualifiedName, doctype)
         assert_equals(doc.compatMode, "CSS1Compat")
-        // XXX Spec says "utf-8", browsers do "UTF-8".
-        assert_equals(doc.characterSet.toUpperCase(), "UTF-8")
+        assert_equals(doc.characterSet, "UTF-8")
+        assert_equals(doc.inputEncoding, "UTF-8")
         assert_equals(doc.contentType, "application/xml")
         assert_equals(doc.URL, "about:blank")
         assert_equals(doc.documentURI, "about:blank")
         assert_equals(doc.createElement("DIV").localName, "DIV");
       }, "createDocument test " + i + ": metadata for " +
       [namespace, qualifiedName, doctype].map(function(el) { return format_value(el) }))
     }
   })
--- a/testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.html
+++ b/testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.html
@@ -63,18 +63,18 @@ createHTMLDocuments(function(doc, expect
   assert_equals(body.childNodes.length, 0)
 })
 
 test(function() {
   var doc = document.implementation.createHTMLDocument("test");
   assert_equals(doc.URL, "about:blank");
   assert_equals(doc.documentURI, "about:blank");
   assert_equals(doc.compatMode, "CSS1Compat");
-  // XXX Spec says "utf-8", browsers do "UTF-8".
-  assert_equals(doc.characterSet.toUpperCase(), "UTF-8");
+  assert_equals(doc.characterSet, "UTF-8");
+  assert_equals(doc.inputEncoding, "UTF-8");
   assert_equals(doc.contentType, "text/html");
   assert_equals(doc.createElement("DIV").localName, "div");
 }, "createHTMLDocument(): metadata")
 
 test(function() {
   var doc = document.implementation.createHTMLDocument("test");
   var a = doc.createElement("a");
   // In UTF-8: 0xC3 0xA4
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/Document-Element-getElementsByTagName.js
@@ -0,0 +1,166 @@
+function test_getElementsByTagName(context, element) {
+  // TODO: getElementsByTagName("*")
+  test(function() {
+    assert_false(context.getElementsByTagName("html") instanceof NodeList,
+                 "Should not return a NodeList")
+    assert_true(context.getElementsByTagName("html") instanceof HTMLCollection,
+                "Should return an HTMLCollection")
+  }, "Interfaces")
+
+  test(function() {
+    var firstCollection = context.getElementsByTagName("html"),
+        secondCollection = context.getElementsByTagName("html")
+    assert_true(firstCollection !== secondCollection ||
+                firstCollection === secondCollection)
+  }, "Caching is allowed")
+
+  test(function() {
+    var l = context.getElementsByTagName("nosuchtag")
+    l[5] = "foopy"
+    assert_equals(l[5], undefined)
+    assert_equals(l.item(5), null)
+  }, "Shouldn't be able to set unsigned properties on a HTMLCollection (non-strict mode)")
+
+  test(function() {
+    var l = context.getElementsByTagName("nosuchtag")
+    assert_throws(new TypeError(), function() {
+      "use strict";
+      l[5] = "foopy"
+    })
+    assert_equals(l[5], undefined)
+    assert_equals(l.item(5), null)
+  }, "Shouldn't be able to set unsigned properties on a HTMLCollection (strict mode)")
+
+  test(function() {
+    var l = context.getElementsByTagName("nosuchtag")
+    var fn = l.item;
+    assert_equals(fn, HTMLCollection.prototype.item);
+    l.item = "pass"
+    assert_equals(l.item, "pass")
+    assert_equals(HTMLCollection.prototype.item, fn);
+  }, "Should be able to set expando shadowing a proto prop (item)")
+
+  test(function() {
+    var l = context.getElementsByTagName("nosuchtag")
+    var fn = l.namedItem;
+    assert_equals(fn, HTMLCollection.prototype.namedItem);
+    l.namedItem = "pass"
+    assert_equals(l.namedItem, "pass")
+    assert_equals(HTMLCollection.prototype.namedItem, fn);
+  }, "Should be able to set expando shadowing a proto prop (namedItem)")
+
+  test(function() {
+    var t = element.appendChild(document.createElement("pre"));
+    t.id = "x";
+    this.add_cleanup(function() {element.removeChild(t)});
+
+    var list = context.getElementsByTagName('pre');
+    var pre = list[0];
+    assert_equals(pre.id, "x");
+    assert_equals(list['x'], pre);
+
+    assert_true('x' in list, "'x' in list");
+    assert_true(list.hasOwnProperty('x'), "list.hasOwnProperty('x')");
+
+    assert_array_equals(Object.getOwnPropertyNames(list).sort(), ["0", "x"]);
+
+    var desc = Object.getOwnPropertyDescriptor(list, '0');
+    assert_equals(typeof desc, "object", "descriptor should be an object");
+    assert_true(desc.enumerable, "desc.enumerable");
+    assert_true(desc.configurable, "desc.configurable");
+
+    desc = Object.getOwnPropertyDescriptor(list, 'x');
+    assert_equals(typeof desc, "object", "descriptor should be an object");
+    assert_false(desc.enumerable, "desc.enumerable");
+    assert_true(desc.configurable, "desc.configurable");
+  }, "hasOwnProperty, getOwnPropertyDescriptor, getOwnPropertyNames")
+
+  test(function() {
+    assert_equals(document.createElementNS("http://www.w3.org/1999/xhtml", "i").localName, "i") // Sanity
+    var t = element.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "I"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_equals(t.localName, "I")
+    assert_equals(t.tagName, "I")
+    assert_equals(context.getElementsByTagName("I").length, 0)
+    assert_equals(context.getElementsByTagName("i").length, 0)
+  }, "HTML element with uppercase tagName never matches in HTML Documents")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("test", "st"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagName("st"), [t])
+    assert_array_equals(context.getElementsByTagName("ST"), [])
+  }, "Element in non-HTML namespace, no prefix, lowercase name")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("test", "ST"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagName("ST"), [t])
+    assert_array_equals(context.getElementsByTagName("st"), [])
+  }, "Element in non-HTML namespace, no prefix, uppercase name")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("test", "te:st"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagName("st"), [t])
+    assert_array_equals(context.getElementsByTagName("ST"), [])
+  }, "Element in non-HTML namespace, prefix, lowercase name")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("test", "te:ST"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagName("ST"), [t])
+    assert_array_equals(context.getElementsByTagName("st"), [])
+    assert_array_equals(context.getElementsByTagName("te:st"), [])
+    assert_array_equals(context.getElementsByTagName("te:ST"), [])
+  }, "Element in non-HTML namespace, prefix, uppercase name")
+
+  test(function() {
+    var t = element.appendChild(document.createElement("aÇ"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_equals(t.localName, "aÇ")
+    assert_array_equals(context.getElementsByTagName("AÇ"), [t], "All uppercase input")
+    assert_array_equals(context.getElementsByTagName("aÇ"), [t], "Ascii lowercase input")
+    assert_array_equals(context.getElementsByTagName("aç"), [], "All lowercase input")
+  }, "Element in HTML namespace, no prefix, non-ascii characters in name")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("test", "AÇ"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagName("AÇ"), [t])
+    assert_array_equals(context.getElementsByTagName("aÇ"), [])
+    assert_array_equals(context.getElementsByTagName("aç"), [])
+  }, "Element in non-HTML namespace, non-ascii characters in name")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "test:aÇ"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagName("AÇ"), [t], "All uppercase input")
+    assert_array_equals(context.getElementsByTagName("aÇ"), [t], "Ascii lowercase input")
+    assert_array_equals(context.getElementsByTagName("aç"), [], "All lowercase input")
+  }, "Element in HTML namespace, prefix, non-ascii characters in name")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("test", "test:AÇ"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagName("AÇ"), [t], "All uppercase input")
+    assert_array_equals(context.getElementsByTagName("aÇ"), [], "Ascii lowercase input")
+    assert_array_equals(context.getElementsByTagName("aç"), [], "All lowercase input")
+  }, "Element in non-HTML namespace, prefix, non-ascii characters in name")
+
+  test(function() {
+    var actual = context.getElementsByTagName("*");
+    var expected = [];
+    var get_elements = function(node) {
+      for (var i = 0; i < node.childNodes.length; i++) {
+        var child = node.childNodes[i];
+        if (child.nodeType === child.ELEMENT_NODE) {
+          expected.push(child);
+          get_elements(child);
+        }
+      }
+    }
+    get_elements(context);
+    assert_array_equals(actual, expected);
+  }, "getElementsByTagName('*')")
+}
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/Document-Element-getElementsByTagNameNS.js
@@ -0,0 +1,128 @@
+function test_getElementsByTagNameNS(context, element) {
+  test(function() {
+    assert_false(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "html") instanceof NodeList, "NodeList")
+    assert_true(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "html") instanceof HTMLCollection, "HTMLCollection")
+    var firstCollection = context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "html"),
+        secondCollection = context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "html")
+    assert_true(firstCollection !== secondCollection || firstCollection === secondCollection,
+                "Caching is allowed.")
+  })
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("test", "body"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    var actual = context.getElementsByTagNameNS("*", "body");
+    var expected = [];
+    var get_elements = function(node) {
+      for (var i = 0; i < node.childNodes.length; i++) {
+        var child = node.childNodes[i];
+        if (child.nodeType === child.ELEMENT_NODE) {
+          if (child.localName == "body") {
+            expected.push(child);
+          }
+          get_elements(child);
+        }
+      }
+    }
+    get_elements(context);
+    assert_array_equals(actual, expected);
+  }, "getElementsByTagNameNS('*', 'body')")
+
+  test(function() {
+    assert_array_equals(context.getElementsByTagNameNS("", "*"), []);
+    var t = element.appendChild(document.createElementNS("", "body"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagNameNS("", "*"), [t]);
+  }, "Empty string namespace")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("test", "body"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagNameNS("test", "body"), [t]);
+  }, "body element in test namespace, no prefix")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("test", "test:body"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagNameNS("test", "body"), [t]);
+  }, "body element in test namespace, prefix")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("test", "BODY"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagNameNS("test", "BODY"), [t]);
+    assert_array_equals(context.getElementsByTagNameNS("test", "body"), []);
+  }, "BODY element in test namespace, no prefix")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "abc"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "abc"), [t]);
+   assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "ABC"), []);
+    assert_array_equals(context.getElementsByTagNameNS("test", "ABC"), []);
+  }, "abc element in html namespace")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "ABC"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "abc"), []);
+    assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "ABC"), [t]);
+  }, "ABC element in html namespace")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "AÇ"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "AÇ"), [t]);
+    assert_array_equals(context.getElementsByTagNameNS("test", "aÇ"), []);
+    assert_array_equals(context.getElementsByTagNameNS("test", "aç"), []);
+  }, "AÇ, case sensitivity")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("test", "test:BODY"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    assert_array_equals(context.getElementsByTagNameNS("test", "BODY"), [t]);
+    assert_array_equals(context.getElementsByTagNameNS("test", "body"), []);
+  }, "BODY element in test namespace, prefix")
+
+  test(function() {
+    var t = element.appendChild(document.createElementNS("test", "test:test"))
+    this.add_cleanup(function() {element.removeChild(t)})
+    var actual = context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "*");
+    var expected = [];
+    var get_elements = function(node) {
+      for (var i = 0; i < node.childNodes.length; i++) {
+        var child = node.childNodes[i];
+        if (child.nodeType === child.ELEMENT_NODE) {
+          if (child !== t) {
+            expected.push(child);
+          }
+          get_elements(child);
+        }
+      }
+    }
+    get_elements(context);
+    assert_array_equals(actual, expected);
+  }, "getElementsByTagNameNS('http://www.w3.org/1999/xhtml', '*')")
+
+  test(function() {
+    var actual = context.getElementsByTagNameNS("*", "*");
+    var expected = [];
+    var get_elements = function(node) {
+      for (var i = 0; i < node.childNodes.length; i++) {
+        var child = node.childNodes[i];
+        if (child.nodeType === child.ELEMENT_NODE) {
+          expected.push(child);
+          get_elements(child);
+        }
+      }
+    }
+    get_elements(context);
+    assert_array_equals(actual, expected);
+  }, "getElementsByTagNameNS('*', '*')")
+
+  test(function() {
+    assert_array_equals(context.getElementsByTagNameNS("**", "*"), []);
+    assert_array_equals(context.getElementsByTagNameNS(null, "0"), []);
+    assert_array_equals(context.getElementsByTagNameNS(null, "div"), []);
+  }, "Empty lists")
+}
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/Document-URL.sub.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Document.URL with redirect</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+async_test(function() {
+  var iframe = document.createElement("iframe");
+  iframe.src = "/common/redirect.py?location=/common/blank.html";
+  document.body.appendChild(iframe);
+  this.add_cleanup(function() { document.body.removeChild(iframe); });
+  iframe.onload = this.step_func_done(function() {
+    assert_equals(iframe.contentDocument.URL,
+                  "http://{{host}}:{{ports[http][0]}}/common/blank.html");
+  });
+})
+</script>
--- a/testing/web-platform/tests/dom/nodes/Document-characterSet-normalization.html
+++ b/testing/web-platform/tests/dom/nodes/Document-characterSet-normalization.html
@@ -1,10 +1,10 @@
 <!doctype html>
-<title>document.characterSet normalization tests</title>
+<title>document.characterSet and inputEncoding normalization tests</title>
 <link rel=author title="Aryeh Gregor" href=ayg@aryeh.name>
 <meta name=timeout content=long>
 <div id=log></div>
 <script src=/resources/testharness.js></script>
 <script src=/resources/testharnessreport.js></script>
 <style>iframe { display: none }</style>
 <script>
 "use strict";
@@ -15,17 +15,16 @@ var encodingMap = {
     "unicode-1-1-utf-8",
     "utf-8",
     "utf8",
     // As we use <meta>, utf-16 will map to utf-8 per
     // https://html.spec.whatwg.org/multipage/#documentEncoding
     "utf-16",
     "utf-16le",
     "utf-16be",
-    "utf-16be",
   ],
   "ibm866": [
     "866",
     "cp866",
     "csibm866",
     "ibm866",
   ],
   "iso-8859-2": [
@@ -337,30 +336,46 @@ Object.keys(encodingMap).forEach(functio
     if (lower[i] != mixed[i] && upper[i] != mixed[i]) {
       encodingMap[name].push(mixed[i]);
     }
     encodingMap[name].push(spacey[i]);
     */
   }
 });
 
+function expected_case(encoding_label) {
+  if (encoding_label === 'big5') {
+    return 'Big5';
+  }
+  if (encoding_label === 'shift_jis') {
+    return 'Shift_JIS';
+  }
+  return encoding_label.toUpperCase();
+}
+
 Object.keys(encodingMap).forEach(function(name) {
   encodingMap[name].forEach(function(label) {
     var iframe = document.createElement("iframe");
     var t = async_test("Name " + format_value(name) +
-                       " has label " + format_value(label));
+                       " has label " + format_value(label) + " (characterSet)");
+    var t2 = async_test("Name " + format_value(name) +
+                       " has label " + format_value(label) + " (inputEncoding)");
     /*
     iframe.src = "data:text/html,<!doctype html>" +
                  '<meta charset="' + label + '">';
     */
     iframe.src = "encoding.py?label=" + label;
     iframe.onload = function() {
       t.step(function() {
-        assert_equals(iframe.contentDocument.characterSet.toLowerCase(), name);
+        assert_equals(iframe.contentDocument.characterSet, expected_case(name));
+      });
+      t2.step(function() {
+        assert_equals(iframe.contentDocument.inputEncoding, expected_case(name));
       });
       document.body.removeChild(iframe);
       t.done();
+      t2.done();
     };
     document.body.appendChild(iframe);
   });
 });
 </script>
 <!-- vim: set expandtab tabstop=2 shiftwidth=2: -->
--- a/testing/web-platform/tests/dom/nodes/Document-constructor.html
+++ b/testing/web-platform/tests/dom/nodes/Document-constructor.html
@@ -26,18 +26,18 @@ test(function() {
   assert_array_equals(doc.childNodes, [], "childNodes");
 }, "new Document(): children")
 
 test(function() {
   var doc = new Document();
   assert_equals(doc.URL, "about:blank");
   assert_equals(doc.documentURI, "about:blank");
   assert_equals(doc.compatMode, "CSS1Compat");
-  // XXX Spec says "utf-8", browsers do "UTF-8".
-  assert_equals(doc.characterSet.toUpperCase(), "UTF-8");
+  assert_equals(doc.characterSet, "UTF-8");
+  assert_equals(doc.inputEncoding, "UTF-8");
   assert_equals(doc.contentType, "application/xml");
   assert_equals(doc.createElement("DIV").localName, "DIV");
 }, "new Document(): metadata")
 
 test(function() {
   var doc = new Document();
   var a = doc.createElement("a");
   // In UTF-8: 0xC3 0xA4
--- a/testing/web-platform/tests/dom/nodes/Document-getElementsByTagName.html
+++ b/testing/web-platform/tests/dom/nodes/Document-getElementsByTagName.html
@@ -1,172 +1,11 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>Document.getElementsByTagName</title>
 <link rel=help href="https://dom.spec.whatwg.org/#dom-document-getelementsbytagname">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="Document-Element-getElementsByTagName.js"></script>
 <div id="log"></div>
-<pre id="x"></pre>
 <script>
-// TODO: getElementsByTagName("*")
-test(function() {
-  assert_false(document.getElementsByTagName("html") instanceof NodeList,
-               "Should not return a NodeList")
-  assert_true(document.getElementsByTagName("html") instanceof HTMLCollection,
-              "Should return an HTMLCollection")
-}, "Interfaces")
-
-test(function() {
-  var firstCollection = document.getElementsByTagName("html"),
-      secondCollection = document.getElementsByTagName("html")
-  assert_true(firstCollection !== secondCollection ||
-              firstCollection === secondCollection)
-}, "Caching is allowed")
-
-test(function() {
-  var l = document.getElementsByTagName("nosuchtag")
-  l[5] = "foopy"
-  assert_equals(l[5], undefined)
-  assert_equals(l.item(5), null)
-}, "Shouldn't be able to set unsigned properties on a HTMLCollection (non-strict mode)")
-
-test(function() {
-  var l = document.getElementsByTagName("nosuchtag")
-  assert_throws(new TypeError(), function() {
-    "use strict";
-    l[5] = "foopy"
-  })
-  assert_equals(l[5], undefined)
-  assert_equals(l.item(5), null)
-}, "Shouldn't be able to set unsigned properties on a HTMLCollection (strict mode)")
-
-test(function() {
-  var l = document.getElementsByTagName("nosuchtag")
-  var fn = l.item;
-  assert_equals(fn, HTMLCollection.prototype.item);
-  l.item = "pass"
-  assert_equals(l.item, "pass")
-  assert_equals(HTMLCollection.prototype.item, fn);
-}, "Should be able to set expando shadowing a proto prop (item)")
-
-test(function() {
-  var l = document.getElementsByTagName("nosuchtag")
-  var fn = l.namedItem;
-  assert_equals(fn, HTMLCollection.prototype.namedItem);
-  l.namedItem = "pass"
-  assert_equals(l.namedItem, "pass")
-  assert_equals(HTMLCollection.prototype.namedItem, fn);
-}, "Should be able to set expando shadowing a proto prop (namedItem)")
-
-test(function() {
-  var list = document.getElementsByTagName('pre');
-  var pre = list[0];
-  assert_equals(pre.id, "x");
-  assert_equals(list['x'], pre);
-
-  assert_true('x' in list, "'x' in list");
-  assert_true(list.hasOwnProperty('x'), "list.hasOwnProperty('x')");
-
-  assert_array_equals(Object.getOwnPropertyNames(list).sort(), ["0", "x"]);
-
-  var desc = Object.getOwnPropertyDescriptor(list, '0');
-  assert_equals(typeof desc, "object", "descriptor should be an object");
-  assert_true(desc.enumerable, "desc.enumerable");
-  assert_true(desc.configurable, "desc.configurable");
-
-  desc = Object.getOwnPropertyDescriptor(list, 'x');
-  assert_equals(typeof desc, "object", "descriptor should be an object");
-  assert_false(desc.enumerable, "desc.enumerable");
-  assert_true(desc.configurable, "desc.configurable");
-}, "hasOwnProperty, getOwnPropertyDescriptor, getOwnPropertyNames")
-
-test(function() {
-  assert_equals(document.createElementNS("http://www.w3.org/1999/xhtml", "i").localName, "i") // Sanity
-  var t = document.body.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "I"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_equals(t.localName, "I")
-  assert_equals(t.tagName, "I")
-  assert_equals(document.getElementsByTagName("I").length, 0)
-  assert_equals(document.getElementsByTagName("i").length, 0)
-  assert_equals(document.body.getElementsByTagName("I").length, 0)
-  assert_equals(document.body.getElementsByTagName("i").length, 0)
-}, "HTML element with uppercase tagName never matches in HTML Documents")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("test", "st"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagName("st"), [t])
-  assert_array_equals(document.getElementsByTagName("ST"), [])
-}, "Element in non-HTML namespace, no prefix, lowercase name")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("test", "ST"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagName("ST"), [t])
-  assert_array_equals(document.getElementsByTagName("st"), [])
-}, "Element in non-HTML namespace, no prefix, uppercase name")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("test", "te:st"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagName("st"), [t])
-  assert_array_equals(document.getElementsByTagName("ST"), [])
-}, "Element in non-HTML namespace, prefix, lowercase name")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("test", "te:ST"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagName("ST"), [t])
-  assert_array_equals(document.getElementsByTagName("st"), [])
-  assert_array_equals(document.getElementsByTagName("te:st"), [])
-  assert_array_equals(document.getElementsByTagName("te:ST"), [])
-}, "Element in non-HTML namespace, prefix, uppercase name")
-
-test(function() {
-  var t = document.body.appendChild(document.createElement("aÇ"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_equals(t.localName, "aÇ")
-  assert_array_equals(document.getElementsByTagName("AÇ"), [t], "All uppercase input")
-  assert_array_equals(document.getElementsByTagName("aÇ"), [t], "Ascii lowercase input")
-  assert_array_equals(document.getElementsByTagName("aç"), [], "All lowercase input")
-}, "Element in HTML namespace, no prefix, non-ascii characters in name")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("test", "AÇ"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagName("AÇ"), [t])
-  assert_array_equals(document.getElementsByTagName("aÇ"), [])
-  assert_array_equals(document.getElementsByTagName("aç"), [])
-}, "Element in non-HTML namespace, non-ascii characters in name")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "test:aÇ"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagName("AÇ"), [t], "All uppercase input")
-  assert_array_equals(document.getElementsByTagName("aÇ"), [t], "Ascii lowercase input")
-  assert_array_equals(document.getElementsByTagName("aç"), [], "All lowercase input")
-}, "Element in HTML namespace, prefix, non-ascii characters in name")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("test", "test:AÇ"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagName("AÇ"), [t], "All uppercase input")
-  assert_array_equals(document.getElementsByTagName("aÇ"), [], "Ascii lowercase input")
-  assert_array_equals(document.getElementsByTagName("aç"), [], "All lowercase input")
-}, "Element in non-HTML namespace, prefix, non-ascii characters in name")
-
-test(function() {
-  var actual = document.getElementsByTagName("*");
-  var expected = [];
-  var get_elements = function(node) {
-    for (var i = 0; i < node.childNodes.length; i++) {
-      var child = node.childNodes[i];
-      if (child.nodeType === child.ELEMENT_NODE) {
-        expected.push(child);
-        get_elements(child);
-      }
-    }
-  }
-  get_elements(document);
-  assert_array_equals(actual, expected);
-}, "getElementsByTagName('*')")
+test_getElementsByTagName(document, document.body);
 </script>
--- a/testing/web-platform/tests/dom/nodes/Document-getElementsByTagNameNS.html
+++ b/testing/web-platform/tests/dom/nodes/Document-getElementsByTagNameNS.html
@@ -1,136 +1,11 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>Document.getElementsByTagNameNS</title>
 <link rel=help href="https://dom.spec.whatwg.org/#dom-document-getelementsbytagnamens">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="Document-Element-getElementsByTagNameNS.js"></script>
 <div id="log"></div>
 <script>
-// TODO: Actual tests; wildcards.
-test(function() {
-  assert_false(document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "html") instanceof NodeList, "NodeList")
-  assert_true(document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "html") instanceof HTMLCollection, "HTMLCollection")
-  var firstCollection = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "html"),
-      secondCollection = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "html")
-  assert_true(firstCollection !== secondCollection || firstCollection === secondCollection,
-              "Caching is allowed.")
-})
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("test", "body"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  var actual = document.getElementsByTagNameNS("*", "body");
-  var expected = [];
-  var get_elements = function(node) {
-    for (var i = 0; i < node.childNodes.length; i++) {
-      var child = node.childNodes[i];
-      if (child.nodeType === child.ELEMENT_NODE) {
-        if (child.localName == "body") {
-          expected.push(child);
-        }
-        get_elements(child);
-      }
-    }
-  }
-  get_elements(document);
-  assert_array_equals(actual, expected);
-}, "getElementsByTagNameNS('*', 'body')")
-
-test(function() {
-  assert_array_equals(document.getElementsByTagNameNS("", "*"), []);
-  var t = document.body.appendChild(document.createElementNS("", "body"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagNameNS("", "*"), [t]);
-}, "Empty string namespace")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("test", "body"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagNameNS("test", "body"), [t]);
-}, "body element in test namespace, no prefix")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("test", "test:body"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagNameNS("test", "body"), [t]);
-}, "body element in test namespace, prefix")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("test", "BODY"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagNameNS("test", "BODY"), [t]);
-  assert_array_equals(document.getElementsByTagNameNS("test", "body"), []);
-}, "BODY element in test namespace, no prefix")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "abc"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "abc"), [t]);
- assert_array_equals(document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "ABC"), []);
-  assert_array_equals(document.getElementsByTagNameNS("test", "ABC"), []);
-}, "abc element in html namespace")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "ABC"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "abc"), []);
-  assert_array_equals(document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "ABC"), [t]);
-}, "ABC element in html namespace")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "AÇ"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "AÇ"), [t]);
-  assert_array_equals(document.getElementsByTagNameNS("test", "aÇ"), []);
-  assert_array_equals(document.getElementsByTagNameNS("test", "aç"), []);
-}, "AÇ, case sensitivity")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("test", "test:BODY"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  assert_array_equals(document.getElementsByTagNameNS("test", "BODY"), [t]);
-  assert_array_equals(document.getElementsByTagNameNS("test", "body"), []);
-}, "BODY element in test namespace, prefix")
-
-test(function() {
-  var t = document.body.appendChild(document.createElementNS("test", "test:test"))
-  this.add_cleanup(function() {document.body.removeChild(t)})
-  var actual = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "*");
-  var expected = [];
-  var get_elements = function(node) {
-    for (var i = 0; i < node.childNodes.length; i++) {
-      var child = node.childNodes[i];
-      if (child.nodeType === child.ELEMENT_NODE) {
-        if (child !== t) {
-          expected.push(child);
-        }
-        get_elements(child);
-      }
-    }
-  }
-  get_elements(document);
-  assert_array_equals(actual, expected);
-}, "getElementsByTagNameNS('http://www.w3.org/1999/xhtml', '*')")
-
-test(function() {
-  var actual = document.getElementsByTagNameNS("*", "*");
-  var expected = [];
-  var get_elements = function(node) {
-    for (var i = 0; i < node.childNodes.length; i++) {
-      var child = node.childNodes[i];
-      if (child.nodeType === child.ELEMENT_NODE) {
-        expected.push(child);
-        get_elements(child);
-      }
-    }
-  }
-  get_elements(document);
-  assert_array_equals(actual, expected);
-}, "getElementsByTagNameNS('*', '*')")
-
-test(function() {
-  assert_array_equals(document.getElementsByTagNameNS("**", "*"), []);
-  assert_array_equals(document.getElementsByTagNameNS(null, "0"), []);
-  assert_array_equals(document.getElementsByTagNameNS(null, "div"), []);
-}, "Empty lists")
+test_getElementsByTagNameNS(document, document.body);
 </script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/Element-getElementsByTagName.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Element.getElementsByTagName</title>
+<link rel=help href="https://dom.spec.whatwg.org/#dom-element-getelementsbytagname">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="Document-Element-getElementsByTagName.js"></script>
+<div id="log"></div>
+<script>
+var element;
+setup(function() {
+  element = document.createElement("div");
+  element.appendChild(document.createTextNode("text"));
+  var p = element.appendChild(document.createElement("p"));
+  p.appendChild(document.createElement("a"))
+   .appendChild(document.createTextNode("link"));
+  p.appendChild(document.createElement("b"))
+   .appendChild(document.createTextNode("bold"));
+  p.appendChild(document.createElement("em"))
+   .appendChild(document.createElement("u"))
+   .appendChild(document.createTextNode("emphasized"));
+  element.appendChild(document.createComment("comment"));
+});
+
+test_getElementsByTagName(element, element);
+
+test(function() {
+  assert_array_equals(element.getElementsByTagName(element.localName), []);
+}, "Matching the context object");
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/Element-getElementsByTagNameNS.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Element.getElementsByTagNameNS</title>
+<link rel=help href="https://dom.spec.whatwg.org/#dom-element-getelementsbytagnamens">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="Document-Element-getElementsByTagNameNS.js"></script>
+<div id="log"></div>
+<script>
+var element;
+setup(function() {
+  element = document.createElement("div");
+  element.appendChild(document.createTextNode("text"));
+  var p = element.appendChild(document.createElement("p"));
+  p.appendChild(document.createElement("a"))
+   .appendChild(document.createTextNode("link"));
+  p.appendChild(document.createElement("b"))
+   .appendChild(document.createTextNode("bold"));
+  p.appendChild(document.createElement("em"))
+   .appendChild(document.createElement("u"))
+   .appendChild(document.createTextNode("emphasized"));
+  element.appendChild(document.createComment("comment"));
+});
+
+test_getElementsByTagNameNS(element, element);
+
+test(function() {
+  assert_array_equals(element.getElementsByTagNameNS("*", element.localName), []);
+}, "Matching the context object (wildcard namespace)");
+
+test(function() {
+  assert_array_equals(
+    element.getElementsByTagNameNS("http://www.w3.org/1999/xhtml",
+                                   element.localName),
+    []);
+}, "Matching the context object (specific namespace)");
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/Node-parentNode-iframe.html
@@ -0,0 +1,1 @@
+<a name='c'>c</a>
\ No newline at end of file
--- a/testing/web-platform/tests/dom/nodes/Node-parentNode.html
+++ b/testing/web-platform/tests/dom/nodes/Node-parentNode.html
@@ -25,9 +25,9 @@ function testIframe(iframe) {
   t.step(function() {
     var doc = iframe.contentDocument;
     iframe.parentNode.removeChild(iframe);
     assert_equals(doc.firstChild.parentNode, doc);
   });
   t.done();
 }
 </script>
-<iframe id=a src="data:text/html,<a name='c'>c</a>" onload="testIframe(this)"></iframe>
+<iframe id=a src="Node-parentNode-iframe.html" onload="testIframe(this)"></iframe>
--- a/testing/web-platform/tests/dom/nodes/Node-properties.html
+++ b/testing/web-platform/tests/dom/nodes/Node-properties.html
@@ -8,679 +8,682 @@
 <script src=../common.js></script>
 <script>
 "use strict";
 /**
  * First we define a data structure to tell us what tests to run.  The keys
  * will be eval()ed, and are mostly global variables defined in common.js.  The
  * values are objects, which maps properties to expected values.  So
  *
- * 	foo: {
- * 		bar: "baz",
- * 		quz: 7,
- * 	},
+ *     foo: {
+ *         bar: "baz",
+ *         quz: 7,
+ *     },
  *
  * will test that eval("foo.bar") === "baz" and eval("foo.quz") === 7.  "foo"
  * and "bar" could thus be expressions, like "document.documentElement" and
  * "childNodes[4]" respectively.
  *
  * To avoid repetition, some values are automatically added based on others.
  * For instance, if we specify nodeType: Node.TEXT_NODE, we'll automatically
  * also test nodeName: "#text".  This is handled by code after this variable is
  * defined.
  */
 var expected = {
-	testDiv: {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: document,
-		parentNode: document.body,
-		parentElement: document.body,
-		"childNodes.length": 6,
-		"childNodes[0]": paras[0],
-		"childNodes[1]": paras[1],
-		"childNodes[2]": paras[2],
-		"childNodes[3]": paras[3],
-		"childNodes[4]": paras[4],
-		"childNodes[5]": comment,
-		previousSibling: null,
-		nextSibling: document.getElementById("log"),
-		textContent: "A\u0308b\u0308c\u0308d\u0308e\u0308f\u0308g\u0308h\u0308\nIjklmnop\nQrstuvwxYzabcdefGhijklmn",
+    testDiv: {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: document,
+        parentNode: document.body,
+        parentElement: document.body,
+        "childNodes.length": 6,
+        "childNodes[0]": paras[0],
+        "childNodes[1]": paras[1],
+        "childNodes[2]": paras[2],
+        "childNodes[3]": paras[3],
+        "childNodes[4]": paras[4],
+        "childNodes[5]": comment,
+        previousSibling: null,
+        nextSibling: document.getElementById("log"),
+        textContent: "A\u0308b\u0308c\u0308d\u0308e\u0308f\u0308g\u0308h\u0308\nIjklmnop\nQrstuvwxYzabcdefGhijklmn",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "div",
-		tagName: "DIV",
-		id: "test",
-		"children[0]": paras[0],
-		"children[1]": paras[1],
-		"children[2]": paras[2],
-		"children[3]": paras[3],
-		"children[4]": paras[4],
-		previousElementSibling: null,
-		// nextSibling isn't explicitly set
-		//nextElementSibling: ,
-		childElementCount: 5,
-	},
-	detachedDiv: {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: document,
-		parentNode: null,
-		parentElement: null,
-		"childNodes.length": 2,
-		"childNodes[0]": detachedPara1,
-		"childNodes[1]": detachedPara2,
-		previousSibling: null,
-		nextSibling: null,
-		textContent: "OpqrstuvWxyzabcd",
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "div",
+        tagName: "DIV",
+        id: "test",
+        "children[0]": paras[0],
+        "children[1]": paras[1],
+        "children[2]": paras[2],
+        "children[3]": paras[3],
+        "children[4]": paras[4],
+        previousElementSibling: null,
+        // nextSibling isn't explicitly set
+        //nextElementSibling: ,
+        childElementCount: 5,
+    },
+    detachedDiv: {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: document,
+        parentNode: null,
+        parentElement: null,
+        "childNodes.length": 2,
+        "childNodes[0]": detachedPara1,
+        "childNodes[1]": detachedPara2,
+        previousSibling: null,
+        nextSibling: null,
+        textContent: "OpqrstuvWxyzabcd",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "div",
-		tagName: "DIV",
-		"children[0]": detachedPara1,
-		"children[1]": detachedPara2,
-		previousElementSibling: null,
-		nextElementSibling: null,
-		childElementCount: 2,
-	},
-	detachedPara1: {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: document,
-		parentNode: detachedDiv,
-		parentElement: detachedDiv,
-		"childNodes.length": 1,
-		previousSibling: null,
-		nextSibling: detachedPara2,
-		textContent: "Opqrstuv",
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "div",
+        tagName: "DIV",
+        "children[0]": detachedPara1,
+        "children[1]": detachedPara2,
+        previousElementSibling: null,
+        nextElementSibling: null,
+        childElementCount: 2,
+    },
+    detachedPara1: {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: document,
+        parentNode: detachedDiv,
+        parentElement: detachedDiv,
+        "childNodes.length": 1,
+        previousSibling: null,
+        nextSibling: detachedPara2,
+        textContent: "Opqrstuv",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "p",
-		tagName: "P",
-		previousElementSibling: null,
-		nextElementSibling: detachedPara2,
-		childElementCount: 0,
-	},
-	detachedPara2: {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: document,
-		parentNode: detachedDiv,
-		parentElement: detachedDiv,
-		"childNodes.length": 1,
-		previousSibling: detachedPara1,
-		nextSibling: null,
-		textContent: "Wxyzabcd",
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "p",
+        tagName: "P",
+        previousElementSibling: null,
+        nextElementSibling: detachedPara2,
+        childElementCount: 0,
+    },
+    detachedPara2: {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: document,
+        parentNode: detachedDiv,
+        parentElement: detachedDiv,
+        "childNodes.length": 1,
+        previousSibling: detachedPara1,
+        nextSibling: null,
+        textContent: "Wxyzabcd",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "p",
-		tagName: "P",
-		previousElementSibling: detachedPara1,
-		nextElementSibling: null,
-		childElementCount: 0,
-	},
-	document: {
-		// Node
-		nodeType: Node.DOCUMENT_NODE,
-		"childNodes.length": 2,
-		"childNodes[0]": document.doctype,
-		"childNodes[1]": document.documentElement,
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "p",
+        tagName: "P",
+        previousElementSibling: detachedPara1,
+        nextElementSibling: null,
+        childElementCount: 0,
+    },
+    document: {
+        // Node
+        nodeType: Node.DOCUMENT_NODE,
+        "childNodes.length": 2,
+        "childNodes[0]": document.doctype,
+        "childNodes[1]": document.documentElement,
 
-		// Document
-		URL: String(location),
-		compatMode: "CSS1Compat",
-		characterSet: "utf-8",
-		contentType: "text/html",
-		doctype: doctype,
-		//documentElement: ,
-	},
-	foreignDoc: {
-		// Node
-		nodeType: Node.DOCUMENT_NODE,
-		"childNodes.length": 3,
-		"childNodes[0]": foreignDoc.doctype,
-		"childNodes[1]": foreignDoc.documentElement,
-		"childNodes[2]": foreignComment,
+        // Document
+        URL: String(location),
+        compatMode: "CSS1Compat",
+        characterSet: "UTF-8",
+        inputEncoding: "UTF-8",
+        contentType: "text/html",
+        doctype: doctype,
+        //documentElement: ,
+    },
+    foreignDoc: {
+        // Node
+        nodeType: Node.DOCUMENT_NODE,
+        "childNodes.length": 3,
+        "childNodes[0]": foreignDoc.doctype,
+        "childNodes[1]": foreignDoc.documentElement,
+        "childNodes[2]": foreignComment,
 
-		// Document
-		URL: "about:blank",
-		compatMode: "CSS1Compat",
-		characterSet: "utf-8",
-		contentType: "text/html",
-		//doctype: ,
-		//documentElement: ,
-	},
-	foreignPara1: {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: foreignDoc,
-		parentNode: foreignDoc.body,
-		parentElement: foreignDoc.body,
-		"childNodes.length": 1,
-		previousSibling: null,
-		nextSibling: foreignPara2,
-		textContent: "Efghijkl",
+        // Document
+        URL: "about:blank",
+        compatMode: "CSS1Compat",
+        characterSet: "UTF-8",
+        inputEncoding: "UTF-8",
+        contentType: "text/html",
+        //doctype: ,
+        //documentElement: ,
+    },
+    foreignPara1: {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: foreignDoc,
+        parentNode: foreignDoc.body,
+        parentElement: foreignDoc.body,
+        "childNodes.length": 1,
+        previousSibling: null,
+        nextSibling: foreignPara2,
+        textContent: "Efghijkl",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "p",
-		tagName: "P",
-		previousElementSibling: null,
-		nextElementSibling: foreignPara2,
-		childElementCount: 0,
-	},
-	foreignPara2: {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: foreignDoc,
-		parentNode: foreignDoc.body,
-		parentElement: foreignDoc.body,
-		"childNodes.length": 1,
-		previousSibling: foreignPara1,
-		nextSibling: foreignTextNode,
-		textContent: "Mnopqrst",
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "p",
+        tagName: "P",
+        previousElementSibling: null,
+        nextElementSibling: foreignPara2,
+        childElementCount: 0,
+    },
+    foreignPara2: {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: foreignDoc,
+        parentNode: foreignDoc.body,
+        parentElement: foreignDoc.body,
+        "childNodes.length": 1,
+        previousSibling: foreignPara1,
+        nextSibling: foreignTextNode,
+        textContent: "Mnopqrst",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "p",
-		tagName: "P",
-		previousElementSibling: foreignPara1,
-		nextElementSibling: null,
-		childElementCount: 0,
-	},
-	xmlDoc: {
-		// Node
-		nodeType: Node.DOCUMENT_NODE,
-		"childNodes.length": 4,
-		"childNodes[0]": xmlDoctype,
-		"childNodes[1]": xmlElement,
-		"childNodes[2]": processingInstruction,
-		"childNodes[3]": xmlComment,
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "p",
+        tagName: "P",
+        previousElementSibling: foreignPara1,
+        nextElementSibling: null,
+        childElementCount: 0,
+    },
+    xmlDoc: {
+        // Node
+        nodeType: Node.DOCUMENT_NODE,
+        "childNodes.length": 4,
+        "childNodes[0]": xmlDoctype,
+        "childNodes[1]": xmlElement,
+        "childNodes[2]": processingInstruction,
+        "childNodes[3]": xmlComment,
 
-		// Document
-		URL: "about:blank",
-		compatMode: "CSS1Compat",
-		characterSet: "utf-8",
-		contentType: "application/xml",
-		//doctype: ,
-		//documentElement: ,
-	},
-	xmlElement: {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: xmlDoc,
-		parentNode: xmlDoc,
-		parentElement: null,
-		"childNodes.length": 1,
-		"childNodes[0]": xmlTextNode,
-		previousSibling: xmlDoctype,
-		nextSibling: processingInstruction,
-		textContent: "do re mi fa so la ti",
+        // Document
+        URL: "about:blank",
+        compatMode: "CSS1Compat",
+        characterSet: "UTF-8",
+        inputEncoding: "UTF-8",
+        contentType: "application/xml",
+        //doctype: ,
+        //documentElement: ,
+    },
+    xmlElement: {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: xmlDoc,
+        parentNode: xmlDoc,
+        parentElement: null,
+        "childNodes.length": 1,
+        "childNodes[0]": xmlTextNode,
+        previousSibling: xmlDoctype,
+        nextSibling: processingInstruction,
+        textContent: "do re mi fa so la ti",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "igiveuponcreativenames",
-		tagName: "igiveuponcreativenames",
-		previousElementSibling: null,
-		nextElementSibling: null,
-		childElementCount: 0,
-	},
-	detachedXmlElement: {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: xmlDoc,
-		parentNode: null,
-		parentElement: null,
-		"childNodes.length": 0,
-		previousSibling: null,
-		nextSibling: null,
-		textContent: "",
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "igiveuponcreativenames",
+        tagName: "igiveuponcreativenames",
+        previousElementSibling: null,
+        nextElementSibling: null,
+        childElementCount: 0,
+    },
+    detachedXmlElement: {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: xmlDoc,
+        parentNode: null,
+        parentElement: null,
+        "childNodes.length": 0,
+        previousSibling: null,
+        nextSibling: null,
+        textContent: "",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "everyone-hates-hyphenated-element-names",
-		tagName: "everyone-hates-hyphenated-element-names",
-		previousElementSibling: null,
-		nextElementSibling: null,
-		childElementCount: 0,
-	},
-	detachedTextNode: {
-		// Node
-		nodeType: Node.TEXT_NODE,
-		ownerDocument: document,
-		parentNode: null,
-		parentElement: null,
-		previousSibling: null,
-		nextSibling: null,
-		nodeValue: "Uvwxyzab",
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "everyone-hates-hyphenated-element-names",
+        tagName: "everyone-hates-hyphenated-element-names",
+        previousElementSibling: null,
+        nextElementSibling: null,
+        childElementCount: 0,
+    },
+    detachedTextNode: {
+        // Node
+        nodeType: Node.TEXT_NODE,
+        ownerDocument: document,
+        parentNode: null,
+        parentElement: null,
+        previousSibling: null,
+        nextSibling: null,
+        nodeValue: "Uvwxyzab",
 
-		// Text
-		wholeText: "Uvwxyzab",
-	},
-	foreignTextNode: {
-		// Node
-		nodeType: Node.TEXT_NODE,
-		ownerDocument: foreignDoc,
-		parentNode: foreignDoc.body,
-		parentElement: foreignDoc.body,
-		previousSibling: foreignPara2,
-		nextSibling: null,
-		nodeValue: "I admit that I harbor doubts about whether we really need so many things to test, but it's too late to stop now.",
+        // Text
+        wholeText: "Uvwxyzab",
+    },
+    foreignTextNode: {
+        // Node
+        nodeType: Node.TEXT_NODE,
+        ownerDocument: foreignDoc,
+        parentNode: foreignDoc.body,
+        parentElement: foreignDoc.body,
+        previousSibling: foreignPara2,
+        nextSibling: null,
+        nodeValue: "I admit that I harbor doubts about whether we really need so many things to test, but it's too late to stop now.",
 
-		// Text
-		wholeText: "I admit that I harbor doubts about whether we really need so many things to test, but it's too late to stop now.",
-	},
-	detachedForeignTextNode: {
-		// Node
-		nodeType: Node.TEXT_NODE,
-		ownerDocument: foreignDoc,
-		parentNode: null,
-		parentElement: null,
-		previousSibling: null,
-		nextSibling: null,
-		nodeValue: "Cdefghij",
+        // Text
+        wholeText: "I admit that I harbor doubts about whether we really need so many things to test, but it's too late to stop now.",
+    },
+    detachedForeignTextNode: {
+        // Node
+        nodeType: Node.TEXT_NODE,
+        ownerDocument: foreignDoc,
+        parentNode: null,
+        parentElement: null,
+        previousSibling: null,
+        nextSibling: null,
+        nodeValue: "Cdefghij",
 
-		// Text
-		wholeText: "Cdefghij",
-	},
-	xmlTextNode: {
-		// Node
-		nodeType: Node.TEXT_NODE,
-		ownerDocument: xmlDoc,
-		parentNode: xmlElement,
-		parentElement: xmlElement,
-		previousSibling: null,
-		nextSibling: null,
-		nodeValue: "do re mi fa so la ti",
+        // Text
+        wholeText: "Cdefghij",
+    },
+    xmlTextNode: {
+        // Node
+        nodeType: Node.TEXT_NODE,
+        ownerDocument: xmlDoc,
+        parentNode: xmlElement,
+        parentElement: xmlElement,
+        previousSibling: null,
+        nextSibling: null,
+        nodeValue: "do re mi fa so la ti",
 
-		// Text
-		wholeText: "do re mi fa so la ti",
-	},
-	detachedXmlTextNode: {
-		// Node
-		nodeType: Node.TEXT_NODE,
-		ownerDocument: xmlDoc,
-		parentNode: null,
-		parentElement: null,
-		previousSibling: null,
-		nextSibling: null,
-		nodeValue: "Klmnopqr",
+        // Text
+        wholeText: "do re mi fa so la ti",
+    },
+    detachedXmlTextNode: {
+        // Node
+        nodeType: Node.TEXT_NODE,
+        ownerDocument: xmlDoc,
+        parentNode: null,
+        parentElement: null,
+        previousSibling: null,
+        nextSibling: null,
+        nodeValue: "Klmnopqr",
 
-		// Text
-		wholeText: "Klmnopqr",
-	},
-	processingInstruction: {
-		// Node
-		nodeType: Node.PROCESSING_INSTRUCTION_NODE,
-		ownerDocument: xmlDoc,
-		parentNode: xmlDoc,
-		parentElement: null,
-		previousSibling: xmlElement,
-		nextSibling: xmlComment,
-		nodeValue: 'Did you know that ":syn sync fromstart" is very useful when using vim to edit large amounts of JavaScript embedded in HTML?',
+        // Text
+        wholeText: "Klmnopqr",
+    },
+    processingInstruction: {
+        // Node
+        nodeType: Node.PROCESSING_INSTRUCTION_NODE,
+        ownerDocument: xmlDoc,
+        parentNode: xmlDoc,
+        parentElement: null,
+        previousSibling: xmlElement,
+        nextSibling: xmlComment,
+        nodeValue: 'Did you know that ":syn sync fromstart" is very useful when using vim to edit large amounts of JavaScript embedded in HTML?',
 
-		// ProcessingInstruction
-		target: "somePI",
-	},
-	detachedProcessingInstruction: {
-		// Node
-		nodeType: Node.PROCESSING_INSTRUCTION_NODE,
-		ownerDocument: xmlDoc,
-		parentNode: null,
-		parentElement: null,
-		previousSibling: null,
-		nextSibling: null,
-		nodeValue: "chirp chirp chirp",
+        // ProcessingInstruction
+        target: "somePI",
+    },
+    detachedProcessingInstruction: {
+        // Node
+        nodeType: Node.PROCESSING_INSTRUCTION_NODE,
+        ownerDocument: xmlDoc,
+        parentNode: null,
+        parentElement: null,
+        previousSibling: null,
+        nextSibling: null,
+        nodeValue: "chirp chirp chirp",
 
-		// ProcessingInstruction
-		target: "whippoorwill",
-	},
-	comment: {
-		// Node
-		nodeType: Node.COMMENT_NODE,
-		ownerDocument: document,
-		parentNode: testDiv,
-		parentElement: testDiv,
-		previousSibling: paras[4],
-		nextSibling: null,
-		nodeValue: "Alphabet soup?",
-	},
-	detachedComment: {
-		// Node
-		nodeType: Node.COMMENT_NODE,
-		ownerDocument: document,
-		parentNode: null,
-		parentElement: null,
-		previousSibling: null,
-		nextSibling: null,
-		nodeValue: "Stuvwxyz",
-	},
-	foreignComment: {
-		// Node
-		nodeType: Node.COMMENT_NODE,
-		ownerDocument: foreignDoc,
-		parentNode: foreignDoc,
-		parentElement: null,
-		previousSibling: foreignDoc.documentElement,
-		nextSibling: null,
-		nodeValue: '"Commenter" and "commentator" mean different things.  I\'ve seen non-native speakers trip up on this.',
-	},
-	detachedForeignComment: {
-		// Node
-		nodeType: Node.COMMENT_NODE,
-		ownerDocument: foreignDoc,
-		parentNode: null,
-		parentElement: null,
-		previousSibling: null,
-		nextSibling: null,
-		nodeValue: "אריה יהודה",
-	},
-	xmlComment: {
-		// Node
-		nodeType: Node.COMMENT_NODE,
-		ownerDocument: xmlDoc,
-		parentNode: xmlDoc,
-		parentElement: null,
-		previousSibling: processingInstruction,
-		nextSibling: null,
-		nodeValue: "I maliciously created a comment that will break incautious XML serializers, but Firefox threw an exception, so all I got was this lousy T-shirt",
-	},
-	detachedXmlComment: {
-		// Node
-		nodeType: Node.COMMENT_NODE,
-		ownerDocument: xmlDoc,
-		parentNode: null,
-		parentElement: null,
-		previousSibling: null,
-		nextSibling: null,
-		nodeValue: "בן חיים אליעזר",
-	},
-	docfrag: {
-		// Node
-		nodeType: Node.DOCUMENT_FRAGMENT_NODE,
-		ownerDocument: document,
-		"childNodes.length": 0,
-		textContent: "",
-	},
-	foreignDocfrag: {
-		// Node
-		nodeType: Node.DOCUMENT_FRAGMENT_NODE,
-		ownerDocument: foreignDoc,
-		"childNodes.length": 0,
-		textContent: "",
-	},
-	xmlDocfrag: {
-		// Node
-		nodeType: Node.DOCUMENT_FRAGMENT_NODE,
-		ownerDocument: xmlDoc,
-		"childNodes.length": 0,
-		textContent: "",
-	},
-	doctype: {
-		// Node
-		nodeType: Node.DOCUMENT_TYPE_NODE,
-		ownerDocument: document,
-		parentNode: document,
-		previousSibling: null,
-		nextSibling: document.documentElement,
+        // ProcessingInstruction
+        target: "whippoorwill",
+    },
+    comment: {
+        // Node
+        nodeType: Node.COMMENT_NODE,
+        ownerDocument: document,
+        parentNode: testDiv,
+        parentElement: testDiv,
+        previousSibling: paras[4],
+        nextSibling: null,
+        nodeValue: "Alphabet soup?",
+    },
+    detachedComment: {
+        // Node
+        nodeType: Node.COMMENT_NODE,
+        ownerDocument: document,
+        parentNode: null,
+        parentElement: null,
+        previousSibling: null,
+        nextSibling: null,
+        nodeValue: "Stuvwxyz",
+    },
+    foreignComment: {
+        // Node
+        nodeType: Node.COMMENT_NODE,
+        ownerDocument: foreignDoc,
+        parentNode: foreignDoc,
+        parentElement: null,
+        previousSibling: foreignDoc.documentElement,
+        nextSibling: null,
+        nodeValue: '"Commenter" and "commentator" mean different things.  I\'ve seen non-native speakers trip up on this.',
+    },
+    detachedForeignComment: {
+        // Node
+        nodeType: Node.COMMENT_NODE,
+        ownerDocument: foreignDoc,
+        parentNode: null,
+        parentElement: null,
+        previousSibling: null,
+        nextSibling: null,
+        nodeValue: "אריה יהודה",
+    },
+    xmlComment: {
+        // Node
+        nodeType: Node.COMMENT_NODE,
+        ownerDocument: xmlDoc,
+        parentNode: xmlDoc,
+        parentElement: null,
+        previousSibling: processingInstruction,
+        nextSibling: null,
+        nodeValue: "I maliciously created a comment that will break incautious XML serializers, but Firefox threw an exception, so all I got was this lousy T-shirt",
+    },
+    detachedXmlComment: {
+        // Node
+        nodeType: Node.COMMENT_NODE,
+        ownerDocument: xmlDoc,
+        parentNode: null,
+        parentElement: null,
+        previousSibling: null,
+        nextSibling: null,
+        nodeValue: "בן חיים אליעזר",
+    },
+    docfrag: {
+        // Node
+        nodeType: Node.DOCUMENT_FRAGMENT_NODE,
+        ownerDocument: document,
+        "childNodes.length": 0,
+        textContent: "",
+    },
+    foreignDocfrag: {
+        // Node
+        nodeType: Node.DOCUMENT_FRAGMENT_NODE,
+        ownerDocument: foreignDoc,
+        "childNodes.length": 0,
+        textContent: "",
+    },
+    xmlDocfrag: {
+        // Node
+        nodeType: Node.DOCUMENT_FRAGMENT_NODE,
+        ownerDocument: xmlDoc,
+        "childNodes.length": 0,
+        textContent: "",
+    },
+    doctype: {
+        // Node
+        nodeType: Node.DOCUMENT_TYPE_NODE,
+        ownerDocument: document,
+        parentNode: document,
+        previousSibling: null,
+        nextSibling: document.documentElement,
 
-		// DocumentType
-		name: "html",
-		publicId: "",
-		systemId: "",
-	},
-	foreignDoctype: {
-		// Node
-		nodeType: Node.DOCUMENT_TYPE_NODE,
-		ownerDocument: foreignDoc,
-		parentNode: foreignDoc,
-		previousSibling: null,
-		nextSibling: foreignDoc.documentElement,
+        // DocumentType
+        name: "html",
+        publicId: "",
+        systemId: "",
+    },
+    foreignDoctype: {
+        // Node
+        nodeType: Node.DOCUMENT_TYPE_NODE,
+        ownerDocument: foreignDoc,
+        parentNode: foreignDoc,
+        previousSibling: null,
+        nextSibling: foreignDoc.documentElement,
 
-		// DocumentType
-		name: "html",
-		publicId: "",
-		systemId: "",
-	},
-	xmlDoctype: {
-		// Node
-		nodeType: Node.DOCUMENT_TYPE_NODE,
-		ownerDocument: xmlDoc,
-		parentNode: xmlDoc,
-		previousSibling: null,
-		nextSibling: xmlElement,
+        // DocumentType
+        name: "html",
+        publicId: "",
+        systemId: "",
+    },
+    xmlDoctype: {
+        // Node
+        nodeType: Node.DOCUMENT_TYPE_NODE,
+        ownerDocument: xmlDoc,
+        parentNode: xmlDoc,
+        previousSibling: null,
+        nextSibling: xmlElement,
 
-		// DocumentType
-		name: "qorflesnorf",
-		publicId: "abcde",
-		systemId: "x\"'y",
-	},
-	"paras[0]": {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: document,
-		parentNode: testDiv,
-		parentElement: testDiv,
-		"childNodes.length": 1,
-		previousSibling: null,
-		nextSibling: paras[1],
-		textContent: "A\u0308b\u0308c\u0308d\u0308e\u0308f\u0308g\u0308h\u0308\n",
+        // DocumentType
+        name: "qorflesnorf",
+        publicId: "abcde",
+        systemId: "x\"'y",
+    },
+    "paras[0]": {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: document,
+        parentNode: testDiv,
+        parentElement: testDiv,
+        "childNodes.length": 1,
+        previousSibling: null,
+        nextSibling: paras[1],
+        textContent: "A\u0308b\u0308c\u0308d\u0308e\u0308f\u0308g\u0308h\u0308\n",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "p",
-		tagName: "P",
-		id: "a",
-		previousElementSibling: null,
-		nextElementSibling: paras[1],
-		childElementCount: 0,
-	},
-	"paras[1]": {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: document,
-		parentNode: testDiv,
-		parentElement: testDiv,
-		"childNodes.length": 1,
-		previousSibling: paras[0],
-		nextSibling: paras[2],
-		textContent: "Ijklmnop\n",
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "p",
+        tagName: "P",
+        id: "a",
+        previousElementSibling: null,
+        nextElementSibling: paras[1],
+        childElementCount: 0,
+    },
+    "paras[1]": {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: document,
+        parentNode: testDiv,
+        parentElement: testDiv,
+        "childNodes.length": 1,
+        previousSibling: paras[0],
+        nextSibling: paras[2],
+        textContent: "Ijklmnop\n",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "p",
-		tagName: "P",
-		id: "b",
-		previousElementSibling: paras[0],
-		nextElementSibling: paras[2],
-		childElementCount: 0,
-	},
-	"paras[2]": {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: document,
-		parentNode: testDiv,
-		parentElement: testDiv,
-		"childNodes.length": 1,
-		previousSibling: paras[1],
-		nextSibling: paras[3],
-		textContent: "Qrstuvwx",
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "p",
+        tagName: "P",
+        id: "b",
+        previousElementSibling: paras[0],
+        nextElementSibling: paras[2],
+        childElementCount: 0,
+    },
+    "paras[2]": {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: document,
+        parentNode: testDiv,
+        parentElement: testDiv,
+        "childNodes.length": 1,
+        previousSibling: paras[1],
+        nextSibling: paras[3],
+        textContent: "Qrstuvwx",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "p",
-		tagName: "P",
-		id: "c",
-		previousElementSibling: paras[1],
-		nextElementSibling: paras[3],
-		childElementCount: 0,
-	},
-	"paras[3]": {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: document,
-		parentNode: testDiv,
-		parentElement: testDiv,
-		"childNodes.length": 1,
-		previousSibling: paras[2],
-		nextSibling: paras[4],
-		textContent: "Yzabcdef",
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "p",
+        tagName: "P",
+        id: "c",
+        previousElementSibling: paras[1],
+        nextElementSibling: paras[3],
+        childElementCount: 0,
+    },
+    "paras[3]": {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: document,
+        parentNode: testDiv,
+        parentElement: testDiv,
+        "childNodes.length": 1,
+        previousSibling: paras[2],
+        nextSibling: paras[4],
+        textContent: "Yzabcdef",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "p",
-		tagName: "P",
-		id: "d",
-		previousElementSibling: paras[2],
-		nextElementSibling: paras[4],
-		childElementCount: 0,
-	},
-	"paras[4]": {
-		// Node
-		nodeType: Node.ELEMENT_NODE,
-		ownerDocument: document,
-		parentNode: testDiv,
-		parentElement: testDiv,
-		"childNodes.length": 1,
-		previousSibling: paras[3],
-		nextSibling: comment,
-		textContent: "Ghijklmn",
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "p",
+        tagName: "P",
+        id: "d",
+        previousElementSibling: paras[2],
+        nextElementSibling: paras[4],
+        childElementCount: 0,
+    },
+    "paras[4]": {
+        // Node
+        nodeType: Node.ELEMENT_NODE,
+        ownerDocument: document,
+        parentNode: testDiv,
+        parentElement: testDiv,
+        "childNodes.length": 1,
+        previousSibling: paras[3],
+        nextSibling: comment,
+        textContent: "Ghijklmn",
 
-		// Element
-		namespaceURI: "http://www.w3.org/1999/xhtml",
-		prefix: null,
-		localName: "p",
-		tagName: "P",
-		id: "e",
-		previousElementSibling: paras[3],
-		nextElementSibling: null,
-		childElementCount: 0,
-	},
+        // Element
+        namespaceURI: "http://www.w3.org/1999/xhtml",
+        prefix: null,
+        localName: "p",
+        tagName: "P",
+        id: "e",
+        previousElementSibling: paras[3],
+        nextElementSibling: null,
+        childElementCount: 0,
+    },
 };
 
 for (var node in expected) {
-	// Now we set various default values by node type.
-	switch (expected[node].nodeType) {
-	case Node.ELEMENT_NODE:
-		expected[node].nodeName = expected[node].tagName;
-		expected[node].nodeValue = null;
-		expected[node]["children.length"] = expected[node].childElementCount;
+    // Now we set various default values by node type.
+    switch (expected[node].nodeType) {
+    case Node.ELEMENT_NODE:
+        expected[node].nodeName = expected[node].tagName;
+        expected[node].nodeValue = null;
+        expected[node]["children.length"] = expected[node].childElementCount;
 
-		if (expected[node].id === undefined) {
-			expected[node].id = "";
-		}
-		if (expected[node].className === undefined) {
-			expected[node].className = "";
-		}
+        if (expected[node].id === undefined) {
+            expected[node].id = "";
+        }
+        if (expected[node].className === undefined) {
+            expected[node].className = "";
+        }
 
-		var len = expected[node].childElementCount;
-		if (len === 0) {
-			expected[node].firstElementChild =
-			expected[node].lastElementChild = null;
-		} else {
-			// If we have expectations for the first/last child in children,
-			// use those.  Otherwise, at least check that .firstElementChild ==
-			// .children[0] and .lastElementChild == .children[len - 1], even
-			// if we aren't sure what they should be.
-			expected[node].firstElementChild = expected[node]["children[0]"]
-				? expected[node]["children[0]"]
-				: eval(node).children[0];
-			expected[node].lastElementChild =
-				expected[node]["children[" + (len - 1) + "]"]
-				? expected[node]["children[" + (len - 1) + "]"]
-				: eval(node).children[len - 1];
-		}
-		break;
+        var len = expected[node].childElementCount;
+        if (len === 0) {
+            expected[node].firstElementChild =
+            expected[node].lastElementChild = null;
+        } else {
+            // If we have expectations for the first/last child in children,
+            // use those.  Otherwise, at least check that .firstElementChild ==
+            // .children[0] and .lastElementChild == .children[len - 1], even
+            // if we aren't sure what they should be.
+            expected[node].firstElementChild = expected[node]["children[0]"]
+                ? expected[node]["children[0]"]
+                : eval(node).children[0];
+            expected[node].lastElementChild =
+                expected[node]["children[" + (len - 1) + "]"]
+                ? expected[node]["children[" + (len - 1) + "]"]
+                : eval(node).children[len - 1];
+        }
+        break;
 
-	case Node.TEXT_NODE:
-		expected[node].nodeName = "#text";
-		expected[node]["childNodes.length"] = 0;
-		expected[node].textContent = expected[node].data =
-			expected[node].nodeValue;
-		expected[node].length = expected[node].nodeValue.length;
-		break;
+    case Node.TEXT_NODE:
+        expected[node].nodeName = "#text";
+        expected[node]["childNodes.length"] = 0;
+        expected[node].textContent = expected[node].data =
+            expected[node].nodeValue;
+        expected[node].length = expected[node].nodeValue.length;
+        break;
 
-	case Node.PROCESSING_INSTRUCTION_NODE:
-		expected[node].nodeName = expected[node].target;
-		expected[node]["childNodes.length"] = 0;
-		expected[node].textContent = expected[node].data =
-			expected[node].nodeValue;
-		expected[node].length = expected[node].nodeValue.length;
-		break;
+    case Node.PROCESSING_INSTRUCTION_NODE:
+        expected[node].nodeName = expected[node].target;
+        expected[node]["childNodes.length"] = 0;
+        expected[node].textContent = expected[node].data =
+            expected[node].nodeValue;
+        expected[node].length = expected[node].nodeValue.length;
+        break;
 
-	case Node.COMMENT_NODE:
-		expected[node].nodeName = "#comment";
-		expected[node]["childNodes.length"] = 0;
-		expected[node].textContent = expected[node].data =
-			expected[node].nodeValue;
-		expected[node].length = expected[node].nodeValue.length;
-		break;
+    case Node.COMMENT_NODE:
+        expected[node].nodeName = "#comment";
+        expected[node]["childNodes.length"] = 0;
+        expected[node].textContent = expected[node].data =
+            expected[node].nodeValue;
+        expected[node].length = expected[node].nodeValue.length;
+        break;
 
-	case Node.DOCUMENT_NODE:
-		expected[node].nodeName = "#document";
-		expected[node].ownerDocument = expected[node].parentNode =
-			expected[node].parentElement = expected[node].previousSibling =
-			expected[node].nextSibling = expected[node].nodeValue =
-			expected[node].textContent = null;
-		expected[node].documentURI = expected[node].URL;
-		break;
+    case Node.DOCUMENT_NODE:
+        expected[node].nodeName = "#document";
+        expected[node].ownerDocument = expected[node].parentNode =
+            expected[node].parentElement = expected[node].previousSibling =
+            expected[node].nextSibling = expected[node].nodeValue =
+            expected[node].textContent = null;
+        expected[node].documentURI = expected[node].URL;
+        break;
 
-	case Node.DOCUMENT_TYPE_NODE:
-		expected[node].nodeName = expected[node].name;
-		expected[node]["childNodes.length"] = 0;