Refresh WPT tests up to c875b42
https://bugs.webkit.org/show_bug.cgi?id=159712

Patch by Youenn Fablet <youennf@gmail.com> on 2016-07-13
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* resources/ImportExpectations:
* resources/TestRepositories:
* resources/web-platform-tests-modules.json:
* web-platform-tests/XMLHttpRequest/open-url-multi-window-6-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm: Added.
* web-platform-tests/XMLHttpRequest/responsexml-basic-expected.txt:
* web-platform-tests/XMLHttpRequest/responsexml-basic.htm:
* web-platform-tests/XMLHttpRequest/responsexml-document-properties-expected.txt:
* web-platform-tests/XMLHttpRequest/send-redirect-post-upload-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/send-redirect-post-upload.htm: Added.
* web-platform-tests/__init__.py:
* web-platform-tests/dom/events/CustomEvent-expected.txt: Added.
* web-platform-tests/dom/events/CustomEvent.html: Added.
* web-platform-tests/dom/events/Event-dispatch-bubbles-true-expected.txt: Added.
* web-platform-tests/dom/events/Event-dispatch-bubbles-true.html: Added.
* web-platform-tests/dom/events/Event-dispatch-detached-click-expected.txt: Added.
* web-platform-tests/dom/events/Event-dispatch-detached-click.html: Added.
* web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation-expected.txt: Added.
* web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation.html: Added.
* web-platform-tests/dom/events/Event-dispatch-order-expected.txt: Added.
* web-platform-tests/dom/events/Event-dispatch-order.html: Added.
* web-platform-tests/dom/events/Event-dispatch-throwing-expected.txt: Added.
* web-platform-tests/dom/events/Event-dispatch-throwing.html: Added.
* web-platform-tests/dom/events/Event-init-while-dispatching-expected.txt: Added.
* web-platform-tests/dom/events/Event-init-while-dispatching.html: Added.
* web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt: Added.
* web-platform-tests/dom/events/Event-subclasses-constructors.html: Added.
* web-platform-tests/dom/events/EventListener-handleEvent-expected.txt: Added.
* web-platform-tests/dom/events/EventListener-handleEvent.html: Added.
* web-platform-tests/dom/events/EventListener-incumbent-global-1.sub-expected.txt: Added.
* web-platform-tests/dom/events/EventListener-incumbent-global-1.sub.html: Added.
* web-platform-tests/dom/events/EventListener-incumbent-global-2.sub-expected.txt: Added.
* web-platform-tests/dom/events/EventListener-incumbent-global-2.sub.html: Added.
* web-platform-tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html: Added.
* web-platform-tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html: Added.
* web-platform-tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html: Added.
* web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes-expected.txt: Added.
* web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes.html: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-expected.txt:
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.html: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.svg: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.xhtml: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.xml: Added.
* web-platform-tests/dom/nodes/ProcessingInstruction-escapes-1-expected.txt: Added.
* web-platform-tests/dom/nodes/ProcessingInstruction-escapes-1.xhtml: Added.
* web-platform-tests/domparsing/DOMParser-parseFromString-html-expected.txt:
* web-platform-tests/domparsing/DOMParser-parseFromString-html.html:
* web-platform-tests/domparsing/createContextualFragment-expected.txt: Added.
* web-platform-tests/domparsing/createContextualFragment.html: Added.
* web-platform-tests/domparsing/innerhtml-01-expected.txt: Added.
* web-platform-tests/domparsing/innerhtml-01.xhtml: Added.
* web-platform-tests/domparsing/innerhtml-03-expected.txt: Added.
* web-platform-tests/domparsing/innerhtml-03.xhtml: Added.
* web-platform-tests/domparsing/innerhtml-04-expected.txt: Added.
* web-platform-tests/domparsing/innerhtml-04.html: Added.
* web-platform-tests/domparsing/innerhtml-05-expected.txt: Added.
* web-platform-tests/domparsing/innerhtml-05.xhtml: Added.
* web-platform-tests/domparsing/innerhtml-06-expected.txt: Added.
* web-platform-tests/domparsing/innerhtml-06.html: Added.
* web-platform-tests/domparsing/innerhtml-07-expected.txt: Added.
* web-platform-tests/domparsing/innerhtml-07.html: Added.
* web-platform-tests/domparsing/insert_adjacent_html-expected.txt: Added.
* web-platform-tests/domparsing/insert_adjacent_html.html: Added.
* web-platform-tests/domparsing/insert_adjacent_html.js: Added.
(testThrowingNoParent):
* web-platform-tests/domparsing/outerhtml-01-expected.txt: Added.
* web-platform-tests/domparsing/outerhtml-01.html: Added.
* web-platform-tests/domparsing/outerhtml-02-expected.txt: Added.
* web-platform-tests/domparsing/outerhtml-02.html: Added.
* web-platform-tests/domparsing/xml-serialization-expected.txt: Added.
* web-platform-tests/domparsing/xml-serialization.xhtml: Added.
* web-platform-tests/fetch/api/basic/request-head-expected.txt: Added.
* web-platform-tests/fetch/api/basic/request-head-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/request-head-worker.html: Added.
* web-platform-tests/fetch/api/basic/request-head.html: Added.
* web-platform-tests/fetch/api/basic/request-head.js: Added.
(promise_test):
* web-platform-tests/fetch/api/basic/request-headers-expected.txt:
* web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt:
* web-platform-tests/fetch/api/basic/request-headers.js:
* web-platform-tests/fetch/api/basic/response-url-expected.txt: Added.
* web-platform-tests/fetch/api/basic/response-url-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/response-url-worker.html: Added.
* web-platform-tests/fetch/api/basic/response-url.html: Added.
* web-platform-tests/fetch/api/basic/response-url.js: Added.
(checkResponseURL):
* web-platform-tests/fetch/api/basic/w3c-import.log:
* web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight.js:
(corsPreflight):
* web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt:
* web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt:
* web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt:
* web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt:
* web-platform-tests/fetch/api/request/request-init-002.html:
* web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt:
* web-platform-tests/fetch/api/request/request-init-003.sub.html:
* web-platform-tests/html/dom/interfaces.html:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank-expected.txt: Added.
* web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank.html: Added.
* web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid-expected.txt: Added.
* web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid.html: Added.
* web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc-expected.txt: Added.
* web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc.html: Added.
* web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context-expected.txt: Added.
* web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context.html: Added.
* web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01.html:
* web-platform-tests/html/semantics/document-metadata/the-link-element/stylesheet.py: Added.
(main):
* web-platform-tests/html/semantics/document-metadata/the-link-element/w3c-import.log:
* web-platform-tests/html/semantics/embedded-content/media-elements/video_008-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/media-elements/video_008.htm: Added.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/historical-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/historical.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-subdocument.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_child.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_grandchild.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_parentage-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_parentage.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_grandchild.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_harness.js: Added.
(get_test_results.):
(get_test_results):
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_child.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_grandchild.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/stash.py: Added.
(main):
* web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-img-element/w3c-import.log:
* web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body-expected.txt: Added.
* web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body.html: Added.
* web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange-expected.txt:
* web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html:
* web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element-expected.txt: Added.
* web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/scripting-enabled-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/scripting-enabled.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/w3c-import.log:
* web-platform-tests/lint.whitelist:
* web-platform-tests/streams/readable-streams/bad-strategies.https-expected.txt:
* web-platform-tests/streams/readable-streams/bad-strategies.js:
(get string_appeared_here):
(promise_test): Deleted.

LayoutTests:

* TestExpectations: Adding some test expectations and skipping some resource files.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@203164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 0f0706e..1e28533 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2016-07-13  Youenn Fablet  <youennf@gmail.com>
+
+        Refresh WPT tests up to c875b42
+        https://bugs.webkit.org/show_bug.cgi?id=159712
+
+        Reviewed by Alex Christensen.
+
+        * TestExpectations: Adding some test expectations and skipping some resource files.
+
 2016-07-13  Frederic Wang  <fwang@igalia.com>
 
         The display property of many MathML elements can not be overriden by page authors
diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations
index 445dfa2..6c8c866 100644
--- a/LayoutTests/TestExpectations
+++ b/LayoutTests/TestExpectations
@@ -233,7 +233,12 @@
 webkit.org/b/136878 js/promises-tests/promises-tests-2-3-3.html [ Slow ]
 
 # Resource files not in resources folder
+imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts-subframe.html [ Skip ]
+imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader-subframe.html [ Skip ]
 imported/w3c/web-platform-tests/common/blank.html [ Skip ]
+imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html [ Skip ]
+imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html [ Skip ]
+imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html [ Skip ]
 imported/w3c/web-platform-tests/dom/nodes/Document-createElement-namespace-tests [ Skip ]
 imported/w3c/web-platform-tests/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess-iframe.xml [ Skip ]
 imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode-iframe1.xml [ Skip ]
@@ -257,6 +262,17 @@
 imported/w3c/web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03-frame.html [ Skip ]
 imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/example.html [ Skip ]
 imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/example2.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-iframe.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-subdocument.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_child.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_grandchild.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_grandchild.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_child.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_grandchild.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/support/blank.htm [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_allow_script.html [ Skip ]
 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/iframed.sub.html [ Skip ]
 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/sizes-iframed.sub.html [ Skip ]
 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-object-element/test0.html [ Skip ]
@@ -267,9 +283,9 @@
 imported/w3c/web-platform-tests/html/semantics/grouping-content/the-ol-element/reversed-1a.html [ Skip ]
 imported/w3c/web-platform-tests/html/semantics/grouping-content/the-ol-element/reversed-1b.html [ Skip ]
 imported/w3c/web-platform-tests/html/semantics/grouping-content/the-ol-element/reversed-1c.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html [ Skip ]
 imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/focus-iframe.html [ Skip ]
-imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts-subframe.html [ Skip ]
-imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader-subframe.html [ Skip ]
+
 imported/w3c/web-platform-tests/service-workers [ Skip ]
 
 # Skip W3C tests that are too slow in debug builds.
@@ -344,7 +360,11 @@
 
 webkit.org/b/157068 imported/w3c/web-platform-tests/fetch/nosniff/importscripts.html [ Skip ]
 webkit.org/b/157145 imported/w3c/web-platform-tests/fetch/nosniff/stylesheet.html [ Failure Pass ]
-webkit.org/b/159413 imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.html [ Failure ]
+webkit.org/b/159712 imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context.html [ Timeout ]
+webkit.org/b/159712 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping.html [ Failure Pass ]
+webkit.org/b/159712 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping.html [ Failure Pass ]
+webkit.org/b/159712 imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm [ Pass Timeout ]
+webkit.org/b/159712 imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-post-upload.htm [ Crash Pass ]
 
 # New W3C ref tests that are failing.
 webkit.org/b/148856 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_initially_paused.html [ ImageOnlyFailure ]
diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog
index 5041ce0..f302505 100644
--- a/LayoutTests/imported/w3c/ChangeLog
+++ b/LayoutTests/imported/w3c/ChangeLog
@@ -1,3 +1,183 @@
+2016-07-13  Youenn Fablet  <youennf@gmail.com>
+
+        Refresh WPT tests up to c875b42
+        https://bugs.webkit.org/show_bug.cgi?id=159712
+
+        Reviewed by Alex Christensen.
+
+        * resources/ImportExpectations:
+        * resources/TestRepositories:
+        * resources/web-platform-tests-modules.json:
+        * web-platform-tests/XMLHttpRequest/open-url-multi-window-6-expected.txt: Added.
+        * web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm: Added.
+        * web-platform-tests/XMLHttpRequest/responsexml-basic-expected.txt:
+        * web-platform-tests/XMLHttpRequest/responsexml-basic.htm:
+        * web-platform-tests/XMLHttpRequest/responsexml-document-properties-expected.txt:
+        * web-platform-tests/XMLHttpRequest/send-redirect-post-upload-expected.txt: Added.
+        * web-platform-tests/XMLHttpRequest/send-redirect-post-upload.htm: Added.
+        * web-platform-tests/__init__.py:
+        * web-platform-tests/dom/events/CustomEvent-expected.txt: Added.
+        * web-platform-tests/dom/events/CustomEvent.html: Added.
+        * web-platform-tests/dom/events/Event-dispatch-bubbles-true-expected.txt: Added.
+        * web-platform-tests/dom/events/Event-dispatch-bubbles-true.html: Added.
+        * web-platform-tests/dom/events/Event-dispatch-detached-click-expected.txt: Added.
+        * web-platform-tests/dom/events/Event-dispatch-detached-click.html: Added.
+        * web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation-expected.txt: Added.
+        * web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation.html: Added.
+        * web-platform-tests/dom/events/Event-dispatch-order-expected.txt: Added.
+        * web-platform-tests/dom/events/Event-dispatch-order.html: Added.
+        * web-platform-tests/dom/events/Event-dispatch-throwing-expected.txt: Added.
+        * web-platform-tests/dom/events/Event-dispatch-throwing.html: Added.
+        * web-platform-tests/dom/events/Event-init-while-dispatching-expected.txt: Added.
+        * web-platform-tests/dom/events/Event-init-while-dispatching.html: Added.
+        * web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt: Added.
+        * web-platform-tests/dom/events/Event-subclasses-constructors.html: Added.
+        * web-platform-tests/dom/events/EventListener-handleEvent-expected.txt: Added.
+        * web-platform-tests/dom/events/EventListener-handleEvent.html: Added.
+        * web-platform-tests/dom/events/EventListener-incumbent-global-1.sub-expected.txt: Added.
+        * web-platform-tests/dom/events/EventListener-incumbent-global-1.sub.html: Added.
+        * web-platform-tests/dom/events/EventListener-incumbent-global-2.sub-expected.txt: Added.
+        * web-platform-tests/dom/events/EventListener-incumbent-global-2.sub.html: Added.
+        * web-platform-tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html: Added.
+        * web-platform-tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html: Added.
+        * web-platform-tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html: Added.
+        * web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes-expected.txt: Added.
+        * web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes.html: Added.
+        * web-platform-tests/dom/nodes/Document-createElement-namespace-expected.txt:
+        * web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.html: Added.
+        * web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.svg: Added.
+        * web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.xhtml: Added.
+        * web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.xml: Added.
+        * web-platform-tests/dom/nodes/ProcessingInstruction-escapes-1-expected.txt: Added.
+        * web-platform-tests/dom/nodes/ProcessingInstruction-escapes-1.xhtml: Added.
+        * web-platform-tests/domparsing/DOMParser-parseFromString-html-expected.txt:
+        * web-platform-tests/domparsing/DOMParser-parseFromString-html.html:
+        * web-platform-tests/domparsing/createContextualFragment-expected.txt: Added.
+        * web-platform-tests/domparsing/createContextualFragment.html: Added.
+        * web-platform-tests/domparsing/innerhtml-01-expected.txt: Added.
+        * web-platform-tests/domparsing/innerhtml-01.xhtml: Added.
+        * web-platform-tests/domparsing/innerhtml-03-expected.txt: Added.
+        * web-platform-tests/domparsing/innerhtml-03.xhtml: Added.
+        * web-platform-tests/domparsing/innerhtml-04-expected.txt: Added.
+        * web-platform-tests/domparsing/innerhtml-04.html: Added.
+        * web-platform-tests/domparsing/innerhtml-05-expected.txt: Added.
+        * web-platform-tests/domparsing/innerhtml-05.xhtml: Added.
+        * web-platform-tests/domparsing/innerhtml-06-expected.txt: Added.
+        * web-platform-tests/domparsing/innerhtml-06.html: Added.
+        * web-platform-tests/domparsing/innerhtml-07-expected.txt: Added.
+        * web-platform-tests/domparsing/innerhtml-07.html: Added.
+        * web-platform-tests/domparsing/insert_adjacent_html-expected.txt: Added.
+        * web-platform-tests/domparsing/insert_adjacent_html.html: Added.
+        * web-platform-tests/domparsing/insert_adjacent_html.js: Added.
+        (testThrowingNoParent):
+        * web-platform-tests/domparsing/outerhtml-01-expected.txt: Added.
+        * web-platform-tests/domparsing/outerhtml-01.html: Added.
+        * web-platform-tests/domparsing/outerhtml-02-expected.txt: Added.
+        * web-platform-tests/domparsing/outerhtml-02.html: Added.
+        * web-platform-tests/domparsing/xml-serialization-expected.txt: Added.
+        * web-platform-tests/domparsing/xml-serialization.xhtml: Added.
+        * web-platform-tests/fetch/api/basic/request-head-expected.txt: Added.
+        * web-platform-tests/fetch/api/basic/request-head-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/basic/request-head-worker.html: Added.
+        * web-platform-tests/fetch/api/basic/request-head.html: Added.
+        * web-platform-tests/fetch/api/basic/request-head.js: Added.
+        (promise_test):
+        * web-platform-tests/fetch/api/basic/request-headers-expected.txt:
+        * web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt:
+        * web-platform-tests/fetch/api/basic/request-headers.js:
+        * web-platform-tests/fetch/api/basic/response-url-expected.txt: Added.
+        * web-platform-tests/fetch/api/basic/response-url-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/basic/response-url-worker.html: Added.
+        * web-platform-tests/fetch/api/basic/response-url.html: Added.
+        * web-platform-tests/fetch/api/basic/response-url.js: Added.
+        (checkResponseURL):
+        * web-platform-tests/fetch/api/basic/w3c-import.log:
+        * web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt:
+        * web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt:
+        * web-platform-tests/fetch/api/cors/cors-preflight-expected.txt:
+        * web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt:
+        * web-platform-tests/fetch/api/cors/cors-preflight.js:
+        (corsPreflight):
+        * web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt:
+        * web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt:
+        * web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt:
+        * web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt:
+        * web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt:
+        * web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt:
+        * web-platform-tests/fetch/api/request/request-init-002.html:
+        * web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt:
+        * web-platform-tests/fetch/api/request/request-init-003.sub.html:
+        * web-platform-tests/html/dom/interfaces.html:
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+        * web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank-expected.txt: Added.
+        * web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank.html: Added.
+        * web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid-expected.txt: Added.
+        * web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid.html: Added.
+        * web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc-expected.txt: Added.
+        * web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc.html: Added.
+        * web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context-expected.txt: Added.
+        * web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context.html: Added.
+        * web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01-expected.txt:
+        * web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01.html:
+        * web-platform-tests/html/semantics/document-metadata/the-link-element/stylesheet.py: Added.
+        (main):
+        * web-platform-tests/html/semantics/document-metadata/the-link-element/w3c-import.log:
+        * web-platform-tests/html/semantics/embedded-content/media-elements/video_008-expected.txt: Added.
+        * web-platform-tests/html/semantics/embedded-content/media-elements/video_008.htm: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-canvas-element/historical-expected.txt: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-canvas-element/historical.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-expected.txt: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-subdocument.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_child.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_grandchild.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_parentage-expected.txt: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_parentage.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_grandchild.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage-expected.txt: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen-expected.txt: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event-expected.txt: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_harness.js: Added.
+        (get_test_results.):
+        (get_test_results):
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-expected.txt: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-expected.txt: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_child.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_grandchild.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage-expected.txt: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-iframe-element/stash.py: Added.
+        (main):
+        * web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change-expected.txt:
+        * web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src-expected.txt: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src.html: Added.
+        * web-platform-tests/html/semantics/embedded-content/the-img-element/w3c-import.log:
+        * web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body-expected.txt: Added.
+        * web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body.html: Added.
+        * web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange-expected.txt:
+        * web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html:
+        * web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element-expected.txt: Added.
+        * web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element.html: Added.
+        * web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html: Added.
+        * web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-expected.txt: Added.
+        * web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html: Added.
+        * web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js: Added.
+        * web-platform-tests/html/semantics/scripting-1/the-script-element/scripting-enabled-expected.txt: Added.
+        * web-platform-tests/html/semantics/scripting-1/the-script-element/scripting-enabled.html: Added.
+        * web-platform-tests/html/semantics/scripting-1/the-script-element/w3c-import.log:
+        * web-platform-tests/lint.whitelist:
+        * web-platform-tests/streams/readable-streams/bad-strategies.https-expected.txt:
+        * web-platform-tests/streams/readable-streams/bad-strategies.js:
+        (get string_appeared_here):
+        (promise_test): Deleted.
+
 2016-07-13  Youenn Fablet  <youenn@apple.com>
 
         [Fetch API] Response should not become disturbed on the ReadableStream creation
diff --git a/LayoutTests/imported/w3c/resources/ImportExpectations b/LayoutTests/imported/w3c/resources/ImportExpectations
index d87da48..4f9b946 100644
--- a/LayoutTests/imported/w3c/resources/ImportExpectations
+++ b/LayoutTests/imported/w3c/resources/ImportExpectations
@@ -76,9 +76,11 @@
 web-platform-tests/XMLHttpRequest/send-entity-body-basic.htm [ Skip ]
 web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub.htm [ Skip ]
 web-platform-tests/ambient-light [ Skip ]
+web-platform-tests/annotation-model [ Skip ]
 web-platform-tests/animation-timing [ Skip ]
 web-platform-tests/app-uri [ Skip ]
 web-platform-tests/battery-status [ Skip ]
+web-platform-tests/browser-payment-api [ Skip ]
 web-platform-tests/compat [ Skip ]
 web-platform-tests/content-security-policy [ Skip ]
 web-platform-tests/cookies [Skip]
@@ -218,6 +220,7 @@
 web-platform-tests/selectors [ Skip ]
 web-platform-tests/selectors-api [ Skip ]
 #web-platform-tests/service-workers [ Import ]
+web-platform-tests/service-workers/service-worker [ Skip ]
 web-platform-tests/shadow-dom [ Skip ]
 web-platform-tests/subresource-integrity [ Skip ]
 web-platform-tests/svg [ Skip ]
diff --git a/LayoutTests/imported/w3c/resources/TestRepositories b/LayoutTests/imported/w3c/resources/TestRepositories
index 4dd4ab8..5d2f7f9 100644
--- a/LayoutTests/imported/w3c/resources/TestRepositories
+++ b/LayoutTests/imported/w3c/resources/TestRepositories
@@ -15,7 +15,7 @@
     {
         "name": "web-platform-tests",
         "url": "https://github.com/w3c/web-platform-tests.git", 
-        "revision": "03916af",
+        "revision": "c875b42",
         "paths_to_skip": [
             "conformance-checkers",
             "docs",
diff --git a/LayoutTests/imported/w3c/resources/web-platform-tests-modules.json b/LayoutTests/imported/w3c/resources/web-platform-tests-modules.json
index d151461..6365b821 100644
--- a/LayoutTests/imported/w3c/resources/web-platform-tests-modules.json
+++ b/LayoutTests/imported/w3c/resources/web-platform-tests-modules.json
@@ -3,8 +3,8 @@
         "path": [
             "resources"
         ], 
-        "url": "https://github.com/w3c/testharness.js/archive/dee0f92b957973785097af3e1b1a5ded9b1e7a94.tar.gz", 
-        "url_subpath": "testharness.js-dee0f92b957973785097af3e1b1a5ded9b1e7a94"
+        "url": "https://github.com/w3c/testharness.js/archive/8550cfecab28e680545486a85887334a3757fd49.tar.gz", 
+        "url_subpath": "testharness.js-8550cfecab28e680545486a85887334a3757fd49"
     }, 
     {
         "path": [
@@ -28,8 +28,8 @@
         "path": [
             "tools"
         ], 
-        "url": "https://github.com/w3c/wpt-tools/archive/2f2503955023732d6432cd9c9a7fe03fbdfc6d38.tar.gz", 
-        "url_subpath": "wpt-tools-2f2503955023732d6432cd9c9a7fe03fbdfc6d38"
+        "url": "https://github.com/w3c/wpt-tools/archive/09258ba099c2cd0f7c107a5d4e8b5f458c209a47.tar.gz", 
+        "url_subpath": "wpt-tools-09258ba099c2cd0f7c107a5d4e8b5f458c209a47"
     }, 
     {
         "path": [
diff --git a/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6-expected.txt
new file mode 100644
index 0000000..f6a1ba9
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6-expected.txt
@@ -0,0 +1,3 @@
+
+FAIL XMLHttpRequest: open() in document that is not fully active (but may be active) should throw assert_throws: function "function () { client.open("GET", "...") }" did not throw
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm
new file mode 100644
index 0000000..b6f1582
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>XMLHttpRequest: open() in document that is not fully active (but may be active) should throw</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method">
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+      var test = async_test(),
+          client,
+          count = 0,
+          win = window.open("resources/init.htm");
+      test.add_cleanup(function() { win.close(); });
+      function init() {
+        test.step(function() {
+          if(0 == count) {
+            var doc = win.document;
+            var ifr = document.createElement("iframe");
+            ifr.onload = function() {
+              // Again, do things async so we're not doing loads from inside
+              // load events.
+              setTimeout(function() {
+                client = new ifr.contentWindow.XMLHttpRequest();
+                count++;
+                // Important to do a normal navigation, not a reload.
+                win.location.href = "resources/init.htm";
+              }, 100);
+            }
+            doc.body.appendChild(ifr);
+          } else if(1 == count) {
+            assert_throws("InvalidStateError", function() { client.open("GET", "...") })
+            test.done()
+          }
+        })
+      }
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-basic-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-basic-expected.txt
index fb30d41..5914569 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-basic-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-basic-expected.txt
@@ -1,4 +1,4 @@
 
-FAIL XMLHttpRequest: responseXML basic test assert_equals: getElementById("n2") expected null but got Element node <p xmlns="namespacesarejuststrings" id="n2">2</p>
+FAIL XMLHttpRequest: responseXML basic test undefined is not an object (evaluating 'client.responseXML.documentElement.childrenNodes')
 PASS responseXML on empty response documents 
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-basic.htm b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-basic.htm
index 8bc1ff5..cc4b8dc 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-basic.htm
+++ b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-basic.htm
@@ -19,7 +19,7 @@
         assert_equals(client.responseXML.documentElement.localName, "html", 'localName is html')
         assert_equals(client.responseXML.documentElement.childNodes.length, 5, 'childNodes is 5')
         assert_equals(client.responseXML.getElementById("n1").localName, client.responseXML.documentElement.childNodes[1].localName)
-        assert_equals(client.responseXML.getElementById("n2"), null, 'getElementById("n2")')
+        assert_equals(client.responseXML.getElementById("n2"), client.responseXML.documentElement.childrenNodes[3], 'getElementById("n2")')
         assert_equals(client.responseXML.getElementsByTagName("p")[1].namespaceURI, "namespacesarejuststrings", 'namespaceURI')
       })
       test(function() {
diff --git a/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-document-properties-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-document-properties-expected.txt
index 15afb10..bed9047 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-document-properties-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsexml-document-properties-expected.txt
@@ -16,7 +16,7 @@
 FAIL links assert_equals: expected (undefined) undefined but got (object) object "[object HTMLCollection]"
 PASS cookie 
 PASS lastModified set to time of response if no HTTP header provided 
-FAIL lastModified set to related HTTP header if provided assert_equals: expected 1467730108000 but got 1467737203000
+FAIL lastModified set to related HTTP header if provided assert_equals: expected 1468404072000 but got 1468410886000
 PASS cookie (after setting it) 
 PASS styleSheets 
 PASS implementation 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-post-upload-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-post-upload-expected.txt
new file mode 100644
index 0000000..55fed90
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-post-upload-expected.txt
@@ -0,0 +1,6 @@
+
+PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (301) 
+PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (302) 
+PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (303) 
+PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (307) 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-post-upload.htm b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-post-upload.htm
new file mode 100644
index 0000000..1e705ca
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-post-upload.htm
@@ -0,0 +1,124 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-onprogress" data-tested-assertations="../.." />
+    <link rel="help" href="https://xhr.spec.whatwg.org/#event-xhr-progress" data-tested-assertations="../.." />
+    <link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method" data-tested-assertations="following::dt[@id="dom-xmlhttprequest-send-bodyinit"]/following::dd[1]/p[2] following::ol[1]/li[9]//li[1] following::ol[1]/li[9]//li[2]" />
+    <link rel="help" href="https://fetch.spec.whatwg.org/#http-fetch" data-tested-assertations="following::ol[1]/li[6]/dl/dd[1]//dd[3]" />
+    <link rel="help" href="https://fetch.spec.whatwg.org/#concept-http-redirect-fetch" data-tested-assertations="following::li[16]" />
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <title>XMLHttpRequest: The send() method: POSTing to URL that redirects</title>
+</head>
+
+<body>
+    <div id="log"></div>
+
+    <script type="text/javascript">
+    function testRedirectPost(code, shouldResendPost) {
+        var test = async_test(document.title + " (" + code + ")");
+        var actual = [];
+        // We check upload.onprogress with a boolean because it *might* fire more than once
+        var progressFiredReadyState1 = false;
+
+        var expectedHeaders, expectedEvents;
+
+        // 307 redirects should resend the POST data, and events and headers will be a little different..
+        if(shouldResendPost) {
+            expectedHeaders = { 
+                "X-Request-Content-Length": "11988",
+                "X-Request-Content-Type": "text/plain;charset=UTF-8",
+                "X-Request-Method": "POST",
+                "X-Request-Query": "NO",
+                "Content-Length": "11988"
+            }
+            expectedEvents = [
+                "xhr onreadystatechange 1",
+                "xhr loadstart 1",
+                "upload loadstart 1",
+                "upload loadend 1",
+                "xhr onreadystatechange 2",
+                "xhr onreadystatechange 3",
+                "xhr onreadystatechange 4",
+                "xhr load 4",
+                "xhr loadend 4"
+            ];
+        } else {
+            // setting the right expectations for POST resent as GET without request body
+            expectedHeaders = { 
+                "X-Request-Content-Length": "NO",
+                "X-Request-Content-Type": "NO",
+                "X-Request-Method": "GET",
+                "X-Request-Query": "NO"
+            }            
+            expectedEvents = [
+                "xhr onreadystatechange 1",
+                "xhr loadstart 1",
+                "upload loadstart 1",
+                "upload loadend 1",
+                "xhr onreadystatechange 2",
+                /* we expect no onreadystatechange readyState=3 event because there is no loading content */
+                "xhr onreadystatechange 4",
+                "xhr load 4",
+                "xhr loadend 4"
+            ];
+        }
+        test.step(function()
+        {
+            var xhr = new XMLHttpRequest();
+
+            xhr.upload.onloadstart = test.step_func(function(e) {
+                actual.push("upload loadstart " + xhr.readyState);
+            });
+            xhr.upload.onprogress = test.step_func(function(e) {
+                // events every 50ms, one final when uploading is done
+                if(xhr.readyState >= xhr.HEADERS_RECEIVED) {
+                    assert_equals(xhr.status, 200, "JS never gets to see the 30x status code");
+                }
+                progressFiredReadyState1 = xhr.readyState === xhr.OPENED;
+            });
+            xhr.upload.onloadend = test.step_func(function() {
+                actual.push("upload loadend " + xhr.readyState);
+            });
+            xhr.onloadstart = test.step_func(function() {
+                actual.push("xhr loadstart " + xhr.readyState);
+            });
+            xhr.onreadystatechange = test.step_func(function() {
+                if(xhr.readyState >= xhr.HEADERS_RECEIVED) {
+                    assert_equals(xhr.status, 200, "JS never gets to see the 30x status code");
+                }
+                actual.push("xhr onreadystatechange " + xhr.readyState);
+            });
+            xhr.onload = test.step_func(function(e)
+            {
+                actual.push("xhr load " + xhr.readyState);
+            });
+            xhr.onloadend = test.step_func(function(e)
+            {
+                actual.push("xhr loadend " + xhr.readyState);
+
+                assert_true(progressFiredReadyState1, "One progress event should fire on xhr.upload when readyState is 1");
+
+                // Headers will tell us if data was sent when expected
+                for(var header in expectedHeaders) {
+                    assert_equals(xhr.getResponseHeader(header), expectedHeaders[header], header);
+                }
+
+                assert_array_equals(actual, expectedEvents, "events firing in expected order and states");
+                test.done();
+            });
+
+            xhr.open("POST", "./resources/redirect.py?location=content.py&code=" + code, true);
+            xhr.send((new Array(1000)).join("Test Message"));
+        });
+    }
+
+
+    testRedirectPost(301, false);
+    testRedirectPost(302, false);
+    testRedirectPost(303, false);
+    testRedirectPost(307, true);
+
+    </script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/__init__.py b/LayoutTests/imported/w3c/web-platform-tests/__init__.py
index c1e4c6d..a6834b8 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/__init__.py
+++ b/LayoutTests/imported/w3c/web-platform-tests/__init__.py
@@ -1 +1 @@
-# This file is required for Python to search this directory for modules.
+# This file is required for Python to search this directory for modules.
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/CustomEvent-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/events/CustomEvent-expected.txt
new file mode 100644
index 0000000..3c2481c
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/CustomEvent-expected.txt
@@ -0,0 +1,3 @@
+
+PASS CustomEvent 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/CustomEvent.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/CustomEvent.html
new file mode 100644
index 0000000..c55d592
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/CustomEvent.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>CustomEvent</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+  var type = "foo";
+
+  var target = document.createElement("div");
+  target.addEventListener(type, this.step_func(function(evt) {
+    assert_equals(evt.type, type);
+  }), true);
+
+  var fooEvent = document.createEvent("CustomEvent");
+  fooEvent.initEvent(type, true, true);
+  target.dispatchEvent(fooEvent);
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-bubbles-true-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-bubbles-true-expected.txt
new file mode 100644
index 0000000..04eb8bf
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-bubbles-true-expected.txt
@@ -0,0 +1,7 @@
+
+PASS In window.document with click event 
+PASS In window.document with load event 
+FAIL In window.document.cloneNode(true) assert_array_equals: targets lengths differ, expected 14 got 0
+FAIL In new Document() assert_array_equals: targets lengths differ, expected 14 got 0
+FAIL In DOMImplementation.createHTMLDocument() assert_array_equals: targets lengths differ, expected 14 got 0
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-bubbles-true.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-bubbles-true.html
new file mode 100644
index 0000000..b23605a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-bubbles-true.html
@@ -0,0 +1,108 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title> Event.bubbles attribute is set to false </title>
+<link rel="help" href="https://dom.spec.whatwg.org/#dom-event-initevent">
+<link rel="help" href="https://dom.spec.whatwg.org/#concept-event-dispatch">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<table id="table" border="1" style="display: none">
+    <tbody id="table-body">
+    <tr id="table-row">
+        <td id="table-cell">Shady Grove</td>
+        <td>Aeolian</td>
+    </tr>
+    <tr id="parent">
+        <td id="target">Over the river, Charlie</td>
+        <td>Dorian</td>
+    </tr>
+    </tbody>
+</table>
+<script>
+function concatReverse(a) {
+    return a.concat(a.map(function(x) { return x }).reverse());
+}
+
+function targetsForDocumentChain(document) {
+    return [
+        document,
+        document.documentElement,
+        document.getElementsByTagName("body")[0],
+        document.getElementById("table"),
+        document.getElementById("table-body"),
+        document.getElementById("parent")
+    ];
+}
+
+function testChain(document, targetParents, phases, event_type) {
+    var target = document.getElementById("target");
+    var targets = targetParents.concat(target);
+    var expected_targets = concatReverse(targets);
+
+    var actual_targets = [], actual_phases = [];
+    var test_event = function(evt) {
+        actual_targets.push(evt.currentTarget);
+        actual_phases.push(evt.eventPhase);
+    }
+
+    for (var i = 0; i < targets.length; i++) {
+        targets[i].addEventListener(event_type, test_event, true);
+        targets[i].addEventListener(event_type, test_event, false);
+    }
+
+    var evt = document.createEvent("Event");
+    evt.initEvent(event_type, true, true);
+
+    target.dispatchEvent(evt);
+
+    assert_array_equals(actual_targets, expected_targets, "targets");
+    assert_array_equals(actual_phases, phases, "phases");
+}
+
+var phasesForDocumentChain = [
+    Event.CAPTURING_PHASE,
+    Event.CAPTURING_PHASE,
+    Event.CAPTURING_PHASE,
+    Event.CAPTURING_PHASE,
+    Event.CAPTURING_PHASE,
+    Event.CAPTURING_PHASE,
+    Event.AT_TARGET,
+    Event.AT_TARGET,
+    Event.BUBBLING_PHASE,
+    Event.BUBBLING_PHASE,
+    Event.BUBBLING_PHASE,
+    Event.BUBBLING_PHASE,
+    Event.BUBBLING_PHASE,
+    Event.BUBBLING_PHASE,
+];
+
+test(function () {
+    var chainWithWindow = [window].concat(targetsForDocumentChain(document));
+    var phases = [Event.CAPTURING_PHASE].concat(phasesForDocumentChain, Event.BUBBLING_PHASE);
+    testChain(document, chainWithWindow, phases, "click");
+}, "In window.document with click event");
+
+test(function () {
+    testChain(document, targetsForDocumentChain(document), phasesForDocumentChain, "load");
+}, "In window.document with load event")
+
+test(function () {
+    var documentClone = document.cloneNode(true);
+    testChain(
+        documentClone, targetsForDocumentChain(documentClone), phasesForDocumentChain, "click");
+}, "In window.document.cloneNode(true)");
+
+test(function () {
+    var newDocument = new Document();
+    newDocument.appendChild(document.documentElement.cloneNode(true));
+    testChain(
+        newDocument, targetsForDocumentChain(newDocument), phasesForDocumentChain, "click");
+}, "In new Document()");
+
+test(function () {
+    var HTMLDocument = document.implementation.createHTMLDocument();
+    HTMLDocument.body.appendChild(document.getElementById("table").cloneNode(true));
+    testChain(
+        HTMLDocument, targetsForDocumentChain(HTMLDocument), phasesForDocumentChain, "click");
+}, "In DOMImplementation.createHTMLDocument()");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-detached-click-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-detached-click-expected.txt
new file mode 100644
index 0000000..0cb57ef
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-detached-click-expected.txt
@@ -0,0 +1,4 @@
+
+PASS Click event on an element not in the document 
+PASS Click event can be dispatched to an element that is not in the document. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-detached-click.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-detached-click.html
new file mode 100644
index 0000000..30e15b8
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-detached-click.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<title>Click event on an element not in the document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+  var EVENT = "click";
+  var TARGET = document.createElement("somerandomelement");
+  var t = async_test("Click event can be dispatched to an element that is not in the document.")
+  TARGET.addEventListener(EVENT, t.step_func(function(evt) {
+    assert_equals(evt.target, TARGET);
+    t.done();
+  }), true);
+  var e = document.createEvent("Event");
+  e.initEvent(EVENT, true, true);
+  TARGET.dispatchEvent(e);
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation-expected.txt
new file mode 100644
index 0000000..a0d8b83
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation-expected.txt
@@ -0,0 +1,3 @@
+
+FAIL  Multiple dispatchEvent() and stopPropagation()  assert_array_equals: lengths differ, expected 1 got 0
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation.html
new file mode 100644
index 0000000..72644bd
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title> Multiple dispatchEvent() and stopPropagation() </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id=log></div>
+
+<div id="parent" style="display: none">
+    <input id="target" type="hidden" value=""/>
+</div>
+
+<script>
+test(function() {
+    var event_type = "foo";
+    var target = document.getElementById("target");
+    var parent = document.getElementById("parent");
+    var actual_result;
+    var test_event = function(evt) {
+        actual_result.push(evt.currentTarget);
+
+        if (parent == evt.currentTarget) {
+            evt.stopPropagation();
+        }
+    };
+
+    var evt = document.createEvent("Event");
+    evt.initEvent(event_type, true, true);
+
+    target.addEventListener(event_type, test_event, false);
+    parent.addEventListener(event_type, test_event, false);
+    document.addEventListener(event_type, test_event, false);
+    window.addEventListener(event_type, test_event, false);
+
+    actual_result = [];
+    target.dispatchEvent(evt);
+    assert_array_equals(actual_result, [target, parent]);
+
+    actual_result = [];
+    parent.dispatchEvent(evt);
+    assert_array_equals(actual_result, [parent]);
+
+    actual_result = [];
+    document.dispatchEvent(evt);
+    assert_array_equals(actual_result, [document, window]);
+});
+</script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-order-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-order-expected.txt
new file mode 100644
index 0000000..3b79ba6
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-order-expected.txt
@@ -0,0 +1,3 @@
+
+PASS Event phases order 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-order.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-order.html
new file mode 100644
index 0000000..ca94434
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-order.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<title>Event phases order</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+async_test(function() {
+    document.addEventListener('DOMContentLoaded', this.step_func_done(function() {
+        var parent = document.getElementById('parent');
+        var child = document.getElementById('child');
+
+        var order = [];
+
+        parent.addEventListener('click', this.step_func(function(){ order.push(1) }), true);
+        child.addEventListener('click', this.step_func(function(){ order.push(2) }), false);
+        parent.addEventListener('click', this.step_func(function(){ order.push(3) }), false);
+
+        child.dispatchEvent(new Event('click', {bubbles: true}));
+
+        assert_array_equals(order, [1, 2, 3]);
+    }));
+}, "Event phases order");
+</script>
+<div id="parent">
+    <div id="child"></div>
+</div>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-throwing-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-throwing-expected.txt
new file mode 100644
index 0000000..30c3be6
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-throwing-expected.txt
@@ -0,0 +1,6 @@
+CONSOLE MESSAGE: line 20: Error: Error from only listener
+CONSOLE MESSAGE: line 40: Error: Error from first listener
+
+PASS Throwing in event listener with a single listeners 
+PASS Throwing in event listener with multiple listeners 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-throwing.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-throwing.html
new file mode 100644
index 0000000..7d1c0d9
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-throwing.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<title>Throwing in event listeners</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+setup({allow_uncaught_exception:true})
+
+test(function() {
+    var errorEvents = 0;
+    window.onerror = this.step_func(function(e) {
+        assert_equals(typeof e, 'string');
+        ++errorEvents;
+    });
+
+    var element = document.createElement('div');
+
+    element.addEventListener('click', function() {
+        throw new Error('Error from only listener');
+    });
+
+    element.dispatchEvent(new Event('click'));
+
+    assert_equals(errorEvents, 1);
+}, "Throwing in event listener with a single listeners");
+
+test(function() {
+    var errorEvents = 0;
+    window.onerror = this.step_func(function(e) {
+        assert_equals(typeof e, 'string');
+        ++errorEvents;
+    });
+
+    var element = document.createElement('div');
+
+    var secondCalled = false;
+
+    element.addEventListener('click', function() {
+        throw new Error('Error from first listener');
+    });
+    element.addEventListener('click', this.step_func(function() {
+        secondCalled = true;
+    }), false);
+
+    element.dispatchEvent(new Event('click'));
+
+    assert_equals(errorEvents, 1);
+    assert_true(secondCalled);
+}, "Throwing in event listener with multiple listeners");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-init-while-dispatching-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-init-while-dispatching-expected.txt
new file mode 100644
index 0000000..24d40a9
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-init-while-dispatching-expected.txt
@@ -0,0 +1,7 @@
+
+FAIL Calling initKeyboardEvent while dispatching. assert_equals: initKeyboardEvent key setter should short-circuit expected (string) "A" but got (undefined) undefined
+PASS Calling initMouseEvent while dispatching. 
+PASS Calling initCustomEvent while dispatching. 
+PASS Calling initUIEvent while dispatching. 
+PASS Calling initEvent while dispatching. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-init-while-dispatching.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-init-while-dispatching.html
new file mode 100644
index 0000000..2aa1f67
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-init-while-dispatching.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Re-initializing events while dispatching them</title>
+<link rel="author" title="Josh Matthews" href="mailto:josh@joshmatthews.net">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var events = {
+  'KeyboardEvent': {
+    'constructor': function() { return new KeyboardEvent("type", {key: "A"}); },
+    'init': function(ev) { ev.initKeyboardEvent("type2", true, true, null, "a", 1, "", true, "") },
+    'check': function(ev) {
+       assert_equals(ev.key, "A", "initKeyboardEvent key setter should short-circuit");
+       assert_false(ev.repeat, "initKeyboardEvent repeat setter should short-circuit");
+       assert_equals(ev.location, 0, "initKeyboardEvent location setter should short-circuit");
+     }
+  },
+  'MouseEvent': {
+    'constructor': function() { return new MouseEvent("type"); },
+    'init': function(ev) { ev.initMouseEvent("type2", true, true, null, 0, 1, 1, 1, 1, true, true, true, true, 1, null) },
+    'check': function(ev) {
+      assert_equals(ev.screenX, 0, "initMouseEvent screenX setter should short-circuit");
+      assert_equals(ev.screenY, 0, "initMouseEvent screenY setter should short-circuit");
+      assert_equals(ev.clientX, 0, "initMouseEvent clientX setter should short-circuit");
+      assert_equals(ev.clientY, 0, "initMouseEvent clientY setter should short-circuit");
+      assert_false(ev.ctrlKey, "initMouseEvent ctrlKey setter should short-circuit");
+      assert_false(ev.altKey, "initMouseEvent altKey setter should short-circuit");
+      assert_false(ev.shiftKey, "initMouseEvent shiftKey setter should short-circuit");
+      assert_false(ev.metaKey, "initMouseEvent metaKey setter should short-circuit");
+      assert_equals(ev.button, 0, "initMouseEvent button setter should short-circuit");
+    }
+  },
+  'CustomEvent': {
+    'constructor': function() { return new CustomEvent("type") },
+    'init': function(ev) { ev.initCustomEvent("type2", true, true, 1) },
+    'check': function(ev) {
+      assert_equals(ev.detail, null, "initCustomEvent detail setter should short-circuit");
+    }
+  },
+  'UIEvent': {
+    'constructor': function() { return new UIEvent("type") },
+    'init': function(ev) { ev.initUIEvent("type2", true, true, window, 1) },
+    'check': function(ev) {
+      assert_equals(ev.view, null, "initUIEvent view setter should short-circuit");
+      assert_equals(ev.detail, 0, "initUIEvent detail setter should short-circuit");
+    }
+  },
+  'Event': {
+    'constructor': function() { return new Event("type") },
+    'init': function(ev) { ev.initEvent("type2", true, true) },
+    'check': function(ev) {
+      assert_equals(ev.bubbles, false, "initEvent bubbles setter should short-circuit");
+      assert_equals(ev.cancelable, false, "initEvent cancelable setter should short-circuit");
+      assert_equals(ev.type, "type", "initEvent type setter should short-circuit");
+    }
+  }
+};
+
+var names = Object.keys(events);
+for (var i = 0; i < names.length; i++) {
+  var t = async_test("Calling init" + names[i] + " while dispatching.");
+  t.step(function() {
+    var e = events[names[i]].constructor();
+
+    var target = document.createElement("div")
+    target.addEventListener("type", t.step_func(function() {
+      events[names[i]].init(e);
+
+      var o = e;
+      while ((o = Object.getPrototypeOf(o))) {
+        if (!(o.constructor.name in events)) {
+          break;
+        }
+        events[o.constructor.name].check(e);
+      }
+    }), false);
+
+    assert_equals(target.dispatchEvent(e), true, "dispatchEvent must return true")
+  });
+  t.done();
+}
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt
new file mode 100644
index 0000000..7f19ad1
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt
@@ -0,0 +1,47 @@
+
+PASS Event constructor (no argument) 
+PASS Event constructor (undefined argument) 
+PASS Event constructor (null argument) 
+PASS Event constructor (empty argument) 
+PASS Event constructor (argument with default values) 
+PASS Event constructor (argument with non-default values) 
+PASS UIEvent constructor (no argument) 
+PASS UIEvent constructor (undefined argument) 
+PASS UIEvent constructor (null argument) 
+PASS UIEvent constructor (empty argument) 
+PASS UIEvent constructor (argument with default values) 
+PASS UIEvent constructor (argument with non-default values) 
+PASS FocusEvent constructor (no argument) 
+PASS FocusEvent constructor (undefined argument) 
+PASS FocusEvent constructor (null argument) 
+PASS FocusEvent constructor (empty argument) 
+PASS FocusEvent constructor (argument with default values) 
+PASS FocusEvent constructor (argument with non-default values) 
+FAIL MouseEvent constructor (no argument) assert_true: Event object "[object MouseEvent]" should have a buttons property expected true got false
+FAIL MouseEvent constructor (undefined argument) assert_true: Event object "[object MouseEvent]" should have a buttons property expected true got false
+FAIL MouseEvent constructor (null argument) assert_true: Event object "[object MouseEvent]" should have a buttons property expected true got false
+FAIL MouseEvent constructor (empty argument) assert_true: Event object "[object MouseEvent]" should have a buttons property expected true got false
+FAIL MouseEvent constructor (argument with default values) assert_true: Event object "[object MouseEvent]" should have a buttons property expected true got false
+FAIL MouseEvent constructor (argument with non-default values) assert_true: Event object "[object MouseEvent]" should have a buttons property expected true got false
+FAIL WheelEvent constructor (no argument) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
+FAIL WheelEvent constructor (undefined argument) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
+FAIL WheelEvent constructor (null argument) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
+FAIL WheelEvent constructor (empty argument) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
+FAIL WheelEvent constructor (argument with default values) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
+FAIL WheelEvent constructor (argument with non-default values) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
+FAIL KeyboardEvent constructor (no argument) assert_true: Event object "[object KeyboardEvent]" should have a key property expected true got false
+FAIL KeyboardEvent constructor (undefined argument) assert_true: Event object "[object KeyboardEvent]" should have a key property expected true got false
+FAIL KeyboardEvent constructor (null argument) assert_true: Event object "[object KeyboardEvent]" should have a key property expected true got false
+FAIL KeyboardEvent constructor (empty argument) assert_true: Event object "[object KeyboardEvent]" should have a key property expected true got false
+FAIL KeyboardEvent constructor (argument with default values) assert_true: Event object "[object KeyboardEvent]" should have a key property expected true got false
+FAIL KeyboardEvent constructor (argument with non-default values) assert_true: Event object "[object KeyboardEvent]" should have a key property expected true got false
+PASS CompositionEvent constructor (no argument) 
+PASS CompositionEvent constructor (undefined argument) 
+PASS CompositionEvent constructor (null argument) 
+PASS CompositionEvent constructor (empty argument) 
+PASS CompositionEvent constructor (argument with default values) 
+PASS CompositionEvent constructor (argument with non-default values) 
+FAIL UIEvent constructor (view argument with wrong type) assert_throws: function "function () {
+    new UIEvent("x", { view: 7 })
+  }" did not throw
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors.html
new file mode 100644
index 0000000..1741b96
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors.html
@@ -0,0 +1,153 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Event constructors</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+function assert_props(iface, event, defaults) {
+  assert_true(event instanceof self[iface]);
+  expected[iface].properties.forEach(function(p) {
+    var property = p[0], value = p[defaults ? 1 : 2];
+    assert_true(property in event,
+                "Event " + format_value(event) + " should have a " +
+                property + " property");
+    assert_equals(event[property], value,
+                  "The value of the " + property + " property should be " +
+                  format_value(value));
+  });
+  if ("parent" in expected[iface]) {
+    assert_props(expected[iface].parent, event, defaults);
+  }
+}
+
+var EventModifierInit = [
+  ["ctrlKey", false, true],
+  ["shiftKey", false, true],
+  ["altKey", false, true],
+  ["metaKey", false, true],
+];
+var expected = {
+  "Event": {
+    "properties": [
+      ["bubbles", false, true],
+      ["cancelable", false, true],
+    ],
+  },
+
+  "UIEvent": {
+    "parent": "Event",
+    "properties": [
+      ["view", null, window],
+      ["detail", 0, 7],
+    ],
+  },
+
+  "FocusEvent": {
+    "parent": "UIEvent",
+    "properties": [
+      ["relatedTarget", null, document],
+    ],
+  },
+
+  "MouseEvent": {
+    "parent": "UIEvent",
+    "properties": EventModifierInit.concat([
+      ["screenX", 0, 40],
+      ["screenY", 0, 40],
+      ["clientX", 0, 40],
+      ["clientY", 0, 40],
+      ["button", 0, 40],
+      ["buttons", 0, 40],
+      ["relatedTarget", null, document],
+    ]),
+  },
+
+  "WheelEvent": {
+    "parent": "MouseEvent",
+    "properties": [
+      ["deltaX", 0.0, 3.1],
+      ["deltaY", 0.0, 3.1],
+      ["deltaZ", 0.0, 3.1],
+      ["deltaMode", 0, 40],
+    ],
+  },
+
+  "KeyboardEvent": {
+    "parent": "UIEvent",
+    "properties": EventModifierInit.concat([
+      ["key", "", "string"],
+      ["code", "", "string"],
+      ["location", 0, 7],
+      ["repeat", false, true],
+      ["isComposing", false, true],
+      ["charCode", 0, 7],
+      ["keyCode", 0, 7],
+      ["which", 0, 7],
+    ]),
+  },
+
+  "CompositionEvent": {
+    "parent": "UIEvent",
+    "properties": [
+      ["data", "", "string"],
+    ],
+  },
+};
+
+Object.keys(expected).forEach(function(iface) {
+  test(function() {
+    var event = new self[iface]("type");
+    assert_props(iface, event, true);
+  }, iface + " constructor (no argument)");
+
+  test(function() {
+    var event = new self[iface]("type", undefined);
+    assert_props(iface, event, true);
+  }, iface + " constructor (undefined argument)");
+
+  test(function() {
+    var event = new self[iface]("type", null);
+    assert_props(iface, event, true);
+  }, iface + " constructor (null argument)");
+
+  test(function() {
+    var event = new self[iface]("type", {});
+    assert_props(iface, event, true);
+  }, iface + " constructor (empty argument)");
+
+  test(function() {
+    var dictionary = {};
+    expected[iface].properties.forEach(function(p) {
+      var property = p[0], value = p[1];
+      dictionary[property] = value;
+    });
+    var event = new self[iface]("type", dictionary);
+    assert_props(iface, event, true);
+  }, iface + " constructor (argument with default values)");
+
+  test(function() {
+    function fill_in(iface, dictionary) {
+      if ("parent" in expected[iface]) {
+        fill_in(expected[iface].parent, dictionary)
+      }
+      expected[iface].properties.forEach(function(p) {
+        var property = p[0], value = p[2];
+        dictionary[property] = value;
+      });
+    }
+
+    var dictionary = {};
+    fill_in(iface, dictionary);
+
+    var event = new self[iface]("type", dictionary);
+    assert_props(iface, event, false);
+  }, iface + " constructor (argument with non-default values)");
+});
+
+test(function () {
+  assert_throws(new TypeError(), function() {
+    new UIEvent("x", { view: 7 })
+  });
+}, "UIEvent constructor (view argument with wrong type)")
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent-expected.txt
new file mode 100644
index 0000000..5ddbb7d
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent-expected.txt
@@ -0,0 +1,3 @@
+
+PASS EventListener::handleEvent() 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent.html
new file mode 100644
index 0000000..3b58c49
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>EventListener::handleEvent()</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<table id="table" border="1" style="display: none">
+    <tbody id="table-body">
+    <tr id="table-row">
+        <td id="table-cell">Shady Grove</td>
+        <td>Aeolian</td>
+    </tr>
+    <tr id="parent">
+        <td id="target">Over the river, Charlie</td>
+        <td>Dorian</td>
+    </tr>
+    </tbody>
+</table>
+<script>
+test(function(t) {
+    var event = "foo";
+    var target = document.getElementById("target");
+
+    var event_listener = {
+        "handleEvent": function(evt) {
+            var that = this;
+            t.step(function() {
+                assert_equals(evt.type, event);
+                assert_equals(evt.target, target);
+                assert_equals(that, event_listener);
+            });
+        }
+    };
+
+    var evt = document.createEvent("Event");
+    evt.initEvent(event, true, true);
+
+    target.addEventListener(event, event_listener, true);
+    target.dispatchEvent(evt);
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-1.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-1.sub-expected.txt
new file mode 100644
index 0000000..0713275
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-1.sub-expected.txt
@@ -0,0 +1,7 @@
+Blocked access to external URL http://www1.localhost:8800/dom/events/EventListener-incumbent-global-subframe-1.sub.html
+
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT Check the incumbent global EventListeners  are called with Test timed out
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-1.sub.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-1.sub.html
new file mode 100644
index 0000000..9d94138
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-1.sub.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<meta charset=utf-8>
+<title></title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<iframe src="{{location[scheme]}}://{{domains[www1]}}:{{ports[http][0]}}{{location[path]}}/../EventListener-incumbent-global-subframe-1.sub.html"></iframe>
+<script>
+
+var t = async_test("Check the incumbent global EventListeners  are called with");
+
+onload = t.step_func(function() {
+  onmessage = t.step_func_done(function(e) {
+    var d = e.data;
+    assert_equals(d.actual, d.expected, d.reason);
+  });
+
+  frames[0].postMessage("start", "*");
+});
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-2.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-2.sub-expected.txt
new file mode 100644
index 0000000..8efac09
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-2.sub-expected.txt
@@ -0,0 +1,7 @@
+Blocked access to external URL http://www1.localhost:8800/dom/events/EventListener-incumbent-global-subframe-2.sub.html
+
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT Check the incumbent global EventListeners  are called with Test timed out
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-2.sub.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-2.sub.html
new file mode 100644
index 0000000..4433c09
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-2.sub.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<meta charset=utf-8>
+<title></title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<iframe src="{{location[scheme]}}://{{domains[www1]}}:{{ports[http][0]}}{{location[path]}}/../EventListener-incumbent-global-subframe-2.sub.html"></iframe>
+<script>
+
+var t = async_test("Check the incumbent global EventListeners  are called with");
+
+onload = t.step_func(function() {
+  onmessage = t.step_func_done(function(e) {
+    var d = e.data;
+    assert_equals(d.actual, d.expected, d.reason);
+  });
+
+  frames[0].postMessage("start", "*");
+});
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html
new file mode 100644
index 0000000..25487cc
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<iframe src="{{location[scheme]}}://{{domains[www2]}}:{{ports[http][0]}}{{location[path]}}/../EventListener-incumbent-global-subsubframe.sub.html"></iframe>
+<script>
+  document.domain = "{{host}}";
+  onmessage = function(e) {
+    if (e.data == "start") {
+      frames[0].document.body.addEventListener("click", frames[0].postMessage.bind(frames[0], "respond", "*", undefined));
+      frames[0].postMessage("sendclick", "*");
+    } else {
+      parent.postMessage(e.data, "*");
+    }
+  }
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html
new file mode 100644
index 0000000..9c7235e
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<iframe src="{{location[scheme]}}://{{domains[www2]}}:{{ports[http][0]}}{{location[path]}}/../EventListener-incumbent-global-subsubframe.sub.html"></iframe>
+<script>
+  document.domain = "{{host}}";
+  onmessage = function(e) {
+    if (e.data == "start") {
+      frames[0].document.body.addEventListener("click", frames[0].getTheListener());
+      frames[0].postMessage("sendclick", "*");
+    } else {
+      parent.postMessage(e.data, "*");
+    }
+  }
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html
new file mode 100644
index 0000000..9ce9f21
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<script>
+  function getTheListener() {
+    return postMessage.bind(this, "respond", "*", undefined)
+  }
+  document.domain = "{{host}}";
+  onmessage = function (e) {
+    if (e.data == "sendclick") {
+      document.body.click();
+    } else {
+      parent.postMessage(
+        {
+          actual: e.origin,
+          expected: "{{location[scheme]}}://{{domains[www1]}}:{{ports[http][0]}}",
+          reason: "Incumbent should have been the caller of addEventListener()"
+        },
+        "*")
+    };
+  }
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes-expected.txt
new file mode 100644
index 0000000..f56c792
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes-expected.txt
@@ -0,0 +1,212 @@
+
+PASS a.classList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS area.classList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS link.classList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS iframe.classList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS output.classList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS td.classList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS th.classList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS a.classList in http://www.w3.org/2000/svg namespace should be DOMTokenList. 
+PASS area.classList in http://www.w3.org/2000/svg namespace should be DOMTokenList. 
+PASS link.classList in http://www.w3.org/2000/svg namespace should be DOMTokenList. 
+PASS iframe.classList in http://www.w3.org/2000/svg namespace should be DOMTokenList. 
+PASS output.classList in http://www.w3.org/2000/svg namespace should be DOMTokenList. 
+PASS td.classList in http://www.w3.org/2000/svg namespace should be DOMTokenList. 
+PASS th.classList in http://www.w3.org/2000/svg namespace should be DOMTokenList. 
+PASS a.classList in http://www.w3.org/1998/Math/MathML namespace should be DOMTokenList. 
+PASS area.classList in http://www.w3.org/1998/Math/MathML namespace should be DOMTokenList. 
+PASS link.classList in http://www.w3.org/1998/Math/MathML namespace should be DOMTokenList. 
+PASS iframe.classList in http://www.w3.org/1998/Math/MathML namespace should be DOMTokenList. 
+PASS output.classList in http://www.w3.org/1998/Math/MathML namespace should be DOMTokenList. 
+PASS td.classList in http://www.w3.org/1998/Math/MathML namespace should be DOMTokenList. 
+PASS th.classList in http://www.w3.org/1998/Math/MathML namespace should be DOMTokenList. 
+PASS a.classList in http://example.com/ namespace should be DOMTokenList. 
+PASS area.classList in http://example.com/ namespace should be DOMTokenList. 
+PASS link.classList in http://example.com/ namespace should be DOMTokenList. 
+PASS iframe.classList in http://example.com/ namespace should be DOMTokenList. 
+PASS output.classList in http://example.com/ namespace should be DOMTokenList. 
+PASS td.classList in http://example.com/ namespace should be DOMTokenList. 
+PASS th.classList in http://example.com/ namespace should be DOMTokenList. 
+PASS a.classList in null namespace should be DOMTokenList. 
+PASS area.classList in null namespace should be DOMTokenList. 
+PASS link.classList in null namespace should be DOMTokenList. 
+PASS iframe.classList in null namespace should be DOMTokenList. 
+PASS output.classList in null namespace should be DOMTokenList. 
+PASS td.classList in null namespace should be DOMTokenList. 
+PASS th.classList in null namespace should be DOMTokenList. 
+FAIL a.dropzone in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. assert_equals: expected "[object DOMTokenList]" but got "[object Undefined]"
+FAIL area.dropzone in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. assert_equals: expected "[object DOMTokenList]" but got "[object Undefined]"
+FAIL link.dropzone in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. assert_equals: expected "[object DOMTokenList]" but got "[object Undefined]"
+FAIL iframe.dropzone in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. assert_equals: expected "[object DOMTokenList]" but got "[object Undefined]"
+FAIL output.dropzone in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. assert_equals: expected "[object DOMTokenList]" but got "[object Undefined]"
+FAIL td.dropzone in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. assert_equals: expected "[object DOMTokenList]" but got "[object Undefined]"
+FAIL th.dropzone in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. assert_equals: expected "[object DOMTokenList]" but got "[object Undefined]"
+PASS a.dropzone in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS area.dropzone in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS link.dropzone in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS iframe.dropzone in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS output.dropzone in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS td.dropzone in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS th.dropzone in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS a.dropzone in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS area.dropzone in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS link.dropzone in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS iframe.dropzone in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS output.dropzone in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS td.dropzone in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS th.dropzone in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS a.dropzone in http://example.com/ namespace should be undefined. 
+PASS area.dropzone in http://example.com/ namespace should be undefined. 
+PASS link.dropzone in http://example.com/ namespace should be undefined. 
+PASS iframe.dropzone in http://example.com/ namespace should be undefined. 
+PASS output.dropzone in http://example.com/ namespace should be undefined. 
+PASS td.dropzone in http://example.com/ namespace should be undefined. 
+PASS th.dropzone in http://example.com/ namespace should be undefined. 
+PASS a.dropzone in null namespace should be undefined. 
+PASS area.dropzone in null namespace should be undefined. 
+PASS link.dropzone in null namespace should be undefined. 
+PASS iframe.dropzone in null namespace should be undefined. 
+PASS output.dropzone in null namespace should be undefined. 
+PASS td.dropzone in null namespace should be undefined. 
+PASS th.dropzone in null namespace should be undefined. 
+PASS a.htmlFor in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS area.htmlFor in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS link.htmlFor in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS iframe.htmlFor in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS output.htmlFor in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS td.htmlFor in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS th.htmlFor in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS a.htmlFor in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS area.htmlFor in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS link.htmlFor in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS iframe.htmlFor in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS output.htmlFor in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS td.htmlFor in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS th.htmlFor in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS a.htmlFor in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS area.htmlFor in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS link.htmlFor in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS iframe.htmlFor in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS output.htmlFor in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS td.htmlFor in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS th.htmlFor in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS a.htmlFor in http://example.com/ namespace should be undefined. 
+PASS area.htmlFor in http://example.com/ namespace should be undefined. 
+PASS link.htmlFor in http://example.com/ namespace should be undefined. 
+PASS iframe.htmlFor in http://example.com/ namespace should be undefined. 
+PASS output.htmlFor in http://example.com/ namespace should be undefined. 
+PASS td.htmlFor in http://example.com/ namespace should be undefined. 
+PASS th.htmlFor in http://example.com/ namespace should be undefined. 
+PASS a.htmlFor in null namespace should be undefined. 
+PASS area.htmlFor in null namespace should be undefined. 
+PASS link.htmlFor in null namespace should be undefined. 
+PASS iframe.htmlFor in null namespace should be undefined. 
+PASS output.htmlFor in null namespace should be undefined. 
+PASS td.htmlFor in null namespace should be undefined. 
+PASS th.htmlFor in null namespace should be undefined. 
+PASS a.relList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS area.relList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS link.relList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS iframe.relList in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS output.relList in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS td.relList in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS th.relList in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS a.relList in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS area.relList in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS link.relList in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS iframe.relList in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS output.relList in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS td.relList in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS th.relList in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS a.relList in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS area.relList in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS link.relList in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS iframe.relList in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS output.relList in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS td.relList in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS th.relList in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS a.relList in http://example.com/ namespace should be undefined. 
+PASS area.relList in http://example.com/ namespace should be undefined. 
+PASS link.relList in http://example.com/ namespace should be undefined. 
+PASS iframe.relList in http://example.com/ namespace should be undefined. 
+PASS output.relList in http://example.com/ namespace should be undefined. 
+PASS td.relList in http://example.com/ namespace should be undefined. 
+PASS th.relList in http://example.com/ namespace should be undefined. 
+PASS a.relList in null namespace should be undefined. 
+PASS area.relList in null namespace should be undefined. 
+PASS link.relList in null namespace should be undefined. 
+PASS iframe.relList in null namespace should be undefined. 
+PASS output.relList in null namespace should be undefined. 
+PASS td.relList in null namespace should be undefined. 
+PASS th.relList in null namespace should be undefined. 
+PASS a.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS area.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS link.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS iframe.sandbox in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS output.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS td.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS th.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS a.sandbox in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS area.sandbox in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS link.sandbox in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS iframe.sandbox in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS output.sandbox in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS td.sandbox in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS th.sandbox in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS a.sandbox in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS area.sandbox in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS link.sandbox in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS iframe.sandbox in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS output.sandbox in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS td.sandbox in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS th.sandbox in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS a.sandbox in http://example.com/ namespace should be undefined. 
+PASS area.sandbox in http://example.com/ namespace should be undefined. 
+PASS link.sandbox in http://example.com/ namespace should be undefined. 
+PASS iframe.sandbox in http://example.com/ namespace should be undefined. 
+PASS output.sandbox in http://example.com/ namespace should be undefined. 
+PASS td.sandbox in http://example.com/ namespace should be undefined. 
+PASS th.sandbox in http://example.com/ namespace should be undefined. 
+PASS a.sandbox in null namespace should be undefined. 
+PASS area.sandbox in null namespace should be undefined. 
+PASS link.sandbox in null namespace should be undefined. 
+PASS iframe.sandbox in null namespace should be undefined. 
+PASS output.sandbox in null namespace should be undefined. 
+PASS td.sandbox in null namespace should be undefined. 
+PASS th.sandbox in null namespace should be undefined. 
+PASS a.sizes in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS area.sizes in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS link.sizes in http://www.w3.org/1999/xhtml namespace should be DOMTokenList. 
+PASS iframe.sizes in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS output.sizes in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS td.sizes in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS th.sizes in http://www.w3.org/1999/xhtml namespace should be undefined. 
+PASS a.sizes in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS area.sizes in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS link.sizes in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS iframe.sizes in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS output.sizes in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS td.sizes in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS th.sizes in http://www.w3.org/2000/svg namespace should be undefined. 
+PASS a.sizes in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS area.sizes in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS link.sizes in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS iframe.sizes in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS output.sizes in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS td.sizes in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS th.sizes in http://www.w3.org/1998/Math/MathML namespace should be undefined. 
+PASS a.sizes in http://example.com/ namespace should be undefined. 
+PASS area.sizes in http://example.com/ namespace should be undefined. 
+PASS link.sizes in http://example.com/ namespace should be undefined. 
+PASS iframe.sizes in http://example.com/ namespace should be undefined. 
+PASS output.sizes in http://example.com/ namespace should be undefined. 
+PASS td.sizes in http://example.com/ namespace should be undefined. 
+PASS th.sizes in http://example.com/ namespace should be undefined. 
+PASS a.sizes in null namespace should be undefined. 
+PASS area.sizes in null namespace should be undefined. 
+PASS link.sizes in null namespace should be undefined. 
+PASS iframe.sizes in null namespace should be undefined. 
+PASS output.sizes in null namespace should be undefined. 
+PASS td.sizes in null namespace should be undefined. 
+PASS th.sizes in null namespace should be undefined. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes.html b/LayoutTests/imported/w3c/web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes.html
new file mode 100644
index 0000000..880ce28
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>DOMTokenList coverage for attributes</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+"use strict";
+
+var pairs = [
+  // Defined in DOM
+  {attr: "classList", sup: ["anyElement"]},
+  // Defined in HTML
+  {attr: "dropzone", sup: ["anyHTMLElement"]},
+  {attr: "htmlFor", sup: ["output"]},
+  {attr: "relList", sup: ["a", "area", "link"]},
+  {attr: "sandbox", sup: ["iframe"]},
+  {attr: "sizes", sup: ["link"]}
+];
+var namespaces = [
+  "http://www.w3.org/1999/xhtml",
+  "http://www.w3.org/2000/svg",
+  "http://www.w3.org/1998/Math/MathML",
+  "http://example.com/",
+  ""
+];
+
+var elements = ["a", "area", "link", "iframe", "output", "td", "th"];
+function testAttr(pair, new_el){
+  return (pair.attr === "classList" || (new_el.namespaceURI === "http://www.w3.org/1999/xhtml" && (pair.attr === "dropzone" || pair.sup.indexOf(new_el.localName) != -1)));
+}
+
+pairs.forEach(function(pair) {
+  namespaces.forEach(function(ns) {
+    elements.forEach(function(el) {
+      var new_el = document.createElementNS(ns, el);
+      if (testAttr(pair, new_el)) {
+        test(function() {
+          assert_class_string(new_el[pair.attr], "DOMTokenList");
+        }, new_el.localName + "." + pair.attr + " in " + new_el.namespaceURI + " namespace should be DOMTokenList.");
+      }
+      else {
+        test(function() {
+          assert_equals(new_el[pair.attr], undefined);
+       }, new_el.localName + "." + pair.attr + " in " + new_el.namespaceURI + " namespace should be undefined.");
+      }
+    });
+  });
+});
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-namespace-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-namespace-expected.txt
index 28c2fd6..d41f7a4 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-namespace-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-namespace-expected.txt
@@ -10,10 +10,10 @@
 PASS Created element's namespace in created XML document by DOMParser ('application/xml') 
 PASS Created element's namespace in created XHTML document by DOMParser ('application/xhtml+xml') 
 PASS Created element's namespace in created SVG document by DOMParser ('image/svg+xml') 
-FAIL Created element's namespace in empty.html assert_equals: Wrong MIME type returned from doc.contentType expected "text/html" but got "application/json"
-FAIL Created element's namespace in empty.xhtml assert_equals: Wrong MIME type returned from doc.contentType expected "application/xhtml+xml" but got "application/json"
-FAIL Created element's namespace in empty.xml assert_equals: Wrong MIME type returned from doc.contentType expected "application/xml" but got "application/json"
-FAIL Created element's namespace in empty.svg assert_equals: Wrong MIME type returned from doc.contentType expected "image/svg+xml" but got "application/json"
+PASS Created element's namespace in empty.html 
+PASS Created element's namespace in empty.xhtml 
+PASS Created element's namespace in empty.xml 
+PASS Created element's namespace in empty.svg 
 PASS Created element's namespace in minimal_html.html 
 PASS Created element's namespace in minimal_html.xhtml 
 PASS Created element's namespace in minimal_html.xml 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ProcessingInstruction-escapes-1-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ProcessingInstruction-escapes-1-expected.txt
new file mode 100644
index 0000000..a0d2223
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ProcessingInstruction-escapes-1-expected.txt
@@ -0,0 +1,3 @@
+
+PASS ProcessingInstruction numeric escapes 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ProcessingInstruction-escapes-1.xhtml b/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ProcessingInstruction-escapes-1.xhtml
new file mode 100644
index 0000000..d629a84
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ProcessingInstruction-escapes-1.xhtml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="support/style.css" type="text/css"?>
+<?xml-stylesheet href="data:text/css,&#x41;&amp;&apos;" type="text/css"?>
+<?xml-stylesheet href="data:text/css,&#65;&amp;&apos;" type="text/css"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>ProcessingInstruction numeric escapes</title>
+<link rel="help" href="https://dom.spec.whatwg.org/#dom-processinginstruction-target"/>
+<link rel="help" href="https://dom.spec.whatwg.org/#dom-characterdata-data"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"/>
+<script>
+<![CDATA[
+test(function() {
+  var pienc = document.firstChild.nextSibling;
+  assert_true(pienc instanceof ProcessingInstruction)
+  assert_equals(pienc.target, "xml-stylesheet")
+  assert_equals(pienc.data, 'href="data:text/css,&#x41;&amp;&apos;" type="text/css"')
+  assert_equals(pienc.sheet.href, "data:text/css,A&'");
+
+  pienc = pienc.nextSibling;
+  assert_true(pienc instanceof ProcessingInstruction)
+  assert_equals(pienc.target, "xml-stylesheet")
+  assert_equals(pienc.data, 'href="data:text/css,&#65;&amp;&apos;" type="text/css"')
+  assert_equals(pienc.sheet.href, "data:text/css,A&'");
+})
+]]>
+</script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/DOMParser-parseFromString-html-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/domparsing/DOMParser-parseFromString-html-expected.txt
index 47801e0..4e79a20 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/domparsing/DOMParser-parseFromString-html-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/DOMParser-parseFromString-html-expected.txt
@@ -5,6 +5,7 @@
 PASS inputEncoding 
 PASS charset 
 FAIL URL value assert_equals: The document must have a URL value equal to the URL of the active document. expected "http://localhost:8800/domparsing/DOMParser-parseFromString-html.html" but got "about:blank"
+FAIL baseURI value assert_equals: expected (string) "http://localhost:8800/domparsing/DOMParser-parseFromString-html.html" but got (object) null
 PASS Location value 
 PASS DOMParser parses HTML tag soup with no problems 
 PASS DOMParser throws on an invalid enum value 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/DOMParser-parseFromString-html.html b/LayoutTests/imported/w3c/web-platform-tests/domparsing/DOMParser-parseFromString-html.html
index 96c4a02..ec42442 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/domparsing/DOMParser-parseFromString-html.html
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/DOMParser-parseFromString-html.html
@@ -51,6 +51,10 @@
 }, 'URL value');
 
 test(function() {
+    assert_equals(doc.baseURI, document.URL);
+}, 'baseURI value');
+
+test(function() {
     assert_equals(doc.location, null,
                   'The document must have a location value of null.');
 }, 'Location value');
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/createContextualFragment-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/domparsing/createContextualFragment-expected.txt
new file mode 100644
index 0000000..20d6cca
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/createContextualFragment-expected.txt
@@ -0,0 +1,15 @@
+
+PASS Must not throw INVALID_STATE_ERR for a detached node. 
+FAIL Must throw TypeError when calling without arguments assert_throws: function "function () {
+                range.createContextualFragm..." did not throw
+PASS Simple test with paragraphs 
+PASS Don't auto-create <body> when applied to <html> 
+PASS <script>s should be run when appended to the document (but not before) 
+PASS <html> and <body> must work the same, 1 
+PASS <html> and <body> must work the same, 2 
+PASS Implicit <body> creation 
+FAIL Namespace generally shouldn't matter NotSupportedError: DOM Exception 9
+FAIL <html> in a different namespace shouldn't be special NotSupportedError: DOM Exception 9
+PASS null should be stringified 
+PASS undefined should be stringified 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/createContextualFragment.html b/LayoutTests/imported/w3c/web-platform-tests/domparsing/createContextualFragment.html
new file mode 100644
index 0000000..ce7d813
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/createContextualFragment.html
@@ -0,0 +1,131 @@
+<!doctype html>
+<title>createContextualFragment() tests</title>
+<div id=log></div>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+// We are not testing XML documents here, because apparently it's not clear
+// what we want to happen there.  We also aren't testing the HTML parser in any
+// depth, just some basic sanity checks.
+
+// Exception-throwing
+test(function() {
+        var range = document.createRange();
+        range.detach();
+        range.createContextualFragment("");
+}, "Must not throw INVALID_STATE_ERR for a detached node.");
+
+test(function() {
+        var range = document.createRange();
+        assert_throws(new TypeError(), function() {
+                range.createContextualFragment();
+        });
+}, "Must throw TypeError when calling without arguments");
+
+test(function() {
+        // Simple test
+        var range = document.createRange();
+        range.selectNodeContents(document.body);
+
+        var fragment = "<p CLaSs=testclass> Hi! <p>Hi!";
+        var expected = document.createDocumentFragment();
+        var tmpNode = document.createElement("p");
+        tmpNode.setAttribute("class", "testclass");
+        tmpNode.appendChild(document.createTextNode(" Hi! "));
+        expected.appendChild(tmpNode);
+
+        tmpNode = document.createElement("p");
+        tmpNode.appendChild(document.createTextNode("Hi!"));
+        expected.appendChild(tmpNode);
+
+        var result = range.createContextualFragment(fragment);
+        assert_true(expected.isEqualNode(result),
+                "Unexpected result (collapsed Range)");
+
+        // Token test that the end node makes no difference
+        range.setEnd(document.body.getElementsByTagName("script")[0], 0);
+        result = range.createContextualFragment(fragment);
+        assert_true(expected.isEqualNode(result),
+                "Unexpected result (Range ends in <script>)");
+}, "Simple test with paragraphs");
+
+test(function() {
+        // This test based on https://bugzilla.mozilla.org/show_bug.cgi?id=585819,
+        // from a real-world compat bug
+        var range = document.createRange();
+        range.selectNodeContents(document.documentElement);
+        var fragment = "<span>Hello world</span>";
+        var expected = document.createDocumentFragment();
+        var tmpNode = document.createElement("span");
+        tmpNode.appendChild(document.createTextNode("Hello world"));
+        expected.appendChild(tmpNode);
+
+        var result = range.createContextualFragment(fragment);
+        assert_true(expected.isEqualNode(result),
+                "Unexpected result (collapsed Range)");
+
+        // Another token test that the end node makes no difference
+        range.setEnd(document.head, 0);
+        result = range.createContextualFragment(fragment);
+        assert_true(expected.isEqualNode(result),
+                "Unexpected result (Range ends in <head>)");
+}, "Don't auto-create <body> when applied to <html>");
+
+// Scripts should be run if inserted (that's what the "Unmark all scripts
+// . . ." line means, I'm told)
+var passed = false;
+test(function() {
+        assert_false(passed, "Sanity check");
+        var range = document.createRange();
+        range.selectNodeContents(document.documentElement);
+        var fragment = range.createContextualFragment("<script>passed = true</s" + "cript>");
+        assert_false(passed, "Fragment created but not yet added to document, should not have run");
+        document.body.appendChild(fragment);
+        assert_true(passed, "Fragment created and added to document, should run");
+}, "<script>s should be run when appended to the document (but not before)");
+
+// Now that we've established basic sanity, let's do equivalence tests.  Those
+// are easier to write anyway.
+function testEquivalence(element1, fragment1, element2, fragment2) {
+        var range1 = element1.ownerDocument.createRange();
+        range1.selectNodeContents(element1);
+        var range2 = element2.ownerDocument.createRange();
+        range2.selectNodeContents(element2);
+
+        var result1 = range1.createContextualFragment(fragment1);
+        var result2 = range2.createContextualFragment(fragment2);
+
+        assert_true(result1.isEqualNode(result2), "Results are supposed to be equivalent");
+
+        // Throw in partial ownerDocument tests on the side, since the algorithm
+        // does specify that and we don't want to completely not test it.
+        if (result1.firstChild != null) {
+                assert_equals(result1.firstChild.ownerDocument, element1.ownerDocument,
+                        "ownerDocument must be set to that of the reference node");
+        }
+        if (result2.firstChild != null) {
+                assert_equals(result2.firstChild.ownerDocument, element2.ownerDocument,
+                        "ownerDocument must be set to that of the reference node");
+        }
+}
+
+var tests = [
+        ["<html> and <body> must work the same, 1", document.documentElement, "<span>Hello world</span>", document.body, "<span>Hello world</span>"],
+        ["<html> and <body> must work the same, 2", document.documentElement, "<body><p>Hello world", document.body, "<body><p>Hello world"],
+        ["Implicit <body> creation", document.documentElement, "<body><p>", document.documentElement, "<p>"],
+        ["Namespace generally shouldn't matter",
+                document.createElementNS("http://fake-namespace", "div"), "<body><p><span>Foo",
+                document.createElement("div"), "<body><p><span>Foo"],
+        ["<html> in a different namespace shouldn't be special",
+                document.createElementNS("http://fake-namespace", "html"), "<body><p>",
+                document.createElement("div"), "<body><p>"],
+        ["null should be stringified", document.createElement("span"), null, document.createElement("span"), "null"],
+        ["undefined should be stringified", document.createElement("span"), undefined, document.createElement("span"), "undefined"]/*,
+        // FIXME: Spec doesn't say what to do about non-Elements!
+        ["Text nodes?",
+                document.createTextNode("?"), "<span>",
+                document.createTextNode("?"), "<span>"]*/
+];
+
+generate_tests(testEquivalence, tests);
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-01-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-01-expected.txt
new file mode 100644
index 0000000..e7e220a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-01-expected.txt
@@ -0,0 +1,7 @@
+
+FAIL innerHTML in XHTML: getting while the document is in an invalid state assert_throws: getting element with ":" in its local name function "function () {
+    document.documentElement.innerHTML;
+  }" did not throw
+FAIL innerHTML in XHTML: getting while the document is in an invalid state 1 assert_throws: Getting a Text node whose data contains characters that are not matched by the XML Char production function "function () {
+    document.getElementsByTagName("title")[..." did not throw
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-01.xhtml b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-01.xhtml
new file mode 100644
index 0000000..432cfbf
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-01.xhtml
@@ -0,0 +1,28 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>innerHTML in XHTML: getting while the document is in an invalid state</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://w3c.github.io/DOM-Parsing/#widl-Element-innerHTML"/>
+<link rel="help" href="http://www.whatwg.org/html5/#xml-fragment-serialization-algorithm"/>
+<link rel="help" href="http://www.whatwg.org/html5/#document.title"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+test(function() {
+  document.documentElement.appendChild(document.createElement("test:test"));
+  assert_throws("INVALID_STATE_ERR", function() {
+    document.documentElement.innerHTML;
+  }, "getting element with \":\" in its local name");
+});
+test(function() {
+  document.title = "\f";
+  assert_throws("INVALID_STATE_ERR", function() {
+    document.getElementsByTagName("title")[0].innerHTML;
+  }, "Getting a Text node whose data contains characters that are not matched by the XML Char production");
+});
+</script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-03-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-03-expected.txt
new file mode 100644
index 0000000..aff1c82
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-03-expected.txt
@@ -0,0 +1,10 @@
+
+PASS innerHTML in XHTML 
+PASS innerHTML in XHTML 1 
+PASS innerHTML in XHTML 2 
+PASS innerHTML in XHTML 3 
+PASS innerHTML in XHTML 4 
+PASS innerHTML in XHTML 5 
+PASS innerHTML in XHTML 6 
+PASS innerHTML in XHTML 7 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-03.xhtml b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-03.xhtml
new file mode 100644
index 0000000..313531e
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-03.xhtml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>innerHTML in XHTML</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="http://html5.org/specs/dom-parsing.html#dom-innerhtml"/>
+<link rel="help" href="http://www.whatwg.org/html5/#xml-fragment-serialization-algorithm"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script><![CDATA[
+test(function() {
+  var el = document.createElement("div");
+  el.appendChild(document.createElement("xmp"))
+    .appendChild(document.createElement("span"))
+    .appendChild(document.createTextNode("<"));
+  assert_equals(el.innerHTML, "<xmp xmlns=\"http://www.w3.org/1999/xhtml\"><span>&lt;<\/span><\/xmp>");
+})
+test(function() {
+  var el = document.createElement("xmp");
+  el.appendChild(document.createElement("span"))
+    .appendChild(document.createTextNode("<"));
+  assert_equals(el.innerHTML, "<span xmlns=\"http://www.w3.org/1999/xhtml\">&lt;<\/span>");
+})
+test(function() {
+  var el = document.createElement("xmp");
+  el.appendChild(document.createTextNode("<"));
+  assert_equals(el.innerHTML, "&lt;");
+})
+test(function() {
+  var el = document.createElement("div");
+  el.appendChild(document.createElement("br"));
+  assert_equals(el.innerHTML, "<br xmlns=\"http://www.w3.org/1999/xhtml\" />");
+})
+test(function() {
+  var el = document.createElement("div");
+  el.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "html:br"));
+  assert_equals(el.innerHTML, "<html:br xmlns:html=\"http://www.w3.org/1999/xhtml\" />");
+})
+test(function() {
+  var el = document.createElement("div");
+  el.appendChild(document.createTextNode("<>\"'&"));
+  assert_equals(el.innerHTML, "&lt;&gt;\"'&amp;");
+})
+test(function() {
+  var el = document.createElement("div");
+  el.appendChild(document.createTextNode("&lt;&gt;&quot;&apos;&amp;"));
+  assert_equals(el.innerHTML, "&amp;lt;&amp;gt;&amp;quot;&amp;apos;&amp;amp;");
+})
+test(function() {
+  var el = document.createElement("div");
+  el.appendChild(document.createTextNode("àו…\u00A0"));
+  assert_equals(el.innerHTML, "àו…\u00A0");
+})
+]]></script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-04-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-04-expected.txt
new file mode 100644
index 0000000..d2f89bb
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-04-expected.txt
@@ -0,0 +1,3 @@
+
+PASS innerHTML should leave the removed children alone. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-04.html b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-04.html
new file mode 100644
index 0000000..32c921d
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-04.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<title>innerHTML in HTML</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://w3c.github.io/DOM-Parsing/#widl-Element-innerHTML">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+function testIsChild(p, c) {
+  assert_equals(p.firstChild, c);
+  assert_equals(c.parentNode, p);
+}
+test(function() {
+  var p = document.createElement('p');
+  var b = p.appendChild(document.createElement('b'));
+  var t = b.appendChild(document.createTextNode("foo"));
+  testIsChild(p, b);
+  testIsChild(b, t);
+  assert_equals(t.data, "foo");
+  p.innerHTML = "";
+  testIsChild(b, t);
+  assert_equals(t.data, "foo");
+}, "innerHTML should leave the removed children alone.")
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-05-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-05-expected.txt
new file mode 100644
index 0000000..d39a3e7
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-05-expected.txt
@@ -0,0 +1,6 @@
+CONSOLE MESSAGE: line 1380: Blocked a frame with origin "http://localhost:8800" from accessing a frame with origin "null".  The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "data". Protocols must match.
+
+
+
+FAIL innerHTML in XHTML undefined is not an object (evaluating 'window[0].document.documentElement')
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-05.xhtml b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-05.xhtml
new file mode 100644
index 0000000..da2d851
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-05.xhtml
@@ -0,0 +1,26 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>innerHTML in XHTML</title>
+<link rel="author" title="Simon Pieters" href="mailto:simonp@opera.com"/>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="http://html5.org/specs/dom-parsing.html#dom-innerhtml"/>
+<link rel="help" href="http://www.whatwg.org/html5/#xml-fragment-serialization-algorithm"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<iframe src="data:text/xml,&lt;html xmlns='http://www.w3.org/1999/xhtml'>&lt;foo--/>&lt;/html>"></iframe>
+<script><![CDATA[
+var t = async_test();
+window.onload = t.step_func(function() {
+  var foo = window[0].document.documentElement.firstChild;
+  assert_throws('SyntaxError', function() {
+    foo.innerHTML = 'x<\/foo--><\!--y';
+    // This is ridiculous.
+  });
+  t.done();
+});
+]]></script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-06-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-06-expected.txt
new file mode 100644
index 0000000..a1c784a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-06-expected.txt
@@ -0,0 +1,5 @@
+math in html: innerHTML
+
+
+PASS innerHTML defined on math. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-06.html b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-06.html
new file mode 100644
index 0000000..81e9c57
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-06.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>math in html: innerHTML</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<h1>math in html: innerHTML</h1>
+<div id="log"></div>
+<div style="display:none">
+<div id="d1"><math><mi>x</mi></math></div>
+</div>
+<script>
+test(function() {
+  var math = document.getElementById("d1").firstChild;
+  assert_equals(math.innerHTML, "<mi>x</mi>");
+},"innerHTML defined on math.");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-07-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-07-expected.txt
new file mode 100644
index 0000000..2ee1ed8
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-07-expected.txt
@@ -0,0 +1,7 @@
+
+PASS innerHTML and string conversion: null. 
+PASS innerHTML and string conversion: undefined. 
+PASS innerHTML and string conversion: number. 
+PASS innerHTML and string conversion: toString. 
+PASS innerHTML and string conversion: valueOf. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-07.html b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-07.html
new file mode 100644
index 0000000..9e313a2
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/innerhtml-07.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>innerHTML and string conversion</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+  var p = document.createElement("p");
+  p.innerHTML = null;
+  assert_equals(p.innerHTML, "");
+  assert_equals(p.textContent, "");
+}, "innerHTML and string conversion: null.")
+
+test(function() {
+  var p = document.createElement("p");
+  p.innerHTML = undefined;
+  assert_equals(p.innerHTML, "undefined");
+  assert_equals(p.textContent, "undefined");
+}, "innerHTML and string conversion: undefined.")
+
+test(function() {
+  var p = document.createElement("p");
+  p.innerHTML = 42;
+  assert_equals(p.innerHTML, "42");
+  assert_equals(p.textContent, "42");
+}, "innerHTML and string conversion: number.")
+
+test(function() {
+  var p = document.createElement("p");
+  p.innerHTML = {
+    toString: function() { return "pass"; },
+    valueOf: function() { return "fail"; }
+  };
+  assert_equals(p.innerHTML, "pass");
+  assert_equals(p.textContent, "pass");
+}, "innerHTML and string conversion: toString.")
+
+test(function() {
+  var p = document.createElement("p");
+  p.innerHTML = {
+    toString: undefined,
+    valueOf: function() { return "pass"; }
+  };
+  assert_equals(p.innerHTML, "pass");
+  assert_equals(p.textContent, "pass");
+}, "innerHTML and string conversion: valueOf.")
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/insert_adjacent_html-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/domparsing/insert_adjacent_html-expected.txt
new file mode 100644
index 0000000..2a204c7
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/insert_adjacent_html-expected.txt
@@ -0,0 +1,32 @@
+
+PASS beforeBegin content without next sibling 
+PASS Afterbegin content without next sibling 
+PASS BeforeEnd content without next sibling 
+PASS afterend content without next sibling 
+PASS beforeBegin content again, with next sibling 
+PASS Afterbegin content again, with next sibling 
+PASS BeforeEnd content again, with next sibling 
+PASS afterend content again, with next sibling 
+PASS Should throw when inserting with invalid position string 
+FAIL When the parent node is null, insertAdjacentHTML should throw for beforebegin and afterend (text) assert_throws: function "function () { element.insertAdjacentHTML("afterend", "") }" did not throw
+FAIL When the parent node is null, insertAdjacentHTML should throw for beforebegin and afterend (comments) assert_throws: function "function () { element.insertAdjacentHTML("afterend", "<!-..." did not throw
+FAIL When the parent node is null, insertAdjacentHTML should throw for beforebegin and afterend (elements) assert_throws: function "function () { element.insertAdjacentHTML("afterend", "<di..." did not throw
+PASS When the parent node is a document, insertAdjacentHTML should throw for beforebegin and afterend (text) 
+PASS When the parent node is a document, insertAdjacentHTML should throw for beforebegin and afterend (comments) 
+PASS When the parent node is a document, insertAdjacentHTML should throw for beforebegin and afterend (elements) 
+PASS Inserting after being and before end should order things correctly 
+PASS beforeBegin child node not in tree but has parent 
+PASS Afterbegin child node not in tree but has parent 
+PASS BeforeEnd child node not in tree but has parent 
+PASS afterend child node not in tree but has parent 
+PASS Should not run script when appending things which have descendant <script> inserted via insertAdjacentHTML 
+PASS beforeBegin content2 without next sibling 
+PASS Afterbegin content2 without next sibling 
+PASS BeforeEnd content2 without next sibling 
+PASS afterend content2 without next sibling 
+PASS beforeBegin content2 test again, now that there's a next sibling 
+PASS Afterbegin content2 test again, now that there's a next sibling 
+PASS BeforeEnd content2 test again, now that there's a next sibling 
+PASS afterend content2 test again, now that there's a next sibling 
+FAIL Inserting kids of the <html> element should not do weird things with implied <body>/<head> tags assert_equals: Should still have one head expected 1 but got 3
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/insert_adjacent_html.html b/LayoutTests/imported/w3c/web-platform-tests/domparsing/insert_adjacent_html.html
new file mode 100644
index 0000000..dfe624f
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/insert_adjacent_html.html
@@ -0,0 +1,94 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>insertAdjacentHTML in HTML</title>
+  <script src="/resources/testharness.js"></script>
+  <script src="/resources/testharnessreport.js"></script>
+  <script src="insert_adjacent_html.js"></script>
+</head>
+<body>
+<p id="display"></p><div id="content" style="display: none"></div><div id="content2" style="display: none"></div>
+<script>
+var script_ran = false;
+
+function testPositions(node, testDesc) {
+  test(function() {
+    script_ran = false;
+    node.insertAdjacentHTML("beforeBegin", "\u003Cscript>script_ran = true;\u003C/script><i></i>");
+    assert_equals(node.previousSibling.localName, "i", "Should have had <i> as previous sibling");
+    assert_equals(node.previousSibling.previousSibling.localName, "script", "Should have had <script> as second previous child");
+    assert_false(script_ran, "script should not have run");
+  }, "beforeBegin " + node.id + " " + testDesc)
+
+  test(function() {
+    script_ran = false;
+    node.insertAdjacentHTML("Afterbegin", "<b></b>\u003Cscript>script_ran = true;\u003C/script>");
+    assert_equals(node.firstChild.localName, "b", "Should have had <b> as first child");
+    assert_equals(node.firstChild.nextSibling.localName, "script", "Should have had <script> as second child");
+    assert_false(script_ran, "script should not have run");
+  }, "Afterbegin " + node.id + " " + testDesc);
+
+  test(function() {
+    script_ran = false;
+    node.insertAdjacentHTML("BeforeEnd", "\u003Cscript>script_ran = true;\u003C/script><u></u>");
+    assert_equals(node.lastChild.localName, "u", "Should have had <u> as last child");
+    assert_equals(node.lastChild.previousSibling.localName, "script", "Should have had <script> as penultimate child");
+    assert_false(script_ran, "script should not have run");
+  }, "BeforeEnd " + node.id + " " + testDesc)
+
+  test(function() {
+    script_ran = false;
+    node.insertAdjacentHTML("afterend", "<a></a>\u003Cscript>script_ran = true;\u003C/script>");
+    assert_equals(node.nextSibling.localName, "a", "Should have had <a> as next sibling");
+    assert_equals(node.nextSibling.nextSibling.localName, "script", "Should have had <script> as second next sibling");
+    assert_false(script_ran, "script should not have run");
+  }, "afterend " + node.id + " " + testDesc)
+}
+
+var content = document.getElementById("content");
+testPositions(content, "without next sibling");
+testPositions(content, "again, with next sibling");
+
+test(function() {
+  assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("bar", "foo")});
+  assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("beforebegİn", "foo")});
+  assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("beforebegın", "foo")});
+}, "Should throw when inserting with invalid position string");
+
+var parentElement = document.createElement("div");
+var child = document.createElement("div");
+child.id = "child";
+
+testThrowingNoParent(child, "null");
+testThrowingNoParent(document.documentElement, "a document");
+
+test(function() {
+  child.insertAdjacentHTML("afterBegin", "foo");
+  child.insertAdjacentHTML("beforeend", "bar");
+  assert_equals(child.textContent, "foobar");
+  parentElement.appendChild(child);
+}, "Inserting after being and before end should order things correctly");
+
+testPositions(child, "node not in tree but has parent");
+
+test(function() {
+  script_ran = false;
+  content.appendChild(parentElement); // must not run scripts
+  assert_false(script_ran, "script should not have run");
+}, "Should not run script when appending things which have descendant <script> inserted via insertAdjacentHTML");
+
+var content2 = document.getElementById("content2");
+testPositions(content2, "without next sibling");
+testPositions(content2, "test again, now that there's a next sibling");
+
+// HTML only
+test(function() {
+  document.body.insertAdjacentHTML("afterend", "<p>");
+  document.head.insertAdjacentHTML("beforebegin", "<p>");
+  assert_equals(document.getElementsByTagName("head").length, 1, "Should still have one head");
+  assert_equals(document.getElementsByTagName("body").length, 1, "Should still have one body");
+}, "Inserting kids of the <html> element should not do weird things with implied <body>/<head> tags")
+</script>
+<div id="log"></div>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/insert_adjacent_html.js b/LayoutTests/imported/w3c/web-platform-tests/domparsing/insert_adjacent_html.js
new file mode 100644
index 0000000..2451228
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/insert_adjacent_html.js
@@ -0,0 +1,33 @@
+function testThrowingNoParent(element, desc) {
+  test(function() {
+    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
+      function() { element.insertAdjacentHTML("afterend", "") }
+    );
+    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
+      function() { element.insertAdjacentHTML("beforebegin", "") }
+    );
+    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
+      function() { element.insertAdjacentHTML("afterend", "foo") }
+    );
+    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
+      function() { element.insertAdjacentHTML("beforebegin", "foo") }
+    );
+  }, "When the parent node is " + desc + ", insertAdjacentHTML should throw for beforebegin and afterend (text)");
+  test(function() {
+    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
+      function() { element.insertAdjacentHTML("afterend", "<!-- fail -->") }
+    );
+    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
+      function() { element.insertAdjacentHTML("beforebegin", "<!-- fail -->") }
+    );
+  }, "When the parent node is " + desc + ", insertAdjacentHTML should throw for beforebegin and afterend (comments)");
+  test(function() {
+    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
+      function() { element.insertAdjacentHTML("afterend", "<div></div>") }
+    );
+    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
+      function() { element.insertAdjacentHTML("beforebegin", "<div></div>") }
+    );
+  }, "When the parent node is " + desc + ", insertAdjacentHTML should throw for beforebegin and afterend (elements)");
+}
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/outerhtml-01-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/domparsing/outerhtml-01-expected.txt
new file mode 100644
index 0000000..735db28
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/outerhtml-01-expected.txt
@@ -0,0 +1,3 @@
+
+PASS outerHTML: child of #document 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/outerhtml-01.html b/LayoutTests/imported/w3c/web-platform-tests/domparsing/outerhtml-01.html
new file mode 100644
index 0000000..2e8072e
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/outerhtml-01.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<title>outerHTML: child of #document</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="http://html5.org/specs/dom-parsing.html#outerhtml">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+  assert_throws("NO_MODIFICATION_ALLOWED_ERR", function() {
+    document.documentElement.outerHTML = "<html><p>FAIL: Should have thrown an error<\/p><\/html>";
+  })
+});
+</script>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/outerhtml-02-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/domparsing/outerhtml-02-expected.txt
new file mode 100644
index 0000000..19a65fc
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/outerhtml-02-expected.txt
@@ -0,0 +1,7 @@
+
+PASS outerHTML and string conversion: null. 
+PASS outerHTML and string conversion: undefined. 
+PASS outerHTML and string conversion: number. 
+PASS outerHTML and string conversion: toString. 
+PASS outerHTML and string conversion: valueOf. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/outerhtml-02.html b/LayoutTests/imported/w3c/web-platform-tests/domparsing/outerhtml-02.html
new file mode 100644
index 0000000..7b69fbf
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/outerhtml-02.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<title>outerHTML and string conversion</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+  var div = document.createElement("div");
+  var p = div.appendChild(document.createElement("p"));
+  p.outerHTML = null;
+  assert_equals(div.innerHTML, "");
+  assert_equals(div.textContent, "");
+}, "outerHTML and string conversion: null.")
+
+test(function() {
+  var div = document.createElement("div");
+  var p = div.appendChild(document.createElement("p"));
+  p.outerHTML = undefined;
+  assert_equals(div.innerHTML, "undefined");
+  assert_equals(div.textContent, "undefined");
+}, "outerHTML and string conversion: undefined.")
+
+test(function() {
+  var div = document.createElement("div");
+  var p = div.appendChild(document.createElement("p"));
+  p.outerHTML = 42;
+  assert_equals(div.innerHTML, "42");
+  assert_equals(div.textContent, "42");
+}, "outerHTML and string conversion: number.")
+
+test(function() {
+  var div = document.createElement("div");
+  var p = div.appendChild(document.createElement("p"));
+  p.outerHTML = {
+    toString: function() { return "pass"; },
+    valueOf: function() { return "fail"; }
+  };
+  assert_equals(div.innerHTML, "pass");
+  assert_equals(div.textContent, "pass");
+}, "outerHTML and string conversion: toString.")
+
+test(function() {
+  var div = document.createElement("div");
+  var p = div.appendChild(document.createElement("p"));
+  p.outerHTML = {
+    toString: undefined,
+    valueOf: function() { return "pass"; }
+  };
+  assert_equals(div.innerHTML, "pass");
+  assert_equals(div.textContent, "pass");
+}, "outerHTML and string conversion: valueOf.")
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/xml-serialization-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/domparsing/xml-serialization-expected.txt
new file mode 100644
index 0000000..bf75319
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/xml-serialization-expected.txt
@@ -0,0 +1,17 @@
+
+PASS Comment: containing -- 
+PASS Comment: starting with - 
+PASS Comment: ending with - 
+PASS Comment: containing --> 
+FAIL DocumentType: empty public and system id assert_equals: expected "<!DOCTYPE html>" but got "<!DOCTYPE html PUBLIC \"\" \"\">"
+FAIL DocumentType: empty system id assert_equals: expected "<!DOCTYPE html PUBLIC \"a\">" but got "<!DOCTYPE html PUBLIC \"a\" \"\">"
+FAIL DocumentType: empty public id assert_equals: expected "<!DOCTYPE html SYSTEM \"a\">" but got "<!DOCTYPE html PUBLIC \"\" \"a\">"
+PASS DocumentType: non-empty public and system id 
+PASS DocumentType: 'APOSTROPHE' (U+0027) 
+PASS DocumentType: 'QUOTATION MARK' (U+0022) 
+PASS DocumentType: 'APOSTROPHE' (U+0027) and 'QUOTATION MARK' (U+0022) 
+PASS ProcessingInstruction: empty data 
+PASS ProcessingInstruction: non-empty data 
+PASS ProcessingInstruction: target contains xml 
+PASS ProcessingInstruction: target contains a 'COLON' (U+003A) 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/domparsing/xml-serialization.xhtml b/LayoutTests/imported/w3c/web-platform-tests/domparsing/xml-serialization.xhtml
new file mode 100644
index 0000000..678523d
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/domparsing/xml-serialization.xhtml
@@ -0,0 +1,91 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>XML serialization</title>
+  <script src="/resources/testharness.js"></script>
+  <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script><![CDATA[
+function serialize(node) {
+  var serializer = new XMLSerializer();
+  return serializer.serializeToString(node);
+}
+
+test(function() {
+  var dt = document.createComment("--");
+  assert_equals(serialize(dt), '<!------>');
+}, "Comment: containing --");
+
+test(function() {
+  var dt = document.createComment("- x");
+  assert_equals(serialize(dt), '<!--- x-->');
+}, "Comment: starting with -");
+
+test(function() {
+  var dt = document.createComment("x -");
+  assert_equals(serialize(dt), '<!--x --->');
+}, "Comment: ending with -");
+
+test(function() {
+  var dt = document.createComment("-->");
+  assert_equals(serialize(dt), '<!---->-->');
+}, "Comment: containing -->");
+
+test(function() {
+  var dt = document.implementation.createDocumentType("html", "", "");
+  assert_equals(serialize(dt), '<!DOCTYPE html>');
+}, "DocumentType: empty public and system id");
+
+test(function() {
+  var dt = document.implementation.createDocumentType("html", "a", "");
+  assert_equals(serialize(dt), '<!DOCTYPE html PUBLIC "a">');
+}, "DocumentType: empty system id");
+
+test(function() {
+  var dt = document.implementation.createDocumentType("html", "", "a");
+  assert_equals(serialize(dt), '<!DOCTYPE html SYSTEM "a">');
+}, "DocumentType: empty public id");
+
+test(function() {
+  var dt = document.implementation.createDocumentType("html", "a", "b");
+  assert_equals(serialize(dt), '<!DOCTYPE html PUBLIC "a" "b">');
+}, "DocumentType: non-empty public and system id");
+
+test(function() {
+  var dt = document.implementation.createDocumentType("html", "'", "'");
+  assert_equals(serialize(dt), "<!DOCTYPE html PUBLIC \"'\" \"'\">");
+}, "DocumentType: 'APOSTROPHE' (U+0027)");
+
+test(function() {
+  var dt = document.implementation.createDocumentType("html", '"', '"');
+  assert_equals(serialize(dt), '<!DOCTYPE html PUBLIC """ """>');
+}, "DocumentType: 'QUOTATION MARK' (U+0022)");
+
+test(function() {
+  var dt = document.implementation.createDocumentType("html", '"\'', '\'"');
+  assert_equals(serialize(dt), '<!DOCTYPE html PUBLIC ""\'" "\'"">');
+}, "DocumentType: 'APOSTROPHE' (U+0027) and 'QUOTATION MARK' (U+0022)");
+
+test(function() {
+  var pi = document.createProcessingInstruction("a", "");
+  assert_equals(serialize(pi), "<?a ?>");
+}, "ProcessingInstruction: empty data");
+
+test(function() {
+  var pi = document.createProcessingInstruction("a", "b");
+  assert_equals(serialize(pi), "<?a b?>");
+}, "ProcessingInstruction: non-empty data");
+
+test(function() {
+  var pi = document.createProcessingInstruction("xml", "b");
+  assert_equals(serialize(pi), "<?xml b?>");
+}, "ProcessingInstruction: target contains xml");
+
+test(function() {
+  var pi = document.createProcessingInstruction("x:y", "b");
+  assert_equals(serialize(pi), "<?x:y b?>");
+}, "ProcessingInstruction: target contains a 'COLON' (U+003A)");
+]]></script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head-expected.txt
new file mode 100644
index 0000000..fb974df
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head-expected.txt
@@ -0,0 +1,3 @@
+
+PASS Fetch with HEAD with body 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head-worker-expected.txt
new file mode 100644
index 0000000..fb974df
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head-worker-expected.txt
@@ -0,0 +1,3 @@
+
+PASS Fetch with HEAD with body 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head-worker.html b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head-worker.html
new file mode 100644
index 0000000..3be7c99
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head-worker.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Fetch in worker: HEAD method</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <script>
+      fetch_tests_from_worker(new Worker("request-head.js"));
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head.html b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head.html
new file mode 100644
index 0000000..a9d8bef
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Fetch: HEAD method</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <script src="request-head.js"></script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head.js b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head.js
new file mode 100644
index 0000000..f0d6b74
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head.js
@@ -0,0 +1,10 @@
+if (this.document === undefined) {
+  importScripts("/resources/testharness.js");
+}
+
+promise_test(function(test) {
+  var requestInit = {"method": "HEAD", "body": "test"};
+  return promise_rejects(test, new TypeError(), fetch(".", requestInit));
+}, "Fetch with HEAD with body");
+
+done();
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-expected.txt
index be0bbf71..d277b0e 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-expected.txt
@@ -1,7 +1,6 @@
 
 FAIL Fetch with GET assert_equals: Request has header origin: http://localhost:8800 expected (string) "http://localhost:8800" but got (object) null
 FAIL Fetch with HEAD assert_equals: Request has header origin: http://localhost:8800 expected (string) "http://localhost:8800" but got (object) null
-FAIL Fetch with HEAD with body promise_test: Unhandled rejection with value: object "TypeError: Type error"
 PASS Fetch with PUT without body 
 PASS Fetch with PUT with body 
 PASS Fetch with POST without body 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt
index be0bbf71..d277b0e 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt
@@ -1,7 +1,6 @@
 
 FAIL Fetch with GET assert_equals: Request has header origin: http://localhost:8800 expected (string) "http://localhost:8800" but got (object) null
 FAIL Fetch with HEAD assert_equals: Request has header origin: http://localhost:8800 expected (string) "http://localhost:8800" but got (object) null
-FAIL Fetch with HEAD with body promise_test: Unhandled rejection with value: object "TypeError: Type error"
 PASS Fetch with PUT without body 
 PASS Fetch with PUT with body 
 PASS Fetch with POST without body 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.js b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.js
index ec14385..2ddce2a 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.js
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.js
@@ -24,7 +24,6 @@
 
 requestHeaders("Fetch with GET", url, "GET", null, location.origin, null);
 requestHeaders("Fetch with HEAD", url, "HEAD", null, location.origin, "0");
-requestHeaders("Fetch with HEAD with body", url, "HEAD", "Request's body", location.origin, "14");
 requestHeaders("Fetch with PUT without body", url, "POST", null, location.origin, "0");
 requestHeaders("Fetch with PUT with body", url, "PUT", "Request's body", location.origin, "14");
 requestHeaders("Fetch with POST without body", url, "POST", null, location.origin, "0");
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url-expected.txt
new file mode 100644
index 0000000..e8cb19b
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url-expected.txt
@@ -0,0 +1,6 @@
+
+PASS Testing response url getter with http://localhost:8800/ada 
+FAIL Testing response url getter with http://localhost:8800/# assert_equals: expected "http://localhost:8800/" but got "http://localhost:8800/#"
+FAIL Testing response url getter with http://localhost:8800/#ada assert_equals: expected "http://localhost:8800/" but got "http://localhost:8800/#ada"
+FAIL Testing response url getter with http://localhost:8800#ada assert_equals: expected "http://localhost:8800/" but got "http://localhost:8800/#ada"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url-worker-expected.txt
new file mode 100644
index 0000000..e8cb19b
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url-worker-expected.txt
@@ -0,0 +1,6 @@
+
+PASS Testing response url getter with http://localhost:8800/ada 
+FAIL Testing response url getter with http://localhost:8800/# assert_equals: expected "http://localhost:8800/" but got "http://localhost:8800/#"
+FAIL Testing response url getter with http://localhost:8800/#ada assert_equals: expected "http://localhost:8800/" but got "http://localhost:8800/#ada"
+FAIL Testing response url getter with http://localhost:8800#ada assert_equals: expected "http://localhost:8800/" but got "http://localhost:8800/#ada"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url-worker.html b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url-worker.html
new file mode 100644
index 0000000..03374e0f
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url-worker.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Fetch in worker: response url getter</title>
+    <meta name="help" href="https://fetch.spec.whatwg.org/#response-class">
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <script>
+    fetch_tests_from_worker(new Worker("response-url.js?pipe=sub"));
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url.html b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url.html
new file mode 100644
index 0000000..dfe9d96
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Fetch: response url getter</title>
+    <meta name="help" href="https://fetch.spec.whatwg.org/#response-class">
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <script src="response-url.js?pipe=sub"></script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url.js b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url.js
new file mode 100644
index 0000000..91b553a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url.js
@@ -0,0 +1,21 @@
+if (this.document === undefined) {
+  importScripts("/resources/testharness.js");
+}
+
+function checkResponseURL(fetchedURL, expectedURL)
+{
+    promise_test(function() {
+        return fetch(fetchedURL).then(function(response) {
+            assert_equals(response.url, expectedURL);
+        });
+    }, "Testing response url getter with " +fetchedURL);
+}
+
+var baseURL = "http://{{host}}:{{ports[http][0]}}";
+checkResponseURL(baseURL + "/ada", baseURL + "/ada");
+checkResponseURL(baseURL + "/#", baseURL + "/");
+checkResponseURL(baseURL + "/#ada", baseURL + "/");
+checkResponseURL(baseURL + "#ada", baseURL + "/");
+
+done();
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/w3c-import.log
index 589e9a0..b57bd93 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/w3c-import.log
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/w3c-import.log
@@ -30,9 +30,15 @@
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers-worker.html
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers.html
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-head.js
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker.html
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.html
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/response-url.js
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about-worker.html
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.html
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.js
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt
index c785329..4ed70a9a 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt
@@ -1,17 +1,17 @@
 
-FAIL Cross domain basic usage [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
-PASS Cross domain basic usage [server forbid CORS] 
-FAIL Cross domain basic usage [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Same domain different port [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
 PASS Same domain different port [server forbid CORS] 
 FAIL Same domain different port [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Same domain different protocol different port [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Same domain different protocol different port [server forbid CORS] 
+FAIL Same domain different protocol different port [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Cross domain basic usage [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Cross domain basic usage [server forbid CORS] 
+FAIL Cross domain basic usage [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Cross domain different port [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
 PASS Cross domain different port [server forbid CORS] 
 FAIL Cross domain different port [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Cross domain different protocol [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
 PASS Cross domain different protocol [server forbid CORS] 
 FAIL Cross domain different protocol [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
-FAIL Same domain different protocol different port [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
-PASS Same domain different protocol different port [server forbid CORS] 
-FAIL Same domain different protocol different port [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt
index 29d3080..11623e6 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt
@@ -1,8 +1,8 @@
 
+FAIL Omit mode: no cookie sent assert_false: Request should have no cookie expected false got true
 FAIL Include mode: 1 cookie promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Include mode: local cookies are not sent with remote request promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Include mode: remote cookies are not sent with local request promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Include mode: remote cookies are not sent with other remote request promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Same-origin mode: cookies are discarded in cors request promise_test: Unhandled rejection with value: object "TypeError: Type error"
-FAIL Omit mode: no cookie sent assert_false: Request should have no cookie expected false got true
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-expected.txt
index 8b2cb10..bdbd481 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-expected.txt
@@ -1,8 +1,18 @@
 
-PASS CORS [DELETE], server refuses 
-PASS CORS [PUT], server refuses 
-FAIL CORS [PATCH], server allows promise_test: Unhandled rejection with value: object "TypeError: Type error"
-PASS CORS [PATCH], server refuses 
+Harness Error (TIMEOUT), message = null
+
 FAIL CORS [DELETE], server allows promise_test: Unhandled rejection with value: object "TypeError: Type error"
-FAIL CORS [PUT], server allows promise_test: Unhandled rejection with value: object "TypeError: Type error"
+TIMEOUT CORS [DELETE], server refuses Test timed out
+TIMEOUT CORS [PUT], server allows Test timed out
+TIMEOUT CORS [PUT], server refuses Test timed out
+TIMEOUT CORS [PATCH], server allows Test timed out
+TIMEOUT CORS [PATCH], server refuses Test timed out
+TIMEOUT CORS [NEW], server allows Test timed out
+TIMEOUT CORS [NEW], server refuses Test timed out
+TIMEOUT CORS [GET] [x-test-header: allowed], server allows Test timed out
+TIMEOUT CORS [GET] [x-test-header: refused], server refuses Test timed out
+TIMEOUT CORS [GET] [several headers], server allows Test timed out
+TIMEOUT CORS [GET] [several headers], server refuses Test timed out
+TIMEOUT CORS [PUT] [several headers], server allows Test timed out
+TIMEOUT CORS [PUT] [several headers], server refuses Test timed out
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt
index c2c15e0..bdbd481 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt
@@ -1,3 +1,18 @@
 
-PASS Untitled 
+Harness Error (TIMEOUT), message = null
+
+FAIL CORS [DELETE], server allows promise_test: Unhandled rejection with value: object "TypeError: Type error"
+TIMEOUT CORS [DELETE], server refuses Test timed out
+TIMEOUT CORS [PUT], server allows Test timed out
+TIMEOUT CORS [PUT], server refuses Test timed out
+TIMEOUT CORS [PATCH], server allows Test timed out
+TIMEOUT CORS [PATCH], server refuses Test timed out
+TIMEOUT CORS [NEW], server allows Test timed out
+TIMEOUT CORS [NEW], server refuses Test timed out
+TIMEOUT CORS [GET] [x-test-header: allowed], server allows Test timed out
+TIMEOUT CORS [GET] [x-test-header: refused], server refuses Test timed out
+TIMEOUT CORS [GET] [several headers], server allows Test timed out
+TIMEOUT CORS [GET] [several headers], server refuses Test timed out
+TIMEOUT CORS [PUT] [several headers], server allows Test timed out
+TIMEOUT CORS [PUT] [several headers], server refuses Test timed out
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.js b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.js
index 87c60e6..f6f75bb 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.js
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.js
@@ -10,29 +10,25 @@
   Check control access headers added by UA (for method and headers)
 */
 function corsPreflight(desc, corsUrl, method, allowed, headers) {
-  var uuid_token = token();
-  fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token).then(function(response) {
+  return promise_test(function(test) {
+    var uuid_token = token();
+    return fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token).then(function(response) {
+      var url = corsUrl;
+      var urlParameters = "?token=" + uuid_token + "&max_age=0";
+      var requestInit = {"mode": "cors", "method": method};
+      if (headers)
+        requestInit["headers"] = headers;
 
-    var url = corsUrl;
-    var urlParameters = "?token=" + uuid_token + "&max_age=0";
-    var requestInit = {"mode": "cors", "method": method};
-    if (headers)
-      requestInit["headers"] = headers;
-
-    if (allowed) {
-      urlParameters += "&allow_methods=" + method;
-      if (headers) {
-        //Let's check prefligh request.
-        //Server will send back headers from Access-Control-Request-Headers in x-control-request-headers
-        urlParameters += "&control_request_headers"
-        //Make the server allow the headers
-        urlParameters += "&allow_headers="
-        urlParameters += headers.map(function (x) { return x[0]; }).join("%2C%20");
-      }
-      promise_test(function(test) {
-        test.add_cleanup(function() {
-          fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token);
-        });
+      if (allowed) {
+        urlParameters += "&allow_methods=" + method;
+        if (headers) {
+          //Let's check prefligh request.
+          //Server will send back headers from Access-Control-Request-Headers in x-control-request-headers
+          urlParameters += "&control_request_headers"
+          //Make the server allow the headers
+          urlParameters += "&allow_headers="
+          urlParameters += headers.map(function (x) { return x[0]; }).join("%2C%20");
+        }
         return fetch(url + urlParameters, requestInit).then(function(resp) {
           assert_equals(resp.status, 200, "Response's status is 200");
           assert_equals(resp.headers.get("x-did-preflight"), "1", "Preflight request has been made");
@@ -43,20 +39,18 @@
             for (var header of headers)
               assert_in_array(header[0], actualHeaders, "Preflight asked permission for header: " + header);
           }
+          return fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token);
         });
-      }, desc);
-    } else {
-      promise_test(function(test) {
-        test.add_cleanup(function() {
-          fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token);
+      } else {
+        return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit)).then(function(){
+          return fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token);
         });
-        return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
-      }, desc);
-    }
-  });
+      }
+    });
+  }, desc);
 }
 
-var corsUrl = "http://www1.{{host}}:{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+var corsUrl = "http://{{host}}:{{ports[http][1]}}" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
 
 corsPreflight("CORS [DELETE], server allows", corsUrl, "DELETE", true);
 corsPreflight("CORS [DELETE], server refuses", corsUrl, "DELETE", false);
@@ -77,3 +71,5 @@
 corsPreflight("CORS [GET] [several headers], server refuses", corsUrl, "GET", false, headers);
 corsPreflight("CORS [PUT] [several headers], server allows", corsUrl, "PUT", true, headers);
 corsPreflight("CORS [PUT] [several headers], server refuses", corsUrl, "PUT", false, headers);
+
+done();
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt
index 52a62a4..4b71211 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt
@@ -5,58 +5,58 @@
 PASS Redirect 301 from remote to same origin with user and password 
 PASS Redirect 301 from remote to same origin with user 
 PASS Redirect 301 from remote to same origin with password 
-PASS Redirect 301 from remote to another remote with user and password 
-PASS Redirect 301 from remote to another remote with user 
-PASS Redirect 301 from remote to another remote with password 
 PASS Redirect 301 from remote to same remote with user and password 
 PASS Redirect 301 from remote to same remote with user 
 PASS Redirect 301 from remote to same remote with password 
+PASS Redirect 301 from remote to another remote with user and password 
+PASS Redirect 301 from remote to another remote with user 
+PASS Redirect 301 from remote to another remote with password 
 PASS Redirect 302 from same origin to remote with user and password 
 PASS Redirect 302 from same origin to remote with user 
 PASS Redirect 302 from same origin to remote with password 
 PASS Redirect 302 from remote to same origin with user and password 
 PASS Redirect 302 from remote to same origin with user 
 PASS Redirect 302 from remote to same origin with password 
-PASS Redirect 302 from remote to another remote with user and password 
-PASS Redirect 302 from remote to another remote with user 
-PASS Redirect 302 from remote to another remote with password 
 PASS Redirect 302 from remote to same remote with user and password 
 PASS Redirect 302 from remote to same remote with user 
 PASS Redirect 302 from remote to same remote with password 
+PASS Redirect 302 from remote to another remote with user and password 
+PASS Redirect 302 from remote to another remote with user 
+PASS Redirect 302 from remote to another remote with password 
 PASS Redirect 303 from same origin to remote with user and password 
 PASS Redirect 303 from same origin to remote with user 
 PASS Redirect 303 from same origin to remote with password 
 PASS Redirect 303 from remote to same origin with user and password 
 PASS Redirect 303 from remote to same origin with user 
 PASS Redirect 303 from remote to same origin with password 
-PASS Redirect 303 from remote to another remote with user and password 
-PASS Redirect 303 from remote to another remote with user 
-PASS Redirect 303 from remote to another remote with password 
 PASS Redirect 303 from remote to same remote with user and password 
 PASS Redirect 303 from remote to same remote with user 
 PASS Redirect 303 from remote to same remote with password 
+PASS Redirect 303 from remote to another remote with user and password 
+PASS Redirect 303 from remote to another remote with user 
+PASS Redirect 303 from remote to another remote with password 
 PASS Redirect 307 from same origin to remote with user and password 
 PASS Redirect 307 from same origin to remote with user 
 PASS Redirect 307 from same origin to remote with password 
 PASS Redirect 307 from remote to same origin with user and password 
 PASS Redirect 307 from remote to same origin with user 
 PASS Redirect 307 from remote to same origin with password 
-PASS Redirect 307 from remote to another remote with user and password 
-PASS Redirect 307 from remote to another remote with user 
-PASS Redirect 307 from remote to another remote with password 
 PASS Redirect 307 from remote to same remote with user and password 
 PASS Redirect 307 from remote to same remote with user 
 PASS Redirect 307 from remote to same remote with password 
+PASS Redirect 307 from remote to another remote with user and password 
+PASS Redirect 307 from remote to another remote with user 
+PASS Redirect 307 from remote to another remote with password 
 PASS Redirect 308 from same origin to remote with user and password 
 PASS Redirect 308 from same origin to remote with user 
 PASS Redirect 308 from same origin to remote with password 
 PASS Redirect 308 from remote to same origin with user and password 
 PASS Redirect 308 from remote to same origin with user 
 PASS Redirect 308 from remote to same origin with password 
-PASS Redirect 308 from remote to another remote with user and password 
-PASS Redirect 308 from remote to another remote with user 
-PASS Redirect 308 from remote to another remote with password 
 PASS Redirect 308 from remote to same remote with user and password 
 PASS Redirect 308 from remote to same remote with user 
 PASS Redirect 308 from remote to same remote with password 
+PASS Redirect 308 from remote to another remote with user and password 
+PASS Redirect 308 from remote to another remote with user 
+PASS Redirect 308 from remote to another remote with password 
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt
index 4254269..137f790 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt
@@ -1,5 +1,8 @@
+localhost:8800 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
+localhost:8800 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
+localhost:8800 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
 
-FAIL User-added Authorization header with include mode Can't find variable: btoa
-FAIL User-added Authorization header with same-origin mode Can't find variable: btoa
-FAIL User-added Authorization header with omit mode Can't find variable: btoa
+FAIL User-added Authorization header with include mode assert_equals: HTTP status is 200 expected 200 but got 401
+FAIL User-added Authorization header with same-origin mode assert_equals: HTTP status is 200 expected 200 but got 401
+FAIL User-added Authorization header with omit mode assert_equals: HTTP status is 200 expected 200 but got 401
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt
index 21c2a87..ea7adde 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt
@@ -1,9 +1,9 @@
 
 PASS Include mode: 1 cookie 
 PASS Include mode: 2 cookies 
-PASS Omit mode: discard cookies 
-PASS Omit mode: no cookie is stored 
-PASS Omit mode: no cookie is sent 
+FAIL Omit mode: discard cookies assert_false: Request does not have cookie(s) expected false got true
+FAIL Omit mode: no cookie is stored assert_false: Request does not have cookie(s) expected false got true
+FAIL Omit mode: no cookie is sent assert_false: Request does not have cookie(s) expected false got true
 PASS Same-origin mode: 1 cookie 
 PASS Same-origin mode: 2 cookies 
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt
index 35eac07..348df38 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt
@@ -1,6 +1,6 @@
 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'referrer'.
 
 
-FAIL Request's referrer is origin assert_equals: request's referrer is http://localhost:8800 expected "http://localhost:8800" but got "http://localhost:8800/fetch/api/policies/referrer-origin.js?pipe=sub"
+FAIL Request's referrer is origin assert_equals: request's referrer is http://localhost:8800/ expected "http://localhost:8800/" but got "http://localhost:8800/fetch/api/policies/referrer-origin.js?pipe=sub"
 PASS Throw a TypeError referrer is not same-origin with origin 
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt
index 3a1ba49..ff55995 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt
@@ -4,29 +4,29 @@
 PASS Redirect 301 in "follow" mode with invalid location 
 PASS Redirect 301 in "manual" mode with invalid location 
 PASS Redirect 301 in "follow" mode with data location 
-FAIL Redirect 301 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 301 in "manual" mode with data location 
 PASS Redirect 302 in "follow" mode without location 
 PASS Redirect 302 in "manual" mode without location 
 PASS Redirect 302 in "follow" mode with invalid location 
 PASS Redirect 302 in "manual" mode with invalid location 
 PASS Redirect 302 in "follow" mode with data location 
-FAIL Redirect 302 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 302 in "manual" mode with data location 
 PASS Redirect 303 in "follow" mode without location 
 PASS Redirect 303 in "manual" mode without location 
 PASS Redirect 303 in "follow" mode with invalid location 
 PASS Redirect 303 in "manual" mode with invalid location 
 PASS Redirect 303 in "follow" mode with data location 
-FAIL Redirect 303 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 303 in "manual" mode with data location 
 PASS Redirect 307 in "follow" mode without location 
 PASS Redirect 307 in "manual" mode without location 
 PASS Redirect 307 in "follow" mode with invalid location 
 PASS Redirect 307 in "manual" mode with invalid location 
 PASS Redirect 307 in "follow" mode with data location 
-FAIL Redirect 307 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 307 in "manual" mode with data location 
 PASS Redirect 308 in "follow" mode without location 
 PASS Redirect 308 in "manual" mode without location 
 PASS Redirect 308 in "follow" mode with invalid location 
 PASS Redirect 308 in "manual" mode with invalid location 
 PASS Redirect 308 in "follow" mode with data location 
-FAIL Redirect 308 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 308 in "manual" mode with data location 
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt
index 899c718..dddda69 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt
@@ -1,17 +1,17 @@
 
-FAIL Redirect 301 in "error" mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 301 in "error" mode  
 PASS Redirect 301 in "follow" mode  
-FAIL Redirect 301 in "manual" mode  assert_equals: Response's status is 0 expected 0 but got 200
-FAIL Redirect 302 in "error" mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 301 in "manual" mode  
+PASS Redirect 302 in "error" mode  
 PASS Redirect 302 in "follow" mode  
-FAIL Redirect 302 in "manual" mode  assert_equals: Response's status is 0 expected 0 but got 200
-FAIL Redirect 303 in "error" mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 302 in "manual" mode  
+PASS Redirect 303 in "error" mode  
 PASS Redirect 303 in "follow" mode  
-FAIL Redirect 303 in "manual" mode  assert_equals: Response's status is 0 expected 0 but got 200
-FAIL Redirect 307 in "error" mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 303 in "manual" mode  
+PASS Redirect 307 in "error" mode  
 PASS Redirect 307 in "follow" mode  
-FAIL Redirect 307 in "manual" mode  assert_equals: Response's status is 0 expected 0 but got 200
-FAIL Redirect 308 in "error" mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 307 in "manual" mode  
+PASS Redirect 308 in "error" mode  
 PASS Redirect 308 in "follow" mode  
-FAIL Redirect 308 in "manual" mode  assert_equals: Response's status is 0 expected 0 but got 200
+PASS Redirect 308 in "manual" mode  
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html
index fa2fe18..5d92b09 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html
@@ -31,9 +31,8 @@
         promise_test(function(test) {
           var request = new Request("", makeRequestInit(body, "POST"));
           if (body) {
-            assert_throws(new TypeError(),
-                          function() { new Request("", makeRequestInit(body, "GET")); }
-            );
+            assert_throws(new TypeError(), function() { new Request("", makeRequestInit(body, "GET")); });
+            assert_throws(new TypeError(), function() { new Request("", makeRequestInit(body, "HEAD")); });
           } else {
             new Request("", makeRequestInit(body, "GET")); // should not throw
           }
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt
index fcce29c..f978e8e 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt
@@ -1,6 +1,6 @@
 
 PASS Check request values when initialized from Request 
 PASS Check request values when initialized from Request and init values 
-FAIL Check request values when initialized from url string assert_equals: Check url attribute expected "http://url.test:1234/path/subpath?query=true" but got "http://url.test:1234/path/subpath?query=true#fragment"
-FAIL Check request values when initialized from url and init values assert_equals: Check url attribute expected "http://url.test:1234/path/subpath?query=true" but got "http://url.test:1234/path/subpath?query=true#fragment"
+FAIL Check request values when initialized from url string assert_equals: Check referrer attribute expected "http://localhost:8800/" but got "about:client"
+PASS Check request values when initialized from url and init values 
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html
index 12181a2..8860d60 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html
+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html
@@ -66,16 +66,16 @@
 
       test(function() {
         var url = "http://url.test:1234/path/subpath?query=true";
-        expectedDefault["url"] = url;
         url += "#fragment";
+        expectedDefault["url"] = url;
         var requestToCheck = new Request(url);
         checkRequest(requestToCheck, expectedDefault);
       }, "Check request values when initialized from url string");
 
       test(function() {
         var url = "http://url.test:1234/path/subpath?query=true";
-        expectedInitialized["url"] = url;
         url += "#fragment";
+        expectedInitialized["url"] = url;
         var requestToCheck = new Request(url , initValuesDict);
         checkRequest(requestToCheck, expectedInitialized);
       }, "Check request values when initialized from url and init values");
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
index a13341a..7d3a3fc 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
@@ -2568,27 +2568,29 @@
 PASS TrackEvent interface: existence and properties of interface prototype object 
 PASS TrackEvent interface: existence and properties of interface prototype object's "constructor" property 
 PASS TrackEvent interface: attribute track 
-FAIL TrackEvent must be primary interface of new TrackEvent("addtrack"; {track:document.createElement("track").track}) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Stringification of new TrackEvent("addtrack"; {track:document.createElement("track").track}) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL TrackEvent interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "track" with the proper type (0) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "type" with the proper type (0) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "target" with the proper type (1) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "currentTarget" with the proper type (2) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "NONE" with the proper type (3) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "CAPTURING_PHASE" with the proper type (4) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "AT_TARGET" with the proper type (5) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "BUBBLING_PHASE" with the proper type (6) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "eventPhase" with the proper type (7) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "stopPropagation" with the proper type (8) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "stopImmediatePropagation" with the proper type (9) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "bubbles" with the proper type (10) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "cancelable" with the proper type (11) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "preventDefault" with the proper type (12) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "defaultPrevented" with the proper type (13) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must have own property "isTrusted" assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "timeStamp" with the proper type (15) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "initEvent" with the proper type (16) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
-FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new TrackEvent("addtrack"; {track:document.createElement("track").track}) with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end an..."
+PASS TrackEvent must be primary interface of new TrackEvent("addtrack", {track:document.createElement("track").track}) 
+PASS Stringification of new TrackEvent("addtrack", {track:document.createElement("track").track}) 
+FAIL TrackEvent interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "track" with the proper type (0) Unrecognized type [object Object],[object Object],[object Object]
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "type" with the proper type (0) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "target" with the proper type (1) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "currentTarget" with the proper type (2) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "NONE" with the proper type (3) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "CAPTURING_PHASE" with the proper type (4) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "AT_TARGET" with the proper type (5) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "BUBBLING_PHASE" with the proper type (6) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "eventPhase" with the proper type (7) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "stopPropagation" with the proper type (8) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "stopImmediatePropagation" with the proper type (9) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "bubbles" with the proper type (10) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "cancelable" with the proper type (11) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "preventDefault" with the proper type (12) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "defaultPrevented" with the proper type (13) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must have own property "isTrusted" 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "timeStamp" with the proper type (15) 
+PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "initEvent" with the proper type (16) 
+FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new TrackEvent("addtrack", {track:document.createElement("track").track}) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
+            fn.apply(obj, args);
+        }" did not throw
 PASS HTMLMapElement interface: existence and properties of interface object 
 PASS HTMLMapElement interface object length 
 PASS HTMLMapElement interface object name 
@@ -6150,44 +6152,9 @@
 FAIL BroadcastChannel interface: operation postMessage(any) assert_own_property: self does not have own property "BroadcastChannel" expected property "BroadcastChannel" missing
 FAIL BroadcastChannel interface: operation close() assert_own_property: self does not have own property "BroadcastChannel" expected property "BroadcastChannel" missing
 FAIL BroadcastChannel interface: attribute onmessage assert_own_property: self does not have own property "BroadcastChannel" expected property "BroadcastChannel" missing
-FAIL WorkerGlobalScope interface: existence and properties of interface object assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface object length assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface object name assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: existence and properties of interface prototype object assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: attribute self assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: attribute location assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: operation close() assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: attribute onerror assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: attribute onlanguagechange assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: attribute onoffline assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: attribute ononline assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: operation importScripts(DOMString) assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: attribute navigator assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: operation createImageBitmap(ImageBitmapSource,long,long,long,long) assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: operation setTimeout(Function,long,any) assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: operation setTimeout(DOMString,long,any) assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: operation clearTimeout(long) assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: operation setInterval(Function,long,any) assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: operation setInterval(DOMString,long,any) assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: operation clearInterval(long) assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: operation btoa(DOMString) assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL WorkerGlobalScope interface: operation atob(DOMString) assert_own_property: self does not have own property "WorkerGlobalScope" expected property "WorkerGlobalScope" missing
-FAIL DedicatedWorkerGlobalScope interface: existence and properties of interface object assert_own_property: self does not have own property "DedicatedWorkerGlobalScope" expected property "DedicatedWorkerGlobalScope" missing
-FAIL DedicatedWorkerGlobalScope interface object length assert_own_property: self does not have own property "DedicatedWorkerGlobalScope" expected property "DedicatedWorkerGlobalScope" missing
-FAIL DedicatedWorkerGlobalScope interface object name assert_own_property: self does not have own property "DedicatedWorkerGlobalScope" expected property "DedicatedWorkerGlobalScope" missing
-FAIL DedicatedWorkerGlobalScope interface: existence and properties of interface prototype object assert_own_property: self does not have own property "DedicatedWorkerGlobalScope" expected property "DedicatedWorkerGlobalScope" missing
-FAIL DedicatedWorkerGlobalScope interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "DedicatedWorkerGlobalScope" expected property "DedicatedWorkerGlobalScope" missing
-FAIL DedicatedWorkerGlobalScope interface: operation postMessage(any,[object Object]) assert_own_property: self does not have own property "DedicatedWorkerGlobalScope" expected property "DedicatedWorkerGlobalScope" missing
-FAIL DedicatedWorkerGlobalScope interface: attribute onmessage assert_own_property: self does not have own property "DedicatedWorkerGlobalScope" expected property "DedicatedWorkerGlobalScope" missing
-FAIL SharedWorkerGlobalScope interface: existence and properties of interface object assert_own_property: self does not have own property "SharedWorkerGlobalScope" expected property "SharedWorkerGlobalScope" missing
-FAIL SharedWorkerGlobalScope interface object length assert_own_property: self does not have own property "SharedWorkerGlobalScope" expected property "SharedWorkerGlobalScope" missing
-FAIL SharedWorkerGlobalScope interface object name assert_own_property: self does not have own property "SharedWorkerGlobalScope" expected property "SharedWorkerGlobalScope" missing
-FAIL SharedWorkerGlobalScope interface: existence and properties of interface prototype object assert_own_property: self does not have own property "SharedWorkerGlobalScope" expected property "SharedWorkerGlobalScope" missing
-FAIL SharedWorkerGlobalScope interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "SharedWorkerGlobalScope" expected property "SharedWorkerGlobalScope" missing
-FAIL SharedWorkerGlobalScope interface: attribute name assert_own_property: self does not have own property "SharedWorkerGlobalScope" expected property "SharedWorkerGlobalScope" missing
-FAIL SharedWorkerGlobalScope interface: attribute applicationCache assert_own_property: self does not have own property "SharedWorkerGlobalScope" expected property "SharedWorkerGlobalScope" missing
-FAIL SharedWorkerGlobalScope interface: attribute onconnect assert_own_property: self does not have own property "SharedWorkerGlobalScope" expected property "SharedWorkerGlobalScope" missing
+PASS WorkerGlobalScope interface: existence and properties of interface object 
+PASS DedicatedWorkerGlobalScope interface: existence and properties of interface object 
+PASS SharedWorkerGlobalScope interface: existence and properties of interface object 
 PASS Worker interface: existence and properties of interface object 
 PASS Worker interface object length 
 PASS Worker interface object name 
@@ -6204,35 +6171,8 @@
 FAIL SharedWorker interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "SharedWorker" expected property "SharedWorker" missing
 FAIL SharedWorker interface: attribute port assert_own_property: self does not have own property "SharedWorker" expected property "SharedWorker" missing
 FAIL SharedWorker interface: attribute onerror assert_own_property: self does not have own property "SharedWorker" expected property "SharedWorker" missing
-FAIL WorkerNavigator interface: existence and properties of interface object assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface object length assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface object name assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface: existence and properties of interface prototype object assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface: attribute appCodeName assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface: attribute appName assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface: attribute appVersion assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface: attribute platform assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface: attribute product assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface: operation taintEnabled() assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface: attribute userAgent assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface: attribute language assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface: attribute languages assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerNavigator interface: attribute onLine assert_own_property: self does not have own property "WorkerNavigator" expected property "WorkerNavigator" missing
-FAIL WorkerLocation interface: existence and properties of interface object assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface object length assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface object name assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface: existence and properties of interface prototype object assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface: attribute href assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface: attribute origin assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface: attribute protocol assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface: attribute host assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface: attribute hostname assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface: attribute port assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface: attribute pathname assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface: attribute search assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
-FAIL WorkerLocation interface: attribute hash assert_own_property: self does not have own property "WorkerLocation" expected property "WorkerLocation" missing
+PASS WorkerNavigator interface: existence and properties of interface object 
+PASS WorkerLocation interface: existence and properties of interface object 
 PASS Storage interface: existence and properties of interface object 
 PASS Storage interface object length 
 PASS Storage interface object name 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces.html b/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces.html
index b0eb70b..d0224bc 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces.html
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces.html
@@ -499,7 +499,7 @@
     boolean getModifierState (DOMString keyArg);
 };
 
-dictionary MouseEventInit : SharedKeyboardAndMouseEventInit {
+dictionary MouseEventInit : EventModifierInit {
     long           screenX = 0;
     long           screenY = 0;
     long           clientX = 0;
@@ -509,7 +509,7 @@
     EventTarget?   relatedTarget = null;
 };
 
-dictionary SharedKeyboardAndMouseEventInit : UIEventInit {
+dictionary EventModifierInit : UIEventInit {
     boolean ctrlKey = false;
     boolean shiftKey = false;
     boolean altKey = false;
@@ -2353,7 +2353,7 @@
            attribute DOMString returnValue;
 };
 
-[Exposed=Window,SharedWorker]
+[Exposed=(Window,SharedWorker)]
 interface ApplicationCache : EventTarget {
 
   // update status
@@ -2762,13 +2762,13 @@
   // also has additional members in a partial interface
 };
 
-[Global=Worker,DedicatedWorker]
+[Global=(Worker,DedicatedWorker),Exposed=DedicatedWorker]
 /*sealed*/ interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
   void postMessage(any message, optional sequence<Transferable> transfer);
            attribute EventHandler onmessage;
 };
 
-[Global=Worker,SharedWorker]
+[Global=(Worker,SharedWorker),Exposed=SharedWorker]
 /*sealed*/ interface SharedWorkerGlobalScope : WorkerGlobalScope {
   readonly attribute DOMString name;
   readonly attribute ApplicationCache applicationCache;
@@ -2795,7 +2795,6 @@
 };
 SharedWorker implements AbstractWorker;
 
-[Exposed=Worker]
 partial interface WorkerGlobalScope { // not obsolete
   void importScripts(DOMString... urls);
   readonly attribute WorkerNavigator navigator;
@@ -3246,7 +3245,7 @@
     TextTrackCue: [],
     DataCue: [],
     TimeRanges: ['document.createElement("video").buffered'],
-    TrackEvent: ['new TrackEvent("addtrack"; {track:document.createElement("track").track})'],
+    TrackEvent: ['new TrackEvent("addtrack", {track:document.createElement("track").track})'],
     HTMLTemplateElement: ['document.createElement("template")'],
     HTMLSlotElement: ['document.createElement("slot")'],
     HTMLCanvasElement: ['document.createElement("canvas")'],
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank-expected.txt
new file mode 100644
index 0000000..ee376a2
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank-expected.txt
@@ -0,0 +1,4 @@
+
+
+FAIL base element in about:blank document should resolve against its fallback base URI assert_equals: expected "http://localhost:8800/html/semantics/document-metadata/the-base-element/test" but got ""
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank.html
new file mode 100644
index 0000000..54c4794
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>base element in about:blank document should resolve against its fallback base URI</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<iframe></iframe>
+<script>
+var t = async_test();
+addEventListener("load", t.step_func_done(function() {
+  var doc = frames[0].document;
+  var b = doc.createElement("base");
+  b.setAttribute("href", "test");
+  var newBaseValue = location.href.replace(/\/[^/]*$/, "/") + "test";
+  assert_equals(b.href, newBaseValue);
+  assert_equals(doc.baseURI, location.href);
+  doc.head.appendChild(b);
+  assert_equals(doc.baseURI, newBaseValue);
+}));
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid-expected.txt
new file mode 100644
index 0000000..8fd700a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid-expected.txt
@@ -0,0 +1,3 @@
+
+FAIL base element with unparseable href should have .href getter return attr value assert_equals: expected "//test:test" but got ""
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid.html
new file mode 100644
index 0000000..6d12d29
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>base element with unparseable href should have .href getter return attr value</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+test(function() {
+  var b = document.createElement("base");
+  b.setAttribute("href", "//test:test");
+  assert_equals(b.href, "//test:test");
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc-expected.txt
new file mode 100644
index 0000000..a6616c76
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc-expected.txt
@@ -0,0 +1,4 @@
+
+
+FAIL base element in srcdoc document should resolve against its fallback base URI assert_equals: expected "http://localhost:8800/html/semantics/document-metadata/the-base-element/test" but got ""
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc.html
new file mode 100644
index 0000000..eea1efe
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>base element in srcdoc document should resolve against its fallback base URI</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<iframe srcdoc=""></iframe>
+<script>
+var t = async_test();
+addEventListener("load", t.step_func_done(function() {
+  var doc = frames[0].document;
+  var b = doc.createElement("base");
+  b.setAttribute("href", "test");
+  var newBaseValue = location.href.replace(/\/[^/]*$/, "/") + "test";
+  assert_equals(b.href, newBaseValue);
+  assert_equals(doc.baseURI, location.href);
+  doc.head.appendChild(b);
+  assert_equals(doc.baseURI, newBaseValue);
+}));
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context-expected.txt
new file mode 100644
index 0000000..6ee3f71
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context-expected.txt
@@ -0,0 +1,2 @@
+FAIL: Timed out waiting for notifyDone to be called
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context.html
new file mode 100644
index 0000000..127b253
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context.html
@@ -0,0 +1,35 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Documents without browsing contexts should not load stylesheets</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/utils.js"></script>
+<body>
+<script>
+  function count(id, t) {
+    var xhr = new XMLHttpRequest();
+    xhr.open('GET', 'stylesheet.py?count=1&id=' + id);
+    xhr.onload = t.step_func_done(function() {
+      assert_equals(xhr.responseText, "1");
+    });
+    xhr.onerror = t.unreached_func();
+    xhr.send();
+  }
+
+  async_test(function(t) {
+    var id = token();
+    var doc = (new DOMParser()).parseFromString('<link rel="stylesheet" href="stylesheet.py?id=' + id + '"></link>', 'text/html');
+    var link = doc.querySelector('link');
+    document.head.appendChild(link);
+    t.step_timeout(function() { count(id, t) }, 500);
+  }, 'Create a document, adopt the node');
+
+  async_test(function(t) {
+    var id = token();
+    var d = document.createElement('div');
+    document.body.appendChild(d);
+    d.innerHTML = '<link rel="stylesheet" href="stylesheet.py?id=' + id + '"></link>';
+    t.step_timeout(function() { count(id, t) }, 500);
+  }, 'Create a stylesheet in innerHTML document');
+</script>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01-expected.txt
index 8ce4f48..f633f66 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01-expected.txt
@@ -2,5 +2,7 @@
 
 Harness Error (TIMEOUT), message = null
 
+PASS Should get an error event for a 404 error. 
+PASS Should get an error event for an unsupported URL. 
 TIMEOUT Should get an error event for a text/plain response. Test timed out
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01.html
index ce35e03..0460846 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01.html
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01.html
@@ -7,17 +7,32 @@
 <div id="log"></div>
 <div id="test">
 <script>
-//var t404 = async_test("Should get an error event for a 404 error.")
-//t404.step(function() {
-//  var elt = document.createElement("link");
-//  elt.onerror = t404.step_func(function() {
-//    assert_true(true, "Got error event for 404 error.")
-//    t404.done()
-//  })
-//  elt.rel = "stylesheet";
-//  elt.href = 404 error;
-//  document.getElementsByTagName("head")[0].appendChild(elt);
-//})
+var t404 = async_test("Should get an error event for a 404 error.")
+t404.step(function() {
+  var elt = document.createElement("link");
+  elt.onerror = t404.step_func(function() {
+    assert_true(true, "Got error event for 404 error.")
+    t404.step_timeout(function() { t404.done() }, 0);
+  })
+  elt.onload = t404.unreached_func("load event should not be fired");
+  elt.rel = "stylesheet";
+  elt.href = "nonexistent_stylesheet.css";
+  document.getElementsByTagName("head")[0].appendChild(elt);
+})
+
+var tUnsupported = async_test("Should get an error event for an unsupported URL.")
+tUnsupported.step(function() {
+  var elt = document.createElement("link");
+  elt.onerror = tUnsupported.step_func(function() {
+    assert_true(true, "Got error event for unsupported URL.")
+    tUnsupported.step_timeout(function() { tUnsupported.done() }, 0);
+  })
+  elt.onload = tUnsupported.unreached_func("load event should not be fired");
+  elt.rel = "stylesheet";
+  elt.href = "nonexistent:stylesheet.css";
+  document.getElementsByTagName("head")[0].appendChild(elt);
+})
+
 var tText = async_test("Should get an error event for a text/plain response.")
 tText.step(function() {
   var elt = document.createElement("link");
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/stylesheet.py b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/stylesheet.py
new file mode 100644
index 0000000..a312e9e
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/stylesheet.py
@@ -0,0 +1,9 @@
+def main(request, response):
+    try:
+        count = int(request.server.stash.take(request.GET["id"]))
+    except:
+        count = 0
+    if "count" in request.GET:
+        return str(count)
+    request.server.stash.put(request.GET["id"], str(count + 1))
+    return 'body { color: red }'
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/w3c-import.log
index e08cb84..09b3ce8 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/w3c-import.log
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/w3c-import.log
@@ -15,6 +15,7 @@
 None
 ------------------------------------------------------------------------
 List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-load-event.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-rellist.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01.html
@@ -22,3 +23,4 @@
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/stylesheet-with-base-expected.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/stylesheet-with-base.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/stylesheet.css
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/stylesheet.py
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/video_008-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/video_008-expected.txt
new file mode 100644
index 0000000..909138b
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/video_008-expected.txt
@@ -0,0 +1,4 @@
+
+
+FAIL HTML5 Media Elements: 'media' attribute assert_true: expected true got false
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/video_008.htm b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/video_008.htm
new file mode 100644
index 0000000..dff49d8
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/video_008.htm
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+    <title>HTML5 Media Elements: 'media' attribute</title>
+    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
+    <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+    <link rel="help" href="http://www.w3.org/TR/html5/video.html#the-source-element" />
+    <meta name="assert" content="'media' attribute is 'all' by default." />
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <script type="text/javascript" src="/common/media.js"></script>
+    <script type="text/javascript">
+      var videotest = async_test();
+
+      function do_play(event)
+      {
+        videotest.step(function() {
+          var vid = document.getElementById("video0");
+          assert_true(vid.currentSrc.indexOf("movie_300") > 0);
+        });
+        videotest.done();
+      }
+
+    </script>
+  </head>
+  <body>
+  <div id='log'></div>
+
+  <video id="video0" autoplay onplay="do_play(event);">
+    <script type="text/javascript">
+
+      document.write(
+        "<source media='not all' src='" + getVideoURI("/media/movie_300") + "'" +
+        " />"
+      );
+      document.write(
+        "<source src='" + getVideoURI("/media/movie_5") + "'" +
+        " media='all' />"
+      );
+
+    </script>
+    Your browser does not support media elements.
+  </video>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/historical-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/historical-expected.txt
new file mode 100644
index 0000000..a343293
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/historical-expected.txt
@@ -0,0 +1,4 @@
+
+PASS Canvas support for supportsContext 
+FAIL Canvas support for probablySupportsContext assert_false: expected false got true
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/historical.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/historical.html
new file mode 100644
index 0000000..bf96e9e
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/historical.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Historical canvas features</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+var canvas;
+setup(function() {
+  canvas = document.createElement("canvas");
+});
+["supportsContext", "probablySupportsContext"].forEach(function(m) {
+  test(function() {
+    assert_false(m in canvas);
+  }, "Canvas support for " + m);
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-expected.txt
new file mode 100644
index 0000000..791caf6
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-expected.txt
@@ -0,0 +1,5 @@
+    
+
+PASS We have the right embed element 
+PASS Check that the right things loaded 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-subdocument.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-subdocument.html
new file mode 100644
index 0000000..a2c2a93
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-subdocument.html
@@ -0,0 +1,4 @@
+<script>
+  var varName = location.search.substr(1);
+  parent[varName] = true;
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback.html
new file mode 100644
index 0000000..16192ac
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Ensure that embed elements inside object elements load when the objects
+  fall back but not otherwise</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+  var child1Loaded = false;
+  var child2Loaded = false;
+  var child3Loaded = false;
+  var parent3Loaded = false;
+</script>
+<object>
+  <embed src="embed-in-object-fallback-subdocument.html?child1Loaded">
+</object>
+<object>
+  <embed id="two" src="embed-in-object-fallback-subdocument.html?child2Loaded">
+  <!--  Something that forces the embed to be in the tree before the <object>
+       is done parsing  -->
+  <script>
+    test(function() {
+      assert_equals(document.getElementById("two").localName,
+                    "embed");
+    }, "We have the right embed element");
+  </script>
+</object>
+<object data="embed-in-object-fallback-subdocument.html?parent3Loaded">
+  <embed src="embed-in-object-fallback-subdocument.html?child3Loaded">
+</object>
+<script>
+  var t = async_test("Check that the right things loaded");
+  onload = t.step_func_done(function() {
+    assert_true(child1Loaded, "child 1 should load");
+    assert_true(child2Loaded, "child 2 should load");
+    assert_false(child3Loaded, "child 3 should not load");
+    assert_true(parent3Loaded, "parent 3 should load");
+  });
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_child.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_child.html
new file mode 100644
index 0000000..738ceee
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_child.html
@@ -0,0 +1,14 @@
+<body>
+    Child.
+    <iframe id="grandchild" src="change_grandchild.html"></iframe>
+</body>
+<script>
+    var timer = window.setInterval(poll, 100);
+    function poll() {
+        if (document.body.getAttribute("data-contains-grandchild")) {
+            var grandchild = document.getElementById("grandchild");
+            window.frameElement.parentNode.appendChild(grandchild);
+            window.clearTimeout(timer);
+        }
+    }
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_grandchild.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_grandchild.html
new file mode 100644
index 0000000..885622c
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_grandchild.html
@@ -0,0 +1,4 @@
+<body>Grandchild.</body>
+<script>
+    window.frameElement.parentNode.setAttribute("data-contains-grandchild", true);
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_parentage-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_parentage-expected.txt
new file mode 100644
index 0000000..83e23cd
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_parentage-expected.txt
@@ -0,0 +1,4 @@
+  
+
+PASS Change the frame heriarchy 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_parentage.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_parentage.html
new file mode 100644
index 0000000..1d62ccc
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_parentage.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Change the frame heriarchy</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+  <iframe src="change_child.html"></iframe>
+</body>
+<script>
+    async_test(function(t) {
+        var timer = window.setInterval(t.step_func(poll), 100);
+        function poll() {
+            // We wait for the grandchild's script to set the custom attribtue.
+            // Note that if this test passes, the grandchild's script must have been run twice,
+            // once to trigger the move from the child to here, and once to pass this test.
+            if (document.body.getAttribute("data-contains-grandchild")) {
+                window.clearTimeout(timer);
+                t.done();
+            }
+        }
+    });
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html
new file mode 100644
index 0000000..8b44fe8
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html
@@ -0,0 +1,12 @@
+<script src="iframe_harness.js"></script>
+<body>
+  <iframe src="cross_origin_grandchild.html"></iframe>
+</body>
+<script>
+    send_test_results({
+        "id": '79a52de8-4222-427e-92db-caec28e75f8e',
+        "parent": window.parent !== window,
+        "grandparent": window.parent.parent === window.parent,
+        "top": window.top === window.parent,
+    });
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_grandchild.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_grandchild.html
new file mode 100644
index 0000000..1eff64a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_grandchild.html
@@ -0,0 +1,11 @@
+<script src="iframe_harness.js"></script>
+<body>
+</body>
+<script>
+    send_test_results({
+        "id": '6c8da65d-2c5e-44ef-bb0b-b8b9849aab19',
+        "parent": window.parent !== window,
+        "grandparent": window.parent.parent !== window.parent,
+        "top": window.top === window.parent.parent,
+    });
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage-expected.txt
new file mode 100644
index 0000000..626c2d2
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage-expected.txt
@@ -0,0 +1,7 @@
+Blocked access to external URL http://www1.web-platform.test:8000/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html
+
+
+FAIL Check the frame heriarchy assert_equals: expected 200 but got 500
+FAIL Check the frame heriarchy 1 assert_equals: expected 200 but got 500
+FAIL Check the frame heriarchy 2 assert_equals: expected 200 but got 500
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html
new file mode 100644
index 0000000..cd27b8e
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Check the frame heriarchy</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="iframe_harness.js"></script>
+<body>
+  <iframe src="http://www1.web-platform.test:8000/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html"></iframe>
+</body>
+<script>
+    get_test_results('bffa23ee-b45a-4e9a-9405-87ab437d5cfa');
+    get_test_results('79a52de8-4222-427e-92db-caec28e75f8e');
+    get_test_results('6c8da65d-2c5e-44ef-bb0b-b8b9849aab19');
+    send_test_results({
+        "id": 'bffa23ee-b45a-4e9a-9405-87ab437d5cfa',
+        "parent": window.parent === window,
+        "top": window.top === window,
+    });
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen-expected.txt
new file mode 100644
index 0000000..2a8af53
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen-expected.txt
@@ -0,0 +1,9 @@
+
+
+FAIL iframe-allowfullscreen assert_true: Top level document has fullscreen enabled flag set expected true got undefined
+FAIL iframe-sandbox-allowfullscreen assert_true: Top level document has fullscreen enabled flag set expected true got undefined
+FAIL iframe-allowfullscreen-dialog assert_true: Top level document has fullscreen enabled flag set expected true got undefined
+FAIL iframe-sandbox-allowfullscreen-dialog assert_true: Top level document has fullscreen enabled flag set expected true got undefined
+FAIL iframe-noload-noallowfullscreen assert_false: Fullscreen should not be enabled without allowfullscreen attribute expected false got undefined
+FAIL iframe-noload-allowfullscreen assert_true: Fullscreen should be enabled with allowfullscreen attribute expected true got undefined
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html
new file mode 100644
index 0000000..9071a0b
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html
@@ -0,0 +1,115 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Check how allowfullscreen affects fullscreen enabled flag</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/browsers.html#initialise-the-document-object">
+<link rel="help" href="https://fullscreen.spec.whatwg.org/#fullscreen-enabled-flag">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<div id="log"></div>
+<script>
+  function test_allowfullscreen(t, setup_iframe) {
+    var iframe = document.createElement("iframe");
+    setup_iframe(iframe);
+    iframe.src = "support/blank.htm";
+    var eventWatcher = new EventWatcher(t, iframe, "load");
+    document.body.appendChild(iframe);
+    t.add_cleanup(function() {
+      document.body.removeChild(iframe);
+    });
+
+    assert_true(document.fullscreenEnabled, "Top level document has fullscreen enabled flag set");
+    eventWatcher.wait_for("load").then(t.step_func(function() {
+      assert_false(iframe.contentDocument.fullscreenEnabled, "Document inside iframe without allowfullscreen attribute should not have fullscreen enabled flag set");
+      iframe.setAttribute("allowfullscreen", true);
+      assert_false(iframe.contentDocument.fullscreenEnabled, "Setting allowfullscreen attribute after document load should not affect fullscreen enabled flag");
+      iframe.contentWindow.location.reload();
+      return eventWatcher.wait_for("load");
+    })).then(t.step_func(function() {
+      assert_true(iframe.contentDocument.fullscreenEnabled, "Fullscreen enabled flag should be set when a new document is loaded with allowfullscreen attribute present");
+      iframe.removeAttribute("allowfullscreen");
+      assert_true(iframe.contentDocument.fullscreenEnabled, "Removing allowfullscreen attribute should not affect fullscreen enabled flag");
+      iframe.contentWindow.location.reload();
+      return eventWatcher.wait_for("load");
+    })).then(t.step_func_done(function() {
+      assert_false(iframe.contentDocument.fullscreenEnabled, "Fullscreen enabled flag should be reset when a new document is loaded with allowfullscreen attribute absent");
+    }));
+  }
+
+  async_test(function(t) {
+    test_allowfullscreen(t, function(iframe) {});
+  }, "iframe-allowfullscreen");
+
+  async_test(function(t) {
+    test_allowfullscreen(t, function(iframe) {
+      iframe.setAttribute("sandbox", "allow-same-origin");
+    });
+  }, "iframe-sandbox-allowfullscreen");
+
+  /* Fullscreen enabled flag with dialog */
+
+  function test_allowfullscreen_dialog(t, setup_iframe, check) {
+    var iframe = document.createElement("iframe");
+    setup_iframe(iframe);
+    iframe.src = "support/blank.htm";
+    var eventWatcher = new EventWatcher(t, iframe, "load");
+    document.body.appendChild(iframe);
+    t.add_cleanup(function() {
+      document.body.removeChild(iframe);
+    });
+
+    var newWin;
+    assert_true(document.fullscreenEnabled, "Top level document has fullscreen enabled flag set");
+    eventWatcher.wait_for("load").then(t.step_func(function() {
+      assert_false(iframe.contentDocument.fullscreenEnabled, "Document inside iframe without allowfullscreen attribute should not have fullscreen enabled flag set");
+      newWin = iframe.contentWindow.open("support/blank.htm");
+      t.add_cleanup(function() {
+        newWin.close();
+      });
+      var newWinEventWatcher = new EventWatcher(t, newWin, "load");
+      return newWinEventWatcher.wait_for("load");
+    })).then(t.step_func_done(function() {
+      check(newWin);
+    }));
+  }
+
+  async_test(function(t) {
+    test_allowfullscreen_dialog(t, function() {}, function(newWin) {
+      assert_true(newWin.document.fullscreenEnabled, "Document in the new window is a top level document, thus should has fullscreen enabled flag set");
+    });
+  }, "iframe-allowfullscreen-dialog");
+
+  async_test(function(t) {
+    test_allowfullscreen_dialog(t, function(iframe) {
+      iframe.setAttribute("sandbox", "allow-same-origin allow-popups");
+    }, function(newWin) {
+      assert_false(newWin.document.fullscreenEnabled, "Document in the new window should inherit the sandboxed fullscreen flag and should not have fullscreen enabled flag set");
+    });
+  }, "iframe-sandbox-allowfullscreen-dialog");
+
+  /* Fullscreen enabled flag with about:blank */
+
+  function test_allowfullscreen_noload(setup_iframe, check) {
+    var iframe = document.createElement("iframe");
+    setup_iframe(iframe);
+    document.body.appendChild(iframe);
+    check(iframe.contentDocument);
+    document.body.removeChild(iframe);
+  }
+
+  test(function() {
+    test_allowfullscreen_noload(function() {}, function(doc) {
+      assert_false(doc.fullscreenEnabled, "Fullscreen should not be enabled without allowfullscreen attribute");
+    });
+  }, "iframe-noload-noallowfullscreen");
+
+  test(function() {
+    test_allowfullscreen_noload(function(iframe) {
+      iframe.setAttribute("allowfullscreen", true);
+    }, function(doc) {
+      assert_true(doc.fullscreenEnabled, "Fullscreen should be enabled with allowfullscreen attribute");
+    });
+  }, "iframe-noload-allowfullscreen");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event-expected.txt
new file mode 100644
index 0000000..2ce73f6
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event-expected.txt
@@ -0,0 +1,5 @@
+
+
+FAIL load event of blob URL assert_true: The iframe element should represent a nested browsing context. expected true got false
+FAIL load event of initial about:blank assert_true: The object element should represent a nested browsing context. expected true got false
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html
new file mode 100644
index 0000000..d245bf0
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html
@@ -0,0 +1,48 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test some sanity behavior around iframe load/error events</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<body>
+<script>
+async_test(function(t) {
+  var obj = document.createElement("iframe");
+  obj.onload = t.step_func_done(function(e){
+    assert_true(obj.contentWindow instanceof Window, "The iframe element should represent a nested browsing context.")
+    assert_equals(Object.getPrototypeOf(e).constructor, Event, "The load event should use the Event interface.");
+    assert_true(e.isTrusted, "The load event should be a trusted event.");
+    assert_false(e.cancelable, "The load event should not be a cancelable event.");
+    assert_false(e.bubbles, "The load event should not be a bubble event.");
+    assert_equals(e.target, obj, "The load event target should be the corresponding object element.");
+  });
+
+  obj.onerror = t.step_func_done(function(e){
+    assert_unreached("The error event should not be fired.");
+  });
+
+  var url = URL.createObjectURL(new Blob([""], { type: "text/html" }));
+
+  obj.src = url;
+  document.body.appendChild(obj);
+}, "load event of blob URL");
+
+async_test(function(t) {
+  var obj = document.createElement("iframe");
+  obj.onload = t.step_func_done(function(e){
+    assert_true(obj.contentWindow instanceof Window, "The object element should represent a nested browsing context.")
+    assert_equals(Object.getPrototypeOf(e).constructor, Event, "The load event should use the Event interface.");
+    assert_true(e.isTrusted, "The load event should be a trusted event.");
+    assert_false(e.cancelable, "The load event should not be a cancelable event.");
+    assert_false(e.bubbles, "The load event should not be a bubble event.");
+    assert_equals(e.target, obj, "The load event target should be the corresponding object element.");
+  });
+
+  obj.onerror = t.step_func_done(function(e){
+    assert_unreached("The error event should not be fired.");
+  });
+
+  document.body.appendChild(obj);
+}, "load event of initial about:blank");
+
+</script>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_harness.js b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_harness.js
new file mode 100644
index 0000000..f4ef511
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_harness.js
@@ -0,0 +1,26 @@
+function get_test_results(id) {
+    async_test(function(test) {
+        var timer = window.setInterval(test.step_func(loop), 100);
+        function loop() {
+            var xhr = new XMLHttpRequest();
+            xhr.open('GET', 'stash.py?id=' + id);
+            xhr.onreadystatechange = test.step_func(function() {
+                assert_equals(xhr.status, 200);
+                if (xhr.responseText) {
+                    assert_equals(xhr.responseText, "OK");
+                    test.done();
+                    window.clearTimeout(timer);
+                }
+            });
+            xhr.send();
+        }
+    });
+}
+
+function send_test_results(results) {
+    var ok = true;
+    for (result in results) { ok = ok && results[result]; }
+    var xhr = new XMLHttpRequest();
+    xhr.open('POST', 'stash.py?id=' + results.id);
+    xhr.send(ok ? "OK" : "FAIL: " + JSON.stringify(results));
+}
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-expected.txt
new file mode 100644
index 0000000..f88e6f0
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-expected.txt
@@ -0,0 +1,6 @@
+CONSOLE MESSAGE: line 7: Error while parsing the 'sandbox' attribute: 'allow-popups-to-escape-sandbox' is an invalid sandbox flag.
+
+
+FAIL Check that popups from a sandboxed iframe escape the sandbox if
+       allow-popups-to-escape-sandbox is used assert_equals: Should have escaped the sandbox expected "http://localhost:8800" but got "null"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping.html
new file mode 100644
index 0000000..271f846
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Check that popups from a sandboxed iframe escape the sandbox if
+       allow-popups-to-escape-sandbox is used</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<iframe sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox">
+</iframe>
+<script>
+  var t = async_test();
+  var ourOrigin;
+  onmessage = t.step_func(function(e) {
+    assert_equals(e.data, "hello", "This is our origin getter message");
+    ourOrigin = e.origin;
+
+    onmessage = t.step_func_done(function(e) {
+      assert_equals(e.origin, "null", "It came from a sandboxed iframe");
+      assert_equals(e.data.data, undefined, "Should have the right message");
+      assert_equals(e.data.origin, ourOrigin, "Should have escaped the sandbox");
+    });
+
+    document.querySelector("iframe").src = "iframe_sandbox_popups_helper.html";
+  });
+  postMessage("hello", "*");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper.html
new file mode 100644
index 0000000..ee993dd
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<script>
+  var popupWin;
+  if (opener) {
+    // We're the popup.  Send back our state.  What we really want to send is
+    // our origin, but that will come automatically.
+    opener.postMessage(undefined, "*");
+    self.close();
+  } else {
+    // We're the child.  Start listening for messages and open ourselves as the
+    // popup.
+    onmessage = function (e) {
+      parent.postMessage({ data: e.data, origin: e.origin }, "*");
+    };
+    popupWin = window.open(location.href);
+  }
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-expected.txt
new file mode 100644
index 0000000..c5cc843
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-expected.txt
@@ -0,0 +1,4 @@
+
+
+PASS Check that popups from a sandboxed iframe do not escape the sandbox 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping.html
new file mode 100644
index 0000000..546f9d5
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Check that popups from a sandboxed iframe do not escape the sandbox</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+  var t = async_test();
+  onmessage = t.step_func_done(function(e) {
+    assert_equals(e.origin, "null", "It came from a sandboxed iframe");
+    assert_equals(e.data.data, undefined, "Should have the right message");
+    assert_equals(e.data.origin, "null", "Should not have escaped the sandbox");
+  });
+</script>
+<iframe sandbox="allow-scripts allow-popups"
+        src="iframe_sandbox_popups_helper.html"></iframe>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_child.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_child.html
new file mode 100644
index 0000000..a36e231
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_child.html
@@ -0,0 +1,12 @@
+<script src="iframe_harness.js"></script>
+<body>
+  <iframe src="same_origin_grandchild.html"></iframe>
+</body>
+<script>
+    send_test_results({
+        "id": '08782f28-e313-47ae-8cd7-419f3e194b0a',
+        "parent": window.parent !== window,
+        "grandparent": window.parent.parent === window.parent,
+        "top": window.top === window.parent,
+    });
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_grandchild.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_grandchild.html
new file mode 100644
index 0000000..e7a2293
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_grandchild.html
@@ -0,0 +1,11 @@
+<script src="iframe_harness.js"></script>
+<body>
+</body>
+<script>
+    send_test_results({
+        "id": '66de8d44-7da7-47c7-9a52-41cba4f22bfe',
+        "parent": window.parent !== window,
+        "grandparent": window.parent.parent !== window.parent,
+        "top": window.top === window.parent.parent,
+    });
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage-expected.txt
new file mode 100644
index 0000000..98f8181
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage-expected.txt
@@ -0,0 +1,6 @@
+
+
+FAIL Check the frame heriarchy assert_equals: expected 200 but got 500
+FAIL Check the frame heriarchy 1 assert_equals: expected 200 but got 500
+FAIL Check the frame heriarchy 2 assert_equals: expected 200 but got 500
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage.html
new file mode 100644
index 0000000..a163eb8
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Check the frame heriarchy</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="iframe_harness.js"></script>
+<body>
+  <iframe src="same_origin_child.html"></iframe>
+</body>
+<script>
+    get_test_results('17381dae-9c3e-4661-9f2b-28eb07a5f2fc');
+    get_test_results('08782f28-e313-47ae-8cd7-419f3e194b0a');
+    get_test_results('66de8d44-7da7-47c7-9a52-41cba4f22bfe');
+    send_test_results({
+        "id": '17381dae-9c3e-4661-9f2b-28eb07a5f2fc',
+        "parent": window.parent === window,
+        "top": window.top === window,
+    });
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/stash.py b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/stash.py
new file mode 100644
index 0000000..0b8693a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/stash.py
@@ -0,0 +1,10 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+def main(request, response):
+    if request.method == 'POST':
+        request.server.stash.put(request.GET["id"], request.body)
+        return ''
+    return request.server.stash.take(request.GET["id"])
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change-expected.txt
index 5ea6810..7d37d99 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change-expected.txt
@@ -4,7 +4,7 @@
 
 PASS img (no src), onload, narrow 
 PASS img (no src), resize to wide 
-FAIL img (empty src), onload, narrow assert_equals: expected "" but got "http://localhost:8800/html/semantics/embedded-content/the-img-element/environment-changes/iframed.sub.html?id=e9f61391-d442-4103-aea8-4444a42342e7"
+FAIL img (empty src), onload, narrow assert_equals: expected "" but got "http://localhost:8800/html/semantics/embedded-content/the-img-element/environment-changes/iframed.sub.html?id=d8d26f64-5aa4-456c-a535-7ac76894546f"
 PASS img (empty src), resize to wide 
 PASS img (src only) broken image, onload, narrow 
 PASS img (src only) broken image, resize to wide 
@@ -26,7 +26,7 @@
 FAIL picture: same URL in source (max-width:500px) and img, resize to wide assert_unreached: Got unexpected load event Reached unreachable code
 PASS img (no src), onload, wide 
 PASS img (no src), resize to narrow 
-FAIL img (empty src), onload, wide assert_equals: expected "" but got "http://localhost:8800/html/semantics/embedded-content/the-img-element/environment-changes/iframed.sub.html?id=c9ab9dc7-6bed-4687-8ff7-ef8d18c8fc1e"
+FAIL img (empty src), onload, wide assert_equals: expected "" but got "http://localhost:8800/html/semantics/embedded-content/the-img-element/environment-changes/iframed.sub.html?id=f1cb87a8-4fac-47a8-9808-f8ae48010ebd"
 PASS img (empty src), resize to narrow 
 PASS img (src only) broken image, onload, wide 
 PASS img (src only) broken image, resize to narrow 
@@ -36,13 +36,13 @@
 PASS img (srcset 1 cand) broken image, resize to narrow 
 PASS img (srcset 1 cand) valid image, onload, wide 
 PASS img (srcset 1 cand) valid image, resize to narrow 
-FAIL picture: source (max-width:500px) broken image, img broken image, onload, wide assert_equals: expected "http://localhost:8800/images/broken.png?71-c9ab9dc7-6bed-4687-8ff7-ef8d18c8fc1e" but got "http://localhost:8800/images/broken.png?70-c9ab9dc7-6bed-4687-8ff7-ef8d18c8fc1e"
+FAIL picture: source (max-width:500px) broken image, img broken image, onload, wide assert_equals: expected "http://localhost:8800/images/broken.png?71-f1cb87a8-4fac-47a8-9808-f8ae48010ebd" but got "http://localhost:8800/images/broken.png?70-f1cb87a8-4fac-47a8-9808-f8ae48010ebd"
 TIMEOUT picture: source (max-width:500px) broken image, img broken image, resize to narrow Test timed out
-FAIL picture: source (max-width:500px) broken image, img valid image, onload, wide assert_equals: expected "http://localhost:8800/images/green-2x2.png?81-c9ab9dc7-6bed-4687-8ff7-ef8d18c8fc1e" but got "http://localhost:8800/images/broken.png?80-c9ab9dc7-6bed-4687-8ff7-ef8d18c8fc1e"
+FAIL picture: source (max-width:500px) broken image, img valid image, onload, wide assert_equals: expected "http://localhost:8800/images/green-2x2.png?81-f1cb87a8-4fac-47a8-9808-f8ae48010ebd" but got "http://localhost:8800/images/broken.png?80-f1cb87a8-4fac-47a8-9808-f8ae48010ebd"
 TIMEOUT picture: source (max-width:500px) broken image, img valid image, resize to narrow Test timed out
-FAIL picture: source (max-width:500px) valid image, img broken image, onload, wide assert_equals: expected "http://localhost:8800/images/broken.png?91-c9ab9dc7-6bed-4687-8ff7-ef8d18c8fc1e" but got "http://localhost:8800/images/green-1x1.png?90-c9ab9dc7-6bed-4687-8ff7-ef8d18c8fc1e"
+FAIL picture: source (max-width:500px) valid image, img broken image, onload, wide assert_equals: expected "http://localhost:8800/images/broken.png?91-f1cb87a8-4fac-47a8-9808-f8ae48010ebd" but got "http://localhost:8800/images/green-1x1.png?90-f1cb87a8-4fac-47a8-9808-f8ae48010ebd"
 TIMEOUT picture: source (max-width:500px) valid image, img broken image, resize to narrow Test timed out
-FAIL picture: source (max-width:500px) valid image, img valid image, onload, wide assert_equals: expected "http://localhost:8800/images/green-2x2.png?101-c9ab9dc7-6bed-4687-8ff7-ef8d18c8fc1e" but got "http://localhost:8800/images/green-1x1.png?100-c9ab9dc7-6bed-4687-8ff7-ef8d18c8fc1e"
+FAIL picture: source (max-width:500px) valid image, img valid image, onload, wide assert_equals: expected "http://localhost:8800/images/green-2x2.png?101-f1cb87a8-4fac-47a8-9808-f8ae48010ebd" but got "http://localhost:8800/images/green-1x1.png?100-f1cb87a8-4fac-47a8-9808-f8ae48010ebd"
 TIMEOUT picture: source (max-width:500px) valid image, img valid image, resize to narrow Test timed out
 PASS picture: same URL in source (max-width:500px) and img, onload, wide 
 PASS picture: same URL in source (max-width:500px) and img, resize to narrow 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src-expected.txt
new file mode 100644
index 0000000..e7e4b84
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src-expected.txt
@@ -0,0 +1,6 @@
+
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT Loading a non-parsing URL as an image should silently fail; triggering appropriate events Test timed out
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src.html
new file mode 100644
index 0000000..a4323da
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Loading a non-parsing URL as an image should silently fail; triggering appropriate events</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<img id=myimg />
+<script>
+async_test(function(t) {
+    var img = document.getElementById("myimg");
+    img.src = "http://also a broken url";
+    var errorevent = false;
+
+    // The errors should be queued in the event loop, so they should only trigger
+    // after this block of code finishes, not during the img.src setter itself
+    img.addEventListener('error', t.step_func(function(){errorevent = true;}));
+    img.addEventListener('loadend', t.step_func_done(function() {
+        assert_true(errorevent, "error event fired");
+    }));
+});
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/w3c-import.log
index 3e844b8..0d89938 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/w3c-import.log
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/w3c-import.log
@@ -23,5 +23,6 @@
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/document-base-url.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-1.jpg
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/img.complete.html
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/invalid-src.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/update-media.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body-expected.txt
new file mode 100644
index 0000000..b5407fd
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body-expected.txt
@@ -0,0 +1,14 @@
+
+
+PASS form submission from form should navigate to url with x-www-form-urlencoded 
+PASS form submission from form should navigate to url with multipart/form-data 
+FAIL form submission from form should navigate to url with text/plain assert_equals: expected "OK" but got "FAIL"
+PASS form submission from button should navigate to url with x-www-form-urlencoded 
+PASS form submission from button should navigate to url with multipart/form-data 
+FAIL form submission from button should navigate to url with text/plain assert_equals: expected "OK" but got "FAIL"
+PASS form submission from input should navigate to url with x-www-form-urlencoded 
+PASS form submission from input should navigate to url with multipart/form-data 
+FAIL form submission from input should navigate to url with text/plain assert_equals: expected "OK" but got "FAIL"
+PASS form submission from submit input should contain submit button value 
+PASS form submission from submit button should contain submit button value 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body.html
new file mode 100644
index 0000000..0edc0f3
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body.html
@@ -0,0 +1,113 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+var simple_tests = [
+  {
+    name: "form submission from form should navigate to url with x-www-form-urlencoded",
+    input: "<input name=foo value=bara>",
+    enctype: "application/x-www-form-urlencoded",
+    submitelement: "",
+    submitaction: function(doc) { doc.getElementById("testform").submit(); }
+  },
+  {
+    name: "form submission from form should navigate to url with multipart/form-data",
+    input: "<textarea name=foo>bar</textarea>",
+    enctype: "multipart/form-data",
+    submitelement: "",
+    submitaction: function(doc) { doc.getElementById("testform").submit(); }
+  },
+  {
+    name: "form submission from form should navigate to url with text/plain",
+    input: "<textarea name=qux>baz</textarea>",
+    enctype: "text/plain",
+    submitelement: "",
+    submitaction: function(doc) { doc.getElementById("testform").submit(); }
+  },
+  {
+    name: "form submission from button should navigate to url with x-www-form-urlencoded",
+    input: "<input name=foo value=bara>",
+    enctype: "application/x-www-form-urlencoded",
+    submitelement: "<button id=buttonsubmit type=\"submit\">Submit</button>",
+    submitaction: function(doc) { doc.getElementById("buttonsubmit").click(); }
+  },
+  {
+    name: "form submission from button should navigate to url with multipart/form-data",
+    input: "<textarea name=foo>bar</textarea>",
+    enctype: "multipart/form-data",
+    submitelement: "<button id=buttonsubmit type=\"submit\">Submit</button>",
+    submitaction: function(doc) { doc.getElementById("buttonsubmit").click(); }
+  },
+  {
+    name: "form submission from button should navigate to url with text/plain",
+    input: "<textarea name=qux>baz</textarea>",
+    enctype: "text/plain",
+    submitelement: "<button id=buttonsubmit type=\"submit\">Submit</button>",
+    submitaction: function(doc) { doc.getElementById("buttonsubmit").click(); }
+  },
+  {
+    name: "form submission from input should navigate to url with x-www-form-urlencoded",
+    input: "<input name=foo value=bara>",
+    enctype: "application/x-www-form-urlencoded",
+    submitelement: "<input id=inputsubmit type=\"submit\">Submit</input>",
+    submitaction: function(doc) { doc.getElementById("inputsubmit").click(); }
+  },
+  {
+    name: "form submission from input should navigate to url with multipart/form-data",
+    input: "<textarea name=foo>bar</textarea>",
+    enctype: "multipart/form-data",
+    submitelement: "<input id=inputsubmit type=\"submit\">Submit</input>",
+    submitaction: function(doc) { doc.getElementById("inputsubmit").click(); }
+  },
+  {
+    name: "form submission from input should navigate to url with text/plain",
+    input: "<input name=qux value=baz>",
+    enctype: "text/plain",
+    submitelement: "<input id=inputsubmit type=\"submit\">Submit</input>",
+    submitaction: function(doc) { doc.getElementById("inputsubmit").click(); }
+  },
+  {
+    name: "form submission from submit input should contain submit button value",
+    input: "<button type=submit name=notclicked value=nope>not clicked</button>",
+    enctype: "application/x-www-form-urlencoded",
+    submitelement: "<button id=inputsubmit type=\"submit\" name=foo value=bara>Submit</button>",
+    submitaction: function(doc) { doc.getElementById("inputsubmit").click(); }
+  }
+,
+  {
+    name: "form submission from submit button should contain submit button value",
+    input: "<input type=submit name=notclicked value=nope/>",
+    enctype: "application/x-www-form-urlencoded",
+    submitelement: "<input id=inputsubmit type=\"submit\" name=foo value=bara >",
+    submitaction: function(doc) { doc.getElementById("inputsubmit").click(); }
+  }
+];
+simple_tests.forEach(function(test_obj) {
+  test_obj.test = async_test(test_obj.name);
+});
+function run_simple_test() {
+  if (simple_tests.length == 0) {
+    return;
+  }
+  var test_obj = simple_tests.pop();
+  var t = test_obj.test;
+  var testframe = document.getElementById("testframe");
+  var testdocument = testframe.contentWindow.document;
+  testdocument.body.innerHTML =
+    "<form id=testform method=post action=\"form-submission.py\" enctype=\"" + test_obj.enctype + "\">" +
+    test_obj.input +
+    test_obj.submitelement +
+    "</form>";
+  testframe.onload = function() {
+    t.step(function (){
+      var response = testframe.contentDocument.documentElement.textContent;
+      assert_equals(response, "OK");
+    });
+    t.done();
+    run_simple_test();
+  };
+  test_obj.submitaction(testdocument);
+}
+</script>
+<iframe id=testframe src="/common/blank.html" onload="run_simple_test();"></iframe>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange-expected.txt
index 062cecc..fdaa87a 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange-expected.txt
@@ -7,6 +7,8 @@
 PASS input setSelectionRange return void 
 PASS input setSelectionRange(0,1) 
 PASS input setSelectionRange(0,input.value.length+1) 
+PASS input setSelectionRange(input.value.length+1,input.value.length+1) 
+PASS input setSelectionRange(input.value.length+1,input.value.length+1) 
 PASS input setSelectionRange(2,2) 
 PASS input setSelectionRange(2,1) 
 PASS input direction of setSelectionRange(0,1,"backward") 
@@ -15,6 +17,8 @@
 PASS input direction of setSelectionRange(0,1,"hoge") 
 PASS input direction of setSelectionRange(0,1,"BACKWARD") 
 PASS input direction of setSelectionRange(0,1) 
+FAIL input setSelectionRange(1,-1) assert_equals: element.selectionStart should be 1 expected 1 but got 0
+FAIL input setSelectionRange(-1,1) assert_equals: ECMAScript conversion to unsigned long + if end is less than or equal to start then the start of the selection and the end of the selection must both be placed immediately before the character with offset end expected 1 but got 0
 PASS input setSelectionRange("string",1) 
 PASS input setSelectionRange(true,1) 
 PASS input setSelectionRange([],1) 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html
index 5f52573..60d591b 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html
@@ -32,6 +32,18 @@
   },'input setSelectionRange(0,input.value.length+1)');
 
   test(function() {
+    input.setSelectionRange(input.value.length+1,input.value.length+1)
+    assert_equals(input.selectionStart, input.value.length, "Arguments (start) greater than the length of the value of the text field must be treated as pointing at the end of the text field");
+    assert_equals(input.selectionEnd, input.value.length, "Arguments (end) greater than the length of the value of the text field must be treated as pointing at the end of the text field");
+  },'input setSelectionRange(input.value.length+1,input.value.length+1)');
+
+  test(function() {
+    input.setSelectionRange(input.value.length+1,1)
+    assert_equals(input.selectionStart, 1, "If end is less than or equal to start then the start of the selection and the end of the selection must both be placed immediately before the character with offset end");
+    assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");
+  },'input setSelectionRange(input.value.length+1,input.value.length+1)');
+
+  test(function() {
     input.setSelectionRange(2,2)
     assert_equals(input.selectionStart, 2, "If end is less than or equal to start then the start of the selection and the end of the selection must both be placed immediately before the character with offset end");
     assert_equals(input.selectionEnd, 2, "If end is less than or equal to start then the start of the selection and the end of the selection must both be placed immediately before the character with offset end");
@@ -74,6 +86,18 @@
   },'input direction of setSelectionRange(0,1)');
 
   test(function() {
+    input.setSelectionRange(1,-1);
+    assert_equals(input.selectionStart, 1, "element.selectionStart should be 1");
+    assert_equals(input.selectionEnd, input.value.length, "ECMAScript conversion to unsigned long");
+  },'input setSelectionRange(1,-1)');
+
+  test(function() {
+    input.setSelectionRange(-1,1);
+    assert_equals(input.selectionStart, 1, "ECMAScript conversion to unsigned long + if end is less than or equal to start then the start of the selection and the end of the selection must both be placed immediately before the character with offset end");
+    assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");
+  },'input setSelectionRange(-1,1)');
+
+  test(function() {
     input.setSelectionRange("string",1);
     assert_equals(input.selectionStart, 0, "element.selectionStart should be 0");
     assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element-expected.txt
new file mode 100644
index 0000000..548ea37
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element-expected.txt
@@ -0,0 +1,4 @@
+ 
+
+PASS form.elements should be accessed correctly by index 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element.html
new file mode 100644
index 0000000..44471aa
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>form.elements: indexed</title>
+<link rel="author" title="Ivan.Yang" href="mailto:jsyangwenjie@gmail.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<form id=form>
+<input type="radio" name="radio1" id="r1" value=1>
+<input type="radio" name="radio2" id="r2" value=2>
+</form>
+</div>
+<script>
+test(function() {
+  var form = document.getElementById("form");
+  assert_equals(form[0], document.getElementById("r1"));
+  assert_equals(form[1], document.getElementById("r2"));
+  assert_equals(form[2], undefined);
+  assert_equals(form[-1], undefined);
+  }, "form.elements should be accessed correctly by index")
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html
new file mode 100644
index 0000000..2f3ce23
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Script is not executed after script thread is shutdown</title>
+<script>
+onload = function() {
+  script_executed = parent.script_executed;
+  s = document.createElement('script');
+  s.type = 'text/javascript';
+  s.src = 'script-not-executed-after-shutdown.js?pipe=trickle(d3)';
+  document.body.appendChild(s);
+};
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-expected.txt
new file mode 100644
index 0000000..0a3e91a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-expected.txt
@@ -0,0 +1,3 @@
+
+PASS Script is not executed after script thread is shutdown 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html
new file mode 100644
index 0000000..704e8ed
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Script is not executed after script thread is shutdown</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<iframe id="testiframe" src="script-not-executed-after-shutdown-child.html"></iframe>
+<script>
+async_test(function(t) {
+  window.script_executed = t.unreached_func("script executed in removed iframe");
+  let iframe = document.getElementById("testiframe");
+  iframe.onload = function() {
+    iframe.parentNode.removeChild(iframe);
+  };
+  setTimeout(function() {
+    t.done();
+  }, 5000);
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js
new file mode 100644
index 0000000..ccdf14c
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js
@@ -0,0 +1 @@
+script_executed();
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/scripting-enabled-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/scripting-enabled-expected.txt
new file mode 100644
index 0000000..73b428b
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/scripting-enabled-expected.txt
@@ -0,0 +1,3 @@
+
+PASS script on document returned by createHTMLDocument should not execute 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/scripting-enabled.html b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/scripting-enabled.html
new file mode 100644
index 0000000..a2671a7
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/scripting-enabled.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>JS is disabled on documents created without a browsing context</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-n-script">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(function(t) {
+  var doc = document.implementation.createHTMLDocument();
+  window.fail_test = t.unreached_func('should not have been called');
+
+  var script = doc.createElement('script');
+  script.textContent = 'fail_test();';
+  doc.documentElement.appendChild(script);
+}, 'script on document returned by createHTMLDocument should not execute');
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/w3c-import.log
index 55938eb..98da23c 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/w3c-import.log
+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/w3c-import.log
@@ -39,6 +39,9 @@
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-languages-01.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-languages-02.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-noembed-noframes-iframe.xhtml
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed-2.py
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.py
diff --git a/LayoutTests/imported/w3c/web-platform-tests/lint.whitelist b/LayoutTests/imported/w3c/web-platform-tests/lint.whitelist
index debd9f5..f5225bc 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/lint.whitelist
+++ b/LayoutTests/imported/w3c/web-platform-tests/lint.whitelist
@@ -109,6 +109,10 @@
 CONSOLE:service-workers/service-worker/navigation-redirect.https.html
 CONSOLE:service-workers/service-worker/resources/clients-get-other-origin.html
 
+# use of console in a public library - annotation-model ensures
+# it is not actually used
+CONSOLE:annotation-model/scripts/ajv.min.js
+
 # Lint doesn't know about sub.svg I guess
 PARSE-FAILED:content-security-policy/svg/including.sub.svg
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-strategies.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-strategies.https-expected.txt
index fa8af34..6dac12f 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-strategies.https-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-strategies.https-expected.txt
@@ -4,7 +4,10 @@
 PASS Readable stream: strategy.size errors the stream and then returns Infinity 
 PASS Readable stream: throwing strategy.size method 
 PASS Readable stream: throwing strategy.highWaterMark getter 
-PASS Readable stream: invalid strategy.highWaterMark 
+FAIL Readable stream: invalid strategy.highWaterMark assert_throws: construction should throw a RangeError for NaN function "() => {
+      new ReadableStream({}, {
+        size() {
+ ..." threw object "TypeError: highWaterMark parameter is not a number" ("TypeError") expected object "RangeError" ("RangeError")
 PASS Readable stream: invalid strategy.size return value 
 FAIL Load bad-strategies.js with SharedWorker assert_unreached: SharedWorker is unavailable Reached unreachable code
 FAIL Untitled undefined is not an object (evaluating 'navigator.serviceWorker.getRegistration')
@@ -13,6 +16,9 @@
 PASS Readable stream: strategy.size errors the stream and then returns Infinity 
 PASS Readable stream: throwing strategy.size method 
 PASS Readable stream: throwing strategy.highWaterMark getter 
-PASS Readable stream: invalid strategy.highWaterMark 
+FAIL Readable stream: invalid strategy.highWaterMark assert_throws: construction should throw a RangeError for NaN function "() => {
+      new ReadableStream({}, {
+        size() {
+ ..." threw object "TypeError: highWaterMark parameter is not a number" ("TypeError") expected object "RangeError" ("RangeError")
 PASS Readable stream: invalid strategy.size return value 
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-strategies.js b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-strategies.js
index 0c053ab..5a52d60 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-strategies.js
+++ b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-strategies.js
@@ -114,7 +114,7 @@
 
 test(() => {
 
-  for (const highWaterMark of [-1, -Infinity]) {
+  for (const highWaterMark of [-1, -Infinity, NaN, 'foo', {}]) {
     assert_throws(new RangeError(), () => {
       new ReadableStream({}, {
         size() {
@@ -125,17 +125,6 @@
     }, 'construction should throw a RangeError for ' + highWaterMark);
   }
 
-  for (const highWaterMark of [NaN, 'foo', {}]) {
-    assert_throws(new TypeError(), () => {
-      new ReadableStream({}, {
-        size() {
-          return 1;
-        },
-        highWaterMark
-      });
-    }, 'construction should throw a TypeError for ' + highWaterMark);
-  }
-
 }, 'Readable stream: invalid strategy.highWaterMark');
 
 promise_test(() => {