summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/html')
-rw-r--r--testing/web-platform/tests/html/OWNERS9
-rw-r--r--testing/web-platform/tests/html/browsers/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/aborting-a-document-load/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-1.html11
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-2.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001.html30
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/MANIFEST16
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html31
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html35
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html6
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-2.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-3.html6
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-4.html6
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html13
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html41
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html47
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_3.html47
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/contains.json6
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/events.html151
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/hashchange_event.html43
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank1.html8
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank2.html8
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/page-with-fragment.html20
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/post_name_on_load.html7
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resume-timer-on-history-back.html145
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-basic.html34
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html67
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html54
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-cross-origin.html71
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-samedoc.html81
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/popstate_event.html40
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/unset_context_name-1.html7
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/unset_context_name.html7
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001-1.html7
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001-2.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001-3.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001.html20
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/002-1.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/002-2.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/002.html23
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-1.html7
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-2.html9
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-3.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003.html22
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-1.html7
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-2.html9
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-3.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004.html22
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/005.html16
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/006.html17
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/007.html16
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/008.html17
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/009.html22
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/010.html17
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/011.html21
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/012.html20
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/013.html20
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/014.html21
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/015.html20
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/MANIFEST42
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/blank.html1
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-1.html3
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-2.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-3.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location.html17
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-1.html3
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-2.html6
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-3.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit.html18
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/click.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment.html20
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html11
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/href.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-query-fragment-components.html28
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling.html36
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_data_url-1.html7
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_data_url.html20
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_same_origin-1.html7
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_same_origin.html20
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-parent.html17
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-src.html17
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function.html18
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-src-about-blank.html17
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/dummy.html3
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/location-set.html8
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/set-parent-src.html8
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/read-html/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/read-media/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-image.html30
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-video.html30
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/read-multipart-x-mixed-replace/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/read-plugin/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/read-text/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/read-text/load-text-plain.html40
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/read-ua-inline/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/read-xml/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/001.html16
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/002.html21
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/003.html25
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/004.html23
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/005.html23
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/006.html34
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/007.html37
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/MANIFEST7
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-percent-encoded.html59
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html53
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-id-top.html51
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-top.html60
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/001.html15
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/002.html15
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/003.html15
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/004.html15
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/005.html15
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/MANIFEST33
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/base.html14
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back-1.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back.html31
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-1.html2
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-2.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent.html31
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/contains.json6
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-1.html10
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-2.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload.html26
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward-1.html2
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward.html19
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-1.html10
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-2.html1
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001.html14
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002-1.html7
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002.html20
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/003.html20
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/MANIFEST14
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-001.html9
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-002.html9
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-003.html11
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-004.html11
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-005.html22
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-006.html9
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/next.html2
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001-1.html23
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001a.html7
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001b.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002-1.html28
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002a.html7
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002b.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003-1.html23
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003a.html8
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003b.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004-1.html25
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004a.html8
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004b.html18
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005-1.html13
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005a.html8
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005b.html17
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-1.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-2.html2
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001.html25
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002-1.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002.html33
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003-1.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003.html33
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004-1.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004.html28
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-1.html20
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-2.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006.html18
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-1.html21
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-2.html5
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007.html28
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008-1.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008.html16
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009-1.html4
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009.html16
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/MANIFEST21
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/manual-001-1.html2
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/manual-001.html5
-rw-r--r--testing/web-platform/tests/html/browsers/history/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/history/history-notes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child1.html18
-rw-r--r--testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child2.html5
-rw-r--r--testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild1.html8
-rw-r--r--testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild2.html5
-rw-r--r--testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html30
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/001.html333
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/002.html308
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/004.html62
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/005.html47
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/006.html53
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/007.html56
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/008.html40
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/008.js11
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/009-1.html20
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/009-3.html28
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/009-5.html23
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/009.html22
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/010-1.html16
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/010-3.html24
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/010-5.html23
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/010.html22
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/011.html32
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/012.html32
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/blank.html8
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/blank2.html13
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/blank3.html11
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_001.html20
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_002.html22
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_003.html26
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_004.html29
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_005.html34
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_006.html30
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_007.html32
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history.js35
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_back-1.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_back.html27
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_back_1.html28
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_entry.html12
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-1.html15
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-2.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward.html32
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward_1.html28
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_minus.html27
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html18
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument.html29
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_plus.html33
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined-1.html15
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined.html28
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero-1.html18
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero.html29
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate.html19
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_err.html18
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_nooptionalparam.html20
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate.html20
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_err.html18
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_nooptionalparam.html20
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/history_state.html24
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001-1.html72
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001.html18
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002-1.html35
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002.html18
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/filler.html5
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history.js35
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history_entry.html12
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-1.html18
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-manual.html31
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-1.html18
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-manual.html31
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-1.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-manual.html30
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html18
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1.html28
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2.html28
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3.html28
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4.html28
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5.html28
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html30
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1-1.html15
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html30
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html12
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html28
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html12
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html29
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html12
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html29
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html197
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-1.html9
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-2.html7
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load.html23
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-1.html7
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-2.html7
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load.html23
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/contains.json6
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html15
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/document_location.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting.html18
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location-stringifier.html11
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign.html26
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank-1.html2
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank.html24
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_hash.html33
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_host.html28
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_hostname.html33
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_href.html19
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_origin.html14
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_pathname.html22
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_port.html31
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_protocol.html25
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload-iframe.html4
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html41
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_replace.html20
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/location_search.html20
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-1.html7
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-2.html7
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-manual.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-1.html10
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-2.html7
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-manual.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_replace_during_load-manual.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-1.html9
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-2.html7
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-manual.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-1.html15
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-manual.html26
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write-1.html14
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write.html26
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write-1.html4
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write.html21
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload-1.html9
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload.html26
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/reload_post_1-1.html10
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/reload_post_1.html27
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/same_origin_frame.html12
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-1.html10
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-2.html7
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-1.html13
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-2.html7
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load.html16
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-1.html12
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-2.html7
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load.html17
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-location-interface/security_location_0.sub.htm27
-rw-r--r--testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/offline/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/offline/appcache/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/offline/application-cache-api/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_checking-manual.html23
-rw-r--r--testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_downloading-manual.html24
-rw-r--r--testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_idle.html22
-rw-r--r--testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html24
-rw-r--r--testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_uncached.html19
-rw-r--r--testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_updateready-manual.html25
-rw-r--r--testing/web-platform/tests/html/browsers/offline/application-cache-api/api_swapcache-manual.html30
-rw-r--r--testing/web-platform/tests/html/browsers/offline/application-cache-api/api_swapcache_error.html19
-rw-r--r--testing/web-platform/tests/html/browsers/offline/application-cache-api/api_update.html24
-rw-r--r--testing/web-platform/tests/html/browsers/offline/application-cache-api/api_update_error.html24
-rw-r--r--testing/web-platform/tests/html/browsers/offline/browser-state/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_event-manual.html40
-rw-r--r--testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_online.html17
-rw-r--r--testing/web-platform/tests/html/browsers/offline/changestonetworkingmodel/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/offline/changestonetworkingmodel/original-id.json1
-rw-r--r--testing/web-platform/tests/html/browsers/offline/disk-space/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/offline/downloading-or-updating-an-application-cache/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/offline/expiring-application-caches/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/offline/introduction-4/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/offline/introduction-4/contains.json10
-rw-r--r--testing/web-platform/tests/html/browsers/offline/introduction-4/event_cached.html18
-rw-r--r--testing/web-platform/tests/html/browsers/offline/introduction-4/event_checking.html18
-rw-r--r--testing/web-platform/tests/html/browsers/offline/introduction-4/event_downloading-manual.html23
-rw-r--r--testing/web-platform/tests/html/browsers/offline/introduction-4/event_error-manual.html23
-rw-r--r--testing/web-platform/tests/html/browsers/offline/introduction-4/event_noupdate.html19
-rw-r--r--testing/web-platform/tests/html/browsers/offline/introduction-4/event_obsolete-manual.html23
-rw-r--r--testing/web-platform/tests/html/browsers/offline/introduction-4/event_progress.html18
-rw-r--r--testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready-manual.html22
-rw-r--r--testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready_swapcache-manual.html30
-rw-r--r--testing/web-platform/tests/html/browsers/offline/manifest_main_empty-manual.html14
-rw-r--r--testing/web-platform/tests/html/browsers/offline/manifest_notchanged_online-manual.html19
-rw-r--r--testing/web-platform/tests/html/browsers/offline/manifest_section_empty-manual.html19
-rw-r--r--testing/web-platform/tests/html/browsers/offline/manifest_section_many-manual.html19
-rw-r--r--testing/web-platform/tests/html/browsers/offline/manifest_url_check.html18
-rw-r--r--testing/web-platform/tests/html/browsers/offline/manifests/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/offline/manifests/contains.json14
-rw-r--r--testing/web-platform/tests/html/browsers/offline/resources/css/clock.css1
-rw-r--r--testing/web-platform/tests/html/browsers/offline/resources/css/offline.css5
-rw-r--r--testing/web-platform/tests/html/browsers/offline/resources/css/online.css5
-rw-r--r--testing/web-platform/tests/html/browsers/offline/resources/css/result.css11
-rw-r--r--testing/web-platform/tests/html/browsers/offline/resources/html/clock.html12
-rw-r--r--testing/web-platform/tests/html/browsers/offline/resources/js/clock.js3
-rw-r--r--testing/web-platform/tests/html/browsers/offline/resources/manifest/clock.manifest17
-rw-r--r--testing/web-platform/tests/html/browsers/offline/resources/manifest/section_empty.manifest10
-rw-r--r--testing/web-platform/tests/html/browsers/offline/resources/manifest/section_many.manifest19
-rw-r--r--testing/web-platform/tests/html/browsers/offline/resources/manifest/url_check.manifest17
-rw-r--r--testing/web-platform/tests/html/browsers/offline/section_network_offline-manual.html17
-rw-r--r--testing/web-platform/tests/html/browsers/offline/section_network_online-manual.html16
-rw-r--r--testing/web-platform/tests/html/browsers/offline/the-application-cache-selection-algorithm/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/origin/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-on-new-window.html25
-rw-r--r--testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html373
-rw-r--r--testing/web-platform/tests/html/browsers/origin/cross-origin-objects/frame.html39
-rw-r--r--testing/web-platform/tests/html/browsers/origin/cross-origin-objects/win-documentdomain.sub.html63
-rw-r--r--testing/web-platform/tests/html/browsers/origin/origin-of-data-document.html28
-rw-r--r--testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html25
-rw-r--r--testing/web-platform/tests/html/browsers/sandboxing/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/Document-defaultView.html38
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/Window-document.html25
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html47
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html62
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html30
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/iterator.html11
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html12
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html6
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html8
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/window_length.html51
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/callback.js1
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload-1.html7
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload.html16
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer-1.html1
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer.html18
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload-1.html7
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload.html16
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html38
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-1.html2
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-2.html16
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001.html3
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-1.html8
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-2.html16
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002.html3
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/browser-interface-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/closing-browsing-contexts/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html20
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html2
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html10
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html22
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2.html10
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html21
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html4
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html4
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3.html9
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html21
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html4
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html4
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4.html9
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html27
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html2
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-manual.html10
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html19
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html1
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html1
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-manual.html10
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html78
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/test.html7
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-null-names.html20
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/security-window/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.sub.html203
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/support/noopener-target.html8
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-locationbar-manual.html29
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-menubar-manual.html29
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-personalbar-manual.html29
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-scrollbars-manual.html29
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-statusbar-manual.html29
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-toolbar-manual.html29
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/window-aliases.html28
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-strict.html43
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties.html35
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/window-named-properties.html77
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/window-open-noopener.html105
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/window-properties.html322
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/window-prototype-chain.html35
-rw-r--r--testing/web-platform/tests/html/browsers/windows/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/contains.json6
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-first-created.xhtml54
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/001-1.html8
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/001.html22
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/002-1.html8
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/002.html25
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/MANIFEST4
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html25
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent.html20
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html20
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html20
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-default-name.html26
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/existing.html11
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/message.html9
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/parent1.html5
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/parent2.html9
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/self1.html11
-rw-r--r--testing/web-platform/tests/html/browsers/windows/browsing-context-names/self2.html11
-rw-r--r--testing/web-platform/tests/html/browsers/windows/groupings-of-browsing-contexts/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/MANIFEST1
-rw-r--r--testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/contains.json6
-rw-r--r--testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html74
-rw-r--r--testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/test.html7
-rw-r--r--testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/testcase3.html14
-rw-r--r--testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-top-001.html63
-rw-r--r--testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-close-manual.sub.html3
-rw-r--r--testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-manual.html10
-rw-r--r--testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-window-name.sub.html3
-rw-r--r--testing/web-platform/tests/html/browsers/windows/noreferrer-window-name.html85
-rw-r--r--testing/web-platform/tests/html/browsers/windows/noreferrer.html25
-rw-r--r--testing/web-platform/tests/html/browsers/windows/secondary-browsing-contexts/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/windows/security-nav/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/browsers/windows/support-close.html1
-rw-r--r--testing/web-platform/tests/html/browsers/windows/support-named-null-opener.html8
-rw-r--r--testing/web-platform/tests/html/browsers/windows/support-nested-browsing-contexts.html12
-rw-r--r--testing/web-platform/tests/html/browsers/windows/support-opener-null.html4
-rw-r--r--testing/web-platform/tests/html/browsers/windows/support-post-to-opener.html8
-rw-r--r--testing/web-platform/tests/html/browsers/windows/support-window-name-echo.html1
-rw-r--r--testing/web-platform/tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.sub.html39
-rw-r--r--testing/web-platform/tests/html/dom/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/documents/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.body.html169
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.currentScript.sub.html211
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null-undef.html30
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Element.getElementsByClassName-null-undef.html30
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/cross-domain.js1
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.embeds-document.plugins-01.html55
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.forms.html70
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByClassName-same.html17
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-case-xhtml.xhtml21
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-case.html16
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-id-xhtml.xhtml20
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-id.html15
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-interface.html16
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-namespace-xhtml.xhtml32
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-namespace.html27
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-xhtml.xhtml126
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements.html47
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-null-undef-xhtml.xhtml35
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-null-undef.html30
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-param-xhtml.xhtml28
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-param.html23
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-same.html17
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.head-01.html22
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.head-02.html20
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.images.html105
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-01.html32
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-02.xhtml37
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-03.html31
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-04.xhtml48
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-05.html42
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-06.html19
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-07.html11
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-08.html22
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-09.html97
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-01.html19
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-02.html99
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-03.html110
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-04.html104
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-05.html104
-rw-r--r--testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-06.html104
-rw-r--r--testing/web-platform/tests/html/dom/documents/loading-xml-documents/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-01.html13
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-02.html14
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-03.html12
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-04.xhtml18
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-05.xhtml19
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-06.xhtml17
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-cookie.html20
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified-01.html51
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified.html15
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified.html.headers1
-rw-r--r--testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-readyState.html33
-rw-r--r--testing/web-platform/tests/html/dom/documents/security-document/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/documents/the-document-object/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/closing-the-input-stream/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/closing-the-input-stream/document.close-01.xhtml19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/001.html12
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/002.html13
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/003.html14
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/004.html14
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/005.html14
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/005.js1
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/006.html14
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/006.js1
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/007.html15
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/007.js4
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/008-1.js3
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/008.html15
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/008.js4
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/009.html15
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/010-1.js4
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/010.html15
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/010.js4
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/011-1.js5
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/011.html15
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/011.js5
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/012.html15
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/012.js5
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/013.html15
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/013.js1
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/014.html15
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/015.html16
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/016.html16
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/017.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/018.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/019.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/020.html18
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/021.html18
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/022.html18
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/023.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/024.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/025.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/026.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/027.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/028.html21
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/029.html21
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/030.html21
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/031.html21
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/032.html22
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/033.html20
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/034.html21
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/035.html21
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/036.html21
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/037.html21
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/038.html21
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/039.html21
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/040.html10
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/041.html13
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/042.html16
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/043.html16
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/044.html17
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/045.html20
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/046.html20
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/047.html15
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/048.html15
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/049.html18
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/050.html25
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/051.html16
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/document.write-01.xhtml19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/document.write-02.html27
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_001.html14
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_002.html22
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_003.html23
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_004.html22
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_005.html25
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_005.js3
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_006.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_007.html17
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_008.html18
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_009.html21
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_010.html23
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-1.html2
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-2.html7
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-external.js1
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/original-id.json1
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_001.html10
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_002.html20
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_003.html10
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_004.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_005.html20
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_006.html20
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_007.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_008.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_009.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_010.html22
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_011.html22
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_012.html22
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_013.html24
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-01.xhtml19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-02.html27
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-03.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/original-id.json1
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/001.html20
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/002.html12
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/004-1.html1
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/004.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/005.html16
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/006.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/007.html19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/008.html20
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/009.html34
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-1.html2
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-2.html5
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010.html22
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011-1.html5
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011.html9
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/012-1.html7
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/012.html9
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/013-1.html7
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/013.html9
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/014-1.html9
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/014.html9
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/015-1.html17
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/015.html14
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/016-1.html39
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/016.html15
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-01.xhtml19
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-02.html27
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03-frame.html10
-rw-r--r--testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03.html19
-rw-r--r--testing/web-platform/tests/html/dom/elements-embedded.js149
-rw-r--r--testing/web-platform/tests/html/dom/elements-forms.js143
-rw-r--r--testing/web-platform/tests/html/dom/elements-grouping.js60
-rw-r--r--testing/web-platform/tests/html/dom/elements-metadata.js40
-rw-r--r--testing/web-platform/tests/html/dom/elements-misc.js61
-rw-r--r--testing/web-platform/tests/html/dom/elements-obsolete.js58
-rw-r--r--testing/web-platform/tests/html/dom/elements-sections.js63
-rw-r--r--testing/web-platform/tests/html/dom/elements-tabular.js109
-rw-r--r--testing/web-platform/tests/html/dom/elements-text.js64
-rw-r--r--testing/web-platform/tests/html/dom/elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/elements/content-models/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/elements/content-models/contains.json48
-rw-r--r--testing/web-platform/tests/html/dom/elements/element-definitions/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/elements/element-definitions/contains.json6
-rw-r--r--testing/web-platform/tests/html/dom/elements/elements-in-the-dom/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/elements/elements-in-the-dom/unknown-element.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/.htaccess16
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/classlist-nonstring.html44
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/contains.json38
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/custom-attrs.html29
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/data_unicode_attr.html22
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dataset-delete.html47
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dataset-enumeration.html31
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dataset-get.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dataset-prototype.html26
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dataset-set.html42
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dataset.html38
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-L-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-L.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-R-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-R.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-L-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-L.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-L-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-L.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-R-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-R.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-ref.html51
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN.html51
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-L-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-L.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-R-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-R.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-R-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-R.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-L-ref.html61
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-L.html62
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-R-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-R.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-L-ref.html60
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-L.html61
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-R-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-R.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-L-ref.html60
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-L.html61
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-R-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-R.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-L-ref.html60
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-L.html61
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-R-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-R.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-L-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-L.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-R-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-R.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-L-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-L.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-R-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-R.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-L-ref.html60
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-L.html61
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-R-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-R.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-L-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-L.html59
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-R-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-R.html59
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-L-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-L.html59
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-L-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-L.html59
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-R-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-R.html59
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-ref.html53
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN.html54
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-L-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-L.html59
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-R-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-R.html59
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-R-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-R.html59
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-L-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-L.html70
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-R-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-R.html70
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-L-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-L.html70
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-L-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-L.html70
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-R-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-R.html70
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-ref.html53
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN.html69
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-L-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-L.html70
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-R-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-R.html70
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-R-ref.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-R.html70
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-isolate-ref.html57
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-isolate.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-EN-ref.html49
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-EN.html66
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-between-Rs-ref.html61
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-between-Rs.html76
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-mixed-ref.html61
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-mixed.html77
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-EN-ref.html49
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-EN.html66
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-between-Rs-ref.html64
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-between-Rs.html79
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-mixed-ref.html64
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-mixed.html80
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-EN-ref.html49
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-EN.html77
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-between-Rs-ref.html65
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-between-Rs.html86
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-mixed-ref.html64
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-mixed.html100
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/document-dir.html26
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/id-attribute.html130
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/id-name-specialcase.html30
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/id-name.html17
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/lang-xmllang-01-ref.html20
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/lang-xmllang-01.html58
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/lang-xyzzy-ref.html9
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/lang-xyzzy.html12
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/style-01-ref.html24
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/style-01.html26
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-001.html41
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-002.html41
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-003.html41
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-003.html.headers1
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-004.html42
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-005.html41
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-005.html.headers1
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-006.html42
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-006.html.headers1
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-007.html42
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-008.html41
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-009.html41
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-009.html.headers1
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-010.html42
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-011.html.headers1
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-007.html29
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-008.html29
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-009.html29
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-010.html29
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-011.html29
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-012.html29
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006a.html32
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006b.html32
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006c.html32
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009a.html33
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009b.html33
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009c.html33
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-001-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002a-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002b-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002c-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-003-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-004-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-005-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006c-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-007-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-008-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009b-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/semantics-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/elements/wai-aria/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/elements/wai-aria/README.md1
-rw-r--r--testing/web-platform/tests/html/dom/elements/wai-aria/contains.json18
-rw-r--r--testing/web-platform/tests/html/dom/interactions-with-xpath-and-xslt/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/dom/interfaces.html3339
-rw-r--r--testing/web-platform/tests/html/dom/new-harness.js22
-rw-r--r--testing/web-platform/tests/html/dom/original-harness.js332
-rw-r--r--testing/web-platform/tests/html/dom/reflection-embedded.html17
-rw-r--r--testing/web-platform/tests/html/dom/reflection-forms.html17
-rw-r--r--testing/web-platform/tests/html/dom/reflection-grouping.html17
-rw-r--r--testing/web-platform/tests/html/dom/reflection-metadata.html17
-rw-r--r--testing/web-platform/tests/html/dom/reflection-misc.html17
-rw-r--r--testing/web-platform/tests/html/dom/reflection-obsolete.html17
-rw-r--r--testing/web-platform/tests/html/dom/reflection-original.html40
-rw-r--r--testing/web-platform/tests/html/dom/reflection-sections.html17
-rw-r--r--testing/web-platform/tests/html/dom/reflection-tabular.html17
-rw-r--r--testing/web-platform/tests/html/dom/reflection-text.html17
-rw-r--r--testing/web-platform/tests/html/dom/reflection.js824
-rw-r--r--testing/web-platform/tests/html/editing/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/activation/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/activation/click.html18
-rw-r--r--testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/introduction-6/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/processing-model-4/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/the-accesskey-attribute/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/dnd/README23
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/001.xhtml50
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/002.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/003-1.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/003.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/004.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/005.xhtml26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/006.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/007.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/008.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/009.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/010-1.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/010.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/011.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/012.xhtml42
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/013.xhtml42
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/014.xhtml42
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/cross-domain/001.xhtml59
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/helper-drag-me-green-box.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/helper-drop-here-canvas.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/crashers/dialog-001.html38
-rw-r--r--testing/web-platform/tests/html/editing/dnd/cross-document/001-1.html47
-rw-r--r--testing/web-platform/tests/html/editing/dnd/cross-document/001.html23
-rw-r--r--testing/web-platform/tests/html/editing/dnd/cross-document/002.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/cross-document/003-1.html104
-rw-r--r--testing/web-platform/tests/html/editing/dnd/cross-document/003.html29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/001.xhtml71
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/002.xhtml54
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/003.xhtml55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/004.xhtml56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/005.xhtml56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/006.xhtml55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/007.xhtml57
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/008.xhtml56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/009-1.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/009.xhtml30
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/010-1.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/010.xhtml47
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/011.xhtml32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/012.xhtml33
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/013-1.xhtml28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/013.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/014-1.xhtml55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/014.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/015-manual.html62
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/016.xhtml58
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/017.xhtml58
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/018.xhtml59
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/019.xhtml59
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/020.xhtml64
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/021.xhtml60
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/022.xhtml74
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/023.xhtml55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/024.xhtml56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/025.xhtml56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/026.xhtml57
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/027.xhtml58
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/028.xhtml62
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/029.xhtml58
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/030.xhtml72
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/031.xhtml141
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/032.xhtml125
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/033.xhtml125
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/034.xhtml126
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/035.xhtml126
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/036.xhtml125
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/037.xhtml127
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/038.xhtml146
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/039.xhtml131
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/040.xhtml131
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/041.xhtml132
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/042.xhtml132
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/043.xhtml131
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/044.xhtml132
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/045.xhtml57
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/046.xhtml172
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/047.xhtml157
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/048.xhtml157
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/049.xhtml158
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/050.xhtml158
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/051.xhtml157
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/052.xhtml158
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/053.html83
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/054.html83
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/055.html46
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/056.xhtml55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/057.xhtml56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/058.html79
-rw-r--r--testing/web-platform/tests/html/editing/dnd/datastore/helper-drop-box-here.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dom/draggable.html207
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dom/events.html48
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dom/specials.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/draggable-areas/border-radius.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/draggable-areas/border.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/draggable-areas/box-shadow.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/draggable-areas/outline.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/draggable-areas/transform.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/draggable-areas/z-index.html35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/001.xhtml38
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/002.xhtml38
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/003.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/004.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/005.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/006.xhtml50
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/007.xhtml38
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/008.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/009.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/010.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/011.xhtml38
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/012.xhtml38
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/013.xhtml38
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/014.xhtml38
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/015.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/016.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/017.xhtml32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/018.xhtml39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/019.xhtml39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/020.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/021.xhtml38
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/022.xhtml39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/023.xhtml40
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/024.xhtml39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/025.html162
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/026.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/027.xhtml34
-rw-r--r--testing/web-platform/tests/html/editing/dnd/drop/028.html42
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/001.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/002.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/003.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/004.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/005.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/006.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/007.html54
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/008.html56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/009.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/dropzone/010.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/001-1.xhtml51
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/001.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/002-1.xhtml51
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/002.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/003-1.xhtml51
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/003.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/004.xhtml55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/005.xhtml55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/006.xhtml55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/007.xhtml56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/008.xhtml56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/009.xhtml56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/010.xhtml55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/011.xhtml55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/012.xhtml55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/013.xhtml56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/014.xhtml56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/015.xhtml56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/016.xhtml29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/017.xhtml29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/018.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/019.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/020.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/021.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/022.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/023.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/024.xhtml34
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/025.html69
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/026.html61
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/027.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/028.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/029.html79
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/030.html61
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/031-1.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/031.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/032.html81
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/033.html79
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/034.html56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/035.html83
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/036.html70
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/037-proposed.xhtml86
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/037-spec.xhtml88
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/038-proposed.html84
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/events-cross-document-suite-HELPER-1.html205
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/events-cross-document-suite-HELPER-2.html77
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/events-cross-document-suite-manual.html11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/events-file-suite-manual.html175
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/events-non-draggable-001.html60
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/events-non-draggable-002.html101
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/events-suite-manual.html370
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/helper-drag-me-input-with-circle.xhtml51
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/helper-drag-me-link-with-circle.xhtml51
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/helper-drag-me-p-with-circle.xhtml51
-rw-r--r--testing/web-platform/tests/html/editing/dnd/events/helper-drop-here-body-circle.xhtml51
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/001.html103
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/002.html146
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/003.html90
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/004.html51
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/005.html13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/006.html13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/007.html99
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/008.html113
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/009.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/010.html29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/011.html93
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/fail.txt1
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/prompt/001.html28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/prompt/002.html39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/prompt/003.html28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/prompt/004.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/prompt/005.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/prompt/006.html41
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/prompt/007.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/prompt/008.html41
-rw-r--r--testing/web-platform/tests/html/editing/dnd/file/prompt/009.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/001.xhtml32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/002.xhtml32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/003.xhtml32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/004.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/005.xhtml32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/006.xhtml34
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/007.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/008.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/009.xhtml34
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/010.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/011.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/012-1.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/012.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/013-1.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/013.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/014-1.xhtml32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/014.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/015.xhtml29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/016.xhtml28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/017.xhtml30
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/018.xhtml29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/021.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/022.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/023.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/024.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/025.xhtml39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/026.xhtml40
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/027.xhtml40
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/028.xhtml32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/cross-domain/001.xhtml49
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/helper-circle.xhtml9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/helper-drag-me-data-url-image.xhtml9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/helper-drop-horizontal-scrollbar.xhtml9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/helper-drop-image-here.xhtml28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/images/helper-drop-vertical-scrollbar.xhtml13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactive/frames-1.html18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactive/frames.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactive/object-retention.html144
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactive/plugins.html28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/001.html29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/002.html29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/003.html29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/004.html29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/005.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/006.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/007.html36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/008.html36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/009.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/010.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/011.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/012.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/015.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/016.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/017.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/018.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/019.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/020.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/021.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/interactiveelements/022.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/media/001.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/000.html93
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/001.html128
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/002.html106
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/003.html132
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/004.html116
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/005.html115
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/006.html105
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/007.html116
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/008.html94
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/009.html98
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/010.html104
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/011.html107
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/012.html104
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/013.html104
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/014.html97
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/015.html99
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/016.html160
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/017.html137
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/018.html95
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/019.html96
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/020.html99
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/021.html104
-rw-r--r--testing/web-platform/tests/html/editing/dnd/microdata/test2
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/001-1.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/001.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/002.xhtml14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/003.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/004.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/005.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/006.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/007-1.xhtml13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/007.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/008-1.xhtml13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/008.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/009-1.xhtml13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/009.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/010-1.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/010.xhtml14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/011-1.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/011.xhtml39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/012.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/013.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/014.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/015.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/016-1.xhtml30
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/016.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/017.xhtml14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/018.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/019.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/020.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/021-1.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/021.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/022-1.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/022.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/023-1.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/023.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/helper-drag-image-dont-drop.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/helper-drag-selection-dont-drop.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-here-reload.xhtml30
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-image-now.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-link-now.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-now.xhtml13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-selection-here.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/001.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/002.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/003.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/004.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/005.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/006.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/007.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/008.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/009.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/010.xhtml22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/011.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/012.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/013.xhtml28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/014.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/015.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/016.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/017.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/018.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/019.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/020.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/021.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/022.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/023.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/024.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/025.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/026.xhtml32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/027.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/028.xhtml32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/029.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/030.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/031.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/032.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/033.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/034.xhtml29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/035.xhtml30
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/036.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/038.xhtml23
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/039.xhtml23
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/040.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/041.xhtml35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/042.html59
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/043.html68
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/044.html53
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/045.html55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/046.html54
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/047.html55
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/048.html54
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/049.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/050.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/051.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/052.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/053.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/054.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/055.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/056.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/057.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/058.html29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/059.html20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/060.html30
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/061.html30
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/062.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-001.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-002.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-003.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-004.html19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-005.html15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-006.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-007.html20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-008.html31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-009.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-001.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-002.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-003.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-004.html21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-005.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-006.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/overlay/oversized-001.html18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/alttab.html12
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cancel-middle-click.html50
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cancel-right-click.html50
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/close-drag-001.html24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/close-drag-002.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/close-drag-003.html28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/close-drag-004.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/close-drag-005.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/close-drag-006.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cursors/001.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cursors/002.html26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cursors/003.html38
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cursors/004.html42
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cursors/005.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cursors/006.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cursors/007.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cursors/008.html51
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cursors/009.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cursors/010.html28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/cursors/011.html57
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/drag-keypress.html28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/drag-link.html12
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/drag-to-title.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/file-drop-position.html23
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/file-os-to-os.html13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/file-to-system.html50
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/html-to-os-HELPER-FILE.html14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/html-to-os.html20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/html-unicode-to-os.html19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/inputs-no-js.html15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/001.html47
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/002.html49
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/003.html59
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/004.html31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/005.html35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/006.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/007.html34
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/008.html40
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/009.html42
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/010.html39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/011.html40
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/012.html44
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/013.html47
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/014.html39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/015.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/016.html34
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/017.html40
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/018.html42
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/019.html39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/020.html33
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/021.html33
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/fail.txt1
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/file1.txt1
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/file2.txt1
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/interrupt/pass.txt1
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/keyboardshortcuts.html18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/modifiers/all.html175
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/modifiers/copy.html175
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/modifiers/copylink.html175
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/modifiers/copymove.html175
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/modifiers/link.html175
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/modifiers/linkmove.html175
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/modifiers/move.html175
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/modifiers/onlydropzone.html70
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/modifiers/onlydropzoneevents.html82
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/modifiers/releasemodifiersdrag.html125
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/modifiers/releasemodifiersdrop.html108
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/modifiers/scriptmodified.html99
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/moving-window.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/overlappingwindows.html56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/placeholderposition1.html14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/placeholderposition2.html14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/click-to-activate.js1
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/dragndrop.swfbin0 -> 4139 bytes
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/dragndropleavedeactivate.swfbin0 -> 4243 bytes
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-001.html21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-002.html39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-003.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-004.html41
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-005.html26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-006.html26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-007.html42
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-008.html41
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-009.html40
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-010.html41
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-011.html40
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-101.html21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-102.html39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-103.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-104.html41
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-105.html26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-106.html26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-107.html43
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-108.html41
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-109.html40
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-110.html41
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-111.html40
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-203.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-204.html41
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-205.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-206.html26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-207.html43
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-303.html22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-304.html41
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-305.html26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-306.html26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-307.html42
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hx133
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hxml1
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/mouseup.hx34
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/mouseup.hxml1
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/plugindrop.html24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/selection-between-ui.html20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/selection-from-os.html17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/selection-from-ui.html20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/selection-to-os.html14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/selection-to-ui-via.html19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/selection-to-ui.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/selection-ui-to-self.html21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/selection-unicode-to-os.html13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/taskbardrop.html23
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/taskbarminimise.html12
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/text-os-to-os.html13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/platform/text-to-os.html19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/001.xhtml39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/002.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/003.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/004.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/005.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/006.xhtml14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/007.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/008.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/009-1.xhtml9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/009.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/010-1.xhtml9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/010.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/011-1.xhtml9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/011.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/012-1.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/012-2.xhtml28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/reload/012.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/001.xhtml43
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/002.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/003.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/004.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/005.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/006.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/007.xhtml28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/008.xhtml28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/009.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/010.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/011.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/012.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/013.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/014.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/015.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/016.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/017.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/018.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/019.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/020.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/021.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/022-1.html26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/022.html28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/helper-drag-me-input.xhtml9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/helper-drag-me-link.xhtml9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/remove/helper-drag-me-p.xhtml9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/resources/100x100-navy.pngbin0 -> 278 bytes
-rw-r--r--testing/web-platform/tests/html/editing/dnd/resources/1x1-transparent.gifbin0 -> 43 bytes
-rw-r--r--testing/web-platform/tests/html/editing/dnd/resources/boxnavy.swfbin0 -> 4254 bytes
-rw-r--r--testing/web-platform/tests/html/editing/dnd/resources/circle.pngbin0 -> 1252 bytes
-rw-r--r--testing/web-platform/tests/html/editing/dnd/resources/crossorigin.sub.js13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/resources/fail.pngbin0 -> 759 bytes
-rw-r--r--testing/web-platform/tests/html/editing/dnd/resources/filler.html109
-rw-r--r--testing/web-platform/tests/html/editing/dnd/resources/pass.pngbin0 -> 1689 bytes
-rw-r--r--testing/web-platform/tests/html/editing/dnd/roundtrip/001.xhtml38
-rw-r--r--testing/web-platform/tests/html/editing/dnd/roundtrip/002.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/roundtrip/003.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/roundtrip/004.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/roundtrip/005.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/roundtrip/006.xhtml14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/roundtrip/007.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/roundtrip/008.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/001.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/002.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/003.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/004.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/005.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/006.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/007.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/008.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/009.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/010.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/011.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/012.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/013.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/014.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/015.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/016.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/017.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/018.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/019.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/020.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/021.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/022.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/023.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/024.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/025.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/026.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/027.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/028.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/029.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/030.xhtml23
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/031.xhtml34
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/032.xhtml33
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/033.xhtml23
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/034.xhtml22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/035.xhtml30
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/036.xhtml29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/037.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/038.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/039.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/040.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/041.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/042.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/043.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/044.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/045.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/046.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/047.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/048.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/049.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/050.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/051.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/052.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/053.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/054.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/055.xhtml23
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/056.xhtml23
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/057.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/058.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/059.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/060.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/061.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/062.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/063.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/064-1.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/064.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/065.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/066.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/067-1.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/067-2.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/067.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/068-1.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/068-2.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/068.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/069.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/070.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/071.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/072.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/073.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/074.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/075.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/076.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/077.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/078.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/079.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/080.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/081.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/082.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/083.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/084.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/085.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/086.xhtml36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/087.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/088.xhtml29
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/089.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/090.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/091-1.xhtml9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/091-2.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/091.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/092.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/093.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/094.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/095.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/096.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/097.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/098.xhtml26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/099.xhtml26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/100.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/101.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/102.xhtml22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/103.xhtml22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/104.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/105.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/106.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/107-1.html8
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/107.html5
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/108-1.html3
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/108.html5
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/109.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/110.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/111.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/112.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/113.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/114.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/115.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/116.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/117.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/118.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/119.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/120.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/121.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/122.xhtml22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/123.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/124.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/125.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/126.xhtml22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/127.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/128.xhtml26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/129.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/130.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/131.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/132.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/133.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/134.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/135.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/136.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/137.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/138.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/139.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/140.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/141.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/142.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/143.xhtml26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/144.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/145.xhtml31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/146.xhtml28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/147.html15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/148.html15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/149.html16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/150.html15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/151.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/152.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/153.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/154.xhtml17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/155.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/156.xhtml11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/157.xhtml11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/158.xhtml11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/159.xhtml11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/160.xhtml11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/161.xhtml11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/162.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/163.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/164.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/165.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/166.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/167.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/168.xhtml25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/169.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/170.xhtml33
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/171.xhtml39
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/172.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/173.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-input-to-other-input.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-input-to-other-textarea.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-input.xhtml10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-textarea-to-other-blue-box.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-textarea-to-other-input.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-textarea-to-other-textarea.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-blue-box-contenteditable.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-blue-box.xhtml22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-input.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-textarea.xhtml16
-rw-r--r--testing/web-platform/tests/html/editing/dnd/selection/helper-scroll-then-drop-input.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/001.svg9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/002.svg9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/003.svg13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/004.svg13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/005.svg8
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/006.svg9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/007.svg9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/008.svg13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/009.svg13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/010.svg8
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/011.svg15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/012.svg15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/013-1.xhtml15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/013.svg11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/014-1.xhtml18
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/014.svg10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/015-1.xhtml9
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/015.svg10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/016-1.xhtml22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/016.svg10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/017.xhtml14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/018.xhtml14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/019.xhtml19
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/020.xhtml27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/021.xhtml26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/022.xhtml26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/023.xhtml26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/024.xhtml22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/025.xhtml22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/026.xhtml22
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/027.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/028.xhtml20
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/029.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/030-1.svg5
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/030.xhtml32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/031.xhtml32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/032.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/033.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/034.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/035.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/036-1.svg4
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/036.xhtml11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/037.xhtml11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/038.xhtml11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/039-1.svg4
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/039.xhtml11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/040.xhtml11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/041.xhtml11
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/042.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/043.xhtml21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/044.svg10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/045.svg10
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/046.svg14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/047.svg13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/048.svg13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/049.xhtml14
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/050.xhtml13
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/051.xhtml24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/052.svg28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/053.svg30
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/054.svg35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/055.svg30
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/056.svg69
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/057.svg121
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/058.svg36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/059-1.svg21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/059.svg15
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/060-1.svg12
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/060.svg28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/061.svg27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/062.svg17
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/063.svg24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/064.svg26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/065.svg28
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/066.svg31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/067.svg35
-rw-r--r--testing/web-platform/tests/html/editing/dnd/svg/helper-drop-selection-here-textArea.svg5
-rw-r--r--testing/web-platform/tests/html/editing/dnd/synthetic/001.html120
-rw-r--r--testing/web-platform/tests/html/editing/dnd/synthetic/005-manual.html339
-rw-r--r--testing/web-platform/tests/html/editing/dnd/synthetic/006-manual.html78
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/001-manual.html110
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/002-manual.html86
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/003-manual.html95
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/004-1.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/004-manual.html36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/005-1.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/005-manual.html36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/006-manual.html52
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/007-manual.html52
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/008-manual.html53
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/009-manual.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/010-manual.html25
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/011-manual.html63
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/012-manual.html62
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/013-manual.html24
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/101-manual.html123
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/102-manual.html36
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/103-1.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/103-manual.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/104-1.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/104-manual.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/105-1.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/105-manual.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/106-1.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/106-manual.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/107-1.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/107-manual.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/108-1.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/108-manual.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/109-1.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/109-manual.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/110-1.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/110-manual.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/111-manual.html52
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/112-manual.html56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/113-manual.html50
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/114-manual.html56
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/115-manual.html50
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/116-manual.html31
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/117-1.html33
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/117-manual.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/118-1.html32
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/118-manual.html27
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/201-manual.html83
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/202.html64
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-mustallow.html26
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-mustblock.html21
-rw-r--r--testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-showorigin.html31
-rwxr-xr-xtesting/web-platform/tests/html/editing/dnd/the-datatransfer-interface/dndTransferCases-manual.html66
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dragevent-interface/dragevent-manual.html99
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-draggable-attribute/draggable_attribute.html123
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_file_type-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_kind_file-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_kind_string-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_string_type-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_inputbox_element-manual.html51
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_inputbox_element_dbcs-manual.html46
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_link_element-manual.html48
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_COpy-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_STRING-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_String_-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_linK-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_copy-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_foo-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_link-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_move-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_multiple_values_foo_bar_move-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_multiple_values_foo_link-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_multiple_values_move_copy-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_not_specified-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_unordered_unique_space_separated-manual.html53
-rw-r--r--testing/web-platform/tests/html/editing/editing-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/editing-0/best-practices-for-in-page-editors/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/editing-0/contenteditable/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/editing-0/contenteditable/contentEditable-invalidvalue.html16
-rw-r--r--testing/web-platform/tests/html/editing/editing-0/contenteditable/user-interaction-editing-contenteditable.html54
-rw-r--r--testing/web-platform/tests/html/editing/editing-0/editing-apis/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/original-id.json1
-rw-r--r--testing/web-platform/tests/html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/user-interaction-editing-designMode.html26
-rw-r--r--testing/web-platform/tests/html/editing/editing-0/spelling-and-grammar-checking/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/editing-0/spelling-and-grammar-checking/user-interaction-editing-spellcheck.html35
-rw-r--r--testing/web-platform/tests/html/editing/focus/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/focus/document-level-focus-apis/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/focus/document-level-focus-apis/document-level-apis.html34
-rw-r--r--testing/web-platform/tests/html/editing/focus/document-level-focus-apis/test.html5
-rw-r--r--testing/web-platform/tests/html/editing/focus/element-level-focus-apis/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/focus/focus-01-manual.html43
-rw-r--r--testing/web-platform/tests/html/editing/focus/focus-02-manual.html38
-rw-r--r--testing/web-platform/tests/html/editing/focus/focus-management/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/focus/focus-management/focus-event-targets-simple.html33
-rw-r--r--testing/web-platform/tests/html/editing/focus/focus-management/focus-events.html32
-rw-r--r--testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-default-value.html21
-rw-r--r--testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-negative-manual.html44
-rw-r--r--testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-order-manual.html59
-rw-r--r--testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-positive-manual.html43
-rw-r--r--testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-zero-manual.html45
-rw-r--r--testing/web-platform/tests/html/editing/inert-subtrees/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/inert-subtrees/the-inert-attribute/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/the-hidden-attribute/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1-ref.html4
-rw-r--r--testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1a.html8
-rw-r--r--testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1b.html11
-rw-r--r--testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1c.html12
-rw-r--r--testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1d.html12
-rw-r--r--testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1e.html10
-rw-r--r--testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1f.html10
-rw-r--r--testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1g.html11
-rw-r--r--testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-2-ref.svg7
-rw-r--r--testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-2.svg12
-rw-r--r--testing/web-platform/tests/html/iana/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/iana/application-x-www-form-urlencoded/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/iana/application-x-www-form-urlencoded/original-id.json1
-rw-r--r--testing/web-platform/tests/html/iana/application-xhtml-xml/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/iana/application-xhtml-xml/original-id.json1
-rw-r--r--testing/web-platform/tests/html/iana/multipart-x-mixed-replace/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/iana/multipart-x-mixed-replace/original-id.json1
-rw-r--r--testing/web-platform/tests/html/iana/ping-to/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/iana/text-cache-manifest/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/iana/text-cache-manifest/original-id.json1
-rw-r--r--testing/web-platform/tests/html/iana/text-html/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/iana/text-html/original-id.json1
-rw-r--r--testing/web-platform/tests/html/iana/web-scheme-prefix/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/iana/web-scheme-prefix/original-id.json1
-rw-r--r--testing/web-platform/tests/html/infrastructure/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/case-sensitivity-and-string-comparison/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-dom-interfaces/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/contains.json14
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html47
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html116
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html216
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html78
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-dom-interfaces/domstringmap/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-dom-interfaces/garbage-collection/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-dom-interfaces/reflecting-content-attributes-in-idl-attributes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-dom-interfaces/safe-passing-of-structured-data/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-dom-interfaces/transferable-objects/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/boolean-attributes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/colors/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/comma-separated-tokens/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/common-parser-idioms/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/dates-and-times/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/dates-and-times/contains.json42
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/keywords-and-enumerated-attributes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/mq/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/numbers/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/numbers/contains.json26
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/space-separated-tokens/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/common-microsyntaxes/syntax-references/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/conformance-requirements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/conformance-requirements/conformance-classes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/conformance-requirements/dependencies/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/conformance-requirements/extensibility/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/conformance-requirements/extensibility/foreign.html45
-rw-r--r--testing/web-platform/tests/html/infrastructure/fetching-resources/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/fetching-resources/content-type-sniffing/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/fetching-resources/cors-enabled-fetch/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/fetching-resources/cors-settings-attributes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/fetching-resources/encrypted-http-and-related-security-concerns/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/fetching-resources/extracting-character-encodings-from-meta-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/fetching-resources/processing-model/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/fetching-resources/terminology-1/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/namespaces/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/terminology/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/terminology/character-encodings/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/terminology/dom-trees/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/terminology/plugins/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/terminology/plugins/sample.txt3
-rw-r--r--testing/web-platform/tests/html/infrastructure/terminology/plugins/text-plain.html32
-rw-r--r--testing/web-platform/tests/html/infrastructure/terminology/resources/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/terminology/scripting-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/terminology/xml/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/base-urls/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.xhtml59
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/interfaces-for-url-manipulation/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/parsing-urls/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/blank.py2
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/css-tmpl.py5
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/manifest.py12
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/page-using-manifest.py12
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js932
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py131
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py16
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.htmlbin0 -> 906 bytes
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16le.htmlbin0 -> 912 bytes
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-8.html9
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html9
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html9
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/terminology-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url.html93
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/terminology-0/multiple-base.sub.html17
-rw-r--r--testing/web-platform/tests/html/infrastructure/urls/url-manipulation-and-creation/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/infrastructure/utf-8/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/a-quick-introduction-to-html/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/a-quick-introduction-to-html/common-pitfalls-to-avoid-when-using-the-scripting-apis/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/a-quick-introduction-to-html/writing-secure-applications-with-html/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/audience/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/background/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/presentational-markup/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/restrictions-on-content-models-and-on-attribute-values/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/syntax-errors/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/design-notes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/design-notes/compliance-with-other-specifications/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/design-notes/serializability-of-script-execution/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/fingerprint/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/history-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/html-vs-xhtml/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/scope/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/structure-of-this-specification/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/structure-of-this-specification/how-to-read-this-specification/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/structure-of-this-specification/typographic-conventions/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/introduction/suggested-reading/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/obsolete/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/obsolete/non-conforming-features/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/obsolete/obsolete-but-conforming-features/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/obsolete/obsolete-but-conforming-features/warnings-for-obsolete-but-conforming-features/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/frames/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-all.html52
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html53
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-02.html53
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-03.html53
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-04.html47
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/heading-obsolete-attributes-01.html18
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/nothing.html27
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/original-id.json1
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/script-IDL-event-htmlfor.html57
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-applet-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-down-manual.html8
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-left-manual.html8
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-right-manual.html8
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-up-manual.html8
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-events.html71
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-loop.html27
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-scrollamount-effect-manual.html9
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-scrollamount.html27
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-scrolldelay.html33
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-start.html23
-rw-r--r--testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-stop.html22
-rw-r--r--testing/web-platform/tests/html/rendering/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/introduction-9/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-button-element-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-details-element-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-button/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-checkbox-and-radio-button-widgets/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-color-well/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-file-upload-control/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-range-control/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-text-entry-widget/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-text-entry-widget/unrecognized-type-should-fallback-as-text-type-ref.html7
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-text-entry-widget/unrecognized-type-should-fallback-as-text-type.html8
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-input-element-as-domain-specific-widgets/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-keygen-element-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-marquee-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-meter-element-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-progress-element-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-select-element-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-select-element-0/option-label-ref.html19
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-select-element-0/option-label.html66
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/cols-default.html5
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/cols-zero.html5
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/rows-default.html5
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/rows-zero.html5
-rw-r--r--testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/textarea-ref.html4
-rw-r--r--testing/web-platform/tests/html/rendering/frames-and-framesets/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/interactive-media/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/interactive-media/editing-hosts/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/interactive-media/links-forms-and-navigation/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/interactive-media/links-forms-and-navigation/original-id.json1
-rw-r--r--testing/web-platform/tests/html/rendering/interactive-media/text-rendered-in-native-user-interfaces/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/interactive-media/the-title-attribute-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/introduction-8/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/bidirectional-text/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/div-align-ref.html76
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/div-align.html71
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/figure-ref.html11
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/figure.html9
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/form-controls/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/hidden-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/TODO-lists.html17
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-supported-ref.html45
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-supported-xhtml.xhtml40
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-supported.html35
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-lower-alpha.html14
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-lower-roman.html14
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-ref.html13
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-upper-alpha.html14
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-upper-roman.html14
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-supported-ref.html25
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-supported-xhtml.xhtml14
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-supported.html9
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-circle.html6
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-disc.html6
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-invalid.html6
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-lower-alpha.html6
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-lower-roman.html6
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-none.html6
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-ref.html5
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-round.html6
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-square.html6
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-upper-alpha.html6
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-upper-roman.html6
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-supported-ref.html21
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-supported-xhtml.xhtml13
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-supported.html8
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-decimal.html7
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-invalid.html7
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-lower-alpha.html7
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-lower-roman.html7
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-ref.html6
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-upper-alpha.html7
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-upper-roman.html7
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-a.html34
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-q.html33
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-ref.html21
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-s.html34
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-x.xhtml23
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/quotes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/sections-and-headings/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-1-ref.html46
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-1.html37
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-2-notref.html40
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-2-ref.html30
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-2.html31
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-cell-width-ref.html37
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-cell-width-s.html55
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-cell-width.html54
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-layout-notref.html9
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-layout-ref.html9
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-layout.html12
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-150percent-ref.html12
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-150percent.html12
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-ref.html13
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-s.html31
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width.html30
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/min-width-not-important.html54
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/ref.html21
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/align-ref.html31
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/align.html24
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/color-ref.html22
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/color.html7
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/width-ref.html19
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/width.html15
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_link.xhtml16
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_text_00ffff-ref.html14
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_text_00ffff.xhtml12
-rw-r--r--testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/test-body.xhtml8
-rw-r--r--testing/web-platform/tests/html/rendering/print-media/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim-ref.html11
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim.html12
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border-ref.xhtml9
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border_percent.xhtml10
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border-ref.xhtml8
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc.xhtml9
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel.xhtml9
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback-ref.html4
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback.html22
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html23
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale_ref.html14
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_a.html15
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_ref.html14
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/image-maps-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/images/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/images/space-ref.html13
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/images/space.html14
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/resources/svg-sizing.js418
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-embedded-sizing.js96
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-iframe-auto.html33
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-iframe-fixed.html33
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-iframe-percentage.html33
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-auto.html33
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-fixed.html33
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-percentage.html33
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-auto.html33
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-fixed.html33
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-percentage.html33
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.html29
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.js79
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/toolbars-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/replaced-elements/tools/gen-svgsizing-tests.py55
-rw-r--r--testing/web-platform/tests/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/rendering/unstyled-xml-documents/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/resources/common.js187
-rw-r--r--testing/web-platform/tests/html/semantics/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/common-idioms/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/common-idioms/conversations/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/common-idioms/footnotes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/common-idioms/rel-up/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/common-idioms/tag-clouds/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/common-idioms/the-main-part-of-the-content/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/disabled-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/disabled-elements/disabledElement.html44
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/styling/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/styling/LinkStyle.html72
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/styling/support/alternate.css7
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/styling/support/emptytitle.css4
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/styling/support/normal.css5
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/styling/support/notitle.css4
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/styling/support/unmatch.css4
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-base-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_about_blank.html19
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_empty.html29
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_invalid.html12
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_specified.sub.html33
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_unspecified.html30
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_multiple.html29
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_srcdoc.html19
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-base-element/example.html7
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-base-element/example2.html5
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-head-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-link-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context.html35
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-load-event.html18
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-rellist.html25
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-style-error-01.html48
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-link-element/resources/stylesheet.css3
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-link-element/style.css3
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet-with-base-ref.html11
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet-with-base.html11
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet.css3
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet.py9
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/contains.json22
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html112
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/;url=foo1
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/__dir__.headers1
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/foo1
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/foo'bar1
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/refresh.sub.html1
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/ufoo1
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/urfoo1
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/url foo1
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/urlfoo1
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/x;url=foo1
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/the-lang-attribute-012.html51
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-style-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-style-element/historical.html14
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-style-element/html_style_in_comment-ref.html18
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-style-element/html_style_in_comment.xhtml18
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style-error-01.html32
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style_disabled.html39
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style_events.html36
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style_media.html40
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-title-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-01.html25
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-02.xhtml30
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-03.html32
-rw-r--r--testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-04.xhtml37
-rw-r--r--testing/web-platform/tests/html/semantics/edits/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/edits/attributes-common-to-ins-and-del-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/edits/edits-and-lists/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/edits/edits-and-paragraphs/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/edits/edits-and-tables/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/edits/the-del-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/edits/the-del-element/del_effect.html19
-rw-r--r--testing/web-platform/tests/html/semantics/edits/the-ins-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/edits/the-ins-element/ins_effect.html19
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/dimension-attributes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/image-maps/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/image-maps/contains.json10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/mathml/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_controls_present-manual.html14
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_loop_base.html42
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_muted_overriding_volume-manual.html21
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_muted_present-manual.html20
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_volume_check.html58
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_volume_loudest-manual.html21
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_volume_silent-manual.html21
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/contains.json132
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/error-codes/error.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplay.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplay_noautoplay.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplaythrough.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplaythrough_noautoplay.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadeddata.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadeddata_noautoplay.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadedmetadata.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadedmetadata_noautoplay.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadstart.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadstart_noautoplay.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_canplay_canplaythrough.html52
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_canplay_playing.html52
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_loadedmetadata_loadeddata.html52
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_loadstart_progress.html52
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_pause.html48
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_pause_noautoplay.html40
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_play.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_play_noautoplay.html40
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_playing.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_playing_noautoplay.html40
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_progress.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_progress_noautoplay.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_timeupdate.html34
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_timeupdate_noautoplay.html40
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_volumechange.html72
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/historical.html53
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/addTextTrack.html116
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/textTracks.html13
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/default.html55
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/kind.html146
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/label.html83
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/readyState.html11
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/src.html43
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/srclang.html82
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/track.html12
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/activeCues.html104
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/addCue.html68
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/constants.html23
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html100
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/kind.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/label.html29
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/language.html29
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/mode.html55
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/oncuechange.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/removeCue.html50
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/endTime.html39
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/id.html39
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/onenter.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/onexit.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/pauseOnExit.html40
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/startTime.html39
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/track.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/getCueById.html53
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/getter.html49
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/length.html22
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getTrackById.html16
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/length.html18
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/onaddtrack.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/onremovetrack.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TrackEvent/constructor.html24
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TrackEvent/createEvent.html15
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/autoplay-overrides-preload.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/load-events-networkState.html67
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/load-removes-queued-error-event.html44
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-insert-before.html29
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-moved.html21
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-addEventListener.html26
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-no-listener.html26
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-onerror.html26
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-audio-constructor-no-src.html13
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-audio-constructor.html12
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-in-sync-event.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-fragment-into-document.html22
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-into-document.html12
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-into-iframe.html23
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-parent-into-document.html19
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-in-div.html14
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-in-namespace.html14
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-networkState.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-not-in-document.html13
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source.html14
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-load.html20
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-pause-networkState.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-pause.html20
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-play.html20
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-remove-from-document-networkState.html29
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-remove-from-document.html21
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-remove-src.html22
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-in-namespace.html14
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-networkState.html16
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-not-in-document.html13
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src.html14
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-control.html26
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-insert-br.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-insert-source.html44
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-insert-text.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-remove-source-after.html56
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-remove-source.html43
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-remove-text.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-remove-source.html24
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-remove-src.html22
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-source-media.html14
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/delayed-broken-video.py5
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/stable-state-beforeunload-manual.html30
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/stable-state-dialogs-manual.html18
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/stable-state-print-manual.html22
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/location-of-the-media-resource/currentSrc.html44
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/mime-types/canPlayType.html110
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/networkState_during_loadstart.html42
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/networkState_during_progress.html42
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/networkState_initial.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/currentTime.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/duration.html11
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/paused_false_during_play.html44
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/paused_true_during_pause.html46
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-move-to-other-document.html25
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-move-within-document.html25
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-remove-from-document-networkState.html21
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-remove-from-document.html37
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/play-in-detached-document.html23
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/playbackRate.html19
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/preload_reflects_none_autoplay.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/ready-states/autoplay.html73
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_canplay.html44
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_canplaythrough.html46
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_loadeddata.html44
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_loadedmetadata.html44
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_playing.html44
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_initial.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/seeking/seek-to-currentTime.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/seeking/seek-to-max-value.htm23
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/seeking/seek-to-negative-time.htm23
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/src_reflects_attribute_not_source_elements.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cloneNode.html86
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/003.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/004.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/005.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/006.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/007.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/008.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/009.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/010.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/011.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/012.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/013.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/014.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/015.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/016.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/017.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/018.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/019.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/020.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/021.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/022.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/023.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/024.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/025.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/026.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/027.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/028.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/029.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/030.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/031.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/032.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/033.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/034.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/035.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/036.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/037.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/038.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/039.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/040.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/041.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/042.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/043.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/044.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/045.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/046.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/common.js144
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py51
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/remove-cookie.html6
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/set-cookie.html6
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.de.vtt4
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.en.vtt4
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.fr.vtt4
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.vtt4
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/src-clear-cues.html52
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-api-texttracks.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/user-interface/muted.html152
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_008.htm45
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_controls_present-manual.html14
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_loop_base.html41
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_muted_overriding_volume-manual.html21
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_muted_present-manual.html20
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_volume_check.html58
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_volume_loudest-manual.html21
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_volume_silent-manual.html21
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/media-elements/volume_nonfinite.html18
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/svg/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-area-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-coords.html47
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-processing.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-shape.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-stringifier.html16
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-area-element/support/hit-test.js42
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_001.htm18
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_002.htm18
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_constructor.html50
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_content-ref.htm13
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.canvas.readonly.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.canvas.reference.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.exists.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.shared.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.unique.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.scaled-manual.html30
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.scaled.pngbin0 -> 219 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.exists.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.extend.html34
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.prototype.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.replace.html35
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/contains.json10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.arguments.missing.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.casesensitive.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.emptystring.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.badname.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.badsuffix.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.nullsuffix.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.unicode.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/fallback.basic.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/fallback.multiple.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/fallback.nested.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/historical.html77
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.colour.html30
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.colour.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.2dstate.html103
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.clip.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.different.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.different.pngbin0 -> 107 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.gradient.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.path.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.path.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.pattern.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.same.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.same.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.transform.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.dataURI.html40
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.canvas.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.image.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.fillStyle.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.strokeStyle.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.timing.html41
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.create.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.cross.html39
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.fillStyle.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.strokeStyle.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.reset.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.default.html30
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.default.pngbin0 -> 272 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.get.pngbin0 -> 125 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.idl.html50
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.idl.set.zero.html30
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.html30
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.pngbin0 -> 272 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.hex.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.html30
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.pngbin0 -> 272 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.html30
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.pngbin0 -> 272 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.html30
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.pngbin0 -> 272 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.zero.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setcontent.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setcontent.pngbin0 -> 125 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setidl.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setidl.pngbin0 -> 125 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setidlzero.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.removed.html29
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.removed.pngbin0 -> 168 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.set.pngbin0 -> 125 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.pngbin0 -> 272 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.hex.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.pngbin0 -> 272 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.pngbin0 -> 272 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.pngbin0 -> 272 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.zero.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.style.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.style.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html29
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html29
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.arguments.1.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.arguments.2.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.arguments.3.html29
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.bogustype.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.default.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.alpha.html45
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.alpha.pngbin0 -> 208 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.primarycolours.html48
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.primarycolours.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.basic.html56
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.basic.pngbin0 -> 213 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.notnumber.html42
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.outsiderange.html43
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpg.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.ascii.html35
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.unicode.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.nocontext.html30
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.complexcolours.html48
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.complexcolours.pngbin0 -> 242 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.primarycolours.html48
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.primarycolours.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.unrecognised.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.zeroheight.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.zerosize.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.zerowidth.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.delete.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.exists.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.extend.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.name.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.prototype.html36
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.replace.html28
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-dimension.html20
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-document.html17
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-iframe.html7
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-ignored-in-media-element.html22
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-subdocument.html4
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback.html38
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-01.html18
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-02.html22
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-03.html20
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-04.html20
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-ref.html7
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/change_child.html14
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/change_grandchild.html4
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/change_parentage.html22
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html12
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/cross_origin_grandchild.html11
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html19
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/historical.html16
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html55
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-append-to-child-document.html17
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html48
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-with-base-ref.html9
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-with-base.html11
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_harness.js26
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm53
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_script.html46
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html25
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html25
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-1.html16
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-2.html27
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-3.html17
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html15
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html18
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html15
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_01.html20
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_02.html22
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_03.html20
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_04.html22
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/same_origin_child.html12
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/same_origin_grandchild.html11
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage.html19
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/stash.py10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/blank.htm1
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_allow_script.html8
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/3.jpgbin0 -> 91072 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/Image-constructor.html29
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/brokenimg.jpg4
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/contains.json60
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html37
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/error.html31
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/document-base-url-ref.html5
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/document-base-url.html7
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/environment-changes/iframed.sub.html78
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html65
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-1.jpgbin0 -> 389245 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image.pngbin0 -> 268 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/img.complete.html82
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/invalid-src.html42
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/nonexistent-image.html21
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html416
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/resources/cat.jpgbin0 -> 21474 bytes
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html42
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/sizes-iframed.sub.html178
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/common.js25
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html245
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source.html20
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-media.html32
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-src-complete.html23
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-the-image-data/fail-to-resolve.html25
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-the-source-set.html140
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-map-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-object-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-attributes.html50
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-events.html80
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-fallback.html41
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-handler.html33
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-object-element/test0.html10
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-object-element/test1.html9
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-object-element/test2.html4
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-param-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-source-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-track-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-video-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video-tabindex.html18
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_content-ref.htm12
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_content_image.htm16
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_content_text.htm16
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_dynamic_poster-ref.htm5
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_dynamic_poster_absolute.htm12
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_dynamic_poster_relative.htm12
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_initially_paused-ref.html8
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_initially_paused.html21
-rw-r--r--testing/web-platform/tests/html/semantics/forms/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/contains.json34
-rw-r--r--testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-ltr-iframe.html4
-rw-r--r--testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-ltr.html29
-rw-r--r--testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-rtl-manual.html26
-rw-r--r--testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/disabled-elements-01.html84
-rw-r--r--testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/formAction_document_address.html74
-rw-r--r--testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/formaction.html42
-rw-r--r--testing/web-platform/tests/html/semantics/forms/categories/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/contains.json18
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-checkValidity.html145
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-reportValidity.html145
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validate.html127
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-badInput.html46
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-customError.html48
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-patternMismatch.html27
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html115
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html113
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html77
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-tooLong.html50
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-tooShort.html52
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-typeMismatch.html41
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-valid.html130
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-valueMissing.html168
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/form-validation-willValidate.html90
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/inputwillvalidate.html26
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/support/validator.js377
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-email-delete-manual.html30
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-password-delete-manual.html30
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-search-delete-manual.html30
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-tel-delete-manual.html30
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-text-delete-manual.html30
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-url-delete-manual.html30
-rw-r--r--testing/web-platform/tests/html/semantics/forms/constraints/tooLong-textarea-delete-manual.html30
-rw-r--r--testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/contains.json14
-rw-r--r--testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/form.html97
-rw-r--r--testing/web-platform/tests/html/semantics/forms/form-submission-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/form-submission-0/contains.json30
-rw-r--r--testing/web-platform/tests/html/semantics/forms/form-submission-0/getactionurl.html39
-rw-r--r--testing/web-platform/tests/html/semantics/forms/form-submission-0/submit-entity-body.html113
-rw-r--r--testing/web-platform/tests/html/semantics/forms/form-submission-0/url-encoded.html46
-rw-r--r--testing/web-platform/tests/html/semantics/forms/historical.html85
-rw-r--r--testing/web-platform/tests/html/semantics/forms/introduction-1/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/introduction-1/contains.json34
-rw-r--r--testing/web-platform/tests/html/semantics/forms/resetting-a-form/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/resetting-a-form/reset-form.html105
-rw-r--r--testing/web-platform/tests/html/semantics/forms/textfieldselection/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/textfieldselection/original-id.json1
-rw-r--r--testing/web-platform/tests/html/semantics/forms/textfieldselection/select-event.html45
-rw-r--r--testing/web-platform/tests/html/semantics/forms/textfieldselection/selection-after-content-change.html18
-rw-r--r--testing/web-platform/tests/html/semantics/forms/textfieldselection/selection-not-application-textarea.html20
-rw-r--r--testing/web-platform/tests/html/semantics/forms/textfieldselection/selection-not-application.html48
-rw-r--r--testing/web-platform/tests/html/semantics/forms/textfieldselection/selection.html145
-rw-r--r--testing/web-platform/tests/html/semantics/forms/textfieldselection/textfieldselection-setRangeText.html120
-rw-r--r--testing/web-platform/tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html274
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-button-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-button-element/button-activate-frame.html3
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-button-element/button-activate.html17
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-button-element/button-events.html66
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-button-element/button-validation.html29
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-datalist-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-datalist-element/datalistoptions.html43
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-fieldset-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-fieldset-element/HTMLFieldSetElement.html54
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-001.html71
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-002.xhtml25
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-form-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-form-element/form-autocomplete.html59
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-interfaces-01.html20
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-matches.html46
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-nameditem-01.html43
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-nameditem-02.html28
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-sameobject.html20
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-form-element/form-indexed-element.html45
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-form-element/form-nameditem.html330
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/button.html66
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/checkbox.html149
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/checked.xhtml19
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/clone.html150
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/cloning-steps.html53
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/color.html45
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/contains.json154
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/date.html90
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/datetime-local.html36
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/datetime.html106
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/email.html58
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/file-manual.html30
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/files.html48
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/hidden.html74
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/image01-ref.html5
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/image01.html7
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-button.html51
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-checkbox.html60
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/maxlength-manual.html37
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/maxlength.html55
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/minlength.html55
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/month.html65
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/number.html53
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/password.html79
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/pattern_attribute.html34
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/radio-groupname-case.html75
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/radio.html144
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/range-2.html43
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/range.html276
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/required_attribute.html34
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/reset.html113
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/search_input.html35
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/selection.html135
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/telephone.html84
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/text.html104
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/time-2.html42
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/time.html207
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/type-change-state.html62
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/url.html59
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/valueMode.html72
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-input-element/week.html38
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-keygen-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-label-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-label-element/label-attributes.html137
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-label-element/labelable-elements.html156
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-legend-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-legend-element/legend-form.html33
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-meter-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-meter-element/meter.html250
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-optgroup-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-optgroup-element/optgroup-disabled-manual.html35
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-option-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-option-element/option-disabled-manual.html28
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-option-element/option-form.html32
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-option-element/option-label-value.js82
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-option-element/option-label.html12
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-option-element/option-selected.html61
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-backslash.html15
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-label.html23
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-recurse.html92
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-spaces.html75
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-option-element/option-value.html12
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-output-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-output-element/output.html39
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-progress-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-progress-element/progress-2.html34
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-progress-element/progress.html74
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-select-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-select-element/common-HTMLOptionsCollection-namedItem.html54
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html70
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-select-element/select-ask-for-reset.html97
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-select-element/select-named-getter.html46
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-select-element/select-remove.html64
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-textarea-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-textarea-element/cloning-steps.html34
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-newline-bidi-ref.html19
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-newline-bidi.html23
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-placeholder-manual.html14
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-select-event-manual.html31
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-select-manual.html13
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-type.html16
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-textarea-element/wrap-reflect-1-ref.html5
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-textarea-element/wrap-reflect-1a.html9
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-textarea-element/wrap-reflect-1b.html9
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-blockquote-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-dd-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-dd-element/grouping-dd.html27
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-div-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-div-element/grouping-div.html28
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-dl-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-dl-element/grouping-dl.html30
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-dt-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-dt-element/grouping-dt.html28
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-figcaption-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-figcaption-element/grouping-figcaption.html28
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-figure-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-figure-element/grouping-figure.html29
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-hr-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-hr-element/grouping-hr.html30
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-li-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-novalue-manual.html148
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-001-ref.html48
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-001.html49
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-002-ref.html34
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-002.html36
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li.html193
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-rev-reftest-001-ref.html53
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-rev-reftest-001.html59
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-001-ref.html57
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-001.html64
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-002-ref.html57
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-002.html61
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-001-ref.html55
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-001.html58
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002-ref.html62
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002.html65
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-003-ref.html78
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-003.html81
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol.html314
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/ol.start-reflection-1.html25
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/ol.start-reflection-2.html25
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1-ref.html6
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1a.html10
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1b.html15
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1c.html16
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1d.html12
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1e.html11
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-2-ref.html6
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-2.html7
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-p-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-p-element/grouping-p.html28
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/grouping-pre-reftest-001-ref.html22
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/grouping-pre-reftest-001.html23
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/grouping-pre.html28
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/pre-newline-bidi-ref.html19
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/pre-newline-bidi.html23
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ul-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/grouping-content/the-ul-element/grouping-ul.html28
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/commands/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/commands/contains.json38
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/the-command-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/details.html47
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html157
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/contains.json6
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-close.html77
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html30
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal.html125
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/the-menu-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/the-menu-element/contains.json18
-rw-r--r--testing/web-platform/tests/html/semantics/interactive-elements/the-summary-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/interfaces.html47
-rw-r--r--testing/web-platform/tests/html/semantics/interfaces.js150
-rw-r--r--testing/web-platform/tests/html/semantics/links/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/links/downloading-resources/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/links/downloading-resources/contains.json6
-rw-r--r--testing/web-platform/tests/html/semantics/links/following-hyperlinks/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/links/introduction-3/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_attribute-getter-setter.html65
-rw-r--r--testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_getter.html48
-rw-r--r--testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_noopener.html78
-rw-r--r--testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-popup.html19
-rw-r--r--testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-target-1.html4
-rw-r--r--testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-target-2.html8
-rw-r--r--testing/web-platform/tests/html/semantics/links/linktypes/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/links/linktypes/alternate-css-ref.html5
-rw-r--r--testing/web-platform/tests/html/semantics/links/linktypes/alternate-css.html7
-rw-r--r--testing/web-platform/tests/html/semantics/links/linktypes/alternate.css3
-rw-r--r--testing/web-platform/tests/html/semantics/links/linktypes/contains.json68
-rw-r--r--testing/web-platform/tests/html/semantics/links/linktypes/original-id.json1
-rw-r--r--testing/web-platform/tests/html/semantics/links/linktypes/preferred.css3
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-noscript-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_001.htm18
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_002.htm31
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_003.htm39
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_004.htm37
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_005.htm39
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_006.htm45
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_007.htm48
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_008.htm47
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_009.htm25
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_010.htm54
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_011.htm19
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/contains.json18
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/external-script-utf8.js5
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/external-script-windows1250.js5
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/base.html15
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/test.js1
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/beta/test.js1
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-with-base.html27
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/empty.html32
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/failure.html25
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/unreachable.js1
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/historical.html53
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/load-event.html24
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/log.py13
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/resources/cross-origin.py10
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-01.html89
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-02.html40
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-03.html20
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-crossorigin-network.html49
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-crossorigin.html39
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-for-event-xhtml.xhtml22
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-for-event.html93
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-language-type.html18
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-languages-01.html24
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-languages-02.html98
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-noembed-noframes-iframe.xhtml36
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html12
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html18
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js1
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed-2.py4
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.html19
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.py4
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-1.html12
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-2.html13
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onload-insertion-point.html12
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onload-string.html17
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-text-xhtml.xhtml28
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-text.html72
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/scripting-enabled.html16
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py15
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onerror-insertion-point-1-helper.html2
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onerror-insertion-point-2-helper.html2
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onload-insertion-point-helper.html2
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onload-insertion-point-helper.js1
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document.html150
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/template-child-nodes.html102
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-serializing-xhtml-documents/outerhtml.html71
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001-ref.html6
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001.html12
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-002.html12
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-003.html19
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/template-clone-children.html82
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/templates-copy-document-owner.html126
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-document-type.html83
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-001.html44
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-002.html67
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents.html172
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/innerhtml-on-templates/innerhtml.html86
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/end-template-tag-in-body.html12
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/end-template-tag-in-head.html12
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/frameset-end-tag.html10
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/head-template-contents-div-no-end-tag.html12
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/head-template-contents-table-no-end-tag.html14
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/html-start-tag.html10
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-child-nodes-div.xhtml14
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-child-nodes-nested.xhtml16
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-attribute.html10
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-body.html10
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-div-no-end-tag.html12
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-empty.html11
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-frameset.html10
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-head.html10
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-html.html10
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-nested.html10
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-table-no-end-tag.html14
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-text.html10
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents.html12
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-descendant-body.html12
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-descendant-frameset.html12
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-descendant-head.html13
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/two-templates.html17
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/serializing-html-templates/outerhtml.html70
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/content-attribute.html114
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/node-document-changes.html199
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html135
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-content-node-document.html59
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-content.html77
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-body.html26
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-frameset.html62
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-head.html26
-rw-r--r--testing/web-platform/tests/html/semantics/sections/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/sections/headings-and-sections/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/sections/headings-and-sections/contains.json6
-rw-r--r--testing/web-platform/tests/html/semantics/sections/the-address-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/sections/the-article-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/sections/the-aside-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/sections/the-body-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/sections/the-footer-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/sections/the-h1-h2-h3-h4-h5-and-h6-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/sections/the-h1-h2-h3-h4-h5-and-h6-elements/original-id.json1
-rw-r--r--testing/web-platform/tests/html/semantics/sections/the-header-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/sections/the-hgroup-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/sections/the-nav-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/sections/the-section-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/sections/usage-summary-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/case-sensitivity/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-001-manual.html18
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked.html43
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/default.html64
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir.html46
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir01.html18
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/disabled.html60
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/enabled.html42
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-autofocus.html24
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-iframe.html5
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus.html51
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio.html26
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate.html37
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/inrange-outofrange.html84
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/link.html23
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/readwrite-readonly.html89
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/required-optional.html35
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/utils.js20
-rw-r--r--testing/web-platform/tests/html/semantics/selectors/pseudo-classes/valid-invalid.html146
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/cellIndex.html50
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/examples/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/historical.html25
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/html-table-section-element.js22
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/processing-model-1/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/processing-model-1/contains.json10
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/caption_001.html70
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-col-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-colgroup-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/caption-methods.html100
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/contains.json10
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/createTBody.html173
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/delete-caption.html94
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/insertRow-method-01.html24
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/insertRow-method-02.html34
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/insertRow-method-03.html32
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/remove-row.html50
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/tBodies.html40
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/tFoot.html57
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/tHead.html66
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/table-insertRow.html56
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-table-element/table-rows.html234
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/deleteRow.html54
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/insertRow.html56
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/rows.html15
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-td-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-tfoot-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-tfoot-element/rows.html15
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-th-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-thead-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-thead-element/rows.html15
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/cells.html28
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/deleteCell.html54
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/insertCell.html55
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/rowIndex.html77
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/sectionRowIndex.html130
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/historical.html32
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-stringifier.html16
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-getter-01.html34
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-setter-01.html41
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-abbr-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-b-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default-ref.html36
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html46
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf-ref.html44
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf.html56
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested-ref.html44
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested.html52
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number-ref.html44
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number.html53
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate-ref.html36
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate.html47
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1-ref.html47
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1.html58
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2-ref.html47
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2.html59
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1-ref.html45
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1.html54
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2-ref.html45
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2.html54
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1-ref.html45
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1.html54
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2-ref.html45
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2.html54
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1-ref.html45
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1.html54
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2-ref.html45
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2.html53
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run-ref.html44
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run.html56
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped-ref.html52
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped.html73
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container-ref.html36
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container.html46
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-child.html17
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-ltr.html15
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-override.html18
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001-ref.html11
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001.html14
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors-ref.html38
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors.html59
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-ref.html19
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi.html22
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-cite-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-code-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-data-element/data.value-001.html66
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-dfn-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-em-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-i-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-kbd-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-mark-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-q-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-rp-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-rt-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-s-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-samp-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-small-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-span-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-strong-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-sub-and-sup-elements/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-time-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-time-element/001.html68
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-u-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-var-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element-ref.html9
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element.html11
-rw-r--r--testing/web-platform/tests/html/semantics/text-level-semantics/usage-summary/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/the-root-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/the-root-element/the-html-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/syntax/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/syntax/html-element-list.js140
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-1.css4
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-15-inverse.css4
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-15.css4
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-utf8.css4
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-001.html37
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-001.html.headers1
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-003.htmlbin0 -> 2624 bytes
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-004.htmlbin0 -> 2612 bytes
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-007.html37
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-007.html.headers1
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-009.html37
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-009.html.headers1
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-015.html35
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-015.html.headers1
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-016.html38
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-016.html.headers1
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-018.html38
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-018.html.headers1
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-030.html38
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-030.html.headers1
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-034.html39
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-034.html.headers1
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-037.html37
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-037.html.headers1
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-038.html38
-rw-r--r--testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-038.html.headers1
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/DOMContentLoaded-defer-support.js13
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/DOMContentLoaded-defer.html17
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/Document.getElementsByTagName-foreign-01.html143
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/Document.getElementsByTagName-foreign-02.html24
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/Element.getElementsByTagName-foreign-01.html25
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/Element.getElementsByTagName-foreign-02.html29
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/README4
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/common.js24
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/contains.json490
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/foreign_content_001.html43
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/foreign_content_003.html47
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/foreign_content_004.html65
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/foreign_content_005.html45
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/foreign_content_006.html38
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/foreign_content_008.html39
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/foreign_content_009.html46
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/foreign_content_010.html44
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/foreign_content_011.html26
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/foreign_content_013.html26
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_adoption01.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_adoption02.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_comments01.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_doctype01.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_domjs-unsafe.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_entities01.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_entities02.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_html5test-com.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_inbody01.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests4.html24
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests6.html24
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests7.html24
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests_innerHTML_1.html24
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_isindex.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_main-element.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_pending-spec-changes-plain-text-unsafe.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_pending-spec-changes.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_plain-text-unsafe.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_scriptdata01.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_adoption01.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_ark.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_webkit01.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tables01.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_template.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests1.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests10.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests11.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests12.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests14.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests15.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests16.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests17.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests18.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests19.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests2.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests20.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests21.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests22.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests23.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests24.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests25.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests26.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests3.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests5.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests6.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests7.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests8.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tests9.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_tricky01.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_webkit01.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/html5lib_webkit02.html28
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/math-parse01.html62
-rwxr-xr-xtesting/web-platform/tests/html/syntax/parsing/math-parse03.html132
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/named-character-references-data.js2233
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/named-character-references.html36
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template.js214
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-foster-parenting/template-is-a-foster-parent-element.html63
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-foster-parenting/template-is-not-a-foster-parent-element.html70
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/generating-of-implied-end-tags.html136
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-body-token.html132
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-frameset-token.html125
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-head-token.html129
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-html-token.html158
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/start-tag-body.html97
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/start-tag-html.html38
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/template-end-tag-without-start-one.html102
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-frameset-insertion-mode/end-tag-frameset.html26
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags.html137
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-head-insertion-mode/template-end-tag-without-start-one.html101
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-table-insertion-mode/end-tag-table.html42
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/appending-to-a-template/template-child-nodes.html116
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context.html182
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context.html84
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context.html71
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/template/creating-an-element-for-the-token/template-owner-document.html221
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/test.js331
-rw-r--r--testing/web-platform/tests/html/syntax/parsing/the-end.html40
-rw-r--r--testing/web-platform/tests/html/syntax/serializing-html-fragments/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/syntax/serializing-html-fragments/initial-linefeed-pre.html48
-rw-r--r--testing/web-platform/tests/html/syntax/serializing-html-fragments/outerHTML.html31
-rw-r--r--testing/web-platform/tests/html/syntax/serializing-html-fragments/serializing.html332
-rw-r--r--testing/web-platform/tests/html/syntax/serializing-xml-fragments/outerHTML.html38
-rw-r--r--testing/web-platform/tests/html/syntax/writing/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/syntax/writing/cdata-sections/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/syntax/writing/character-references/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/syntax/writing/comments/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/syntax/writing/elements-0/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/syntax/writing/elements-0/contains.json26
-rw-r--r--testing/web-platform/tests/html/syntax/writing/text/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/syntax/writing/text/contains.json6
-rw-r--r--testing/web-platform/tests/html/syntax/writing/the-doctype/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/the-xhtml-syntax/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm67
-rw-r--r--testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-fragments/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/the-xhtml-syntax/serializing-xhtml-fragments/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/the-xhtml-syntax/writing-xhtml-documents/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/tools/html5lib_test.xml29
-rw-r--r--testing/web-platform/tests/html/tools/html5lib_test_fragment.xml27
-rw-r--r--testing/web-platform/tests/html/tools/update_html5lib_tests.py152
-rw-r--r--testing/web-platform/tests/html/webappapis/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/animation-frames/callback-exception.html27
-rw-r--r--testing/web-platform/tests/html/webappapis/animation-frames/callback-invoked.html18
-rw-r--r--testing/web-platform/tests/html/webappapis/animation-frames/callback-multicalls.html26
-rw-r--r--testing/web-platform/tests/html/webappapis/animation-frames/cancel-invoked.html18
-rw-r--r--testing/web-platform/tests/html/webappapis/animation-frames/idlharness.html50
-rw-r--r--testing/web-platform/tests/html/webappapis/animation-frames/same-dispatch-time.html31
-rw-r--r--testing/web-platform/tests/html/webappapis/atob/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/atob/base64.html306
-rw-r--r--testing/web-platform/tests/html/webappapis/idle-callbacks/callback-exception.html22
-rw-r--r--testing/web-platform/tests/html/webappapis/idle-callbacks/callback-iframe.html17
-rw-r--r--testing/web-platform/tests/html/webappapis/idle-callbacks/callback-invoked.html12
-rw-r--r--testing/web-platform/tests/html/webappapis/idle-callbacks/callback-multiple-calls.html41
-rw-r--r--testing/web-platform/tests/html/webappapis/idle-callbacks/callback-timeout.html28
-rw-r--r--testing/web-platform/tests/html/webappapis/idle-callbacks/cancel-invoked.html26
-rw-r--r--testing/web-platform/tests/html/webappapis/idle-callbacks/idlharness.html34
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/enabling-and-disabling-scripting/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/event-loops/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/event-loops/contains.json14
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/event-loops/microtask_after_raf.html57
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/event-loops/microtask_after_script.html55
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/event-loops/resources/common.js20
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/event-loops/task_microtask_ordering-manual.html64
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/event-loops/task_microtask_ordering.html85
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/body-onload.html20
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/contains.json18
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/event-handler-attributes-body-window.html34
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/event-handler-javascript.html20
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/event-handler-onresize.html38
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/event-handler-processing-algorithm.html63
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/event-handler-spec-example.html65
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/inline-event-handler-ordering.html52
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late.html25
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-once.html23
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/onerroreventhandler-frame.html56
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/events/onerroreventhandler.html11
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/introduction-5/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/javascript-protocol/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/addEventListener.html32
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error-data-url.html37
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error.html39
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-runtime-error.html39
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setInterval.html34
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setTimeout.html32
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin.html38
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-data-url.html36
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute.html39
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror.html28
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setInterval.html39
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setTimeout.html36
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin.html36
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error.html38
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/contains.json28
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setInterval.html34
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setTimeout.html32
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin.html38
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-data-url.html36
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-attribute.html39
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-body-onerror.html25
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setInterval.html39
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setTimeout.html36
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-window-onerror.html29
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin.html36
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error.html38
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setInterval.js9
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setTimeout.js8
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error.js1
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setInterval.js9
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setTimeout.js8
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable.js1
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-parse-error.html40
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error-throw.html39
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error.html43
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1.html33
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2.html33
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-3.html33
-rw-r--r--testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-4.html33
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-external-interface/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.html10
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.js63
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker.js4
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/contains.json22
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content.html136
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/001.xhtml16
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/002.xhtml19
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/003.xhtml18
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/004.xhtml18
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/005.xhtml18
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/006.xhtml18
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/get-navigatorlanguage-manual.html16
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-indexed.html28
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigatorlanguage.html19
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.html214
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/001.xhtml17
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/002.xhtml19
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/003.xhtml18
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/004.xhtml18
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/005.xhtml18
-rw-r--r--testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/006.xhtml19
-rw-r--r--testing/web-platform/tests/html/webappapis/timers/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/timers/evil-spec-example.html23
-rw-r--r--testing/web-platform/tests/html/webappapis/user-prompts/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/user-prompts/dialogs-implemented-using-separate-documents/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/user-prompts/printing/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/webappapis/user-prompts/simple-dialogs/.gitkeep0
3524 files changed, 116560 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/OWNERS b/testing/web-platform/tests/html/OWNERS
new file mode 100644
index 000000000..c98635fc6
--- /dev/null
+++ b/testing/web-platform/tests/html/OWNERS
@@ -0,0 +1,9 @@
+@ayg
+@Ms2ger
+@gsnedders
+@jdm
+@jgraham
+@plehegar
+@sideshowbarker
+@zcorpan
+@zqzhang
diff --git a/testing/web-platform/tests/html/browsers/.gitkeep b/testing/web-platform/tests/html/browsers/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/aborting-a-document-load/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/aborting-a-document-load/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/aborting-a-document-load/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-1.html
new file mode 100644
index 000000000..cadcf126f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-1.html
@@ -0,0 +1,11 @@
+<!doctype html>
+001-1
+<script>
+addEventListener("pageshow",
+ function(e) {
+ parent.events.push(e);
+ if (parent.events.length == 2) {
+ parent.do_test();
+ }
+ }, false);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-2.html
new file mode 100644
index 000000000..6387bc89c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-2.html
@@ -0,0 +1,5 @@
+<!doctype html>
+001-2
+<script>
+onload = function() {setTimeout(function() {history.go(-1)}, 500)}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001.html
new file mode 100644
index 000000000..26a66304a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<title>pageshow event from traversal</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="001-1.html"></iframe>
+<script>
+var t = async_test();
+var events = [];
+var iframe = document.getElementsByTagName("iframe")[0];
+
+onload = t.step_func(function() {
+ setTimeout(t.step_func(
+ function() {
+ assert_equals(iframe.contentDocument.readyState, "complete")
+ iframe.src = "001-2.html";
+ }), 500);
+ onload = null;
+})
+
+do_test = t.step_func(function() {
+ assert_equals(events.length, 2);
+ events.forEach(function(e, i) {
+ phase = i ? "after" : "before";
+ assert_equals(e.type, "pageshow", "type " + phase + " navigation");
+ assert_equals(e.persisted, i == 0 ? false : true, "persisted " + phase + " navigation");
+ t.done();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/MANIFEST b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/MANIFEST
new file mode 100644
index 000000000..b3b6014f6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/MANIFEST
@@ -0,0 +1,16 @@
+support 001-1.html
+support 001-2.html
+001.html
+support browsing_context_name-1.html
+support browsing_context_name-2.html
+support browsing_context_name-3.html
+support browsing_context_name-4.html
+browsing_context_name_cross_origin_2.html
+browsing_context_name_cross_origin_3.html
+browsing_context_name_cross_origin.html
+browsing_context_name.html
+events.html
+hashchange_event.html
+popstate_event.html
+support unset_context_name-1.html
+unset_context_name.html
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html
new file mode 100644
index 000000000..ace09e574
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Synthetic popstate events</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function () {
+ var e = document.createEvent('PopStateEvent');
+ var eProto = Object.getPrototypeOf(e);
+ assert_equals(eProto, PopStateEvent.prototype);
+}, 'document.createEvent');
+
+test(function () {
+ assert_false('initPopStateEvent' in PopStateEvent.prototype,
+ 'There should be no PopStateEvent#initPopStateEvent');
+}, 'initPopStateEvent');
+
+test(function () {
+ var state = history.state;
+ var data;
+ window.addEventListener('popstate', function (e) {
+ data = e.state;
+ });
+ window.dispatchEvent(new PopStateEvent('popstate', {
+ 'state': {testdata:true}
+ }));
+ assert_true(data.testdata,'state data was corrupted');
+ assert_equals(history.state, state, "history.state was NOT set by dispatching the event");
+}, 'Dispatching a synthetic PopStateEvent');
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html
new file mode 100644
index 000000000..5cbab71a5
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html
@@ -0,0 +1,35 @@
+<iframe id="test"></iframe>
+<script>
+var opener = window.opener;
+var t = opener.t;
+var f = document.getElementById("test");
+var l = opener.document.getElementById("step_log");
+
+log = function(t) {l.textContent += ("\n" + t)}
+var navigated = false;
+var steps = [
+ () => f.src = "browsing_context_name-1.html",
+ () => {
+ navigated = true;
+ opener.assert_equals(f.contentWindow.name, "test", "Initial load");
+ f.src = "browsing_context_name-2.html"
+ },
+ () => {
+ opener.assert_equals(f.contentWindow.name, "test1");
+ opener.assert_equals(history.length, 2);
+ history.back()
+ },
+ () => {
+ opener.assert_equals(f.contentWindow.name, "test1", "After navigation");
+ t.done();
+ }
+].map((x, i) => t.step_func(() => {log("Step " + (i+1)); x()}));
+
+next = () => steps.shift()();
+
+onload = () => {
+ log("page load");
+ f.onload = () => {log("iframe onload"); next()};
+ setTimeout(next, 0);
+};
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html
new file mode 100644
index 000000000..85748a2eb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html
@@ -0,0 +1,6 @@
+document 1
+<script>
+if (!parent.navigated) {
+ window.name = "test";
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-2.html
new file mode 100644
index 000000000..b0c869046
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-2.html
@@ -0,0 +1,4 @@
+document 2
+<script>
+window.name = "test1";
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-3.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-3.html
new file mode 100644
index 000000000..e0c239744
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-3.html
@@ -0,0 +1,6 @@
+document 3
+<script>
+if (!parent.navigated) {
+ window.name = "test3";
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-4.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-4.html
new file mode 100644
index 000000000..5d2dfa6bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-4.html
@@ -0,0 +1,6 @@
+document 4
+<script>
+if (!parent.navigated) {
+ window.name = "test4";
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html
new file mode 100644
index 000000000..60a8acb09
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<title>Retaining window.name on history traversal</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<pre id="step_log"></pre>
+
+<script>
+var t = async_test();
+t.step(() => {
+ win = window.open("browsing_context_name-0.html");
+ t.add_cleanup(() => win.close());
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html
new file mode 100644
index 000000000..b04eee66e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html
@@ -0,0 +1,41 @@
+<!doctype html>
+<title>Restoring window.name on cross-origin history traversal</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<pre id="step_log"></pre>
+<iframe id="test"></iframe>
+<script>
+
+var t = async_test(undefined, {timeout:10000});
+var f = document.getElementById("test");
+var l = document.getElementById("step_log");
+var navigated = false;
+
+log = function(t) {l.textContent += ("\n" + t)}
+
+var steps = [
+ function() {f.src = "browsing_context_name-1.html"},
+ function() {
+ var navigated = true;
+ assert_equals(f.contentWindow.name, "test", "Initial load");
+ setTimeout(next, 0);
+ },
+ function() {f.src = f.src.replace("http://", "http://www.").replace("browsing_context_name-1", "browsing_context_name-2");},
+ function() {
+ setTimeout(next, 0);
+ },
+ function() {history.back(); setTimeout(next, 500)},
+ function() {
+ assert_equals(f.contentWindow.name, "test", "After navigation");
+ t.done();
+ }
+].map(function(x) {return t.step_func(function() {log("Step " + step); x()})});
+
+var step = 0;
+next = t.step_func(function() {steps[step++]()});
+
+f.onload=next;
+
+onload = setTimeout(next, 0);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html
new file mode 100644
index 000000000..1a57e838c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html
@@ -0,0 +1,47 @@
+<!doctype html>
+<title>Restoring window.name on cross-origin history traversal</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<pre id="step_log"></pre>
+<iframe id="test"></iframe>
+<script>
+
+var t = async_test(undefined, {timeout:10000});
+var f = document.getElementById("test");
+var l = document.getElementById("step_log");
+var navigated = false;
+
+log = function(t) {l.textContent += ("\n" + t)}
+
+var steps = [
+ function() {f.src = "browsing_context_name-1.html"},
+ function() {
+ var navigated = true;
+ assert_equals(f.contentWindow.name, "test", "Initial load");
+ setTimeout(next, 0);
+ },
+ function() {f.src = "browsing_context_name-3.html"},
+ function() {
+ var navigated = true;
+ assert_equals(f.contentWindow.name, "test3", "Initial load");
+ setTimeout(next, 0);
+ },
+ function() {f.src = f.src.replace("http://", "http://www.").replace("browsing_context_name-3", "browsing_context_name-2");},
+ function() {
+ setTimeout(next, 0);
+ },
+ function() {history.go(-2); setTimeout(next, 500)},
+ function() {
+ assert_equals(f.contentWindow.name, "test3", "After navigation");
+ t.done();
+ }
+].map(function(x) {return t.step_func(function() {log("Step " + step); x()})});
+
+var step = 0;
+next = t.step_func(function() {steps[step++]()});
+
+f.onload=next;
+
+onload = setTimeout(next, 0);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_3.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_3.html
new file mode 100644
index 000000000..0f0702732
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_3.html
@@ -0,0 +1,47 @@
+<!doctype html>
+<title>Restoring window.name on cross-origin history traversal</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<pre id="step_log"></pre>
+<iframe id="test"></iframe>
+<script>
+var t = async_test(undefined, {timeout:10000});
+var f = document.getElementById("test");
+var l = document.getElementById("step_log");
+var navigated = false;
+
+log = function(t) {l.textContent += ("\n" + t)}
+
+var steps = [
+ function() {f.src = "browsing_context_name-1.html"},
+ function() {
+ var navigated = true;
+ assert_equals(f.contentWindow.name, "test", "Initial load");
+ setTimeout(next, 0);
+ },
+ function() {f.src = "browsing_context_name-3.html"},
+ function() {
+ var navigated = true;
+ assert_equals(f.contentWindow.name, "test3", "Initial load");
+ setTimeout(next, 0);
+ },
+ function() {f.src = f.src.replace("http://", "http://www.").replace("browsing_context_name-1", "browsing_context_name-2");},
+ function() {f.src = f.src.replace("http://www.", "http://").replace("browsing_context_name-2", "browsing_context_name-4");},
+ function() {
+ assert_equals(f.contentWindow.name, "test3", "After navigation");
+ history.go(-3); setTimeout(next, 500)
+ },
+ function() {
+ assert_equals(f.contentWindow.name, "test3", "After navigation");
+ t.done();
+ }
+].map(function(x) {return t.step_func(function() {log("Step " + step + " " + f.contentWindow.location); x()})});
+
+var step = 0;
+next = t.step_func(function() {steps[step++]()});
+
+f.onload=next;
+
+onload = setTimeout(next, 0);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/contains.json b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/contains.json
new file mode 100644
index 000000000..90b346668
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/contains.json
@@ -0,0 +1,6 @@
+[
+ {
+ "id": "event-definitions-0",
+ "original_id": "event-definitions-0"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/events.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/events.html
new file mode 100644
index 000000000..d5ff83fac
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/events.html
@@ -0,0 +1,151 @@
+<!doctype html>
+<title> PageTransitionEffect Event </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var e = new PageTransitionEvent("pageshow", {persisted:false, cancelable:false, bubbles:false});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pageshow");
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+ assert_false(e.persisted, "persisted");
+}, "Constructing pageshow event");
+
+test(function() {
+ var e = new PageTransitionEvent("pagehide", {persisted:false, cancelable:false, bubbles:false});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pagehide");
+ assert_false(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pagehide event");
+
+test(function() {
+ var e = new PageTransitionEvent("pageshow", {persisted:true});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pageshow");
+ assert_true(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pageshow event, persisted true");
+
+test(function() {
+ var e = new PageTransitionEvent("pagehide", {persisted:true});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pagehide");
+ assert_true(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pagehide event, persisted true");
+
+test(function() {
+ var e = new PageTransitionEvent("pageshow", {});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pageshow");
+ assert_false(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pageshow event, empty options");
+
+test(function() {
+ var e = new PageTransitionEvent("pagehide", {});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pagehide");
+ assert_false(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pagehide event, empty options");
+
+test(function() {
+ var e = new PageTransitionEvent("pageshow");
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pageshow");
+ assert_false(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pageshow event, missing options");
+
+test(function() {
+ var e = new PageTransitionEvent("pagehide");
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pagehide");
+ assert_false(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pagehide event, missing options");
+
+test(function() {
+ var e = new PageTransitionEvent("pageshow", {persisted:null});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pageshow");
+ assert_false(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pageshow event, persisted:null");
+
+test(function() {
+ var e = new PageTransitionEvent("pagehide", {persisted:null});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pagehide");
+ assert_false(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pagehide event, persisted:null");
+
+test(function() {
+ var e = new PageTransitionEvent("pageshow", {persisted:undefined});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pageshow");
+ assert_false(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pageshow event, persisted:undefined");
+
+test(function() {
+ var e = new PageTransitionEvent("pagehide", {persisted:undefined});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pagehide");
+ assert_false(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pagehide event, persisted:undefined");
+
+test(function() {
+ var e = new PageTransitionEvent("pageshow", {bubbles:true});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pageshow");
+ assert_false(e.persisted, "persisted");
+ assert_true(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pageshow event, bubbles:true");
+
+test(function() {
+ var e = new PageTransitionEvent("pagehide", {bubbles:true});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pagehide");
+ assert_false(e.persisted, "persisted");
+ assert_true(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+}, "Constructing pagehide event, bubbles:true");
+
+test(function() {
+ var e = new PageTransitionEvent("pageshow", {cancelable:true});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pageshow");
+ assert_false(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_true(e.cancelable, "cancelable");
+}, "Constructing pageshow event, cancelable:true");
+
+test(function() {
+ var e = new PageTransitionEvent("pagehide", {cancelable:true});
+ assert_true(e instanceof PageTransitionEvent);
+ assert_equals(e.type, "pagehide");
+ assert_false(e.persisted, "persisted");
+ assert_false(e.bubbles, "bubbles");
+ assert_true(e.cancelable, "cancelable");
+}, "Constructing pagehide event, cancelable:true");
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/hashchange_event.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/hashchange_event.html
new file mode 100644
index 000000000..4b701ad04
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/hashchange_event.html
@@ -0,0 +1,43 @@
+<!doctype html>
+<title>Queue a task to fire hashchange event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+t = async_test();
+window.onload = t.step_func(function () {
+ if (location.href.toString().indexOf("#") > -1) {
+ location.href = location.href.replace(/#.*$/,'');
+ return;
+ }
+ var root = location.href;
+ var oldURLs = [];
+ var newURLs = [];
+
+ var timer = null;
+
+ location.hash = 'foo';
+ window.onhashchange = t.step_func(function (e) {
+ oldURLs.push(e.oldURL);
+ newURLs.push(e.newURL);
+ if (newURLs.length === 2) {
+ check_result();
+ } else if (timer === null) {
+ timer = setTimeout(function() {check_result()}, 500);
+ }
+ })
+
+ check_result = t.step_func(function() {
+ clearTimeout(timer);
+ try {
+ assert_array_equals([root, root+"#foo"], oldURLs, "e.newURL");
+ assert_array_equals([root+"#foo", root+"#bar"], newURLs, "e.newURL");
+ t.done();
+ } finally {
+ location.hash = "";
+ }
+ });
+
+ location.hash = 'bar';
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank1.html
new file mode 100644
index 000000000..6b4df1ef2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank1.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<style>
+body {
+ height: 2000px;
+ width: 2000px;
+}
+</style>
+<body> Blank 1 </body> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank2.html
new file mode 100644
index 000000000..def213966
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank2.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<style>
+body {
+ height: 2000px;
+ width: 2000px;
+}
+</style>
+<body> Blank 2 </body>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/page-with-fragment.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/page-with-fragment.html
new file mode 100644
index 000000000..11737661d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/page-with-fragment.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<style>
+body {
+ height: 2000px;
+ width: 2000px;
+}
+#fragment {
+ position: absolute;
+ top: 800px;
+ background-color: #faa;
+ display: block;
+ height: 100px;
+ width: 100px;
+}
+
+</style>
+<body>
+Page with fragment
+ <a id="fragment" name="fragment" class='box'></a>
+</body> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/post_name_on_load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/post_name_on_load.html
new file mode 100644
index 000000000..1e9b10d1e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/post_name_on_load.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<script>
+addEventListener('load', _ => {
+ let params = new URLSearchParams(window.location.search);
+ window.opener.postMessage(params.get('name'), '*');
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resume-timer-on-history-back.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resume-timer-on-history-back.html
new file mode 100644
index 000000000..fb7365bd3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resume-timer-on-history-back.html
@@ -0,0 +1,145 @@
+<!doctype html>
+<title>Verify history.back() on a persisted page resumes timers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script type="text/javascript">
+
+function make_post_back_url(name) {
+ return new URL('resources/post_name_on_load.html?name=' + name,
+ window.location).href;
+}
+
+function wait_for_message(name) {
+ return new Promise(resolve => {
+ addEventListener('message', function onMsg(evt) {
+ if (evt.data !== name) {
+ return;
+ }
+ removeEventListener('message', onMsg);
+ resolve();
+ });
+ });
+}
+
+function with_window_by_name(name) {
+ let win = window.open(make_post_back_url(name));
+ return wait_for_message(name).then(_ => {
+ return win;
+ });
+}
+
+function with_nested_frame(win, url) {
+ return new Promise(resolve => {
+ let frame = win.document.createElement('iframe');
+ frame.addEventListener('load', function onLoad(evt) {
+ removeEventListener('load', onLoad);
+ resolve(frame);
+ });
+ frame.src = url;
+ win.document.body.appendChild(frame);
+ });
+}
+
+function delay(win, delay) {
+ return new Promise(resolve => {
+ win.setTimeout(_ => {
+ resolve(win);
+ }, delay);
+ });
+}
+
+function navigate_by_name(win, name) {
+ win.location = make_post_back_url(name);
+ return wait_for_message(name).then(_ => {
+ return win;
+ });
+}
+
+function go_back(win) {
+ return new Promise(resolve => {
+ win.onpagehide = e => resolve(win);
+ win.history.back();
+ });
+}
+
+let DELAY = 500;
+
+promise_test(t => {
+ // Create a new window so we can navigate it later.
+ return with_window_by_name('foo').then(win => {
+ // Schedule a timer within the new window. Our intent is
+ // to navigate the window before the timer fires.
+ let delayFired = false;
+ let innerDelay = delay(win, DELAY);
+ innerDelay.then(_ => {
+ delayFired = true;
+ });
+
+ return navigate_by_name(win, 'bar').then(_ => {
+ // Since the window has navigated the timer should not
+ // fire. We set a timer on our current test window
+ // to verify the other timer is not received.
+ assert_false(delayFired);
+ return delay(window, DELAY * 2);
+ }).then(_ => {
+ // The navigated window's timer should not have fired.
+ assert_false(delayFired);
+ // Now go back to the document that set the timer.
+ return go_back(win);
+ }).then(_ => {
+ // We wait for one of two conditions here. For browsers
+ // with a bfcache the original suspended timer will fire.
+ // Alternatively, if the browser reloads the page the original
+ // message will be sent again. Wait for either of these
+ // two events.
+ return Promise.race([wait_for_message('foo'), innerDelay]);
+ }).then(_ => {
+ win.close();
+ });
+ });
+}, 'history.back() handles top level page timer correctly');
+
+promise_test(t => {
+ let win;
+ // Create a new window so we can navigate it later.
+ return with_window_by_name('foo').then(w => {
+ win = w;
+
+ // Create a nested frame so we check if navigation and history.back()
+ // properly handle child window state.
+ return with_nested_frame(win, 'about:blank');
+
+ }).then(frame => {
+ // Schedule a timer within the nested frame contained by the new window.
+ // Our intent is to navigate the window before the timer fires.
+ let delayFired = false;
+ let innerDelay = delay(frame.contentWindow, DELAY);
+ innerDelay.then(_ => {
+ delayFired = true;
+ });
+
+ return navigate_by_name(win, 'bar').then(_ => {
+ // Since the window has navigated the timer should not
+ // fire. We set a timer on our current test window
+ // to verify the other timer is not received.
+ assert_false(delayFired);
+ return delay(window, DELAY * 2);
+ }).then(_ => {
+ // The navigated window's timer should not have fired.
+ assert_false(delayFired);
+ // Now go back to the document containing the frame that set the timer.
+ return go_back(win);
+ }).then(_ => {
+ // We wait for one of two conditions here. For browsers
+ // with a bfcache the original suspended timer will fire.
+ // Alternatively, if the browser reloads the page the original
+ // message will be sent again. Wait for either of these
+ // two events.
+ return Promise.race([wait_for_message('foo'), innerDelay]);
+ }).then(_ => {
+ win.close();
+ });
+ });
+}, 'history.back() handles nested iframe timer correctly');
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-basic.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-basic.html
new file mode 100644
index 000000000..e47cd9c38
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-basic.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<title>Verify existence and basic read/write function of history.scrollRestoration</title>
+
+<style>
+ body {
+ height: 2000px;
+ width: 2000px;
+ }
+</style>
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script type="text/javascript">
+ 'use strict';
+
+ test(function() {
+ assert_equals(history.scrollRestoration, 'auto');
+ }, 'Default value is "auto"');
+
+ test(function() {
+ history.scrollRestoration = 'manual';
+ assert_equals(history.scrollRestoration, 'manual', 'should be able to set "manual"');
+ history.scrollRestoration = 'auto';
+ assert_equals(history.scrollRestoration, 'auto', 'should be able to set "auto"');
+ }, 'It is writable');
+
+ test(function() {
+ history.scrollRestoration = 'auto';
+ for (var v of [3.1415, {}, 'bogus']) {
+ history.scrollRestoration = v;
+ assert_equals(history.scrollRestoration, 'auto', `setting to invalid value (${v}) should be ignored`);
+ }
+ }, 'Invalid values are ignored');
+</script> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html
new file mode 100644
index 000000000..e3da59e39
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<meta name=timeout content=long>
+<title>Precedence of scroll restoration mode over fragment scrolling in cross-origin history traversal</title>
+<style>
+ iframe {
+ height: 300px;
+ width: 300px;
+ }
+</style>
+
+<body>
+ <iframe></iframe>
+</body>
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script type="text/javascript">
+ 'use strict';
+
+ // The test does the following navigation steps for iframe
+ // 1. load page-with-fragment.html#fragment
+ // 2. load blank1
+ // 3. go back to page-with-fragment.html
+ async_test(function(t) {
+ var iframe = document.querySelector('iframe');
+ var baseURL = location.href.substring(0, location.href.lastIndexOf('/'));
+
+ var steps = [
+ function() {
+ iframe.src = 'resources/page-with-fragment.html#fragment';
+ }, function() {
+ assert_equals(iframe.contentWindow.location.href, baseURL + '/resources/page-with-fragment.html#fragment', 'should be on page-with-fragment page');
+ // wait one animation frame to ensure layout is run and fragment scrolling is complete
+ iframe.contentWindow.requestAnimationFrame(function() {
+ assert_equals(iframe.contentWindow.scrollY, 800, 'should scroll to fragment');
+
+ iframe.contentWindow.history.scrollRestoration = 'manual';
+ assert_equals(iframe.contentWindow.history.scrollRestoration, 'manual');
+ setTimeout(next, 0);
+ });
+ }, function() {
+ // navigate to a new page from a different origin
+ iframe.src = iframe.src.replace("http://", "http://www.").replace("page-with-fragment.html#fragment", "blank1.html");
+ }, function() {
+ // going back causes the iframe to traverse back
+ history.back();
+ }, function() {
+ // coming back from history, scrollRestoration should be set to manual and respected
+ assert_equals(iframe.contentWindow.location.href, baseURL + '/resources/page-with-fragment.html#fragment', 'should be back on page-with-fragment page');
+ iframe.contentWindow.requestAnimationFrame(function() {
+ assert_equals(iframe.contentWindow.history.scrollRestoration, 'manual', 'navigating back should retain scrollRestoration value');
+ assert_equals(iframe.contentWindow.scrollX, 0, 'should not scroll to fragment');
+ assert_equals(iframe.contentWindow.scrollY, 0, 'should not scroll to fragment');
+ t.done();
+ });
+ }
+ ];
+
+ var stepCount = 0;
+ var next = t.step_func(function() {
+ steps[stepCount++]();
+ });
+
+ iframe.onload = next;
+ next();
+ }, 'Manual scroll restoration should take precedent over scrolling to fragment in cross origin navigation');
+</script> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html
new file mode 100644
index 000000000..d837b8f63
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<style>
+ body {
+ height: 2000px;
+ width: 2000px;
+ }
+
+ #fragment {
+ position: absolute;
+ top: 800px;
+ background-color: #faa;
+ display: block;
+ height: 100px;
+ width: 100px;
+ }
+</style>
+
+<body>
+ <a id="fragment" name="fragment" class='box'></a>
+</body>
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script type="text/javascript">
+ 'use strict';
+
+ async_test(function(t) {
+ history.scrollRestoration = 'manual';
+ assert_equals(history.scrollRestoration, 'manual');
+
+ location.hash = '#fragment';
+ assert_equals(window.scrollY, 800, 'new navigations should scroll to fragment');
+
+ // create a new entry and reset the scroll before verification
+ history.pushState(null, null, '#done');
+ window.scrollTo(0, 0);
+ assert_equals(window.scrollY, 0, 'should reset scroll before verification');
+
+ setTimeout(function() {
+ // setup verification
+ window.addEventListener('hashchange', t.step_func(function() {
+ assert_equals(location.hash, '#fragment');
+ assert_equals(history.scrollRestoration, 'manual');
+ // navigating back should give precedent to history restoration which is 'manual'
+ assert_equals(window.scrollX, 0, 'should not scroll to fragment');
+ assert_equals(window.scrollY, 0, 'should not scroll to fragment');
+ t.done();
+ }));
+ // kick off verification
+ window.history.back();
+ }, 0);
+
+ }, 'Manual scroll restoration should take precedent over scrolling to fragment in cross doc navigation');
+</script> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-cross-origin.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-cross-origin.html
new file mode 100644
index 000000000..87a337b2d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-cross-origin.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<meta name=timeout content=long>
+<title>Correct behaviour of scroll restoration mode is cross origin history traversal</title>
+
+<style>
+ iframe {
+ height: 300px;
+ width: 300px;
+ }
+</style>
+
+<body>
+ <iframe></iframe>
+</body>
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script type="text/javascript">
+ 'use strict';
+
+ // The test does the following navigation steps for iframe
+ // 1. load blank1
+ // 2. load blank2
+ // 3. go back to blank1
+ async_test(function(t) {
+ var iframe = document.querySelector('iframe');
+ var baseURL = location.href.substring(0, location.href.lastIndexOf('/'));
+
+ var steps = [
+ function() {
+ iframe.src = 'resources/blank1.html';
+ },
+ function() {
+ assert_equals(iframe.contentWindow.location.href, baseURL + '/resources/blank1.html', 'should be on first blank page');
+ iframe.contentWindow.history.scrollRestoration = 'manual';
+ assert_equals(iframe.contentWindow.history.scrollRestoration, 'manual');
+ iframe.contentWindow.scrollTo(500, 500);
+ assert_equals(iframe.contentWindow.scrollX, 500, 'scripted scrolling should take effect');
+ assert_equals(iframe.contentWindow.scrollY, 500, 'scripted scrolling should take effect');
+ setTimeout(next, 0);
+ },
+ function() {
+ // navigate to new page
+ iframe.src = 'resources/blank2.html';
+ },
+ function() {
+ assert_equals(iframe.contentWindow.location.href, baseURL + '/resources/blank2.html', 'should be on second blank page');
+ assert_equals(iframe.contentWindow.history.scrollRestoration, 'auto', 'new page loads should set scrollRestoration to "auto"');
+ setTimeout(next, 0);
+ }, function() {
+ iframe.contentWindow.history.back();
+ }, function() {
+ // coming back scrollRestoration should be restored to 'manual' and respected
+ assert_equals(iframe.contentWindow.location.href, baseURL + '/resources/blank1.html', 'should be back on first blank page');
+ assert_equals(iframe.contentWindow.history.scrollRestoration, 'manual', 'navigating back should retain scrollRestoration value');
+ assert_equals(iframe.contentWindow.scrollX, 0, 'horizontal scroll offset should not be restored');
+ assert_equals(iframe.contentWindow.scrollY, 0, 'vertical scroll offset should not be restored');
+ t.done();
+ }
+ ];
+
+ var stepCount = 0;
+ var next = t.step_func(function() {
+ steps[stepCount++]();
+ });
+
+ iframe.onload = next;
+ next();
+ }, 'Navigating to new page should reset to "auto" and navigating back should restore and respect scroll restoration mode');
+
+</script> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-samedoc.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-samedoc.html
new file mode 100644
index 000000000..46d40eedc
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-samedoc.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<title>Correct behaviour of scroll restoration mode in same document history traversals</title>
+
+<style>
+ body {
+ height: 10000px;
+ width: 10000px;
+ }
+</style>
+
+<body></body>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script type="text/javascript">
+ 'use strict';
+
+ async_test(function(t) {
+ history.scrollRestoration = 'auto';
+ window.scrollTo(0, 0);
+
+ // create history entries and then verify the impact of scrollRestoration
+ // when they are popped
+ var entries = {
+ /* For scroll restoration mode 'auto', the spec does not require scroll
+ position to be restored at any particular value. */
+ '#1': {type: 'push', expectedScroll: null, scrollRestoration: 'auto'},
+ '#2': {type: 'replace', expectedScroll: null, scrollRestoration: 'auto'},
+ /* For scroll restoration mode 'manual', the spec requires scroll position
+ not to be restored. So we expect [555,555] which is the latest position
+ before navigation. */
+ '#3': {type: 'push', expectedScroll: [555, 555], scrollRestoration: 'manual'},
+ '#4': {type: 'replace', expectedScroll: [555, 555], scrollRestoration: 'manual'}
+ };
+
+ // setup entries
+ for (var key in entries) {
+ var entry = entries[key],
+ beforeValue = history.scrollRestoration,
+ newValue = entry.scrollRestoration;
+
+ var args = [{key: key}, '', key];
+ if (entry.type == 'push') {
+ history.pushState.apply(history, args);
+ } else {
+ history.pushState(null, '', key);
+ history.replaceState.apply(history, args);
+ }
+ assert_equals(history.scrollRestoration, beforeValue, `history.scrollRestoration value is retained after pushing new state`);
+ history.scrollRestoration = newValue;
+ assert_equals(history.scrollRestoration, newValue, `Setting scrollRestoration to ${newValue} works as expected`);
+ window.scrollBy(50, 100);
+ }
+
+ // setup verification
+ window.addEventListener('hashchange', t.step_func(function() {
+ var key = location.hash,
+ entry = entries[key];
+
+ if (key === '') {
+ t.done();
+ return;
+ }
+ assert_equals(history.state.key, key, `state should have key: ${key}`);
+ assert_equals(history.scrollRestoration, entry.scrollRestoration, 'scrollRestoration is updated correctly');
+ if (entry.expectedScroll) {
+ assert_equals(window.scrollX, entry.expectedScroll[0], `scrollX is correct for ${key}`);
+ assert_equals(window.scrollY, entry.expectedScroll[1], `scrollY is correct for ${key}`);
+ }
+
+ window.history.back();
+ }));
+
+ // reset the scroll and kick off the verification
+ setTimeout(function() {
+ history.pushState(null, null, '#done');
+ window.scrollTo(555, 555);
+ window.history.back();
+ }, 0);
+
+ }, 'history.{push,replace}State retain scroll restoration mode and navigation in the same document respects it');
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/popstate_event.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/popstate_event.html
new file mode 100644
index 000000000..7630b9918
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/popstate_event.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<title>Queue a task to fire popstate event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+t = async_test();
+window.onload = t.step_func(function () {
+ var states = [];
+
+ var timer = null;
+
+ history.pushState("a", "State a", "/a");
+ history.pushState("b", "State b", "/b");
+
+ history.back();
+ window.onpopstate = t.step_func(function (e) {
+ states.push(e.state);
+
+ if (states.length === 2) {
+ check_result();
+ } else if (timer === null) {
+ timer = setTimeout(function() {check_result()}, 500);
+ }
+ })
+
+ check_result = t.step_func(function() {
+ clearTimeout(timer);
+ try {
+ assert_array_equals(states, ["a", null]);
+ t.done();
+ } finally {
+ location.hash = "";
+ }
+ });
+
+ setTimeout(function() {history.back()}, 0);
+
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/unset_context_name-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/unset_context_name-1.html
new file mode 100644
index 000000000..d3d67d0f8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/unset_context_name-1.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<title>window.name after navigating to a different origin</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(function() {assert_equals(window.name, "")})
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/unset_context_name.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/unset_context_name.html
new file mode 100644
index 000000000..6814ed50e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/unset_context_name.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<!-- test must be run in a top level browsing context -->
+<title>window.name after navigating to a different origin</title>
+<script>
+window.name = "test_window";
+location.href = location.href.replace("http://", "http://www.").replace("unset_context_name", "unset_context_name-1");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001-1.html
new file mode 100644
index 000000000..df8d884e8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001-1.html
@@ -0,0 +1,7 @@
+<!doctype html>
+001-1
+<script>
+addEventListener("unload", function() {
+ location = location.href.replace("http://", "http://www.").replace(/\d{3}-\d\.html/, "001-3.html");
+}, false);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001-2.html
new file mode 100644
index 000000000..1cffc59b2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001-2.html
@@ -0,0 +1,5 @@
+<!doctype html>
+001-2
+<script>
+parent.postMessage("001-2", "*");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001-3.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001-3.html
new file mode 100644
index 000000000..5f1310e07
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001-3.html
@@ -0,0 +1,5 @@
+<!doctype html>
+001-3.html
+<script>
+parent.postMessage("001-3", "*");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001.html
new file mode 100644
index 000000000..7d99f6beb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/001.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>Cross-origin navigation started from unload handler</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="001-1.html"></iframe>
+<script>
+var t = async_test();
+onload = t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ var new_src = iframe.src.replace(/\d{3}-\d\.html/, "001-2.html");
+ iframe.src = new_src;
+});
+
+onmessage = t.step_func(function(e) {
+ assert_equals(e.data, "001-2");
+ t.done();
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/002-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/002-1.html
new file mode 100644
index 000000000..716e182ad
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/002-1.html
@@ -0,0 +1,5 @@
+<!doctype html>
+002-1
+<script>
+parent.postMessage("002-1", "*");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/002-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/002-2.html
new file mode 100644
index 000000000..a29a6bbcd
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/002-2.html
@@ -0,0 +1,5 @@
+<!doctype html>
+002-2
+<script>
+parent.postMessage("002-2", "*");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/002.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/002.html
new file mode 100644
index 000000000..0efc7016f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/002.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>Multiple simultaneous navigations</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="about:blank"></iframe>
+<script>
+var t = async_test();
+onload = t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+
+ setTimeout(t.step_func(function() {
+ iframe.src = "002-1.html?pipe=trickle(d1)";
+ setTimeout(t.step_func(function(){iframe.src = "002-2.html"}), 500);
+ }), 100);
+});
+
+onmessage = t.step_func(function(e) {
+ assert_equals(e.data, "002-2");
+ t.done();
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-1.html
new file mode 100644
index 000000000..4d2229eb5
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-1.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<script>
+onload = function() {
+ parent.postMessage("003-1", "*");
+ setTimeout(function() {location = "003-2.html";}, 100);
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-2.html
new file mode 100644
index 000000000..827a06947
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-2.html
@@ -0,0 +1,9 @@
+<!doctype html>
+003-2
+<script>
+onload = function() {
+ parent.postMessage("003-2", "*")
+ setTimeout(function() {history.go(-1)})
+}
+onunload = function() {location = "003-3.html"}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-3.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-3.html
new file mode 100644
index 000000000..8b26c896f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-3.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<script>
+parent.postMessage("003-3", "*");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003.html
new file mode 100644
index 000000000..f43715096
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>Navigation from unload whilst traversing history</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="003-1.html"></iframe>
+<script>
+var t = async_test();
+
+var pages = [];
+var iframe = document.getElementsByTagName("iframe")[0];
+
+
+onmessage = t.step_func(function(e) {
+ pages.push(e.data);
+ if(pages.length == 3) {
+ assert_array_equals(pages, ["003-1", "003-2", "003-1"]);
+ t.done();
+ iframe.parentNode.removeChild(iframe);
+ }
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-1.html
new file mode 100644
index 000000000..02f916fd9
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-1.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<script>
+onload = function() {
+ parent.postMessage("004-1", "*");
+ setTimeout(function() {location = location.href.replace("http://", "http://www.").replace("004-1.html", "004-2.html");}, 100);
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-2.html
new file mode 100644
index 000000000..f2ef83ee1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-2.html
@@ -0,0 +1,9 @@
+<!doctype html>
+003-2
+<script>
+onload = function() {
+ parent.postMessage("004-2", "*")
+ setTimeout(function() {history.go(-1)})
+}
+onunload = function() {location = "004-3.html"}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-3.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-3.html
new file mode 100644
index 000000000..c98711ae9
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-3.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<script>
+parent.postMessage("004-3", "*");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004.html
new file mode 100644
index 000000000..dddde4918
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>Navigation from unload whilst traversing cross-origin history</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="004-1.html"></iframe>
+<script>
+var t = async_test();
+
+var pages = [];
+var iframe = document.getElementsByTagName("iframe")[0];
+
+
+onmessage = t.step_func(function(e) {
+ pages.push(e.data);
+ if(pages.length == 3) {
+ assert_array_equals(pages, ["004-1", "004-2", "004-1"]);
+ t.done();
+ iframe.parentNode.removeChild(iframe);
+ }
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/005.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/005.html
new file mode 100644
index 000000000..4a044bb25
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/005.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>Link with onclick navigation and href navigation </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe id="test" name="test"></iframe>
+<a target="test" onclick="document.getElementById('test').contentWindow.location='click.html'" href="href.html">Test</a>
+<script>
+var t = async_test();
+t.step(function() {document.links[0].click()});
+onmessage = t.step_func(
+ function(e) {
+ assert_equals(e.data, "href");
+ t.done();
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/006.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/006.html
new file mode 100644
index 000000000..1e7aa2020
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/006.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>Link with onclick form submit and href navigation </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe name="test"></iframe>
+<form target="test" action="click.html"></form>
+<a target="test" onclick="document.forms[0].submit()" href="href.html">Test</a>
+<script>
+var t = async_test();
+t.step(function() {document.links[0].click()});
+onmessage = t.step_func(
+ function(e) {
+ assert_equals(e.data, "href");
+ t.done();
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/007.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/007.html
new file mode 100644
index 000000000..d4bcfc290
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/007.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>Link with onclick javascript url and href navigation </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe id="test" name="test"></iframe>
+<a target="test" onclick="document.getElementById('test').contentWindow.location = 'javascript:\'abc<script>parent.postMessage(&quot;click&quot;, &quot;*&quot;)</script>\'';" href="href.html">Test</a>
+<script>
+var t = async_test();
+t.step(function() {document.getElementsByTagName("a")[0].click()});
+onmessage = t.step_func(
+ function(e) {
+ assert_equals(e.data, "href");
+ t.done();
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/008.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/008.html
new file mode 100644
index 000000000..7d1495a08
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/008.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>Link with onclick form submit to javascript url and href navigation </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe id="test" name="test"></iframe>
+<form target="test" action="javascript:'<script>parent.postMessage(&quot;click&quot;, &quot;*&quot;)</script>'"></form>
+<a target="test" onclick="document.forms[0].submit()" href="href.html">Test</a>
+<script>
+var t = async_test();
+t.step(function() {document.getElementsByTagName("a")[0].click()});
+onmessage = t.step_func(
+ function(e) {
+ assert_equals(e.data, "href");
+ t.done();
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/009.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/009.html
new file mode 100644
index 000000000..0fcd1d37f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/009.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>Link with onclick form submit to javascript url with document.write and href navigation </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe id="test" name="test"></iframe>
+<form target="test" action="javascript:(function() {document.write('<script>parent.postMessage(&quot;write&quot;, &quot;*&quot;)</script>'); return '<script>parent.postMessage(&quot;click&quot;, &quot;*&quot;)</script>'})()"></form>
+<a target="test" onclick="document.forms[0].submit()" href="href.html">Test</a>
+<script>
+var t = async_test();
+var events = [];
+t.step(function() {
+ document.getElementsByTagName("a")[0].click()});
+onmessage = t.step_func(
+ function(e) {
+ events.push(e.data);
+ if (events.length === 2) {
+ assert_array_equals(events, ["write", "href"]);
+ t.done();
+ }
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/010.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/010.html
new file mode 100644
index 000000000..3917cd16e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/010.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>Link with onclick form submit to javascript url with delayed document.write and href navigation </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe id="test" name="test"></iframe>
+<form target="test" action="javascript:(function() {var x = new XMLHttpRequest(); x.open('GET', 'blank.html?pipe=trickle(d2)', false); x.send(); document.write('<script>parent.postMessage(&quot;write&quot;, &quot;*&quot;)</script>'); return '<script>parent.postMessage(&quot;click&quot;, &quot;*&quot;)</script>'})()"></form>
+<a target="test" onclick="document.forms[0].submit()" href="href.html">Test</a>
+<script>
+var t = async_test(undefined, {timeout:4000});
+t.step(function() {document.getElementsByTagName("a")[0].click()});
+onmessage = t.step_func(
+ function(e) {
+ assert_equals(e.data, "href");
+ t.done();
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/011.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/011.html
new file mode 100644
index 000000000..fe6b8dbc3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/011.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>Link with onclick navigation to javascript url with document.write and href navigation </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe id="test" name="test"></iframe>
+<a target="test" onclick="javascript:(function() {document.write('<script>parent.postMessage(&quot;write&quot;, &quot;*&quot;)</script>'); return '<script>parent.postMessage(&quot;click&quot;, &quot;*&quot;)</script>'})()" href="href.html">Test</a>
+<script>
+var t = async_test();
+var events = [];
+t.step(function() {
+ document.getElementsByTagName("a")[0].click()});
+onmessage = t.step_func(
+ function(e) {
+ events.push(e.data);
+ if (events.length === 2) {
+ assert_array_equals(events, ["write", "href"]);
+ t.done();
+ }
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/012.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/012.html
new file mode 100644
index 000000000..be8f2feba
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/012.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>Link with onclick navigation to javascript url with delayed document.write and href navigation </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe id="test" name="test"></iframe>
+<!-- XXX: What is this test trying to do? It's navigating the subframe, but
+ doing a write() to _this_ document, and the "javascript:" in there is
+ completely a red herring: it's a label, not a protocol. There is no
+ javascript url involved here, unlike what the title claims! -->
+<a target="test" onclick="javascript:(function() {var x = new XMLHttpRequest(); x.open('GET', 'blank.html?pipe=trickle(d2)', false); x.send(); document.write('write<script>parent.postMessage(&quot;write&quot;, &quot;*&quot;)</script>'); return '<script>parent.postMessage(&quot;click&quot;, &quot;*&quot;)</script>'})()" href="href.html">Test</a>
+<script>
+var t = async_test(undefined, {timeout:4000});
+t.step(function() {document.getElementsByTagName("a")[0].click()});
+onmessage = t.step_func(
+ function(e) {
+ assert_equals(e.data, "href");
+ t.done();
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/013.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/013.html
new file mode 100644
index 000000000..69ce7bc61
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/013.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>Link with onclick navigation to javascript url with delayed document.write and href navigation </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe id="test" name="test"></iframe>
+<a target="test" href="javascript:parent.events.push('javascript');">Test</a>
+<script>
+var t = async_test(undefined, {timeout:4000});
+var events = [];
+t.step(function() {
+ document.getElementsByTagName("a")[0].click();
+ events.push('after script');
+});
+onload = t.step_func(function() {
+ // javascript: executions are async.
+ assert_array_equals(events, ['after script', 'javascript']);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/014.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/014.html
new file mode 100644
index 000000000..605e18185
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/014.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title> Link with javascript onclick form submission script order </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe id="test" name="test"></iframe>
+<form target="test" action="javascript:parent.events.push('submit');"></form>
+<a target="test" onclick="document.forms[0].submit()">Test</a>
+<script>
+var t = async_test(undefined, {timeout:4000});
+var events = [];
+t.step(function() {
+ document.getElementsByTagName("a")[0].click();
+ events.push('after script');
+});
+onload = t.step_func(function() {
+ // javascript: executions are async.
+ assert_array_equals(events, ['after script', 'submit']);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/015.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/015.html
new file mode 100644
index 000000000..eb54622b7
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/015.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title> Link with javascript onclick and href script order </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe id="test" name="test"></iframe>
+<a target="test" onclick="parent.events.push('click');" href="javascript:parent.events.push('href')">Test</a>
+<script>
+var t = async_test(undefined, {timeout:4000});
+var events = [];
+t.step(function() {
+ document.getElementsByTagName("a")[0].click();
+ events.push('after script');
+});
+onload = t.step_func(function() {
+ // javascript: executions are async.
+ assert_array_equals(events, ['click', 'after script', 'href']);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/MANIFEST b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/MANIFEST
new file mode 100644
index 000000000..0467aa3b4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/MANIFEST
@@ -0,0 +1,42 @@
+support 001-1.html
+support 001-2.html
+support 001-3.html
+http 001.html
+support 002-1.html
+support 002-2.html
+002.html
+support 003-1.html
+support 003-2.html
+support 003-3.html
+003.html
+support 004-1.html
+support 004-2.html
+support 004-3.html
+004.html
+005.html
+006.html
+007.html
+008.html
+009.html
+010.html
+011.html
+012.html
+013.html
+014.html
+015.html
+support blank.html
+support child_navigates_parent_location-1.html
+support child_navigates_parent_location-2.html
+support child_navigates_parent_location-3.html
+child_navigates_parent_location.html
+support child_navigates_parent_submit-1.html
+support child_navigates_parent_submit-2.html
+support child_navigates_parent_submit-3.html
+child_navigates_parent_submit.html
+support click.html
+support href.html
+support navigation_unload_data_url-1.html
+navigation_unload_data_url.html
+support navigation_unload_same_origin-1.html
+navigation_unload_same_origin.html
+support slice-and-dice.php
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/blank.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/blank.html
new file mode 100644
index 000000000..c50eddd41
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/blank.html
@@ -0,0 +1 @@
+<!doctype html>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-1.html
new file mode 100644
index 000000000..66afcff22
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-1.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<script>parent.postMessage("initial", "*")</script>
+<iframe src="child_navigates_parent_location-2.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-2.html
new file mode 100644
index 000000000..746cf4b0f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-2.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<script>
+parent.parent.postMessage("inner", "*");
+parent.location = "child_navigates_parent_location-3.html"
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-3.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-3.html
new file mode 100644
index 000000000..bb8ba4e69
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-3.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<script>
+parent.postMessage("destination", "*");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location.html
new file mode 100644
index 000000000..9111232e2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>Child document navigating parent via location </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var events = [];
+onmessage = t.step_func(function(e) {
+ events.push(e.data);
+ if (events.length == 3) {
+ assert_array_equals(events, ["initial", "inner", "destination"]);
+ t.done();
+ }
+});
+</script>
+<iframe src="child_navigates_parent_location-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-1.html
new file mode 100644
index 000000000..cc8616670
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-1.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<script>parent.postMessage("initial", "*")</script>
+<iframe src="child_navigates_parent_submit-2.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-2.html
new file mode 100644
index 000000000..34e513de9
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-2.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<form action="child_navigates_parent_submit-3.html" target="_parent"></form>
+<script>
+parent.parent.postMessage("inner", "*");
+document.forms[0].submit()
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-3.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-3.html
new file mode 100644
index 000000000..bb8ba4e69
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-3.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<script>
+parent.postMessage("destination", "*");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit.html
new file mode 100644
index 000000000..d491a26c1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>Child document navigating parent via submit </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var events = [];
+onmessage = t.step_func(function(e) {
+ events.push(e.data);
+ if (events.length == 3) {
+ assert_array_equals(events, ["initial", "inner", "destination"]);
+
+ t.done();
+ }
+});
+</script>
+<iframe src="child_navigates_parent_submit-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/click.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/click.html
new file mode 100644
index 000000000..8cb03b74d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/click.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<script>
+parent.postMessage("click", "*");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment.html
new file mode 100644
index 000000000..18a6f84c9
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Navigating to the same URL with an empty fragment aborts the navigation</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<iframe src="empty_fragment_iframe.html"></iframe>
+<script>
+// If the navigation were not aborted, we would expect multiple load events
+// as the page continually reloads itself.
+async_test(function(t) {
+ var count = 0;
+ var iframe = document.querySelector('iframe');
+ iframe.onload = t.step_func(function() {
+ count++;
+ });
+ window.child_succeeded = t.step_func_done(function() {
+ assert_equals(count, 1);
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html
new file mode 100644
index 000000000..26b28a0d7
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html
@@ -0,0 +1,11 @@
+<script>
+var timeout;
+onload = function() {
+ location.hash = "";
+ timeout = setTimeout(function() { parent.child_succeeded() }, 2000);
+};
+
+onbeforeunload = function() {
+ clearTimeout(timeout);
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/href.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/href.html
new file mode 100644
index 000000000..eccadadf4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/href.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<script>
+parent.postMessage("href", "*");
+</script>
+href
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-query-fragment-components.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-query-fragment-components.html
new file mode 100644
index 000000000..9c18f109c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-query-fragment-components.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title> javascript url with query and fragment components </title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+var a = null;
+var b = null;
+var c = null;
+</script>
+
+<iframe id="a" src='javascript:"nope" ? "yep" : "what";'></iframe>
+<iframe id="b" src='javascript:"wrong"; // # %0a "ok";'></iframe>
+<iframe id="c" src='javascript:"%252525 ? %252525 # %252525"'></iframe>
+
+<script>
+var t = async_test("iframes with javascript src", {timeout:1000});
+function check(id, expected) {
+ assert_equals(
+ document.getElementById(id).contentDocument.body.textContent,
+ expected);
+}
+onload = t.step_func(function() {
+ check("a", "yep");
+ check("b", "ok");
+ check("c", "%2525 ? %2525 # %2525");
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling.html
new file mode 100644
index 000000000..621a8cbae
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test that javascript: evaluation only performs a navigation to the
+ result when the result is a string value.</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<iframe src="javascript:'1'"></iframe>
+<iframe src="javascript:1"></iframe>
+<iframe src="javascript:({ toString: function() { return '1'; } })"></iframe>
+<iframe src="javascript:undefined"></iframe>
+<iframe src="javascript:null"></iframe>
+<iframe src="javascript:true"></iframe>
+<iframe src="javascript:new String('1')"></iframe>
+<script>
+ var t = async_test();
+ onload = t.step_func_done(function() {
+ assert_equals(frames[0].document.documentElement.textContent,
+ "1", "string return should cause navigation");
+ // The rest of the test is disabled for now, until
+ // https://github.com/whatwg/html/issues/1895 gets sorted out
+/*
+ assert_equals(frames[1].document.documentElement.textContent,
+ "", "number return should not cause navigation");
+ assert_equals(frames[2].document.documentElement.textContent,
+ "", "object return should not cause navigation");
+ assert_equals(frames[3].document.documentElement.textContent,
+ "", "undefined return should not cause navigation");
+ assert_equals(frames[4].document.documentElement.textContent,
+ "", "null return should not cause navigation");
+ assert_equals(frames[5].document.documentElement.textContent,
+ "", "null return should not cause navigation");
+ assert_equals(frames[6].document.documentElement.textContent,
+ "", "String object return should not cause navigation");
+*/
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_data_url-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_data_url-1.html
new file mode 100644
index 000000000..8c412e657
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_data_url-1.html
@@ -0,0 +1,7 @@
+<!doctype html>
+001-1
+<script>
+addEventListener("unload", function() {
+ location = "data:text/html,unload<script>parent.postMessage('fail', '*');<\/script>";
+}, false);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_data_url.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_data_url.html
new file mode 100644
index 000000000..7a8be3e91
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_data_url.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>Same-origin navigation started from unload handler</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="navigation_unload_data_url-1.html"></iframe>
+<script>
+var t = async_test();
+onload = t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ var new_src = "data:text/html,load<script>parent.postMessage('pass', '*')<\/script>";
+ iframe.src = new_src;
+});
+
+onmessage = t.step_func(function(e) {
+ assert_equals(e.data, "pass");
+ t.done();
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_same_origin-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_same_origin-1.html
new file mode 100644
index 000000000..4b52fe3cf
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_same_origin-1.html
@@ -0,0 +1,7 @@
+<!doctype html>
+001-1
+<script>
+addEventListener("unload", function() {
+ location = location.href.replace(/[^\/\.]*\.html/, "001-3.html");
+}, false);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_same_origin.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_same_origin.html
new file mode 100644
index 000000000..b75409cc8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_same_origin.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>Same-origin navigation started from unload handler</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="navigation_unload_same_origin-1.html"></iframe>
+<script>
+var t = async_test();
+onload = t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ var new_src = iframe.src.replace(/[^\/\.]*\.html/, "001-2.html");
+ iframe.src = new_src;
+});
+
+onmessage = t.step_func(function(e) {
+ assert_equals(e.data, "001-3");
+ t.done();
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-parent.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-parent.html
new file mode 100644
index 000000000..bd2d9dfdb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-parent.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Set location from a parent</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<iframe></iframe>
+<script>
+ onload = function() {
+ var fr = document.querySelector("iframe")
+ fr.contentWindow.location = "support/dummy.html"
+ fr.onload = function() {
+ assert_equals(fr.contentDocument.referrer, document.URL)
+ done()
+ }
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-src.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-src.html
new file mode 100644
index 000000000..4a15b3f08
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-src.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Set src from a function called from a parent</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<iframe src="support/set-parent-src.html"></iframe>
+<script>
+ onload = function() {
+ var fr = document.querySelector("iframe")
+ fr.contentWindow.go()
+ fr.onload = function() {
+ assert_equals(fr.contentDocument.referrer, document.URL)
+ done()
+ }
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function.html
new file mode 100644
index 000000000..b75062b8d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Set location from a function called from a parent</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<iframe src="support/location-set.html"></iframe>
+<script>
+ onload = function() {
+ var fr = document.querySelector("iframe")
+ var url = fr.contentDocument.URL
+ fr.contentWindow.go()
+ fr.onload = function() {
+ assert_equals(fr.contentDocument.referrer, url)
+ done()
+ }
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-src-about-blank.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-src-about-blank.html
new file mode 100644
index 000000000..dce6ab2f6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-src-about-blank.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Set the src attribute to about:blank and check referrer</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<iframe></iframe>
+<script>
+ onload = function() {
+ var fr = document.querySelector("iframe")
+ fr.src = "about:blank"
+ fr.onload = function() {
+ assert_equals(fr.contentDocument.referrer, document.URL)
+ done()
+ }
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/dummy.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/dummy.html
new file mode 100644
index 000000000..063865709
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/dummy.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<meta charset=utf-8>
+<p>Hello. \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/location-set.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/location-set.html
new file mode 100644
index 000000000..ad733afac
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/location-set.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<meta charset=utf-8>
+<script>
+ function go() {
+ location.href = "support/dummy.html"
+ }
+</script>
+<p>Hello. Go. \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/set-parent-src.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/set-parent-src.html
new file mode 100644
index 000000000..9d45be8c8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/set-parent-src.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<meta charset=utf-8>
+<script>
+ function go() {
+ frameElement.src = "support/dummy.html"
+ }
+</script>
+<p>Hello. Go. \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-html/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/read-html/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-html/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-image.html b/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-image.html
new file mode 100644
index 000000000..52151b8de
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-image.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Media documents: image</title>
+ <link rel="author" title="Michael Ventnor" href="mailto:mventnor@mozilla.com">
+ <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#read-media">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+
+<script>
+ var t = async_test("The document for a standalone media file should have one child in the body.");
+
+ function frameLoaded() {
+ var testframe = document.getElementById('testframe');
+ var testframeChildren = testframe.contentDocument.body.childNodes;
+ assert_equals(testframeChildren.length, 1, "Body of image document has 1 child");
+ assert_equals(testframeChildren[0].nodeName, "IMG", "Only child of body must be an <img> element");
+ assert_equals(testframeChildren[0].namespaceURI, "http://www.w3.org/1999/xhtml",
+ "Only child of body must be an HTML element");
+ t.done();
+ }
+</script>
+</head>
+<body>
+ <div id="log"></div>
+ <iframe id="testframe" onload="t.step(frameLoaded)"
+ src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oMFgQGMyFwHucAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC"></iframe>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-video.html b/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-video.html
new file mode 100644
index 000000000..13bc5db4a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-video.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Media documents: video</title>
+ <link rel="author" title="Michael Ventnor" href="mailto:mventnor@mozilla.com">
+ <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#read-media">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+
+<script>
+ var t = async_test("The document for a standalone media file should have one child in the body.");
+
+ function frameLoaded() {
+ var testframe = document.getElementById('testframe');
+ var testframeChildren = testframe.contentDocument.body.childNodes;
+ assert_equals(testframeChildren.length, 1, "Body of image document has 1 child");
+ assert_equals(testframeChildren[0].nodeName, "VIDEO", "Only child of body must be an <video> element");
+ assert_equals(testframeChildren[0].namespaceURI, "http://www.w3.org/1999/xhtml",
+ "Only child of body must be an HTML element");
+ t.done();
+ }
+</script>
+</head>
+<body>
+ <div id="log"></div>
+ <iframe id="testframe" onload="t.step(frameLoaded)"
+ src="data:video/webm,"></iframe>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-multipart-x-mixed-replace/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/read-multipart-x-mixed-replace/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-multipart-x-mixed-replace/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-plugin/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/read-plugin/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-plugin/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-text/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/read-text/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-text/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-text/load-text-plain.html b/testing/web-platform/tests/html/browsers/browsing-the-web/read-text/load-text-plain.html
new file mode 100644
index 000000000..bd4fd7859
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-text/load-text-plain.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Page load processing model for text files</title>
+<link rel="author" title="Ms2ger" href="ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#read-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test("Checking document metadata for text file");
+var tD = async_test("Checking DOM for text file");
+var tC = async_test("Checking contents for text file");
+var iframe = document.body.appendChild(document.createElement("iframe"));
+iframe.onload = function(e) {
+ var doc = iframe.contentDocument;
+ t.step(function() {
+ assert_equals(doc.compatMode, "BackCompat");
+ assert_equals(doc.contentType, "text/plain");
+ assert_equals(doc.doctype, null);
+ t.done();
+ })
+ tD.step(function() {
+ assert_equals(doc.childNodes.length, 1, "Document should have 1 child")
+ assert_equals(doc.documentElement.tagName, "HTML");
+ assert_equals(doc.documentElement.childNodes.length, 2,
+ "Root element should have 2 children")
+ assert_equals(doc.documentElement.firstChild.tagName, "HEAD");
+ assert_equals(doc.documentElement.lastChild.tagName, "BODY");
+ assert_equals(doc.documentElement.lastChild.childNodes.length, 1,
+ "Body element should have 1 child")
+ assert_equals(doc.documentElement.lastChild.firstChild.tagName, "PRE");
+ tD.done();
+ })
+ tC.step(function() {
+ assert_equals(doc.documentElement.lastChild.firstChild.firstChild.data,
+ "This is a sample text/plain document.\n\nThis is not an HTML document.\n\n");
+ tC.done();
+ })
+};
+iframe.src = "../../../../common/text-plain.txt";
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-ua-inline/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/read-ua-inline/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-ua-inline/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-xml/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/read-xml/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-xml/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/001.html
new file mode 100644
index 000000000..32599bbc5
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/001.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<!-- this tests the spec as it hopefully will be once bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=17155 is fixed -->
+<title>Fragment Navigation: Updating document address</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(location.hash, "", "Page must be loaded with no hash")
+ var original_location = location.href;
+ location.hash = "test";
+ assert_equals(location.hash, "#test");
+ assert_equals(location.href, original_location + "#test");
+ location.hash = ""
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/002.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/002.html
new file mode 100644
index 000000000..92bfd6341
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/002.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<!-- this tests the spec as it hopefully will be once bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=17155 is fixed -->
+<title>Fragment Navigation: Updating document address twice</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(location.hash, "", "Page must be loaded with no hash")
+ var original_location = location.href;
+ location.hash = "test";
+ assert_equals(location.hash, "#test");
+ assert_equals(location.href, original_location + "#test");
+
+ location.hash = "test1";
+ assert_equals(location.hash, "#test1");
+ assert_equals(location.href, original_location + "#test1");
+
+ location.hash = "";
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/003.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/003.html
new file mode 100644
index 000000000..200a6dc34
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/003.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<!-- this tests the spec as it hopefully will be once bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=17155 is fixed -->
+<title>Fragment Navigation: Updating scroll position</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<div id="log"></div>
+<div id="test">scroll 1</div>
+<div style="height:10000px">Filler</div>
+<div id="test1">scroll 2</div>
+<script>
+test(function() {
+ assert_equals(document.body.scrollTop, 0);
+ location.hash = "test";
+
+ var scroll1 = document.body.scrollTop;
+ assert_true(scroll1 > 0);
+
+ location.hash = "test1";
+ var scroll2 = document.body.scrollTop;
+ assert_true(scroll2 > scroll1);
+
+ location.hash = ""
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/004.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/004.html
new file mode 100644
index 000000000..950172d7b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/004.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<!-- this tests the spec as it hopefully will be once bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=17155 is fixed -->
+<title>Fragment Navigation: hashchange event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<div id="log"></div>
+<script>
+var t = async_test();
+t.step(function() {
+ assert_equals(location.hash, "", "Page must be loaded with no hash");
+ location.hash = "test";
+
+ addEventListener("hashchange",
+ t.step_func(function(e) {
+ assert_equals(e.target, window);
+ assert_equals(e.type, "hashchange");
+ assert_true(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+ t.done();
+ }), true)
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/005.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/005.html
new file mode 100644
index 000000000..f0761a64f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/005.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<!-- this tests the spec as it hopefully will be once bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=17155 is fixed -->
+<title>Fragment Navigation: hashchange event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<div id="log"></div>
+<script>
+var t = async_test();
+t.step(function() {
+ var original_url = location.href;
+ assert_equals(location.hash, "", "Page must be loaded with no hash");
+ location.hash = "test";
+
+ addEventListener("hashchange",
+ t.step_func(function(e) {
+ assert_equals(e.oldURL, original_url, "oldURL property");
+ assert_equals(e.newURL, location.href, "newURL property");
+ location.hash = "";
+ t.done();
+ }), true);
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/006.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/006.html
new file mode 100644
index 000000000..a65b9eb4a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/006.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<!-- this tests the spec as it hopefully will be once bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=17155 is fixed -->
+<title>Fragment Navigation: hashchange event multiple changes old/newURL</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<div id="log"></div>
+<script>
+var t = async_test();
+t.step(function() {
+ var original_url = location.href;
+ assert_equals(location.hash, "", "Page must be loaded with no hash");
+ location.hash = "test";
+
+ var count = 0;
+ var mid_url = location.href;
+
+ addEventListener("hashchange",
+ t.step_func(function(e) {
+ if (count === 0) {
+ assert_equals(e.oldURL, original_url, "oldURL property first update");
+ assert_equals(e.newURL, mid_url, "newURL property first update");
+ count = 1;
+ } else if (count === 1) {
+ assert_equals(e.oldURL, mid_url, "oldURL property second update");
+ assert_equals(e.newURL, location.href, "newURL property second update");
+ location.hash = "";
+ t.done();
+ }
+ }), true);
+
+ location.hash = "test1";
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/007.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/007.html
new file mode 100644
index 000000000..0b6fe813b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/007.html
@@ -0,0 +1,37 @@
+<!doctype html>
+<!-- this tests the spec as it hopefully will be once bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=17155 is fixed -->
+<title>Fragment Navigation: hashchange event multiple changes old/newURL</title>
+<meta name=timeout content=long>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<div id="log"></div>
+<script>
+var t = async_test();
+t.step(function() {
+ var original_url = location.href;
+ assert_equals(location.hash, "", "Page must be loaded with no hash");
+
+ var count = 0;
+
+ location.hash = "test";
+
+ hashes = [];
+
+ addEventListener("hashchange",
+ t.step_func(function(e) {
+ if (count < 100) {
+ location.hash = "test" + count++;
+ hashes.push(location.hash);
+ } else if (count === 100) {
+ expected = [];
+ for (var i=0; i<100; i++) {
+ expected.push("#test" + i);
+ }
+ assert_array_equals(hashes, expected);
+ location.hash = "";
+ t.done();
+ }
+ }), true);
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/MANIFEST b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/MANIFEST
new file mode 100644
index 000000000..eaa8e6d61
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/MANIFEST
@@ -0,0 +1,7 @@
+001.html
+002.html
+003.html
+004.html
+005.html
+006.html
+007.html
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-percent-encoded.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-percent-encoded.html
new file mode 100644
index 000000000..3196d8be8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-percent-encoded.html
@@ -0,0 +1,59 @@
+<!doctype html>
+<title>Fragment Navigation: fragment id should be percent-decoded</title>
+<meta name=timeout content=long>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<div></div>
+<div id="has two spaces" style="position:absolute; top:200px;"></div>
+<div id="escape%20collision" style="position:absolute; top:300px;"></div>
+<div id="escape collision" style="position:absolute; top:400px;"></div>
+<div id="do%20not%20go%20here" style="position:absolute; top:400px;"></div>
+<div style="height:200em;"></div>
+<script>
+var steps = [{
+ fragid:'has%20two%20spaces',
+ handler: function(){
+ assert_equals( scrollPosition(), 200 );
+ }
+ },{
+ fragid:'escape%20collision',
+ handler: function(){
+ assert_equals( scrollPosition(), 400 );
+ }
+ },{
+ fragid:'do%20not%20go%20here',
+ handler: function(){
+ // don't move
+ assert_equals( scrollPosition(), 400 );
+ }
+ }];
+
+function scrollPosition(){
+ return document.documentElement.scrollTop || document.body.scrollTop;
+}
+
+function runNextStep(){
+ if( steps.length > 0 ) {
+ var step = steps.shift();
+ var listener = t.step_func( function(){
+ step.handler();
+ runNextStep();
+ });
+ scrollToFragmentThenDo( step.fragid, listener );
+ } else {
+ t.done();
+ }
+}
+
+function scrollToFragmentThenDo( fragid, then ){
+ location.hash = fragid;
+ setTimeout( then, 1 );
+}
+
+var t = async_test();
+t.step( function(){
+ assert_equals(location.hash, "", "Page must be loaded with no hash");
+ runNextStep();
+})
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html
new file mode 100644
index 000000000..43dbaf9e2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html
@@ -0,0 +1,53 @@
+<!doctype html>
+<title>Fragment Navigation: scroll to anchor name is lower priority than equal id</title>
+<meta name=timeout content=long>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<div></div>
+<a name="anchor1" style="position:absolute; top:200px;"></a>
+<div id="id-equals-anchor" style="position:absolute; top:300px;"></div>
+<a name="id-equals-anchor" style="position:absolute; top:400px;"></a>
+<div style="height:200em;"></div>
+<script>
+var steps = [{
+ fragid:'anchor1',
+ handler: function(){
+ assert_equals( scrollPosition(), 200 );
+ }
+ },{
+ fragid:'id-equals-anchor',
+ handler: function(){
+ // id still takes precedence over anchor name
+ assert_equals( scrollPosition(), 300 );
+ }
+ }];
+
+function scrollPosition(){
+ return document.documentElement.scrollTop || document.body.scrollTop;
+}
+
+function runNextStep(){
+ if( steps.length > 0 ) {
+ var step = steps.shift();
+ var listener = t.step_func( function(){
+ step.handler();
+ runNextStep();
+ });
+ scrollToFragmentThenDo( step.fragid, listener );
+ } else {
+ t.done();
+ }
+}
+
+function scrollToFragmentThenDo( fragid, then ){
+ location.hash = fragid;
+ setTimeout( then, 1 );
+}
+
+var t = async_test();
+t.step( function(){
+ assert_equals(location.hash, "", "Page must be loaded with no hash");
+ runNextStep();
+})
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-id-top.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-id-top.html
new file mode 100644
index 000000000..601d40a2a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-id-top.html
@@ -0,0 +1,51 @@
+<!doctype html>
+<title>Fragment Navigation: TOP is a valid element id, which overrides navigating to top of the document</title>
+<meta name=timeout content=long>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<div></div>
+<div id="Top" style="position:absolute; top:200px;"></div>
+<div style="height:200em; position:relative;"></div>
+<script>
+var steps = [{
+ fragid:'Top',
+ handler: function(){
+ assert_equals( scrollPosition(), 200 );
+ }
+ },{
+ // scroling to top should work when fragid differs from id by case.
+ fragid:'top',
+ handler: function(){
+ assert_equals( scrollPosition(), 0 );
+ }
+ }];
+
+function scrollPosition(){
+ return document.documentElement.scrollTop || document.body.scrollTop;
+}
+
+function runNextStep(){
+ if( steps.length > 0 ) {
+ var step = steps.shift();
+ var listener = t.step_func( function(){
+ step.handler();
+ runNextStep();
+ });
+ scrollToFragmentThenDo( step.fragid, listener );
+ } else {
+ t.done();
+ }
+}
+
+function scrollToFragmentThenDo( fragid, then ){
+ location.hash = fragid;
+ setTimeout( then, 1 );
+}
+
+var t = async_test();
+t.step( function(){
+ assert_equals(location.hash, "", "Page must be loaded with no hash");
+ runNextStep();
+})
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-top.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-top.html
new file mode 100644
index 000000000..3265a71bf
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-top.html
@@ -0,0 +1,60 @@
+<!doctype html>
+<title>Fragment Navigation: When fragid is TOP scroll to the top of the document</title>
+<meta name=timeout content=long>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<div></div>
+<div id="not-the-top"></div>
+<div style="height:200em"></div>
+<script>
+var steps = [{
+ fragid:'not-the-top',
+ handler: function(){
+ assert_not_equals( scrollPosition(), 0 );
+ }
+ },{
+ fragid:'top',
+ handler: function(){
+ assert_equals( scrollPosition(), 0 );
+ }
+ },{
+ fragid:'not-the-top',
+ handler: function(){
+ assert_not_equals( scrollPosition(), 0 );
+ }
+ },{
+ fragid:'TOP',
+ handler: function(){
+ assert_equals( scrollPosition(), 0 );
+ }
+ }];
+
+function scrollPosition(){
+ return document.documentElement.scrollTop || document.body.scrollTop;
+}
+
+function runNextStep(){
+ if( steps.length > 0 ) {
+ var step = steps.shift();
+ var listener = t.step_func( function(){
+ step.handler();
+ runNextStep();
+ });
+ scrollToFragmentThenDo( step.fragid, listener );
+ } else {
+ t.done();
+ }
+}
+
+function scrollToFragmentThenDo( fragid, then ){
+ location.hash = fragid;
+ setTimeout( then, 1 );
+}
+
+var t = async_test();
+t.step( function(){
+ assert_equals(location.hash, "", "Page must be loaded with no hash");
+ runNextStep();
+})
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/.gitkeep b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/001.html
new file mode 100644
index 000000000..1ef88d3cc
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/001.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.open in unload</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var win;
+
+t.step(function() {
+ win = window.open("support/001-1.html");
+});
+
+add_completion_callback(function() {win.close()});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/002.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/002.html
new file mode 100644
index 000000000..a4e0b243e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/002.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.open in unload</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var win;
+
+t.step(function() {
+ win = window.open("support/002-1.html");
+});
+
+add_completion_callback(function() {win.close()});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/003.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/003.html
new file mode 100644
index 000000000..d0a19e0dd
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/003.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.open in beforeunload with link</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var win;
+
+t.step(function() {
+ win = window.open("support/003-1.html");
+});
+
+add_completion_callback(function() {win.close()});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/004.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/004.html
new file mode 100644
index 000000000..fca926f65
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/004.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.open in beforeunload with button</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var win;
+
+t.step(function() {
+ win = window.open("support/004-1.html");
+});
+
+add_completion_callback(function() {win.close()});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/005.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/005.html
new file mode 100644
index 000000000..c215fb88e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/005.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.open in pagehide in iframe</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var win;
+
+t.step(function() {
+ win = window.open("support/005-1.html");
+});
+
+add_completion_callback(function() {win.close()});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/MANIFEST b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/MANIFEST
new file mode 100644
index 000000000..f77806795
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/MANIFEST
@@ -0,0 +1,33 @@
+support 001-1.html
+support 001a.html
+support 001b.html
+001.html
+support 002-1.html
+support 002a.html
+support 002b.html
+002.html
+support 003-1.html
+support 003a.html
+support 003b.html
+003.html
+support 004-1.html
+support 004a.html
+support 004b.html
+004.html
+support 005-1.html
+support 005a.html
+support 005b.html
+005.html
+base.html
+support beforeunload-on-history-back-1.html
+beforeunload-on-history-back.html
+support beforeunload-on-navigation-of-parent-1.html
+support beforeunload-on-navigation-of-parent-2.html
+beforeunload-on-navigation-of-parent.html
+support navigation-within-beforeunload-1.html
+support navigation-within-beforeunload-2.html
+navigation-within-beforeunload.html
+support pagehide-on-history-forward-1.html
+pagehide-on-history-forward.html
+dir prompt
+dir unload
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/base.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/base.html
new file mode 100644
index 000000000..70c07cba4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/base.html
@@ -0,0 +1,14 @@
+<!doctype html>
+Base
+<script>
+onpagehide = function() {
+ if(top.base_hide) {
+ top.base_hide();
+ }
+}
+onpageshow = function() {
+if (top.base_show) {
+ top.base_show();
+}
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back-1.html
new file mode 100644
index 000000000..4403cfa8e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back-1.html
@@ -0,0 +1,5 @@
+<!doctype html>
+001-1
+<script>
+addEventListener("beforeunload", function() {top.t.step(function() {top.beforeunload_fired = true})}, false);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back.html
new file mode 100644
index 000000000..5b0415c42
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<title>beforeunload event fires on history navigation back</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+beforeunload_fired = false;
+var t = async_test();
+
+var base_count = 0;
+
+onload = function() {setTimeout(t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0]
+ iframe.onload = t.step_func(function() {
+ iframe.onload = null;
+ history.go(-1);
+ });
+
+ iframe.src = "beforeunload-on-history-back-1.html";
+}), 100)};
+
+base_show = t.step_func(function() {
+ base_count++;
+ if (base_count > 1) {
+ assert_true(beforeunload_fired);
+ t.done();
+ }
+});
+
+</script>
+<iframe src="base.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-1.html
new file mode 100644
index 000000000..4f239dad1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-1.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<iframe src="beforeunload-on-navigation-of-parent-2.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-2.html
new file mode 100644
index 000000000..a34b182e7
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-2.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<script>
+addEventListener("beforeunload", function() {parent.parent.beforeunload_fired=true}, false)
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent.html
new file mode 100644
index 000000000..96d49567f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<title>beforeunload in iframe on navigation of parent</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+beforeunload_fired = false;
+var t = async_test();
+
+var base_count = 0;
+
+onload = function() {setTimeout(t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0]
+ iframe.onload = t.step_func(function() {
+ iframe.onload = null;
+ history.go(-1);
+ });
+
+ iframe.src = "beforeunload-on-navigation-of-parent-1.html";
+}), 100)};
+
+base_show = t.step_func(function() {
+ base_count++;
+ if (base_count > 1) {
+ assert_true(beforeunload_fired);
+ t.done();
+ }
+});
+
+</script>
+<iframe src="base.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/contains.json b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/contains.json
new file mode 100644
index 000000000..4ebca09bf
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/contains.json
@@ -0,0 +1,6 @@
+[
+ {
+ "id": "event-definition",
+ "original_id": "event-definition"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-1.html
new file mode 100644
index 000000000..b96234fba
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-1.html
@@ -0,0 +1,10 @@
+<!doctype html>
+004-1
+<script>
+addEventListener("beforeunload",
+function() {
+if (top.counter++ < 999) {
+ location = "navigation-within-beforeunload-2.html?" + top.counter;
+}
+}, false);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-2.html
new file mode 100644
index 000000000..2dceaa6d6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-2.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<script>
+document.write(location)
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload.html
new file mode 100644
index 000000000..d7131b00d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>Triggering navigation from within beforeunload event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+beforeunload_fired = false;
+var t = async_test();
+
+var base_count = 0;
+var counter = 0;
+
+onload = function() {setTimeout(function() {
+ var iframe = document.getElementsByTagName("iframe")[0]
+
+ iframe.onload = function() {
+ setTimeout(function() {iframe.contentWindow.location="navigation-within-beforeunload-2.html";}, 100);
+ iframe.onload = t.step_func(function() {assert_equals(counter, 1000); t.done()});
+ };
+
+ iframe.src = "navigation-within-beforeunload-1.html?" + Math.random();
+
+}, 100)};
+
+</script>
+<iframe src="base.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward-1.html
new file mode 100644
index 000000000..a60c20ed8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward-1.html
@@ -0,0 +1,2 @@
+<!doctype html>
+filler text
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward.html
new file mode 100644
index 000000000..5e64b5ec6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>pagehide event fires on history navigation forward</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+
+onload = function() {setTimeout(t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0]
+
+ iframe.src = "pagehide-on-history-forward-1.html";
+}), 100)};
+
+base_hide = t.step_func(function() {
+ t.done()
+});
+</script>
+<iframe src="base.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-1.html
new file mode 100644
index 000000000..b68afc49e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-1.html
@@ -0,0 +1,10 @@
+<script>
+addEventListener("beforeunload",
+function() {
+ parent.events.push("beforeunload");
+}, false);
+parent.events.push("before src change");
+
+location.href = "001-2.html&pipe=trickle(d2)";
+parent.events.push("after src change");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-2.html
new file mode 100644
index 000000000..9da0f9395
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-2.html
@@ -0,0 +1 @@
+001-2
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001.html
new file mode 100644
index 000000000..109dcc139
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>beforeunload event order</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+events = [];
+onload = t.step_func(function() {
+ assert_array_equals(events, ["before src change", "beforeunload", "after src change"]);
+ t.done();
+})
+</script>
+<iframe src="001-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002-1.html
new file mode 100644
index 000000000..c5f57375d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002-1.html
@@ -0,0 +1,7 @@
+<script>
+addEventListsner("beforeunload", parent.t.step_func(
+function(e) {
+ parent.do_test(e);
+}, false);
+location.href = "001-2.html&pipe=trickle(d2)";
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002.html
new file mode 100644
index 000000000..d8f4fc60a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>beforeunload event properties</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+
+function do_test(e) {
+ assert_equals(e.type, "beforeunload");
+ assert_false(e.bubbles, "bubbles");
+ assert_true(e.cancelable, "bubbles");
+ assert_equals(e.returnValue, "");
+}
+
+onload = t.step_func(function() {
+ t.done();
+})
+</script>
+<iframe src="001-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/003.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/003.html
new file mode 100644
index 000000000..5683f1b12
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/003.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>beforeunload event in child frame for parent navigation</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+
+function do_test(e) {
+ assert_equals(e.type, "beforeunload");
+ assert_false(e.bubbles, "bubbles");
+ assert_true(e.cancelable, "bubbles");
+ assert_equals(e.returnValue, "");
+}
+
+onload = t.step_func(function() {
+ t.done();
+})
+</script>
+<iframe src="001-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/MANIFEST b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/MANIFEST
new file mode 100644
index 000000000..8d93279a4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/MANIFEST
@@ -0,0 +1,14 @@
+support 001-1.html
+support 001-2.html
+001.html
+support 002-1.html
+002.html
+003.html
+manual manual-001.html
+manual manual-002.html
+manual manual-003.html
+manual manual-004.html
+manual manual-005.html
+manual manual-006.html
+support next.html
+support slice-and-dice.php
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-001.html
new file mode 100644
index 000000000..3b7ef74b7
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-001.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<title>Prompt when beforeunload is canceled</title>
+<script>
+addEventListener("beforeunload",
+function(e) {e.preventDefault()},
+false);
+</script>
+<p>When clicking the link below, you should get a prompt asking if you want to unload the document</p>
+<a href="next.html">Click here</a>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-002.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-002.html
new file mode 100644
index 000000000..7be8a3301
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-002.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<title>Prompt when beforeunload has returnValue set</title>
+<script>
+addEventListener("beforeunload",
+function(e) {e.returnValue = "PASS if you see this"},
+false);
+</script>
+<p>When clicking the link below, you should get a prompt asking if you want to unload the document</p>
+<a href="next.html">Click here</a>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-003.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-003.html
new file mode 100644
index 000000000..ff72b6705
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-003.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<title>Prompt when beforeunload is canceled</title>
+<script>
+addEventListener("beforeunload",
+function(e) {e.preventDefault()},
+false);
+</script>
+<p>When clicking the button below, you should get a prompt asking if you want to unload the document</p>
+<form method="get" action="next.html">
+<input type="submit" value="Click here">
+</form>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-004.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-004.html
new file mode 100644
index 000000000..a4d296892
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-004.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<title>Prompt on form submit</title>
+<script>
+addEventListener("beforeunload",
+function(e) {e.preventDefault()},
+false);
+</script>
+<p>When clicking the button below, you should get a prompt asking if you want to unload the document</p>
+<form method="get" action="next.html">
+<input type="submit" value="Click here">
+</form>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-005.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-005.html
new file mode 100644
index 000000000..71ff0a241
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-005.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>Event loop pause for beforeunload</title>
+<script>
+var counter = 0;
+
+onload = function count() {
+ document.getElementById("log").textContent = counter++
+ setTimeout(count, 200);
+}
+
+addEventListener("beforeunload",
+function(e) {
+ e.preventDefault()
+},
+false);
+</script>
+<ul>
+<li>Click on the link below. When the prompt appears the counter at the bottom must stop incrementing.
+<li>Opt not to leave the page. The counter must start incrementing again
+</ul>
+<p><a href="">Click here</a>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-006.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-006.html
new file mode 100644
index 000000000..dae0340ad
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-006.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<title>Prompt when beforeunload returns string value</title>
+<script>
+addEventListener("beforeunload",
+function(e) {return "PASS if you see this"},
+false);
+</script>
+<p>When clicking the link below, you should get a prompt asking if you want to unload the document</p>
+<a href="next.html">Click here</a>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/next.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/next.html
new file mode 100644
index 000000000..38e7cdd5e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/next.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<p>You should have seen a prompt asking you to unload the previous document
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001-1.html
new file mode 100644
index 000000000..72f41ae3e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<script>
+ t = opener.t;
+ do_test = t.step(function () {
+ localStorage.test6564729 += '4';
+ var d = document;
+ var e = document.open(); // has no effect (ignore-opens-during-unload > 0)
+ localStorage.test6564729 += (e == d) ? '5' : 'A [' + e + '] ';
+ document.write('FAIL - document.write executed and blocked navigation!'); // has no effect (ignore-opens-during-unload > 0)
+ localStorage.test6564729 += document.body.textContent.match('FAIL') ? 'B' : '6';
+ document.close(); // has no effect (no script-created parser)
+ localStorage.test6564729 += '7';
+ })
+onload = t.step_func(function() {
+ localStorage.test6564729 = '0';
+ setTimeout(t.step_func(function() {document.links[0].click()}));
+});
+</script>
+<body onbeforeunload="localStorage.test6564729 += '1'"
+ onpagehide="localStorage.test6564729 += '3'"
+ onunload="do_test()">
+<p><a href="001a.html">Follow this link to run the test.</a>
+<p><iframe src="001b.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001a.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001a.html
new file mode 100644
index 000000000..36d4188b9
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001a.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<script>
+opener.t.step(function() {
+ opener.assert_equals(localStorage.test6564729, '0123456789');
+ opener.t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001b.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001b.html
new file mode 100644
index 000000000..eaafc371a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001b.html
@@ -0,0 +1,5 @@
+<!DOCTYPE HTML>
+<body onbeforeunload="localStorage.test6564729 += '2'"
+ onpagehide="localStorage.test6564729 += '8'"
+ onunload="localStorage.test6564729 += '9'">
+<p>Inner frame \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002-1.html
new file mode 100644
index 000000000..0e6f7d967
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002-1.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<script>
+ var t = opener.t;
+
+ var do_test = t.step_func(function() {
+ localStorage.test6564729 += '1';
+ var d = document;
+ var e = document.open(); // unload triggered here - beforeunload 2, 3 in 002b; pagehide 4, unload 5, pagehide 6 in 002b, unload 7 in 002b
+ localStorage.test6564729 += (e == d) ? '8' : 'X';
+ var s = 'FAIL if you see this | ' + localStorage.test6564729;
+ document.write(s);
+ localStorage.test6564729 += document.body.textContent == s ? '9' : 'x';
+ document.close();
+ localStorage.test6564729 += 'Z';
+ document.body.textContent += ' // ' + localStorage.test6564729;
+ location = '002a.html'; // unload triggers again here, but they're not registered event listeners any more
+ });
+
+onload = t.step_func(function() {
+ localStorage.test6564729 = '0';
+ setTimeout(function() {document.getElementsByTagName("input")[0].click()}, 100);
+});
+</script>
+<body onbeforeunload="localStorage.test6564729 += '2'"
+ onpagehide="localStorage.test6564729 += '4'"
+ onunload="localStorage.test6564729 += '5'">
+<input type=button value="Activate this button to run the test" onclick="do_test()">
+<p><iframe src="002b.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002a.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002a.html
new file mode 100644
index 000000000..d11f67086
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002a.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<script>
+ opener.t.step(function() {
+ opener.assert_equals(localStorage.test6564729, '0123456789Z');
+ opener.t.done();
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002b.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002b.html
new file mode 100644
index 000000000..d08a7a8ad
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002b.html
@@ -0,0 +1,5 @@
+<!DOCTYPE HTML>
+<body onbeforeunload="localStorage.test6564729 += '3'"
+ onpagehide="localStorage.test6564729 += '6'"
+ onunload="localStorage.test6564729 += '7'">
+<p>Inner frame \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003-1.html
new file mode 100644
index 000000000..b3a4754b8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<script>
+ var t = opener.t;
+ var do_test = t.step_func(function() {
+ localStorage.test6564729 += '1';
+ var d = document;
+ var e = document.open(); // has no effect (ignore-opens-during-unload > 0 because we're in beforeunload)
+ localStorage.test6564729 += (e == d) ? '2' : 'A [' + e + '] ';
+ document.write('FAIL - document.write executed and blocked navigation!'); // has no effect (ignore-opens-during-unload > 0)
+ localStorage.test6564729 += document.body.textContent.match('FAIL') ? 'B' : '3';
+ document.close(); // has no effect (no script-created parser)
+ localStorage.test6564729 += '4';
+ })
+
+ onload=t.step_func(function() {localStorage.test6564729 = '0'; setTimeout(t.step_func(function() {document.links[0].click()}), 100)})
+
+</script>
+<body
+ onbeforeunload="do_test()"
+ onpagehide="localStorage.test6564729 += '6'"
+ onunload="localStorage.test6564729 += '7'">
+<p><a href="003a.html">Follow this link to run the test.</a>
+<p><iframe src="003b.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003a.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003a.html
new file mode 100644
index 000000000..5393fa221
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003a.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML>
+<p>FAIL</p>
+<script>
+opener.t.step(function() {
+ opener.assert_equals(localStorage.test6564729, '0123456789')
+ opener.t.done();
+})
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003b.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003b.html
new file mode 100644
index 000000000..c8f1917b8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003b.html
@@ -0,0 +1,5 @@
+<!DOCTYPE HTML>
+<body onbeforeunload="localStorage.test6564729 += '5'"
+ onpagehide="localStorage.test6564729 += '8'"
+ onunload="localStorage.test6564729 += '9'">
+<p>Inner frame \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004-1.html
new file mode 100644
index 000000000..06aba08af
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004-1.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<script>
+ var t = opener.t;
+ var do_test = t.step_func(function() {
+ localStorage.test6564729 += 'B';
+ var d = document;
+ var e = document.open(); // unload triggered here - beforeunload C, D in 004b; pagehide E, unload F, pagehide G in 004b, unload HIJK in 004b
+ localStorage.test6564729 += (e == d) ? 'L' : 'Y';
+ var s = 'FAIL if you see this | ' + localStorage.test6564729;
+ document.write(s);
+ localStorage.test6564729 += document.body.textContent == s ? 'M' : 'y';
+ document.close();
+ localStorage.test6564729 += 'N';
+ location = '004a.html'; // unload triggers again here, but they're not registered event listeners any more
+ })
+onload = t.step_func(function() {
+ localStorage.test6564729 = 'A';
+ setTimeout(t.step_func(function() {document.getElementsByTagName("input")[0].click()}), 100);
+})
+</script>
+<body onbeforeunload="localStorage.test6564729 += 'C'"
+ onpagehide="localStorage.test6564729 += 'E'"
+ onunload="localStorage.test6564729 += 'F'">
+<input type=button value="Activate this button to run the test" onclick="do_test()">
+<p><iframe src="004b.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004a.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004a.html
new file mode 100644
index 000000000..117e2b94a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004a.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML>
+<p>FAIL</p>
+<script>
+opener.t.step(function() {
+ opener.assert_equals(localStorage.test6564729, 'ABCDEFGHIJKLMN');
+ opener.t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004b.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004b.html
new file mode 100644
index 000000000..788937a0b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004b.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<script>
+ function testRun() {
+ localStorage.test6564729 += 'H';
+ var d = parent.document;
+ var e = parent.document.open(); // no effect, since that document is already in unload
+ localStorage.test6564729 += (e == d) ? 'I' : 'X';
+ var s = 'FAIL';
+ document.write(s);
+ localStorage.test6564729 += document.body.textContent == s ? 'x' : 'J';
+ document.close();
+ localStorage.test6564729 += 'K';
+ }
+</script>
+<body onbeforeunload="localStorage.test6564729 += 'D'"
+ onpagehide="localStorage.test6564729 += 'G'"
+ onunload="testRun()">
+<p>Inner frame \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005-1.html
new file mode 100644
index 000000000..7b81a9f11
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005-1.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<script>
+onload = opener.t.step_func(function() {
+ localStorage.test6564729 = '0'
+ setTimeout(opener.t.step_func(function() {document.links[0].click()}), 100);
+});
+</script>
+<body
+ onbeforeunload="localStorage.test6564729 += '1'"
+ onpagehide="localStorage.test6564729 += '3'"
+ onunload="localStorage.test6564729 += '4'">
+<p><a href="005a.html">Follow this link to run the test.</a>
+<p><iframe src="005b.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005a.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005a.html
new file mode 100644
index 000000000..5185d3b92
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005a.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML>
+<p>FAIL</p>
+<script>
+opener.t.step(function() {
+ opener.assert_equals(localStorage.test6564729, '012345678')
+ opener.t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005b.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005b.html
new file mode 100644
index 000000000..476e8e38c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005b.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<script>
+ var t = parent.opener.t;
+ var do_test = t.step_func(function () {
+ localStorage.test6564729 += '5';
+ var s = 'FAIL: document.open() has canceled the navigation (' + localStorage.test6564729 + ')';
+ parent.document.open();
+ parent.document.write(s);
+ parent.document.close();
+ localStorage.test6564729 += parent.document.body.textContent.match('FAIL') == s ? 'X' : '6';
+ localStorage.test6564729 += '7';
+ });
+</script>
+<body onbeforeunload="localStorage.test6564729 += '2'"
+ onpagehide="do_test()"
+ onunload="localStorage.test6564729 += '8'">
+<p>Inner frame
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-1.html
new file mode 100644
index 000000000..74ba43954
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-1.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<script>
+addEventListener("pagehide", parent.t.step_func(function() {parent.pagehide_fired = true}), false);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-2.html
new file mode 100644
index 000000000..90e28ab7f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-2.html
@@ -0,0 +1,2 @@
+<!doctype html>
+Filler
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001.html
new file mode 100644
index 000000000..444a2770c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>pagehide event on unload</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+pagehide_fired = false;
+var t = async_test();
+
+onload = function() {setTimeout(function() {
+ var iframe = document.getElementsByTagName("iframe")[0]
+
+ iframe.onload = function() {
+ setTimeout(function() {
+ iframe.contentWindow.location="001-2.html";
+ }, 100);
+ iframe.onload = t.step_func(function() {assert_true(pagehide_fired); t.done()});
+ };
+
+ iframe.src = "001-1.html?" + Math.random();
+
+}, 100)};
+
+</script>
+<iframe></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002-1.html
new file mode 100644
index 000000000..fd8e2b726
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002-1.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<script>
+addEventListener("pagehide", parent.t.step_func(parent.do_test()), false);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002.html
new file mode 100644
index 000000000..3fb07e484
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<title>pagehide event properties</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+
+onload = function() {setTimeout(function() {
+ var iframe = document.getElementsByTagName("iframe")[0]
+
+ iframe.onload = function() {
+ setTimeout(function() {
+ iframe.contentWindow.location="001-2.html";
+ }, 100);
+ iframe.onload = t.step_func(function() {t.done()});
+ };
+
+ function do_test(e) {
+ assert_equals(e.type, "pagehide");
+ assert_equals(e.target, iframe.contentDocument);
+ assert_equals(e.currentTarget, iframe.contentWindow);
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+ assert_true(e.persisted, "persisted");
+ }
+
+ iframe.src = "002-1.html?" + Math.random();
+
+}, 100)};
+
+</script>
+<iframe></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003-1.html
new file mode 100644
index 000000000..9838c7945
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003-1.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<script>
+addEventListener("unload", parent.t.step_func(function(e) {parent.do_test(e)}), false);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003.html
new file mode 100644
index 000000000..97821be48
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<title>unload event properties</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var do_test;
+
+onload = function() {setTimeout(function() {
+ var iframe = document.getElementsByTagName("iframe")[0]
+
+ iframe.onload = function() {
+ setTimeout(function() {
+ iframe.contentWindow.location="002-2.html";
+ }, 100);
+ iframe.onload = t.step_func(function() {t.done()});
+ };
+
+ do_test = function(e) {
+ assert_equals(e.type, "unload");
+ assert_equals(e.target, iframe.contentDocument);
+ assert_equals(e.currentTarget, iframe.contentWindow);
+ assert_false(e.bubbles, "bubbles");
+ assert_false(e.cancelable, "cancelable");
+ }
+
+ iframe.src = "003-1.html?" + Math.random();
+
+}, 100)};
+
+</script>
+<iframe></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004-1.html
new file mode 100644
index 000000000..5d0497556
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004-1.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<script>
+addEventListener("pagehide", function() {parent.events.push("pagehide"); setTimeout(function() {parent.events.push("timeout")}, 0)}, false);
+addEventListener("unload", function() {parent.events.push("unload")}, false);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004.html
new file mode 100644
index 000000000..301baa3b8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>pagehide / unload event order</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+
+var events = [];
+
+onload = function() {setTimeout(function() {
+ var iframe = document.getElementsByTagName("iframe")[0]
+
+ iframe.onload = function() {
+ setTimeout(function() {
+ iframe.contentWindow.location="001-2.html";
+ }, 100);
+ iframe.onload = t.step_func(function() {
+ assert_array_equals(events, ["pagehide", "unload"])
+ t.done()});
+ };
+
+ iframe.src = "004-1.html?" + Math.random();
+
+}, 100)};
+
+</script>
+<iframe></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-1.html
new file mode 100644
index 000000000..8d2659623
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-1.html
@@ -0,0 +1,20 @@
+<!doctype html>
+006-1
+<script>
+onpagehide = function() {
+ onpagehide = null;
+ setTimeout(function() {
+ parent.t.done()
+ }, 1000);
+}
+onload = function() {
+ if (!parent.loaded) {
+ parent.loaded = true;
+ setTimeout(parent.t.step_func(
+ function() {
+ location="006-2.html?" + Math.random();
+ }
+ ), 100);
+ }
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-2.html
new file mode 100644
index 000000000..52365e55d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-2.html
@@ -0,0 +1,5 @@
+<!doctype html>
+006-2
+<script>
+onload = function() {setTimeout(parent.t.step_func(function() {history.go(-1)}), 100)}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006.html
new file mode 100644
index 000000000..c9e4d68a1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>salvagable state of document after setting pagehide listener</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+
+var loaded = false;
+
+onload = function() {setTimeout(function() {
+ var iframe = document.getElementsByTagName("iframe")[0]
+ onload = null;
+ iframe.src="006-1.html?" + Math.random();
+}, 100)};
+
+</script>
+<iframe></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-1.html
new file mode 100644
index 000000000..ed19f4498
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-1.html
@@ -0,0 +1,21 @@
+<!doctype html>
+007-1
+<script>
+onunload = function() {
+ onunload = null;
+ parent.unload_fired = true;
+ setTimeout(function() {
+ parent.timeout_fired = true;
+ }, 100);
+}
+onload = function() {
+ if (!parent.loaded) {
+ parent.loaded = true;
+ setTimeout(parent.t.step_func(
+ function() {
+ location="007-2.html?" + Math.random();
+ }
+ ), 100);
+ }
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-2.html
new file mode 100644
index 000000000..f74cd1e67
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-2.html
@@ -0,0 +1,5 @@
+<!doctype html>
+007-2
+<script>
+onload = function() {setTimeout(parent.t.step_func(function() {parent.start_test(); history.go(-1)}), 100)}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007.html
new file mode 100644
index 000000000..0d5b72e0f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>salvagable state of document after setting unload listener</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test(undefined, {timeout:2000});
+
+var loaded = false;
+var unload_fired = false;
+var timeout_fired = false;
+
+function start_test() {
+ setTimeout(t.step_func(function() {
+ assert_true(unload_fired);
+ assert_false(timeout_fired);
+ t.done()
+ }), 1000);
+}
+
+onload = function() {setTimeout(function() {
+ var iframe = document.getElementsByTagName("iframe")[0]
+ onload = null;
+ iframe.src="007-1.html?" + Math.random();
+}, 100)};
+
+</script>
+<iframe></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008-1.html
new file mode 100644
index 000000000..29de29c91
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008-1.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<script>
+onpagehide = parent.t.step_func(function() {parent.t.done()});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008.html
new file mode 100644
index 000000000..015507d81
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>pagehide IDL attribute</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var iframe;
+var t = async_test();
+onload = function() {
+ setTimeout(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ iframe.src="about:blank";
+ }, 100)
+};
+</script>
+<iframe src="008-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009-1.html
new file mode 100644
index 000000000..d69a05914
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009-1.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<script>
+onunload = parent.t.step_func(function() {parent.t.done()});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009.html
new file mode 100644
index 000000000..0e93e0470
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>unload IDL attribute</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var iframe;
+var t = async_test();
+onload = function() {
+ setTimeout(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ iframe.src="about:blank";
+ }, 100)
+}
+</script>
+<iframe src="009-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/MANIFEST b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/MANIFEST
new file mode 100644
index 000000000..637d35cf3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/MANIFEST
@@ -0,0 +1,21 @@
+support 001-1.html
+support 001-2.html
+001.html
+support 002-1.html
+002.html
+support 003-1.html
+003.html
+support 004-1.html
+004.html
+support 006-1.html
+support 006-2.html
+006.html
+support 007-1.html
+support 007-2.html
+007.html
+support 008-1.html
+008.html
+support 009-1.html
+009.html
+manual manual-001-1.html
+manual manual-001.html
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/manual-001-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/manual-001-1.html
new file mode 100644
index 000000000..3da0a0de3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/manual-001-1.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<p>Now go back. PASS should be displayed after a short pause
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/manual-001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/manual-001.html
new file mode 100644
index 000000000..6d817a111
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/manual-001.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<title>Document salvagable state after setting pagehide handler</title>
+<script>onpagehide = function() {setTimeout(function(){document.body.innerHTML = "PASS"}, 100)}</script>
+<p>Click the link below then navigate back to this page. Shortly after returning you should see the text "PASS"</p>
+<p><A href="manual-001-1.html">Click here</a>
diff --git a/testing/web-platform/tests/html/browsers/history/.gitkeep b/testing/web-platform/tests/html/browsers/history/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/history/history-notes/.gitkeep b/testing/web-platform/tests/html/browsers/history/history-notes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/history-notes/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child1.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child1.html
new file mode 100644
index 000000000..22bb0b298
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child1.html
@@ -0,0 +1,18 @@
+<body>
+ <a id="link" href="joint-session-history-child2.html">Child1</a>.
+ <iframe id="grandchild"></iframe>
+</body>
+<script>
+ window.onload = function() {
+ var link = document.getElementById("link");
+ var grandchild = document.getElementById("grandchild");
+ var timer = window.setInterval(poll, 100);
+ function poll() {
+ if (grandchild.getAttribute("data-grandchild-loaded")) {
+ window.clearInterval(timer);
+ link.click();
+ }
+ }
+ grandchild.src="joint-session-history-grandchild1.html";
+ };
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child2.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child2.html
new file mode 100644
index 000000000..24b469516
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child2.html
@@ -0,0 +1,5 @@
+<body>Child 2.</body>
+<script>
+ // Servo doesn't support postMessage yet, so we poll on attributes.
+ window.frameElement.setAttribute("data-child-loaded", true);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild1.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild1.html
new file mode 100644
index 000000000..d05e15242
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild1.html
@@ -0,0 +1,8 @@
+<body>
+ <a id="link" href="joint-session-history-grandchild2.html">Grandchild1</a>.
+</body>
+<script>
+ window.onload = function() {
+ document.getElementById("link").click();
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild2.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild2.html
new file mode 100644
index 000000000..b5c81e1fc
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild2.html
@@ -0,0 +1,5 @@
+<body>Grandchild2.</body>
+<script>
+ // Servo doesn't support postMessage yet, so we poll on attributes.
+ window.frameElement.setAttribute("data-grandchild-loaded", true);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html
new file mode 100644
index 000000000..c42d160a2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Do only fully active documents count for session history?</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+ <iframe id="child"></iframe>
+</body>
+<script>
+ async_test(function(t) {
+ var old_history_len = window.history.length;
+ var child = document.getElementById("child");
+ var timer = window.setInterval(t.step_func(poll), 100);
+ function poll() {
+ if (child.getAttribute("data-child-loaded")) {
+ // Check to see how many entries have been added to the session history.
+ // The spec https://html.spec.whatwg.org/multipage/#joint-session-history
+ // says that only fully active documents are included in the joint session history.
+ // If only fully active documents count, then the only fully active document
+ // is the child, with session length 1, so the joint session length change will be 1.
+ // If all documents count, then the grandchild is reachable via the session history,
+ // and it has session length 1, so the joint session length change will be 2.
+ assert_equals(2, window.history.length - old_history_len);
+ window.clearInterval(timer);
+ t.done();
+ }
+ }
+ child.src = "joint-session-history-child1.html";
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/.gitkeep b/testing/web-platform/tests/html/browsers/history/the-history-interface/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/001.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/001.html
new file mode 100644
index 000000000..0e5632bbc
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/001.html
@@ -0,0 +1,333 @@
+<!doctype html>
+<html>
+ <head>
+ <title>history.pushState tests</title>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ <script type="text/javascript">
+//does not test for firing of popstate onload, because this was dropped from the specification on 25 March 2011
+//covers history.state after load, in accordance with the specification draft from 25 March 2011
+//history.state before load is tested in 006 and 007
+//does not test for structured cloning of FileList, File or Blob interfaces, as these require manual file selection
+
+//**This test assumes that assignments to location.hash will be synchronous - this is how all browsers implement it.
+//The spec (as of 25 March 2011) disagrees.**//
+
+var histlength, atstep = 0, lasttimer;
+setup({explicit_done:true}); //tests should take under 6 seconds + execution time
+
+window.onload = function () {
+ if( location.protocol == 'file:' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'ERROR: This test cannot be run from file: (URL resolving will not work). It must be loaded over HTTP.';
+ return;
+ } else if( location.protocol == 'https:' ) {
+ document.getElementsByTagName('p')[0].innerHTML += '<br>WARNING: Browsers may intentionally fail to update history.length when pages are loaded over HTTPS, as a privacy restriction. If possible, load this page over HTTP.';
+ }
+ //use a timeout, because some browsers intentionally do not add history entries for URL changes in the onload thread
+ setTimeout(testinit,100);
+};
+function testinit() {
+ atstep = 1;
+ histlength = history.length;
+ iframe = document.getElementsByTagName('iframe')[0].src = 'blank2.html';
+ //reportload will now be called by the onload handler for the iframe
+}
+function reportload() {
+ var iframe = document.getElementsByTagName('iframe')[0], hashchng = false;
+ var canvassup = false, cloneobj;
+
+ function tests1() {
+ //Firefox may fail when reloading, because it recovers iframe state, and therefore does not see the need to alter history length
+ test(function () { assert_equals( history.length, histlength + 1, 'make sure that you loaded the test in a new tab/window' ); }, 'history.length should update when loading pages in an iframe');
+ histlength = history.length;
+ iframe.contentWindow.location.hash = 'test'; //should be synchronous **SEE COMMENT AT TOP OF FILE
+ test(function () {
+ assert_equals( history.length, histlength + 1, 'make sure that you loaded the test in a new tab/window' );
+ }, 'history.length should update when setting location.hash');
+ test(function () { assert_true( !!history.pushState, 'critical test; ignore any failures after this' ); }, 'history.pushState must exist'); //assert_exists does not allow prototype inheritance
+ test(function () { assert_true( !!iframe.contentWindow.history.pushState, 'critical test; ignore any failures after this' ); }, 'history.pushState must exist within iframes');
+ test(function () {
+ assert_equals( iframe.contentWindow.history.state, null );
+ }, 'initial history.state should be null');
+ test(function () {
+ histlength = history.length;
+ iframe.contentWindow.history.pushState('','');
+ assert_equals( history.length, histlength + 1 );
+ }, 'history.length should update when pushing a state');
+ test(function () {
+ assert_equals( iframe.contentWindow.history.state, '' );
+ }, 'history.state should update after a state is pushed');
+ histlength = history.length;
+ history.back();
+ setTimeout(tests2,50); //.back is queued to end of thread
+ }
+ function tests2() {
+ test(function () {
+ assert_equals( history.length, histlength );
+ }, 'history.length should not decrease after going back');
+ test(function () {
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test' );
+ }, 'traversing history must traverse pushed states');
+ history.go(-1);
+ setTimeout(tests3,50); //.go is queued to end of thread
+ }
+ function tests3() {
+ test(function () {
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), '', '(this could cause other failures later on)' );
+ }, 'traversing history must also traverse hash changes');
+ //Safari 5.0.3 fails here - it navigates *this* document to the *iframe's* location, instead of just navigating the iframe
+ history.go(2);
+ setTimeout(tests4,50); //.go is queued to end of thread
+ }
+ function tests4() {
+ test(function () {
+ //Firefox 4 beta 11 has a messed up error object, which does not have the right error type or .SECURITY_ERR property
+ assert_throws('SECURITY_ERR',function () { history.pushState('','','//exa mple'); });
+ }, 'pushState must not be allowed to create invalid URLs');
+ test(function () {
+ assert_throws('SECURITY_ERR',function () { history.pushState('','','http://www.example.com/'); });
+ }, 'pushState must not be allowed to create cross-origin URLs');
+ test(function () {
+ assert_throws('SECURITY_ERR',function () { history.pushState('','','about:blank'); });
+ }, 'pushState must not be allowed to create cross-origin URLs (about:blank)');
+ test(function () {
+ assert_throws('SECURITY_ERR',function () { history.pushState('','','data:text/html,'); });
+ }, 'pushState must not be allowed to create cross-origin URLs (data:URI)');
+ test(function () {
+ assert_throws('SECURITY_ERR',function () { iframe.contentWindow.history.pushState('','','http://www.example.com/'); },iframe.contentWindow);
+ }, 'security errors are expected to be thrown in the context of the document that owns the history object');
+ test(function () {
+ iframe.contentWindow.location.hash = 'test2';
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test2', 'location.hash did not change when told to' );
+ }, 'location.hash must be allowed to change (part 1)');
+ history.go(-1);
+ setTimeout(tests5,50); //.go is queued to end of thread
+ }
+ function tests5() {
+ test(function () {
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test', 'location.hash did not change when going back' );
+ }, 'location.hash must be allowed to change (part 2)');
+ test(function () {
+ iframe.contentWindow.history.pushState('','');
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test', 'location.hash changed when an unrelated state was pushed' );
+ }, 'pushState must not alter location.hash when no URL is provided');
+ history.go(1); //should do nothing, since the pushState should have removed the forward history
+ setTimeout(tests6,50); //.go is queued to end of thread
+ }
+ function tests6() {
+ test(function () {
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test' );
+ }, 'pushState must remove all history after the current state');
+ test(function () {
+ iframe.contentWindow.history.pushState('','','#test3');
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test3' );
+ }, 'pushState must be able to set location.hash');
+ //begin setup for "remove any tasks queued by the history traversal task source"
+ iframe.contentWindow.location.hash = '#test4';
+ iframe.contentWindow.history.go(-1); //must be queued
+ try {
+ //must remove the queued navigation in the same browsing context
+ iframe.contentWindow.history.pushState('','');
+ } catch(unsuperr) {}
+ //allow the browser to mistakenly run the .go if it is going to
+ //do not put two .go commands in the same thread, in case the browser mistakenly calculates the history position when
+ //calling .go instead of when executing the traversal task - that could give a false PASS in the next test otherwise
+ setTimeout(tests7,50);
+ }
+ function tests7() {
+ iframe.contentWindow.history.go(-1); //must be queued, but should not be removed this time
+ setTimeout(tests8,50); //.go is queued to end of thread
+ }
+ function tests8() {
+ test(function () {
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test4' );
+ }, 'pushState must remove any tasks queued by the history traversal task source');
+ //end "remove any tasks queued by the history traversal task source"
+ window.addEventListener('hashchange',function () { hashchng = true; },false);
+ try {
+ //push a state that changes the hash
+ iframe.contentWindow.history.pushState('','',iframe.contentWindow.location.pathname+'#test5');
+ } catch(unsuperr) {}
+ setTimeout(tests9,50); //allow the hashchange event to process, if the browser has mistakenly fired it
+ }
+ function tests9() {
+ test(function () {
+ assert_false( hashchng );
+ }, 'pushState must not fire hashchange events');
+ test(function () {
+ iframe.contentWindow.history.pushState('','','/testing_ignore_me_404');
+ assert_equals( iframe.contentWindow.location.pathname, '/testing_ignore_me_404' );
+ }, 'pushState must be able to set location.pathname');
+ test(function () {
+ var newURL = location.href.replace(/\/[^\/]*$/)+'/testing_ignore_me_404/';
+ iframe.contentWindow.history.pushState('','',newURL);
+ assert_equals( iframe.contentWindow.location.href, newURL );
+ }, 'pushState must be able to set absolute URLs to the same host');
+ test(function () {
+ assert_throws( 'DATA_CLONE_ERR', function () {
+ history.pushState({dummy:function () {}},'');
+ } );
+ }, 'pushState must not be able to use a function as data');
+ test(function () {
+ assert_throws( 'DATA_CLONE_ERR', function () {
+ history.pushState({dummy:window},'');
+ } );
+ }, 'pushState must not be able to use a DOM node as data');
+ test(function () {
+ try { a.b = c; } catch(errdata) {
+ assert_throws( 'DATA_CLONE_ERR', function () {
+ history.pushState({dummy:errdata},'');
+ } );
+ }
+ }, 'pushState must not be able to use an error object as data');
+ test(function () {
+ assert_throws( 'DATA_CLONE_ERR', function () {
+ iframe.contentWindow.history.pushState(document,'');
+ }, iframe.contentWindow );
+ }, 'security errors are expected to be thrown in the context of the document that owns the history object (2)');
+ cloneobj = {
+ nulldata: null,
+ udefdata: window.undefined,
+ booldata: true,
+ numdata: 1,
+ strdata: 'string data',
+ boolobj: new Boolean(true),
+ numobj: new Number(1),
+ strobj: new String('string data'),
+ datedata: new Date(),
+ regdata: /a/g,
+ arrdata: [1]
+ };
+ cloneobj.regdata.lastIndex = 1;
+ cloneobj.looped = cloneobj;
+ //test the ImageData type, if the browser supports it
+ var canvas = document.createElement('canvas');
+ if( canvas.getContext && ( canvas = canvas.getContext('2d') ) && canvas.createImageData ) {
+ canvassup = true;
+ cloneobj.imgdata = canvas.createImageData(1,1);
+ }
+ test(function () {
+ try {
+ iframe.contentWindow.history.pushState(cloneobj,'new title');
+ } catch(e) {
+ cloneobj.looped = null;
+ //try again because this object is needed for future tests
+ iframe.contentWindow.history.pushState(cloneobj,'new title');
+ //rethrow so the browser gets a FAIL for not coping with the circular reference; "internal structured cloning algorithm" step 1
+ throw(e);
+ }
+ }, 'pushState must be able to make structured clones of complex objects');
+ test(function () {
+ assert_equals( iframe.contentWindow.history.state && iframe.contentWindow.history.state.strdata, 'string data' );
+ }, 'history.state should also reference a clone of the original object');
+ test(function () {
+ assert_false( cloneobj === iframe.contentWindow.history.state );
+ }, 'history.state should be a clone of the original object, not a reference to it');
+ /*
+ behaviour is not defined per spec, and no known implementations do this
+ test(function () {
+ assert_equals( iframe.contentDocument.title, 'new title', 'not required for specification conformance' );
+ }, 'pushState MIGHT set the document title');
+ */
+ history.go(-1);
+ setTimeout(tests10,50); //.go is queued to end of thread
+ }
+ function tests10() {
+ var eventtime = setTimeout(function () { tests11(false); },500); //should be cleared by the event handler long before it has a chance to fire
+ iframe.contentWindow.addEventListener('popstate',function (e) { clearTimeout(eventtime); tests11(true,e); },false);
+ history.forward();
+ }
+ function tests11(hasFired,ev) {
+ test(function () {
+ assert_true( hasFired );
+ }, 'popstate event should fire when navigation occurs');
+ test(function () {
+ assert_true( !!ev && typeof(ev.state) != 'undefined', 'state information was not passed' );
+ assert_true( !!ev.state, 'state information does not contain the expected value - browser is probably stuck in the wrong history position' );
+ assert_equals( ev.state.nulldata, null, 'state null data was not correct' );
+ assert_equals( ev.state.udefdata, window.undefined, 'state undefined data was not correct' );
+ assert_true( ev.state.booldata, 'state boolean data was not correct' );
+ assert_equals( ev.state.numdata, 1, 'state numeric data was not correct' );
+ assert_equals( ev.state.strdata, 'string data', 'state string data was not correct' );
+ assert_true( !!ev.state.datedata.getTime, 'state date data was not correct' );
+ assert_exists( ev.state, 'regdata', 'state regex data was not correct' );
+ assert_equals( ev.state.regdata.source, 'a', 'state regex pattern data was not correct' );
+ assert_true( ev.state.regdata.global, 'state regex flag data was not correct' );
+ assert_equals( ev.state.regdata.lastIndex, 0, 'state regex lastIndex data was not correct' );
+ assert_equals( ev.state.arrdata.length, 1, 'state array data was not correct' );
+ assert_true( ev.state.boolobj.valueOf(), 'state boolean data was not correct' );
+ assert_equals( ev.state.numobj.valueOf(), 1, 'state numeric data was not correct' );
+ assert_equals( ev.state.strobj.valueOf(), 'string data', 'state string data was not correct' );
+ if( canvassup ) {
+ assert_equals( ev.state.imgdata.width, 1, 'state ImageData was not correct' );
+ }
+ }, 'popstate event should pass the state data');
+ test(function () {
+ assert_equals( ev.state.looped, ev.state );
+ }, 'state data should cope with circular object references');
+ test(function () {
+ assert_false( cloneobj === ev.state );
+ }, 'state data should be a clone of the original object, not a reference to it');
+ test(function () {
+ assert_equals( iframe.contentWindow.history.state && iframe.contentWindow.history.state.strdata, 'string data' );
+ }, 'history.state should also reference a clone of the original object (2)');
+ test(function () {
+ assert_false( cloneobj === iframe.contentWindow.history.state );
+ }, 'history.state should be a clone of the original object, not a reference to it (2)');
+ test(function () {
+ assert_false( iframe.contentWindow.history.state === ev.state );
+ }, 'history.state should be a separate clone of the object, not a reference to the object passed to the event handler');
+ try {
+ iframe.contentWindow.persistval = true;
+ iframe.contentWindow.history.pushState('','', location.href.replace(/\/[^\/]*$/,'/blank3.html') );
+ } catch(unsuperr) {}
+ //it's already cached, so this should be very fast if the browser mistakenly loads it
+ //it should not need to load at all, since it's just a pushed state
+ setTimeout(tests12,1000);
+ }
+ function tests12() {
+ test(function () {
+ assert_true( iframe.contentWindow.persistval && !iframe.contentWindow.forreal );
+ }, 'pushState should not actually load the new URL');
+ atstep = 3;
+ iframe.contentWindow.location.reload(); //load the real URL
+ lasttimer = setTimeout(function () { tests13(false); },3000); //should be cleared by the onload handler long before it has a chance to fire
+ }
+ function tests13(passed) {
+ test(function () {
+ assert_true( passed, 'expected a load event to fire when reloading the URL from cache, gave up waiting after 3 seconds' );
+ }, 'reloading a pushed state should actually load the new URL');
+ //try to make browsers behave when reloading so that the correct URL is recovered - does not always work
+ iframe.contentWindow.location.href = location.href.replace(/\/[^\/]*$/,'/blank.html');
+ done();
+ }
+
+ if( atstep == 1 ) {
+ //blank2 has loaded
+ atstep = 2;
+ //use a timeout, because some browsers intentionally do not add history entries for URL changes in an onload thread
+ setTimeout(tests1,100);
+ } else if( atstep == 3 ) {
+ //blank3 should now have loaded after the .reload() command
+ atstep = 4;
+ clearTimeout(lasttimer);
+ tests13(true);
+ }
+}
+
+
+
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>WARNING: This test should always be loaded in a new tab/window, to avoid browsers attempting to recover the state of frames, and history length. Do not reload the test.</p>
+ <div id="log">Running test...</div>
+ <p><iframe onload="reportload();" src="blank.html"></iframe></p>
+ <p><iframe src="blank.html"></iframe></p>
+ <p><iframe src="blank2.html"></iframe></p>
+ <p><iframe src="blank3.html"></iframe></p>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/002.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/002.html
new file mode 100644
index 000000000..eb0c15aab
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/002.html
@@ -0,0 +1,308 @@
+<!doctype html>
+<html>
+ <head>
+ <title>history.replaceState tests</title>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ <script type="text/javascript">
+//does not test for firing of popstate onload, because this was dropped from the specification on 25 March 2011
+//covers history.state after load, in accordance with the specification draft from 25 March 2011
+//history.state before load is tested in 006 and 007
+//does not test for structured cloning of FileList, File or Blob interfaces, as these require manual file selection
+
+//**This test assumes that assignments to location.hash will be synchronous - this is how all browsers implement it.
+//The spec (as of 25 March 2011) disagrees.
+
+var histlength, atstep = 0, lasttimer;
+setup({explicit_done:true}); //tests should take under 6 seconds + execution time
+
+window.onload = function () {
+ if( location.protocol == 'file:' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'ERROR: This test cannot be run from file: (URL resolving will not work). It must be loaded over HTTP.';
+ return;
+ } else if( location.protocol == 'https:' ) {
+ document.getElementsByTagName('p')[0].innerHTML += '<br>WARNING: Browsers may intentionally fail to update history.length when pages are loaded over HTTPS, as a privacy restriction. If possible, load this page over HTTP.';
+ }
+ //use a timeout, because some browsers intentionally do not add history entries for URL changes in the onload thread
+ setTimeout(testinit,100);
+};
+function testinit() {
+ atstep = 1;
+ histlength = history.length;
+ iframe = document.getElementsByTagName('iframe')[0].src = 'blank2.html';
+ //reportload will now be called by the onload handler for the iframe
+}
+function reportload() {
+ var iframe = document.getElementsByTagName('iframe')[0], hashchng = false;
+ var canvassup = false, cloneobj;
+
+ function tests1() {
+ test(function () { assert_equals( history.length, histlength + 1, 'make sure that you loaded the test in a new tab/window' ); }, 'history.length should update when loading pages in an iframe');
+ histlength = history.length;
+ iframe.contentWindow.location.hash = 'test'; //should be synchronous **SEE COMMENT AT TOP OF FILE
+ test(function () {
+ assert_equals( history.length, histlength + 1, 'make sure that you loaded the test in a new tab/window' );
+ }, 'history.length should update when setting location.hash');
+ test(function () { assert_true( !!history.replaceState, 'critical test; ignore any failures after this' ); }, 'history.replaceState must exist'); //assert_exists does not allow prototype inheritance
+ test(function () { assert_true( !!iframe.contentWindow.history.replaceState, 'critical test; ignore any failures after this' ); }, 'history.replaceState must exist within iframes');
+ test(function () {
+ assert_equals( iframe.contentWindow.history.state, null );
+ }, 'initial history.state should be null');
+ iframe.contentWindow.location.hash = 'test2';
+ history.back();
+ setTimeout(tests2,50); //.go is queued to end of thread
+ }
+ function tests2() {
+ test(function () {
+ histlength = history.length;
+ iframe.contentWindow.history.replaceState('','');
+ assert_equals( history.length, histlength );
+ }, 'history.length should not update when replacing a state with no URL');
+ test(function () {
+ assert_equals( iframe.contentWindow.history.state, '' );
+ }, 'history.state should update after a state is pushed');
+ test(function () {
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test' );
+ }, 'hash should not change when replaceState is called without a URL');
+ test(function () {
+ histlength = history.length;
+ iframe.contentWindow.history.replaceState('','','#test3');
+ assert_equals( history.length, histlength );
+ }, 'history.length should not update when replacing a state with a URL');
+ test(function () {
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test3' );
+ }, 'hash should change when replaceState is called with a URL');
+ history.go(-1);
+ setTimeout(tests3,50); //.go is queued to end of thread
+ }
+ function tests3() {
+ test(function () {
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), '' );
+ }, 'replaceState must replace the existing state and not add an extra one');
+ history.go(2);
+ setTimeout(tests4,50); //.go is queued to end of thread
+ }
+ function tests4() {
+ test(function () {
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test2' );
+ }, 'replaceState must replace the existing state without altering the forward history');
+ test(function () {
+ assert_throws('SECURITY_ERR',function () { history.replaceState('','','//exa mple'); });
+ }, 'replaceState must not be allowed to create invalid URLs');
+ test(function () {
+ assert_throws('SECURITY_ERR',function () { history.replaceState('','','http://www.example.com/'); });
+ }, 'replaceState must not be allowed to create cross-origin URLs');
+ test(function () {
+ assert_throws('SECURITY_ERR',function () { history.replaceState('','','about:blank'); });
+ }, 'replaceState must not be allowed to create cross-origin URLs (about:blank)');
+ test(function () {
+ assert_throws('SECURITY_ERR',function () { history.replaceState('','','data:text/html,'); });
+ }, 'replaceState must not be allowed to create cross-origin URLs (data:URI)');
+ test(function () {
+ assert_throws('SECURITY_ERR',function () { iframe.contentWindow.history.replaceState('','','http://www.example.com/'); },iframe.contentWindow);
+ }, 'security errors are expected to be thrown in the context of the document that owns the history object');
+ test(function () {
+ //avoids browsers running .go synchronously when only a hash change is involved
+ iframe.contentWindow.history.replaceState('','','/testing_ignore_me_404#test4');
+ assert_equals( iframe.contentWindow.location.pathname, '/testing_ignore_me_404' );
+ }, 'replaceState must be able to set location.pathname');
+ test(function () {
+ var newURL = location.href.replace(/\/[^\/]*$/)+'/testing_ignore_me_404/';
+ iframe.contentWindow.history.replaceState('','',newURL);
+ assert_equals( iframe.contentWindow.location.href, newURL );
+ }, 'replaceState must be able to set absolute URLs to the same host');
+ //begin setup for "[must not] remove any tasks queued by the history traversal task source"
+ iframe.contentWindow.history.go(-1); //must be queued so the next command takes place *beforehand*
+ try {
+ //must not remove the queued navigation in the same browsing context
+ iframe.contentWindow.history.replaceState('','',iframe.contentWindow.location.pathname+'#test5');
+ } catch(unsuperr2) {}
+ //allow the browser to run the .go
+ setTimeout(tests5,50);
+ }
+ function tests5() {
+ test(function () {
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test3' );
+ }, 'replaceState must not remove any tasks queued by the history traversal task source');
+ //Safari 5.0.3 fails here - it navigates *this* document to the *iframe's* location, instead of just navigating the iframe
+ history.go(1);
+ setTimeout(tests6,50); //.go is queued to end of thread
+ }
+ function tests6() {
+ test(function () {
+ assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test5' );
+ }, '.go must queue a task with the history traversal task source (run asynchronously)');
+ //end "[must not] remove any tasks queued by the history traversal task source"
+ window.addEventListener('hashchange',function () { hashchng = true; },false);
+ try {
+ //push a state that changes the hash
+ iframe.contentWindow.history.replaceState('','',iframe.contentWindow.location.pathname+'#test6');
+ } catch(unsuperr) {}
+ setTimeout(tests7,50); //allow the hashchange event to process, if the browser has mistakenly fired it
+ }
+ function tests7() {
+ test(function () {
+ assert_false( hashchng );
+ }, 'replaceState must not fire hashchange events');
+ test(function () {
+ assert_throws( 'DATA_CLONE_ERR', function () {
+ history.replaceState({dummy:function () {}},'');
+ } );
+ }, 'replaceState must not be able to use a function as data');
+ test(function () {
+ assert_throws( 'DATA_CLONE_ERR', function () {
+ history.replaceState({dummy:window},'');
+ } );
+ }, 'replaceState must not be able to use a DOM node as data');
+ test(function () {
+ try { a.b = c; } catch(errdata) {
+ assert_throws( 'DATA_CLONE_ERR', function () {
+ history.replaceState({dummy:errdata},'');
+ } );
+ }
+ }, 'replaceState must not be able to use an error object as data');
+ test(function () {
+ assert_throws( 'DATA_CLONE_ERR', function () {
+ iframe.contentWindow.history.replaceState(document,'');
+ }, iframe.contentWindow );
+ }, 'security errors are expected to be thrown in the context of the document that owns the history object (2)');
+ cloneobj = {
+ nulldata: null,
+ udefdata: window.undefined,
+ booldata: true,
+ numdata: 1,
+ strdata: 'string data',
+ boolobj: new Boolean(true),
+ numobj: new Number(1),
+ strobj: new String('string data'),
+ datedata: new Date(),
+ regdata: /a/g,
+ arrdata: [1]
+ };
+ cloneobj.regdata.lastIndex = 1;
+ cloneobj.looped = cloneobj;
+ //test the ImageData type, if the browser supports it
+ var canvas = document.createElement('canvas');
+ if( canvas.getContext && ( canvas = canvas.getContext('2d') ) && canvas.createImageData ) {
+ canvassup = true;
+ cloneobj.imgdata = canvas.createImageData(1,1);
+ }
+ test(function () {
+ try {
+ iframe.contentWindow.history.replaceState(cloneobj,'new title');
+ } catch(e) {
+ cloneobj.looped = null;
+ //try again because this object is needed for future tests
+ iframe.contentWindow.history.replaceState(cloneobj,'new title');
+ //rethrow so the browser gets a FAIL for not coping with the circular reference; "internal structured cloning algorithm" step 1
+ throw(e);
+ }
+ }, 'replaceState must be able to make structured clones of complex objects');
+ test(function () {
+ assert_equals( iframe.contentWindow.history.state && iframe.contentWindow.history.state.strdata, 'string data' );
+ }, 'history.state should also reference a clone of the original object');
+ test(function () {
+ assert_false( cloneobj === iframe.contentWindow.history.state );
+ }, 'history.state should be a clone of the original object, not a reference to it');
+ history.go(-1);
+ setTimeout(tests8,50); //.go is queued to end of thread
+ }
+ function tests8() {
+ var eventtime = setTimeout(function () { tests9(false); },500); //should be cleared by the event handler long before it has a chance to fire
+ iframe.contentWindow.addEventListener('popstate',function (e) { clearTimeout(eventtime); tests9(true,e); },false);
+ history.forward();
+ }
+ function tests9(hasFired,ev) {
+ test(function () {
+ assert_true( hasFired );
+ }, 'popstate event should fire when navigation occurs');
+ test(function () {
+ assert_true( !!ev && typeof(ev.state) != 'undefined', 'state information was not passed' );
+ assert_true( !!ev.state, 'state information does not contain the expected value - browser is probably stuck in the wrong history position' );
+ assert_equals( ev.state.nulldata, null, 'state null data was not correct' );
+ assert_equals( ev.state.udefdata, window.undefined, 'state undefined data was not correct' );
+ assert_true( ev.state.booldata, 'state boolean data was not correct' );
+ assert_equals( ev.state.numdata, 1, 'state numeric data was not correct' );
+ assert_equals( ev.state.strdata, 'string data', 'state string data was not correct' );
+ assert_true( !!ev.state.datedata.getTime, 'state date data was not correct' );
+ assert_exists( ev.state, 'regdata', 'state regex data was not correct' );
+ assert_equals( ev.state.regdata.source, 'a', 'state regex pattern data was not correct' );
+ assert_true( ev.state.regdata.global, 'state regex flag data was not correct' );
+ assert_equals( ev.state.regdata.lastIndex, 0, 'state regex lastIndex data was not correct' );
+ assert_equals( ev.state.arrdata.length, 1, 'state array data was not correct' );
+ assert_true( ev.state.boolobj.valueOf(), 'state boolean data was not correct' );
+ assert_equals( ev.state.numobj.valueOf(), 1, 'state numeric data was not correct' );
+ assert_equals( ev.state.strobj.valueOf(), 'string data', 'state string data was not correct' );
+ if( canvassup ) {
+ assert_equals( ev.state.imgdata.width, 1, 'state ImageData was not correct' );
+ }
+ }, 'popstate event should pass the state data');
+ test(function () {
+ assert_equals( ev.state.looped, ev.state );
+ }, 'state data should cope with circular object references');
+ test(function () {
+ assert_false( cloneobj === ev.state );
+ }, 'state data should be a clone of the original object, not a reference to it');
+ test(function () {
+ assert_equals( iframe.contentWindow.history.state && iframe.contentWindow.history.state.strdata, 'string data' );
+ }, 'history.state should also reference a clone of the original object (2)');
+ test(function () {
+ assert_false( cloneobj === iframe.contentWindow.history.state );
+ }, 'history.state should be a clone of the original object, not a reference to it (2)');
+ test(function () {
+ assert_false( iframe.contentWindow.history.state === ev.state );
+ }, 'history.state should be a separate clone of the object, not a reference to the object passed to the event handler');
+ try {
+ iframe.contentWindow.persistval = true;
+ iframe.contentWindow.history.replaceState('','', location.href.replace(/\/[^\/]*$/,'/blank3.html') );
+ } catch(unsuperr) {}
+ //it's already cached, so this should be very fast if the browser mistakenly loads it
+ //it should not need to load at all, since it's just a pushed state
+ setTimeout(tests10,1000);
+ }
+ function tests10() {
+ test(function () {
+ assert_true( iframe.contentWindow.persistval && !iframe.contentWindow.forreal );
+ }, 'replaceState should not actually load the new URL');
+ atstep = 3;
+ iframe.contentWindow.location.reload(); //load the real URL
+ lasttimer = setTimeout(function () { tests11(false); },3000); //should be cleared by the onload handler long before it has a chance to fire
+ }
+ function tests11(passed) {
+ test(function () {
+ assert_true( passed, 'expected a load event to fire when reloading the URL from cache, gave up waiting after 3 seconds' );
+ }, 'reloading a replaced state should actually load the new URL');
+ //try to make browsers behave when reloading so that the correct URL is recovered - does not always work
+ iframe.contentWindow.location.href = location.href.replace(/\/[^\/]*$/,'/blank.html');
+ done();
+ }
+
+ if( atstep == 1 ) {
+ //blank2 has loaded
+ atstep = 2;
+ //use a timeout, because some browsers intentionally do not add history entries for URL changes in an onload thread
+ setTimeout(tests1,100);
+ } else if( atstep == 3 ) {
+ //blank3 should now have loaded after the .reload() command
+ atstep = 4;
+ clearTimeout(lasttimer);
+ tests11(true);
+ }
+}
+
+
+
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>WARNING: This test should always be loaded in a new tab/window, to avoid browsers attempting to recover the state of frames, and history length. Do not reload the test.</p>
+ <div id="log">Running test...</div>
+ <p><iframe onload="reportload();" src="blank.html"></iframe></p>
+ <p><iframe src="blank.html"></iframe></p>
+ <p><iframe src="blank2.html"></iframe></p>
+ <p><iframe src="blank3.html"></iframe></p>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/004.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/004.html
new file mode 100644
index 000000000..e69889724
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/004.html
@@ -0,0 +1,62 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Final history position for history.go should be calculated when executing the task</title>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ <script type="text/javascript">
+setup({explicit_done:true});
+window.onload = function () {
+ var hashcount = 0;
+ if( location.hash && location.hash != '#' ) {
+ location.href = location.href.replace(/#.*$/,'');
+ return;
+ }
+ setTimeout(add1,100);
+ function add1() {
+ location.hash = '#foo';
+ setTimeout(add2,100);
+ }
+ function add2() {
+ location.hash = '#bar';
+ setTimeout(add3,100);
+ }
+ function add3() {
+ location.hash = '#baz';
+ setTimeout(dojumps,100);
+ }
+ function dojumps() {
+ window.onhashchange = function () {
+ hashcount++;
+ };
+ history.go(-2);
+ test(function () {
+ //many browsers special-case jumps that only imply hash changes and will do them synchronously - the spec does allow this
+ assert_equals( hashcount, 0, 'hashchange fired even though the location should not have changed' );
+ assert_equals( location.hash.replace(/^#/,''), 'baz', 'the browser navigated synchronously' );
+ }, '.go commands should be queued until the thread has ended');
+ history.go(-1);
+ setTimeout(checkjumps,100);
+ }
+ function checkjumps() {
+ test(function () {
+ assert_true( !!hashcount, 'this testcase requires haschange support; the test cannot be used in this browser' );
+ }, 'browser needs to support hashchange events for this testcase');
+ test(function () {
+ assert_equals( hashcount, 2, 'the wrong number of queued commands were executed' );
+ }, 'queued .go commands should all be executed when the queue is processed');
+ test(function () {
+ assert_equals( location.hash.replace(/^#/,''), '' );
+ }, 'history position should be calculated when executing, not when calling the .go command');
+ done();
+ }
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/005.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/005.html
new file mode 100644
index 000000000..2152e85a3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/005.html
@@ -0,0 +1,47 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Popstate event listener registration</title>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ <script type="text/javascript">
+
+//this test checks that onpopstate works on the body element
+
+var readyForPop = false, bodypop = false, inlinepop = false;
+setup({explicit_done:true});
+
+//use a timeout to avoid "popstate fires onload" from setting the variables too early
+setTimeout(step1,1000);
+function step1() {
+ readyForPop = true;
+ test(function () {
+ history.pushState('','');
+ history.pushState('','');
+ }, 'history.pushState support is needed for this testcase');
+ history.go(-1);
+ setTimeout(step2,50); //.go is queued to end of thread
+}
+function step2() {
+ test(function () {
+ assert_true( bodypop );
+ }, '<body onpopstate="..."> should register a listener for the popstate event');
+ window.onpopstate = function () { inlinepop = true; };
+ history.go(-1);
+ setTimeout(step3,50); //.go is queued to end of thread
+}
+function step3() {
+ test(function () {
+ assert_true( inlinepop );
+ }, 'window.onpopstate should register a listener for the popstate event');
+ done();
+}
+ </script>
+ </head>
+ <body onpopstate="if( readyForPop ) { bodypop = true; }">
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/006.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/006.html
new file mode 100644
index 000000000..442b6f8f1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/006.html
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Firing popstate after onload, even if there is no pushed/replaced state</title>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ <script type="text/javascript">
+
+//spec (25 March 2011 draft) states that popstate must not fire after onload unless there is a pushed/replaced state that is navigated
+var popfired = false;
+setup({explicit_done:true});
+window.addEventListener('popstate',function (e) { popfired = true; },false);
+test(function () {
+ assert_equals( history.state, null );
+}, 'history.state should initially be null');
+window.onload = function () {
+ test(function () {
+ assert_false( popfired );
+ }, 'popstate event should not fire before onload fires');
+ test(function () {
+ assert_equals( history.state, null );
+ }, 'history.state should still be null onload');
+ popfired = false;
+ setTimeout(function () {
+ test(function () {
+ assert_false( popfired );
+ }, 'popstate event should not fire after onload fires');
+ test(function () {
+ assert_equals( history.state, null );
+ }, 'history.state should still be null after onload');
+ test(function () {
+ var failed = false, realstate = history.state;
+ try {
+ history.state = '';
+ } catch(e) {
+ failed = e;
+ }
+ assert_equals(history.state,realstate,'property was read/write');
+ assert_false(failed);
+ }, 'writing to history.state should be silently ignored and not throw an error');
+ done();
+ },100);
+};
+
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/007.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/007.html
new file mode 100644
index 000000000..29ed8bf0e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/007.html
@@ -0,0 +1,56 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Firing popstate after onload with pushed state</title>
+ <meta name=timeout content=long>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log">It looks like the browser stopped loading the page when encountering a .go(-1) command pointing to a pushed state. This will break the tests.</div>
+ <script type="text/javascript">
+
+//spec (25 March 2011 draft) states that popstate must fire before onload if there is a pushed/replaced state that is navigated
+var popfired = false;
+setup({explicit_done:true});
+test(function () {
+ assert_equals( history.state, null );
+}, 'history.state should initially be null');
+window.addEventListener('popstate',function (e) { popfired = e.state; },false);
+test(function () {
+ history.pushState('state1','');
+ history.pushState('state2','');
+}, 'history.pushState support is needed for this testcase');
+test(function () {
+ assert_equals( history.state, 'state2' );
+}, 'history.state should reflect pushed state');
+if( history.pushState ) { history.go(-1); }
+window.onload = function () {
+ test(function () {
+ assert_true( !!popfired );
+ }, 'popstate event should fire before onload fires');
+ test(function () {
+ assert_equals( popfired, 'state1' );
+ }, 'the correct state should be restored when navigating during initial load');
+ test(function () {
+ assert_equals( history.state, 'state1' );
+ }, 'history.state should reflect the navigated state onload');
+ popfired = false;
+ setTimeout(function () {
+ test(function () {
+ assert_false( !!popfired );
+ }, 'popstate event should not fire after onload fires');
+ test(function () {
+ assert_equals( history.state, 'state1' );
+ }, 'history.state should reflect the navigated state after onload');
+ done();
+ if( history.pushState ) { history.go(-1); } //go back to the start to avoid state recovery when reloading
+ },100);
+};
+
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/008.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/008.html
new file mode 100644
index 000000000..c8071e315
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/008.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+
+<!-- configure this test below to point to the script -->
+
+ <head>
+ <title>history.pushState/replaceState resolving</title>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+
+ <p></p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+ <script type="text/javascript">
+
+/*
+Location of the script (which must be hosted on a separate domain from this test) containing the test code:
+var beforehref = location.href;
+test(function () {
+ history.pushState('','','/testing_ignore_me_404');
+ assert_equals(location.href,beforehref.replace(/^(\w*:\/\/[^\/]*\/)[\w\W]*$/,'$1testing_ignore_me_404'));
+}, 'history.pushState URL resolving should be done relative to the document, not the script');
+test(function () {
+ history.replaceState('','','/testing_ignore_me_404_2');
+ assert_equals(location.href,beforehref.replace(/^(\w*:\/\/[^\/]*\/)[\w\W]*$/,'$1testing_ignore_me_404_2'));
+}, 'history.replaceState URL resolving should be done relative to the document, not the script');
+*/
+var scriptlocation = 'http://www.' + location.host + location.pathname.split("/").slice(0,-1).join("/") + "/008.js";
+
+if( location.protocol == 'file:' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'ERROR: This test cannot be run from file: (URL resolving will not work). It must be loaded over HTTP.';
+} else {
+ document.write('<script type="text\/javascript" src="'+scriptlocation+'"><\/script>');
+}
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/008.js b/testing/web-platform/tests/html/browsers/history/the-history-interface/008.js
new file mode 100644
index 000000000..96a1fe5d4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/008.js
@@ -0,0 +1,11 @@
+var beforehref = location.href;
+
+test(function () {
+ history.pushState('','','/testing_ignore_me_404');
+ assert_equals(location.href,beforehref.replace(/^(\w*:\/\/[^\/]*\/)[\w\W]*$/,'$1testing_ignore_me_404'));
+}, 'history.pushState URL resolving should be done relative to the document, not the script');
+
+test(function () {
+ history.replaceState('','','/testing_ignore_me_404_2');
+ assert_equals(location.href,beforehref.replace(/^(\w*:\/\/[^\/]*\/)[\w\W]*$/,'$1testing_ignore_me_404_2'));
+}, 'history.replaceState URL resolving should be done relative to the document, not the script');
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/009-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/009-1.html
new file mode 100644
index 000000000..00b72e8ec
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/009-1.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<html>
+ <head>
+ <title>history.pushState/replaceState and referer headers</title>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+ <script type="text/javascript">
+window.onload = function () {
+ setTimeout(function () {
+ try { history.pushState('','','009-2.html?1234'); } catch(e) {}
+ location.href = '009-3.html?pipe=sub';
+ },10);
+};
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/009-3.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/009-3.html
new file mode 100644
index 000000000..e58b8fa5e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/009-3.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+ <head>
+ <title>history.pushState/replaceState and referer headers</title>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+ <script type="text/javascript">
+var httpReferer = "{{headers[referer]}}";
+var lastUrl = location.href.replace(/\/[^\/]*$/,'\/009-2.html?1234');
+parent.test(function () {
+ parent.assert_equals( httpReferer, lastUrl );
+}, 'HTTP Referer should use the pushed state');
+parent.test(function () {
+ parent.assert_equals( document.referrer, lastUrl );
+}, 'document.referrer should use the pushed state');
+window.onload = function () {
+ setTimeout(function () {
+ try { history.pushState('','','009-4.html?2345'); } catch(e) {}
+ location.href = '009-5.html?pipe=sub';
+ },10);
+};
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/009-5.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/009-5.html
new file mode 100644
index 000000000..068a089af
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/009-5.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<html>
+ <head>
+ <title>history.pushState/replaceState and referer headers</title>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+ <script type="text/javascript">
+var httpReferer = unescape("{{headers[referer]}}");
+var lastUrl = location.href.replace(/\/[^\/]*$/,'\/009-4.html?2345');
+parent.test(function () {
+ parent.assert_equals( httpReferer, lastUrl );
+}, 'HTTP Referer should use the replaced state');
+parent.test(function () {
+ parent.assert_equals( document.referrer, lastUrl );
+}, 'document.referrer should use the replaced state');
+parent.done();
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/009.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/009.html
new file mode 100644
index 000000000..c1ae0bbe0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/009.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<html>
+ <head>
+ <title>history.pushState/replaceState and referer headers</title>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+ <script type="text/javascript">
+setup({explicit_done:true});
+var iframe = document.createElement('iframe');
+window.onload = function () {
+ iframe.setAttribute('src','009-1.html');
+ document.body.appendChild(iframe)
+};
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/010-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/010-1.html
new file mode 100644
index 000000000..683397745
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/010-1.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+ <head>
+ <title>history.pushState/replaceState and referer headers (before onload)</title>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+ <script type="text/javascript">
+try { history.pushState('','','010-2.html?1234'); } catch(e) {}
+location.href = '010-3.html?pipe=sub';
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/010-3.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/010-3.html
new file mode 100644
index 000000000..b80f56c3d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/010-3.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<html>
+ <head>
+ <title>history.pushState/replaceState and referer headers (before onload)</title>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+ <script type="text/javascript">
+ var httpReferer = "{{headers[referer]}}";
+var lastUrl = location.href.replace(/\/[^\/]*$/,'\/010-2.html?1234');
+parent.test(function () {
+ parent.assert_equals( httpReferer, lastUrl );
+}, 'HTTP Referer should use the pushed state (before onload)');
+parent.test(function () {
+ parent.assert_equals( document.referrer, lastUrl );
+}, 'document.referrer should use the pushed state (before onload)');
+try { history.pushState('','','010-4.html?2345'); } catch(e) {}
+location.href = '010-5.html?pipe=sub';
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/010-5.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/010-5.html
new file mode 100644
index 000000000..d150449eb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/010-5.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<html>
+ <head>
+ <title>history.pushState/replaceState and referer headers (before onload)</title>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+ <script type="text/javascript">
+var httpReferer = "{{headers[referer]}}";
+var lastUrl = location.href.replace(/\/[^\/]*$/,'\/010-4.html?2345');
+parent.test(function () {
+ parent.assert_equals( httpReferer, lastUrl );
+}, 'HTTP Referer should use the replaced state (before onload)');
+parent.test(function () {
+ parent.assert_equals( document.referrer, lastUrl );
+}, 'document.referrer should use the replaced state (before onload)');
+parent.done();
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/010.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/010.html
new file mode 100644
index 000000000..ca109a744
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/010.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<html>
+ <head>
+ <title>history.pushState/replaceState and referer headers (before onload)</title>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+ <script type="text/javascript">
+setup({explicit_done:true});
+var iframe = document.createElement('iframe');
+window.onload = function () {
+ iframe.setAttribute('src','010-1.html');
+ document.body.appendChild(iframe)
+};
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/011.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/011.html
new file mode 100644
index 000000000..4043aff7f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/011.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>history.pushState before onload</title>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+ <script type="text/javascript">
+var newUrl = location.href.replace(/\/[^\/]*$/,'\/011-1.html');
+setup({explicit_done:true});
+test(function () {
+ history.pushState('','','011-1.html');
+}, 'pushState should be able to set the location state');
+test(function () {
+ assert_equals( location.href, newUrl );
+}, 'pushed location should be reflected immediately');
+window.onload = function () {
+ setTimeout(function () {
+ test(function () {
+ assert_equals( location.href, newUrl );
+ }, 'pushed location should be retained after the page has loaded');
+ done();
+ },10);
+};
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/012.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/012.html
new file mode 100644
index 000000000..f5e625167
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/012.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>history.replaceState before onload</title>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+ <script type="text/javascript">
+var newUrl = location.href.replace(/\/[^\/]*$/,'\/011-1.html');
+setup({explicit_done:true});
+test(function () {
+ history.replaceState('','','011-1.html');
+}, 'replaceState should be able to set the location state');
+test(function () {
+ assert_equals( location.href, newUrl );
+}, 'replaced location should be reflected immediately');
+window.onload = function () {
+ setTimeout(function () {
+ test(function () {
+ assert_equals( location.href, newUrl );
+ }, 'replaced location should be retained after the page has loaded');
+ done();
+ },10);
+};
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/blank.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank.html
new file mode 100644
index 000000000..89c8724c0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dummy page 1</title>
+ </head>
+ <body>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/blank2.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank2.html
new file mode 100644
index 000000000..f79982e32
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank2.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dummy page 2</title>
+ </head>
+ <body>
+ <script type="text/javascript">
+if( self == top || !parent.reportload ) {
+ document.write("<p>FAIL. Browser got confused when navigating forwards, and navigated the whole window to the iframe's location, instead of just navigating the iframe. It is not possible to run the testsuite.<\/p>");
+}
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/blank3.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank3.html
new file mode 100644
index 000000000..2a8989f27
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank3.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dummy page 3</title>
+ <script type="text/javascript">
+var forreal = true;
+ </script>
+ </head>
+ <body>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_001.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_001.html
new file mode 100644
index 000000000..21ba22f6f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_001.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>combination_history_001(Combine pushState and replaceSate methods.)</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ window.history.pushState(1, document.title, '?x=1');
+ assert_equals(history.state, 1, "first");
+
+ window.history.replaceState(2, document.title, '?x=1');
+ assert_equals(history.state, 2, "second")
+ }, "Combine pushState and replaceSate methods");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_002.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_002.html
new file mode 100644
index 000000000..29e82f51b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_002.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>combination_history_002(After calling of pushState method, check length.)</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ var first;
+ var second;
+ first = window.history.length;
+ window.history.pushState(1, document.title, '?x=1');
+ second = window.history.length;
+
+ assert_equals(second - first, 1, "second - first");
+ }, "After calling of pushState method, check length");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_003.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_003.html
new file mode 100644
index 000000000..7467d9b29
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_003.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>combination_history_003(After calling of pushState and replaceState methods, check length.)</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ var first;
+ var second;
+ var third;
+ first = window.history.length;
+ window.history.pushState(1, document.title, '?x=1');
+ second = window.history.length;
+ window.history.replaceState(2, document.title, '?x=2');
+ third = window.history.length;
+
+ assert_equals(second - first, 1, "second - first");
+ assert_equals(third, second, "third");
+ }, "After calling of pushState and replaceState methods, check length");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_004.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_004.html
new file mode 100644
index 000000000..4e38b5620
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_004.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>combination_history_004(After calling of back method, check length.)</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test("After calling of back method, check length");
+
+ var last;
+ t.step(function () {
+ window.history.pushState(1, document.title, '?x=1');
+ window.history.pushState(2, document.title, '?x=2');
+ last = window.history.length;
+
+ window.history.back();
+ });
+
+ window.addEventListener('popstate', t.step_func(function(e) {
+ assert_equals(e.state, 1, "state");
+ assert_equals(window.history.length, last, "last");
+ t.done();
+ }), false);
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_005.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_005.html
new file mode 100644
index 000000000..448767801
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_005.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>combination_history_005(After calling of forward method, check length.)</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test("After calling of forward method, check length");
+
+ var last;
+ var fired = false;
+ t.step(function () {
+ window.history.pushState(1, document.title, '?x=1');
+ window.history.pushState(2, document.title, '?x=2');
+ last = window.history.length;
+
+ window.history.back();
+ });
+
+ window.addEventListener('popstate', t.step_func(function(e) {
+ if(fired) {
+ assert_equals(e.state, 2, "state");
+ assert_equals(window.history.length, last, "last");
+ t.done();
+ }
+ fired = true;
+ window.history.forward();
+ }), false);
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_006.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_006.html
new file mode 100644
index 000000000..305f593c0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_006.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>combination_history_006(After calling of go method, check length.)</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test("After calling of go method, check length");
+
+ var last;
+ t.step(function () {
+ window.history.pushState(1, document.title, '?x=1');
+ window.history.pushState(2, document.title, '?x=2');
+
+ last = window.history.length;
+
+ window.history.go(-1);
+ });
+
+ window.addEventListener('popstate', t.step_func(function(e) {
+ assert_equals(e.state, 1, "state");
+ assert_equals(window.history.length, last, "last");
+ t.done();
+ }), false);
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_007.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_007.html
new file mode 100644
index 000000000..cec9ea098
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_007.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>combination_history_007(After calling of back and pushState method, check length.)</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test("After calling of back and pushState method, check length");
+
+ var last;
+ t.step(function () {
+ window.history.pushState(1, document.title, '?x=1');
+ window.history.pushState(2, document.title, '?x=2');
+
+ last = window.history.length;
+
+ window.history.back();
+ });
+
+ window.addEventListener('popstate', t.step_func(function(e) {
+ assert_equals(e.state, 1, "state");
+ assert_equals(window.history.length, last, "last");
+ window.history.pushState(3, document.title, '?x=3');
+ assert_equals(window.history.length, last, "last");
+ t.done();
+ }), false);
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history.js b/testing/web-platform/tests/html/browsers/history/the-history-interface/history.js
new file mode 100644
index 000000000..bb5ee6dde
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history.js
@@ -0,0 +1,35 @@
+function parse_query() {
+ var query = location.search.slice(1);
+ var vars = query.split("&");
+ var fields = {};
+ vars.forEach(
+ function (x) {
+ var split = x.split("=");
+ return fields[split[0]] = split.slice(1).join("=");
+ });
+ return fields;
+}
+
+var query_parts = parse_query();
+var id = "id" in query_parts ? parseInt(query_parts.id) : 1;
+var urls_to_load = query_parts.urls.split(",");
+
+document.write(id);
+
+onunload = function() {};
+
+function queue_next() {
+ t = opener.t;
+ setTimeout(t.step_func(
+ function() {
+// opener.assert_equals(history.length, id);
+ if (urls_to_load[0]) {
+ var next_page = urls_to_load[0];
+ (next_page.indexOf("?") > -1) ? (next_page += "&") : (next_page += "?");
+ next_page += "urls=" + urls_to_load.slice(1).join(",");
+ next_page += "&id=" + ++id;
+ location = next_page;
+ }
+ }
+ ), 100);
+}
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back-1.html
new file mode 100644
index 000000000..78547019f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back-1.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ onunload = function() {}
+
+ opener.pages.push(id);
+ if (!opener.started) {
+ onload = function() {
+ setTimeout(function() {
+ opener.started = true;
+ history.back();
+ }, 100);
+ }
+ } else {
+ opener.start_test_wait();
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back.html
new file mode 100644
index 000000000..042da4e61
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>history_back</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test("history back");
+
+ t.step(function () {
+ window.history.pushState(1, document.title, '?x=1');
+ window.history.pushState(2, document.title, '?x=2');
+
+ window.history.back();
+ });
+
+ window.addEventListener('popstate', t.step_func(function(e) {
+ assert_equals(e.state, 1, "history state");
+
+ t.done();
+ }), false);
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back_1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back_1.html
new file mode 100644
index 000000000..cc37ddd35
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back_1.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>history.back() with session history</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test(undefined, {timeout:5000});
+ started = false;
+ pages = []
+ timer = null;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_array_equals(pages, [2, 1], "Pages opened during history navigation");
+ t.done();
+ } finally {
+ win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=history_back-1.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_entry.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_entry.html
new file mode 100644
index 000000000..e5929ddbe
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_entry.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ onload = function() {
+ if (!opener.started) {
+ queue_next();
+ } else {
+ opener.pages.push(id);
+ opener.start_test_wait();
+ }
+};
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-1.html
new file mode 100644
index 000000000..5880eacf0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-1.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ onunload = function() {}
+
+ onload = function() {
+ if (!opener.started) {
+ queue_next();
+ } else {
+ opener.pages.push(id);
+ opener.start_test_wait();
+ history.forward();
+ }
+ };
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-2.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-2.html
new file mode 100644
index 000000000..c7a9a1068
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-2.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ onunload = function() {}
+
+ opener.pages.push(id);
+ if (!opener.started) {
+ onload = function() {
+ setTimeout(function() {
+ opener.started = true;
+ history.go(-1);
+ }, 100);
+ }
+ } else {
+ opener.start_test_wait();
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward.html
new file mode 100644
index 000000000..6c37f2521
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>history_forward</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test("history forward");
+
+ var fired = false;
+ t.step(function () {
+ window.history.pushState(1, document.title, '?x=1');
+ window.history.pushState(2, document.title, '?x=2');
+
+ window.history.back();
+ });
+
+ window.addEventListener('popstate', t.step_func(function(e) {
+ if(fired) {
+ assert_equals(e.state, 2, "history state");
+
+ t.done();
+ }
+ fired = true;
+ window.history.forward();
+ }), false);
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward_1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward_1.html
new file mode 100644
index 000000000..3d119482c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward_1.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>history.forward() with session history</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test(undefined, {timeout:5000});
+ started = false;
+ pages = []
+ timer = null;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_array_equals(pages, [3, 2, 3], "Pages opened during history navigation");
+ t.done();
+ } finally {
+ win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=history_forward-1.html,history_forward-2.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_minus.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_minus.html
new file mode 100644
index 000000000..b8fe75573
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_minus.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>history_go_minus</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test("history go minus");
+
+ t.step(function () {
+ window.history.pushState(1, document.title, '?x=1');
+ window.history.pushState(2, document.title, '?x=2');
+
+ window.history.go(-1);
+ });
+
+ window.addEventListener('popstate', t.step_func(function(e) {
+ assert_equals(e.state, 1, "history state");
+
+ t.done();
+ }), false);
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html
new file mode 100644
index 000000000..acd9bda31
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ onunload = function() {}
+
+ onload = function() {
+ if (!opener.started) {
+ queue_next();
+ } else {
+ opener.pages.push(id);
+ opener.start_test_wait();
+ if (!opener.gone) {
+ history.go();
+ opener.gone = true;
+ }
+ }
+ };
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument.html
new file mode 100644
index 000000000..278cf86c2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>history.go()</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test(undefined, {timeout:5000});
+ started = false;
+ gone = false;
+ pages = []
+ timer = null;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_array_equals(pages, [3, 2, 2], "Pages opened during history navigation");
+ t.done();
+ } finally {
+ win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=history_go_no_argument-1.html,history_forward-2.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_plus.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_plus.html
new file mode 100644
index 000000000..74d4c588c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_plus.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>history_go_plus</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test("history go plus");
+
+ var fired = false;
+ t.step(function () {
+ window.history.pushState(1, document.title, '?x=1');
+ window.history.pushState(2, document.title, '?x=2');
+
+ window.history.back();
+ });
+
+ window.addEventListener('popstate', t.step_func(function(e) {
+ if(fired) {
+ assert_equals(e.state, 2, "history state");
+
+ t.done();
+ }
+ fired = true;
+ window.history.go(1);
+
+ }), false);
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined-1.html
new file mode 100644
index 000000000..5880eacf0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined-1.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ onunload = function() {}
+
+ onload = function() {
+ if (!opener.started) {
+ queue_next();
+ } else {
+ opener.pages.push(id);
+ opener.start_test_wait();
+ history.forward();
+ }
+ };
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined.html
new file mode 100644
index 000000000..e2a40275e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>history.forward() with session history</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test(undefined, {timeout:5000});
+ started = false;
+ pages = []
+ timer = null;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_array_equals(pages, [3, 2, 2], "Pages opened during history navigation");
+ t.done();
+ } finally {
+ win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=history_go_undefined-1.html,history_forward-2.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero-1.html
new file mode 100644
index 000000000..d9d4f330b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero-1.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ onunload = function() {}
+
+ onload = function() {
+ if (!opener.started) {
+ queue_next();
+ } else {
+ opener.pages.push(id);
+ opener.start_test_wait();
+ if (!opener.gone) {
+ history.go(0);
+ opener.gone = true;
+ }
+ }
+ };
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero.html
new file mode 100644
index 000000000..685878383
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>history.go(0)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test(undefined, {timeout:5000});
+ started = false;
+ gone = false;
+ pages = []
+ timer = null;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_array_equals(pages, [3, 2, 2], "Pages opened during history navigation");
+ t.done();
+ } finally {
+ win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=history_go_zero-1.html,history_forward-2.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate.html
new file mode 100644
index 000000000..5180a3f6e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>history_pushState</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ window.history.pushState(1, document.title, '?x=1');
+ var state;
+ state = window.history.state;
+ assert_equals(state, 1, "history state");
+ }, "history pushState");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_err.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_err.html
new file mode 100644
index 000000000..82afc04f2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_err.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>history_pushState SECURITY_ERR</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ assert_throws("SecurityError", function () {
+ window.history.pushState(1, document.title, 'http://www.microsoft.com/test.html');
+ });
+ }, "history pushState SECURITY_ERR");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_nooptionalparam.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_nooptionalparam.html
new file mode 100644
index 000000000..8e4b049a1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_nooptionalparam.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>history_pushState_NoOptionalParam</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ window.history.pushState(1, document.title);
+
+ var state;
+ state = window.history.state;
+ assert_equals(state, 1, "history state");
+ }, "history pushState NoOptionalParam");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate.html
new file mode 100644
index 000000000..794c2f371
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>history_replaceState</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ window.history.replaceState(1, document.title, '?x=1');
+
+ var second;
+ second = window.history.state;
+ assert_equals(second, 1, "history state");
+ }, "history replaceState");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_err.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_err.html
new file mode 100644
index 000000000..3060cf1f1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_err.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>history_replaceState SECURITY_ERR</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ assert_throws("SecurityError", function () {
+ window.history.replaceState(1, document.title, 'http://www.microsoft.com/test.html');
+ });
+ }, "history replaceState SECURITY_ERR");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_nooptionalparam.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_nooptionalparam.html
new file mode 100644
index 000000000..838467d78
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_nooptionalparam.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>history_replaceStateNoOptionalParam</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ window.history.replaceState(1, document.title);
+
+ var second;
+ second = window.history.state;
+ assert_equals(second, 1, "history state");
+ }, "history replaceStateNoOptionalParam");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_state.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_state.html
new file mode 100644
index 000000000..2ee2356b1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_state.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>history_state</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ var first;
+ var second;
+
+ first = window.history.state;
+ window.history.pushState(1, document.title, '?x=1');
+
+ second = window.history.state;
+ assert_equals(first, null, "first");
+ assert_equals(second, 1, "second");
+ }, "history state");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001-1.html
new file mode 100644
index 000000000..9aa5d30d1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001-1.html
@@ -0,0 +1,72 @@
+<!doctype html>
+<script>
+var o = opener;
+
+var frameloaded = null;
+
+o.t.step(function() {o.assert_equals(history.length, 1)});
+
+onload = function () {
+ o.t.step(function() {
+ o.assert_equals(history.length, 1);
+ o.t.done();
+ });
+
+ o.t1.step(function() {
+ var iframe = document.createElement("iframe");
+ iframe.src = "filler.html?id=2";
+ document.body.appendChild(iframe);
+ frameloaded = o.t1.step_func(function () {
+ o.assert_equals(history.length, 1);
+ setTimeout(o.t1.step_func(function () {
+ o.assert_equals(history.length, 1);
+ iframe.src = "filler.html?id=3";
+ frameloaded = o.t2.step_func(function() {
+ o.assert_equals(history.length, 2);
+ history.go(-1);
+ frameloaded = o.t3.step_func(function() {
+ o.assert_equals(history.length, 2);
+ var parts = iframe.contentWindow.location.href.split("/")
+ o.assert_equals(parts[parts.length - 1], "filler.html?id=2");
+ o.t3.done();
+ o.t4.step(function() {
+ var iframe0 = document.getElementsByTagName("iframe")[0];
+ iframe0.src = "filler.html?id=4"
+ frameloaded = o.t4.step_func(function() {
+ o.assert_equals(history.length, 2);
+ var parts = iframe0.contentWindow.location.href.split("/")
+ o.assert_equals(parts[parts.length - 1], "filler.html?id=4");
+ //This is the point at which gecko and webkit stop running tests
+ history.go(-1);
+ frameloaded = o.t5.step_func(function() {
+ o.assert_equals(history.length, 2);
+ var parts = iframe0.contentWindow.location.href.split("/")
+ o.assert_equals(parts[parts.length - 1], "filler.html?id=1");
+ var parts = iframe.contentWindow.location.href.split("/")
+ o.assert_equals(parts[parts.length - 1], "filler.html?id=2");
+ history.go(1);
+ frameloaded = o.t6.step_func(function() {
+ o.assert_equals(history.length, 2);
+ var parts = iframe0.contentWindow.location.href.split("/")
+ o.assert_equals(parts[parts.length - 1], "filler.html?id=4");
+ var parts = iframe.contentWindow.location.href.split("/")
+ o.assert_equals(parts[parts.length - 1], "filler.html?id=2");
+ o.t6.done();
+ });
+ o.t5.done();
+ });
+ o.t4.done();
+ });
+ });
+ });
+ o.t2.done();
+ });
+ o.t1.done();
+ }, 500))
+ });
+ });
+
+}
+</script>
+
+<iframe src="filler.html?id=1"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001.html
new file mode 100644
index 000000000..c9d1c6416
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>Joint session history with single iframe</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+setup({timeout:10000});
+var t = async_test("Session history length on initial load");
+var t1 = async_test("Session history length on adding new iframe");
+var t2 = async_test("Navigating second iframe");
+var t3 = async_test("Traversing history back (1)");
+var t4 = async_test("Navigating first iframe");
+var t5 = async_test("Traversing history back (2)");
+var t6 = async_test("Traversing history forward");
+var w = window.open("001-1.html");
+//add_completion_callback(function() {w.close()});
+</script>
+
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002-1.html
new file mode 100644
index 000000000..ed69d679d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002-1.html
@@ -0,0 +1,35 @@
+<!doctype html>
+<script>
+var o = opener;
+
+var frameloaded = null;
+
+o.t.step(function() {o.assert_equals(history.length, 1)});
+
+onload = function () {
+ o.t.step(function() {
+ o.assert_equals(history.length, 1);
+ o.t.done();
+ });
+
+ o.t1.step(function() {
+ var iframe = document.createElement("iframe");
+ iframe.src = "filler.html?id=2";
+ document.body.appendChild(iframe);
+ o.assert_equals(history.length, 1);
+ frameloaded = o.t2.step_func(function() {
+ iframe.contentDocument.open();
+ iframe.contentDocument.write("3<script>onpageshow = function() {alert('pageshow'); parent.frameloaded()}<\/script>");
+ iframe.contentDocument.close();
+ frameloaded = o.t2.step_func(function () {
+ o.assert_equals(history.length, 2);
+ o.t2.done();
+ });
+ });
+ o.t1.done();
+ });
+
+}
+</script>
+
+<iframe src="filler.html?id=1"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002.html
new file mode 100644
index 000000000..b08c19e52
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>Joint session history with single iframe</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+setup({timeout:10000});
+var t = async_test("Session history length on initial load");
+var t1 = async_test("Session history length on adding new iframe");
+var t2 = async_test("Navigating second iframe");
+<!-- var t3 = async_test("Traversing history back (1)"); -->
+<!-- var t4 = async_test("Navigating first iframe"); -->
+<!-- var t5 = async_test("Traversing history back (2)"); -->
+<!-- var t6 = async_test("Traversing history forward"); -->
+var w = window.open("002-1.html");
+//add_completion_callback(function() {w.close()});
+</script>
+
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/filler.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/filler.html
new file mode 100644
index 000000000..93e3c7ccf
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/filler.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<script>
+document.write(location.search)
+onpageshow = function() {if (parent.frameloaded) {parent.frameloaded()}}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history.js b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history.js
new file mode 100644
index 000000000..bb5ee6dde
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history.js
@@ -0,0 +1,35 @@
+function parse_query() {
+ var query = location.search.slice(1);
+ var vars = query.split("&");
+ var fields = {};
+ vars.forEach(
+ function (x) {
+ var split = x.split("=");
+ return fields[split[0]] = split.slice(1).join("=");
+ });
+ return fields;
+}
+
+var query_parts = parse_query();
+var id = "id" in query_parts ? parseInt(query_parts.id) : 1;
+var urls_to_load = query_parts.urls.split(",");
+
+document.write(id);
+
+onunload = function() {};
+
+function queue_next() {
+ t = opener.t;
+ setTimeout(t.step_func(
+ function() {
+// opener.assert_equals(history.length, id);
+ if (urls_to_load[0]) {
+ var next_page = urls_to_load[0];
+ (next_page.indexOf("?") > -1) ? (next_page += "&") : (next_page += "?");
+ next_page += "urls=" + urls_to_load.slice(1).join(",");
+ next_page += "&id=" + ++id;
+ location = next_page;
+ }
+ }
+ ), 100);
+}
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history_entry.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history_entry.html
new file mode 100644
index 000000000..e5929ddbe
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history_entry.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ onload = function() {
+ if (!opener.started) {
+ queue_next();
+ } else {
+ opener.pages.push(id);
+ opener.start_test_wait();
+ }
+};
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-1.html
new file mode 100644
index 000000000..8c4401836
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-1.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ onbeforeunload = function() {opener.beforeunload_ran = true; return "Opt to stay on the page"};
+
+ opener.pages.push(id);
+ if (!opener.started) {
+ onload = function() {
+ setTimeout(function() {
+ opener.started = true;
+ history.back();
+ }, 100);
+ }
+ }
+</script>
+<p>You should see/have seen a prompt asking if you want to leave the page.</p>
+<p>Opt to stay on the page</p>
+<button onclick="onbeforeunload = null; opener.start_test_wait(); document.getElementsByTagName('button')[0].disabled = true;">Click here</button>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-manual.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-manual.html
new file mode 100644
index 000000000..b1d0aed52
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-manual.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<title>Traversing the history, prompt in before unload, navigation denied</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ setup({timeout:3600000});
+ var t = async_test(undefined, {timeout:3600000});
+ started = false;
+ pages = []
+ timer = null;
+ beforeunload_ran = false;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_true(beforeunload_ran, "beforeunload event handler ran");
+ assert_array_equals(pages, [2], "Pages opened during history navigation");
+ t.done();
+ } finally {
+ win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=traverse_the_history_unload_prompt_1-1.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-1.html
new file mode 100644
index 000000000..608a579e6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-1.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ onbeforeunload = function() {opener.beforeunload_ran = true; return "Opt to leave the page"};
+
+ opener.pages.push(id);
+ if (!opener.started) {
+ onload = function() {
+ setTimeout(function() {
+ opener.started = true;
+ history.back();
+ }, 100);
+ }
+ }
+</script>
+<p>You should see/have seen a prompt asking if you want to leave the page.</p>
+<p>Opt to leave the page</p>
+<p>If you weren't navigated away after opting to leave the page, that's a FAIL</p>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-manual.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-manual.html
new file mode 100644
index 000000000..d45a2afb1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-manual.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<title>Traversing the history, prompt in before unload, navigation allowed</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ setup({timeout:3600000});
+ var t = async_test(undefined, {timeout:3600000});
+ started = false;
+ pages = []
+ timer = null;
+ beforeunload_ran = false;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_true(beforeunload_ran, "beforeunload event handler ran");
+ assert_array_equals(pages, [2,1], "Pages opened during history navigation");
+ t.done();
+ } finally {
+ win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=traverse_the_history_unload_prompt_2-1.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-1.html
new file mode 100644
index 000000000..c0079b6be
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-1.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ onunload = function(e) {opener.unload_ran = true; return "Now refuse to leave the current page"}
+
+ opener.pages.push(id);
+ if (!opener.started) {
+ onload = function() {
+ setTimeout(function() {
+ opener.started = true;
+ history.back();
+ }, 100);
+ }
+ } else {
+ opener.start_test_wait();
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-manual.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-manual.html
new file mode 100644
index 000000000..8154e8e47
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-manual.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<title>Traversing the history, unload event is fired on doucment</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test(undefined, {timeout:5000});
+ started = false;
+ pages = []
+ timer = null;
+ unload_ran = false;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_array_equals(pages, [2], "Pages opened during history navigation");
+ assert_true(unload_ran, "Unload event handler ran");
+ t.done();
+ } finally {
+ // win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=traverse_the_history_unload_prompt_1-1.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html
new file mode 100644
index 000000000..a11fcf2d2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html
@@ -0,0 +1,18 @@
+<!doctype html>
+4
+<script>
+ onunload = function() {}
+
+ opener.pages.push(4);
+ if (!opener.started) {
+ onload = function() {
+ setTimeout(function() {
+ opener.started = true;
+ history.go(-2);
+ history.go(-1);
+ }, 100);
+ }
+ } else {
+ opener.start_test_wait();
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1.html
new file mode 100644
index 000000000..11715583d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>Multiple history traversals from the same task</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test();
+ started = false;
+ pages = []
+ timer = null;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_array_equals(pages, [4, 2], "Pages opened during history navigation");
+ t.done();
+ } finally {
+ // win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html&urls=history_entry.html,history_entry.html,traverse_the_history_1-1.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html
new file mode 100644
index 000000000..64920b4f4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ opener.pages.push(id);
+ if (!opener.started) {
+ onload = function() {
+ setTimeout(function() {
+ opener.started = true;
+ history.go(-3);
+ history.go(-2);
+ history.go(1);
+ }, 100);
+ }
+ } else {
+ opener.start_test_wait();
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2.html
new file mode 100644
index 000000000..1d1003380
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>Multiple history traversals, last would be aborted</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test();
+ started = false;
+ pages = []
+ timer = null;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_array_equals(pages, [6, 3], "Pages opened during history navigation");
+ t.done();
+ } finally {
+ // win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,history_entry.html,history_entry.html,traverse_the_history_2-1.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html
new file mode 100644
index 000000000..c49bfd384
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ opener.pages.push(id);
+ if (!opener.started) {
+ onload = function() {
+ setTimeout(function() {
+ opener.started = true;
+ history.go(-2);
+ history.go(-1);
+ history.go(3);
+ }, 100);
+ }
+ } else {
+ opener.start_test_wait();
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3.html
new file mode 100644
index 000000000..51ed4eb39
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>Multiple history traversals, last would be aborted</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test(undefined, {timeout:5000});
+ started = false;
+ pages = []
+ timer = null;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_array_equals(pages, [6, 3], "Pages opened during history navigation");
+ t.done();
+ } finally {
+ // win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,history_entry.html,history_entry.html,traverse_the_history_2-1.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html
new file mode 100644
index 000000000..cf7f72379
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ opener.pages.push(id);
+ if (!opener.started) {
+ onload = function() {
+ setTimeout(function() {
+ opener.started = true;
+ history.go(-10); //Outside the range
+ history.go(-1);
+ history.go(-2);
+ }, 100);
+ }
+ } else {
+ opener.start_test_wait();
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4.html
new file mode 100644
index 000000000..651693011
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>Multiple history traversals, last would be aborted</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test(undefined, {timeout:5000});
+ started = false;
+ pages = []
+ timer = null;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_array_equals(pages, [6, 5], "Pages opened during history navigation");
+ t.done();
+ } finally {
+ // win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,history_entry.html,history_entry.html,traverse_the_history_4-1.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html
new file mode 100644
index 000000000..a3f2553fa
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ opener.pages.push(id);
+ if (!opener.started) {
+ onload = function() {
+ setTimeout(function() {
+ opener.started = true;
+ history.go(10); //Outside the range
+ history.go(-1);
+ history.go(-2);
+ }, 100);
+ }
+ } else {
+ opener.start_test_wait();
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5.html
new file mode 100644
index 000000000..837f265b5
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>Multiple history traversals, last would be aborted</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test(undefined, {timeout:5000});
+ started = false;
+ pages = []
+ timer = null;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_array_equals(pages, [6, 5], "Pages opened during history navigation");
+ t.done();
+ } finally {
+ // win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,history_entry.html,history_entry.html,traverse_the_history_5-1.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html
new file mode 100644
index 000000000..d3f3f6d5d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<script src="history.js"></script>
+<script>
+ onunload = function() {opener.unload_ran = true;}
+
+ opener.pages.push(id);
+ if (!opener.started) {
+ onload = function() {
+ setTimeout(function() {
+ opener.started = true;
+ history.back();
+ }, 100);
+ }
+ } else {
+ opener.start_test_wait();
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html
new file mode 100644
index 000000000..5a72dd635
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<title>Traversing the history, unload event is fired on doucment</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test(undefined, {timeout:5000});
+ started = false;
+ pages = []
+ timer = null;
+ unload_ran = false;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ assert_array_equals(pages, [2, 1], "Pages opened during history navigation");
+ assert_true(unload_ran, "Unload event handler ran");
+ t.done();
+ } finally {
+ // win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=traverse_the_history_unload_1-1.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1-1.html
new file mode 100644
index 000000000..af0118a01
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1-1.html
@@ -0,0 +1,15 @@
+<!doctype html>
+2
+<script>
+ onunload = function() {}
+ opener.pages.push(2);
+ onload = function() {
+ setTimeout(function() {
+ document.write("<!doctype html>3<script>opener.pages.push(3); if(!opener.started) {opener.started = true; history.go(-1);} opener.start_test_wait();<\/script>");
+ document.close();
+ if (opener.started) {
+ opener.start_test_wait();
+ }
+ }, 100);
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html
new file mode 100644
index 000000000..c2c31e76f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<title>Traverse the history after document.write after the load event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test();
+ started = false;
+ pages = []
+ start_test_wait = t.step_func(
+ function() {
+ check_result = t.step_func(
+ function() {
+ if (pages.length < 4) {
+ setTimeout(check_result, 500);
+ return
+ }
+ //The pass condition here is based on the idea that the spec is wrong and browsers are right
+ assert_array_equals(pages, [2, 3, 2, 3], "Pages opened during history navigation");
+ t.done();
+ }
+ )
+ setTimeout(check_result, 500);
+ }
+ );
+ t.step(function() {
+ win = window.open("history_entry.html?urls=traverse_the_history_write_after_load_1-1.html");
+ t.add_cleanup(function() {win.close()});
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html
new file mode 100644
index 000000000..0e58cf573
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html
@@ -0,0 +1,12 @@
+<!doctype html>
+3
+<script>
+ onunload = function() {}
+ opener.pages.push(3);
+ onload = function() {
+ document.write("<!doctype html>4<script>opener.pages.push(4); if(!opener.started) {opener.started = true; history.go(-2);} opener.start_test_wait();<\/script>");
+ if (opener.started) {
+ opener.start_test_wait();
+ }
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html
new file mode 100644
index 000000000..28e363f91
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>Traverse the history back and forward when a history entry is written after the load event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test();
+ started = false;
+ pages = []
+ start_test_wait = t.step_func(
+ function() {
+ var check_result = t.step_func(function() {
+ if (pages.length < 5) {
+ setTimeout(check_result, 500);
+ return
+ }
+ //The pass condition here is based on the idea that the spec is wrong and browsers are right
+ assert_array_equals(pages, [3, 4, 2, 3, 4], "Pages opened during history navigation");
+ t.done();
+ });
+ setTimeout(check_result, 500);
+ }
+ );
+ t.step(function() {
+ win = window.open("history_entry.html?urls=history_forward-1.html,traverse_the_history_write_onload_2-1.html");
+ t.add_cleanup(function() {win.close()});
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html
new file mode 100644
index 000000000..261955533
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html
@@ -0,0 +1,12 @@
+<!doctype html>
+2
+<script>
+ onunload = function() {}
+ opener.pages.push(2);
+ onload = function() {
+ document.write("<!doctype html>3<script>opener.pages.push(3); if(!opener.started) {opener.started = true; history.go(-1);} opener.start_test_wait();<\/script>");
+ if (opener.started) {
+ opener.start_test_wait();
+ }
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html
new file mode 100644
index 000000000..ff2729c3c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>Traverse the history when a history entry is written in the load event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test();
+ started = false;
+ pages = []
+ timer = null;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ //The pass condition here is based on the idea that the spec is wrong and browsers are right
+ assert_array_equals(pages, [2, 3, 1], "Pages opened durning history navigation");
+ t.done();
+ } finally {
+ // win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=traverse_the_history_write_onload_1-1.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html
new file mode 100644
index 000000000..f32bee5e1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html
@@ -0,0 +1,12 @@
+<!doctype html>
+3
+<script>
+ onunload = function() {}
+ opener.pages.push(3);
+ onload = function() {
+ document.write("<!doctype html>4<script>opener.pages.push(4); if(!opener.started) {opener.started = true; history.go(-1);} opener.start_test_wait();<\/script>");
+ if (opener.started) {
+ opener.start_test_wait();
+ }
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html
new file mode 100644
index 000000000..bc29174b0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>Traverse the history back and forward when a history entry is written in the load event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t = async_test();
+ started = false;
+ pages = []
+ timer = null;
+ start_test_wait = t.step_func(
+ function() {
+ clearTimeout(timer);
+ timer = setTimeout(t.step_func(
+ function() {
+ try {
+ //The pass condition here is based on the idea that the spec is wrong and browsers are right
+ assert_array_equals(pages, [3, 4, 2, 3, 4], "Pages opened durning history navigation");
+ t.done();
+ } finally {
+ win.close();
+ }
+ }
+ ), 500);
+ }
+ );
+ t.step(function() {win = window.open("history_entry.html?urls=history_forward-1.html,traverse_the_history_write_onload_2-1.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/.gitkeep b/testing/web-platform/tests/html/browsers/history/the-location-interface/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html
new file mode 100644
index 000000000..f72ed1eaf
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html
@@ -0,0 +1,197 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+
+ <title>Location objects' custom [[GetPrototypeOf]] trap permit [[Prototype]] chain cycles to be created through them</title>
+
+ <link rel="author" title="Jeff Walden" href="http://whereswalden.com/" />
+ <link rel="help" href="https://tc39.github.io/ecma262/#sec-ordinarysetprototypeof" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/browsers.html#location-getprototypeof" />
+
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+
+<hr />
+
+<iframe id="same-origin-different-window"></iframe>
+<iframe id="cross-origin-joined-via-document-domain"></iframe>
+
+<script>
+"use strict";
+
+// Handle same-origin, same-window testing first, before any async-requiring
+// testing.
+test(function() {
+ var LocationPrototype = Location.prototype;
+ var ObjectPrototype = Object.prototype;
+
+ var loc = window.location;
+
+ var locProto = Object.getPrototypeOf(loc);
+ assert_equals(locProto, LocationPrototype,
+ "loc's initial [[Prototype]]");
+
+ var originalLocProtoProto = Object.getPrototypeOf(locProto);
+ assert_equals(originalLocProtoProto, ObjectPrototype,
+ "Location.prototype's initial [[Prototype]]");
+
+ Object.setPrototypeOf(locProto, loc);
+
+ assert_equals(Object.getPrototypeOf(locProto), loc,
+ "LocationPrototype's new [[Prototype]]");
+ assert_equals(Object.getPrototypeOf(loc), locProto,
+ "loc's new [[Prototype]]");
+
+ // Reset so as not to muck with testharness.js expectations.
+ Object.setPrototypeOf(locProto, originalLocProtoProto);
+}, "same-origin, same-window location cycle");
+
+var pathdir =
+ location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1);
+
+var triggerCrossOriginTest = (function() {
+ var crossOrigin =
+ document.getElementById("cross-origin-joined-via-document-domain");
+
+ var t = async_test("cross-origin location has null prototype");
+
+ return new Promise(function(resolve, reject) {
+ crossOrigin.onload = t.step_func_done(function(e) {
+ try {
+ var win = crossOrigin.contentWindow;
+
+ var loc = win.location;
+
+ // Between un-opted-in windows, location objects appear to have null
+ // [[Prototype]].
+ assert_equals(Object.getPrototypeOf(loc), null,
+ "cross-origin unjoined location's [[Prototype]");
+
+ resolve();
+ } catch (e) {
+ reject(e);
+ throw e;
+ }
+ });
+
+ crossOrigin.src =
+ "//{{domains[www]}}:" + location.port + pathdir + "cross_origin_joined_frame.sub.html";
+ })
+ .catch(t.unreached_func("crossOrigin onload/src setting"));
+})();
+
+var triggerSameOriginTest = (function() {
+ var sameOriginDifferentWindow =
+ document.getElementById("same-origin-different-window");
+
+ var t = async_test("same-origin, different-window location cycle");
+
+ return new Promise(function(resolve, reject) {
+ sameOriginDifferentWindow.onload = t.step_func_done(function() {
+ try {
+ var win = sameOriginDifferentWindow.contentWindow;
+
+ var loc = win.location;
+ var LocationPrototype = win.Location.prototype;
+ var ObjectPrototype = win.Object.prototype;
+
+ var locProto = Object.getPrototypeOf(loc);
+ assert_equals(locProto, LocationPrototype,
+ "loc's initial [[Prototype]]");
+
+ var originalLocProtoProto = Object.getPrototypeOf(locProto);
+ assert_equals(originalLocProtoProto, ObjectPrototype,
+ "Location.prototype's initial [[Prototype]]");
+
+ Object.setPrototypeOf(locProto, loc);
+
+ assert_equals(Object.getPrototypeOf(locProto), loc,
+ "LocationPrototype's new [[Prototype]]");
+ assert_equals(Object.getPrototypeOf(loc), locProto,
+ "loc's new [[Prototype]]");
+
+ // Reset so as not to muck with testharness.js expectations.
+ Object.setPrototypeOf(locProto, originalLocProtoProto);
+
+ resolve();
+ } catch (e) {
+ reject(e);
+ throw e;
+ }
+ });
+
+ sameOriginDifferentWindow.src = "same_origin_frame.html";
+ })
+ .catch(t.unreached_func("sameOriginDifferentWindow onload/src setting"));
+})();
+
+function crossOriginJoinTest() {
+ var win =
+ document.getElementById("cross-origin-joined-via-document-domain")
+ .contentWindow;
+
+ assert_equals(document.domain, "{{host}}");
+
+ var loc = win.location;
+
+ var threw = false;
+ try {
+ // Still cross-origin until the document.domain set below.
+ win.Location;
+ } catch (e) {
+ threw = true;
+ }
+
+ assert_equals(threw, true,
+ "accessing win.Location before joining win's origin");
+
+ // Join with other frames that have set |document.domain| to this same
+ // value -- namely, this cross-origin frame. Now access between the two
+ // windows should be permitted.
+ assert_equals(document.domain, "{{host}}",
+ "initial document.domain sanity check");
+ document.domain = "{{host}}";
+
+ var LocationPrototype = win.Location.prototype;
+ var ObjectPrototype = win.Object.prototype;
+
+ var locProto = Object.getPrototypeOf(loc);
+ assert_equals(locProto, LocationPrototype,
+ "loc's initial [[Prototype]]");
+
+ var originalLocProtoProto = Object.getPrototypeOf(locProto);
+ assert_equals(originalLocProtoProto, ObjectPrototype,
+ "Location.prototype's initial [[Prototype]]");
+
+ Object.setPrototypeOf(locProto, loc);
+
+ assert_equals(Object.getPrototypeOf(locProto), loc,
+ "LocationPrototype's new [[Prototype]]");
+ assert_equals(Object.getPrototypeOf(loc), locProto,
+ "loc's new [[Prototype]]");
+
+ // Reset so as not to muck with testharness.js expectations.
+ Object.setPrototypeOf(locProto, originalLocProtoProto);
+}
+
+function run() {
+ var t =
+ async_test("cross-origin, but joined via document.domain, location cycle");
+
+ // The cross-origin/joined case must be tested after both unjoined same-origin
+ // and unjoined cross-origin tests: by mucking with document.domain, the
+ // cross-origin/joined case makes it impossible to perform those tests.
+ t.step(function() {
+ Promise.all([triggerCrossOriginTest, triggerSameOriginTest])
+ .then(t.step_func_done(crossOriginJoinTest),
+ t.unreached_func("cross-origin joined error case"));
+ });
+}
+run();
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-1.html
new file mode 100644
index 000000000..3d2b89722
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-1.html
@@ -0,0 +1,9 @@
+<!doctype html>
+1
+<script>
+onload = parent.t.step_func(function() {
+ setTimeout(function() {
+ location = location.toString().replace("assign_after_load-1.html", "assign_after_load-2.html");
+ }, 100);
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-2.html
new file mode 100644
index 000000000..94679571b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-2.html
@@ -0,0 +1,7 @@
+<!doctype html>
+2
+<script>
+onload = parent.t.step_func(function() {
+ setTimeout(function() {parent.do_test()}, 100);
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load.html
new file mode 100644
index 000000000..00dc931d4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>Assignment to location after document is completely loaded</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe></iframe>
+<script>
+var t = async_test();
+var history_length;
+
+onload = t.step_func(function() {
+ setTimeout(function() {
+ history_length = history.length;
+ document.getElementsByTagName("iframe")[0].src = "assign_after_load-1.html";
+ }, 100);
+});
+
+do_test = t.step_func(function() {
+ assert_equals(history.length, history_length + 2);
+ t.done();
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-1.html
new file mode 100644
index 000000000..2549867c8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-1.html
@@ -0,0 +1,7 @@
+<!doctype html>
+1
+<script>
+onload = parent.t.step_func(function() {
+ location = location.toString().replace("assign_before_load-1.html", "assign_before_load-2.html");
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-2.html
new file mode 100644
index 000000000..94679571b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-2.html
@@ -0,0 +1,7 @@
+<!doctype html>
+2
+<script>
+onload = parent.t.step_func(function() {
+ setTimeout(function() {parent.do_test()}, 100);
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load.html
new file mode 100644
index 000000000..62a2aa7c6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>Assignment to location before document is completely loaded</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe></iframe>
+<script>
+var t = async_test();
+var history_length;
+
+onload = t.step_func(function() {
+ setTimeout(function() {
+ history_length = history.length;
+ document.getElementsByTagName("iframe")[0].src = "assign_before_load-1.html";
+ }, 100);
+});
+
+do_test = t.step_func(function() {
+ assert_equals(history.length, history_length + 1);
+ t.done();
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/contains.json b/testing/web-platform/tests/html/browsers/history/the-location-interface/contains.json
new file mode 100644
index 000000000..d311dbb31
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/contains.json
@@ -0,0 +1,6 @@
+[
+ {
+ "id": "security-location",
+ "original_id": "security-location"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html
new file mode 100644
index 000000000..a3ffdd005
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Cross-origin subframe for Location cyclic [[Prototype]] test</title>
+ <link rel="author" title="Jeff Walden" href="http://whereswalden.com/" />
+</head>
+<body>
+<script>
+document.domain = "{{host}}";
+</script>
+<!-- this should be accessible to the parent once it sets document.domain -->
+<p>Cross-origin iframe with joined <code>document.domain</code></p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/document_location.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/document_location.html
new file mode 100644
index 000000000..5ccc9c76b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/document_location.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>document.location</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var doc = document.implementation.createHTMLDocument("");
+ assert_equals(doc.location, null);
+}, "document not in a browsing context");
+
+test(function() {
+ assert_equals(document.location, location);
+}, "document.location equals window.location");
+
+</script>
+
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting.html
new file mode 100644
index 000000000..726aaea23
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>[[SetPrototypeOf]] on a location object should return false</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+ test(function() {
+ var origProto = Object.getPrototypeOf(location);
+ assert_throws(new TypeError, function() {
+ Object.setPrototypeOf(location, {});
+ });
+ assert_throws(new TypeError, function() {
+ location.__proto__ = {};
+ });
+ assert_false(Reflect.setPrototypeOf(location, {}));
+ assert_equals(Object.getPrototypeOf(location), origProto);
+ });
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-stringifier.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-stringifier.html
new file mode 100644
index 000000000..d23323b37
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-stringifier.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Location stringifier</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://heycam.github.io/webidl/#es-stringifier">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=/common/stringifiers.js></script>
+<div id=log></div>
+<script>
+test_stringifier_attribute(location, "href", true);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign.html
new file mode 100644
index 000000000..7e18804c2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>location_assign</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ var href = location.href;
+ location.assign('#x');
+
+ assert_equals((href + "#x"), location.href, "location href");
+
+ }, "location assign");
+
+ test(function () {
+ var href = location.href;
+ assert_throws('SYNTAX_ERR', function() { location.assign("http://:"); });
+ assert_equals(location.href, href);
+ }, "URL that fails to parse");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank-1.html
new file mode 100644
index 000000000..b43598f2c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank-1.html
@@ -0,0 +1,2 @@
+<!doctype html>
+Filler text
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank.html
new file mode 100644
index 000000000..f3f7cf26b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<title>location.assign with initial about:blank browsing context</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe></iframe>
+<script>
+var t = async_test();
+var history_length;
+onload = t.step_func(function() {
+ setTimeout(t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ iframe.onload = t.step_func(function() {
+ setTimeout(t.step_func(function() {
+ assert_equals(history.length, history_length);
+ t.done();
+ }), 100);
+ });
+ history_length = history.length;
+ iframe.src = "location_assign_about_blank-1.html"
+ }), 100);
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_hash.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_hash.html
new file mode 100644
index 000000000..74d2d0154
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_hash.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>location_hash</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <iframe id="srcdoc-iframe"
+ srcdoc="<div style='height: 200vh'></div><div id='test'></div>"></iframe>
+ <script>
+ test(function () {
+ window.history.pushState(1, document.title, '#x=1');
+ var hash = location.hash;
+
+ assert_equals(hash, "#x=1", "hash");
+
+ }, "location hash");
+
+ var t = async_test("Setting location.hash on srcdoc iframe");
+ addEventListener("load", t.step_func_done(function() {
+ var frameWin = document.getElementById("srcdoc-iframe").contentWindow;
+ assert_equals(frameWin.location.href, "about:srcdoc");
+ assert_equals(frameWin.scrollY, 0, "Should not have scrolled yet");
+ frameWin.location.hash = "test";
+ assert_equals(frameWin.location.href, "about:srcdoc#test");
+ assert_true(frameWin.scrollY > frameWin.innerHeight,
+ "Should have scrolled by more than one viewport height");
+ }));
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_host.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_host.html
new file mode 100644
index 000000000..d93bf47e5
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_host.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>location_host</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ var host = location.host;
+ var url = location.href;
+
+ var pos = url.indexOf("//");
+ if (pos != -1) {
+ url = url.substr(pos+2, url.length-pos-2);
+ pos = url.indexOf("/");
+ if (pos != -1)
+ url = url.substr(0, pos);
+ }
+
+ assert_equals(host, url, "host");
+
+ }, "location host");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_hostname.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_hostname.html
new file mode 100644
index 000000000..2ffa0e5fc
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_hostname.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>location_hostname</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ var hostname = location.hostname;
+ var url = location.href;
+
+ var pos = url.indexOf("//");
+ if (pos != -1) {
+ url = url.substr(pos+2, url.length-pos-2);
+ pos = url.indexOf(":");
+ if (pos != -1) {
+ url = url.substr(0, pos);
+ } else {
+ pos = url.indexOf("/");
+ if (pos != -1)
+ url = url.substr(0, pos);
+ }
+ }
+
+ assert_equals(hostname, url, "hostname");
+
+ }, "location hostname");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_href.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_href.html
new file mode 100644
index 000000000..1aa85dcdc
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_href.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>location_href</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ var href = location.href;
+
+ assert_equals(href, document.URL, "href");
+
+ }, "location href");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_origin.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_origin.html
new file mode 100644
index 000000000..2325f4018
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_origin.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<meta charset="utf-8">
+<title></title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+ test(function () {
+ assert_equals(
+ location.origin,
+ location.protocol + '//' + location.host,
+ "origin"
+ );
+ }, "location origin");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_pathname.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_pathname.html
new file mode 100644
index 000000000..dea05d2f3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_pathname.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>location_pathname</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ var pathname = location.pathname;
+ var url = location.href
+
+ url = url.replace(location.protocol + "//" + location.host, "");
+
+ assert_equals(pathname, url, "pathname");
+
+ }, "location pathname");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_port.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_port.html
new file mode 100644
index 000000000..fa1308ca5
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_port.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>location_port</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ var port = location.port;
+ var url = location.href;
+
+ var pos = url.indexOf("//");
+ if (pos != -1) {
+ url = url.substr(pos+2, url.length-pos-2);
+ pos = url.indexOf("/");
+ if (pos != -1)
+ url = url.substr(0, pos);
+ pos = url.indexOf(":");
+ if (pos != -1)
+ url = url.substr(pos+1, url.length-pos-1);
+ }
+
+ assert_equals(port, url, "port");
+
+ }, "location port");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_protocol.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_protocol.html
new file mode 100644
index 000000000..d28bd5639
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_protocol.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>location_protocol</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ var protocol = location.protocol;
+ var url = location.href;
+
+ var pos = url.indexOf("//");
+ if (pos != -1) {
+ url = url.substr(0, pos);
+ }
+
+ assert_equals(protocol, url, "protocol");
+
+ }, "location protocol");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload-iframe.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload-iframe.html
new file mode 100644
index 000000000..95b63d9f5
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload-iframe.html
@@ -0,0 +1,4 @@
+<script>
+ parent._ping(window.location.href)
+ location.reload();
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html
new file mode 100644
index 000000000..78b3cc35e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>location_reload</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <iframe></iframe>
+
+ <script>
+ var history_length;
+ async_test(function(t) {
+
+ var url = new URL("./location_reload-iframe.html", window.location).href;
+ var pingCount = 0;
+
+ window._ping = t.step_func(function(innerURL) {
+ // Some browsers keep 'about:blank' in the session history
+ if (pingCount == 0) {
+ history_length = history.length;
+ }
+ assert_equals(url, innerURL, "iframe url (" + pingCount + ")");
+ assert_equals(history_length, history.length, "history length (" + pingCount + ")");
+ pingCount++;
+ if (pingCount == 5) {
+ iframe.src = 'about:blank';
+ t.done();
+ }
+ });
+
+ var iframe = document.querySelector("iframe");
+ iframe.src = url;
+ history_length = history.length;
+ });
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_replace.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_replace.html
new file mode 100644
index 000000000..2f2d57308
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_replace.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>location_replace</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ var href = location.href;
+ location.replace('#x');
+
+ assert_equals((href + "#x"), location.href, "location href");
+
+ }, "location replace");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_search.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_search.html
new file mode 100644
index 000000000..f9db75784
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_search.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>location_search</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function () {
+ window.history.pushState(1, document.title, '?x=1');
+ var search = location.search;
+
+ assert_equals(search, "?x=1", "search");
+
+ }, "location search");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-1.html
new file mode 100644
index 000000000..c762ece3b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-1.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<script>
+opener.history_length = history.length;
+</script>
+<a onclick="location = 'manual_click_assign_during_load-2.html'; return false;" href>Click Here</a>
+<p>Filler image to keep the page loading:</p>
+<img src="/images/smiley.png?pipe=trickle(20:d1:r2)">
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-2.html
new file mode 100644
index 000000000..1bf7f41e0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-2.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<p>This window should close itself and the test result appear in the original window
+<script>
+onload = function() {
+ setTimeout(function() {opener.do_test(history.length); window.close();}, 100);
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-manual.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-manual.html
new file mode 100644
index 000000000..4f2555c5e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-manual.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>Assignment to location with click during load</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<p>The popup blocker must be disabled for this test</p>
+<div id="log"></div>
+<script>
+setup({timeout:3600000});
+var t = async_test(undefined, {timeout:3600000});
+var win = window.open("manual_click_assign_during_load-1.html");
+
+var history_length;
+do_test = t.step_func(function(new_length) {
+ assert_equals(new_length, history_length + 1);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-1.html
new file mode 100644
index 000000000..e9d03e936
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-1.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<script>
+opener.history_length = history.length;
+</script>
+<a onclick="location.replace('manual_click_location_replace_during_load-2.html'); return false;" href>Click Here</a>
+<p>Filler image to keep the page loading:</p>
+<img>
+<script>
+document.images[0].src = "/images/smiley.png?pipe=trickle(20:d1:r2)&random=" + Math.random();
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-2.html
new file mode 100644
index 000000000..1bf7f41e0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-2.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<p>This window should close itself and the test result appear in the original window
+<script>
+onload = function() {
+ setTimeout(function() {opener.do_test(history.length); window.close();}, 100);
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-manual.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-manual.html
new file mode 100644
index 000000000..43af1b1d3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-manual.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>location.replace with click during load</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<p>The popup blocker must be disabled for this test</p>
+<div id="log"></div>
+<script>
+setup({timeout:3600000});
+var t = async_test(undefined, {timeout:3600000});
+var win = window.open("manual_click_location_replace_during_load-1.html");
+
+var history_length;
+do_test = t.step_func(function(new_length) {
+ assert_equals(new_length, history_length);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_replace_during_load-manual.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_replace_during_load-manual.html
new file mode 100644
index 000000000..3507222ca
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_replace_during_load-manual.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>Assignment to location with click during load</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<p>The popup blocker must be disabled for this test</p>
+<div id="log"></div>
+<script>
+setup({timeout:3600000});
+var t = async_test(undefined, {timeout:3600000});
+var win = window.open("manual_click_replace_during_load-1.html");
+
+var history_length;
+do_test = t.step_func(function(new_length) {
+ assert_equals(new_length, history_length);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-1.html
new file mode 100644
index 000000000..08f7e2dd6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-1.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<script>
+opener.history_length = history.length;
+</script>
+<form onsubmit="location = 'manual_form_submit_assign_during_load-2.html'; return false;">
+<input type=submit value="Click Me">
+</form>
+<p>Filler image to keep the page loading:</p>
+<img src="/images/smiley.png?pipe=trickle(20:d1:r2)">
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-2.html
new file mode 100644
index 000000000..1bf7f41e0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-2.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<p>This window should close itself and the test result appear in the original window
+<script>
+onload = function() {
+ setTimeout(function() {opener.do_test(history.length); window.close();}, 100);
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-manual.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-manual.html
new file mode 100644
index 000000000..df6487407
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-manual.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>Assignment to location with form submit during load</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<p>The popup blocker must be disabled for this test</p>
+<div id="log"></div>
+<script>
+setup({timeout:3600000});
+var t = async_test(undefined, {timeout:3600000});
+var win = window.open("manual_form_submit_assign_during_load-1.html");
+
+var history_length;
+do_test = t.step_func(function(new_length) {
+ assert_equals(new_length, history_length + 1);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-1.html
new file mode 100644
index 000000000..05b44f4c4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-1.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<p>Resize this window. FAIL if the window doesn't close shortly afterwards.</p>
+<script>
+onload = opener.t.step_func(function() {
+ opener.load_count++;
+ if (opener.load_count > 1) {
+ opener.do_test();
+ }
+})
+
+onresize = opener.t.step_func(function() {
+ opener.flag_resized();
+ location.reload();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-manual.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-manual.html
new file mode 100644
index 000000000..1991cee8a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-manual.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>Reload called from resize event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<p>Resize the popup window. That window should then close and the result be presented here. If that window doesn't close after resize that's a FAIL.</p>
+<div id="log"></div>
+<script>
+setup({timeout:3600000})
+var t = async_test(undefined, {timeout:3600000});
+var load_count = 0;
+var resized = false;
+var win = window.open("reload_in_resize-1.html")
+
+flag_resized = t.step_func(function() {
+ resized = true;
+ setTimeout(do_test, 1000);
+});
+
+do_test = t.step_func(function() {
+ win.close();
+ assert_true(resized, "Resize event happened");
+ assert_equals(load_count, 1, "Number of load events");
+ t.done();
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write-1.html
new file mode 100644
index 000000000..1c5a1db8f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write-1.html
@@ -0,0 +1,14 @@
+<!doctype html>
+1
+<script>
+function f() {
+ opener.postMessage("original", "*");
+ setTimeout(function () {
+ document.open();
+ document.write("<!doctype html>2<script>opener.postMessage('written', '*');<\/script>");
+ document.close();
+ }), 100;
+}
+
+window.onload = f
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write.html
new file mode 100644
index 000000000..0fc2a2c3d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>Reload document with document.open and document.written content</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var win = window.open("reload_document_open_write-1.html");
+var t = async_test();
+
+var data = [];
+
+window.onmessage = t.step_func(function(e) {
+ data.push(e.data);
+ if (data.length < 3) {
+ win.location.reload();
+ } else {
+ setTimeout(t.step_func(function() {
+ assert_array_equals(data, ["original", "written", "written"]);
+ t.done();
+ }), 500);
+ }
+});
+
+add_completion_callback(function() {win.close()});
+</script>
+
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write-1.html
new file mode 100644
index 000000000..9a0843392
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write-1.html
@@ -0,0 +1,4 @@
+<script>
+document.write(Math.random());
+opener.postMessage(document.body.innerHTML, "*");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write.html
new file mode 100644
index 000000000..dfbd436a4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>Reload document with document.written content</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var win = window.open("reload_document_write-1.html");
+var t = async_test();
+
+window.onmessage = t.step_func(function(e) {
+ var initial_value = e.data;
+ win.location.reload();
+ window.onmessage = t.step_func(function(e) {
+ assert_true(e.data !== initial_value);
+ t.done();
+ });
+});
+
+add_completion_callback(function() {win.close()});
+</script>
+
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload-1.html
new file mode 100644
index 000000000..36445af3c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload-1.html
@@ -0,0 +1,9 @@
+<script>
+function f() {
+ opener.postMessage("original", "*");
+ document.write("<!doctype html>2<script>opener.postMessage('written', '*');<\/script>");
+ document.close();
+}
+
+window.onload = f
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload.html
new file mode 100644
index 000000000..b2cf31147
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>Reload document with document.written content written in load event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var win = window.open("reload_document_write_onload-1.html");
+var t = async_test();
+
+var data = [];
+
+window.onmessage = t.step_func(function(e) {
+ data.push(e.data);
+ if (data.length < 3) {
+ win.location.reload();
+ } else {
+ setTimeout(t.step_func(function() {
+ assert_array_equals(data, ["original", "written", "written"]);
+ t.done();
+ }), 500);
+ }
+});
+
+add_completion_callback(function() {win.close()});
+</script>
+
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_post_1-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_post_1-1.html
new file mode 100644
index 000000000..69e48f77c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_post_1-1.html
@@ -0,0 +1,10 @@
+<script>
+onload = function() {opener.next()}
+document.write(Math.random());
+</script>
+
+<form method="POST" action="">
+<input type=hidden name=test value=test>
+<input type=submit>
+</form>
+<button onclick="location.reload()">Reload</button>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_post_1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_post_1.html
new file mode 100644
index 000000000..080545e23
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_post_1.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<title>Reload document with POST</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var win = window.open("reload_post_1-1.html");
+var t = async_test();
+var posted = false;
+var reloaded = false;
+
+next = t.step_func(function() {
+
+if (posted && !reloaded) {
+ reloaded = true;
+ win.location.reload();
+} else if (posted && reloaded) {
+ t.done();
+} else {
+ posted = true;
+ win.document.forms[0].submit();
+}
+
+});
+
+add_completion_callback(function() {win.close()});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/same_origin_frame.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/same_origin_frame.html
new file mode 100644
index 000000000..953e696b2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/same_origin_frame.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Same-origin subframe for Location cyclic [[Prototype]] test</title>
+ <link rel="author" title="Jeff Walden" href="http://whereswalden.com/" />
+</head>
+<body>
+<!-- nothing to do, this window should be accessible to the parent frame -->
+<p>Same-origin iframe</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-1.html
new file mode 100644
index 000000000..9561cabdd
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-1.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<script>
+opener.history_length = history.length;
+</script>
+<a onclick="location = 'scripted_click_assign_during_load-2.html'; return false;" href>Click Here</a>
+<script>
+document.links[0].click()
+</script>
+<p>Filler image to keep the page loading:</p>
+<img src="/images/smiley.png?pipe=trickle(20:d1:r2)">
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-2.html
new file mode 100644
index 000000000..1bf7f41e0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-2.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<p>This window should close itself and the test result appear in the original window
+<script>
+onload = function() {
+ setTimeout(function() {opener.do_test(history.length); window.close();}, 100);
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load.html
new file mode 100644
index 000000000..4d7352f4c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>Assignment to location with click during load</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<p>The popup blocker must be disabled for this test</p>
+<div id="log"></div>
+<script>
+setup({timeout:3600000});
+var t = async_test(undefined, {timeout:3600000});
+var win = window.open("scripted_click_assign_during_load-1.html");
+
+var history_length;
+do_test = t.step_func(function(new_length) {
+ assert_equals(new_length, history_length);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-1.html
new file mode 100644
index 000000000..05bb42f96
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-1.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<script>
+opener.history_length = history.length;
+</script>
+<a onclick="location.assign('scripted_click_location_assign_during_load-2.html'); return false;" href>Click Here</a>
+<script>
+document.links[0].click()
+</script>
+<p>Filler image to keep the page loading:</p>
+<img>
+<script>
+document.images[0].src = "/images/smiley.png?pipe=trickle(20:d1:r2)&random=" + Math.random()
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-2.html
new file mode 100644
index 000000000..1bf7f41e0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-2.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<p>This window should close itself and the test result appear in the original window
+<script>
+onload = function() {
+ setTimeout(function() {opener.do_test(history.length); window.close();}, 100);
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load.html
new file mode 100644
index 000000000..64f3ff942
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>location.assign with click during load</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<p>The popup blocker must be disabled for this test</p>
+<div id="log"></div>
+<script>
+var t = async_test();
+var win = window.open("scripted_click_location_assign_during_load-1.html");
+
+var history_length;
+do_test = t.step_func(function(new_length) {
+ assert_equals(new_length, history_length + 1);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-1.html
new file mode 100644
index 000000000..ae07ac5cf
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-1.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<script>
+opener.history_length = history.length;
+</script>
+<form onsubmit="location = 'scripted_form_submit_assign_during_load-2.html'; return false;">
+<input type=submit value="Click Me">
+</form>
+<script>
+document.forms[0].elements[0].click()
+</script>
+<p>Filler image to keep the page loading:</p>
+<img src="/images/smiley.png?pipe=trickle(20:d1:r2)">
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-2.html
new file mode 100644
index 000000000..1bf7f41e0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-2.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<p>This window should close itself and the test result appear in the original window
+<script>
+onload = function() {
+ setTimeout(function() {opener.do_test(history.length); window.close();}, 100);
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load.html
new file mode 100644
index 000000000..981b9c9a3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>Assignment to location with form submit during load</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<p>The popup blocker must be disabled for this test</p>
+<div id="log"></div>
+<script>
+setup({timeout:3600000});
+var t = async_test(undefined, {timeout:3600000});
+var win = window.open("scripted_form_submit_assign_during_load-1.html");
+
+var history_length;
+do_test = t.step_func(function(new_length) {
+ assert_equals(new_length, history_length);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/security_location_0.sub.htm b/testing/web-platform/tests/html/browsers/history/the-location-interface/security_location_0.sub.htm
new file mode 100644
index 000000000..f509c23b1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/security_location_0.sub.htm
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Location interface Security</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#security-location" />
+ <meta name="assert" content="access location object from different origins doesn't raise SECURITY_ERR exception" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p>Access location object from different origins doesn't raise SECURITY_ERR exception</p>
+ <div id=log></div>
+ <script src="/common/get-host-info.sub.js"></script>
+ <script>
+ var runTest = async_test("Accessing location object from different origins doesn't raise SECURITY_ERR exception").step_func_done(function() {
+ var frame = document.getElementById('testframe');
+ frame.setAttribute('onload', '');
+ frame.contentWindow.location = get_host_info().HTTP_REMOTE_ORIGIN + "/";
+ });
+ </script>
+ <iframe id='testframe' onload="runTest()">Test Frame</iframe>
+ <script>
+ document.getElementById('testframe').setAttribute('src', get_host_info().HTTP_REMOTE_ORIGIN + '/');
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/.gitkeep b/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/offline/.gitkeep b/testing/web-platform/tests/html/browsers/offline/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/offline/appcache/.gitkeep b/testing/web-platform/tests/html/browsers/offline/appcache/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/appcache/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/.gitkeep b/testing/web-platform/tests/html/browsers/offline/application-cache-api/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_checking-manual.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_checking-manual.html
new file mode 100644
index 000000000..a4a3b41a7
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_checking-manual.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - API_status_CHECKING</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol>
+ <li>Refresh the page.</li>
+ </ol>
+
+ <div id="log"></div>
+ <script>
+ var t = async_test("checking status test"),
+ cache = window.applicationCache;
+
+ cache.onchecking = t.step_func_done(function() {
+ assert_equals(cache.status, cache.CHECKING, "cache.status should equals cache.CHECKING");
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_downloading-manual.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_downloading-manual.html
new file mode 100644
index 000000000..c09d11d78
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_downloading-manual.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - API_status_DOWNLOADING</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol>
+ <li>Modify the commented part in the manifest file (manifest/clock.manifest) on the server.</li>
+ <li>Refresh the page.</li>
+ </ol>
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("downloading status test"),
+ cache = window.applicationCache;
+
+ cache.ondownloading = t.step_func_done(function() {
+ assert_equals(cache.status, cache.DOWNLOADING, "cache.status should equals cache.DOWNLOADING");
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_idle.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_idle.html
new file mode 100644
index 000000000..21725bb00
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_idle.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - API_status_IDLE</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var t = async_test("idle status test"),
+ cache = window.applicationCache;
+
+ setTimeout(function(){
+ t.step(function() {
+ assert_equals(cache.status, cache.IDLE, "cache.status should equals cache.IDLE");
+ });
+ t.done();
+ }, 3000);
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html
new file mode 100644
index 000000000..77005644a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - API_status_OBSOLETE</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol>
+ <li>Remove the manifest file (manifest/clock.manifest) from the server.</li>
+ <li>Refresh the page.</li>
+ </ol>
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("obsolete status test"),
+ cache = window.applicationCache;
+
+ cache.onobsolete = t.step_func_done(function() {
+ assert_equals(cache.status, cache.OBSOLETE, "cache.status should equals cache.OBSOLETE");
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_uncached.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_uncached.html
new file mode 100644
index 000000000..300c4a1b1
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_uncached.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>Offline Application Cache - API_status_UNCACHED</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <script>
+ var cache = window.applicationCache;
+
+ test(function(){
+ assert_equals(cache.status, cache.UNCACHED, "uncached status test");
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_updateready-manual.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_updateready-manual.html
new file mode 100644
index 000000000..7e1533374
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_updateready-manual.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - API_status_UPDATEREADY</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol>
+ <li>Modify the commented part in the manifest file (manifest/clock.manifest) on the server.</li>
+ <li>Refresh the page.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("updateready status test"),
+ cache = window.applicationCache;
+
+ cache.onupdateready = t.step_func_done(function() {
+ assert_equals(cache.status, cache.UPDATEREADY, "cache.status should equals cache.UPDATEREADY");
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_swapcache-manual.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_swapcache-manual.html
new file mode 100644
index 000000000..6649d980f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_swapcache-manual.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - API_swapCache</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol>
+ <li>Modify the part of comment in manifest file of server.</li>
+ <li>Refresh the page.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("swapCache method test");
+ var cache = window.applicationCache;
+
+ cache.onupdateready = t.step_func(function() {
+ try {
+ cache.swapCache();
+ t.done();
+ } catch (e) {
+ assert_unreached("swapCache method failed.");
+ }
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_swapcache_error.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_swapcache_error.html
new file mode 100644
index 000000000..02e7b3cd8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_swapcache_error.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - API_swapCache_error</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <script>
+ var cache = window.applicationCache;
+
+ test(function() {
+ assert_throws("INVALID_STATE_ERR", function(){cache.swapCache();});
+ }, "INVALID_STATE_ERR error test")
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_update.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_update.html
new file mode 100644
index 000000000..452daa711
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_update.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - API_update</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <script>
+ var cache = window.applicationCache;
+
+ test(function() {
+ try {
+ cache.update()
+ assert_true(true, "update method test")
+ } catch (e) {
+ assert_unreached("update method failed.");
+ }
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_update_error.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_update_error.html
new file mode 100644
index 000000000..ef88158cd
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_update_error.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - API_update_error</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol>
+ <li>Remove the manifest file (manifest/clock.manifest) from the server.</li>
+ <li>Refresh the page, then calling update() will throw InvalidStateError exception.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script>
+ var cache = window.applicationCache;
+ test(function() {
+ assert_throws("INVALID_STATE_ERR", function(){cache.update();});
+ }, "INVALID_STATE_ERR error test")
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/browser-state/.gitkeep b/testing/web-platform/tests/html/browsers/offline/browser-state/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/browser-state/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_event-manual.html b/testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_event-manual.html
new file mode 100644
index 000000000..b100f177e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_event-manual.html
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>Offline Application Cache</title>
+ <link rel="stylesheet" href="../resources/css/result.css">
+ </head>
+ <body>
+ <h1>navigator_online_event</h1>
+
+ <ol>
+ <li>Change the 'work offline' mode.</li>
+ <li>If actual result and expected result are same, then test is <span class="manualpass">Pass</span>, otherwise <span class="manualfail">Fail</span>.</li>
+ </ol>
+
+ <hr>
+
+ <h2>Actual Result</h2>
+ <div id="actualResult">
+ <span id="actualMsg"></span>
+ </div>
+
+ <h2>Expected Result</h2>
+ <div id="expectedResult">
+ <span id="expectedMsg">apply 'work offline': offline event is raised.<p>release 'work offline': online event is raised.</span>
+ </div>
+ <script>
+
+ function showOnline() {
+ document.getElementById('actualMsg').innerHTML = 'online event is raised.';
+ }
+
+ function showOffline() {
+ document.getElementById('actualMsg').innerHTML = 'offline event is raised.';
+ }
+
+ window.addEventListener("online", showOnline, false);
+ window.addEventListener("offline", showOffline, false);
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_online.html b/testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_online.html
new file mode 100644
index 000000000..81547c3fb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_online.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>Offline Application Cache - navigator_online_online</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <script>
+ test(function() {
+ assert_true(navigator.onLine, "onLine test");
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/changestonetworkingmodel/.gitkeep b/testing/web-platform/tests/html/browsers/offline/changestonetworkingmodel/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/changestonetworkingmodel/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/offline/changestonetworkingmodel/original-id.json b/testing/web-platform/tests/html/browsers/offline/changestonetworkingmodel/original-id.json
new file mode 100644
index 000000000..2f77367c8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/changestonetworkingmodel/original-id.json
@@ -0,0 +1 @@
+{"original_id":"changesToNetworkingModel"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/offline/disk-space/.gitkeep b/testing/web-platform/tests/html/browsers/offline/disk-space/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/disk-space/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/offline/downloading-or-updating-an-application-cache/.gitkeep b/testing/web-platform/tests/html/browsers/offline/downloading-or-updating-an-application-cache/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/downloading-or-updating-an-application-cache/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/offline/expiring-application-caches/.gitkeep b/testing/web-platform/tests/html/browsers/offline/expiring-application-caches/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/expiring-application-caches/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/.gitkeep b/testing/web-platform/tests/html/browsers/offline/introduction-4/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/contains.json b/testing/web-platform/tests/html/browsers/offline/introduction-4/contains.json
new file mode 100644
index 000000000..799caa23a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/contains.json
@@ -0,0 +1,10 @@
+[
+ {
+ "id": "supporting-offline-caching-for-legacy-applications",
+ "original_id": "supporting-offline-caching-for-legacy-applications"
+ },
+ {
+ "id": "appcacheevents",
+ "original_id": "appcacheevents"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_cached.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_cached.html
new file mode 100644
index 000000000..24f57769f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_cached.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - Event_cached</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("cached event test");
+ var cache = window.applicationCache;
+
+ cache.oncached = t.done();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_checking.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_checking.html
new file mode 100644
index 000000000..c180eca9d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_checking.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - Event_checking</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("checking event test");
+ var cache = window.applicationCache;
+
+ cache.onchecking = t.done();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_downloading-manual.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_downloading-manual.html
new file mode 100644
index 000000000..26b003f06
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_downloading-manual.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - Event_downloading</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol>
+ <li>Modify the commented part of the manifest file (manifest/clock.manifest) on the server.</li>
+ <li>Refresh the page.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("downloading event test");
+ var cache = window.applicationCache;
+
+ cache.ondownloading = t.done();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_error-manual.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_error-manual.html
new file mode 100644
index 000000000..19abb3d6b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_error-manual.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - Event_error</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol>
+ <li>Add a dummy file in the manifest file (manifest/clock.manifest).</li>
+ <li>Refresh the page.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("error event test");
+ var cache = window.applicationCache;
+
+ cache.onerror = t.done();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_noupdate.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_noupdate.html
new file mode 100644
index 000000000..1e4dd89cf
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_noupdate.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - Event_noupdate</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("noupdate event test");
+ var cache = window.applicationCache;
+
+ cache.onnoupdate = t.done();
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_obsolete-manual.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_obsolete-manual.html
new file mode 100644
index 000000000..cab5e01cc
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_obsolete-manual.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - Event_obsolete</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol>
+ <li>Remove the manifest file (manifest/clock.manifest) from the server.</li>
+ <li>Refresh the page.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("obsolete event test");
+ var cache = window.applicationCache;
+
+ cache.onobsolete = t.done();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_progress.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_progress.html
new file mode 100644
index 000000000..a808db757
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_progress.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - Event_progress</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("progress event test");
+ var cache = window.applicationCache;
+
+ cache.onprogress = t.done();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready-manual.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready-manual.html
new file mode 100644
index 000000000..4de435144
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready-manual.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - Event_updateready</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol>
+ <li>Modify the commented part in the manifest file (manifest/clock.manifest) on the server.</li>
+ <li>Refresh the page.</li>
+ </ol>
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("updateready event test");
+ var cache = window.applicationCache;
+
+ cache.onupdateready = t.done();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready_swapcache-manual.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready_swapcache-manual.html
new file mode 100644
index 000000000..da6cead02
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready_swapcache-manual.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html manifest="../resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - Event_updateready_swapCache</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol>
+ <li>Modify the commented part in manifest file (manifest/clock.manifest) on the server.</li>
+ <li>Refresh the page.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("swapCache method test after updateready event is raised");
+ var cache = window.applicationCache;
+
+ cache.onupdateready = t.step_func(function() {
+ try {
+ cache.swapCache();
+ t.done();
+ } catch (e) {
+ assert_unreached("swapCache method failed.");
+ }
+ })
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/manifest_main_empty-manual.html b/testing/web-platform/tests/html/browsers/offline/manifest_main_empty-manual.html
new file mode 100644
index 000000000..317aaa113
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/manifest_main_empty-manual.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML>
+<html manifest="resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - manifest_main_empty</title>
+ <link rel="stylesheet" href="resources/css/result.css">
+ </head>
+ <body>
+ <ol>
+ <li>Disable the network connection.</li>
+ <li>Refresh the page.</li>
+ <li>If the page is normally displayed, then test is <span class="manualpass"><b>PASS</b></span>, otherwise <span class="manualfail"><b>FAIL</b></span>.</li>
+ </ol>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/manifest_notchanged_online-manual.html b/testing/web-platform/tests/html/browsers/offline/manifest_notchanged_online-manual.html
new file mode 100644
index 000000000..a464b426a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/manifest_notchanged_online-manual.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html manifest="resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - manifest_notchanged_online</title>
+ <script src="resources/js/clock.js"></script>
+ <link rel="stylesheet" href="resources/css/result.css">
+ <link rel="stylesheet" href="resources/css/clock.css">
+ <link rel="stylesheet" href="resources/css/online.css" type="text/css" media="screen">
+ </head>
+ <body>
+ <ol>
+ <li>Remove time element of this html document and not change manifest file.</li>
+ <li>Refresh the page.</li>
+ <li>If the page is normally displayed, then test is <span class="manualpass"><b>PASS</b></span>, otherwise <span class="manualfail"><b>FAIL</b></span>.</li>
+ </ol>
+
+ <p class="connectivity" width="600">The time is: <output id="clock"></output></p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/manifest_section_empty-manual.html b/testing/web-platform/tests/html/browsers/offline/manifest_section_empty-manual.html
new file mode 100644
index 000000000..eea2dbba3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/manifest_section_empty-manual.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html manifest="resources/manifest/section_empty.manifest">
+ <head>
+ <title>Offline Application Cache - manifest_section_empty</title>
+ <script src="resources/js/clock.js"></script>
+ <link rel="stylesheet" href="resources/css/result.css">
+ <link rel="stylesheet" href="resources/css/clock.css">
+ <link rel="stylesheet" href="resources/css/online.css" type="text/css" media="screen">
+ </head>
+ <body>
+ <ol>
+ <li>Disable the network connection.</li>
+ <li>Refresh the page.</li>
+ <li>If the time element and colors of result elements are normally displayed, then test is <span class="manualpass"><b>PASS</b></span>, otherwise <span class="manualfail"><b>FAIL</b></span>.</li>
+ </ol>
+
+ <p class="connectivity" width="600">The time is: <output id="clock"></output></p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/manifest_section_many-manual.html b/testing/web-platform/tests/html/browsers/offline/manifest_section_many-manual.html
new file mode 100644
index 000000000..9378df1b4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/manifest_section_many-manual.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html manifest="resources/manifest/section_many.manifest">
+ <head>
+ <title>Offline Application Cache - manifest_section_many</title>
+ <script src="resources/js/clock.js"></script>
+ <link rel="stylesheet" href="resources/css/result.css">
+ <link rel="stylesheet" href="resources/css/clock.css">
+ <link rel="stylesheet" href="resources/css/online.css" type="text/css" media="screen">
+ </head>
+ <body>
+ <ol type="1">
+ <li>Disable the network connection.</li>
+ <li>Refresh the page.</li>
+ <li>If the time element and colors of result elements are normally displayed, then test is <span class="manualpass"><b>PASS</b></span>, otherwise <span class="manualfail"><b>FAIL</b></span>.</li>
+ </ol>
+
+ <p class="connectivity" width="600">The time is: <output id="clock"></output></p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/manifest_url_check.html b/testing/web-platform/tests/html/browsers/offline/manifest_url_check.html
new file mode 100644
index 000000000..02bf70b16
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/manifest_url_check.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html manifest="resources/manifest/url_check.manifest">
+ <head>
+ <title>Offline Application Cache - URL_#</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <script>
+ var t = async_test("url check test");
+ var cache = window.applicationCache;
+
+ cache.onerror = t.done();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/manifests/.gitkeep b/testing/web-platform/tests/html/browsers/offline/manifests/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/manifests/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/offline/manifests/contains.json b/testing/web-platform/tests/html/browsers/offline/manifests/contains.json
new file mode 100644
index 000000000..3fe509a78
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/manifests/contains.json
@@ -0,0 +1,14 @@
+[
+ {
+ "id": "some-sample-manifests",
+ "original_id": "some-sample-manifests"
+ },
+ {
+ "id": "writing-cache-manifests",
+ "original_id": "writing-cache-manifests"
+ },
+ {
+ "id": "parsing-cache-manifests",
+ "original_id": "parsing-cache-manifests"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/offline/resources/css/clock.css b/testing/web-platform/tests/html/browsers/offline/resources/css/clock.css
new file mode 100644
index 000000000..fa406d0fb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/resources/css/clock.css
@@ -0,0 +1 @@
+output { font: 1em sans-serif; } \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/offline/resources/css/offline.css b/testing/web-platform/tests/html/browsers/offline/resources/css/offline.css
new file mode 100644
index 000000000..76b7f3985
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/resources/css/offline.css
@@ -0,0 +1,5 @@
+.connectivity {
+ color: #fff;
+ background: red;
+ padding: 20px;
+} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/offline/resources/css/online.css b/testing/web-platform/tests/html/browsers/offline/resources/css/online.css
new file mode 100644
index 000000000..39efcb2ab
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/resources/css/online.css
@@ -0,0 +1,5 @@
+.connectivity {
+ color: #fff;
+ background: blue;
+ padding: 20px;
+} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/offline/resources/css/result.css b/testing/web-platform/tests/html/browsers/offline/resources/css/result.css
new file mode 100644
index 000000000..7d784b8ab
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/resources/css/result.css
@@ -0,0 +1,11 @@
+.manualpass {
+ color: green;
+}
+.manualfail {
+ color: red;
+}.pass {
+ color: green;
+}
+.fail {
+ color: red;
+}
diff --git a/testing/web-platform/tests/html/browsers/offline/resources/html/clock.html b/testing/web-platform/tests/html/browsers/offline/resources/html/clock.html
new file mode 100644
index 000000000..6b8949a6b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/resources/html/clock.html
@@ -0,0 +1,12 @@
+<!-- clock.html -->
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>Clock</title>
+ <script src="../js/clock.js"></script>
+ <link rel="stylesheet" href="../css/clock.css">
+ </head>
+ <body>
+ <p>The time is: <output id="clock"></output></p>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/offline/resources/js/clock.js b/testing/web-platform/tests/html/browsers/offline/resources/js/clock.js
new file mode 100644
index 000000000..1ac0dca53
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/resources/js/clock.js
@@ -0,0 +1,3 @@
+setTimeout(function () {
+ document.getElementById('clock').value = new Date();
+}, 1000); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/offline/resources/manifest/clock.manifest b/testing/web-platform/tests/html/browsers/offline/resources/manifest/clock.manifest
new file mode 100644
index 000000000..a61aae6c6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/resources/manifest/clock.manifest
@@ -0,0 +1,17 @@
+CACHE MANIFEST
+
+# Version 1
+
+CACHE:
+../css/clock.css
+../js/clock.js
+../css/result.css
+../css/offline.css
+/resources/testharness.js
+/resources/testharnessreport.js
+
+NETWORK:
+../html/clock.html
+
+FALLBACK:
+../css/online.css ../css/offline.css \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/offline/resources/manifest/section_empty.manifest b/testing/web-platform/tests/html/browsers/offline/resources/manifest/section_empty.manifest
new file mode 100644
index 000000000..a23b9013b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/resources/manifest/section_empty.manifest
@@ -0,0 +1,10 @@
+CACHE MANIFEST
+
+# Version 1
+
+../css/clock.css
+../js/clock.js
+../css/result.css
+../css/online.css
+/resources/testharness.js
+/resources/testharnessreport.js \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/offline/resources/manifest/section_many.manifest b/testing/web-platform/tests/html/browsers/offline/resources/manifest/section_many.manifest
new file mode 100644
index 000000000..7e5e5e999
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/resources/manifest/section_many.manifest
@@ -0,0 +1,19 @@
+CACHE MANIFEST
+
+# Version 1
+
+CACHE:
+../css/clock.css
+../js/clock.js
+
+CACHE:
+../css/result.css
+../css/offline.css
+/resources/testharness.js
+/resources/testharnessreport.js
+
+NETWORK:
+../html/clock.html
+
+FALLBACK:
+../css/online.css ../css/offline.css \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/offline/resources/manifest/url_check.manifest b/testing/web-platform/tests/html/browsers/offline/resources/manifest/url_check.manifest
new file mode 100644
index 000000000..041df5e55
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/resources/manifest/url_check.manifest
@@ -0,0 +1,17 @@
+CACHE MANIFEST
+
+# Version 1
+
+CACHE:
+../css/cl#ock.css
+../js/clock.js
+../css/result.css
+../css/offline.css
+/resources/testharness.js
+/resources/testharnessreport.js
+
+NETWORK:
+../html/clock.html
+
+FALLBACK:
+../css/online.css ../css/offline.css \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/offline/section_network_offline-manual.html b/testing/web-platform/tests/html/browsers/offline/section_network_offline-manual.html
new file mode 100644
index 000000000..c4121f5bc
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/section_network_offline-manual.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<html manifest="resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - Section_network_offline</title>
+ <link rel="stylesheet" href="resources/css/result.css">
+ </head>
+ <body>
+ <ol>
+ <li>Disable the network connection.</li>
+ <li>Refresh the page.</li>
+ <li>If only the frame element can't be loaded, then test is <span class="manualpass"><b>PASS</b></span>, otherwise <span class="manualfail"><b>FAIL</b></span>.</li>
+ </ol>
+
+ <IFRAME id="TestFrame" name="TestWindow" src="html/clock.html" width="600" height="50" scrolling="auto" frameborder="1">
+ </IFRAME>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/section_network_online-manual.html b/testing/web-platform/tests/html/browsers/offline/section_network_online-manual.html
new file mode 100644
index 000000000..a5d8e5940
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/section_network_online-manual.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html manifest="resources/manifest/clock.manifest">
+ <head>
+ <title>Offline Application Cache - Section_network_online</title>
+ <link rel="stylesheet" href="resources/css/result.css">
+ </head>
+ <body>
+ <ol>
+ <li>Refresh the page.</li>
+ <li>If the frame element is loaded, then test is <span class="manualpass"><b>PASS</b></span>, otherwise <span class="manualfail"><b>FAIL</b></span>.</li>
+ </ol>
+
+ <IFRAME id="TestFrame" name="TestWindow" src="html/clock.html" width="600" height="50" scrolling="auto" frameborder="1">
+ </IFRAME>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/offline/the-application-cache-selection-algorithm/.gitkeep b/testing/web-platform/tests/html/browsers/offline/the-application-cache-selection-algorithm/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/offline/the-application-cache-selection-algorithm/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/origin/.gitkeep b/testing/web-platform/tests/html/browsers/origin/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/origin/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-on-new-window.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-on-new-window.html
new file mode 100644
index 000000000..3ad0de6a3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-on-new-window.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<meta charset=utf-8>
+<meta name="timeout" content="long">
+<title>Cross-origin behavior of Window and Location on new Window</title>
+<link rel="author" title="Bobby Holley (:bholley)" href="bobbyholley@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#security-window">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#security-location">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+setup({explicit_done: true});
+
+window.addEventListener('message', function onmessage(evt) {
+ window.removeEventListener('message', onmessage);
+ test(function() {
+ var results = evt.data;
+ assert_true(results.length > 0, 'Need results');
+ results.forEach(function(r) { assert_true(r.pass, r.message); });
+ }, "Cross-origin object identity preserved across document.domain");
+ win.close();
+ done();
+});
+var win = window.open('win-documentdomain.sub.html');
+</script>
diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
new file mode 100644
index 000000000..090510de6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
@@ -0,0 +1,373 @@
+<!doctype html>
+<meta charset=utf-8>
+<meta name="timeout" content="long">
+<title>Cross-origin behavior of Window and Location</title>
+<link rel="author" title="Bobby Holley (:bholley)" href="bobbyholley@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#security-window">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#security-location">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<div id=log></div>
+<iframe id="B"></iframe>
+<iframe id="C"></iframe>
+<script>
+
+/*
+ * Setup boilerplate. This gives us a same-origin window "B" and a cross-origin
+ * window "C".
+ */
+var host_info = get_host_info();
+
+setup({explicit_done: true});
+path = location.pathname.substring(0, location.pathname.lastIndexOf('/')) + '/frame.html';
+var B = document.getElementById('B').contentWindow;
+var C = document.getElementById('C').contentWindow;
+B.frameElement.uriToLoad = path;
+C.frameElement.uriToLoad = get_host_info().HTTP_REMOTE_ORIGIN + path;
+
+function reloadSubframes(cb) {
+ var iframes = document.getElementsByTagName('iframe');
+ iframes.forEach = Array.prototype.forEach;
+ var count = 0;
+ function frameLoaded() {
+ this.onload = null;
+ if (++count == iframes.length)
+ cb();
+ }
+ iframes.forEach(function(ifr) { ifr.onload = frameLoaded; ifr.setAttribute('src', ifr.uriToLoad); });
+}
+function isObject(x) { return Object(x) === x; }
+
+/*
+ * Note: we eschew assert_equals in a lot of these tests, since the harness ends
+ * up throwing when it tries to format a message involving a cross-origin object.
+ */
+
+var testList = [];
+function addTest(fun, desc) { testList.push([fun, desc]); }
+
+
+/*
+ * Basic sanity testing.
+ */
+
+addTest(function() {
+ // Note: we do not check location.host as its default port semantics are hard to reflect statically
+ assert_equals(location.hostname, host_info.ORIGINAL_HOST, 'Need to run the top-level test from domain ' + host_info.ORIGINAL_HOST);
+ assert_equals(get_port(location), host_info.HTTP_PORT, 'Need to run the top-level test from port ' + host_info.HTTP_PORT);
+ assert_equals(B.parent, window, "window.parent works same-origin");
+ assert_equals(C.parent, window, "window.parent works cross-origin");
+ assert_equals(B.location.pathname, path, "location.href works same-origin");
+ assert_throws(null, function() { C.location.pathname; }, "location.pathname throws cross-origin");
+ assert_equals(B.frames, 'override', "Overrides visible in the same-origin case");
+ assert_equals(C.frames, C, "Overrides invisible in the cross-origin case");
+}, "Basic sanity-checking");
+
+/*
+ * Whitelist behavior.
+ *
+ * Also tests for [[GetOwnProperty]] and [[HasOwnProperty]] behavior.
+ */
+
+var whitelistedWindowPropNames = ['location', 'postMessage', 'window', 'frames', 'self', 'top', 'parent',
+ 'opener', 'closed', 'close', 'blur', 'focus', 'length'];
+var whitelistedSymbols = [Symbol.isConcatSpreadable, Symbol.toStringTag,
+ Symbol.hasInstance];
+var whitelistedWindowProps = whitelistedWindowPropNames.concat(whitelistedSymbols);
+
+addTest(function() {
+ for (var prop in window) {
+ if (whitelistedWindowProps.indexOf(prop) != -1) {
+ C[prop]; // Shouldn't throw.
+ Object.getOwnPropertyDescriptor(C, prop); // Shouldn't throw.
+ assert_true(Object.prototype.hasOwnProperty.call(C, prop), "hasOwnProperty for " + String(prop));
+ } else {
+ assert_throws(null, function() { C[prop]; }, "Should throw when accessing " + String(prop) + " on Window");
+ assert_throws(null, function() { Object.getOwnPropertyDescriptor(C, prop); },
+ "Should throw when accessing property descriptor for " + prop + " on Window");
+ assert_throws(null, function() { Object.prototype.hasOwnProperty.call(C, prop); },
+ "Should throw when invoking hasOwnProperty for " + prop + " on Window");
+ }
+ if (prop != 'location')
+ assert_throws(null, function() { C[prop] = undefined; }, "Should throw when writing to " + prop + " on Window");
+ }
+ for (var prop in location) {
+ if (prop == 'replace') {
+ C.location[prop]; // Shouldn't throw.
+ Object.getOwnPropertyDescriptor(C.location, prop); // Shouldn't throw.
+ assert_true(Object.prototype.hasOwnProperty.call(C.location, prop), "hasOwnProperty for " + prop);
+ }
+ else {
+ assert_throws(null, function() { C[prop]; }, "Should throw when accessing " + prop + " on Location");
+ assert_throws(null, function() { Object.getOwnPropertyDescriptor(C, prop); },
+ "Should throw when accessing property descriptor for " + prop + " on Location");
+ assert_throws(null, function() { Object.prototype.hasOwnProperty.call(C, prop); },
+ "Should throw when invoking hasOwnProperty for " + prop + " on Location");
+ }
+ if (prop != 'href')
+ assert_throws(null, function() { C[prop] = undefined; }, "Should throw when writing to " + prop + " on Location");
+ }
+}, "Only whitelisted properties are accessible cross-origin");
+
+/*
+ * ES Internal Methods.
+ */
+
+/*
+ * [[GetPrototypeOf]]
+ */
+addTest(function() {
+ assert_true(Object.getPrototypeOf(C) === null, "cross-origin Window proto is null");
+ assert_true(Object.getPrototypeOf(C.location) === null, "cross-origin Location proto is null (__proto__)");
+ var protoGetter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').get;
+ assert_true(protoGetter.call(C) === null, "cross-origin Window proto is null");
+ assert_true(protoGetter.call(C.location) === null, "cross-origin Location proto is null (__proto__)");
+ assert_throws(null, function() { C.__proto__; }, "__proto__ property not available cross-origin");
+ assert_throws(null, function() { C.location.__proto__; }, "__proto__ property not available cross-origin");
+
+}, "[[GetPrototypeOf]] should return null");
+
+/*
+ * [[SetPrototypeOf]]
+ */
+addTest(function() {
+ assert_throws(null, function() { C.__proto__ = new Object(); }, "proto set on cross-origin Window");
+ assert_throws(null, function() { C.location.__proto__ = new Object(); }, "proto set on cross-origin Location");
+ var setters = [Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set];
+ if (Object.setPrototypeOf)
+ setters.push(function(p) { Object.setPrototypeOf(this, p); });
+ setters.forEach(function(protoSetter) {
+ assert_throws(null, function() { protoSetter.call(C, new Object()); }, "proto setter |call| on cross-origin Window");
+ assert_throws(null, function() { protoSetter.call(C.location, new Object()); }, "proto setter |call| on cross-origin Location");
+ });
+}, "[[SetPrototypeOf]] should throw");
+
+/*
+ * [[IsExtensible]]
+ */
+addTest(function() {
+ assert_true(Object.isExtensible(C), "cross-origin Window should be extensible");
+ assert_true(Object.isExtensible(C.location), "cross-origin Location should be extensible");
+}, "[[IsExtensible]] should return true for cross-origin objects");
+
+/*
+ * [[PreventExtensions]]
+ */
+addTest(function() {
+ assert_throws(null, function() { Object.preventExtensions(C) },
+ "preventExtensions on cross-origin Window should throw");
+ assert_throws(null, function() { Object.preventExtensions(C.location) },
+ "preventExtensions on cross-origin Location should throw");
+}, "[[PreventExtensions]] should throw for cross-origin objects");
+
+/*
+ * [[GetOwnProperty]]
+ */
+
+addTest(function() {
+ assert_true(isObject(Object.getOwnPropertyDescriptor(C, 'close')), "C.close is |own|");
+ assert_true(isObject(Object.getOwnPropertyDescriptor(C, 'top')), "C.top is |own|");
+ assert_true(isObject(Object.getOwnPropertyDescriptor(C.location, 'href')), "C.location.href is |own|");
+ assert_true(isObject(Object.getOwnPropertyDescriptor(C.location, 'replace')), "C.location.replace is |own|");
+}, "[[GetOwnProperty]] - Properties on cross-origin objects should be reported |own|");
+
+function checkPropertyDescriptor(desc, propName, expectWritable) {
+ var isSymbol = (typeof(propName) == "symbol");
+ propName = String(propName);
+ assert_true(isObject(desc), "property descriptor for " + propName + " should exist");
+ assert_equals(desc.enumerable, false, "property descriptor for " + propName + " should be non-enumerable");
+ assert_equals(desc.configurable, true, "property descriptor for " + propName + " should be configurable");
+ if (isSymbol) {
+ assert_true("value" in desc,
+ "property descriptor for " + propName + " should be a value descriptor");
+ assert_equals(desc.value, undefined,
+ "symbol-named cross-origin visible prop " + propName +
+ " should come back as undefined");
+ }
+ if ('value' in desc)
+ assert_equals(desc.writable, expectWritable, "property descriptor for " + propName + " should have writable: " + expectWritable);
+ else
+ assert_equals(typeof desc.set != 'undefined', expectWritable,
+ "property descriptor for " + propName + " should " + (expectWritable ? "" : "not ") + "have setter");
+}
+
+addTest(function() {
+ whitelistedWindowProps.forEach(function(prop) {
+ var desc = Object.getOwnPropertyDescriptor(C, prop);
+ checkPropertyDescriptor(desc, prop, prop == 'location');
+ });
+ checkPropertyDescriptor(Object.getOwnPropertyDescriptor(C.location, 'replace'), 'replace', false);
+ checkPropertyDescriptor(Object.getOwnPropertyDescriptor(C.location, 'href'), 'href', true);
+ assert_equals(typeof Object.getOwnPropertyDescriptor(C.location, 'href').get, 'undefined', "Cross-origin location should have no href getter");
+ whitelistedSymbols.forEach(function(prop) {
+ var desc = Object.getOwnPropertyDescriptor(C.location, prop);
+ checkPropertyDescriptor(desc, prop, false);
+ });
+}, "[[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly");
+
+/*
+ * [[Delete]]
+ */
+addTest(function() {
+ assert_throws(null, function() { delete C[0]; }, "Can't delete cross-origin indexed property");
+ assert_throws(null, function() { delete C[100]; }, "Can't delete cross-origin indexed property");
+ assert_throws(null, function() { delete C.location; }, "Can't delete cross-origin property");
+ assert_throws(null, function() { delete C.parent; }, "Can't delete cross-origin property");
+ assert_throws(null, function() { delete C.length; }, "Can't delete cross-origin property");
+ assert_throws(null, function() { delete C.document; }, "Can't delete cross-origin property");
+ assert_throws(null, function() { delete C.foopy; }, "Can't delete cross-origin property");
+ assert_throws(null, function() { delete C.location.href; }, "Can't delete cross-origin property");
+ assert_throws(null, function() { delete C.location.replace; }, "Can't delete cross-origin property");
+ assert_throws(null, function() { delete C.location.port; }, "Can't delete cross-origin property");
+ assert_throws(null, function() { delete C.location.foopy; }, "Can't delete cross-origin property");
+}, "[[Delete]] Should throw on cross-origin objects");
+
+/*
+ * [[DefineOwnProperty]]
+ */
+function checkDefine(obj, prop) {
+ var valueDesc = { configurable: true, enumerable: false, writable: false, value: 2 };
+ var accessorDesc = { configurable: true, enumerable: false, get: function() {} };
+ assert_throws(null, function() { Object.defineProperty(obj, prop, valueDesc); }, "Can't define cross-origin value property " + prop);
+ assert_throws(null, function() { Object.defineProperty(obj, prop, accessorDesc); }, "Can't define cross-origin accessor property " + prop);
+}
+addTest(function() {
+ checkDefine(C, 'length');
+ checkDefine(C, 'parent');
+ checkDefine(C, 'location');
+ checkDefine(C, 'document');
+ checkDefine(C, 'foopy');
+ checkDefine(C.location, 'href');
+ checkDefine(C.location, 'replace');
+ checkDefine(C.location, 'port');
+ checkDefine(C.location, 'foopy');
+}, "[[DefineOwnProperty]] Should throw for cross-origin objects");
+
+/*
+ * [[Enumerate]]
+ */
+
+addTest(function() {
+ for (var prop in C)
+ assert_unreached("Shouldn't have been able to enumerate " + prop + " on cross-origin Window");
+ for (var prop in C.location)
+ assert_unreached("Shouldn't have been able to enumerate " + prop + " on cross-origin Location");
+}, "[[Enumerate]] should return an empty iterator");
+
+/*
+ * [[OwnPropertyKeys]]
+ */
+
+addTest(function() {
+ assert_array_equals(whitelistedWindowPropNames.sort(),
+ Object.getOwnPropertyNames(C).sort(),
+ "Object.getOwnPropertyNames() gives the right answer for cross-origin Window");
+ assert_array_equals(Object.getOwnPropertyNames(C.location).sort(), ['href', 'replace'],
+ "Object.getOwnPropertyNames() gives the right answer for cross-origin Location");
+}, "[[OwnPropertyKeys]] should return all properties from cross-origin objects");
+
+// Compare two arrays that need to have the same elements but may be in
+// different orders. The problem is that there's no good way to sort arrays
+// containing Symbols.
+function assert_arrays_equal_up_to_order(arr1, arr2, desc) {
+ for (let item of arr1) {
+ assert_in_array(item, arr2, desc);
+ }
+
+ for (let item of arr2) {
+ assert_in_array(item, arr1, desc);
+ }
+}
+
+addTest(function() {
+ assert_arrays_equal_up_to_order(Object.getOwnPropertySymbols(C),
+ whitelistedSymbols,
+ "Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Window");
+ assert_arrays_equal_up_to_order(Object.getOwnPropertySymbols(C.location),
+ whitelistedSymbols,
+ "Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Location");
+}, "[[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects");
+
+addTest(function() {
+ assert_true(B.eval('parent.C') === C, "A and B observe the same identity for C's Window");
+ assert_true(B.eval('parent.C.location') === C.location, "A and B observe the same identity for C's Location");
+}, "A and B jointly observe the same identity for cross-origin Window and Location");
+
+function checkFunction(f, proto) {
+ var name = f.name || '<missing name>';
+ assert_equals(typeof f, 'function', name + " is a function");
+ assert_equals(Object.getPrototypeOf(f), proto, f.name + " has the right prototype");
+}
+
+addTest(function() {
+ checkFunction(C.close, Function.prototype);
+ checkFunction(C.location.replace, Function.prototype);
+}, "Cross-origin functions get local Function.prototype");
+
+addTest(function() {
+ assert_true(isObject(Object.getOwnPropertyDescriptor(C, 'parent')),
+ "Need to be able to use Object.getOwnPropertyDescriptor do this test");
+ checkFunction(Object.getOwnPropertyDescriptor(C, 'parent').get, Function.prototype);
+ checkFunction(Object.getOwnPropertyDescriptor(C.location, 'href').set, Function.prototype);
+}, "Cross-origin Window accessors get local Function.prototype");
+
+addTest(function() {
+ checkFunction(close, Function.prototype);
+ assert_true(close != B.close, 'same-origin Window functions get their own object');
+ assert_true(close != C.close, 'cross-origin Window functions get their own object');
+ var close_B = B.eval('parent.C.close');
+ assert_true(close != close_B, 'close_B is unique when viewed by the parent');
+ assert_true(close_B != C.close, 'different Window functions per-incumbent script settings object');
+ checkFunction(close_B, B.Function.prototype);
+
+ checkFunction(location.replace, Function.prototype);
+ assert_true(location.replace != C.location.replace, "cross-origin Location functions get their own object");
+ var replace_B = B.eval('parent.C.location.replace');
+ assert_true(replace_B != C.location.replace, 'different Location functions per-incumbent script settings object');
+ checkFunction(replace_B, B.Function.prototype);
+}, "Same-origin observers get different functions for cross-origin objects");
+
+addTest(function() {
+ assert_true(isObject(Object.getOwnPropertyDescriptor(C, 'parent')),
+ "Need to be able to use Object.getOwnPropertyDescriptor do this test");
+ var get_self_parent = Object.getOwnPropertyDescriptor(window, 'parent').get;
+ var get_parent_A = Object.getOwnPropertyDescriptor(C, 'parent').get;
+ var get_parent_B = B.eval('Object.getOwnPropertyDescriptor(parent.C, "parent").get');
+ assert_true(get_self_parent != get_parent_A, 'different Window accessors per-incumbent script settings object');
+ assert_true(get_parent_A != get_parent_B, 'different Window accessors per-incumbent script settings object');
+ checkFunction(get_self_parent, Function.prototype);
+ checkFunction(get_parent_A, Function.prototype);
+ checkFunction(get_parent_B, B.Function.prototype);
+}, "Same-origin observers get different accessors for cross-origin Window");
+
+addTest(function() {
+ var set_self_href = Object.getOwnPropertyDescriptor(window.location, 'href').set;
+ var set_href_A = Object.getOwnPropertyDescriptor(C.location, 'href').set;
+ var set_href_B = B.eval('Object.getOwnPropertyDescriptor(parent.C.location, "href").set');
+ assert_true(set_self_href != set_href_A, 'different Location accessors per-incumbent script settings object');
+ assert_true(set_href_A != set_href_B, 'different Location accessors per-incumbent script settings object');
+ checkFunction(set_self_href, Function.prototype);
+ checkFunction(set_href_A, Function.prototype);
+ checkFunction(set_href_B, B.Function.prototype);
+}, "Same-origin observers get different accessors for cross-origin Location");
+
+addTest(function() {
+ assert_equals({}.toString.call(C), "[object Object]");
+ assert_equals({}.toString.call(C.location), "[object Object]");
+}, "{}.toString.call() does the right thing on cross-origin objects");
+
+// We do a fresh load of the subframes for each test to minimize side-effects.
+// It would be nice to reload ourselves as well, but we can't do that without
+// disrupting the test harness.
+function runNextTest() {
+ var entry = testList.shift();
+ test(entry[0], entry[1]);
+ if (testList.length != 0)
+ reloadSubframes(runNextTest);
+ else
+ done();
+}
+reloadSubframes(runNextTest);
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/frame.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/frame.html
new file mode 100644
index 000000000..046e49da7
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/frame.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+<head>
+<script>
+ // Override the |frames| property to test that such overrides are
+ // properly ignored cross-origin.
+ window.frames = "override";
+
+ // If we get a postMessage, we grab references to everything and set
+ // document.domain to trim off our topmost subdomain.
+ window.onmessage = function(evt) {
+ window.windowReferences = [];
+ window.locationReferences = [];
+ for (var i = 0; i < parent.length; ++i) {
+ windowReferences.push(parent[i]);
+ locationReferences.push(parent[i].location);
+ }
+ try {
+ document.domain = document.domain.substring(document.domain.indexOf('.') + 1);
+ evt.source.postMessage('PASS', '*');
+ } catch (e) {
+ evt.source.postMessage('FAIL: cannot trim off document.domain: ' + e, '*');
+ }
+ }
+
+ function checkWindowReferences() {
+ for (var i = 0; i < parent.length; ++i) {
+ if (windowReferences[i] != parent[i])
+ throw new Error("Window references don't match for " + i + " after document.domain");
+ if (locationReferences[i] != parent[i].location)
+ throw new Error("Location references don't match for " + i + " after document.domain");
+ }
+ return true;
+ }
+</script>
+</head>
+<body>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/win-documentdomain.sub.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/win-documentdomain.sub.html
new file mode 100644
index 000000000..a315e2120
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/win-documentdomain.sub.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src="/common/get-host-info.sub.js"></script>
+ <script>
+ function loadFrames() {
+ window.A = document.getElementById('A').contentWindow;
+ window.B = document.getElementById('B').contentWindow;
+ window.C = document.getElementById('C').contentWindow;
+ window.D = document.getElementById('D').contentWindow;
+
+ var path = location.pathname.substring(0, location.pathname.lastIndexOf('/')) + '/frame.html';
+ A.location = 'frame.html';
+ B.location = '//{{domains[www2]}}:' + get_port(location) + path;
+ C.location = '//{{domains[www2]}}:' + get_port(location) + path;
+ D.location = '//{{domains[www1]}}:' + get_port(location) + path;
+
+ var loadCount = 0;
+ function frameLoaded() {
+ if (++loadCount == 4)
+ go();
+ }
+ var iframes = document.getElementsByTagName('iframe');
+ for (var i = 0; i < iframes.length; i++) {
+ iframes[i].onload = frameLoaded;
+ }
+ }
+
+ var results = [];
+ function assert(cond, msg) {
+ results.push({pass: !!cond, message: msg});
+ }
+
+ function go() {
+ window.onmessage = function(evt) {
+ try {
+ assert(evt.data == "PASS", "frame.html processing should be PASS but got " + evt.data);
+ assert(B.checkWindowReferences(), "B's Window references are still self-consistent after document.domain");
+ for (var i = 0; i < window.length; ++i) {
+ assert(window[i] === B.windowReferences[i],
+ "Window reference " + i + " consistent between globals after document.domain");
+ assert(window[i].location === B.locationReferences[i],
+ "Location reference " + i + " consistent between globals after document.domain");
+ }
+ } catch(e) {
+ assert(false, "Should not receive exception: " + e);
+ }
+ opener.postMessage(results, '*');
+ };
+ A.document.domain = A.document.domain;
+ document.domain = document.domain;
+ B.postMessage('', '*');
+ }
+
+ </script>
+</head>
+<body onload="loadFrames()">
+ <iframe id="A"></iframe>
+ <iframe id="B"></iframe>
+ <iframe id="C"></iframe>
+ <iframe id="D"></iframe>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/origin/origin-of-data-document.html b/testing/web-platform/tests/html/browsers/origin/origin-of-data-document.html
new file mode 100644
index 000000000..cedb2513f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/origin/origin-of-data-document.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset=utf-8>
+ <title>Origin of document produced from a 'data:' URL</title>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/browsers.html#origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ async_test(function (t) {
+ window.addEventListener("message", t.step_func_done(function (e) {
+ assert_equals(e.origin, "null", "Messages sent from a 'data:' URL should have an opaque origin (which serializes to 'null').");
+ assert_throws("SecurityError", function () {
+ var couldAccessCrossOriginProperty = e.source.location.href;
+ }, "The 'data:' frame should be cross-origin.")
+ }));
+
+ var i = document.createElement('iframe');
+ i.src = "data:text/html,<script>" +
+ " window.parent.postMessage('Hello!', '*');" +
+ "</scr" + "ipt>";
+ document.body.appendChild(i);
+ }, "The origin of a 'data:' document in a frame is opaque.");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/.gitkeep b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html
new file mode 100644
index 000000000..af9332173
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ test(function() {
+ assert_equals(typeof document.domain, "string", "document.domain is a string");
+ assert_not_equals(document.domain, "", "document.domain is not empty");
+ }, "sanity checks");
+
+ test(function() {
+ assert_equals(document.domain, window.location.hostname, "equals location.hostname");
+ }, "current document");
+
+ test(function() {
+ var doc = new Document();
+ assert_equals(doc.domain, "", "new document has empty domain");
+ }, "new document");
+ </script>
+ </head>
+ <body>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/sandboxing/.gitkeep b/testing/web-platform/tests/html/browsers/sandboxing/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/sandboxing/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/.gitkeep b/testing/web-platform/tests/html/browsers/the-window-object/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/Document-defaultView.html b/testing/web-platform/tests/html/browsers/the-window-object/Document-defaultView.html
new file mode 100644
index 000000000..dbc75d30b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/Document-defaultView.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Document#defaultView</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function() {
+ assert_equals(document.defaultView, window);
+}, "Document in a browsing context");
+
+test(function() {
+ var d = new Document();
+ assert_equals(d.defaultView, null);
+}, "Document created with the Document constructor");
+
+test(function() {
+ var d = document.implementation.createDocument(null, null);
+ assert_equals(d.defaultView, null);
+}, "Document created with createDocument");
+
+test(function() {
+ var d = document.implementation.createHTMLDocument();
+ assert_equals(d.defaultView, null);
+}, "Document created with createHTMLDocument");
+
+test(function() {
+ var parser = new DOMParser();
+ var d = parser.parseFromString("<foo\/\>", "application/xml");
+ assert_equals(d.defaultView, null);
+}, "Document created with XML DOMParser");
+
+test(function() {
+ var parser = new DOMParser();
+ var d = parser.parseFromString("bar", "text/html");
+ assert_equals(d.defaultView, null);
+}, "Document created with HTML DOMParser");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/Window-document.html b/testing/web-platform/tests/html/browsers/the-window-object/Window-document.html
new file mode 100644
index 000000000..9b27f5f7c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/Window-document.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Window#document</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+async_test(function() {
+ var URL = "/common/blank.html";
+
+ var iframe = document.createElement("iframe");
+ document.body.appendChild(iframe);
+ var initialWindow = iframe.contentWindow;
+ var initialDocument = initialWindow.document;
+ assert_equals(initialDocument.URL, "about:blank");
+ iframe.src = URL;
+ iframe.onload = this.step_func_done(function() {
+ assert_equals(iframe.contentWindow, initialWindow);
+ assert_equals(initialDocument.URL, "about:blank");
+ var loadedDocument = initialWindow.document;
+ assert_equals(loadedDocument.URL, location.href.replace(location.pathname, URL));
+ assert_not_equals(initialDocument, loadedDocument);
+ });
+}, "Document in a browsing context");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/.gitkeep b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html
new file mode 100644
index 000000000..9710d15fb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: the browsing contexts must be sorted in the order that their containers were inserted into the Document</title>
+<link rel="author" title="Intel" href="http://www.intel.com/" />
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/browsers.html#accessing-other-browsing-contexts" />
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+
+var t1 = async_test("The window's length must return the number of child browsing contexts(in iframe)");
+function on_load1(fr) {
+ t1.step(function () {
+ var doc = fr.contentDocument;
+ var fr3 = doc.createElement("iframe");
+ fr3.setAttribute("id", "fr3");
+ doc.body.insertBefore(fr3, doc.getElementById("tbl"));
+
+ assert_equals(fr.contentWindow.length, 3, "The window.length should be 3.");
+ assert_array_equals([fr.contentWindow[0].frameElement, fr.contentWindow[1].frameElement, fr.contentWindow[2].frameElement],
+ [fr.contentDocument.getElementById("fr4"), fr.contentDocument.getElementById("fr5"), fr.contentDocument.getElementById("fr3")],
+ "The child browsing contexts must be sorted in the order that their containers were inserted into the Document.");
+ });
+ t1.done();
+}
+
+var t2 = async_test("The window's length must return zero if it has no child browsing context");
+function on_load2(fr) {
+ t2.step(function () {
+ assert_equals(fr.contentWindow.length, 0, "The window.length should be 0.");
+ });
+ t2.done();
+}
+
+</script>
+<iframe id="fr1" src="test1.html" style="display:none" onload="on_load1(this)"></iframe>
+<iframe id="fr2" src="test2.html" style="display:none" onload="on_load2(this)"></iframe>
+<script>
+
+test(function () {
+ assert_equals(window.length, 2, "The window.length should be 2.");
+ assert_array_equals([window[0].frameElement, window[1].frameElement],
+ [document.getElementById("fr1"), document.getElementById("fr2")],
+ "The child browsing contexts must be sorted in the tree order.");
+}, "The window's length must return the number of child browsing contexts");
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html
new file mode 100644
index 000000000..d09c944fd
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<head>
+ <meta charset="utf-8">
+ <title>HTML Test: the browsing contexts created by various container elements</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+
+ var t1 = async_test("Accessing child browsing contexts 1");
+ var t2 = async_test("Accessing child browsing contexts 2");
+ var t3 = async_test("Accessing child browsing contexts 3");
+ function on_load() {
+ //Child browsing contexts created by iframe, object and embed elements.
+ t1.step(function () {
+ assert_equals(window.length, 3, "The top browsing context should have 3 child browsing contexts.");
+ });
+ t1.step(function () {
+ assert_equals(window[0].name, "win1", "The browsing context name should be 'win1'.");
+ assert_equals(window[1].name, "win2", "The browsing context name should be 'win2'.");
+ assert_equals(window[2].name, "win3", "The browsing context name should be 'win3'.");
+ });
+ t1.done();
+
+ //Child browsing contexts created by frame elements.
+ t2.step(function () {
+ assert_equals(document.getElementById("fr").contentWindow.length, 2,
+ "The child browsing context created by the iframe element should have 2 child browsing contexts.");
+ });
+ t2.step(function () {
+ assert_equals(document.getElementById("fr").contentWindow[0].name, "win4",
+ "The browsing context name should be 'win4'.");
+ assert_equals(document.getElementById("fr").contentWindow[1].name, "win5",
+ "The browsing context name should be 'win5'.");
+ });
+ t2.done();
+
+ //The child browsing context will be removed if the data attribute of the associated object element is removed.
+ t3.step(function () {
+ document.getElementById("obj").removeAttribute("type");
+ assert_equals(window.length, 3, "The top browsing context should have 3 child browsing contexts.");
+ document.getElementById("obj").removeAttribute("data");
+ assert_equals(window.length, 3, "The top browsing context should have 3 child browsing contexts.");
+
+ setTimeout(function () {
+ assert_equals(window.length, 2, "The top browsing context should have 2 child browsing contexts.");
+ }, 1);
+ });
+ t3.done();
+ }
+
+ </script>
+</head>
+<body onload="on_load()">
+ <div id="log"></div>
+ <div style="display:none">
+ <iframe id="fr" name="win1" src="test3.html"></iframe>
+ <object id="obj" name="win2" type="text/html" data="about:blank"></object>
+ <object type="image/png" src="/images/green.png"></object>
+ <embed id="emb" name="win3" type="image/svg+xml" src="/images/green.svg"></embed>
+ </div>
+</body>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html
new file mode 100644
index 000000000..154889117
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<head>
+ <meta charset="utf-8">
+ <title>HTML Test: indexed property of a Window object</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+
+ var t1 = async_test("Indexed child browsing contexts");
+ function on_load() {
+ t1.step(function () {
+ assert_equals(window[0], document.getElementsByTagName("object")[0].contentWindow,
+ "The first child browsing context's container should be the object element.");
+ assert_equals(window[1], document.getElementsByTagName("iframe")[0].contentWindow,
+ "The second child browsing context's container should be the iframe element.");
+ });
+ t1.done();
+ }
+
+ </script>
+</head>
+<body onload="on_load()">
+ <div id="log"></div>
+ <div style="display:none">
+ <div id="0"></div>
+ <object name="0" type="text/html" data="test2.html"></object>
+ <iframe name="0" src="about:blank"></iframe>
+ </div>
+</body>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/iterator.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/iterator.html
new file mode 100644
index 000000000..76dc7dbae
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/iterator.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>window[@@iterator]</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_false(Symbol.iterator in window);
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html
new file mode 100644
index 000000000..f85f90f7c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: child browsing contexts created by iframe elements</title>
+<link rel="author" title="Intel" href="http://www.intel.com/" />
+<table id="tbl">
+ <tr>
+ <td>
+ <iframe id="fr4" src=""></iframe>
+ </td>
+ </tr>
+ <iframe id="fr5" src="about:blank"></iframe>
+</table>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html
new file mode 100644
index 000000000..d6a16647f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: child browsing contexts created by object and embed elements</title>
+<link rel="author" title="Intel" href="http://www.intel.com/" />
+<object type="image/png" src="/images/green.png"></object>
+<embed type="image/png" src="/images/green.png"></embed>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html
new file mode 100644
index 000000000..a62fdbaae
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: child browsing contexts created by frame elements</title>
+<link rel="author" title="Intel" href="http://www.intel.com/" />
+<frameset>
+ <frame name="win4"></frame>
+ <frame name="win5"></frame>
+</frameset>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/window_length.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/window_length.html
new file mode 100644
index 000000000..c9559b531
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/window_length.html
@@ -0,0 +1,51 @@
+<!doctype html>
+<title>window.length</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var iframe;
+var subframe;
+var other_window;
+test(function() {assert_equals(window.length, 0)}, "No child browsing contexts");
+test(function() {
+ iframe = document.createElement("iframe");
+ assert_equals(window.length, 0)
+}, "iframe not inserted into the document");
+
+test(function() {
+ document.body.appendChild(iframe);
+ assert_equals(window.length, 1)
+}, "One iframe inserted into the document");
+
+test(function() {
+ subframe = document.createElement("iframe");
+ iframe.contentDocument.body.appendChild(subframe);
+ assert_equals(window.length, 1);
+}, "Child browsing context has a child browsing context");
+
+test(function() {
+ try {
+ assert_equals(iframe.contentWindow.length, 1);
+ } finally {
+ subframe.parentNode.removeChild(subframe);
+ }
+}, "window.length in child frame");
+
+test(function() {
+ iframe.parentNode.removeChild(iframe);
+ other_window = window.open();
+ assert_equals(window.length, 0);
+ assert_equals(other_window.length, 0);
+}, "Opened window")
+
+test(function() {
+ other_window.document.body.appendChild(iframe);
+ try {
+ assert_equals(other_window.length, 1);
+ } finally {
+ other_window.close();
+ }
+}, "Iframe in opened window")
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/.gitkeep b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/callback.js b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/callback.js
new file mode 100644
index 000000000..ae51265a2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/callback.js
@@ -0,0 +1 @@
+opener.callback() \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload-1.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload-1.html
new file mode 100644
index 000000000..6f44d8a83
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload-1.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<script>
+onload = function() {opener.postMessage("loaded", "*")};
+onbeforeunload = function() {
+ opener.callback();
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload.html
new file mode 100644
index 000000000..dcb8830ab
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>Running beforeunload handler in window.close()</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var w = window.open("close_beforeunload-1.html");
+onmessage = t.step_func(function(event) {
+ if (event.data != "loaded") {
+ return;
+ }
+ w.close();
+});
+callback = function() {t.done()}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer-1.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer-1.html
new file mode 100644
index 000000000..c50eddd41
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer-1.html
@@ -0,0 +1 @@
+<!doctype html>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer.html
new file mode 100644
index 000000000..874f5be9d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>Running defer script in window.close()</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test(undefined, {timeout:4000});
+t.step(function() {
+ var w = window.open("close_script_defer-1.html");
+ w.document.open()
+ w.document.write("<script defer src='callback.js'><\/script>")
+ setTimeout(function() {
+ w.close();
+ }, 1000);
+})
+setTimeout(function() {t.done();}, 1000)
+callback = t.step(function() {assert_unreached()})
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload-1.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload-1.html
new file mode 100644
index 000000000..9a9e304e8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload-1.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<script>
+onload = function() {opener.postMessage("loaded", "*")};
+onunload = function() {
+ opener.callback();
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload.html
new file mode 100644
index 000000000..e4d231b28
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>Running unload handler in window.close()</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var w = window.open("close_unload-1.html");
+onmessage = t.step_func(function(event) {
+ if (event.data != "loaded") {
+ return;
+ }
+ w.close();
+});
+callback = function() {t.done()}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html
new file mode 100644
index 000000000..75c8729cf
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>[Browsing Context] : [APIs for creating browsing_contexts by name]</title>
+<link rel="author" title="Duhyeong Kim" href="mailto:dduskim@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#apis-for-creating-and-navigating-browsing-contexts-by-name">
+<meta name=timeout content=long>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+async_test(function() {
+ var currentUrl = 'http://' + window.location.host + '/common/blank.html';
+ var win = window.open(currentUrl, '', 'height=1,width=1');
+ this.add_cleanup(function() { win.close(); });
+ win.onload = this.step_func_done(function () {
+ assert_equals(win.location.href, currentUrl, 'should be equal to result url');
+ });
+}, 'first argument: absolute url');
+
+test(function() {
+ var win = window.open('', '', 'height=1,width=1');
+ this.add_cleanup(function() { win.close(); });
+ assert_equals(win.location.href, 'about:blank', 'win.location.href');
+}, 'first argument: empty url');
+
+test(function () {
+ var win = window.open('', 'testWindow', 'height=1,width=1');
+ win.close();
+ assert_equals(win.name, 'testWindow', 'should have a browsing context name');
+}, 'second argument: passing a non-empty name');
+
+test(function () {
+ var win = window.open('', '', 'height=1,width=1');
+ this.add_cleanup(function() { win.close(); });
+ assert_equals(win.name, '', 'window should not have a name');
+ win.name = 'testWindow';
+ assert_equals(win.name, 'testWindow', 'window should have a name');
+}, 'second argument: setting name after opening');
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-1.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-1.html
new file mode 100644
index 000000000..7dd48b41c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-1.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<p>Now open a new tab and navigate to <a href="001-2.html">001-2</a></p>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-2.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-2.html
new file mode 100644
index 000000000..b1413861a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-2.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<script>
+var result = "FAIL";
+if (opener != null) {
+ result = "FAIL (did you open this page in a new tab?)";
+} else {
+ var w = window.open("", "test_name");
+ if (w.location.href !== "about:blank") {
+ result = "FAIL (didn't open an about:blank browsing context)";
+ } else {
+ w.close();
+ result = "PASS";
+ }
+ document.write(result);
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001.html
new file mode 100644
index 000000000..7b0f21ec0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<title>Accessing named windows from outside the unit of related browsing contexts</title>
+<a href="001-1.html" target="test_name">Click here</a>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-1.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-1.html
new file mode 100644
index 000000000..0e210f351
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-1.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<p>Now open a new tab and navigate to <a></a></p>
+<script>
+href = window.location.href.replace("http://", "http://www.").replace("002-1.html", "002-2.html");
+var a = document.getElementsByTagName("a")[0];
+a.href = href;
+a.textContent = href;
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-2.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-2.html
new file mode 100644
index 000000000..b1413861a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-2.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<script>
+var result = "FAIL";
+if (opener != null) {
+ result = "FAIL (did you open this page in a new tab?)";
+} else {
+ var w = window.open("", "test_name");
+ if (w.location.href !== "about:blank") {
+ result = "FAIL (didn't open an about:blank browsing context)";
+ } else {
+ w.close();
+ result = "PASS";
+ }
+ document.write(result);
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002.html
new file mode 100644
index 000000000..b568ae8d4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<title>Accessing different-origin named windows from outside the unit of related browsing contexts</title>
+<a href="002-1.html" target="test_name">Click here</a>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/browser-interface-elements/.gitkeep b/testing/web-platform/tests/html/browsers/the-window-object/browser-interface-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/browser-interface-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/closing-browsing-contexts/.gitkeep b/testing/web-platform/tests/html/browsers/the-window-object/closing-browsing-contexts/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/closing-browsing-contexts/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/.gitkeep b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html
new file mode 100644
index 000000000..217608e46
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<iframe></iframe>
+<script>
+var t = opener.t;
+
+onload = t.step_func(function() {
+ setTimeout(t.step_func(function() {
+ var history_length = history.length;
+ var iframe = document.getElementsByTagName("iframe")[0];
+ iframe.onload = t.step_func(function() {
+ opener.assert_equals(history.length, history_length + 1);
+ iframe.parentNode.removeChild(iframe);
+ opener.assert_equals(history.length, history_length);
+ t.done();
+ window.close();
+ });
+ iframe.src = "discard_iframe_history_1-2.html;";
+ }), 100);
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html
new file mode 100644
index 000000000..b43598f2c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html
@@ -0,0 +1,2 @@
+<!doctype html>
+Filler text
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html
new file mode 100644
index 000000000..4d1e473fc
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>Removing iframe from document removes it from history</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var w = window.open("discard_iframe_history_1-1.html");
+</script>
+
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html
new file mode 100644
index 000000000..61e5891eb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<iframe></iframe>
+<script>
+var t = opener.t;
+
+onload = t.step_func(function() {
+ setTimeout(t.step_func(function() {
+ var history_length = history.length;
+ var iframe = document.getElementsByTagName("iframe")[0];
+ iframe.onload = t.step_func(function() {
+ setTimeout(t.step_func(function() {
+ opener.assert_equals(history.length, history_length + 1, "History length before iframe removal");
+ document.body.innerHTML = "";
+ opener.assert_equals(history.length, history_length, "History length after iframe removal");
+ t.done();
+ window.close();
+ }), 100);
+ });
+ iframe.src = "discard_iframe_history_1-2.html";
+ }), 100);
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2.html
new file mode 100644
index 000000000..89d0fb4c6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>Removing iframe from document via innerHTML removes it from history</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var w = window.open("discard_iframe_history_2-1.html");
+</script>
+
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html
new file mode 100644
index 000000000..de3f075d6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html
@@ -0,0 +1,21 @@
+<script>
+history_lengths = [];
+
+var t = opener.t;
+
+push_length = t.step_func(function () {
+ history_lengths.push(history.length)
+});
+
+do_test = t.step_func(function () {
+ try {
+ var start_length = history_lengths[0];
+ expected = [start_length, start_length + 1, start_length];
+ opener.assert_array_equals(history_lengths, expected);
+ t.done();
+ } finally {
+ window.close();
+ }
+});
+</script>
+<iframe src="discard_iframe_history_3-2.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html
new file mode 100644
index 000000000..95f9fce5d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html
@@ -0,0 +1,4 @@
+<a href="discard_iframe_history_3-3.html" onclick="parent.push_length()">Click me</a>
+<script>
+onload = function() {setTimeout(parent.t.step_func(function() {document.links[0].click()}), 100)}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html
new file mode 100644
index 000000000..4672b0ec3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html
@@ -0,0 +1,4 @@
+<button onclick="var p = parent; p.push_length(); frameElement.parentNode.removeChild(frameElement); p.push_length(); p.do_test();">Click me</button>
+<script>
+onload = function() {setTimeout(parent.t.step_func(function() {document.getElementsByTagName("button")[0].click()}), 100)}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3.html
new file mode 100644
index 000000000..3046f854f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<title>Removing iframe from document removes it from history</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test(undefined);
+var w = window.open("discard_iframe_history_3-1.html");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html
new file mode 100644
index 000000000..1b5726cdc
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html
@@ -0,0 +1,21 @@
+<script>
+history_lengths = [];
+
+var t = opener.t;
+
+push_length = t.step_func(function () {
+ history_lengths.push(history.length)
+});
+
+do_test = t.step_func(function () {
+ try {
+ var start_length = history_lengths[0];
+ expected = [start_length, start_length + 1, start_length];
+ opener.assert_array_equals(history_lengths, expected);
+ t.done();
+ } finally {
+ window.close();
+ }
+});
+</script>
+<iframe src="discard_iframe_history_4-2.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html
new file mode 100644
index 000000000..979b2b28e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html
@@ -0,0 +1,4 @@
+<a href="discard_iframe_history_4-3.html" onclick="parent.push_length()">Click me</a>
+<script>
+onload = function() {setTimeout(parent.t.step_func(function() {document.links[0].click()}), 100)}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html
new file mode 100644
index 000000000..b4308f439
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html
@@ -0,0 +1,4 @@
+<button onclick="var p = parent; p.push_length(); frameElement.parentNode.innerHTML = ''; p.push_length(); p.do_test();">Click me</button>
+<script>
+onload = function() {setTimeout(parent.t.step_func(function() {document.getElementsByTagName("button")[0].click()}), 100)}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4.html
new file mode 100644
index 000000000..ffd444e3b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<title>Removing iframe from document removes it from history</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+var w = window.open("discard_iframe_history_4-1.html");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html
new file mode 100644
index 000000000..996942798
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<iframe></iframe>
+<script>
+var t = opener.t;
+var iframe = document.getElementsByTagName("iframe")[0];
+var history_length;
+
+function load_frame(src) {
+ history_length = history.length;
+ iframe.src = src;
+ var button = document.getElementsByTagName("button")[0];
+ button.parentNode.removeChild(button);
+}
+
+remove_frame = t.step_func(function() {
+ try {
+ opener.assert_equals(history.length, history_length + 1, "History length after loading page in iframe");
+ iframe.parentNode.removeChild(iframe);
+ opener.assert_equals(history.length, history_length, "History length after removing iframe");
+ t.done();
+ } finally {
+ window.close();
+ }
+});
+
+</script>
+<button onclick="load_frame('discard_iframe_history_1-2.html')">Click here</button>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html
new file mode 100644
index 000000000..8c3d1a9da
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<button onclick="parent.remove_frame()">Click here</button>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-manual.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-manual.html
new file mode 100644
index 000000000..d69d7d7a8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-manual.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>Removing iframe from document removes it from history</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+setup({timeout:3600000})
+var t = async_test(undefined, {timeout:3600000});
+var w = window.open("discard_iframe_history_1-1.html");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html
new file mode 100644
index 000000000..bc01cae88
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html
@@ -0,0 +1,19 @@
+<script>
+history_lengths = [];
+
+function push_length() {
+ history_lengths.push(history.length)
+}
+
+do_test = opener.t.step_func(function () {
+ try {
+ var start_length = history_lengths[0];
+ expected = [start_length, start_length + 1, start_length];
+ opener.assert_array_equals(history_lengths, expected);
+ opener.t.done();
+ } finally {
+ window.close();
+ }
+});
+</script>
+<iframe src="discard_iframe_history_2-2.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html
new file mode 100644
index 000000000..b25bf5f00
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html
@@ -0,0 +1 @@
+<a href="discard_iframe_history_2-3.html" onclick="parent.push_length()">Click me</a>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html
new file mode 100644
index 000000000..68847e9a7
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html
@@ -0,0 +1 @@
+<button onclick="var p = parent; p.push_length(); frameElement.parentNode.removeChild(frameElement); p.push_length(); p.do_test();">Click me</button>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-manual.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-manual.html
new file mode 100644
index 000000000..27d395d22
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-manual.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>Removing iframe from document removes it from history</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+setup({timeout:3600000})
+var t = async_test(undefined, {timeout:3600000});
+var w = window.open("discard_iframe_history_2-1.html");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/.gitkeep b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html
new file mode 100644
index 000000000..f020e0ecb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: Named access on the Window object</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/browsers.html#named-access-on-the-window-object">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div style="display:none">
+ <p name="a" id="p1"></p>
+ <a name="a" id="a1" href="#"></a>
+ <applet name="a" id="app1"></applet>
+ <area name="a" id="area1"></area>
+ <embed name="a" id="embed1"></embed>
+ <form name="a" id="form1"></form>
+ <img name="a" id="img1">
+ <object name="a" id="obj1"></object>
+ <span name="a" id="span1"></span>
+
+ <b id="b" name="c"></b>
+ <a name="c"></a>
+ <iframe name="c" id="fm1"></iframe>
+ <iframe name="c" id="fm2" src="test.html" onload="on_load()"></iframe>
+ <input id="b"></input>
+ <span id="d"></span>
+ <a name=""></a>
+ <b id=""></b>
+</div>
+<script>
+
+test(function() {
+ assert_equals(window['c'], document.getElementById("fm1").contentWindow, "The first iframe's window should be returned.");
+}, "Check if the first nested browsing context is returned by window['c']");
+
+test(function() {
+ assert_equals(window['a'].length, 5, "The length should be 5.");
+ assert_true(window['a'] instanceof HTMLCollection);
+ assert_array_equals(window['a'],
+ [ document.getElementById('app1'), document.getElementById('embed1'),
+ document.getElementById('form1'), document.getElementById('img1'),
+ document.getElementById('obj1') ],
+ "The elements are not in tree order.");
+
+ document.getElementById('form1').setAttribute("name", "");
+ document.getElementById('embed1').setAttribute("name", "");
+ assert_array_equals(window['a'],
+ [ document.getElementById('app1'), document.getElementById('img1'),
+ document.getElementById('obj1') ],
+ "Window['a'] should not contain the elements with empty name attribute.");
+}, "Check if window['a'] contains all applet, embed, form, img, and object elements, and their order");
+
+var t = async_test("Check that window['fs'] does not return the frameset element with name='fs' (historical)");
+function on_load () {
+ t.step(function () {
+ assert_equals(document.getElementById('fm2').contentWindow['fs'],
+ undefined,
+ "The frameset element should not be returned.");
+ });
+ t.done();
+}
+
+test(function() {
+ assert_true(window['b'] instanceof HTMLCollection);
+ assert_array_equals(window['b'], [document.getElementsByTagName('b')[0], document.getElementsByTagName('input')[0]]);
+
+ document.getElementsByTagName('b')[0].setAttribute("id", "");
+ assert_equals(window['b'], document.getElementsByTagName('input')[0],
+ "The window['b'] should not contain the elements with empty id attribute.");
+}, "Check if window['b'] returns the elements with the id='b'");
+
+test(function() {
+ assert_equals(window['d'], document.getElementById('d'));
+}, "Check if window['d'] returns the element with id='d'");
+
+test(function() {
+ assert_equals(window[''], undefined, "The window[''] should be undefined");
+}, "Check widow[''] when there are some elements with empty id or name attribute");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/test.html b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/test.html
new file mode 100644
index 000000000..c3b3cc185
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/test.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: Named Object</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<frameset name="fs" id="fs1">
+ <frame></frame>
+</frameset>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-null-names.html b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-null-names.html
new file mode 100644
index 000000000..760bd418d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-null-names.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Named access with null characters</title>
+<link rel="author" title="Ms2ger" href="ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#window">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-window-nameditem">
+<link rel="help" href="https://heycam.github.io/webidl/#named-properties-object">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ var iframe = document.createElement("iframe")
+ iframe.name = "a\0b"
+ document.body.appendChild(iframe)
+ assert_equals(window["a\0b"], iframe.contentWindow)
+ assert_equals(window["ab"], undefined)
+ assert_equals(window["a"], undefined)
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/security-window/.gitkeep b/testing/web-platform/tests/html/browsers/the-window-object/security-window/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/security-window/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.sub.html b/testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.sub.html
new file mode 100644
index 000000000..9a9ef358e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.sub.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: Window Security</title>
+<link rel="author" title="Intel" href="http://www.intel.com/" />
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/browsers.html#the-window-object" />
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/timers.html#timers" />
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/webappapis.html#atob" />
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#windowsessionstorage" />
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#windowlocalstorage" />
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/browsers.html#window" />
+<link rel="help" href="http://dev.w3.org/csswg/cssom/#extensions-to-the-window-interface" />
+<link rel="help" href="http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface" />
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test("Window Security testing");
+
+function fr_load() {
+ fr = document.getElementById("fr");
+
+ t.step(function () {
+ //SecurityError should be thrown
+ [
+ //attributes
+ {name: "applicationCache"},
+ {name: "devicePixelRatio"},
+ {name: "document"},
+ {name: "external"},
+ {name: "frameElement"},
+ {name: "history"},
+ {name: "innerWidth"},
+ {name: "innerHeight"},
+ {name: "locationbar"},
+ {name: "localStorage"},
+ {name: "menubar"},
+ {name: "name"},
+ {name: "navigator"},
+ {name: "onabort"},
+ {name: "onafterprint"},
+ {name: "onbeforeprint"},
+ {name: "onbeforeunload"},
+ {name: "onblur"},
+ {name: "oncancel"},
+ {name: "oncanplay"},
+ {name: "oncanplaythrough"},
+ {name: "onchange"},
+ {name: "onclick"},
+ {name: "onclose"},
+ {name: "oncontextmenu"},
+ {name: "oncuechange"},
+ {name: "ondblclick"},
+ {name: "ondrag"},
+ {name: "ondragend"},
+ {name: "ondragenter"},
+ {name: "ondragleave"},
+ {name: "ondragover"},
+ {name: "ondragstart"},
+ {name: "ondrop"},
+ {name: "ondurationchange"},
+ {name: "onemptied"},
+ {name: "onended"},
+ {name: "onerror"},
+ {name: "onfocus"},
+ {name: "onhashchange"},
+ {name: "oninput"},
+ {name: "oninvalid"},
+ {name: "onkeydown"},
+ {name: "onkeypress"},
+ {name: "onkeyup"},
+ {name: "onload"},
+ {name: "onloadeddata"},
+ {name: "onloadedmetadata"},
+ {name: "onloadstart"},
+ {name: "onmessage"},
+ {name: "onmousedown"},
+ {name: "onmousemove"},
+ {name: "onmouseout"},
+ {name: "onmouseover"},
+ {name: "onmouseup"},
+ {name: "onmousewheel"},
+ {name: "onoffline"},
+ {name: "ononline"},
+ {name: "onpause"},
+ {name: "onplay"},
+ {name: "onplaying"},
+ {name: "onpagehide"},
+ {name: "onpageshow"},
+ {name: "onpopstate"},
+ {name: "onprogress"},
+ {name: "onratechange"},
+ {name: "onreset"},
+ {name: "onresize"},
+ {name: "onscroll"},
+ {name: "onseeked"},
+ {name: "onseeking"},
+ {name: "onselect"},
+ {name: "onshow"},
+ {name: "onstalled"},
+ {name: "onstorage"},
+ {name: "onsubmit"},
+ {name: "onsuspend"},
+ {name: "ontimeupdate"},
+ {name: "onunload"},
+ {name: "onvolumechange"},
+ {name: "onwaiting"},
+ {name: "pageXOffset"},
+ {name: "pageYOffset"},
+ {name: "personalbar"},
+ {name: "screen"},
+ {name: "scrollbars"},
+ {name: "statusbar"},
+ {name: "status"},
+ {name: "screenX"},
+ {name: "screenY"},
+ {name: "sessionStorage"},
+ {name: "toolbar"},
+ //methods
+ {name: "alert", isMethod: true},
+ {name: "clearInterval", isMethod: true, args:[1]},
+ {name: "clearTimeout", isMethod: true, args:[function () {}, 1]},
+ {name: "confirm", isMethod: true},
+ {name: "getComputedStyle", isMethod: true, args:[document.body, null]},
+ {name: "getSelection", isMethod: true},
+ {name: "matchMedia", isMethod: true, args:["(min-width:50px)"]},
+ {name: "moveBy", isMethod: true, args:[10, 10]},
+ {name: "moveTo", isMethod: true, args:[10, 10]},
+ {name: "open", isMethod: true},
+ {name: "print", isMethod: true},
+ {name: "prompt", isMethod: true},
+ {name: "resizeTo", isMethod: true, args:[10, 10]},
+ {name: "resizeBy", isMethod: true, args:[10, 10]},
+ {name: "scroll", isMethod: true, args:[10, 10]},
+ {name: "scrollTo", isMethod: true, args:[10, 10]},
+ {name: "scrollBy", isMethod: true, args:[10, 10]},
+ {name: "setInterval", isMethod: true, args:[function () {}, 1]},
+ {name: "setTimeout", isMethod: true, args:[function () {}, 1]},
+ {name: "showModalDialog", isMethod: true, args:["auto:blank", "dialog"]},
+ {name: "stop", isMethod: true},
+ ].forEach(function (item) {
+ test(function () {
+ assert_true(item.name in window, "window." + item.name + " should exist.");
+ assert_throws("SecurityError", function () {
+ if (item.isMethod)
+ if (item.args)
+ fr.contentWindow[item.name](item.args[0], item.args[1]);
+ else
+ fr.contentWindow[item.name]();
+ else
+ fr.contentWindow[item.name];
+ }, "A SecurityError exception should be thrown.");
+ }, "A SecurityError exception must be thrown when window." + item.name + " is accessed from a different origin.");
+ });
+
+ //SecurityError should not be thrown
+ [
+ //attributes
+ {name: "closed"},
+ {name: "frames"},
+ {name: "length"},
+ {name: "location"},
+ {name: "opener"},
+ {name: "parent"},
+ {name: "self"},
+ {name: "top"},
+ {name: "window"},
+ //methods
+ {name: "blur", isMethod: true},
+ {name: "close", isMethod: true},
+ {name: "focus", isMethod: true},
+ {name: "postMessage", isMethod: true, args: [{msg: 'foo'}, "*"]}
+ ].forEach(function (item) {
+ test(function () {
+ assert_true(item.name in window, "window." + item.name + " should exist.");
+ try {
+ if (item.isMethod)
+ if (item.args)
+ fr.contentWindow[item.name](item.args[0], item.args[1]);
+ else
+ fr.contentWindow[item.name]();
+ else
+ fr.contentWindow[item.name];
+ } catch (e) {
+ assert_unreached("An unexpected exception was thrown.");
+ }
+ }, "A SecurityError exception should not be thrown when window." + item.name + " is accessed from a different origin.");
+ });
+ });
+ t.done();
+}
+
+</script>
+<script>
+onload = function() {
+ var frame = document.createElement('iframe');
+ frame.id = "fr";
+ frame.setAttribute("style", "display:none");
+ frame.setAttribute('src', get_host_info().HTTP_REMOTE_ORIGIN + "/");
+ frame.setAttribute("onload", "fr_load()");
+ document.body.appendChild(frame);
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/noopener-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/noopener-target.html
new file mode 100644
index 000000000..d0d036026
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/support/noopener-target.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<script>
+ var channelName = location.search.substr(1);
+ var channel = new BroadcastChannel(channelName);
+ channel.postMessage({ name: window.name,
+ haveOpener: window.opener !== null });
+ window.close();
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/.gitkeep b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-locationbar-manual.html b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-locationbar-manual.html
new file mode 100644
index 000000000..4331b3b66
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-locationbar-manual.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Window Proxy locationbar visible flag Test</title>
+ <link rel="author" title='JuneyoungOh' href="juneyoung85@gmail.com">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>WindowProxy.locationbar Test</p>
+
+ <h1>Manual Test Steps:</h1>
+ <ol>
+ <li>Make the locationbar visible in the user agent before executing this test.</li>
+ <li>You may need to manually reload afterwards.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script>
+ test(function() {
+ assert_not_equals(typeof window.locationbar, undefined, 'window.locationbar is undefined');
+ assert_true(window.locationbar.visible)
+ }, "window.locationbar.visible");
+ </script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-menubar-manual.html b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-menubar-manual.html
new file mode 100644
index 000000000..43345934a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-menubar-manual.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Window Proxy menubar visible flag Test</title>
+ <link rel="author" title='JuneyoungOh' href="juneyoung85@gmail.com">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>WindowProxy.menubar Test</p>
+
+ <h1>Manual Test Steps:</h1>
+ <ol>
+ <li>Make the menubar visible in the user agent before executing this test.</li>
+ <li>You may need to manually reload afterwards.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script>
+ test(function() {
+ assert_not_equals(typeof window.menubar, undefined, 'window.menubar is undefined');
+ assert_true(window.menubar.visible);
+ }, "window.menubar.visible");
+ </script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-personalbar-manual.html b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-personalbar-manual.html
new file mode 100644
index 000000000..d7f109840
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-personalbar-manual.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <title>Window Proxy personalbar visible flag Test</title>
+ <link rel="author" title="vanessa" href="mailto:vanessaohsy@gmail.com">
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>WindowProxy.personalbar Test</p>
+
+ <h1>Manual Test Steps:</h1>
+ <ol>
+ <li>Make the personalbar visible in the user agent before executing this test.</li>
+ <li>You may need to manually reload afterwards.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script type="text/javascript" >
+ test(function () {
+ assert_not_equals(window.personalbar, undefined, "window.personalbar is undefined");
+ assert_true(window.personalbar.visible, "window.personalbar.visible");
+ });
+ </script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-scrollbars-manual.html b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-scrollbars-manual.html
new file mode 100644
index 000000000..c412bdbe5
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-scrollbars-manual.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <title>Window Proxy scrollbars visible flag Test</title>
+ <link rel="author" title="vanessa" href="vanessaohsy@gmail.com">
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>WindowProxy.scrollbars Test</p>
+
+ <h1>Manual Test Steps:</h1>
+ <ol>
+ <li>Make the scrollbars visible in the user agent before executing this test.</li>
+ <li>You may need to manually reload afterwards.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script type="text/javascript" >
+ test(function () {
+ assert_not_equals(window.scrollbars, undefined, "window.scrollbars is undefined");
+ assert_true(window.scrollbars.visible, "window.scrollbars.visible");
+ });
+ </script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-statusbar-manual.html b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-statusbar-manual.html
new file mode 100644
index 000000000..b09fcc017
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-statusbar-manual.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8" />
+ <title>WindowProxy statusbar visible flag Test</title>
+ <link rel="author" title="dokenzy" href="dokenzy@gmail.com">
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>WindowProxy.statusbar Test</p>
+
+ <h1>Manual Test Steps:</h1>
+ <ol>
+ <li>Make the statusbar visible in the user agent before executing this test.</li>
+ <li>You may need to manually reload afterwards.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script type="text/javascript" >
+ test(function () {
+ assert_not_equals(typeof window.statusbar.visible, undefined, 'window.statusbar.visible');
+ assert_true(window.statusbar.visible, 'window.statusbar.visible');
+ }, "BarProp attribute: window.statusbar.visible");
+ </script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-toolbar-manual.html b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-toolbar-manual.html
new file mode 100644
index 000000000..ba4654431
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/the-windowproxy-object/test-window-proxy-toolbar-manual.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8" />
+ <title>WindowProxy toolbar visible flag Test</title>
+ <link rel="author" title="dokenzy" href="dokenzy@gmail.com">
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>WindowProxy.toolbar Test</p>
+
+ <h1>Manual Test Steps:</h1>
+ <ol>
+ <li>Make the toolbar visible in the user agent before executing this test.</li>
+ <li>You may need to manually reload afterwards.</li>
+ </ol>
+
+ <div id="log"></div>
+
+ <script type="text/javascript" >
+ test(function () {
+ assert_not_equals(typeof window.toolbar.visible, undefined, 'window.toolbar.visible');
+ assert_true(window.toolbar.visible, 'window.toolbar.visible');
+ }, "BarProp attribute: window.toolbar.visible");
+ </script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-aliases.html b/testing/web-platform/tests/html/browsers/the-window-object/window-aliases.html
new file mode 100644
index 000000000..135be02a3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/window-aliases.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Aliases of the window object</title>
+<link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-window">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-frames">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-self">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var global = this;
+
+test(function() {
+ assert_equals(window, global);
+ assert_equals(window.window, global);
+}, "window should be the global object");
+
+test(function() {
+ assert_equals(frames, global);
+ assert_equals(window.frames, global);
+}, "frames should be the global object");
+
+test(function() {
+ assert_equals(self, global);
+ assert_equals(window.self, global);
+}, "self should be the global object");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-strict.html b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-strict.html
new file mode 100644
index 000000000..610941fc8
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-strict.html
@@ -0,0 +1,43 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Indexed properties of the window object (strict mode)</title>
+<link rel="author" title="Ms2ger" href="ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#window">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-window-item">
+<link rel="help" href="https://heycam.github.io/webidl/#getownproperty">
+<link rel="help" href="https://heycam.github.io/webidl/#defineownproperty">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<iframe></iframe>
+<script>
+test(function() {
+ "use strict";
+ assert_false("-1" in window, "-1 not in window");
+ assert_equals(window[-1], undefined);
+ window[-1] = "foo";
+ assert_equals(window[-1], "foo");
+});
+test(function() {
+ "use strict";
+ assert_throws(new TypeError(), function() {
+ window[0] = "foo";
+ });
+ assert_equals(window[0],
+ document.getElementsByTagName("iframe")[0].contentWindow);
+});
+test(function() {
+ "use strict";
+ assert_throws(new TypeError(), function() {
+ window[1] = "foo";
+ });
+ assert_equals(window[1], undefined);
+});
+test(function() {
+ "use strict";
+ var proto = Window.prototype;
+ [-1, 0, 1].forEach(function(idx) {
+ assert_false(idx in proto, idx + " in proto");
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties.html b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties.html
new file mode 100644
index 000000000..9577ab8fb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties.html
@@ -0,0 +1,35 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Indexed properties of the window object (non-strict mode)</title>
+<link rel="author" title="Ms2ger" href="ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#window">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-window-item">
+<link rel="help" href="https://heycam.github.io/webidl/#getownproperty">
+<link rel="help" href="https://heycam.github.io/webidl/#defineownproperty">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<iframe></iframe>
+<script>
+test(function() {
+ assert_false("-1" in window, "-1 not in window");
+ assert_equals(window[-1], undefined);
+ window[-1] = "foo";
+ assert_equals(window[-1], "foo");
+});
+test(function() {
+ window[0] = "foo";
+ assert_equals(window[0],
+ document.getElementsByTagName("iframe")[0].contentWindow);
+});
+test(function() {
+ window[1] = "foo";
+ assert_equals(window[1], undefined);
+});
+test(function() {
+ var proto = Window.prototype;
+ [-1, 0, 1].forEach(function(idx) {
+ assert_false(idx in proto, idx + " in proto");
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-named-properties.html b/testing/web-platform/tests/html/browsers/the-window-object/window-named-properties.html
new file mode 100644
index 000000000..54f37bbdc
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/window-named-properties.html
@@ -0,0 +1,77 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Changes to named properties of the window object</title>
+<link rel="author" title="Ms2ger" href="ms2ger@gmail.com">
+<link rel="author" title="Boris Zbarsky" href="bzbarsky@mit.edu">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#window">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-window-nameditem">
+<link rel="help" href="https://heycam.github.io/webidl/#named-properties-object">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<iframe name="bar"></iframe>
+<iframe name="baz"></iframe>
+<iframe name="baz"></iframe>
+<iframe name="constructor"></iframe>
+<script>
+function assert_data_propdesc(pd, Writable, Enumerable, Configurable) {
+ assert_equals(typeof pd, "object");
+ assert_equals(pd.writable, Writable);
+ assert_equals(pd.enumerable, Enumerable);
+ assert_equals(pd.configurable, Configurable);
+}
+test(function() {
+ assert_true("bar" in window, "bar not in window");
+ assert_equals(window["bar"],
+ document.getElementsByTagName("iframe")[0].contentWindow);
+}, "Static name");
+test(function() {
+ assert_true("bar" in Window.prototype, "bar in Window.prototype");
+ assert_false(Window.prototype.hasOwnProperty("bar"), "Window.prototype.hasOwnProperty(\"bar\")");
+
+ var gsp = Object.getPrototypeOf(Object.getPrototypeOf(window));
+ assert_true("bar" in gsp, "bar in gsp");
+ assert_true(gsp.hasOwnProperty("bar"), "gsp.hasOwnProperty(\"bar\")");
+ assert_data_propdesc(Object.getOwnPropertyDescriptor(gsp, "bar"),
+ true, false, true);
+}, "Static name on the prototype");
+test(function() {
+ assert_equals(window.constructor, Window);
+ assert_false(window.hasOwnProperty("constructor"), "window.constructor should not be an own property.");
+
+ var proto = Object.getPrototypeOf(window);
+ assert_equals(proto.constructor, Window);
+ assert_true("constructor" in proto, "constructor in proto");
+ assert_data_propdesc(Object.getOwnPropertyDescriptor(proto, "constructor"),
+ true, false, true);
+
+ var gsp = Object.getPrototypeOf(proto);
+ assert_true("constructor" in gsp, "constructor in gsp");
+ assert_false(gsp.hasOwnProperty("constructor"), "gsp.hasOwnProperty(\"constructor\")");
+ assert_equals(Object.getOwnPropertyDescriptor(gsp, "constructor"), undefined);
+}, "constructor");
+test(function() {
+ var gsp = Object.getPrototypeOf(Object.getPrototypeOf(window));
+ var names = Object.getOwnPropertyNames(gsp);
+ assert_equals(names.filter((name) => name == "baz").length, 1);
+
+}, "duplicate property names")
+var t = async_test("Dynamic name")
+var t2 = async_test("Ghost name")
+t.step(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ iframe.setAttribute("src", "data:text/html,<script>window.name='foo'<\/script>");
+ iframe.onload = function() {
+ t.step(function() {
+ assert_true("foo" in window, "foo not in window");
+ assert_equals(window["foo"], iframe.contentWindow);
+ });
+ t.done();
+ t2.step(function() {
+ assert_false("bar" in window, "bar still in window");
+ assert_equals(window["bar"], undefined);
+ });
+ t2.done();
+ };
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-noopener.html b/testing/web-platform/tests/html/browsers/the-window-object/window-open-noopener.html
new file mode 100644
index 000000000..808f55e23
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-noopener.html
@@ -0,0 +1,105 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>window.open() with "noopener" tests</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+var testData = [
+ { testDescription: "window.open() with 'noopener' should not reuse existing target",
+ secondWindowFeatureString: "noopener",
+ shouldReuse: false },
+ { testDescription: "noopener needs to be present as a token on its own",
+ secondWindowFeatureString: "noopener=1",
+ shouldReuse: true },
+ { testDescription: "noopener needs to be present as a token on its own again",
+ secondWindowFeatureString: "noopener=0",
+ shouldReuse: true },
+ { testDescription: "noopener needs to be present as a token on its own yet again",
+ secondWindowFeatureString: "make me noopener",
+ shouldReuse: true },
+ { testDescription: "Trailing noopener should work",
+ secondWindowFeatureString: "abc def, \n\r noopener",
+ shouldReuse: false },
+ { testDescription: "Leading noopener should work",
+ secondWindowFeatureString: "noopener \f\t , hey, there",
+ shouldReuse: false },
+ { testDescription: "Interior noopener should work",
+ secondWindowFeatureString: "and now, noopener , hey, there",
+ shouldReuse: false },
+];
+
+var tests = [];
+/**
+ * Loop over our testData array and kick off an async test for each entry. Each
+ * async test opens a window using window.open() with some per-test unique name,
+ * then tries to do a second window.open() call with the same name and the
+ * test-specific feature string. It then checks whether that second
+ * window.open() call reuses the existing window, whether the return value of
+ * the second window.open() call is correct (it should be null in the noopener
+ * cases and non-null in the cases when the existing window gets reused) and so
+ * forth.
+ */
+for (var i = 0; i < testData.length; ++i) {
+ var test = testData[i];
+ var t = async_test(test.testDescription);
+ tests.push(t);
+ t.secondWindowFeatureString = test.secondWindowFeatureString;
+ t.windowName = "someuniquename" + i;
+
+ if (test.shouldReuse) {
+ t.step(function() {
+ var windowName = this.windowName;
+
+ var w1 = window.open("", windowName);
+ this.add_cleanup(function() { w1.close(); });
+
+ assert_equals(w1.opener, window);
+
+ var w2 = window.open("", windowName, this.secondWindowFeatureString);
+ assert_equals(w2, w1);
+ assert_equals(w2.opener, w1.opener);
+ assert_equals(w2.opener, window);
+ this.done();
+ });
+ } else {
+ t.step(function() {
+ var w1;
+ this.add_cleanup(function() { w1.close(); });
+
+ var windowName = this.windowName;
+ var channel = new BroadcastChannel(windowName);
+
+ channel.onmessage = this.step_func_done(function(e) {
+ var data = e.data;
+ assert_equals(data.name, windowName, "Should have the right name");
+ assert_equals(data.haveOpener, false, "Should not have opener");
+ assert_equals(w1.opener, window);
+ assert_equals(w1.location.href, "about:blank");
+ });
+
+ w1 = window.open("", windowName);
+ assert_equals(w1.opener, window);
+
+ var w2 = window.open("support/noopener-target.html?" + windowName,
+ windowName, this.secondWindowFeatureString);
+ assert_equals(w2, null);
+
+ assert_equals(w1.opener, window);
+ });
+ }
+}
+
+/**
+ * Loop over the special targets that ignore noopener and check that doing a
+ * window.open() with those targets correctly reuses the existing window.
+ */
+for (var target of ["_self", "_parent", "_top"]) {
+ var t = async_test("noopener window.open targeting " + target);
+ tests.push(t);
+ t.openedWindow = window.open(`javascript:var w2 = window.open("", "${target}", "noopener"); this.checkValues(w2); this.close(); void(0);`);
+ assert_equals(t.openedWindow.opener, window);
+ t.openedWindow.checkValues = t.step_func_done(function(win) {
+ assert_equals(win, this.openedWindow);
+ });
+}
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-properties.html b/testing/web-platform/tests/html/browsers/the-window-object/window-properties.html
new file mode 100644
index 000000000..3316bf531
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/window-properties.html
@@ -0,0 +1,322 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Properties of the window object</title>
+<link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com">
+<link rel="help" href="http://ecma-international.org/ecma-262/5.1/#sec-15.1">
+<link rel="help" href="https://heycam.github.io/webidl/#interface-prototype-object">
+<link rel="help" href="https://heycam.github.io/webidl/#es-attributes">
+<link rel="help" href="https://heycam.github.io/webidl/#es-operations">
+<link rel="help" href="https://dom.spec.whatwg.org/#eventtarget">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#window">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#windowtimers">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#windowbase64">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#windowsessionstorage">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#windowlocalstorage">
+<link rel="help" href="https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-window-getselection">
+<link rel="help" href="http://dev.w3.org/csswg/cssom/#widl-def-Window">
+<link rel="help" href="http://dev.w3.org/csswg/cssom-view/#widl-def-Window">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+function assert_data_propdesc(pd, Writable, Enumerable, Configurable) {
+ assert_equals(typeof pd, "object");
+ assert_equals(pd.writable, Writable);
+ assert_equals(pd.enumerable, Enumerable);
+ assert_equals(pd.configurable, Configurable);
+}
+function assert_accessor_propdesc(pd, hasSetter, Enumerable, Configurable) {
+ assert_equals(typeof pd, "object");
+ assert_equals(typeof pd.get, "function");
+ assert_true("set" in pd,
+ "Should always have a setter property on the property descriptor");
+ assert_equals(typeof pd.set, hasSetter ? "function" : "undefined");
+ assert_equals(pd.enumerable, Enumerable);
+ assert_equals(pd.configurable, Configurable);
+}
+
+var unforgeableAttributes = [
+ "window",
+ "document",
+ "location",
+ "top"
+];
+
+var replaceableAttributes = [
+ "self",
+ "locationbar",
+ "menubar",
+ "personalbar",
+ "scrollbars",
+ "statusbar",
+ "toolbar",
+ "frames",
+ "parent",
+ "external",
+ "length",
+
+ // CSSOM-View
+ "screen",
+ "scrollX",
+ "scrollY",
+ "pageXOffset",
+ "pageYOffset",
+ "innerWidth",
+ "innerHeight",
+ "screenX",
+ "screenY",
+ "outerWidth",
+ "outerHeight",
+ "devicePixelRatio",
+];
+
+var methods = [
+ "close",
+ "stop",
+ "focus",
+ "blur",
+ "open",
+ "alert",
+ "confirm",
+ "prompt",
+ "print",
+ // See below: "showModalDialog",
+ "postMessage",
+
+ // WindowBase64
+ "btoa",
+ "atob",
+
+ // WindowTimers
+ "setTimeout",
+ "clearTimeout",
+ "setInterval",
+ "clearInterval",
+
+ // HTML Editing APIs
+ "getSelection",
+
+ // CSSOM
+ "getComputedStyle",
+
+ // CSSOM-View
+ "matchMedia",
+ "scroll",
+ "scrollTo",
+ "scrollBy"
+];
+
+// We would like to remove showModalDialog from the platform,
+// see <https://www.w3.org/Bugs/Public/show_bug.cgi?id=26437>.
+if ("showModalDialog" in window) {
+ methods.push("showModalDialog");
+}
+
+var readonlyAttributes = [
+ "history",
+ "frameElement",
+ "navigator",
+ "applicationCache",
+
+ // WindowSessionStorage
+ "sessionStorage",
+
+ // WindowLocalStorage
+ "localStorage",
+];
+
+var writableAttributes = [
+ "name",
+ "status",
+ "opener",
+ "onabort",
+ "onafterprint",
+ "onbeforeprint",
+ "onbeforeunload",
+ "onblur",
+ "oncancel",
+ "oncanplay",
+ "oncanplaythrough",
+ "onchange",
+ "onclick",
+ "onclose",
+ "oncontextmenu",
+ "oncuechange",
+ "ondblclick",
+ "ondrag",
+ "ondragend",
+ "ondragenter",
+ "ondragleave",
+ "ondragover",
+ "ondragstart",
+ "ondrop",
+ "ondurationchange",
+ "onemptied",
+ "onended",
+ "onerror",
+ "onfocus",
+ "onhashchange",
+ "oninput",
+ "oninvalid",
+ "onkeydown",
+ "onkeypress",
+ "onkeyup",
+ "onload",
+ "onloadeddata",
+ "onloadedmetadata",
+ "onloadstart",
+ "onmessage",
+ "onmousedown",
+ "onmousemove",
+ "onmouseout",
+ "onmouseover",
+ "onmouseup",
+ "onmousewheel",
+ "onoffline",
+ "ononline",
+ "onpause",
+ "onplay",
+ "onplaying",
+ "onpagehide",
+ "onpageshow",
+ "onpopstate",
+ "onprogress",
+ "onratechange",
+ "onreset",
+ "onresize",
+ "onscroll",
+ "onseeked",
+ "onseeking",
+ "onselect",
+ "onshow",
+ "onstalled",
+ "onstorage",
+ "onsubmit",
+ "onsuspend",
+ "ontimeupdate",
+ "onunload",
+ "onvolumechange",
+ "onwaiting"
+];
+
+test(function() {
+ // 15.1.1 Value Properties of the Global Object
+ ["NaN", "Infinity", "undefined"].forEach(function(id) {
+ test(function() {
+ assert_true(id in window, id + " in window");
+ assert_data_propdesc(Object.getOwnPropertyDescriptor(window, id),
+ false, false, false);
+ }, "Value Property: " + id);
+ });
+}, "Value Properties of the Global Object");
+test(function() {
+ // 15.1.2 Function Properties of the Global Object
+ ["eval", "parseInt", "parseFloat", "isNaN", "isFinite"].forEach(function(id) {
+ test(function() {
+ assert_true(id in window, id + " in window");
+ assert_data_propdesc(Object.getOwnPropertyDescriptor(window, id),
+ true, false, true);
+ }, "Function Property: " + id);
+ });
+}, "Function Properties of the Global Object");
+test(function() {
+ // 15.1.3 URI Handling Function Properties
+ ["decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent"].forEach(function(id) {
+ test(function() {
+ assert_true(id in window, id + " in window");
+ assert_data_propdesc(Object.getOwnPropertyDescriptor(window, id),
+ true, false, true);
+ }, "URI Handling Function Property: " + id);
+ });
+}, "URI Handling Function Properties");
+test(function() {
+ // 15.1.4 Constructor Properties of the Global Object
+ ["Object", "Function", "Array", "String", "Boolean", "Number", "Date",
+ "RegExp", "Error", "EvalError", "RangeError", "ReferenceError",
+ "SyntaxError", "TypeError", "URIError"].forEach(function(id) {
+ test(function() {
+ assert_true(id in window, id + " in window");
+ assert_data_propdesc(Object.getOwnPropertyDescriptor(window, id),
+ true, false, true);
+ }, "Constructor Property: " + id);
+ });
+}, "Constructor Properties of the Global Object");
+test(function() {
+ // 15.1.5 Other Properties of the Global Object
+ ["Math", "JSON"].forEach(function(id) {
+ test(function() {
+ assert_true(id in window, id + " in window");
+ assert_data_propdesc(Object.getOwnPropertyDescriptor(window, id),
+ true, false, true);
+ }, "Other Property: " + id);
+ });
+}, "Other Properties of the Global Object");
+test(function() {
+ // EventTarget interface
+ ["addEventListener", "removeEventListener", "dispatchEvent"].forEach(function(id) {
+ test(function() {
+ var EventTargetProto = EventTarget.prototype;
+ assert_true(id in window, id + " in window");
+ assert_equals(window[id], EventTargetProto[id]);
+ assert_data_propdesc(Object.getOwnPropertyDescriptor(EventTargetProto, id),
+ true, true, true);
+ assert_equals(Object.getOwnPropertyDescriptor(window, id), undefined);
+ }, "EventTarget method: " + id);
+ });
+}, "EventTarget interface");
+test(function() {
+ // Window interface
+ methods.forEach(function(id) {
+ test(function() {
+ var WindowProto = Window.prototype;
+ assert_true(id in window, id + " in window");
+ assert_false(id in WindowProto, id + " in Window.prototype");
+ assert_data_propdesc(Object.getOwnPropertyDescriptor(window, id),
+ true, true, true);
+ }, "Window method: " + id);
+ });
+ readonlyAttributes.forEach(function(id) {
+ test(function() {
+ var WindowProto = Window.prototype;
+ assert_true(id in window, id + " in window");
+ assert_false(id in WindowProto, id + " in Window.prototype");
+ assert_accessor_propdesc(Object.getOwnPropertyDescriptor(window, id),
+ false, true, true);
+ }, "Window readonly attribute: " + id);
+ });
+ writableAttributes.forEach(function(id) {
+ test(function() {
+ var WindowProto = Window.prototype;
+ assert_true(id in window, id + " in window");
+ assert_false(id in WindowProto, id + " in Window.prototype");
+ assert_accessor_propdesc(Object.getOwnPropertyDescriptor(window, id),
+ true, true, true);
+ }, "Window attribute: " + id);
+ });
+ unforgeableAttributes.forEach(function(id) {
+ test(function() {
+ var WindowProto = Window.prototype;
+ assert_true(id in window, id + " in window");
+ assert_false(id in WindowProto, id + " in Window.prototype");
+ // location has a [PutForwards] extended attribute.
+ assert_accessor_propdesc(Object.getOwnPropertyDescriptor(window, id),
+ id === "location", true, false);
+ }, "Window unforgeable attribute: " + id);
+ });
+ replaceableAttributes.forEach(function(id) {
+ test(function() {
+ var WindowProto = Window.prototype;
+ assert_true(id in window, id + " in window");
+ assert_false(id in WindowProto, id + " in Window.prototype");
+ assert_accessor_propdesc(Object.getOwnPropertyDescriptor(window, id),
+ true, true, true);
+ }, "Window replaceable attribute: " + id);
+ });
+}, "Window interface");
+test(function() {
+ assert_equals(window.constructor, Window);
+ assert_false(window.hasOwnProperty("constructor"), "window.constructor should not be an own property.");
+ assert_data_propdesc(Object.getOwnPropertyDescriptor(Window.prototype, "constructor"),
+ true, false, true);
+}, "constructor");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-prototype-chain.html b/testing/web-platform/tests/html/browsers/the-window-object/window-prototype-chain.html
new file mode 100644
index 000000000..d29a8e11f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/window-prototype-chain.html
@@ -0,0 +1,35 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Prototype chain of the window object</title>
+<link rel="author" title="Ms2ger" href="ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#window">
+<link rel="help" href="https://dom.spec.whatwg.org/#eventtarget">
+<link rel="help" href="https://heycam.github.io/webidl/#interface-prototype-object">
+<link rel="help" href="https://heycam.github.io/webidl/#named-properties-object">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ assert_class_string(window, "Window");
+}, "window object");
+test(function() {
+ var proto = Object.getPrototypeOf(window);
+ assert_class_string(proto, "WindowPrototype");
+ assert_equals(proto, Window.prototype);
+}, "Window.prototype");
+test(function() {
+ var gsp = Object.getPrototypeOf(Object.getPrototypeOf(window));
+ assert_class_string(gsp, "WindowProperties");
+}, "Global scope polluter");
+test(function() {
+ var protoproto = Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(window)));
+ assert_class_string(protoproto, "EventTargetPrototype");
+ assert_equals(protoproto, EventTarget.prototype);
+}, "EventTarget.prototype");
+test(function() {
+ var protoprotoproto = Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(window))));
+ assert_class_string(protoprotoproto, "Object");
+ assert_equals(protoprotoproto, Object.prototype);
+}, "Object.prototype");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/.gitkeep b/testing/web-platform/tests/html/browsers/windows/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/.gitkeep b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/contains.json b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/contains.json
new file mode 100644
index 000000000..9f2ca3b6f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/contains.json
@@ -0,0 +1,6 @@
+[
+ {
+ "id": "navigating-auxiliary-browsing-contexts-in-the-dom",
+ "original_id": "navigating-auxiliary-browsing-contexts-in-the-dom"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-first-created.xhtml b/testing/web-platform/tests/html/browsers/windows/browsing-context-first-created.xhtml
new file mode 100644
index 000000000..a059eec4c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-first-created.xhtml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>HTML Test: Browsing context is first created</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ <![CDATA[
+
+ var doc, iframe;
+
+ setup(function () {
+ iframe = document.createElement("iframe");
+ document.body.appendChild(iframe);
+ doc = iframe.contentDocument;
+ });
+
+ test(function () {
+ assert_equals(iframe.contentWindow.history.length, 1, "The history.length should be 1.");
+ }, "Check the history.length of the first created browsing context");
+
+ test(function () {
+ assert_equals(doc.documentURI, "about:blank", "The document's address should be 'about:blank'.");
+ assert_equals(doc.URL, "about:blank", "The document's address should be 'about:blank'.");
+ assert_equals(doc.contentType, "text/html", "The document should be an HTML document.");
+ assert_equals(doc.doctype, null, "The docType of a document without a document type declaration should be null.");
+ assert_equals(doc.compatMode, "BackCompat", "The compatMode of a document without a document type declaration should be 'BackCompat'.");
+ assert_equals(doc.characterSet, "UTF-8", "The document's encoding should be 'UTF-8'.");
+ assert_equals(iframe.contentWindow.parent.document, document);
+ assert_equals(doc.referrer, document.URL, "The document's referrer should be its creator document's address.");
+ }, "Check the document's meta data");
+
+ test(function () {
+ assert_equals(doc.readyState, "complete", "The readyState attribute should be 'complete'.");
+ }, "Check the document's status");
+
+ test(function () {
+ assert_equals(doc.childNodes.length, 1, "The document must have only one child.");
+ assert_equals(doc.documentElement.tagName, "HTML");
+ assert_equals(doc.documentElement.childNodes.length, 2, "The HTML element should have 2 children.");
+ assert_equals(doc.documentElement.childNodes[0].tagName, "HEAD", "The first child of HTML element should be a HEAD element.");
+ assert_false(doc.documentElement.childNodes[0].hasChildNodes(), "The HEAD element should not have children.");
+ assert_equals(doc.documentElement.childNodes[1].tagName, "BODY", "The second child of HTML element should be a BODY element.");
+ assert_false(doc.documentElement.childNodes[1].hasChildNodes(), "The BODY element should not have children.");
+ }, "Check the document's content");
+
+ ]]>
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/.gitkeep b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/001-1.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/001-1.html
new file mode 100644
index 000000000..d413c3019
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/001-1.html
@@ -0,0 +1,8 @@
+<!doctype html>
+001-1
+<script>
+if (window.opener !== null) {
+ window.opener.postMessage("FAIL", "*");
+}
+window.close();
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/001.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/001.html
new file mode 100644
index 000000000..2478cdc8f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/001.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>Link with target=_blank, rel=noreferrer</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<a href="001-1.html" rel="noreferrer" target="_blank">Link</a>
+<script>
+var t = async_test();
+var a;
+t.step(function() {
+ a = document.getElementsByTagName("a")[0];
+ a.click();
+ //This is a bit hacky; if the test passes there isn't a link back to the parent
+ //window so we have to pass on a timeout. But opening the link could be slow in
+ //some cases, so there is some possibility of false passes
+ setTimeout(t.step_func(function() {
+ t.done();
+ }), 1000);
+});
+
+onmessage = t.step_func(function() {assert_unreached("Opened window had a reference to opener")});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/002-1.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/002-1.html
new file mode 100644
index 000000000..ca8a485de
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/002-1.html
@@ -0,0 +1,8 @@
+<!doctype html>
+002-1
+<script>
+if (window.opener !== null) {
+ window.opener.postMessage("PASS", "*");
+}
+window.close();
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/002.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/002.html
new file mode 100644
index 000000000..4a1df8e4d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/002.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>Link with target=_blank, no rel</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<a href="002-1.html" target="_blank">Link</a>
+<script>
+var a;
+async_test(function(t) {
+ a = document.getElementsByTagName("a")[0];
+ a.click();
+
+ // This is a bit hacky; if the test fails there isn't a link back to the parent
+ // window so we have to pass on a timeout. But opening the link could be slow in
+ // some cases, so there is some possibility of false fails
+ step_timeout(t.step_func(function() {
+ assert_unreached("Failed to get callback from opened window");
+ }), 5000);
+
+ onmessage = t.step_func(function(e) {
+ assert_equals(e.data, "PASS");
+ t.done()
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/MANIFEST b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/MANIFEST
new file mode 100644
index 000000000..efecf51e3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/MANIFEST
@@ -0,0 +1,4 @@
+001.html
+support 001-1.html
+002.html
+support 002-1.html
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html
new file mode 100644
index 000000000..2eaba22f6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: Choose browsing context - the given name is same as an existing browsing context's name</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="existing.html" style="display:none"></iframe>
+<iframe name="existWin" style="display:none"></iframe>
+<script>
+
+var t = async_test("The browsing context must be chosen if the given name is same as its name");
+
+window.addEventListener("message", function (e) {
+ t.step(function() {
+ assert_equals(e.data.name, "existWin", "The browsing context name should be 'existWin'.");
+ });
+ t.done();
+}, false);
+
+frames[0].onload = t.step_func(function(e) {
+ frames[0].do_test();
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent.html
new file mode 100644
index 000000000..c771a8fd7
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: Choose browsing context - the given name is '_parent'</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="parent1.html" name="parentWin" style="display:none"></iframe>
+<script>
+
+var t = async_test("The parent browsing context must be chosen if the given name is '_parent'");
+
+window.addEventListener("message", function (e) {
+ t.step(function() {
+ assert_equals(e.data.name, "parentWin", "The browsing context name should be 'parentWin'.");
+ });
+ t.done();
+}, false);
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html
new file mode 100644
index 000000000..99d7fe7d3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: Choose browsing context - the given name is '_self'</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="self1.html" style="display:none"></iframe>
+<script>
+
+var t = async_test("The current browsing context must be chosen if the given name is '_self'");
+
+window.addEventListener("message", function (e) {
+ t.step(function () {
+ assert_equals(e.data.name, "selfWin1", "The browsing context name should be 'selfWin1'.");
+ });
+ t.done();
+}, false);
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html
new file mode 100644
index 000000000..e25a5b442
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: Choose browsing context - the given name is empty string</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="self2.html" style="display:none"></iframe>
+<script>
+
+var t = async_test("The current browsing context must be chosen if the given name is empty string");
+
+window.addEventListener("message", function (e) {
+ t.step(function () {
+ assert_equals(e.data.name, "selfWin2", "The browsing context name should be 'selfWin2'.");
+ });
+ t.done();
+}, false);
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-default-name.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-default-name.html
new file mode 100644
index 000000000..0bad8e606
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/browsing-context-default-name.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: Browsing context - Default name</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="message.html" style="display:none"></iframe>
+<script>
+
+test(function () {
+ assert_equals(window.frames[0].name, "", "The browsing context should not have a default name.");
+}, "A embedded browsing context has no default name");
+
+test(function () {
+ var win = window.open("about:blank", "_blank");
+ assert_equals(win.name, "", "The browsing context should not have a name.");
+ win.close();
+}, "A browsing context which is opened by window.open() method with '_blank' parameter has no default name");
+
+//This test must be run when the current browsing context's name is not set
+test(function () {
+ assert_equals(window.name, "", "The browsing context should not have a name.");
+}, "A browsing context has no default name");
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/existing.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/existing.html
new file mode 100644
index 000000000..13d2c6ab4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/existing.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>This is a test page</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script>
+
+function do_test() {
+ window.open("message.html", "existWin");
+}
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/message.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/message.html
new file mode 100644
index 000000000..90720d46a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/message.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: post window's name to top browsing context</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script>
+
+top.postMessage({name: window.name}, "*");
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/parent1.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/parent1.html
new file mode 100644
index 000000000..fb34b2fe7
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/parent1.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: browsing context name - parent</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<iframe src="parent2.html"></iframe>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/parent2.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/parent2.html
new file mode 100644
index 000000000..34eb1c76b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/parent2.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: browsing context name - parent</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script>
+
+window.open("message.html", "_parent");
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/self1.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/self1.html
new file mode 100644
index 000000000..2c8e3a414
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/self1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: browsing context name - self</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script>
+
+window.name = "selfWin1";
+var win = window.open("message.html", "_self");
+win.close();
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/self2.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/self2.html
new file mode 100644
index 000000000..57276fada
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/self2.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: browsing context name - self</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script>
+
+window.name = "selfWin2";
+var win = window.open("message.html", "");
+win.close();
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/groupings-of-browsing-contexts/.gitkeep b/testing/web-platform/tests/html/browsers/windows/groupings-of-browsing-contexts/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/groupings-of-browsing-contexts/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/.gitkeep b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/MANIFEST b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/MANIFEST
new file mode 100644
index 000000000..3bc8c0f3f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/MANIFEST
@@ -0,0 +1 @@
+window-top-001.html
diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/contains.json b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/contains.json
new file mode 100644
index 000000000..121284dca
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/contains.json
@@ -0,0 +1,6 @@
+[
+ {
+ "id": "navigating-nested-browsing-contexts-in-the-dom",
+ "original_id": "navigating-nested-browsing-contexts-in-the-dom"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html
new file mode 100644
index 000000000..f1d5581f6
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<meta charset="utf-8"/>
+<title>HTML Test: window.frameElement</title>
+<link rel="author" title="Intel" href="http://www.intel.com/" />
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script>
+
+var t1 = async_test("The window's frameElement attribute must return its container element if it is a nested browsing context");
+var t2 = async_test("The SecurityError must be thrown if the window accesses to frameElement attribute of a Window which does not have the same effective script origin");
+var t3 = async_test("The window's frameElement attribute must return null if the container's document does not have the same effective script origin");
+
+function on_load() {
+ t1.step(function () {
+ assert_equals(frames[0].frameElement, document.getElementById("fr1"),
+ "The frameElement attribute should be the first iframe element.");
+ assert_equals(window["win2"].frameElement, document.getElementById("obj"),
+ "The frameElement attribute should be the object element.");
+ assert_equals(window["win3"].frameElement, document.getElementById("emb"),
+ "The frameElement attribute should be the embed element.");
+ assert_equals(document.getElementById("fr4").contentWindow[0].frameElement,
+ document.getElementById("fr4").contentDocument.getElementById("f1"),
+ "The frameElement attribute should be the frame element in 'test.html'.");
+ });
+ t1.done();
+
+ t2.step(function () {
+ assert_throws("SecurityError", function () { frames[1].frameElement; },
+ "The SecurityError exception should be thrown.");
+ });
+ t2.done();
+
+ t3.step(function () {
+ document.getElementById("fr5").contentWindow.postMessage(null, "*");
+ });
+ window.addEventListener("message", function (event) {
+ var data = JSON.parse(event.data);
+ if (data.name == "testcase3") {
+ t3.step(function () {
+ assert_equals(data.result, "window.frameElement = null",
+ "The frameElement attribute should be null.");
+ });
+ t3.done();
+ }
+ }, false);
+}
+
+</script>
+<body onload="on_load()">
+ <div id="log"></div>
+ <iframe id="fr1"></iframe>
+ <iframe id="fr2" src="test.html"></iframe> <!-- cross origin -->
+ <iframe id="fr3" src="" style="display:none"></iframe>
+ <object id="obj" name="win2" type="text/html" data="about:blank"></object>
+ <embed id="emb" name="win3" type="image/svg+xml" src="/images/green.svg" />
+ <iframe id="fr4" src="test.html"></iframe> <!-- same origin -->
+ <iframe id="fr5" src="testcase3.html"></iframe> <!-- cross origin -->
+ <script>
+
+ setup(function () {
+ var src_base = get_host_info().HTTP_REMOTE_ORIGIN;
+ src_base += document.location.pathname.substring(0, document.location.pathname.lastIndexOf("/") + 1);
+ document.getElementById("fr2").src = src_base + "test.html";
+ document.getElementById("fr5").src = src_base + "testcase3.html";
+ });
+
+ test(function () {
+ assert_equals(window.frameElement, null,
+ "The frameElement attribute should be null.");
+ }, "The window's frameElement attribute must return null if it is not a nested browsing context");
+
+ </script>
+</body>
diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/test.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/test.html
new file mode 100644
index 000000000..d066b8d4c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/test.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<meta charset="utf-8"/>
+<title>HTML Test: child browsing context created by the frame element</title>
+<link rel="author" title="Intel" href="http://www.intel.com/" />
+<frameset>
+ <frame id="f1" name="frame">
+</frameset>
diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/testcase3.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/testcase3.html
new file mode 100644
index 000000000..d67bde26f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/testcase3.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<meta charset="utf-8"/>
+<title>Testcase 3: frameElement attribute must return null if the container\'s document does not have the same effective script origin</title>
+<script>
+window.addEventListener("message", function (event) {
+ try {
+ var result = "window.frameElement = " + window.frameElement;
+ } catch (e) {
+ result = e.message;
+ }
+ event.source.postMessage(JSON.stringify({name: "testcase3", result: result}),
+ "*");
+}, false);
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-top-001.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-top-001.html
new file mode 100644
index 000000000..9dbccfc7c
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-top-001.html
@@ -0,0 +1,63 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>window.top</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(window, top)
+}, "Top level browsing context");
+
+function step_func(test) {
+ return function (top_pointer) {
+ test.step(function() {assert_equals(top_pointer, window);})
+ test.done();
+ }
+}
+
+var t1 = async_test("One nested iframe");
+t1.step(function() {
+ var iframe = document.createElement("iframe");
+ //iframe.src = "data:text/html,"
+
+ iframe.onload = t1.step_func(
+ function() {
+ var doc = iframe.contentDocument;
+ iframe.contentWindow.test_func = step_func(t1);
+
+ var script = doc.createElement("script")
+ script.textContent = "test_func(top);"
+ doc.body.appendChild(script);
+ });
+ document.body.appendChild(iframe);
+});
+
+var t2 = async_test("Two nested iframes");
+t2.step(function() {
+ var iframe = document.createElement("iframe");
+ //iframe.src = "data:text/html,"
+
+ iframe.onload = t2.step_func(
+ function() {
+ var doc = iframe.contentDocument;
+ iframe2 = document.createElement("iframe");
+ //iframe2.src = "data:text/html,"
+
+ iframe2.onload = t2.step_func(
+ function() {
+ var doc2 = iframe2.contentDocument;
+
+ iframe2.contentWindow.test_func = step_func(t2);
+
+ var script = doc2.createElement("script")
+ script.textContent = "test_func(top);"
+ doc2.body.appendChild(script);
+ });
+ doc.body.appendChild(iframe2);
+ });
+
+ document.body.appendChild(iframe);
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-close-manual.sub.html b/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-close-manual.sub.html
new file mode 100644
index 000000000..0191fa61e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-close-manual.sub.html
@@ -0,0 +1,3 @@
+<meta charset=utf-8>
+<p>Follow this link to open a new browsing context and then confirm it can be closed:
+<a rel=noreferrer target=reallydoesnotmatter href="//天気の良い日.{{location[host]}}/html/browsers/windows/support-close.html">link</a>.
diff --git a/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-manual.html b/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-manual.html
new file mode 100644
index 000000000..f5879ee6d
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-manual.html
@@ -0,0 +1,10 @@
+<ol>
+ <li><p>After clicking these two links in order a single browsing context should be open showing
+ <code>example.org</code>:
+ <a target=doesnotmatter href="http://example.com/">one</a>,
+ <a target=doesnotmatter href="http://example.org/">two</a>.
+
+ <li><p>After clicking these two links two browsing contexts should have been opened:
+ <a rel=noreferrer target=reallydoesnotmatter href="http://example.com/">one</a>,
+ <a rel=noreferrer target=reallydoesnotmatter href="http://example.com/">two</a>.
+</ol>
diff --git a/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-window-name.sub.html b/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-window-name.sub.html
new file mode 100644
index 000000000..790c22157
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-window-name.sub.html
@@ -0,0 +1,3 @@
+<meta charset=utf-8>
+<p>Follow this link to open a new browsing context and then confirm it says "idonteven":
+<a rel=noreferrer target=idonteven href="//天気の良い日.{{location[host]}}/html/browsers/windows/support-window-name-echo.html">link</a>.
diff --git a/testing/web-platform/tests/html/browsers/windows/noreferrer-window-name.html b/testing/web-platform/tests/html/browsers/windows/noreferrer-window-name.html
new file mode 100644
index 000000000..ecd2e7658
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/noreferrer-window-name.html
@@ -0,0 +1,85 @@
+<!doctype html>
+<title>rel=noreferrer and reuse of names</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ async_test(function(t) {
+ localStorage.clear()
+
+ function makeHyperlink(n) {
+ var hyperlink = document.body.appendChild(document.createElement("a"))
+ hyperlink.rel = "noreferrer"
+ hyperlink.target = "sufficientlyrandomwindownameamiright"
+ hyperlink.href = "support-named-null-opener.html#" + n
+ return hyperlink
+ }
+
+ var hyperlink1 = makeHyperlink(1),
+ hyperlink2 = makeHyperlink(2)
+
+ t.add_cleanup(function() {
+ localStorage.setItem("x", "close")
+ localStorage.clear()
+ document.body.removeChild(hyperlink1)
+ document.body.removeChild(hyperlink2)
+ })
+
+ addEventListener("storage", function(e) {
+ t.step(function() {
+ if(localStorage.getItem("window1") && localStorage.getItem("window2")) {
+ localStorage.setItem("x", "close")
+ t.done()
+ }
+ })
+ })
+
+ hyperlink1.click()
+ hyperlink2.click()
+ }, "Following a noreferrer link with a named target should not cause creation of a window that can be targeted by another noreferrer link with the same named target");
+
+ async_test(function(t) {
+ var ifr = document.createElement("iframe");
+ ifr.name = "sufficientlyrandomwindownameamiright2";
+ ifr.onload = t.step_func(function() {
+ var hyperlink = document.body.appendChild(document.createElement("a"));
+ t.add_cleanup(function() {
+ hyperlink.remove();
+ });
+ hyperlink.rel = "noreferrer";
+ hyperlink.href = URL.createObjectURL(new Blob(["hello subframe"],
+ { type: "text/html"}));
+ hyperlink.target = "sufficientlyrandomwindownameamiright2";
+ ifr.onload = t.step_func_done(function() {
+ assert_equals(ifr.contentDocument.documentElement.textContent,
+ "hello subframe");
+ });
+ hyperlink.click();
+ });
+ document.body.appendChild(ifr);
+ t.add_cleanup(function() {
+ ifr.remove();
+ });
+ }, "Targeting a rel=noreferrer link at an existing named subframe should work");
+
+ async_test(function(t) {
+ var win = window.open("", "sufficientlyrandomwindownameamiright3");
+ t.add_cleanup(function() {
+ win.close();
+ });
+
+ var hyperlink = document.body.appendChild(document.createElement("a"));
+ t.add_cleanup(function() {
+ hyperlink.remove();
+ });
+ hyperlink.rel = "noreferrer";
+ hyperlink.href = URL.createObjectURL(new Blob(["hello window"],
+ { type: "text/html"}));
+ hyperlink.target = "sufficientlyrandomwindownameamiright3";
+ win.onload = t.step_func_done(function() {
+ assert_equals(win.document.documentElement.textContent,
+ "hello window");
+ });
+ hyperlink.click();
+ }, "Targeting a rel=noreferrer link at an existing named window should work");
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/noreferrer.html b/testing/web-platform/tests/html/browsers/windows/noreferrer.html
new file mode 100644
index 000000000..c072486b0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/noreferrer.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>rel=noreferrer nullifies window.opener</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ async_test(function(t) {
+ localStorage.clear()
+
+ var hyperlink = document.body.appendChild(document.createElement("a"))
+ hyperlink.rel = "noreferrer"
+ hyperlink.target = "_blank"
+ hyperlink.href = "support-opener-null.html"
+ hyperlink.click()
+ document.body.removeChild(hyperlink)
+
+ addEventListener("storage", function(e) {
+ t.step(function() {
+ assert_equals(e.newValue, "null")
+ localStorage.clear()
+ t.done()
+ })
+ })
+ })
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/secondary-browsing-contexts/.gitkeep b/testing/web-platform/tests/html/browsers/windows/secondary-browsing-contexts/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/secondary-browsing-contexts/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/windows/security-nav/.gitkeep b/testing/web-platform/tests/html/browsers/windows/security-nav/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/security-nav/.gitkeep
diff --git a/testing/web-platform/tests/html/browsers/windows/support-close.html b/testing/web-platform/tests/html/browsers/windows/support-close.html
new file mode 100644
index 000000000..38ec2aef5
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/support-close.html
@@ -0,0 +1 @@
+<p>Clicking this button should close this browsing context: <button onclick=window.close()>button</button>
diff --git a/testing/web-platform/tests/html/browsers/windows/support-named-null-opener.html b/testing/web-platform/tests/html/browsers/windows/support-named-null-opener.html
new file mode 100644
index 000000000..8c106ca88
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/support-named-null-opener.html
@@ -0,0 +1,8 @@
+<script>
+ addEventListener("storage", function(e) {
+ if(e.newValue === "close") {
+ close()
+ }
+ })
+ localStorage.setItem("window" + location.hash.slice(1), "tralala")
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/support-nested-browsing-contexts.html b/testing/web-platform/tests/html/browsers/windows/support-nested-browsing-contexts.html
new file mode 100644
index 000000000..e92b69d7e
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/support-nested-browsing-contexts.html
@@ -0,0 +1,12 @@
+<body>
+<script>
+ var i = document.createElement("iframe");
+ i.name = "nested1";
+ document.body.appendChild(i);
+
+ window.opener.postMessage({
+ "name": window.name,
+ "isTop": window.top === window
+ }, "*");
+</script>
+</body>
diff --git a/testing/web-platform/tests/html/browsers/windows/support-opener-null.html b/testing/web-platform/tests/html/browsers/windows/support-opener-null.html
new file mode 100644
index 000000000..c734eb305
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/support-opener-null.html
@@ -0,0 +1,4 @@
+<script>
+ localStorage.setItem("opener", window.opener)
+ window.close()
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/support-post-to-opener.html b/testing/web-platform/tests/html/browsers/windows/support-post-to-opener.html
new file mode 100644
index 000000000..453fec97a
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/support-post-to-opener.html
@@ -0,0 +1,8 @@
+<script>
+ if (window.opener) {
+ window.opener.postMessage({
+ "name": window.name,
+ "isTop": window.top === window
+ }, "*");
+ }
+</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/support-window-name-echo.html b/testing/web-platform/tests/html/browsers/windows/support-window-name-echo.html
new file mode 100644
index 000000000..a437fecb2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/support-window-name-echo.html
@@ -0,0 +1 @@
+<script>document.write(name)</script>
diff --git a/testing/web-platform/tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.sub.html b/testing/web-platform/tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.sub.html
new file mode 100644
index 000000000..e37a595f7
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.sub.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Targeting nested browsing contexts</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <script src="/common/get-host-info.sub.js"></script>
+ <script>
+ async_test(function (t) {
+ var windowsToClose = [];
+ window.onmessage = t.step_func(function (e) {
+ if (e.data.name == "openee") {
+ var a = document.body.appendChild(document.createElement('a'));
+ a.target = "nested1";
+ a.href = "support-post-to-opener.html";
+ a.click();
+ windowsToClose.push(e.source);
+ } else {
+ assert_equals(e.data.name, "nested1");
+ assert_equals(e.data.isTop, true);
+ windowsToClose.push(e.source);
+ windowsToClose.forEach(function (w) {
+ w.close();
+ });
+ t.done();
+ }
+ });
+
+ var a = document.body.appendChild(document.createElement('a'));
+ a.target = "openee";
+ a.href = get_host_info().HTTP_REMOTE_ORIGIN + "/html/browsers/windows/support-nested-browsing-contexts.html";
+ a.click();
+ });
+ </script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/.gitkeep b/testing/web-platform/tests/html/dom/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/documents/.gitkeep b/testing/web-platform/tests/html/dom/documents/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/.gitkeep b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.body.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.body.html
new file mode 100644
index 000000000..07f1edf93
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.body.html
@@ -0,0 +1,169 @@
+<!DOCTYPE html>
+<title>Document.body</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-body">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+function createDocument() {
+ var doc = document.implementation.createHTMLDocument("");
+ doc.removeChild(doc.documentElement);
+ return doc;
+}
+test(function() {
+ var doc = createDocument();
+ assert_equals(doc.body, null);
+}, "Childless document");
+test(function() {
+ var doc = createDocument();
+ doc.appendChild(doc.createElement("html"));
+ assert_equals(doc.body, null);
+}, "Childless html element");
+test(function() {
+ var doc = createDocument();
+ var html = doc.appendChild(doc.createElement("html"));
+ var b =
+ html.appendChild(doc.createElement("body"));
+ html.appendChild(doc.createElement("frameset"));
+ assert_equals(doc.body, b);
+}, "Body followed by frameset inside the html element");
+test(function() {
+ var doc = createDocument();
+ var html = doc.appendChild(doc.createElement("html"));
+ var f =
+ html.appendChild(doc.createElement("frameset"));
+ html.appendChild(doc.createElement("body"));
+ assert_equals(doc.body, f);
+}, "Frameset followed by body inside the html element");
+test(function() {
+ var doc = createDocument();
+ var html =
+ doc.appendChild(doc.createElementNS("http://example.org/test", "html"));
+ html.appendChild(doc.createElement("body"));
+ html.appendChild(doc.createElement("frameset"));
+ assert_equals(doc.body, null);
+}, "Body followed by frameset inside a non-HTML html element");
+test(function() {
+ var doc = createDocument();
+ var html =
+ doc.appendChild(doc.createElementNS("http://example.org/test", "html"));
+ html.appendChild(doc.createElement("frameset"));
+ html.appendChild(doc.createElement("body"));
+ assert_equals(doc.body, null);
+}, "Frameset followed by body inside a non-HTML html element");
+test(function() {
+ var doc = createDocument();
+ var html = doc.appendChild(doc.createElement("html"));
+ html.appendChild(
+ doc.createElementNS("http://example.org/test", "body"));
+ var b = html.appendChild(doc.createElement("body"));
+ assert_equals(doc.body, b);
+}, "Non-HTML body followed by body inside the html element");
+test(function() {
+ var doc = createDocument();
+ var html = doc.appendChild(doc.createElement("html"));
+ html.appendChild(
+ doc.createElementNS("http://example.org/test", "frameset"));
+ var b = html.appendChild(doc.createElement("body"));
+ assert_equals(doc.body, b);
+}, "Non-HTML frameset followed by body inside the html element");
+test(function() {
+ var doc = createDocument();
+ var html = doc.appendChild(doc.createElement("html"));
+ var x = html.appendChild(doc.createElement("x"));
+ x.appendChild(doc.createElement("body"));
+ var body = html.appendChild(doc.createElement("body"));
+ assert_equals(doc.body, body);
+}, "Body inside an x element followed by a body");
+test(function() {
+ var doc = createDocument();
+ var html = doc.appendChild(doc.createElement("html"));
+ var x = html.appendChild(doc.createElement("x"));
+ x.appendChild(doc.createElement("frameset"));
+ var frameset = html.appendChild(doc.createElement("frameset"));
+ assert_equals(doc.body, frameset);
+}, "Frameset inside an x element followed by a frameset");
+
+// Root node is not a html element.
+test(function() {
+ var doc = createDocument();
+ doc.appendChild(doc.createElement("body"));
+ assert_equals(doc.body, null);
+}, "Body as the root node");
+test(function() {
+ var doc = createDocument();
+ doc.appendChild(doc.createElement("frameset"));
+ assert_equals(doc.body, null);
+}, "Frameset as the root node");
+test(function() {
+ var doc = createDocument();
+ var body = doc.appendChild(doc.createElement("body"));
+ body.appendChild(doc.createElement("frameset"));
+ assert_equals(doc.body, null);
+}, "Body as the root node with a frameset child");
+test(function() {
+ var doc = createDocument();
+ var frameset = doc.appendChild(doc.createElement("frameset"));
+ frameset.appendChild(doc.createElement("body"));
+ assert_equals(doc.body, null);
+}, "Frameset as the root node with a body child");
+test(function() {
+ var doc = createDocument();
+ doc.appendChild(doc.createElementNS("http://example.org/test", "body"));
+ assert_equals(doc.body, null);
+}, "Non-HTML body as the root node");
+test(function() {
+ var doc = createDocument();
+ doc.appendChild(doc.createElementNS("http://example.org/test", "frameset"));
+ assert_equals(doc.body, null);
+}, "Non-HTML frameset as the root node");
+
+test(function() {
+ assert_not_equals(document.body, null);
+ assert_true(document.body instanceof HTMLBodyElement, "should be HTMLBodyElement");
+ assert_equals(document.body.tagName, "BODY");
+}, "existing document's body");
+
+
+var originalBody = document.body;
+test(function() {
+ assert_throws(new TypeError(), function() {
+ document.body = "text"
+ })
+ assert_equals(document.body, originalBody);
+}, "Setting document.body to a string.")
+test(function() {
+ assert_throws("HierarchyRequestError", function() {
+ document.body = document.createElement("div")
+ })
+ assert_equals(document.body, originalBody);
+}, "Setting document.body to a div element.")
+test(function() {
+ var doc = createDocument();
+ assert_throws("HierarchyRequestError", function() {
+ doc.body = doc.createElement("body")
+ })
+ assert_equals(doc.body, null);
+}, "Setting document.body when there's no root element.")
+test(function() {
+ var doc = document.implementation.createHTMLDocument();
+
+ var new_body = doc.createElement("body");
+ assert_true(new_body instanceof HTMLBodyElement, "should be HTMLBodyElement");
+ assert_equals(new_body.tagName, "BODY");
+
+ doc.body = new_body;
+ assert_equals(doc.body, new_body);
+}, "Setting document.body to a new body element.");
+test(function() {
+ var doc = document.implementation.createHTMLDocument();
+
+ var new_frameset = doc.createElement("frameset");
+ assert_true(new_frameset instanceof HTMLFrameSetElement, "should be HTMLFrameSetElement");
+ assert_equals(new_frameset.tagName, "FRAMESET");
+
+ doc.body = new_frameset;
+ assert_equals(doc.body, new_frameset, "test6-3, append frameset to a new document");
+}, "Setting document.body to a new frameset element.");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.currentScript.sub.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.currentScript.sub.html
new file mode 100644
index 000000000..76f1b64de
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.currentScript.sub.html
@@ -0,0 +1,211 @@
+<!DOCTYPE HTML>
+<meta charset=utf-8>
+<title>Document.currentScript</title>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-document-currentscript">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<div id="log"></div>
+<script>
+var data = {
+ "parse-inline" : [],
+ "parse-ext" : [],
+ "dom-inline" : [],
+ "dom-ext" : [],
+ "nested" : ["nested-outer","nested-inner","nested-outer"],
+ "script-exec" : ["script-exec-before-after","script-exec-before-after"],
+ "script-load-error" : [null],
+ "script-window-error" : ["script-error-compile","script-error-runtime"],
+ "timeout" : [null],
+ "eval" : [],
+ "xhr-test" : [],
+ "script-svg" : [],
+ "script-async" : [],
+ "script-defer" : [],
+ "script-async-false" : [],
+ "iframe-src" : [],
+ "cross-origin" : [null],
+ "document-write" : []
+};
+
+var expected = {};
+var actual = {};
+
+Object.keys(data).forEach(function(id) {
+ var test_expected = data[id];
+ if(test_expected.length == 0) {
+ test_expected = [id];
+ }
+ expected[id] = test_expected;
+ actual[id] = [];
+});
+
+var tests = {};
+setup({allow_uncaught_exception : true});
+
+Object.keys(expected).forEach(function(id) {
+ var testmsg = "Script " + id;
+ tests[id] = async_test(testmsg);
+});
+
+function verify(id) {
+ tests[id].step(function() {
+ actual[id].push(document.currentScript);
+ })
+}
+
+function finish(id) {
+ tests[id].step(function() {
+ assert_array_equals(actual[id],expected[id].map(function(id) {
+ return document.getElementById(id);
+ }));
+ this.done();
+ })
+}
+
+</script>
+
+<!-- Test parser inserted scripts -->
+<script id="parse-inline">
+verify('parse-inline');
+finish('parse-inline')
+</script>
+<script id="parse-ext" src="data:text/plain,verify('parse-ext')"></script>
+<script>finish('parse-ext');</script>
+
+<!-- Test DOM inserted scripts -->
+<script>
+var s = document.createElement("script");
+s.textContent = "verify('dom-inline');";
+s.id = "dom-inline";
+document.body.appendChild(s);
+finish('dom-inline');
+
+s = document.createElement("script");
+s.src = "data:text/plain,verify('dom-ext');";
+s.id = "dom-ext";
+s.onload = function() {
+ finish('dom-ext');
+}
+document.body.appendChild(s);
+</script>
+
+<!-- Test Nested scripts -->
+<script id="nested-outer">
+ verify("nested");
+ var s = document.createElement("script");
+ s.textContent = "verify('nested')";
+ s.id = "nested-inner";
+ document.body.appendChild(s);
+ verify("nested");
+ finish('nested');
+</script>
+
+<!-- Test script load error event listener -->
+<script>
+function testLoadFail() {
+ verify('script-load-error');
+ finish('script-load-error');
+}
+</script>
+
+<script src="http://some.nonexistant.test/fail" id="script-load-error" onerror="testLoadFail()">
+</script>
+
+<!-- Test for runtime and compile time errors -->
+<script>
+ window.onerror = function() {
+ verify('script-window-error');
+ }
+
+ var s = document.createElement("script");
+ s.id = "script-error-compile";
+ s.textContent = "{";
+ document.body.appendChild(s);
+
+ window.onerror = function() {
+ verify('script-window-error');
+ }
+
+ s = document.createElement("script");
+ s.id = "script-error-runtime";
+ s.textContent = "undefinedfn();";
+ document.body.appendChild(s);
+
+ finish('script-window-error');
+</script>
+
+<!-- Verify in setTimeout -->
+<script>
+ setTimeout(function() {
+ verify('timeout');
+ finish('timeout');
+ },0);
+</script>
+
+<!-- Verify in eval -->
+<script id="eval">
+ eval('verify("eval")');
+ finish("eval");
+</script>
+
+<!-- Verify in synchronous xhr -->
+<script id="xhr-test">
+ var request = new XMLHttpRequest();
+ request.open('GET','/',false);
+ request.send(null);
+
+ if(request.status === 200) {
+ verify('xhr-test');
+ finish('xhr-test');
+ }
+</script>
+
+<!-- Testing script within svg -->
+<svg>
+ <script id="script-svg">
+ verify('script-svg');
+ finish('script-svg');
+ </script>
+</svg>
+
+<!-- Test script async and defer -->
+<script id='script-async' async src='data:text/plain,verify("script-async"),finish("script-async")'></script>
+
+<script id='script-defer' defer src='data:text/plain,verify("script-defer"),finish("script-defer")'></script>
+
+<!-- Test async = false dynamic script loading -->
+<script>
+ var s = document.createElement("script");
+ s.id = "script-async-false";
+ s.src = "data:text/plain,verify('script-async-false');"
+ s.onload = function() {
+ finish('script-async-false');
+ }
+ s.async = false;
+ document.body.appendChild(s);
+</script>
+
+<!-- Verify in iframe javascript uri scheme -->
+<iframe src="javascript:parent.verify('iframe-src'),parent.finish('iframe-src')"
+ style="visibility:hidden;display:none">
+</iframe>
+
+<!-- Testing cross origin script -->
+<script>
+var s = document.createElement("script");
+s.id = "cross-origin";
+s.src = get_host_info(). HTTP_REMOTE_ORIGIN + "/html/dom/documents/dom-tree-accessors/cross-domain.js"
+s.onload = function() {
+ verify('cross-origin')
+ finish('cross-origin');
+}
+document.body.appendChild(s);
+
+</script>
+
+<!-- Testing document.write -->
+<script>
+document.write('<script id="document-write">verify("document-write"); finish("document-write");</' + 'script>');
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null-undef.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null-undef.html
new file mode 100644
index 000000000..dc132e5ec
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null-undef.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<title>getElementsByClassName and null/undefined</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-getelementsbyclassname">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<p id="p1"></p>
+<p class="undefined" id="p2"></p>
+<p class="null" id="p3"></p>
+<p class="undefined null" id="p4"></p>
+</div>
+<script>
+test(function() {
+ var wrapper = document.getElementById("test");
+ assert_equals(document.getElementsByClassName(undefined).length, 2);
+ assert_equals(document.getElementsByClassName(undefined)[0],
+ document.getElementById("p2"));
+ assert_equals(document.getElementsByClassName(undefined)[1],
+ document.getElementById("p4"));
+/*
+ assert_equals(document.getElementsByClassName(null).length, 2);
+ assert_equals(document.getElementsByClassName(null)[0],
+ document.getElementById("p3"));
+ assert_equals(document.getElementsByClassName(null)[1],
+ document.getElementById("p4"));
+*/
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Element.getElementsByClassName-null-undef.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Element.getElementsByClassName-null-undef.html
new file mode 100644
index 000000000..b4d924164
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Element.getElementsByClassName-null-undef.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<title>getElementsByClassName and null/undefined</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-getelementsbyclassname">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<p id="p1"></p>
+<p class="undefined" id="p2"></p>
+<p class="null" id="p3"></p>
+<p class="undefined null" id="p4"></p>
+</div>
+<script>
+test(function() {
+ var wrapper = document.getElementById("test");
+ assert_equals(wrapper.getElementsByClassName(undefined).length, 2);
+ assert_equals(wrapper.getElementsByClassName(undefined)[0],
+ document.getElementById("p2"));
+ assert_equals(wrapper.getElementsByClassName(undefined)[1],
+ document.getElementById("p4"));
+/*
+ assert_equals(wrapper.getElementsByClassName(null).length, 2);
+ assert_equals(wrapper.getElementsByClassName(null)[0],
+ document.getElementById("p3"));
+ assert_equals(wrapper.getElementsByClassName(null)[1],
+ document.getElementById("p4"));
+*/
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/cross-domain.js b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/cross-domain.js
new file mode 100644
index 000000000..32effe3c4
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/cross-domain.js
@@ -0,0 +1 @@
+//test script to check cross-domain script execution as in Document.currentScript.sub.html \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.embeds-document.plugins-01.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.embeds-document.plugins-01.html
new file mode 100644
index 000000000..b4fe36d24
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.embeds-document.plugins-01.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<title>document.embeds and document.plugins</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-embeds">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-plugins">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.embeds, document.embeds,
+ "embeds should be constant");
+ assert_equals(document.plugins, document.plugins,
+ "plugins should be constant");
+ assert_equals(document.embeds, document.plugins,
+ "embeds should be the same as plugins");
+ assert_equals(document.embeds.length, 0);
+ assert_equals(document.plugins.length, 0);
+}, "No plugins");
+
+test(function() {
+ var embed = document.body.appendChild(document.createElement("embed"));
+ this.add_cleanup(function() { document.body.removeChild(embed) });
+
+ assert_array_equals(document.embeds, [embed]);
+ assert_array_equals(document.plugins, [embed]);
+
+ assert_equals(document.embeds, document.embeds,
+ "embeds should be constant");
+ assert_equals(document.plugins, document.plugins,
+ "plugins should be constant");
+ assert_equals(document.embeds, document.plugins,
+ "embeds should be the same as plugins");
+}, "One plugin");
+
+test(function() {
+ var embed1 = document.createElement("embed"),
+ embed2 = document.createElement("embed");
+
+ document.body.appendChild(embed2);
+ this.add_cleanup(function() { document.body.removeChild(embed2) });
+ document.body.insertBefore(embed1, embed2);
+ this.add_cleanup(function() { document.body.removeChild(embed1) });
+
+ assert_array_equals(document.embeds, [embed1, embed2]);
+ assert_array_equals(document.plugins, [embed1, embed2]);
+
+ assert_equals(document.embeds, document.embeds,
+ "embeds should be constant");
+ assert_equals(document.plugins, document.plugins,
+ "plugins should be constant");
+ assert_equals(document.embeds, document.plugins,
+ "embeds should be the same as plugins");
+}, "Two plugins");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.forms.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.forms.html
new file mode 100644
index 000000000..e0689c7c7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.forms.html
@@ -0,0 +1,70 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Document.forms</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<form id="form1">
+<input type="button" name="thebutton" value="alpha">
+<input type=radio name=r1 value=a>
+<input type=radio name=r1 value=b>
+<input type=radio name=r1 value=c>
+<input type=radio name=r1 value=d>
+<input type=radio name=r1 value=e>
+</form>
+
+<form id="form2">
+<input type="button" name="thebutton" value="alpha">
+<input type=radio name=r1 value="a">
+<input type=radio name=r1 value="b">
+<input type=radio name=r1 value="c">
+<input type=radio name=r1 value="d">
+<input type=radio name=r1 value="e">
+</form>
+
+<form id=""></form>
+<script>
+test(function() {
+ assert_equals(document.forms.length, 3);
+ assert_equals(document.forms[0].id, "form1");
+ assert_equals(document.forms[1].id, "form2");
+ assert_equals(document.forms.form1.id, "form1");
+ assert_equals(document.forms.form2.id, "form2");
+ assert_equals(document.forms.item(0).id, "form1");
+ assert_equals(document.forms.item(1).id, "form2");
+ assert_equals(document.forms.namedItem("form1").id, "form1");
+ assert_equals(document.forms.namedItem("form2").id, "form2");
+}, "document.forms")
+
+test(function() {
+ // The `item` method takes one *numeric* argument. Passing a string to `item`
+ // results in that string getting converted to 0
+ assert_equals(document.forms.item("form1").id, "form1");
+ assert_equals(document.forms.item("form2").id, "form1");
+}, "document.forms.item with string arg")
+
+test(function() {
+ assert_equals(document.forms[""], undefined);
+ assert_equals(document.forms.namedItem(""), null);
+}, "document.forms with empty string")
+
+test(function() {
+ var result = [];
+ for (var p in document.forms) {
+ result.push(p);
+ }
+ // http://heycam.github.io/webidl/#property-enumeration
+ // If the object supports indexed properties, then the object’s supported
+ // property indices are enumerated first, in numerical order.
+ assert_array_equals(result.splice(0, 3), ["0", "1", "2"]);
+ // [...]
+ // Finally, any enumerable own properties or properties from the object’s
+ // prototype chain are then enumerated, in no defined order.
+ assert_array_equals(result.sort(), ["item", "namedItem", "length"].sort())
+}, "document.forms iteration")
+
+test(function() {
+ var result = Object.getOwnPropertyNames(document.forms);
+ assert_array_equals(result, ["0", "1", "2", "form1", "form2"])
+}, "document.forms getOwnPropertyNames")
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByClassName-same.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByClassName-same.html
new file mode 100644
index 000000000..a91c838d8
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByClassName-same.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<title>Calling getElementsByClassName with the same argument</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-getelementsbyclassname">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<div class="abcd"></div>
+</div>
+<script>
+test(function() {
+ var list1 = document.getElementsByClassName("abcd");
+ var list2 = document.getElementsByClassName("abcd");
+ assert_true(list1 === list2 || list1 !== list2);
+}, "The user agent may return the same object as the object returned by the earlier call.");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-case-xhtml.xhtml b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-case-xhtml.xhtml
new file mode 100644
index 000000000..f15edb6f1
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-case-xhtml.xhtml
@@ -0,0 +1,21 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>getElementsByName and case</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<div id="test">
+<div name="abcd"></div>
+</div>
+<script>
+test(function() {
+ assert_equals(document.getElementsByName("ABCD").length, 0);
+ assert_equals(document.getElementsByName("abcd").length, 1);
+});
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-case.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-case.html
new file mode 100644
index 000000000..9a82e6805
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-case.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<title>getElementsByName and case</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<div name="abcd"></div>
+</div>
+<script>
+test(function() {
+ assert_equals(document.getElementsByName("ABCD").length, 0);
+ assert_equals(document.getElementsByName("abcd").length, 1);
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-id-xhtml.xhtml b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-id-xhtml.xhtml
new file mode 100644
index 000000000..51b9e22f8
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-id-xhtml.xhtml
@@ -0,0 +1,20 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>getElementsByName and ids</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<div id="test">
+<div id="abcd"></div>
+</div>
+<script>
+test(function() {
+ assert_equals(document.getElementsByName("abcd").length, 0);
+});
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-id.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-id.html
new file mode 100644
index 000000000..099215d3a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-id.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<title>getElementsByName and ids</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<div id="abcd"></div>
+</div>
+<script>
+test(function() {
+ assert_equals(document.getElementsByName("abcd").length, 0);
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-interface.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-interface.html
new file mode 100644
index 000000000..97646e39c
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-interface.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<title>Document.getElementsByName: interfaces</title>
+<link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var collection = document.getElementsByName("name");
+ assert_class_string(collection, "NodeList");
+ assert_true(collection instanceof NodeList, "Should be a NodeList");
+ assert_false(collection instanceof HTMLCollection,
+ "Should not be a HTMLCollection");
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-namespace-xhtml.xhtml b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-namespace-xhtml.xhtml
new file mode 100644
index 000000000..e09ece7b1
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-namespace-xhtml.xhtml
@@ -0,0 +1,32 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>getElementsByName and foreign namespaces</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<div id="test">
+<p name="math"><math name="math" xmlns="http://www.w3.org/1998/Math/MathML">
+<mi>a</mi>
+<mo>+</mo>
+<mi>b</mi>
+</math></p>
+<p name="svg"><svg width="300" height="100" name="svg" xmlns="http://www.w3.org/2000/svg">
+<rect width="300" height="100" fill="rgb(0,0,255)"/>
+</svg></p>
+</div>
+<script>
+test(function() {
+ var ps = document.getElementById("test")
+ .getElementsByTagName("p");
+ assert_equals(document.getElementsByName("math").length, 1);
+ assert_equals(document.getElementsByName("math")[0], ps[0]);
+ assert_equals(document.getElementsByName("svg").length, 1);
+ assert_equals(document.getElementsByName("svg")[0], ps[1]);
+});
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-namespace.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-namespace.html
new file mode 100644
index 000000000..63b626042
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-namespace.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<title>getElementsByName and foreign namespaces</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<p name="math"><math name="math">
+<mi>a</mi>
+<mo>+</mo>
+<mi>b</mi>
+</math>
+<p name="svg"><svg width="300" height="100" name="svg">
+<rect width="300" height="100" fill="rgb(0,0,255)"/>
+</svg>
+</div>
+<script>
+test(function() {
+ var ps = document.getElementById("test")
+ .getElementsByTagName("p");
+ assert_equals(document.getElementsByName("math").length, 1);
+ assert_equals(document.getElementsByName("math")[0], ps[0]);
+ assert_equals(document.getElementsByName("svg").length, 1);
+ assert_equals(document.getElementsByName("svg")[0], ps[1]);
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-xhtml.xhtml b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-xhtml.xhtml
new file mode 100644
index 000000000..c2dc99a55
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-xhtml.xhtml
@@ -0,0 +1,126 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>getElementsByName and newly introduced HTML elements</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<div id="test">
+<section name="section"></section>
+<article name="article"></article>
+<aside name="aside"></aside>
+<hgroup name="hgroup"></hgroup>
+<header name="header"></header>
+<footer name="footer"></footer>
+<nav name="nav"></nav>
+<dialog name="dialog"></dialog>
+<figure name="figure"></figure>
+<audio name="audio"></audio>
+<video name="video"></video>
+<embed name="embed"></embed>
+<mark name="mark"></mark>
+<meter name="meter"></meter>
+<progress name="progress"></progress>
+<time name="time"></time>
+<canvas name="canvas"></canvas>
+<command name="command"></command>
+<menu name="menu"></menu>
+<details name="details"></details>
+<datalist name="datalist"></datalist>
+<keygen name="keygen"></keygen>
+<output name="output"></output>
+<ruby name="ruby"></ruby>
+<rt name="rt"></rt>
+<rp name="rp"></rp>
+<source name="source"/>
+</div>
+<script>
+test(function() {
+ assert_equals(document.getElementsByName("section").length, 1);
+ assert_equals(document.getElementsByName("section")[0],
+ document.getElementsByTagName("section")[0]);
+ assert_equals(document.getElementsByName("article").length, 1);
+ assert_equals(document.getElementsByName("article")[0],
+ document.getElementsByTagName("article")[0]);
+ assert_equals(document.getElementsByName("aside").length, 1);
+ assert_equals(document.getElementsByName("aside")[0],
+ document.getElementsByTagName("aside")[0]);
+ assert_equals(document.getElementsByName("hgroup").length, 1);
+ assert_equals(document.getElementsByName("hgroup")[0],
+ document.getElementsByTagName("hgroup")[0]);
+ assert_equals(document.getElementsByName("header").length, 1);
+ assert_equals(document.getElementsByName("header")[0],
+ document.getElementsByTagName("header")[0]);
+ assert_equals(document.getElementsByName("footer").length, 1);
+ assert_equals(document.getElementsByName("footer")[0],
+ document.getElementsByTagName("footer")[0]);
+ assert_equals(document.getElementsByName("nav").length, 1);
+ assert_equals(document.getElementsByName("nav")[0],
+ document.getElementsByTagName("nav")[0]);
+ assert_equals(document.getElementsByName("dialog").length, 1);
+ assert_equals(document.getElementsByName("dialog")[0],
+ document.getElementsByTagName("dialog")[0]);
+ assert_equals(document.getElementsByName("figure").length, 1);
+ assert_equals(document.getElementsByName("figure")[0],
+ document.getElementsByTagName("figure")[0]);
+ assert_equals(document.getElementsByName("audio").length, 1);
+ assert_equals(document.getElementsByName("audio")[0],
+ document.getElementsByTagName("audio")[0]);
+ assert_equals(document.getElementsByName("video").length, 1);
+ assert_equals(document.getElementsByName("video")[0],
+ document.getElementsByTagName("video")[0]);
+ assert_equals(document.getElementsByName("embed").length, 1);
+ assert_equals(document.getElementsByName("embed")[0],
+ document.getElementsByTagName("embed")[0]);
+ assert_equals(document.getElementsByName("mark").length, 1);
+ assert_equals(document.getElementsByName("mark")[0],
+ document.getElementsByTagName("mark")[0]);
+ assert_equals(document.getElementsByName("meter").length, 1);
+ assert_equals(document.getElementsByName("meter")[0],
+ document.getElementsByTagName("meter")[0]);
+ assert_equals(document.getElementsByName("progress").length, 1);
+ assert_equals(document.getElementsByName("progress")[0],
+ document.getElementsByTagName("progress")[0]);
+ assert_equals(document.getElementsByName("time").length, 1);
+ assert_equals(document.getElementsByName("time")[0],
+ document.getElementsByTagName("time")[0]);
+ assert_equals(document.getElementsByName("canvas").length, 1);
+ assert_equals(document.getElementsByName("canvas")[0],
+ document.getElementsByTagName("canvas")[0]);
+ assert_equals(document.getElementsByName("command").length, 1);
+ assert_equals(document.getElementsByName("command")[0],
+ document.getElementsByTagName("command")[0]);
+ assert_equals(document.getElementsByName("menu").length, 1);
+ assert_equals(document.getElementsByName("menu")[0],
+ document.getElementsByTagName("menu")[0]);
+ assert_equals(document.getElementsByName("details").length, 1);
+ assert_equals(document.getElementsByName("details")[0],
+ document.getElementsByTagName("details")[0]);
+ assert_equals(document.getElementsByName("datalist").length, 1);
+ assert_equals(document.getElementsByName("datalist")[0],
+ document.getElementsByTagName("datalist")[0]);
+ assert_equals(document.getElementsByName("keygen").length, 1);
+ assert_equals(document.getElementsByName("keygen")[0],
+ document.getElementsByTagName("keygen")[0]);
+ assert_equals(document.getElementsByName("output").length, 1);
+ assert_equals(document.getElementsByName("output")[0],
+ document.getElementsByTagName("output")[0]);
+ assert_equals(document.getElementsByName("ruby").length, 1);
+ assert_equals(document.getElementsByName("ruby")[0],
+ document.getElementsByTagName("ruby")[0]);
+ assert_equals(document.getElementsByName("rt").length, 1);
+ assert_equals(document.getElementsByName("rt")[0],
+ document.getElementsByTagName("rt")[0]);
+ assert_equals(document.getElementsByName("rp").length, 1);
+ assert_equals(document.getElementsByName("rp")[0],
+ document.getElementsByTagName("rp")[0]);
+ assert_equals(document.getElementsByName("source").length, 1);
+ assert_equals(document.getElementsByName("source")[0],
+ document.getElementsByTagName("source")[0]);
+});
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements.html
new file mode 100644
index 000000000..2ab42b973
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>getElementsByName and newly introduced HTML elements</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<section name="section"></section>
+<article name="article"></article>
+<aside name="aside"></aside>
+<hgroup name="hgroup"></hgroup>
+<header name="header"></header>
+<footer name="footer"></footer>
+<nav name="nav"></nav>
+<dialog name="dialog"></dialog>
+<figure name="figure"></figure>
+<audio name="audio"></audio>
+<video name="video"></video>
+<embed name="embed"></embed>
+<mark name="mark"></mark>
+<meter name="meter"></meter>
+<progress name="progress"></progress>
+<time name="time"></time>
+<canvas name="canvas"></canvas>
+<command name="command"></command>
+<menu name="menu"></menu>
+<details name="details"></details>
+<datalist name="datalist"></datalist>
+<keygen name="keygen"></keygen>
+<output name="output"></output>
+<ruby name="ruby"></ruby>
+<rt name="rt"></rt>
+<rp name="rp"></rp>
+<source name="source">
+</div>
+<script>
+var testDiv = document.getElementById("test");
+for (var i = 0; i < testDiv.children.length; i++) {
+ var name = testDiv.children[i].getAttribute("name");
+ test(function() {
+ assert_equals(document.getElementsByName(name).length, 1);
+ assert_equals(document.getElementsByName(name)[0],
+ document.getElementsByTagName(name)[0]);
+ }, 'getElementsByName("' + name + '")');
+}
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-null-undef-xhtml.xhtml b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-null-undef-xhtml.xhtml
new file mode 100644
index 000000000..9e79c84da
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-null-undef-xhtml.xhtml
@@ -0,0 +1,35 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Calling getElementsByName with null and undefined</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname"/>
+<link rel="help" href="https://heycam.github.io/webidl/#es-DOMString"/>
+<link rel="help" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf#page=57"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+test(function() {
+ var n = document.createElement("div");
+ n.setAttribute("name", "null");
+
+ document.body.appendChild(n);
+ this.add_cleanup(function() { document.body.removeChild(n) });
+
+ assert_equals(document.getElementsByName(null)[0], n);
+}, "getElementsByName(null)");
+
+test(function() {
+ var u = document.createElement("div");
+ u.setAttribute("name", "undefined");
+
+ document.body.appendChild(u);
+ this.add_cleanup(function() { document.body.removeChild(u) });
+
+ assert_equals(document.getElementsByName(undefined)[0], u);
+}, "getElementsByName(undefined)");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-null-undef.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-null-undef.html
new file mode 100644
index 000000000..72734aeda
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-null-undef.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<title>Calling getElementsByName with null and undefined</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname">
+<link rel="help" href="https://heycam.github.io/webidl/#es-DOMString">
+<link rel="help" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf#page=57">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var n = document.createElement("div");
+ n.setAttribute("name", "null");
+
+ document.body.appendChild(n);
+ this.add_cleanup(function() { document.body.removeChild(n) });
+
+ assert_equals(document.getElementsByName(null)[0], n);
+}, "getElementsByName(null)");
+
+test(function() {
+ var u = document.createElement("div");
+ u.setAttribute("name", "undefined");
+
+ document.body.appendChild(u);
+ this.add_cleanup(function() { document.body.removeChild(u) });
+
+ assert_equals(document.getElementsByName(undefined)[0], u);
+}, "getElementsByName(undefined)");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-param-xhtml.xhtml b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-param-xhtml.xhtml
new file mode 100644
index 000000000..e57e9d5c0
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-param-xhtml.xhtml
@@ -0,0 +1,28 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>getElementsByName and the param element</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<div id="test">
+<param name="test1"/>
+<object>
+<param name="test2"/>
+</object>
+</div>
+<script>
+test(function() {
+ assert_equals(document.getElementsByName("test1").length, 1);
+ assert_equals(document.getElementsByName("test1")[0],
+ document.getElementsByTagName("param")[0]);
+ assert_equals(document.getElementsByName("test2").length, 1);
+ assert_equals(document.getElementsByName("test2")[0],
+ document.getElementsByTagName("param")[1]);
+});
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-param.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-param.html
new file mode 100644
index 000000000..aa1bb01bf
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-param.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<title>getElementsByName and the param element</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<param name="test1">
+<object>
+<param name="test2">
+</object>
+</div>
+<script>
+test(function() {
+ assert_equals(document.getElementsByName("test1").length, 1);
+ assert_equals(document.getElementsByName("test1")[0],
+ document.getElementsByTagName("param")[0]);
+ assert_equals(document.getElementsByName("test2").length, 1);
+ assert_equals(document.getElementsByName("test2")[0],
+ document.getElementsByTagName("param")[1]);
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-same.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-same.html
new file mode 100644
index 000000000..f122857a2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-same.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<title>Calling getElementsByName with the same argument</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<div name="abcd"></div>
+</div>
+<script>
+test(function() {
+ var list1 = document.getElementsByName("abcd");
+ var list2 = document.getElementsByName("abcd");
+ assert_true(list1 === list2 || list1 !== list2);
+}, "The user agent may return the same object as the object returned by the earlier call.");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.head-01.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.head-01.html
new file mode 100644
index 000000000..f919d79a3
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.head-01.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<title>document.head</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-head">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var head = document.getElementsByTagName("head")[0];
+ assert_equals(document.head, head);
+ document.head = "";
+ assert_equals(document.head, head);
+ document.head = document.createElement("head");
+ assert_equals(document.head, head);
+ document.documentElement.appendChild(document.createElement("head"));
+ assert_equals(document.head, head);
+ var head2 = document.createElement("head");
+ document.documentElement.insertBefore(head2, head);
+ assert_equals(document.head, head2);
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.head-02.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.head-02.html
new file mode 100644
index 000000000..d0189574e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.head-02.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<title>document.head</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-head">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var HTML = "http://www.w3.org/1999/xhtml";
+test(function() {
+ var head = document.getElementsByTagName("head")[0];
+ assert_equals(document.head, head);
+ var head2 = document.createElementNS(HTML, "blah:head");
+ document.documentElement.insertBefore(head2, head);
+ assert_equals(document.head, head2);
+ var head3 = document.createElementNS("http://www.example.org/", "blah:head");
+ document.documentElement.insertBefore(head3, head2);
+ assert_equals(document.head, head2);
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.images.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.images.html
new file mode 100644
index 000000000..558fdebc3
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.images.html
@@ -0,0 +1,105 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Document.images</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<div id=test>
+<img>
+<img id=x><img name=y><img id=z1 name=z2>
+<img id=a><img id=a>
+<img name=b><img name=b>
+<img id=><img name=>
+<input type=image name=input>
+</div>
+<script>
+function assert_all(aAssertFunc, aCollection) {
+ for (var i = 0; i < aCollection.length; ++i) {
+ aAssertFunc(aCollection[i]);
+ }
+}
+
+var XHTML = "http://www.w3.org/1999/xhtml";
+var div, images, c;
+
+setup(function() {
+ div = document.getElementById("test");
+ var foreign =
+ div.appendChild(document.createElementNS("http://example.org", "img"));
+ foreign.setAttribute("id", "f");
+
+ images = [].slice.call(div.getElementsByTagNameNS(XHTML, "img"));
+
+ c = document.images;
+});
+
+test(function() {
+ assert_equals(c.length, 10);
+ assert_array_equals(c, images);
+
+ assert_all(function (aElement) {
+ assert_equals(aElement.namespaceURI, XHTML);
+ }, c);
+}, "document.images should contain all HTML img elements");
+
+test(function() {
+ assert_equals(c.x, images[1]);
+ assert_equals(c.namedItem("x"), images[1]);
+ assert_true("x" in c, '"x" in c');
+}, "img with id");
+
+test(function() {
+ assert_equals(c.y, images[2]);
+ assert_equals(c.namedItem("y"), images[2]);
+ assert_true("y" in c, '"y" in c');
+}, "img with name");
+
+test(function() {
+ assert_equals(c.z1, images[3]);
+ assert_equals(c.namedItem("z1"), images[3]);
+ assert_true("z1" in c, '"z1" in c');
+ assert_equals(c.z2, images[3]);
+ assert_equals(c.namedItem("z2"), images[3]);
+ assert_true("z2" in c, '"z2" in c');
+}, "img with id and name");
+
+test(function() {
+ assert_equals(c.a, images[4]);
+ assert_equals(c.namedItem("a"), images[4]);
+ assert_true("a" in c, '"a" in c');
+}, "Two img elements with the same id");
+
+test(function() {
+ assert_equals(c.b, images[6]);
+ assert_equals(c.namedItem("b"), images[6]);
+ assert_true("b" in c, '"b" in c');
+}, "Two img elements with the same name");
+
+test(function() {
+ assert_equals(c.c, undefined);
+ assert_equals(c.namedItem("c"), null);
+ assert_false("c" in c, '"c" in c');
+}, "Unknown name should not be in the collection");
+
+test(function() {
+ assert_equals(c.f, undefined);
+ assert_equals(c.namedItem("f"), null);
+ assert_false("f" in c, '"f" in c');
+}, "Foreign element should not be in the collection");
+
+test(function() {
+ assert_equals(c.input, undefined);
+ assert_equals(c.namedItem("input"), null);
+ assert_false("input" in c, '"input" in c');
+ var input = div.getElementsByTagName("input")[0];
+ assert_all(function (aElement) {
+ assert_not_equals(aElement.namespaceURI, input);
+ }, c);
+}, "Input elements should not be in the collection");
+
+test(function() {
+ assert_equals(c[""], undefined);
+ assert_equals(c.namedItem(""), null);
+ assert_false("" in c, '"" in c');
+}, "The empty string should not be in the collections");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-01.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-01.html
new file mode 100644
index 000000000..05ddab9ca
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-01.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<title>document.title with head blown away</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#document.title">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.title, "document.title with head blown away");
+})
+test(function() {
+ var head = document.getElementsByTagName("head")[0];
+ assert_true(!!head, "Head gone?!")
+ head.parentNode.removeChild(head);
+ assert_false(!!document.getElementsByTagName("head")[0], "Head still there?!")
+ document.title = "FAIL";
+ assert_equals(document.title, "");
+})
+test(function() {
+ var title2 = document.createElement("title");
+ title2.appendChild(document.createTextNode("PASS"));
+ document.body.appendChild(title2);
+ assert_equals(document.title, "PASS");
+})
+test(function() {
+ var title3 = document.createElement("title");
+ title3.appendChild(document.createTextNode("PASS2"));
+ document.documentElement.insertBefore(title3, document.body);
+ assert_equals(document.title, "PASS2");
+})
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-02.xhtml b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-02.xhtml
new file mode 100644
index 000000000..917b8787d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-02.xhtml
@@ -0,0 +1,37 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>document.title with head blown away</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#document.title"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.title, "document.title with head blown away");
+})
+test(function() {
+ var head = document.getElementsByTagName("head")[0];
+ assert_true(!!head, "Head gone?!")
+ head.parentNode.removeChild(head);
+ assert_false(!!document.getElementsByTagName("head")[0], "Head still there?!")
+ document.title = "FAIL";
+ assert_equals(document.title, "");
+})
+test(function() {
+ var title2 = document.createElement("title");
+ title2.appendChild(document.createTextNode("PASS"));
+ document.body.appendChild(title2);
+ assert_equals(document.title, "PASS");
+})
+test(function() {
+ var title3 = document.createElement("title");
+ title3.appendChild(document.createTextNode("PASS2"));
+ document.documentElement.insertBefore(title3, document.body);
+ assert_equals(document.title, "PASS2");
+})
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-03.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-03.html
new file mode 100644
index 000000000..952c29db5
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-03.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<title> document.title and space normalization </title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#document.title">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+function test_title(set, expected) {
+ test(function() {
+ document.title = set;
+ assert_equals(document.title, expected);
+ }, "document.title after setting to " + format_value(set));
+}
+
+test(function() {
+ // Single space characters must be normalized. (WHATWG r4353)
+ assert_equals(document.title, "document.title and space normalization");
+}, "document.title initial value");
+
+test_title("one space", "one space");
+test_title("two spaces", "two spaces");
+test_title("one\ttab", "one tab");
+test_title("two\t\ttabs", "two tabs");
+test_title("one\nnewline", "one newline");
+test_title("two\n\nnewlines", "two newlines");
+test_title("one\fform feed", "one form feed");
+test_title("two\f\fform feeds", "two form feeds");
+test_title("one\rcarriage return", "one carriage return");
+test_title("two\r\rcarriage returns", "two carriage returns");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-04.xhtml b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-04.xhtml
new file mode 100644
index 000000000..fbe891650
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-04.xhtml
@@ -0,0 +1,48 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title> document.title and space normalization </title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#document.title"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+test(function() {
+ // Single space characters must be normalized. (WHATWG r4353)
+ assert_equals(document.title, "document.title and space normalization");
+
+ document.title = "one space";
+ assert_equals(document.title, "one space");
+
+ document.title = "two spaces";
+ assert_equals(document.title, "two spaces");
+
+ document.title = "one\ttab";
+ assert_equals(document.title, "one tab");
+
+ document.title = "two\t\ttabs";
+ assert_equals(document.title, "two tabs");
+
+ document.title = "one\nnewline";
+ assert_equals(document.title, "one newline");
+
+ document.title = "two\n\nnewlines";
+ assert_equals(document.title, "two newlines");
+
+ document.title = "one\fform feed";
+ assert_equals(document.title, "one form feed");
+
+ document.title = "two\f\fform feeds";
+ assert_equals(document.title, "two form feeds");
+
+ document.title = "one\rcarriage return";
+ assert_equals(document.title, "one carriage return");
+
+ document.title = "two\r\rcarriage returns";
+ assert_equals(document.title, "two carriage returns");
+});
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-05.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-05.html
new file mode 100644
index 000000000..df6ffc30f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-05.html
@@ -0,0 +1,42 @@
+<!doctype html>
+<title>document.title and White_Space characters</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#document.title">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var White_Space = [
+ "\u000B",
+ "\u0085",
+ "\u00A0",
+ "\u1680",
+ "\u180E",
+ "\u2000",
+ "\u2001",
+ "\u2002",
+ "\u2003",
+ "\u2004",
+ "\u2005",
+ "\u2006",
+ "\u2007",
+ "\u2008",
+ "\u2009",
+ "\u200A",
+ "\u2028",
+ "\u2029",
+ "\u202F",
+ "\u205F",
+ "\u3000"
+];
+
+White_Space.forEach(function(character, i) {
+ test(function() {
+ var s = character + "a" + character + character + "b" + character + "c" +
+ String(i) + character;
+ document.title = s;
+ assert_equals(document.title, s);
+ }, "Removing whitespace in document.title: U+" +
+ character.charCodeAt(0).toString(16));
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-06.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-06.html
new file mode 100644
index 000000000..a80723f23
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-06.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.title and the empty string</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#document.title">
+<meta name="assert" content="On setting document.title to the empty string, no text node must be created.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var head = document.documentElement.firstChild;
+ head.removeChild(head.firstChild);
+ assert_equals(document.title, "");
+ document.title = "";
+ assert_equals(document.title, "");
+ assert_true(head.lastChild instanceof HTMLTitleElement, "Need a title element.");
+ assert_equals(head.lastChild.firstChild, null);
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-07.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-07.html
new file mode 100644
index 000000000..9723d3f81
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-07.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Document.title and DOMImplementation.createHTMLDocument</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/dom/nodes/DOMImplementation-createHTMLDocument.js"></script>
+<div id="log"></div>
+<script>
+createHTMLDocuments(function(doc, expectedtitle, normalizedtitle) {
+ assert_equals(doc.title, normalizedtitle)
+})
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-08.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-08.html
new file mode 100644
index 000000000..a643b75f4
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-08.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#document.title">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.title, "");
+}, "No title element");
+
+test(function() {
+ var title = document.createElement("title");
+ title.appendChild(document.createTextNode("PASS"));
+ document.head.appendChild(title);
+ assert_equals(document.title, "PASS");
+
+ title.appendChild(document.createTextNode("PASS2"));
+ title.appendChild(document.createTextNode("PASS3"));
+ assert_equals(document.title, "PASSPASS2PASS3");
+}, "title element contains multiple child text nodes");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-09.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-09.html
new file mode 100644
index 000000000..a3273f626
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-09.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#document.title">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
+var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
+
+function newSVGDocument() {
+ return document.implementation.createDocument(SVG_NAMESPACE, "svg", null);
+}
+
+function assertIsSVGTitle(element, expectedText) {
+ assert_equals(element.namespaceURI, SVG_NAMESPACE);
+ assert_equals(element.localName, "title");
+ assert_equals(element.textContent, expectedText);
+}
+
+test(function() {
+ var doc = newSVGDocument();
+ assert_equals(doc.title, "");
+ var child = doc.createElementNS(SVG_NAMESPACE, "x-child");
+ doc.documentElement.appendChild(child);
+ doc.title = "foo";
+ assertIsSVGTitle(doc.documentElement.firstChild, "foo");
+ assert_equals(doc.title, "foo");
+}, "No title element in SVG document");
+
+test(function() {
+ var doc = newSVGDocument();
+ var title = doc.createElementNS(SVG_NAMESPACE, "title");
+ title.textContent = "foo";
+ doc.documentElement.appendChild(title)
+ assert_equals(doc.title, "foo");
+ doc.title += "bar";
+ assert_equals(title.textContent, "foobar");
+ assert_equals(title.childNodes.length, 1);
+ assert_true(title.childNodes[0] instanceof Text);
+ assert_equals(doc.title, "foobar");
+ doc.title = "";
+ assert_equals(title.textContent, "");
+ assert_equals(doc.title, "");
+ assert_equals(title.childNodes.length, 0);
+}, "Title element in SVG document");
+
+test(function() {
+ var doc = newSVGDocument();
+ var title = doc.createElementNS(SVG_NAMESPACE, "title");
+ title.textContent = "foo";
+ var child = doc.createElementNS(SVG_NAMESPACE, "x-child");
+ child.appendChild(title);
+ doc.documentElement.appendChild(child);
+ assert_equals(doc.title, "");
+
+ // Now test that on setting, we create a new element and don't change the
+ // existing one
+ doc.title = "bar";
+ assert_equals(title.textContent, "foo");
+ assertIsSVGTitle(doc.documentElement.firstChild, "bar");
+ assert_equals(doc.title, "bar");
+}, "Title element not child of SVG root");
+
+test(function() {
+ var doc = newSVGDocument();
+ var title = doc.createElementNS(HTML_NAMESPACE, "title");
+ title.textContent = "foo";
+ doc.documentElement.appendChild(title);
+ assert_equals(doc.title, "");
+}, "Title element not in SVG namespace");
+
+test(function() {
+ // "SVG" != "svg"
+ var doc = document.implementation.createDocument(SVG_NAMESPACE, "SVG", null);
+
+ // Per spec, this does nothing
+ doc.title = "foo";
+ assert_equals(doc.documentElement.childNodes.length, 0);
+ assert_equals(doc.title, "");
+
+ // An SVG title is ignored by .title
+ doc.documentElement.appendChild(doc.createElementNS(SVG_NAMESPACE, "title"));
+ doc.documentElement.lastChild.textContent = "foo";
+ assert_equals(doc.title, "");
+
+ // But an HTML title is respected
+ doc.documentElement.appendChild(doc.createElementNS(HTML_NAMESPACE, "title"));
+ doc.documentElement.lastChild.textContent = "bar";
+ assert_equals(doc.title, "bar");
+
+ // Even if it's not a child of the root
+ var div = doc.createElementNS(HTML_NAMESPACE, "div");
+ div.appendChild(doc.documentElement.lastChild);
+ doc.documentElement.appendChild(div);
+ assert_equals(doc.title, "bar");
+}, 'Root element not named "svg"');
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-01.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-01.html
new file mode 100644
index 000000000..2b428aa65
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-01.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Named items: img id &amp; name</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-nameditem">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<img id="a" name="b">
+</div>
+<script>
+test(function() {
+ assert_equals(document.a, document.getElementsByTagName("img")[0]);
+ assert_equals(document['a'], document.getElementsByTagName("img")[0]);
+ assert_equals(document.b, document.getElementsByTagName("img")[0]);
+ assert_equals(document['b'], document.getElementsByTagName("img")[0]);
+}, "img elements that have a name and id attribute, should be accessible by both values.");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-02.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-02.html
new file mode 100644
index 000000000..8c3155e7e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-02.html
@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Named items: iframes</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-nameditem">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<iframe name="test1"></iframe>
+
+<iframe name="test2"></iframe>
+<iframe name="test2"></iframe>
+
+<iframe name="test3"></iframe>
+<img name="test3">
+
+<img name="test4">
+<iframe name="test4"></iframe>
+
+<iframe id="test5"></iframe>
+
+<iframe name="test6" id="fail"></iframe>
+
+<iframe name="fail" id="test7"></iframe>
+
+<iframe name="42"></iframe>
+</div>
+<script>
+test(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ assert_equals(iframe.name, "test1");
+
+ assert_true("test1" in document, '"test1" in document should be true');
+ assert_equals(document.test1, iframe.contentWindow);
+}, "If the only named item is an iframe, the contentWindow should be returned.");
+
+test(function() {
+ var iframe1 = document.getElementsByTagName("iframe")[1];
+ assert_equals(iframe1.name, "test2");
+ var iframe2 = document.getElementsByTagName("iframe")[2];
+ assert_equals(iframe2.name, "test2");
+
+ assert_true("test2" in document, '"test2" in document should be true');
+ var collection = document.test2;
+ assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
+ assert_array_equals(collection, [iframe1, iframe2]);
+}, "If there are two iframes, a collection should be returned.");
+
+test(function() {
+ var iframe = document.getElementsByTagName("iframe")[3];
+ assert_equals(iframe.name, "test3");
+ var img = document.getElementsByTagName("img")[0];
+ assert_equals(img.name, "test3");
+
+ assert_true("test3" in document, '"test3" in document should be true');
+ var collection = document.test3;
+ assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
+ assert_array_equals(collection, [iframe, img]);
+}, "If there are an iframe and another element (iframe first), a collection should be returned.");
+
+test(function() {
+ var iframe = document.getElementsByTagName("iframe")[4];
+ assert_equals(iframe.name, "test4");
+ var img = document.getElementsByTagName("img")[1];
+ assert_equals(img.name, "test4");
+
+ assert_true("test4" in document, '"test4" in document should be true');
+ var collection = document.test4;
+ assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
+ assert_array_equals(collection, [img, iframe]);
+}, "If there are an iframe and another element (iframe last), a collection should be returned.");
+
+test(function() {
+ assert_false("test5" in document, '"test5" in document should be false');
+ assert_equals(document.test5, undefined);
+}, "If an iframe has an id and no name, it should not be returned.");
+
+test(function() {
+ var iframe = document.getElementsByTagName("iframe")[6];
+ assert_equals(iframe.name, "test6");
+
+ assert_true("test6" in document, '"test6" in document should be true');
+ assert_equals(document.test6, iframe.contentWindow);
+}, "If an iframe has a name and a different id, it should be returned by its name.");
+
+test(function() {
+ assert_false("test7" in document, '"test7" in document should be false');
+ assert_equals(document.test7, undefined);
+}, "If an iframe has an id and a different name, it should not be returned by its id.");
+
+test(function() {
+ var iframe = document.getElementsByTagName("iframe")[8];
+ assert_equals(iframe.name, "42");
+
+ assert_true(42 in document, '42 in document should be true');
+ assert_equals(document[42], iframe.contentWindow);
+}, "An iframe whose name looks like an array index should work.");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-03.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-03.html
new file mode 100644
index 000000000..4c330b6a3
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-03.html
@@ -0,0 +1,110 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Named items: applets</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-nameditem">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<applet name=test1></applet>
+
+<applet name=test2></applet>
+<applet name=test2></applet>
+
+<applet id=test3></applet>
+
+<applet id=test4></applet>
+<applet id=test4></applet>
+
+<applet name=test5></applet>
+<applet id=test5></applet>
+
+<applet id=test6></applet>
+<applet name=test6></applet>
+
+<applet id=test7 name=fail></applet>
+
+<applet name=test8 id=fail></applet>
+</div>
+<script>
+test(function() {
+ var applet = document.getElementsByTagName("applet")[0];
+ assert_equals(applet.name, "test1");
+
+ assert_true("test1" in document, '"test1" in document should be true');
+ assert_equals(document.test1, applet);
+}, "If there is one applet, it should be returned (name)");
+
+test(function() {
+ var applet1 = document.getElementsByTagName("applet")[1];
+ assert_equals(applet1.name, "test2");
+ var applet2 = document.getElementsByTagName("applet")[2];
+ assert_equals(applet2.name, "test2");
+
+ assert_true("test2" in document, '"test2" in document should be true');
+ var collection = document.test2;
+ assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
+ assert_array_equals(collection, [applet1, applet2]);
+}, "If there are two applets, a collection should be returned. (name)");
+
+test(function() {
+ var applet = document.getElementsByTagName("applet")[3];
+ assert_equals(applet.id, "test3");
+
+ assert_true("test3" in document, '"test3" in document should be true');
+ assert_equals(document.test3, applet);
+}, "If there is one applet, it should be returned (id)");
+
+test(function() {
+ var applet1 = document.getElementsByTagName("applet")[4];
+ assert_equals(applet1.id, "test4");
+ var applet2 = document.getElementsByTagName("applet")[5];
+ assert_equals(applet2.id, "test4");
+
+ assert_true("test4" in document, '"test4" in document should be true');
+ var collection = document.test4;
+ assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
+ assert_array_equals(collection, [applet1, applet2]);
+}, "If there are two applets, a collection should be returned. (id)");
+
+test(function() {
+ var applet1 = document.getElementsByTagName("applet")[6];
+ assert_equals(applet1.name, "test5");
+ var applet2 = document.getElementsByTagName("applet")[7];
+ assert_equals(applet2.id, "test5");
+
+ assert_true("test5" in document, '"test5" in document should be true');
+ var collection = document.test5;
+ assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
+ assert_array_equals(collection, [applet1, applet2]);
+}, "If there are two applets, a collection should be returned. (name and id)");
+
+test(function() {
+ var applet1 = document.getElementsByTagName("applet")[8];
+ assert_equals(applet1.id, "test6");
+ var applet2 = document.getElementsByTagName("applet")[9];
+ assert_equals(applet2.name, "test6");
+
+ assert_true("test6" in document, '"test6" in document should be true');
+ var collection = document.test6;
+ assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
+ assert_array_equals(collection, [applet1, applet2]);
+}, "If there are two applets, a collection should be returned. (id and name)");
+
+test(function() {
+ var applet = document.getElementsByTagName("applet")[10];
+ assert_equals(applet.id, "test7");
+
+ assert_true("test7" in document, '"test7" in document should be true');
+ assert_equals(document.test7, applet);
+}, "A name shouldn't affect getting an applet by id");
+
+test(function() {
+ var applet = document.getElementsByTagName("applet")[11];
+ assert_equals(applet.name, "test8");
+
+ assert_true("test8" in document, '"test8" in document should be true');
+ assert_equals(document.test8, applet);
+}, "An id shouldn't affect getting an applet by name");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-04.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-04.html
new file mode 100644
index 000000000..b7c3ef8e9
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-04.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Named items: forms</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-nameditem">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<form name=test1></form>
+
+<form name=test2></form>
+<form name=test2></form>
+
+<form id=test3></form>
+
+<form id=test4></form>
+<form id=test4></form>
+
+<form name=test5></form>
+<form id=test5></form>
+
+<form id=test6></form>
+<form name=test6></form>
+
+<form id=test7 name=fail></form>
+
+<form name=test8 id=fail></form>
+</div>
+<script>
+test(function() {
+ var form = document.getElementsByTagName("form")[0];
+ assert_equals(form.name, "test1");
+
+ assert_true("test1" in document, '"test1" in document should be true');
+ assert_equals(document.test1, form);
+}, "If there is one form, it should be returned (name)");
+
+test(function() {
+ var form1 = document.getElementsByTagName("form")[1];
+ assert_equals(form1.name, "test2");
+ var form2 = document.getElementsByTagName("form")[2];
+ assert_equals(form2.name, "test2");
+
+ assert_true("test2" in document, '"test2" in document should be true');
+ var collection = document.test2;
+ assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
+ assert_array_equals(collection, [form1, form2]);
+}, "If there are two forms, a collection should be returned. (name)");
+
+test(function() {
+ var form = document.getElementsByTagName("form")[3];
+ assert_equals(form.id, "test3");
+
+ assert_false("test3" in document, '"test3" in document should be false');
+ assert_equals(document.test3, undefined);
+}, "If there is one form, it should not be returned (id)");
+
+test(function() {
+ var form1 = document.getElementsByTagName("form")[4];
+ assert_equals(form1.id, "test4");
+ var form2 = document.getElementsByTagName("form")[5];
+ assert_equals(form2.id, "test4");
+
+ assert_false("test4" in document, '"test4" in document should be false');
+ assert_equals(document.test4, undefined);
+}, "If there are two forms, nothing should be returned. (id)");
+
+test(function() {
+ var form1 = document.getElementsByTagName("form")[6];
+ assert_equals(form1.name, "test5");
+ var form2 = document.getElementsByTagName("form")[7];
+ assert_equals(form2.id, "test5");
+
+ assert_true("test5" in document, '"test5" in document should be true');
+ assert_equals(document.test5, form1);
+}, "If there are two forms, a collection should be returned. (name and id)");
+
+test(function() {
+ var form1 = document.getElementsByTagName("form")[8];
+ assert_equals(form1.id, "test6");
+ var form2 = document.getElementsByTagName("form")[9];
+ assert_equals(form2.name, "test6");
+
+ assert_true("test6" in document, '"test6" in document should be true');
+ assert_equals(document.test6, form2);
+}, "If there are two forms, a collection should be returned. (id and name)");
+
+test(function() {
+ var form = document.getElementsByTagName("form")[10];
+ assert_equals(form.id, "test7");
+
+ assert_false("test7" in document, '"test7" in document should be false');
+ assert_equals(document.test7, undefined);
+}, "A name shouldn't affect getting an form by id");
+
+test(function() {
+ var form = document.getElementsByTagName("form")[11];
+ assert_equals(form.name, "test8");
+
+ assert_true("test8" in document, '"test8" in document should be true');
+ assert_equals(document.test8, form);
+}, "An id shouldn't affect getting an form by name");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-05.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-05.html
new file mode 100644
index 000000000..843ce3579
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-05.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Named items: embeds</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-nameditem">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<embed name=test1></embed>
+
+<embed name=test2></embed>
+<embed name=test2></embed>
+
+<embed id=test3></embed>
+
+<embed id=test4></embed>
+<embed id=test4></embed>
+
+<embed name=test5></embed>
+<embed id=test5></embed>
+
+<embed id=test6></embed>
+<embed name=test6></embed>
+
+<embed id=test7 name=fail></embed>
+
+<embed name=test8 id=fail></embed>
+</div>
+<script>
+test(function() {
+ var embed = document.getElementsByTagName("embed")[0];
+ assert_equals(embed.name, "test1");
+
+ assert_true("test1" in document, '"test1" in document should be true');
+ assert_equals(document.test1, embed);
+}, "If there is one embed, it should be returned (name)");
+
+test(function() {
+ var embed1 = document.getElementsByTagName("embed")[1];
+ assert_equals(embed1.name, "test2");
+ var embed2 = document.getElementsByTagName("embed")[2];
+ assert_equals(embed2.name, "test2");
+
+ assert_true("test2" in document, '"test2" in document should be true');
+ var collection = document.test2;
+ assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
+ assert_array_equals(collection, [embed1, embed2]);
+}, "If there are two embeds, a collection should be returned. (name)");
+
+test(function() {
+ var embed = document.getElementsByTagName("embed")[3];
+ assert_equals(embed.id, "test3");
+
+ assert_false("test3" in document, '"test3" in document should be false');
+ assert_equals(document.test3, undefined);
+}, "If there is one embed, it should not be returned (id)");
+
+test(function() {
+ var embed1 = document.getElementsByTagName("embed")[4];
+ assert_equals(embed1.id, "test4");
+ var embed2 = document.getElementsByTagName("embed")[5];
+ assert_equals(embed2.id, "test4");
+
+ assert_false("test4" in document, '"test4" in document should be false');
+ assert_equals(document.test4, undefined);
+}, "If there are two embeds, nothing should be returned. (id)");
+
+test(function() {
+ var embed1 = document.getElementsByTagName("embed")[6];
+ assert_equals(embed1.name, "test5");
+ var embed2 = document.getElementsByTagName("embed")[7];
+ assert_equals(embed2.id, "test5");
+
+ assert_true("test5" in document, '"test5" in document should be true');
+ assert_equals(document.test5, embed1);
+}, "If there are two embeds, a collection should be returned. (name and id)");
+
+test(function() {
+ var embed1 = document.getElementsByTagName("embed")[8];
+ assert_equals(embed1.id, "test6");
+ var embed2 = document.getElementsByTagName("embed")[9];
+ assert_equals(embed2.name, "test6");
+
+ assert_true("test6" in document, '"test6" in document should be true');
+ assert_equals(document.test6, embed2);
+}, "If there are two embeds, a collection should be returned. (id and name)");
+
+test(function() {
+ var embed = document.getElementsByTagName("embed")[10];
+ assert_equals(embed.id, "test7");
+
+ assert_false("test7" in document, '"test7" in document should be false');
+ assert_equals(document.test7, undefined);
+}, "A name shouldn't affect getting an embed by id");
+
+test(function() {
+ var embed = document.getElementsByTagName("embed")[11];
+ assert_equals(embed.name, "test8");
+
+ assert_true("test8" in document, '"test8" in document should be true');
+ assert_equals(document.test8, embed);
+}, "An id shouldn't affect getting an embed by name");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-06.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-06.html
new file mode 100644
index 000000000..15a72b5f6
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-06.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Named items: imgs</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-nameditem">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<img name=test1>
+
+<img name=test2>
+<img name=test2>
+
+<img id=test3>
+
+<img id=test4>
+<img id=test4 name="">
+
+<img name=test5>
+<img id=test5>
+
+<img id=test6>
+<img name=test6>
+
+<img id=test7 name=fail>
+
+<img name=test8 id=fail>
+</div>
+<script>
+test(function() {
+ var img = document.getElementsByTagName("img")[0];
+ assert_equals(img.name, "test1");
+
+ assert_true("test1" in document, '"test1" in document should be true');
+ assert_equals(document.test1, img);
+}, "If there is one img, it should be returned (name)");
+
+test(function() {
+ var img1 = document.getElementsByTagName("img")[1];
+ assert_equals(img1.name, "test2");
+ var img2 = document.getElementsByTagName("img")[2];
+ assert_equals(img2.name, "test2");
+
+ assert_true("test2" in document, '"test2" in document should be true');
+ var collection = document.test2;
+ assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
+ assert_array_equals(collection, [img1, img2]);
+}, "If there are two imgs, a collection should be returned. (name)");
+
+test(function() {
+ var img = document.getElementsByTagName("img")[3];
+ assert_equals(img.id, "test3");
+
+ assert_false("test3" in document, '"test3" in document should be false');
+ assert_equals(document.test3, undefined);
+}, "If there is one img, it should not be returned (id)");
+
+test(function() {
+ var img1 = document.getElementsByTagName("img")[4];
+ assert_equals(img1.id, "test4");
+ var img2 = document.getElementsByTagName("img")[5];
+ assert_equals(img2.id, "test4");
+
+ assert_false("test4" in document, '"test4" in document should be false');
+ assert_equals(document.test4, undefined);
+}, "If there are two imgs, nothing should be returned. (id)");
+
+test(function() {
+ var img1 = document.getElementsByTagName("img")[6];
+ assert_equals(img1.name, "test5");
+ var img2 = document.getElementsByTagName("img")[7];
+ assert_equals(img2.id, "test5");
+
+ assert_true("test5" in document, '"test5" in document should be true');
+ assert_equals(document.test5, img1);
+}, "If there are two imgs, the one with a name should be returned. (name and id)");
+
+test(function() {
+ var img1 = document.getElementsByTagName("img")[8];
+ assert_equals(img1.id, "test6");
+ var img2 = document.getElementsByTagName("img")[9];
+ assert_equals(img2.name, "test6");
+
+ assert_true("test6" in document, '"test6" in document should be true');
+ assert_equals(document.test6, img2);
+}, "If there are two imgs, the one with a name should be returned. (id and name)");
+
+test(function() {
+ var img = document.getElementsByTagName("img")[10];
+ assert_equals(img.id, "test7");
+
+ assert_true("test7" in document, '"test7" in document should be true');
+ assert_equals(document.test7, img);
+}, "A name should affect getting an img by id");
+
+test(function() {
+ var img = document.getElementsByTagName("img")[11];
+ assert_equals(img.name, "test8");
+
+ assert_true("test8" in document, '"test8" in document should be true');
+ assert_equals(document.test8, img);
+}, "An id shouldn't affect getting an img by name");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/loading-xml-documents/.gitkeep b/testing/web-platform/tests/html/dom/documents/loading-xml-documents/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/loading-xml-documents/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/.gitkeep b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-01.html b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-01.html
new file mode 100644
index 000000000..218a3fe84
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-01.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<title>document.compatMode: Standards</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-compatmode">
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ assert_equals(document.compatMode, "CSS1Compat");
+})
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-02.html b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-02.html
new file mode 100644
index 000000000..6da40d61e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-02.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<title>document.compatMode: Almost standards</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-compatmode">
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ assert_equals(document.compatMode, "CSS1Compat");
+})
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-03.html b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-03.html
new file mode 100644
index 000000000..3d55d6e83
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-03.html
@@ -0,0 +1,12 @@
+<title>document.compatMode: Quirks</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-compatmode">
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ assert_equals(document.compatMode, "BackCompat");
+})
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-04.xhtml b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-04.xhtml
new file mode 100644
index 000000000..a71c1d9dd
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-04.xhtml
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>document.compatMode: Standards</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-compatmode"/>
+</head>
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ assert_equals(document.compatMode, "CSS1Compat");
+})
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-05.xhtml b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-05.xhtml
new file mode 100644
index 000000000..3fde06e5a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-05.xhtml
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>document.compatMode: Standards</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-compatmode"/>
+</head>
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ assert_equals(document.compatMode, "CSS1Compat");
+})
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-06.xhtml b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-06.xhtml
new file mode 100644
index 000000000..eb64dfb90
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-compatmode-06.xhtml
@@ -0,0 +1,17 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>document.compatMode: Standards</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-compatmode"/>
+</head>
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ assert_equals(document.compatMode, "CSS1Compat");
+})
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-cookie.html b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-cookie.html
new file mode 100644
index 000000000..802e2d5ad
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-cookie.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>document.cookie</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#resource-metadata-management">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function(){
+ assert_equals(document.cookie, "");
+}, "document has no cookie");
+
+test(function(){
+ var doc = document.implementation.createHTMLDocument("doc");
+ assert_equals(doc.cookie, "");
+ doc.cookie = "test=foobar";
+ assert_equals(doc.cookie, "");
+}, "getting cookie for a cookie-averse document returns empty string, setting does nothing");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified-01.html b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified-01.html
new file mode 100644
index 000000000..e67c04fc8
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified-01.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>document.lastModified should return current local time</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var d = new Date();
+ var last_modified = document.lastModified;
+ var initial_modified = Date.parse(last_modified) / 1000;
+ var expected = Math.round(d / 1000);
+
+ test(function() {
+ assert_approx_equals(initial_modified, expected, 2.5);
+ }, "Date returned by lastModified is current at page load");
+
+ var pattern = /[0-9]{2}\/[0-9]{2}\/[0-9]{4} ([0-9]{2}):([0-9]{2}):([0-9]{2})/
+
+ test(function() {
+ assert_regexp_match(last_modified, pattern,
+ "Format should match the pattern \"NN/NN/NNNN NN:NN:NN\".");
+ }, "Date returned by lastModified is in the form \"MM/DD/YYYY hh:mm:ss\".");
+
+
+ var hours = d.getHours()
+ var minutes = d.getMinutes()
+ var seconds = d.getSeconds()
+
+ // Checking whether d and and new instance of Date have the same timezone.
+ // Do not run the time zone test in the case daylight saving occurs.
+ var d2 = new Date();
+ if (d2.getTimezoneOffset() == d.getTimezoneOffset()) {
+ test(function() {
+ var local_time = hours * 60 * 60 + minutes * 60 + seconds;
+ var m = pattern.exec(last_modified);
+ var last_modified_time = parseInt(m[1]) * 60 * 60 + parseInt(m[2]) * 60 + parseInt(m[3]);
+ assert_approx_equals(last_modified_time, local_time, 2,
+ "Hours and minutes should match local time.");
+ }, "Date returned by lastModified is in the user's local time zone.");
+ }
+ var t = async_test("Date returned by lastModified is current after timeout.");
+
+ setTimeout(function() {
+ t.step(function() {
+ var new_modified = Date.parse(document.lastModified) / 1000;
+ var new_expected = Math.round(new Date() / 1000);
+ assert_approx_equals(new_modified, new_expected, 2.5,
+ "(initial value was " + initial_modified + ")");
+ t.done();
+ });
+ }, 4000);
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified.html b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified.html
new file mode 100644
index 000000000..9e0a07d8e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>document.lastModified</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#resource-metadata-management">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ test(function(){
+ var date = new Date("Thu, 01 Jan 1970 01:23:45 GMT");
+ var result = ('0' + (date.getMonth()+1)).slice(-2) + '/' + ('0' + date.getDate()).slice(-2) + '/' + date.getFullYear() + " " + [date.getHours(),date.getMinutes(),date.getSeconds()].map(function(n){return ("0" + n).slice(-2);}).join(":");
+ assert_equals(document.lastModified, result);
+ }, "lastModified should return the last modified date and time");
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified.html.headers b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified.html.headers
new file mode 100644
index 000000000..377e3b52d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-lastModified.html.headers
@@ -0,0 +1 @@
+Last-Modified: Thu, 01 Jan 1970 01:23:45 GMT
diff --git a/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-readyState.html b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-readyState.html
new file mode 100644
index 000000000..8c91e0a00
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/resource-metadata-management/document-readyState.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>document.readyState</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#resource-metadata-management">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var t1 = async_test("readyState equals 'complete' when the document has loaded"),
+ t2 = async_test("readyState equals 'interactive' when the document is finished parsing"),
+ t3 = async_test("readystatechange event is fired each time document.readyState changes");
+
+ window.onload = t1.step_func_done(function(){
+ assert_equals(document.readyState, "complete");
+ });
+
+ document.addEventListener("DOMContentLoaded", function(event) {
+ t2.step(function() {
+ assert_equals(document.readyState, "interactive")
+ });
+ t2.done();
+ });
+
+ var states = [document.readyState];
+ document.onreadystatechange = t3.step_func(function(){
+ states.push(document.readyState);
+ if (document.readyState === "complete") {
+ assert_array_equals(states, ["loading", "interactive", "complete"]);
+ t3.done();
+ }
+ })
+</script>
diff --git a/testing/web-platform/tests/html/dom/documents/security-document/.gitkeep b/testing/web-platform/tests/html/dom/documents/security-document/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/security-document/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/documents/the-document-object/.gitkeep b/testing/web-platform/tests/html/dom/documents/the-document-object/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/documents/the-document-object/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/.gitkeep b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/closing-the-input-stream/.gitkeep b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/closing-the-input-stream/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/closing-the-input-stream/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/closing-the-input-stream/document.close-01.xhtml b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/closing-the-input-stream/document.close-01.xhtml
new file mode 100644
index 000000000..cccc26bf1
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/closing-the-input-stream/document.close-01.xhtml
@@ -0,0 +1,19 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>document.close in XHTML</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#closing-the-input-stream"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_throws("INVALID_STATE_ERR", function() {
+ document.close();
+ }, "document.close in XHTML should throw an INVALID_STATE_ERR ");
+}, "document.close in XHTML");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/.gitkeep b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/001.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/001.html
new file mode 100644
index 000000000..3ac6423f4
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/001.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("PASS");
+ assert_equals(document.body.textContent, "PASS");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/002.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/002.html
new file mode 100644
index 000000000..08975bca7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/002.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i>Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/003.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/003.html
new file mode 100644
index 000000000..915e1f6d6
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/003.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<");
+ document.write("i>Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/004.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/004.html
new file mode 100644
index 000000000..dd0172586
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/004.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i");
+ document.write(">Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/005.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/005.html
new file mode 100644
index 000000000..4c161c4d4
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/005.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i>");
+ document.write("Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/005.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/005.js
new file mode 100644
index 000000000..ebfd7e258
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/005.js
@@ -0,0 +1 @@
+order.push(3); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/006.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/006.html
new file mode 100644
index 000000000..92bfb44c3
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/006.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i id='test'>Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.getAttribute("id"), "test");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/006.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/006.js
new file mode 100644
index 000000000..ebfd7e258
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/006.js
@@ -0,0 +1 @@
+order.push(3); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/007.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/007.html
new file mode 100644
index 000000000..753316b89
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/007.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i ");
+ document.write("id='test'>Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.getAttribute("id"), "test");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/007.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/007.js
new file mode 100644
index 000000000..31fcf18d4
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/007.js
@@ -0,0 +1,4 @@
+t.step(function() {
+ order.push(2);
+ document.write("<script>t.step(function() {order.push(3)})</script>");
+ }); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/008-1.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/008-1.js
new file mode 100644
index 000000000..ef90c722b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/008-1.js
@@ -0,0 +1,3 @@
+t.step(function() {
+ order.push(3);
+ }); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/008.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/008.html
new file mode 100644
index 000000000..4818bc388
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/008.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i i");
+ document.write("d='test'>Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.getAttribute("id"), "test");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/008.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/008.js
new file mode 100644
index 000000000..367597515
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/008.js
@@ -0,0 +1,4 @@
+t.step(function() {
+ order.push(2);
+ document.write("<script src=\"008-1.js\"></script>");
+ }); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/009.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/009.html
new file mode 100644
index 000000000..d7b78333b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/009.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i id");
+ document.write("='test'>Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.getAttribute("id"), "test");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/010-1.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/010-1.js
new file mode 100644
index 000000000..fd815bab7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/010-1.js
@@ -0,0 +1,4 @@
+t.step(function() {
+ order.push(4);
+ assert_equals(document.getElementsByTagName("meta").length, 1);
+ }); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/010.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/010.html
new file mode 100644
index 000000000..c8b995825
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/010.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i id=");
+ document.write("'test'>Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.getAttribute("id"), "test");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/010.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/010.js
new file mode 100644
index 000000000..bb328ad55
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/010.js
@@ -0,0 +1,4 @@
+t.step(function() {
+ order.push(3);
+ assert_equals(document.getElementsByTagName("meta").length, 0);
+ });
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/011-1.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/011-1.js
new file mode 100644
index 000000000..944b70d2d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/011-1.js
@@ -0,0 +1,5 @@
+t.step(function() {
+ order.push(4);
+ document.write("<meta>");
+ assert_equals(document.getElementsByTagName("meta").length, 1);
+ }); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/011.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/011.html
new file mode 100644
index 000000000..33464429e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/011.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i id='");
+ document.write("test'>Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.getAttribute("id"), "test");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/011.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/011.js
new file mode 100644
index 000000000..ce47bcd28
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/011.js
@@ -0,0 +1,5 @@
+t.step(function() {
+ order.push(3);
+ document.write("<script src='011-1.js'></script" + "><meta>");
+ assert_equals(document.getElementsByTagName("meta").length, 0);
+ }); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/012.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/012.html
new file mode 100644
index 000000000..c9902a487
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/012.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i id='te");
+ document.write("st'>Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.getAttribute("id"), "test");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/012.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/012.js
new file mode 100644
index 000000000..7ab4c6b38
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/012.js
@@ -0,0 +1,5 @@
+t.step(
+function() {
+ order.push(5);
+ assert_equals(document.getElementsByTagName("meta").length, 0);
+}); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/013.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/013.html
new file mode 100644
index 000000000..7b87d2897
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/013.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i id='test");
+ document.write("'>Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.getAttribute("id"), "test");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/013.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/013.js
new file mode 100644
index 000000000..b5ce5f27d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/013.js
@@ -0,0 +1 @@
+document.write('<svg><![CDATA['); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/014.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/014.html
new file mode 100644
index 000000000..75518a898
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/014.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i id='test'");
+ document.write(">Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.getAttribute("id"), "test");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/015.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/015.html
new file mode 100644
index 000000000..3dd79a63e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/015.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i id='test'");
+ document.write("class='a'>Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.getAttribute("id"), "test");
+ assert_equals(document.body.firstChild.getAttribute("class"), "a");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/016.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/016.html
new file mode 100644
index 000000000..4c2f58912
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/016.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<i>Filler Text");
+ document.write("</i><b>Filler Text");
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+ assert_equals(document.body.childNodes[1].localName, "b");
+ assert_equals(document.body.childNodes[1].textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/017.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/017.html
new file mode 100644
index 000000000..8d1b24b06
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/017.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ var s = "<i id=test>Filler Text</i><b>Filler Text"
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+ assert_equals(document.body.firstChild.localName, "i");
+ assert_equals(document.body.firstChild.getAttribute('id'), "test");
+ assert_equals(document.body.firstChild.textContent, "Filler Text");
+ assert_equals(document.body.childNodes[1].localName, "b");
+ assert_equals(document.body.childNodes[1].textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/018.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/018.html
new file mode 100644
index 000000000..cf8dddbc5
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/018.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+function() {
+ document.write("<body>");
+ var s = "<!--comment--><i>Filler Text</i>"
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+ assert_equals(document.body.firstChild.nodeType, document.COMMENT_NODE);
+ assert_equals(document.body.firstChild.data, "comment");
+ assert_equals(document.body.childNodes[1].localName, "i");
+ assert_equals(document.body.childNodes[1].textContent, "Filler Text");
+}
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/019.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/019.html
new file mode 100644
index 000000000..5e988f79e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/019.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<i");
+});
+</script>
+>Filler Text</i>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "i");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/020.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/020.html
new file mode 100644
index 000000000..1d31bbf35
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/020.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><");
+});
+</script>!--comment-->
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].nodeType, document.COMMENT_NODE);
+ assert_equals(document.body.childNodes[0].data, "comment");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/021.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/021.html
new file mode 100644
index 000000000..500bb1939
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/021.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><sp");
+});
+</script>an>Filler Text</span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "span");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/022.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/022.html
new file mode 100644
index 000000000..53ba29901
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/022.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><span>");
+});
+</script>Filler Text</span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "span");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/023.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/023.html
new file mode 100644
index 000000000..ca89e0e0b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/023.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><span ");
+});
+</script>id=a>Filler Text</span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "span");
+ assert_equals(document.body.childNodes[0].getAttribute("id"), "a");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/024.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/024.html
new file mode 100644
index 000000000..2a47d76cb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/024.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><span i");
+});
+</script>d=a>Filler Text</span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "span");
+ assert_equals(document.body.childNodes[0].getAttribute("id"), "a");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/025.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/025.html
new file mode 100644
index 000000000..31c68cf7d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/025.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><span id");
+});
+</script>=a>Filler Text</span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "span");
+ assert_equals(document.body.childNodes[0].getAttribute("id"), "a");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/026.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/026.html
new file mode 100644
index 000000000..a9bce7743
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/026.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><span id=");
+});
+</script>a>Filler Text</span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "span");
+ assert_equals(document.body.childNodes[0].getAttribute("id"), "a");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/027.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/027.html
new file mode 100644
index 000000000..dcfd67c0f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/027.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><span id=a");
+});
+</script>>Filler Text</span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "span");
+ assert_equals(document.body.childNodes[0].getAttribute("id"), "a");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/028.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/028.html
new file mode 100644
index 000000000..f5b7e9ef2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/028.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><span id=a>Filler Text<");
+});
+</script>/span><b>Filler Text</b></span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "span");
+ assert_equals(document.body.childNodes[0].getAttribute("id"), "a");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+ assert_equals(document.body.childNodes[1].localName, "b");
+ assert_equals(document.body.childNodes[1].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/029.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/029.html
new file mode 100644
index 000000000..f005a7222
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/029.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><span id=a>Filler Text</");
+});
+</script>span><b>Filler Text</b></span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "span");
+ assert_equals(document.body.childNodes[0].getAttribute("id"), "a");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+ assert_equals(document.body.childNodes[1].localName, "b");
+ assert_equals(document.body.childNodes[1].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/030.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/030.html
new file mode 100644
index 000000000..cc361d3aa
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/030.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><span id=a>Filler Text</sp");
+});
+</script>an><b>Filler Text</b></span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "span");
+ assert_equals(document.body.childNodes[0].getAttribute("id"), "a");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+ assert_equals(document.body.childNodes[1].localName, "b");
+ assert_equals(document.body.childNodes[1].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/031.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/031.html
new file mode 100644
index 000000000..32c97c505
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/031.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><span id=a>Filler Text</span");
+});
+</script>><b>Filler Text</b></span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "span");
+ assert_equals(document.body.childNodes[0].getAttribute("id"), "a");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+ assert_equals(document.body.childNodes[1].localName, "b");
+ assert_equals(document.body.childNodes[1].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/032.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/032.html
new file mode 100644
index 000000000..1a33408f1
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/032.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ var tag_name_length = 100000;
+ var tag_name = "";
+ for (var i=0; i<tag_name_length; i++) {
+ tag_name += "a";
+ }
+ document.write("<body><" + tag_name + ">Filler Text</" + tag_name + ">");
+});
+</script>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/033.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/033.html
new file mode 100644
index 000000000..1b8e1c270
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/033.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+test(
+ function() {
+ document.writeln("<i");
+ var s = " b='a'>Filler"
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]+"\n");
+ }
+ document.writeln("</i");
+ document.writeln(">");
+ assert_equals(document.body.childNodes[0].localName, "i");
+ assert_equals(document.body.childNodes[0].getAttribute("b"), "\na\n");
+ assert_equals(document.body.childNodes[0].textContent, "\nF\ni\nl\nl\ne\nr\n");
+ }
+);
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/034.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/034.html
new file mode 100644
index 000000000..abd481a64
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/034.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ var s = "<svg><![CDATA[Filler Text]]></svg>";
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+});
+</script>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "svg");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/035.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/035.html
new file mode 100644
index 000000000..a1e7f9ee6
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/035.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ var s = "<svg><!";
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+});
+</script>[CDATA[Filler Text]]></svg>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "svg");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/036.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/036.html
new file mode 100644
index 000000000..8719e0598
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/036.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ var s = "<svg><![CDATA[Filler Text]";
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+});
+</script>]></svg>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "svg");
+ assert_equals(document.body.childNodes[0].textContent, "Filler Text");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/037.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/037.html
new file mode 100644
index 000000000..cf0787ce7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/037.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ var s = "<body><!DOCTYPE html>";
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+});
+</script><script>
+t.step(function() {
+ //Nothing should be inserted into the DOM for the doctype node so
+ //just checking nothing odd happens
+ assert_equals(document.body.childNodes[0].localName, "script");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/038.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/038.html
new file mode 100644
index 000000000..4ae9d32b2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/038.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ var s = "<body><";
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+});
+</script>!DOCTYPE html><script>
+t.step(function() {
+ //Nothing should be inserted into the DOM for the doctype node so
+ //just checking nothing odd happens
+ assert_equals(document.body.childNodes[0].localName, "script");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/039.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/039.html
new file mode 100644
index 000000000..611a01390
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/039.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ var s = "<body><!";
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+});
+</script>DOCTYPE html><script>
+t.step(function() {
+ //Nothing should be inserted into the DOM for the doctype node so
+ //just checking nothing odd happens
+ assert_equals(document.body.childNodes[0].localName, "script");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/040.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/040.html
new file mode 100644
index 000000000..d76deffa4
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/040.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>document.write entity</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = test(function() {
+ document.write("<body><span>&notin;abc");
+ assert_equals(document.body.childNodes[0].textContent, "\u2209abc");
+});
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/041.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/041.html
new file mode 100644
index 000000000..592711c94
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/041.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<title>document.write entity</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = test(function() {
+ var s = "<body><span>&notin;abc";
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+ assert_equals(document.body.childNodes[0].textContent, "\u2209abc");
+});
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/042.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/042.html
new file mode 100644
index 000000000..e15f1d0c0
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/042.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>document.write entity</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><span>&not");
+});
+</script>in;abc</span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].textContent, "\u2209abc");
+})
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/043.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/043.html
new file mode 100644
index 000000000..4058e7a82
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/043.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>document.write entity</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><span>&");
+});
+</script>notabc</span>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].textContent, "\u00ACabc");
+})
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/044.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/044.html
new file mode 100644
index 000000000..4c9f50273
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/044.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<body><textarea><span>Filler</span></textarea>");
+});
+</script>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "textarea");
+ assert_equals(document.body.childNodes[0].textContent, "<span>Filler</span>");
+})
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/045.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/045.html
new file mode 100644
index 000000000..987eabf0f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/045.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ var s = "<body><textarea><span>Filler</span></textarea>";
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+});
+</script>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "textarea");
+ assert_equals(document.body.childNodes[0].textContent, "<span>Filler</span>");
+})
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/046.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/046.html
new file mode 100644
index 000000000..e87e9cc82
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/046.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ var s = "<body><textarea>";
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+});
+</script><span>Filler</span></textarea>
+<script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].localName, "textarea");
+ assert_equals(document.body.childNodes[0].textContent, "<span>Filler</span>");
+})
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/047.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/047.html
new file mode 100644
index 000000000..51faf6c85
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/047.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+onload = function() {
+ t.step(function() {
+ document.write("<body>Filler Text<div id='log'></div>");
+ assert_equals(document.body.textContent, "Filler Text");
+ });
+ t.done();
+};
+</script>
+<body>FAIL
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/048.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/048.html
new file mode 100644
index 000000000..51faf6c85
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/048.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+onload = function() {
+ t.step(function() {
+ document.write("<body>Filler Text<div id='log'></div>");
+ assert_equals(document.body.textContent, "Filler Text");
+ });
+ t.done();
+};
+</script>
+<body>FAIL
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/049.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/049.html
new file mode 100644
index 000000000..0ec282f2b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/049.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>document.write plaintext</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<div id="log"></div><script>
+test(function() {
+ var s = "<table><tr><td>Text</tr><plaintext><tr><td>Filler ";
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+ document.close();
+ assert_equals(document.body.childNodes[2].nodeType, document.ELEMENT_NODE);
+ assert_equals(document.body.childNodes[2].localName, "plaintext");
+ assert_equals(document.body.childNodes[2].textContent, "<tr><td>Filler ");
+ assert_equals(document.body.childNodes[3].nodeType, document.ELEMENT_NODE);
+ assert_equals(document.body.childNodes[3].localName, "table");
+ assert_equals(document.body.childNodes[3].textContent, "Text");
+});
+</script> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/050.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/050.html
new file mode 100644
index 000000000..0a37fa4c5
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/050.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>document.write plaintext</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<div id="log"></div><script>
+var t = async_test();
+
+t.step(function() {
+ document.write("<plaintext>");
+ assert_equals(document.body.childNodes[2].nodeType, document.ELEMENT_NODE);
+ assert_equals(document.body.childNodes[2].localName, "plaintext");
+ var s = "Filler ";
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ assert_equals(document.body.childNodes[2].textContent, s.slice(0,i+1));
+ }
+ document.close();
+});
+
+onload = function() {
+ t.step(function() {
+ assert_equals(document.body.childNodes[2].textContent, "Filler Text\n");
+ });
+ t.done();
+}
+</script>Text
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/051.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/051.html
new file mode 100644
index 000000000..cdbad22b5
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/051.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>document.write \r\n</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<div id="log"></div><script>
+var t = async_test()
+t.step(function() {
+ document.write("\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nA");
+})
+
+onload = function() {
+ t.step(function() {
+ assert_equals(document.body.lastChild.data, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nA\n");
+ });
+ t.done();
+};
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/document.write-01.xhtml b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/document.write-01.xhtml
new file mode 100644
index 000000000..ec8702a74
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/document.write-01.xhtml
@@ -0,0 +1,19 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>document.write in XHTML</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#document.write%28%29"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_throws("INVALID_STATE_ERR", function() {
+ document.write("Failure: document.write actually worked");
+ }, "document.write in XHTML should throw an INVALID_STATE_ERR ");
+}, "document.write in XHTML");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/document.write-02.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/document.write-02.html
new file mode 100644
index 000000000..4c25da8b6
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/document.write-02.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<title>document.write and null/undefined</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-write%28%29">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#documents-in-the-dom">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var iframe = document.createElement("iframe");
+ document.body.appendChild(iframe);
+ doc = iframe.contentDocument;
+ test(function() {
+ doc.open();
+ doc.write(null);
+ doc.close();
+ assert_equals(doc.documentElement.textContent, "null");
+ }, "document.write(null)");
+ test(function() {
+ doc.open();
+ doc.write(undefined);
+ doc.close();
+ assert_equals(doc.documentElement.textContent, "undefined");
+ }, "document.write(undefined)");
+}, "Calling document.write with null and undefined");
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_001.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_001.html
new file mode 100644
index 000000000..8b54560c6
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_001.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>document.write into iframe</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<iframe id="test"></iframe>
+<script>
+test(
+function() {
+ var iframe = document.getElementById("test");
+ iframe.contentDocument.write("Filler Text");
+ iframe.contentDocument.close();
+ assert_equals(iframe.contentDocument.body.textContent, "Filler Text");
+});
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_002.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_002.html
new file mode 100644
index 000000000..f77819adb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_002.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>document.write into iframe</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<iframe id="test"></iframe>
+<script>
+test(
+function() {
+ var iframe = document.getElementById("test");
+ var s = "<i id='a'>Filler Text</i><b id=b>Filler Text</b>"
+ for (var i=0; i<s.length; i++) {
+ iframe.contentDocument.write(s[i]);
+ }
+ iframe.contentDocument.close();
+ assert_equals(iframe.contentDocument.body.childNodes[0].textContent, "Filler Text");
+ assert_equals(iframe.contentDocument.body.childNodes[0].localName, "i");
+ assert_equals(iframe.contentDocument.body.childNodes[0].getAttribute('id'), "a");
+ assert_equals(iframe.contentDocument.body.childNodes[1].textContent, "Filler Text");
+ assert_equals(iframe.contentDocument.body.childNodes[1].localName, "b");
+ assert_equals(iframe.contentDocument.body.childNodes[1].getAttribute('id'), "b");
+});
+</script>
+<div id="log"></div> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_003.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_003.html
new file mode 100644
index 000000000..9865874da
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_003.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>document.write script into iframe</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<iframe id="test"></iframe>
+<script>
+test(
+function() {
+ var iframe = document.getElementById("test");
+ var s = "<script>document.write(\"<i id='a'>Filler Text</i>\")</script" + "><b id=b>Filler Text</b>"
+ for (var i=0; i<s.length; i++) {
+ iframe.contentDocument.write(s[i]);
+ }
+ iframe.contentDocument.close();
+ //Note: <script> ends up in <head>
+ assert_equals(iframe.contentDocument.body.childNodes[0].textContent, "Filler Text");
+ assert_equals(iframe.contentDocument.body.childNodes[0].localName, "i");
+ assert_equals(iframe.contentDocument.body.childNodes[0].getAttribute('id'), "a");
+ assert_equals(iframe.contentDocument.body.childNodes[1].textContent, "Filler Text");
+ assert_equals(iframe.contentDocument.body.childNodes[1].localName, "b");
+ assert_equals(iframe.contentDocument.body.childNodes[1].getAttribute('id'), "b");
+});
+</script>
+<div id="log"></div> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_004.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_004.html
new file mode 100644
index 000000000..a4d7b1dda
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_004.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>document.write script into iframe write back into parent</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<iframe id="test"></iframe>
+<script>
+var t = async_test();
+var iframe = document.getElementById("test");
+var order = [];
+t.step(function() {
+ order.push(1);
+ var s = "<script>parent.order.push(2); parent.document.write('<script>order.push(3);</script'+'>'); parent.order.push(4)</script" + ">";
+ for (var i=0; i<s.length; i++) {
+ iframe.contentDocument.write(s[i]);
+ }
+ iframe.contentDocument.close();
+ order.push(5);
+ assert_array_equals(order, [1,2,3,4,5])
+}
+);
+t.done();
+</script>
+<div id="log"></div> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_005.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_005.html
new file mode 100644
index 000000000..7bc3ed6c2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_005.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>document.write external script into iframe write back into parent</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<iframe id="test"></iframe>
+<script>
+var t = async_test();
+var iframe = document.getElementById("test");
+var order = [];
+t.step(function() {
+ order.push(1);
+ var s = "<script src='iframe_005.js'></script" + ">";
+ iframe.contentDocument.write(s);
+ iframe.contentDocument.close();
+ order.push(2);
+ assert_array_equals(order, [1,2])
+}
+);
+addEventListener("load", function() {
+ t.step(function() {
+ assert_array_equals(order, [1,2,3,4,5])
+ });
+ t.done();
+}, false);
+</script>
+<div id="log"></div> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_005.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_005.js
new file mode 100644
index 000000000..bf038f700
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_005.js
@@ -0,0 +1,3 @@
+parent.order.push(3);
+document.write("<script>parent.order.push(4)</script>");
+parent.order.push(5); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_006.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_006.html
new file mode 100644
index 000000000..d080ee367
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_006.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write external script into iframe write back into parent</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<iframe id="test"></iframe>
+<script>
+var t = async_test();
+var iframe = document.getElementById("test");
+var order = [];
+t.step(function() {
+ order.push(1);
+ var s = "<script>parent.order.push(2); parent.document.write('<script>order.push(3); iframe.contentDocument.write(\"<script>parent.order.push(4)</script\"+\">\");order.push(5);</script' + '>'); parent.order.push(6)</script"+">";
+ iframe.contentDocument.write(s);
+ iframe.contentDocument.close();
+ order.push(7);
+ assert_array_equals(order, [1,2,3,4,5,6,7]);
+});
+t.done();
+</script>
+<div id="log"></div> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_007.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_007.html
new file mode 100644
index 000000000..c00aa7062
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_007.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>document.write comment into iframe</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<iframe id="test"></iframe>
+<script>
+test(function() {
+ var iframe = document.getElementById("test");
+ var s = "<!--Filler-->";
+ for (var i=0; i<s.length; i++) {
+ iframe.contentDocument.write(s);
+ }
+ iframe.contentDocument.close();
+ assert_equals(iframe.contentDocument.childNodes[0].nodeType, document.COMMENT_NODE);
+ assert_equals(iframe.contentDocument.childNodes[0].data, "Filler");
+});
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_008.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_008.html
new file mode 100644
index 000000000..c814958d1
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_008.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>document.write plaintext into iframe</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<iframe id="test"></iframe>
+<script>
+test(function() {
+ var iframe = document.getElementById("test");
+ var s = "<plaintext><span>Filler Text";
+ for (var i=0; i<s.length; i++) {
+ iframe.contentDocument.write(s[i]);
+ }
+ iframe.contentDocument.close();
+ assert_equals(iframe.contentDocument.body.childNodes[0].nodeType, document.ELEMENT_NODE);
+ assert_equals(iframe.contentDocument.body.childNodes[0].localName, "plaintext");
+ assert_equals(iframe.contentDocument.body.childNodes[0].textContent, "<span>Filler Text");
+});
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_009.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_009.html
new file mode 100644
index 000000000..8b271c7a0
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_009.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>document.write plaintext into iframe</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<iframe id="test"></iframe>
+<script>
+test(function() {
+ var iframe = document.getElementById("test");
+ var s = "<table><tr><td>Text</tr><plaintext><tr><td>Filler ";
+ for (var i=0; i<s.length; i++) {
+ iframe.contentDocument.write(s[i]);
+ }
+ iframe.contentDocument.close();
+ assert_equals(iframe.contentDocument.body.childNodes[0].nodeType, document.ELEMENT_NODE);
+ assert_equals(iframe.contentDocument.body.childNodes[0].localName, "plaintext");
+ assert_equals(iframe.contentDocument.body.childNodes[0].textContent, "<tr><td>Filler ");
+ assert_equals(iframe.contentDocument.body.childNodes[1].nodeType, document.ELEMENT_NODE);
+ assert_equals(iframe.contentDocument.body.childNodes[1].localName, "table");
+ assert_equals(iframe.contentDocument.body.childNodes[1].textContent, "Text");
+});
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_010.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_010.html
new file mode 100644
index 000000000..8dc21a013
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/iframe_010.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>document.write plaintext</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<iframe id="test"></iframe>
+<script>
+var t = async_test();
+var iframe = document.getElementById("test");
+
+function check_dom() {
+ assert_equals(iframe.contentDocument.body.childNodes[0].localName, "plaintext")
+ assert_equals(iframe.contentDocument.body.childNodes[0].textContent, "Filler ")
+ assert_equals(iframe.contentDocument.body.childNodes[1].localName, "table")
+}
+
+t.step(function() {
+ var s = "<script>document.write('<table><plaintext>Filler '); document.close(); top.t.step(function() {top.check_dom()})</script" + ">";
+ for (var i=0; i<s.length; i++) {
+ iframe.contentDocument.write(s[i]);
+ }
+ t.done();
+});
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-1.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-1.html
new file mode 100644
index 000000000..c7a7a1db4
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-1.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<body>You should see the word "worked" below<br><script>document.write("\u003cscript>document.write(\"\\u003cscript src='nested-document-write-external.js'>\\u003c/script>r\"); document.write(\"k\");\u003c/script>e"); document.write("d");</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-2.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-2.html
new file mode 100644
index 000000000..60b8eae1e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-2.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<body>
+You should see the word "worked" in the frame below.<br>
+<iframe></iframe>
+<script>
+var doc = document.getElementsByTagName("iframe")[0].contentDocument;
+doc.open(); doc.write("\u003cscript>document.write(\"\\u003cscript src='nested-document-write-external.js'>\\u003c/script>r\"); document.write(\"k\");\u003c/script>e"); doc.write("d"); doc.close();</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-external.js b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-external.js
new file mode 100644
index 000000000..bf91daf98
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-external.js
@@ -0,0 +1 @@
+document.write("w"); document.write("o");
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/original-id.json b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/original-id.json
new file mode 100644
index 000000000..08bd4d0d4
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/original-id.json
@@ -0,0 +1 @@
+{"original_id":"document.write()"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_001.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_001.html
new file mode 100644
index 000000000..43c7adb4d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_001.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>document.write script</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<script>t.done();<"+"/script>");
+});
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_002.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_002.html
new file mode 100644
index 000000000..3879d8489
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_002.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>document.write script executed synchronously</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+var order = [];
+t.step(function() {
+ document.write("<script>t.step(function() {order.push(1);});<"+"/script>");
+ order.push(2);
+});
+</script>
+<script>
+t.step(function() {
+ order.push(3);
+ assert_array_equals(order, [1,2,3]);
+})
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_003.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_003.html
new file mode 100644
index 000000000..e669252f7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_003.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>document.write script writing a further script</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ document.write("<script>document.write('<script>t.done()</script'+'>')<"+"/script>");
+});
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_004.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_004.html
new file mode 100644
index 000000000..15fda325b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_004.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write script writing script; order of execution</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+var order = [];
+t.step(function() {
+ order.push(1);
+ document.write("<script>order.push(2); document.write('<script>order.push(3);</script'+'>'); order.push(4);<"+"/script>");
+ order.push(5);
+});
+</script>
+<script>
+t.step(function() {
+ assert_array_equals(order, [1,2,3,4,5]);
+});
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_005.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_005.html
new file mode 100644
index 000000000..b99196c7d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_005.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>document.write external script</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+var order = [];
+t.step(function() {
+ order.push(1);
+ document.write("<script src='005.js'><"+"/script>");
+ order.push(2);
+});
+</script>
+<script>
+order.push(4);
+t.step(function() {
+ assert_array_equals(order, [1,2,3,4]);
+});
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_006.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_006.html
new file mode 100644
index 000000000..c8dd9a5f9
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_006.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>document.write external script followed by internal script</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+var order = [];
+t.step(function() {
+ order.push(1);
+ document.write("<script src='006.js'><"+"/script><script>t.step(function(){order.push(4)})</script"+">");
+ order.push(2);
+});
+</script>
+<script>
+t.step(function() {
+ order.push(5);
+ assert_array_equals(order, [1,2,3,4,5]);
+});
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_007.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_007.html
new file mode 100644
index 000000000..fbbe5b2f8
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_007.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write external script that document.writes inline script</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+var order = [];
+t.step(function() {
+ order.push(1);
+});
+</script>
+<script src="007.js"></script>
+<script>
+t.step(function() {
+ order.push(4);
+ assert_array_equals(order, [1,2,3,4]);
+});
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_008.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_008.html
new file mode 100644
index 000000000..c5a44dc70
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_008.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write external script that document.writes external script</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+var order = [];
+t.step(function() {
+ order.push(1);
+});
+</script>
+<script src="008.js"></script>
+<script>
+t.step(function() {
+ order.push(4);
+ assert_array_equals(order, [1,2,3,4]);
+});
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_009.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_009.html
new file mode 100644
index 000000000..d12d934ea
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_009.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>document.write script that document.writes script</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+var order = [];
+t.step(function() {
+ order.push(1);
+ document.write("<script>order.push(2); document.write('<script>order.push(3); document.write(\"<script>order.push(4);</script\"+\">\"); order.push(5);</script' + '>'); order.push(6);</script" + ">");
+ order.push(7);
+});
+</script>
+<script>
+t.step(function() {
+ assert_array_equals(order, [1,2,3,4,5,6,7]);
+});
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_010.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_010.html
new file mode 100644
index 000000000..93728d6f2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_010.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>document.write external script tokenizer order</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+var order = [];
+t.step(function() {
+ order.push(1);
+ document.write("<script src='010.js'></script" + "><meta><script src='010-1.js'></script" + ">");
+ order.push(2);
+ assert_equals(document.getElementsByTagName("meta").length, 0);
+});
+</script>
+<script>
+t.step(function() {
+ order.push(5);
+ assert_equals(document.getElementsByTagName("meta").length, 1);
+ assert_array_equals(order, [1,2,3,4,5]);
+});
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_011.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_011.html
new file mode 100644
index 000000000..2bbcaf976
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_011.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>document.write external script that document.writes external script</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+var order = [];
+t.step(function() {
+ order.push(1);
+ document.write("<script src='011.js'></script" + "><meta>");
+ order.push(2);
+ assert_equals(document.getElementsByTagName("meta").length, 0);
+});
+</script>
+<script>
+t.step(function() {
+ order.push(5);
+ assert_equals(document.getElementsByTagName("meta").length, 3, "Number of meta elements at end");
+ assert_array_equals(order, [1,2,3,4,5]);
+});
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_012.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_012.html
new file mode 100644
index 000000000..57755f4c9
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_012.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>document.write external script tokenizer order</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+var order = [];
+t.step(function() {
+ order.push(1);
+ document.write("<script>order.push(2); document.write('<script src=\"012.js\"></script' + '><meta>'); order.push(3); t.step(function() {assert_equals(document.getElementsByTagName('meta').length, 0)});</script" + "><meta>");
+ order.push(4);
+ assert_equals(document.getElementsByTagName("meta").length, 0);
+});
+</script>
+<script>
+t.step(function() {
+ order.push(6);
+ assert_equals(document.getElementsByTagName("meta").length, 2);
+ assert_array_equals(order, [1,2,3,4,5,6]);
+});
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_013.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_013.html
new file mode 100644
index 000000000..0e71e5eb0
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-write/script_013.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<title>document.write</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test();
+t.step(function() {
+ var s = "<script src='013.js'><" + "/script></svg>]]><path></svg>";
+ for (var i=0; i<s.length; i++) {
+ document.write(s[i]);
+ }
+});
+</script><script>
+t.step(function() {
+ assert_equals(document.body.childNodes[0].nodeType, document.ELEMENT_NODE);
+ assert_equals(document.body.childNodes[0].localName, "svg");
+ assert_equals(document.body.childNodes[0].childNodes[0].nodeType, document.TEXT_NODE);
+ assert_equals(document.body.childNodes[0].childNodes[0].data, "</svg>");
+ assert_equals(document.body.childNodes[0].childNodes[1].nodeType, document.ELEMENT_NODE);
+ assert_equals(document.body.childNodes[0].childNodes[1].localName, "path");
+}
+);
+t.done();
+</script>
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/.gitkeep b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-01.xhtml b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-01.xhtml
new file mode 100644
index 000000000..3d59bcd20
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-01.xhtml
@@ -0,0 +1,19 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>document.writeln in XHTML</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#document.writeln%28%29"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_throws("INVALID_STATE_ERR", function() {
+ document.writeln("Failure: document.writeln actually worked");
+ }, "document.writeln in XHTML should throw an INVALID_STATE_ERR ");
+}, "document.writeln in XHTML");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-02.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-02.html
new file mode 100644
index 000000000..2a64ac756
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-02.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<title>document.writeln and null/undefined</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-writeln%28%29">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#documents-in-the-dom">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var iframe = document.createElement("iframe");
+ document.body.appendChild(iframe);
+ doc = iframe.contentDocument;
+ test(function() {
+ doc.open();
+ doc.writeln(null);
+ doc.close();
+ assert_equals(doc.documentElement.textContent, "null\n");
+ }, "document.writeln(null)");
+ test(function() {
+ doc.open();
+ doc.writeln(undefined);
+ doc.close();
+ assert_equals(doc.documentElement.textContent, "undefined\n");
+ }, "document.writeln(undefined)");
+}, "Calling document.writeln with null and undefined");
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-03.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-03.html
new file mode 100644
index 000000000..df9a7a15c
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-03.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<title>document.writeln with multiple arguments</title>
+<link rel="author" title="Sebmaster" href="mailto:wpt@smayr.name">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-writeln%28%29">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#documents-in-the-dom">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var iframe = document.createElement("iframe");
+ document.body.appendChild(iframe);
+ var doc = iframe.contentDocument;
+ doc.open();
+ doc.writeln('a', 'b');
+ doc.close();
+ assert_equals(doc.documentElement.textContent, "ab\n");
+}, "Calling document.writeln with multiple arguments");
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/original-id.json b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/original-id.json
new file mode 100644
index 000000000..0cc32be6a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/document-writeln/original-id.json
@@ -0,0 +1 @@
+{"original_id":"document.writeln()"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/.gitkeep b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/001.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/001.html
new file mode 100644
index 000000000..f82d80be7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/001.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>Replacement of window object after document.open</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe></iframe>
+<script>
+var t = async_test();
+
+onload = t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ iframe.contentWindow.state = 1;
+ var handle = iframe.contentWindow;
+ iframe.contentDocument.open();
+ assert_false("state" in iframe.contentWindow, "Variables are not preserved after document.open");
+ assert_equals(iframe.contentWindow.state, undefined, "Variables are not preserved after document.open");
+ assert_equals(iframe.contentWindow, handle);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/002.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/002.html
new file mode 100644
index 000000000..42f6c580c
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/002.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<title>document.open during parsing</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var log = document.getElementById("log");
+ document.open()
+ assert_equals(document.getElementById("log"), log)
+})
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/004-1.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/004-1.html
new file mode 100644
index 000000000..c50eddd41
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/004-1.html
@@ -0,0 +1 @@
+<!doctype html>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/004.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/004.html
new file mode 100644
index 000000000..f489caa72
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/004.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>Reuse of document object after document.open</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="004-1.html"></iframe>
+<script>
+var t = async_test();
+var iframe;
+onload = t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ var handle = iframe.contentDocument;
+ iframe.contentDocument.test_state = 1;
+ iframe.contentDocument.open();
+ assert_equals(iframe.contentDocument.test_state, 1);
+ assert_equals(iframe.contentDocument, handle);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/005.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/005.html
new file mode 100644
index 000000000..6bd850520
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/005.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>Cancelling timeout after document.open</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="004-1.html"></iframe>
+<script>
+var t = async_test();
+var iframe;
+onload = t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ iframe.contentWindow.setTimeout(t.step_func(function() {assert_unreached()}), 100);
+ iframe.contentDocument.open()
+ setTimeout(function() {t.done();}, 200);
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/006.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/006.html
new file mode 100644
index 000000000..692d06d98
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/006.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>Cancelling error after document.open</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="004-1.html"></iframe>
+<script>
+var t = async_test();
+var iframe;
+onload = t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ var img = iframe.contentDocument.createElement("img");
+ img.onerror = t.step_func(function() {assert_unreached()})
+ img.src = "missing";
+ iframe.contentDocument.body.appendChild(img);
+ iframe.contentDocument.open()
+ setTimeout(function() {t.done();}, 500);
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/007.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/007.html
new file mode 100644
index 000000000..e5f0d1561
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/007.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>Unregistering event handlers after document.open</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="004-1.html"></iframe>
+<script>
+var t = async_test();
+var iframe;
+onload = t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ iframe.contentDocument.onclick = t.step_func(function() {assert_unreached()})
+ iframe.contentDocument.open();
+ var e = iframe.contentDocument.createEvent("mouseevents")
+ e.initEvent("click", false, false);
+ iframe.contentDocument.dispatchEvent(e);
+ setTimeout(function() {t.done();}, 500);
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/008.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/008.html
new file mode 100644
index 000000000..08fd4aa43
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/008.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>Replacement of document prototype object after document.open</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="004-1.html"></iframe>
+<script>
+var t = async_test();
+var iframe;
+onload = t.step_func(function() {
+ var iframe = document.getElementsByTagName("iframe")[0];
+ var handle = Object.getPrototypeOf(iframe.contentDocument);
+ handle.test_state = 1;
+ iframe.contentDocument.open();
+ var new_handle = Object.getPrototypeOf(iframe.contentDocument);
+ assert_equals(new_handle.test_state, undefined);
+ assert_not_equals(new_handle, handle);
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/009.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/009.html
new file mode 100644
index 000000000..4fc5163ea
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/009.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<title>document.open replacing singleton</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="004-1.html"></iframe>
+<script>
+var iframe = document.getElementsByTagName("iframe")[0];
+var steps;
+iframe.onload = function() {
+steps = ["window", "location", "history", "navigator", "applicationCache", "sessionStorage", "localStorage", "locationbar"].map(
+function(x) {
+ var t = async_test(document.title + " " + x);
+ var handle = iframe.contentWindow[x];
+ handle.test_state = 1;
+ return t.step_func(
+ function() {
+ var new_handle = iframe.contentWindow[x];
+ assert_equals(new_handle.test_state, undefined);
+ if (x !== "window") {
+ assert_not_equals(new_handle, handle);
+ } else {
+ assert_equals(new_handle, handle);
+ }
+ t.done();
+ });
+ }
+);
+}
+onload = function() {
+ iframe.contentDocument.open();
+ steps.forEach(function(x) {x()});
+}
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-1.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-1.html
new file mode 100644
index 000000000..317e13691
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-1.html
@@ -0,0 +1,2 @@
+<!doctype html>
+010-1
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-2.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-2.html
new file mode 100644
index 000000000..ea537fcd6
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-2.html
@@ -0,0 +1,5 @@
+<!doctype html>
+010-2
+<script>
+onload = function() {history.back()}
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010.html
new file mode 100644
index 000000000..f37e8855d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>Salvagability of document.opened document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<iframe src="010-1.html"></iframe>
+<script>
+var iframe;
+var t = async_test();
+onload = t.step_func(function() {
+ iframe = document.getElementsByTagName("iframe")[0];
+ iframe.contentDocument.open();
+ iframe.contentDocument.close();
+
+ iframe.contentWindow.setTimeout(t.step_func(function() {t.done();}), 500);
+
+ onload = null;
+
+ iframe.src = "010-2.html"
+ setTimeout(t.step_func(function() {assert_unreached()}), 1000)
+})
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011-1.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011-1.html
new file mode 100644
index 000000000..e12d78f4a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011-1.html
@@ -0,0 +1,5 @@
+<script>
+document.open()
+setTimeout(parent.t.step_func(function() {parent.t.done()}), 0);
+document.close();
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011.html
new file mode 100644
index 000000000..2acc884c5
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<title>Timeout after document.open</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+</script>
+<iframe src="011-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/012-1.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/012-1.html
new file mode 100644
index 000000000..b1937b2f8
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/012-1.html
@@ -0,0 +1,7 @@
+<script>
+onload = parent.t.step_func(function() {
+ document.open()
+ setTimeout(parent.t.step_func(function() {parent.t.done()}), 0);
+ document.close();
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/012.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/012.html
new file mode 100644
index 000000000..518454858
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/012.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<title>Timeout after document.open in load event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+</script>
+<iframe src="012-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/013-1.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/013-1.html
new file mode 100644
index 000000000..ed8843bbd
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/013-1.html
@@ -0,0 +1,7 @@
+<script>
+addEventListener("DOMContentLoaded", parent.t.step_func(function() {
+ document.open()
+ setTimeout(parent.t.step_func(function() {parent.t.done()}), 0);
+ document.close();
+}), false);
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/013.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/013.html
new file mode 100644
index 000000000..5749361aa
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/013.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<title>Timeout after document.open in DOMContentLoaded event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+</script>
+<iframe src="013-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/014-1.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/014-1.html
new file mode 100644
index 000000000..6d04da565
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/014-1.html
@@ -0,0 +1,9 @@
+<script>
+onload = parent.t.step_func(function() {
+ setTimeout(parent.t.step_func(function() {
+ document.open()
+ setTimeout(parent.t.step_func(function() {parent.t.done()}), 0);
+ document.close();
+ }), 100)
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/014.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/014.html
new file mode 100644
index 000000000..b4e4b17cf
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/014.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<title>Timeout after document.open after document is completely loaded</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+</script>
+<iframe src="014-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/015-1.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/015-1.html
new file mode 100644
index 000000000..670710090
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/015-1.html
@@ -0,0 +1,17 @@
+<script>
+onload = function() {
+ window.test_prop = 1;
+ parent.tests[0].step(function() {parent.assert_equals(test_prop, 1)});
+ document.open();
+ document.write("<script>test_prop = 2;<\/script>");
+ document.close();
+ parent.tests[0].step(function() {parent.assert_equals(test_prop, 1)});
+ parent.tests[1].step(function() {parent.assert_equals(window.test_prop, 2)});
+ parent.tests[2].step(function() {parent.assert_equals(get_this(), window)});
+ parent.tests_done();
+};
+
+function get_this() {
+ return this;
+}
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/015.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/015.html
new file mode 100644
index 000000000..5ef06176b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/015.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>Window vs global scope after document.open</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var tests = [async_test("global scope unchanged"),
+ async_test("window object changed"),
+ async_test("this is the window object")];
+function tests_done() {
+ tests.forEach(function(t) {t.done()});
+}
+</script>
+<iframe src="015-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/016-1.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/016-1.html
new file mode 100644
index 000000000..17f5140ec
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/016-1.html
@@ -0,0 +1,39 @@
+<script>
+window.test_prop = 1;
+</script>
+<script>
+onload = function() {
+ document.open();
+ document.write("<script>test_prop = 2; timeout_fired=false;<\/script>");
+ document.close();
+
+ setTimeout(function() {
+ parent.tests[0].step(function() {
+ parent.assert_equals(test_prop, 1, "Global scope from original window timeout");
+ parent.assert_equals(window.test_prop, 2, "Window property from original window timeout")
+ });
+ parent.tests[1].step(function() {
+ var t = get_this();
+ parent.assert_equals(t.test_prop, 2, "Window property from original window timeout");
+ parent.assert_equals(t, window, "Global scope from original window timeout");
+ });
+ }, 0);
+
+ window.setTimeout(function() {
+ parent.tests[2].step(function() {
+ parent.assert_equals(test_prop, 1, "Global scope from original window timeout");
+ parent.assert_equals(window.test_prop, 2, "Window property from original window timeout")
+ });
+ parent.tests[3].step(function() {
+ var t = get_this();
+ parent.assert_equals(t.test_prop, 2, "Window property from original window timeout");
+ parent.assert_equals(t, window, "Global scope from original window timeout");
+ });
+ parent.tests_done();
+ }, 100);
+};
+
+function get_this() {
+ return this;
+}
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/016.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/016.html
new file mode 100644
index 000000000..1c70fce59
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/016.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>setTimeout document.open</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var tests = [async_test("Timeout on original window, scope"),
+ async_test("Timeout on original window, this object"),
+ async_test("Timeout on new window, scope"),
+ async_test("Timeout on new window, this object")];
+function tests_done() {
+ tests.forEach(function(t) {t.done()});
+}
+</script>
+<iframe src="016-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-01.xhtml b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-01.xhtml
new file mode 100644
index 000000000..974702ae8
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-01.xhtml
@@ -0,0 +1,19 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>document.open in XHTML</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#opening-the-input-stream"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_throws("INVALID_STATE_ERR", function() {
+ document.open();
+ }, "document.open in XHTML should throw an INVALID_STATE_ERR ");
+}, "document.open in XHTML");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-02.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-02.html
new file mode 100644
index 000000000..b56e3a836
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-02.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<title>document.open with three arguments</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-open">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+function open() {
+ assert_unreached("The call should be redirected to the real window.open")
+}
+test(function(t) {
+ var w;
+ t.add_cleanup(function() {try {w.close()} catch(e) {}});
+ w = document.open("/resources/testharness.js", "", "");
+ assert_true(w instanceof w.Window, "Expected a window");
+}, "document.open should redirect to window.open when called with three arguments");
+
+test(function() {
+ var parser = new DOMParser();
+ var doc = parser.parseFromString("", "text/html");
+ assert_equals(doc.defaultView, null);
+ assert_throws("INVALID_ACCESS_ERR", function() {
+ doc.open("/resources/testharness.js", "", "");
+ });
+}, "document.open should throw when it has no window and is called with three arguments");
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03-frame.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03-frame.html
new file mode 100644
index 000000000..b5252dcea
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03-frame.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<script>
+onload = function() {
+ document.open();
+ document.close();
+ parent.report(window.setTimeout === setTimeout, false, "setTimeout");
+ parent.report(window === this, true, "this");
+ parent.done();
+}
+</script>
diff --git a/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03.html b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03.html
new file mode 100644
index 000000000..fc325d54d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<title>document.open and singleton replacement</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-open">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+function report(actual, expected, message) {
+ t.step(function() {
+ assert_equals(actual, expected, message);
+ });
+}
+function done() {
+ t.done();
+}
+</script>
+<iframe src=document.open-03-frame.html></iframe>
diff --git a/testing/web-platform/tests/html/dom/elements-embedded.js b/testing/web-platform/tests/html/dom/elements-embedded.js
new file mode 100644
index 000000000..fb9fb91d4
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements-embedded.js
@@ -0,0 +1,149 @@
+// Up-to-date as of 2013-04-06.
+var embeddedElements = {
+ img: {
+ // Conforming
+ alt: "string",
+ src: "url",
+ srcset: "string",
+ crossOrigin: {type: "enum", keywords: ["anonymous", "use-credentials"], nonCanon:{"": "anonymous"}, isNullable: true, defaultVal: null, invalidVal: "anonymous"},
+ useMap: "string",
+ isMap: "boolean",
+ width: {type: "unsigned long", customGetter: true},
+ height: {type: "unsigned long", customGetter: true},
+
+ // Obsolete
+ name: "string",
+ lowsrc: {type: "url"},
+ align: "string",
+ hspace: "unsigned long",
+ vspace: "unsigned long",
+ longDesc: "url",
+ border: {type: "string", treatNullAsEmptyString: true},
+ },
+ iframe: {
+ // Conforming
+ src: "url",
+ srcdoc: "string",
+ name: "string",
+ sandbox: "settable tokenlist",
+ allowFullscreen: "boolean",
+ width: "string",
+ height: "string",
+
+ // Obsolete
+ align: "string",
+ scrolling: "string",
+ frameBorder: "string",
+ longDesc: "url",
+ marginHeight: {type: "string", treatNullAsEmptyString: true},
+ marginWidth: {type: "string", treatNullAsEmptyString: true}
+ },
+ embed: {
+ // Conforming
+ src: "url",
+ type: "string",
+ width: "string",
+ height: "string",
+
+ // Obsolete
+ align: "string",
+ name: "string"
+ },
+ object: {
+ // Conforming
+ data: "url",
+ type: "string",
+ typeMustMatch: "boolean",
+ name: "string",
+ useMap: "string",
+ width: "string",
+ height: "string",
+
+ // Obsolete
+ align: "string",
+ archive: "string",
+ code: "string",
+ declare: "boolean",
+ hspace: "unsigned long",
+ standby: "string",
+ vspace: "unsigned long",
+ codeBase: "url",
+ codeType: "string",
+ border: {type: "string", treatNullAsEmptyString: true}
+ },
+ param: {
+ // Conforming
+ name: "string",
+ value: "string",
+
+ // Obsolete
+ type: "string",
+ valueType: "string"
+ },
+ video: {
+ // HTMLMediaElement
+ src: "url",
+ crossOrigin: {type: "enum", keywords: ["anonymous", "use-credentials"], nonCanon:{"": "anonymous"}, isNullable: true, defaultVal: null, invalidVal: "anonymous"},
+ // As with "keytype", we have no missing value default defined here.
+ preload: {type: "enum", keywords: ["none", "metadata", "auto"], nonCanon: {"": "auto"}, defaultVal: null},
+ autoplay: "boolean",
+ loop: "boolean",
+ mediaGroup: "string",
+ controls: "boolean",
+ defaultMuted: {type: "boolean", domAttrName: "muted"},
+
+ width: "unsigned long",
+ height: "unsigned long",
+ poster: "url"
+ },
+ audio: {
+ // HTMLMediaElement
+ src: "url",
+ crossOrigin: {type: "enum", keywords: ["anonymous", "use-credentials"], nonCanon:{"": "anonymous"}, isNullable: true, defaultVal: null, invalidVal: "anonymous"},
+ // As with "keytype", we have no missing value default defined here.
+ preload: {type: "enum", keywords: ["none", "metadata", "auto"], nonCanon: {"": "auto"}, defaultVal: null},
+ autoplay: "boolean",
+ loop: "boolean",
+ mediaGroup: "string",
+ controls: "boolean",
+ defaultMuted: {type: "boolean", domAttrName: "muted"}
+ },
+ source: {
+ src: "url",
+ type: "string",
+ media: "string"
+ },
+ track: {
+ kind: {type: "enum", keywords: ["subtitles", "captions", "descriptions", "chapters", "metadata"], defaultVal: "subtitles", invalidVal: "metadata"},
+ src: "url",
+ srclang: "string",
+ label: "string",
+ "default": "boolean"
+ },
+ canvas: {
+ width: {type: "unsigned long", defaultVal: 300},
+ height: {type: "unsigned long", defaultVal: 150}
+ },
+ map: {
+ name: "string"
+ },
+ area: {
+ // Conforming
+ alt: "string",
+ coords: "string",
+ shape: "string",
+ target: "string",
+ download: "string",
+ ping: "string",
+ rel: "string",
+ relList: {type: "tokenlist", domAttrName: "rel"},
+
+ // HTMLHyperlinkElementUtils
+ href: "url",
+
+ // Obsolete
+ noHref: "boolean"
+ },
+};
+
+mergeElements(embeddedElements);
diff --git a/testing/web-platform/tests/html/dom/elements-forms.js b/testing/web-platform/tests/html/dom/elements-forms.js
new file mode 100644
index 000000000..280e018aa
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements-forms.js
@@ -0,0 +1,143 @@
+// Up-to-date as of 2013-04-07.
+var formElements = {
+ form: {
+ acceptCharset: {type: "string", domAttrName: "accept-charset"},
+ // TODO: action is special
+ // action: "url",
+ autocomplete: {type: "enum", keywords: ["on", "off"], defaultVal: "on"},
+ enctype: {type: "enum", keywords: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], defaultVal: "application/x-www-form-urlencoded"},
+ encoding: {type: "enum", keywords: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], defaultVal: "application/x-www-form-urlencoded", domAttrName: "enctype"},
+ method: {type: "enum", keywords: ["get", "post", "dialog"], defaultVal: "get"},
+ name: "string",
+ noValidate: "boolean",
+ target: "string",
+ },
+ fieldset: {
+ disabled: "boolean",
+ name: "string",
+ },
+ legend: {
+ // Obsolete
+ align: "string",
+ },
+ label: {
+ htmlFor: {type: "string", domAttrName: "for"},
+ },
+ input: {
+ // Conforming
+ accept: "string",
+ alt: "string",
+ // TODO: autocomplete is special.
+ // autocomplete: {type: "enum", keywords: ["on", "off"], defaultVal: "on"},
+ autofocus: "boolean",
+ defaultChecked: {type: "boolean", domAttrName: "checked"},
+ dirName: "string",
+ disabled: "boolean",
+ // TODO: formAction is special
+ // formAction: "url",
+ formEnctype: {type: "enum", keywords: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalidVal: "application/x-www-form-urlencoded"},
+ formMethod: {type: "enum", keywords: ["get", "post"], invalidVal: "get"},
+ formNoValidate: "boolean",
+ formTarget: "string",
+ //TODO: only reflected on setting
+ //height: "unsigned long",
+ inputMode: {type: "enum", keywords: ["verbatim", "latin", "latin-name", "latin-prose", "full-width-latin", "kana", "katakana", "numeric", "tel", "email", "url"]},
+ max: "string",
+ maxLength: "limited long",
+ min: "string",
+ multiple: "boolean",
+ name: "string",
+ pattern: "string",
+ placeholder: "string",
+ readOnly: "boolean",
+ required: "boolean",
+ // https://html.spec.whatwg.org/multipage/#attr-input-size
+ size: {type: "limited unsigned long", defaultVal: 20},
+ src: "url",
+ step: "string",
+ type: {type: "enum", keywords: ["hidden", "text", "search", "tel",
+ "url", "email", "password", "datetime", "date", "month", "week",
+ "time", "datetime-local", "number", "range", "color", "checkbox",
+ "radio", "file", "submit", "image", "reset", "button"], defaultVal:
+ "text"},
+ //TODO: only reflected on setting
+ //width: "unsigned long",
+ defaultValue: {type: "string", domAttrName: "value"},
+
+ // Obsolete
+ align: "string",
+ useMap: "string",
+ },
+ button: {
+ autofocus: "boolean",
+ disabled: "boolean",
+ // TODO: formAction is special
+ // formAction: "url",
+ formEnctype: {type: "enum", keywords: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalidVal: "application/x-www-form-urlencoded"},
+ formMethod: {type: "enum", keywords: ["get", "post", "dialog"], invalidVal: "get"},
+ formNoValidate: "boolean",
+ formTarget: "string",
+ name: "string",
+ type: {type: "enum", keywords: ["submit", "reset", "button"], defaultVal: "submit"},
+ value: "string",
+ // TODO: menu
+ },
+ select: {
+ autofocus: "boolean",
+ disabled: "boolean",
+ multiple: "boolean",
+ name: "string",
+ required: "boolean",
+ size: {type: "unsigned long", defaultVal: 0},
+ },
+ datalist: {},
+ optgroup: {
+ disabled: "boolean",
+ label: "string",
+ },
+ option: {
+ disabled: "boolean",
+ label: {type: "string", customGetter: true},
+ defaultSelected: {type: "boolean", domAttrName: "selected"},
+ value: {type: "string", customGetter: true},
+ },
+ textarea: {
+ // TODO: autocomplete is special.
+ // autocomplete: {type: "enum", keywords: ["on", "off"], defaultVal: "on"},
+ autofocus: "boolean",
+ cols: {type: "limited unsigned long with fallback", defaultVal: 20},
+ dirName: "string",
+ disabled: "boolean",
+ inputMode: {type: "enum", keywords: ["verbatim", "latin", "latin-name", "latin-prose", "full-width-latin", "kana", "katakana", "numeric", "tel", "email", "url"]},
+ maxLength: "limited long",
+ name: "string",
+ placeholder: "string",
+ readOnly: "boolean",
+ required: "boolean",
+ rows: {type: "limited unsigned long with fallback", defaultVal: 2},
+ wrap: "string",
+ },
+ keygen: {
+ autofocus: "boolean",
+ challenge: "string",
+ disabled: "boolean",
+ // The invalid value default is the "unknown" state, which for our
+ // purposes seems to be the same as having no invalid value default.
+ // The missing value default depends on whether "rsa" is implemented,
+ // so we use null, which is magically reserved for "don't try testing
+ // this", since no one default is required. (TODO: we could test that
+ // it's either the RSA state or the unknown state.)
+ keytype: {type: "enum", keywords: ["rsa"], defaultVal: null},
+ name: "string",
+ },
+ output: {
+ htmlFor: {type: "settable tokenlist", domAttrName: "for" },
+ name: "string",
+ },
+ progress: {
+ max: {type: "limited double", defaultVal: 1.0},
+ },
+ meter: {},
+};
+
+mergeElements(formElements);
diff --git a/testing/web-platform/tests/html/dom/elements-grouping.js b/testing/web-platform/tests/html/dom/elements-grouping.js
new file mode 100644
index 000000000..c33f49da1
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements-grouping.js
@@ -0,0 +1,60 @@
+// Up-to-date as of 2013-04-08.
+var groupingElements = {
+ p: {
+ // Obsolete
+ align: "string",
+ },
+ hr: {
+ // Obsolete
+ align: "string",
+ color: "string",
+ noShade: "boolean",
+ size: "string",
+ width: "string",
+ },
+ pre: {
+ // Obsolete
+ width: "long",
+ },
+ blockquote: {
+ cite: "url",
+ },
+ ol: {
+ // Conforming
+ reversed: "boolean",
+ // TODO: This should have a default value of the list's length if the
+ // reversed attribute is set.
+ start: {type: "long", defaultVal: 1},
+ type: "string",
+
+ // Obsolete
+ compact: "boolean",
+ },
+ ul: {
+ // Obsolete
+ compact: "boolean",
+ type: "string",
+ },
+ li: {
+ // Conforming
+ value: "long",
+
+ // Obsolete
+ type: "string",
+ },
+ dl: {
+ // Obsolete
+ compact: "boolean",
+ },
+ dt: {},
+ dd: {},
+ figure: {},
+ figcaption: {},
+ main: {},
+ div: {
+ // Obsolete
+ align: "string",
+ },
+};
+
+mergeElements(groupingElements);
diff --git a/testing/web-platform/tests/html/dom/elements-metadata.js b/testing/web-platform/tests/html/dom/elements-metadata.js
new file mode 100644
index 000000000..05d61a74d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements-metadata.js
@@ -0,0 +1,40 @@
+// Up-to-date as of 2013-04-08.
+var metadataElements = {
+ head: {},
+ title: {},
+ base: {
+ // XXX href is weird. href: "url",
+ target: "string",
+ },
+ link: {
+ // Conforming
+ href: "url",
+ crossOrigin: {type: "enum", keywords: ["anonymous", "use-credentials"], nonCanon:{"": "anonymous"}, isNullable: true, defaultVal: null, invalidVal: "anonymous"},
+ rel: "string",
+ relList: {type: "tokenlist", domAttrName: "rel"},
+ media: "string",
+ hreflang: "string",
+ type: "string",
+ sizes: "settable tokenlist",
+
+ // Obsolete
+ charset: "string",
+ rev: "string",
+ target: "string",
+ },
+ meta: {
+ // Conforming
+ name: "string",
+ httpEquiv: {type: "string", domAttrName: "http-equiv"},
+ content: "string",
+
+ // Obsolete
+ scheme: "string",
+ },
+ style: {
+ media: "string",
+ type: "string",
+ },
+};
+
+mergeElements(metadataElements);
diff --git a/testing/web-platform/tests/html/dom/elements-misc.js b/testing/web-platform/tests/html/dom/elements-misc.js
new file mode 100644
index 000000000..8990afecf
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements-misc.js
@@ -0,0 +1,61 @@
+// Up-to-date as of 2013-04-09.
+var miscElements = {
+ // "The root element" section
+ html: {
+ // Obsolete
+ version: "string",
+ },
+
+ // "Scripting" section
+ script: {
+ src: "url",
+ type: "string",
+ charset: "string",
+ // TODO: async attribute (complicated).
+ defer: "boolean",
+ crossOrigin: {type: "enum", keywords: ["anonymous", "use-credentials"], nonCanon:{"": "anonymous"}, isNullable: true, defaultVal: null, invalidVal: "anonymous"},
+ },
+ noscript: {},
+
+ // "Edits" section
+ ins: {
+ cite: "url",
+ dateTime: "string",
+ },
+ del: {
+ cite: "url",
+ dateTime: "string",
+ },
+
+ // "Interactive elements" section
+ details: {
+ open: "boolean",
+ },
+ summary: {},
+ menu: {
+ // Conforming
+ //TODO: check that missing value default is popup if parent's type is popup
+ type: {type: "enum", keywords:["popup", "toolbar"], defaultVal: "toolbar"},
+ label: "string",
+
+ // Obsolete
+ compact: "boolean",
+ },
+ menuitem: {
+ type: {type: "enum", keywords: ["command", "checkbox", "radio"], defaultVal: "command"},
+ label: "string",
+ icon: "url",
+ disabled: "boolean",
+ checked: "boolean",
+ radiogroup: "string",
+ "default": "boolean",
+ },
+ dialog: {
+ open: "boolean",
+ },
+
+ // Global attributes should exist even on unknown elements
+ undefinedelement: {},
+};
+
+mergeElements(miscElements);
diff --git a/testing/web-platform/tests/html/dom/elements-obsolete.js b/testing/web-platform/tests/html/dom/elements-obsolete.js
new file mode 100644
index 000000000..3b6ae363b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements-obsolete.js
@@ -0,0 +1,58 @@
+// Up-to-date as of 2013-04-13.
+var obsoleteElements = {
+ // https://html.spec.whatwg.org/multipage/#the-applet-element
+ applet: {
+ align: "string",
+ alt: "string",
+ archive: "string",
+ code: "string",
+ codeBase: "url",
+ height: "string",
+ hspace: "unsigned long",
+ name: "string",
+ object: "url",
+ vspace: "unsigned long",
+ width: "string",
+ },
+ // https://html.spec.whatwg.org/multipage/#the-marquee-element-2
+ marquee: {
+ behavior: "string",
+ bgColor: "string",
+ direction: "string",
+ height: "string",
+ hspace: "unsigned long",
+ scrollAmount: {type: "unsigned long", defaultVal: 6},
+ scrollDelay: {type: "unsigned long", defaultVal: 85},
+ trueSpeed: "boolean",
+ vspace: "unsigned long",
+ width: "string",
+ },
+ // https://html.spec.whatwg.org/multipage/#frameset
+ frameset: {
+ cols: "string",
+ rows: "string",
+ },
+ // https://html.spec.whatwg.org/multipage/#frame
+ frame: {
+ name: "string",
+ scrolling: "string",
+ src: "url",
+ frameBorder: "string",
+ longDesc: "url",
+ noResize: "boolean",
+ marginHeight: {type: "string", treatNullAsEmptyString: true},
+ marginWidth: {type: "string", treatNullAsEmptyString: true},
+ },
+ // https://html.spec.whatwg.org/multipage/#htmldirectoryelement
+ dir: {
+ compact: "boolean",
+ },
+ // https://html.spec.whatwg.org/multipage/#htmlfontelement
+ font: {
+ color: {type: "string", treatNullAsEmptyString: true},
+ face: "string",
+ size: "string",
+ },
+};
+
+mergeElements(obsoleteElements);
diff --git a/testing/web-platform/tests/html/dom/elements-sections.js b/testing/web-platform/tests/html/dom/elements-sections.js
new file mode 100644
index 000000000..a22aed9f6
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements-sections.js
@@ -0,0 +1,63 @@
+// Up-to-date as of 2013-04-12.
+var sectionElements = {
+ body: {
+ // Obsolete
+ text: {type: "string", treatNullAsEmptyString: true},
+ link: {type: "string", treatNullAsEmptyString: true},
+ vLink: {type: "string", treatNullAsEmptyString: true},
+ aLink: {type: "string", treatNullAsEmptyString: true},
+ bgColor: {type: "string", treatNullAsEmptyString: true},
+ background: "string",
+ },
+ article: {},
+ section: {},
+ nav: {},
+ aside: {},
+ h1: {
+ // Obsolete
+ align: "string",
+ },
+ h2: {
+ // Obsolete
+ align: "string",
+ },
+ h3: {
+ // Obsolete
+ align: "string",
+ },
+ h4: {
+ // Obsolete
+ align: "string",
+ },
+ h5: {
+ // Obsolete
+ align: "string",
+ },
+ h6: {
+ // Obsolete
+ align: "string",
+ },
+ hgroup: {},
+ header: {},
+ footer: {},
+ address: {},
+};
+
+mergeElements(sectionElements);
+
+extraTests.push(function() {
+ ReflectionTests.reflects({type: "enum", keywords: ["ltr", "rtl", "auto"]}, "dir", document, "dir", document.documentElement);
+ // TODO: these behave differently if the body element is a frameset. Also
+ // should probably test with multiple bodies.
+ ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "fgColor", document, "text", document.body);
+ ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "linkColor", document, "link", document.body);
+ ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "vlinkColor", document, "vlink", document.body);
+ ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "alinkColor", document, "alink", document.body);
+ ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "bgColor", document, "bgcolor", document.body);
+ // Don't mess up the colors :)
+ document.documentElement.removeAttribute("dir");
+ var attrs = ["text", "bgcolor", "link", "alink", "vlink"];
+ for (var i = 0; i < attrs.length; i++) {
+ document.body.removeAttribute(attrs[i]);
+ }
+});
diff --git a/testing/web-platform/tests/html/dom/elements-tabular.js b/testing/web-platform/tests/html/dom/elements-tabular.js
new file mode 100644
index 000000000..bb54ade30
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements-tabular.js
@@ -0,0 +1,109 @@
+// Up-to-date as of 2013-04-12.
+var tabularElements = {
+ table: {
+ // Obsolete
+ align: "string",
+ border: "string",
+ frame: "string",
+ rules: "string",
+ summary: "string",
+ width: "string",
+ bgColor: {type: "string", treatNullAsEmptyString: true},
+ cellPadding: {type: "string", treatNullAsEmptyString: true},
+ cellSpacing: {type: "string", treatNullAsEmptyString: true},
+ },
+ caption: {
+ // Obsolete
+ align: "string",
+ },
+ colgroup: {
+ span: {type: "limited unsigned long with fallback", defaultVal: 1},
+
+ // Obsolete
+ align: "string",
+ ch: {type: "string", domAttrName: "char"},
+ chOff: {type: "string", domAttrName: "charoff"},
+ vAlign: "string",
+ width: "string",
+ },
+ col: {
+ // Conforming
+ span: {type: "limited unsigned long with fallback", defaultVal: 1},
+
+ // Obsolete
+ align: "string",
+ ch: {type: "string", domAttrName: "char"},
+ chOff: {type: "string", domAttrName: "charoff"},
+ vAlign: "string",
+ width: "string",
+ },
+ tbody: {
+ // Obsolete
+ align: "string",
+ ch: {type: "string", domAttrName: "char"},
+ chOff: {type: "string", domAttrName: "charoff"},
+ vAlign: "string",
+ },
+ thead: {
+ // Obsolete
+ align: "string",
+ ch: {type: "string", domAttrName: "char"},
+ chOff: {type: "string", domAttrName: "charoff"},
+ vAlign: "string",
+ },
+ tfoot: {
+ // Obsolete
+ align: "string",
+ ch: {type: "string", domAttrName: "char"},
+ chOff: {type: "string", domAttrName: "charoff"},
+ vAlign: "string",
+ },
+ tr: {
+ // Obsolete
+ align: "string",
+ ch: {type: "string", domAttrName: "char"},
+ chOff: {type: "string", domAttrName: "charoff"},
+ vAlign: "string",
+ bgColor: {type: "string", treatNullAsEmptyString: true},
+ },
+ td: {
+ // HTMLTableCellElement (Conforming)
+ colSpan: {type: "unsigned long", defaultVal: 1},
+ rowSpan: {type: "unsigned long", defaultVal: 1},
+ headers: "settable tokenlist",
+ scope: {type: "enum", keywords: ["row", "col", "rowgroup", "colgroup"]},
+ abbr: "string",
+
+ // HTMLTableCellElement (Obsolete)
+ align: "string",
+ axis: "string",
+ height: "string",
+ width: "string",
+ ch: {type: "string", domAttrName: "char"},
+ chOff: {type: "string", domAttrName: "charoff"},
+ noWrap: "boolean",
+ vAlign: "string",
+ bgColor: {type: "string", treatNullAsEmptyString: true},
+ },
+ th: {
+ // HTMLTableCellElement (Conforming)
+ colSpan: {type: "unsigned long", defaultVal: 1},
+ rowSpan: {type: "unsigned long", defaultVal: 1},
+ headers: "settable tokenlist",
+ scope: {type: "enum", keywords: ["row", "col", "rowgroup", "colgroup"]},
+ abbr: "string",
+
+ // HTMLTableCellElement (Obsolete)
+ align: "string",
+ axis: "string",
+ height: "string",
+ width: "string",
+ ch: {type: "string", domAttrName: "char"},
+ chOff: {type: "string", domAttrName: "charoff"},
+ noWrap: "boolean",
+ vAlign: "string",
+ bgColor: {type: "string", treatNullAsEmptyString: true},
+ },
+};
+
+mergeElements(tabularElements);
diff --git a/testing/web-platform/tests/html/dom/elements-text.js b/testing/web-platform/tests/html/dom/elements-text.js
new file mode 100644
index 000000000..268eb269c
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements-text.js
@@ -0,0 +1,64 @@
+// Up-to-date as of 2013-04-19.
+var textElements = {
+ a: {
+ // Conforming
+ target: "string",
+ download: "string",
+ ping: "string",
+ rel: "string",
+ relList: {type: "tokenlist", domAttrName: "rel"},
+ hreflang: "string",
+ type: "string",
+
+ // HTMLHyperlinkElementUtils
+ href: "url",
+
+ // Obsolete
+ coords: "string",
+ charset: "string",
+ name: "string",
+ rev: "string",
+ shape: "string",
+ },
+ em: {},
+ strong: {},
+ small: {},
+ s: {},
+ cite: {},
+ q: {
+ cite: "url",
+ },
+ dfn: {},
+ abbr: {},
+ data: {
+ value: "string",
+ },
+ time: {
+ dateTime: "string",
+ },
+ code: {},
+ // Opera 11.50 doesn't allow unquoted "var" here, although ES5 does and
+ // other browsers support it.
+ "var": {},
+ samp: {},
+ kbd: {},
+ sub: {},
+ sup: {},
+ i: {},
+ b: {},
+ u: {},
+ mark: {},
+ ruby: {},
+ rt: {},
+ rp: {},
+ bdi: {},
+ bdo: {},
+ span: {},
+ br: {
+ // Obsolete
+ clear: "string",
+ },
+ wbr: {},
+};
+
+mergeElements(textElements);
diff --git a/testing/web-platform/tests/html/dom/elements/.gitkeep b/testing/web-platform/tests/html/dom/elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/elements/content-models/.gitkeep b/testing/web-platform/tests/html/dom/elements/content-models/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/content-models/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/elements/content-models/contains.json b/testing/web-platform/tests/html/dom/elements/content-models/contains.json
new file mode 100644
index 000000000..42f158d36
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/content-models/contains.json
@@ -0,0 +1,48 @@
+[
+ {
+ "id": "kinds-of-content",
+ "original_id": "kinds-of-content",
+ "children": [
+ {
+ "id": "metadata-content",
+ "original_id": "metadata-content"
+ },
+ {
+ "id": "flow-content",
+ "original_id": "flow-content"
+ },
+ {
+ "id": "sectioning-content",
+ "original_id": "sectioning-content"
+ },
+ {
+ "id": "heading-content",
+ "original_id": "heading-content"
+ },
+ {
+ "id": "phrasing-content",
+ "original_id": "phrasing-content"
+ },
+ {
+ "id": "embedded-content",
+ "original_id": "embedded-content"
+ },
+ {
+ "id": "interactive-content",
+ "original_id": "interactive-content"
+ },
+ {
+ "id": "palpable-content",
+ "original_id": "palpable-content"
+ }
+ ]
+ },
+ {
+ "id": "transparent-content-models",
+ "original_id": "transparent-content-models"
+ },
+ {
+ "id": "paragraphs",
+ "original_id": "paragraphs"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/element-definitions/.gitkeep b/testing/web-platform/tests/html/dom/elements/element-definitions/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/element-definitions/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/elements/element-definitions/contains.json b/testing/web-platform/tests/html/dom/elements/element-definitions/contains.json
new file mode 100644
index 000000000..a942e85a2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/element-definitions/contains.json
@@ -0,0 +1,6 @@
+[
+ {
+ "id": "attributes",
+ "original_id": "attributes"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/elements-in-the-dom/.gitkeep b/testing/web-platform/tests/html/dom/elements/elements-in-the-dom/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/elements-in-the-dom/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/elements/elements-in-the-dom/unknown-element.html b/testing/web-platform/tests/html/dom/elements/elements-in-the-dom/unknown-element.html
new file mode 100644
index 000000000..907b14837
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/elements-in-the-dom/unknown-element.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<title>HTMLUnknownElement</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#htmlunknownelement">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var elt = document.createElement("xxx");
+ assert_true(window.HTMLUnknownElement && elt instanceof HTMLUnknownElement,
+ "not an instance of HTMLUnknownElement");
+ assert_true(window.HTMLSpanElement && !(elt instanceof HTMLSpanElement),
+ "an instance of HTMLSpanElement");
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/.gitkeep b/testing/web-platform/tests/html/dom/elements/global-attributes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/.htaccess b/testing/web-platform/tests/html/dom/elements/global-attributes/.htaccess
new file mode 100644
index 000000000..94e9a4f19
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/.htaccess
@@ -0,0 +1,16 @@
+AddType 'text/html; charset=UTF-8' html
+<Files 'the-lang-attribute-003.html'>
+AddLanguage 'ko' .html
+</Files>
+<Files 'the-lang-attribute-005.html'>
+AddLanguage 'zh' .html
+</Files>
+<Files 'the-lang-attribute-006.html'>
+AddLanguage 'zh' .html
+</Files>
+<Files 'the-lang-attribute-009.html'>
+AddLanguage 'ko' .html
+</Files>
+<Files 'the-lang-attribute-011.html'>
+AddLanguage 'ko,zh,ja' .html
+</Files>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/classlist-nonstring.html b/testing/web-platform/tests/html/dom/elements/global-attributes/classlist-nonstring.html
new file mode 100644
index 000000000..5b0560b31
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/classlist-nonstring.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>classList: non-string contains</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#classes">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#domtokenlist">
+<link rel="help" href="https://heycam.github.io/webidl/#es-DOMString">
+<link rel="help" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf#page=57">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<ul>
+<li class=undefined>
+<li class=null>
+<li class=0>
+<li class=NaN>
+<li class=Infinity>
+<li class=-Infinity>
+</ul>
+<script>
+var items = document.getElementById("test")
+ .getElementsByTagName("li");
+var tests = [undefined, null, -0, +0, NaN, +Infinity, -Infinity];
+var results = [
+ [true, false, false, false, false, false, false], // "undefined"
+ [false, true, false, false, false, false, false], // "null"
+ [false, false, true, true, false, false, false], // "0"
+ [false, false, false, false, true, false, false], // "NaN"
+ [false, false, false, false, false, true, false], // "Infinity"
+ [false, false, false, false, false, false, true ] // "-Infinity"
+];
+</script>
+</div>
+<script>
+test(function() {
+ for (var i = 0, il = items.length; i < il; ++i) {
+ test(function() {
+ for (var j = 0, jl = tests.length; j < jl; ++j) {
+ assert_equals(items[i].classList.contains(tests[j]), results[i][j]);
+ }
+ })
+ }
+})
+</script>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/contains.json b/testing/web-platform/tests/html/dom/elements/global-attributes/contains.json
new file mode 100644
index 000000000..c413488b5
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/contains.json
@@ -0,0 +1,38 @@
+[
+ {
+ "id": "the-id-attribute",
+ "original_id": "the-id-attribute"
+ },
+ {
+ "id": "the-title-attribute",
+ "original_id": "the-title-attribute"
+ },
+ {
+ "id": "the-lang-and-xml-lang-attributes",
+ "original_id": "the-lang-and-xml:lang-attributes"
+ },
+ {
+ "id": "the-translate-attribute",
+ "original_id": "the-translate-attribute"
+ },
+ {
+ "id": "the-xml-base-attribute-xml-only",
+ "original_id": "the-xml:base-attribute-(xml-only)"
+ },
+ {
+ "id": "the-dir-attribute",
+ "original_id": "the-dir-attribute"
+ },
+ {
+ "id": "classes",
+ "original_id": "classes"
+ },
+ {
+ "id": "the-style-attribute",
+ "original_id": "the-style-attribute"
+ },
+ {
+ "id": "embedding-custom-non-visible-data-with-the-data-attributes",
+ "original_id": "embedding-custom-non-visible-data-with-the-data-*-attributes"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/custom-attrs.html b/testing/web-platform/tests/html/dom/elements/global-attributes/custom-attrs.html
new file mode 100644
index 000000000..a1e41dac2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/custom-attrs.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Element Custom Attributes</title>
+ <link rel="author" title="Bruno de Oliveira Abinader" href="mailto:bruno.d@partner.samsung.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-dataset">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#xml">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/dom/nodes/attributes.js"></script>
+ </head>
+ <body>
+ <h1>Element Custom Attributes</h1>
+ <div id="log"></div>
+ <script>
+ test(function() {
+ var div = document.createElement("div");
+ div.setAttributeNS("foo", "data-my-custom-attr", "first");
+ div.setAttributeNS("bar", "data-my-custom-attr", "second");
+ div.dataset.myCustomAttr = "third";
+
+ assert_equals(div.attributes.length, 3);
+ attributes_are(div, [["data-my-custom-attr", "first", "foo"],
+ ["data-my-custom-attr", "second", "bar"],
+ ["data-my-custom-attr", "third", null]]);
+ }, "Setting an Element's dataset property should not interfere with namespaced attributes with same name");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/data_unicode_attr.html b/testing/web-platform/tests/html/dom/elements/global-attributes/data_unicode_attr.html
new file mode 100644
index 000000000..17077dafd
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/data_unicode_attr.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<meta charset="utf-8">
+<title>HTML Test: dataset attribute</title>
+<link rel="author" title="ElegantPig" href="mailto:neil.ep@hotmail.com">
+<link rel="author" title="Xiaojun Wu" href="mailto:xiaojunx.a.wu@intel.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id='log'></div>
+<div id="d1" data-weapons="laser 2" data-中文属性="中文"></div>
+<script>
+
+test(function() {
+ var d1 = document.getElementById("d1");
+ assert_equals(d1.dataset.weapons, "laser 2");
+}, "dataset - SBCS");
+
+test(function() {
+ var d1 = document.getElementById("d1");
+ assert_equals(d1.dataset.中文属性, "中文");
+}, "dataset - UNICODE");
+
+</script>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-delete.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-delete.html
new file mode 100644
index 000000000..65e131f44
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-delete.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Dataset - Delete</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <h1>Dataset - Delete</h1>
+ <div id="log"></div>
+ <script>
+ function testDelete(attr, prop)
+ {
+ var d = document.createElement("div");
+ d.setAttribute(attr, "value");
+ delete d.dataset[prop];
+ return d.hasAttribute(attr) === false && d.getAttribute(attr) != "value";
+ }
+
+ function testDeleteNoAdd(prop)
+ {
+ var d = document.createElement("div");
+ delete d.dataset[prop];
+ return true;
+ }
+
+ test(function() { assert_true(testDelete('data-foo', 'foo')); },
+ "Deleting element.dataset['foo'] should also remove an attribute with name 'data-foo' should it exist.");
+ test(function() { assert_true(testDelete('data-foo-bar', 'fooBar')); },
+ "Deleting element.dataset['fooBar'] should also remove an attribute with name 'data-foo-bar' should it exist.");
+ test(function() { assert_true(testDelete('data--', '-')); },
+ "Deleting element.dataset['-'] should also remove an attribute with name 'data--' should it exist.");
+ test(function() { assert_true(testDelete('data--foo', 'Foo')); },
+ "Deleting element.dataset['Foo'] should also remove an attribute with name 'data--foo' should it exist.");
+ test(function() { assert_true(testDeleteNoAdd('data--foo', '-foo')); },
+ "Deleting element.dataset['-foo'] should also remove an attribute with name 'data--foo' should it exist.");
+ test(function() { assert_true(testDelete('data---foo', '-Foo')); },
+ "Deleting element.dataset['-Foo'] should also remove an attribute with name 'data---foo' should it exist.");
+ test(function() { assert_true(testDelete('data-', '')); },
+ "Deleting element.dataset[''] should also remove an attribute with name 'data-' should it exist.");
+ test(function() { assert_true(testDelete('data-\xE0', '\xE0')); },
+ "Deleting element.dataset['\xE0'] should also remove an attribute with name 'data-\xE0' should it exist.");
+ test(function() { assert_true(testDeleteNoAdd('foo')); },
+ "Deleting element.dataset['foo'] should not throw if even if the element does now have an attribute with the name data-foo.");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-enumeration.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-enumeration.html
new file mode 100644
index 000000000..4b1063379
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-enumeration.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Dataset - Enumeration</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <h1>Dataset - Enumeration</h1>
+ <div id="log"></div>
+ <script>
+ function testEnumeration(array)
+ {
+ var d = document.createElement("div");
+ for (var i = 0; i < array.length; ++i)
+ d.setAttribute(array[i], "value");
+
+ var count = 0;
+ for (var item in d.dataset)
+ count++;
+
+ return count;
+ }
+
+ test(function() { assert_equals(testEnumeration(['data-foo', 'data-bar', 'data-baz']), 3); },
+ "A dataset should be enumeratable.");
+ test(function() { assert_equals(testEnumeration(['data-foo', 'data-bar', 'dataFoo']), 2); },
+ "Only attributes who qualify as dataset properties should be enumeratable in the dataset.");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-get.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-get.html
new file mode 100644
index 000000000..ab4078c4f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-get.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Dataset - Get</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <h1>Dataset - Get</h1>
+ <div id="log"></div>
+ <script>
+ function testGet(attr, expected)
+ {
+ var d = document.createElement("div");
+ d.setAttribute(attr, "value");
+ return d.dataset[expected] == "value";
+ }
+
+ test(function() { assert_true(testGet('data-foo', 'foo')); },
+ "Getting element.dataset['foo'] should return the value of element.getAttribute('data-foo')'");
+ test(function() { assert_true(testGet('data-foo-bar', 'fooBar')); },
+ "Getting element.dataset['fooBar'] should return the value of element.getAttribute('data-foo-bar')'");
+ test(function() { assert_true(testGet('data--', '-')); },
+ "Getting element.dataset['-'] should return the value of element.getAttribute('data--')'");
+ test(function() { assert_true(testGet('data--foo', 'Foo')); },
+ "Getting element.dataset['Foo'] should return the value of element.getAttribute('data--foo')'");
+ test(function() { assert_true(testGet('data---foo', '-Foo')); },
+ "Getting element.dataset['-Foo'] should return the value of element.getAttribute('data---foo')'");
+ test(function() { assert_true(testGet('data-Foo', 'foo')); },
+ "Getting element.dataset['foo'] should return the value of element.getAttribute('data-Foo')'");
+ test(function() { assert_true(testGet('data-', '')); },
+ "Getting element.dataset[''] should return the value of element.getAttribute('data-')'");
+ test(function() { assert_true(testGet('data-\xE0', '\xE0')); },
+ "Getting element.dataset['\xE0'] should return the value of element.getAttribute('data-\xE0')'");
+ test(function() { assert_true(testGet('data-to-string', 'toString')); },
+ "Getting element.dataset['toString'] should return the value of element.getAttribute('data-to-string')'");
+
+ function matchesNothingInDataset(attr)
+ {
+ var d = document.createElement("div");
+ d.setAttribute(attr, "value");
+
+ if (!d.dataset)
+ return false;
+
+ var count = 0;
+ for (var item in d.dataset)
+ count++;
+ return count == 0;
+ }
+
+ test(function() { assert_true(matchesNothingInDataset('dataFoo')); },
+ "Tests that an attribute named dataFoo does not make an entry in the dataset DOMStringMap.");
+
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-prototype.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-prototype.html
new file mode 100644
index 000000000..6b1661846
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-prototype.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Dataset - element.dataset is an instance of DOMStringMap</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <h1>Dataset - element.dataset is an instance of DOMStringMap</h1>
+ <div id="log"></div>
+ <script>
+ test(function() { assert_true(document.createElement("div").dataset instanceof window.DOMStringMap); },
+ "An elements dataset property is an instance of a DOMStringMap");
+ test(function() {
+ var dataset = document.createElement("div").dataset;
+ assert_true("toString" in dataset, '"toString" in dataset');
+ assert_equals(dataset.toString, Object.prototype.toString);
+ assert_false("expando" in dataset, '"expando" in dataset');
+ assert_equals(dataset.expando, undefined);
+ Object.prototype.expando = 42;
+ assert_true("expando" in dataset, '"expando" in dataset');
+ assert_equals(dataset.expando, 42);
+ }, "Properties on Object.prototype should shine through.");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-set.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-set.html
new file mode 100644
index 000000000..722b17977
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset-set.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Dataset - Set</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <h1>Dataset - Set</h1>
+ <div id="log"></div>
+ <script>
+ function testSet(prop, expected)
+ {
+ var d = document.createElement("div");
+ d.dataset[prop] = "value";
+ return d.getAttribute(expected) == "value";
+ }
+
+ test(function() { assert_true(testSet('foo', 'data-foo')); },
+ "Setting element.dataset['foo'] should also change the value of element.getAttribute('data-foo')'");
+ test(function() { assert_true(testSet('fooBar', 'data-foo-bar')); },
+ "Setting element.dataset['fooBar'] should also change the value of element.getAttribute('data-foo-bar')'");
+ test(function() { assert_true(testSet('-', 'data--')); },
+ "Setting element.dataset['-'] should also change the value of element.getAttribute('data--')'");
+ test(function() { assert_true(testSet('Foo', 'data--foo')); },
+ "Setting element.dataset['Foo'] should also change the value of element.getAttribute('data--foo')'");
+ test(function() { assert_true(testSet('-Foo', 'data---foo')); },
+ "Setting element.dataset['-Foo'] should also change the value of element.getAttribute('data---foo')'");
+ test(function() { assert_true(testSet('', 'data-')); },
+ "Setting element.dataset[''] should also change the value of element.getAttribute('data-')'");
+ test(function() { assert_true(testSet('\xE0', 'data-\xE0')); },
+ "Setting element.dataset['\xE0'] should also change the value of element.getAttribute('data-\xE0')'");
+ test(function() { assert_throws('SYNTAX_ERR', function() { testSet('-foo', 'dummy') }); },
+ "Setting element.dataset['-foo'] should throw a SYNTAX_ERR'");
+ test(function() { assert_throws('INVALID_CHARACTER_ERR', function() { testSet('foo\x20', 'dummy') }); },
+ "Setting element.dataset['foo\x20'] should throw an INVALID_CHARACTER_ERR'");
+ test(function() { assert_throws('INVALID_CHARACTER_ERR', function() { testSet('foo\uF900', 'dummy') }); },
+ "Setting element.dataset['foo\uF900'] should throw an INVALID_CHARACTER_ERR'");
+
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dataset.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset.html
new file mode 100644
index 000000000..a4a16d014
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dataset.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>dataset: should exist and work on HTML and SVG elements, but not random elements</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var div = document.createElement("div");
+test(function() {
+ assert_true(div.dataset instanceof DOMStringMap);
+}, "HTML elements should have a .dataset");
+test(function() {
+ assert_false("foo" in div.dataset);
+ assert_equals(div.dataset.foo, undefined);
+}, "Should return 'undefined' before setting an attribute")
+test(function() {
+ div.setAttribute("data-foo", "value");
+ assert_true("foo" in div.dataset);
+ assert_equals(div.dataset.foo, "value");
+}, "Should return 'value' if that's the value")
+test(function() {
+ div.setAttribute("data-foo", "");
+ assert_true("foo" in div.dataset);
+ assert_equals(div.dataset.foo, "");
+}, "Should return the empty string if that's the value")
+test(function() {
+ div.removeAttribute("data-foo");
+ assert_false("foo" in div.dataset);
+ assert_equals(div.dataset.foo, undefined);
+}, "Should return 'undefined' after removing an attribute")
+test(function() {
+ assert_equals(document.createElementNS("test", "test").dataset, undefined);
+}, "Should not have a .dataset on random elements");
+test(function() {
+ var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg")
+ assert_true(svg.dataset instanceof DOMStringMap);
+}, "SVG elements should have a .dataset");
+</script>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-L-ref.html
new file mode 100644
index 000000000..de6e13b3a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-L-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with EN, then L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Latin letter A since digits are not strongly
+ directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="ltr">123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="ltr">123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-L.html
new file mode 100644
index 000000000..fa8d793bd
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-L.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with EN, then L</title>
+ <link rel="match" href="dir_auto-EN-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Latin letter A since digits are not strongly
+ directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="auto">123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="auto">123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="ltr">123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-R-ref.html
new file mode 100644
index 000000000..15bd618dc
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-R-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with EN, then R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Hebrew letter Alef since digits are not strongly
+ directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="rtl">123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="rtl">123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="rtl">123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="rtl">123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-R.html
new file mode 100644
index 000000000..7165de583
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-EN-R.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with EN, then R</title>
+ <link rel="match" href="dir_auto-EN-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Hebrew letter Alef since digits are not strongly
+ directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="auto">123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="auto">123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="rtl">123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="rtl">123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-L-ref.html
new file mode 100644
index 000000000..23da64ed9
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-L-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="ltr">ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="ltr">ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-L.html
new file mode 100644
index 000000000..3896bcb76
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-L.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with L</title>
+ <link rel="match" href="dir_auto-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="auto">ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="auto">ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="ltr">ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-L-ref.html
new file mode 100644
index 000000000..c7977d189
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-L-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with N, then EN, then L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Latin letter A since neutrals and digits are not
+ strongly directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="ltr">.-=123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">.-=123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="ltr">.-=123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">.-=123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-L.html
new file mode 100644
index 000000000..21ca0338d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-L.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with N, then EN, then L</title>
+ <link rel="match" href="dir_auto-N-EN-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Latin letter A since neutrals and digits are not
+ strongly directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="auto">.-=123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="auto">.-=123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="ltr">.-=123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">.-=123ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-R-ref.html
new file mode 100644
index 000000000..aae50bc72
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-R-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with N, then EN, then R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Hebrew letter Alef since neutrals and digits are not
+ strongly directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="rtl">.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="rtl">.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="rtl">.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="rtl">.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-R.html
new file mode 100644
index 000000000..b10a52b1a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-R.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with N, then EN, then R</title>
+ <link rel="match" href="dir_auto-N-EN-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Hebrew letter Alef since neutrals and digits are not
+ strongly directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="auto">.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="auto">.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="rtl">.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="rtl">.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-ref.html
new file mode 100644
index 000000000..154d56aaf
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN-ref.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with N, then EN, then L</title>
+ <link rel="match" href="dir_auto-N-EN-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text, ignoring neutrals and numbers.
+ If there is no strong character, as in this test, the direction defaults to LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="ltr">@123!</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">@123!</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="ltr">@123!</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">@123!</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN.html
new file mode 100644
index 000000000..5d948d345
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-EN.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with N, then EN, then L</title>
+ <link rel="match" href="dir_auto-N-EN-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text, ignoring neutrals and numbers.
+ If there is no strong character, as in this test, the direction defaults to LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="auto">@123!</p>
+ </div>
+ <div dir="rtl">
+ <p dir="auto">@123!</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="ltr">@123!</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">@123!</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-L-ref.html
new file mode 100644
index 000000000..4bbaca1e3
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-L-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with N, then L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Latin letter A since neutrals are not
+ strongly directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="ltr">.-=ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">.-=ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="ltr">.-=ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">.-=ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-L.html
new file mode 100644
index 000000000..945fa0677
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-L.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with N, then L</title>
+ <link rel="match" href="dir_auto-N-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Latin letter A since neutrals are not
+ strongly directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="auto">.-=ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="auto">.-=ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="ltr">.-=ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="ltr">.-=ABC&#x05D0;&#x05D1;&#x05D2;.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-R-ref.html
new file mode 100644
index 000000000..7a1daeddd
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-R-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with N, then R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Hebrew letter Alef since neutrals are not
+ strongly directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="rtl">.-=&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="rtl">.-=&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="rtl">.-=&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="rtl">.-=&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-R.html
new file mode 100644
index 000000000..bf27a16a2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-N-R.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with N, then R</title>
+ <link rel="match" href="dir_auto-N-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Hebrew letter Alef since neutrals are not
+ strongly directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="auto">.-=&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="auto">.-=&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="rtl">.-=&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="rtl">.-=&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-R-ref.html
new file mode 100644
index 000000000..c9dc5301b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-R-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="rtl">&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="rtl">&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="rtl">&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="rtl">&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-R.html
new file mode 100644
index 000000000..69a62fc63
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-R.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with R</title>
+ <link rel="match" href="dir_auto-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <p dir="auto">&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="auto">&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <p dir="rtl">&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ <div dir="rtl">
+ <p dir="rtl">&#x05D0;&#x05D1;&#x05D2;ABC.</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-L-ref.html
new file mode 100644
index 000000000..4e42a11a9
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-L-ref.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with L within contained element</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text, including text within contained elements.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ &#x05D3; - The Hebrew letter Dalet (strongly RTL).
+ &#x05D4; - The Hebrew letter He (strongly RTL).
+ &#x05D5; - The Hebrew letter Vav (strongly RTL).
+ &#x05D6; - The Hebrew letter Zayin (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="ltr"><div><div>ABC&#x05D0;&#x05D1;&#x05D2;.</div>&#x05D3;&#x05D4;</div>&#x05D5;</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><div><div>ABC&#x05D0;&#x05D1;&#x05D2;.</div>&#x05D3;&#x05D4;</div>&#x05D5;</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><div><div>ABC&#x05D0;&#x05D1;&#x05D2;.</div>&#x05D3;&#x05D4;</div>&#x05D5;</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><div><div>ABC&#x05D0;&#x05D1;&#x05D2;.</div>&#x05D3;&#x05D4;</div>&#x05D5;</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-L.html
new file mode 100644
index 000000000..f71f318bf
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-L.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with L within contained element</title>
+ <link rel="match" href="dir_auto-contained-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text, including text within contained elements.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ &#x05D3; - The Hebrew letter Dalet (strongly RTL).
+ &#x05D4; - The Hebrew letter He (strongly RTL).
+ &#x05D5; - The Hebrew letter Vav (strongly RTL).
+ &#x05D6; - The Hebrew letter Zayin (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><div><div>ABC&#x05D0;&#x05D1;&#x05D2;.</div>&#x05D3;&#x05D4;</div>&#x05D5;</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><div><div>ABC&#x05D0;&#x05D1;&#x05D2;.</div>&#x05D3;&#x05D4;</div>&#x05D5;</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><div><div>ABC&#x05D0;&#x05D1;&#x05D2;.</div>&#x05D3;&#x05D4;</div>&#x05D5;</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><div><div>ABC&#x05D0;&#x05D1;&#x05D2;.</div>&#x05D3;&#x05D4;</div>&#x05D5;</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-R-ref.html
new file mode 100644
index 000000000..a3938bdf8
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-R-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with R within contained element</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text, including text within contained elements.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="rtl"><div><div>&#x05D0;&#x05D1;&#x05D2;ABC.</div>XY</div>Z</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><div><div>&#x05D0;&#x05D1;&#x05D2;ABC.</div>XY</div>Z</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><div><div>&#x05D0;&#x05D1;&#x05D2;ABC.</div>XY</div>Z</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><div><div>&#x05D0;&#x05D1;&#x05D2;ABC.</div>XY</div>Z</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-R.html
new file mode 100644
index 000000000..2ba63426e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-R.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with R within contained element</title>
+ <link rel="match" href="dir_auto-contained-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text, including text within contained elements.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><div><div>&#x05D0;&#x05D1;&#x05D2;ABC.</div>XY</div>Z</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><div><div>&#x05D0;&#x05D1;&#x05D2;ABC.</div>XY</div>Z</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><div><div>&#x05D0;&#x05D1;&#x05D2;ABC.</div>XY</div>Z</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><div><div>&#x05D0;&#x05D1;&#x05D2;ABC.</div>XY</div>Z</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-L-ref.html
new file mode 100644
index 000000000..470220c80
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-L-ref.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with bdi, then L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text while ignoring bdi elements.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ &#x05D3; - The Hebrew letter Dalet (strongly RTL).
+ &#x05D4; - The Hebrew letter He (strongly RTL).
+ &#x05D5; - The Hebrew letter Vav (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="ltr"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-L.html
new file mode 100644
index 000000000..f35abfe3f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-L.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with bdi, then L</title>
+ <link rel="match" href="dir_auto-contained-bdi-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text while ignoring bdi elements.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ &#x05D3; - The Hebrew letter Dalet (strongly RTL).
+ &#x05D4; - The Hebrew letter He (strongly RTL).
+ &#x05D5; - The Hebrew letter Vav (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><bdi>&#x05D3;&#x05D4;&#x05D5;</bdi>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-R-ref.html
new file mode 100644
index 000000000..94475aaa9
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-R-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with bdi, then R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text while ignoring bdi elements.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="rtl"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-R.html
new file mode 100644
index 000000000..8ac324461
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-R.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with bdi, then R</title>
+ <link rel="match" href="dir_auto-contained-bdi-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text while ignoring bdi elements.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><bdi>DEF</bdi>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-L-ref.html
new file mode 100644
index 000000000..7c9f931d3
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-L-ref.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with dir, then L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text while ignoring contained elements with an explicit dir of their own.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ &#x05D3; - The Hebrew letter Dalet (strongly RTL).
+ &#x05D4; - The Hebrew letter He (strongly RTL).
+ &#x05D5; - The Hebrew letter Vav (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-L.html
new file mode 100644
index 000000000..1f424682f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-L.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with dir, then L</title>
+ <link rel="match" href="dir_auto-contained-dir-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text while ignoring contained elements with an explicit dir of their own.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ &#x05D3; - The Hebrew letter Dalet (strongly RTL).
+ &#x05D4; - The Hebrew letter He (strongly RTL).
+ &#x05D5; - The Hebrew letter Vav (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-R-ref.html
new file mode 100644
index 000000000..c6748dc85
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-R-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with dir, then R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text while ignoring contained elements with an explicit dir of their own.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="rtl"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-R.html
new file mode 100644
index 000000000..daab19149
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir-R.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with dir, then R</title>
+ <link rel="match" href="dir_auto-contained-dir-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text while ignoring contained elements with an explicit dir of their own.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-L-ref.html
new file mode 100644
index 000000000..53c60421f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-L-ref.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with dir=auto, then L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text while ignoring contained elements with an explicit dir of their own.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ &#x05D3; - The Hebrew letter Dalet (strongly RTL).
+ &#x05D4; - The Hebrew letter He (strongly RTL).
+ &#x05D5; - The Hebrew letter Vav (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-L.html
new file mode 100644
index 000000000..f491f6165
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-L.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with dir=auto, then L</title>
+ <link rel="match" href="dir_auto-contained-dir_auto-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text while ignoring contained elements with an explicit dir of their own.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ &#x05D3; - The Hebrew letter Dalet (strongly RTL).
+ &#x05D4; - The Hebrew letter He (strongly RTL).
+ &#x05D5; - The Hebrew letter Vav (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><p dir="auto">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><p dir="auto">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><p dir="rtl">&#x05D3;&#x05D4;&#x05D5;</p>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-R-ref.html
new file mode 100644
index 000000000..41871f04a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-R-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with dir=auto, then R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text while ignoring contained elements with an explicit dir of their own.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="rtl"><p dir="ltr">DEF</p>.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><p dir="ltr">DEF</p>.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><p dir="ltr">DEF</p>.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><p dir="ltr">DEF</p>.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-R.html
new file mode 100644
index 000000000..e3131c89b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-R.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with dir=auto, then R</title>
+ <link rel="match" href="dir_auto-contained-dir_auto-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text while ignoring contained elements with an explicit dir of their own.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><p dir="auto">DEF</p>.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><p dir="auto">DEF</p>.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><p dir="ltr">DEF</p>.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><p dir="ltr">DEF</p>.-=123&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-L-ref.html
new file mode 100644
index 000000000..aca07de7e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-L-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with script, then L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of descendant text while ignoring descendant script elements.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="ltr"><script>&#x05D0; = 3;</script>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><script>&#x05D0; = 3;</script>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><script>&#x05D0; = 3;</script>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><script>&#x05D0; = 3;</script>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-L.html
new file mode 100644
index 000000000..59a2e7775
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-L.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with script, then L</title>
+ <link rel="match" href="dir_auto-contained-script-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of descendant text while ignoring descendant script elements.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><script>&#x05D0; = 3;</script>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><script>&#x05D0; = 3;</script>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><script>&#x05D0; = 3;</script>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><script>&#x05D0; = 3;</script>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-R-ref.html
new file mode 100644
index 000000000..921f10a4c
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-R-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with script, then R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of descendant text while ignoring descendant script elements.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="rtl"><script>x = 3;</script>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><script>x = 3;</script>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><script>x = 3;</script>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><script>x = 3;</script>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-R.html
new file mode 100644
index 000000000..a76515d22
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-script-R.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with script, then R</title>
+ <link rel="match" href="dir_auto-contained-script-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of descendant text while ignoring descendant script elements.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><script>x = 3;</script>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><script>x = 3;</script>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><script>x = 3;</script>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><script>x = 3;</script>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-L-ref.html
new file mode 100644
index 000000000..2ec4f02ec
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-L-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with style, then L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of descendant text while ignoring descendant style elements.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="ltr"><style>body {color:black;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><style>body {color:black;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><style>body {color:black;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><style>body {color:black;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-L.html
new file mode 100644
index 000000000..cc74d4c93
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-L.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with style, then L</title>
+ <link rel="match" href="dir_auto-contained-style-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of descendant text while ignoring descendant style elements.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><style>body {color:black;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><style>body {color:black;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><style>body {color:black;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><style>body {color:black;}</style>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-R-ref.html
new file mode 100644
index 000000000..9ad9d7109
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-R-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with style, then R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of descendant text while ignoring descendant style elements.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="rtl"><style>body {color:black;}</style>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><style>body {color:black;}</style>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><style>body {color:black;}</style>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><style>body {color:black;}</style>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-R.html
new file mode 100644
index 000000000..4aa70cdb2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-style-R.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with style, then R</title>
+ <link rel="match" href="dir_auto-contained-style-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of descendant text while ignoring descendant style elements.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><style>body {color:black;}</style>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><style>body {color:black;}</style>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><style>body {color:black;}</style>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><style>body {color:black;}</style>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-L-ref.html
new file mode 100644
index 000000000..411099f7b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-L-ref.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with textarea, then L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of descendant text while ignoring descendant textarea elements.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ &#x05D3; - The Hebrew letter Dalet (strongly RTL).
+ &#x05D4; - The Hebrew letter He (strongly RTL).
+ &#x05D5; - The Hebrew letter Vav (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="ltr"><textarea>&#x05D3;&#x05D4;&#x05D5;</textarea>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><textarea>&#x05D3;&#x05D4;&#x05D5;</textarea>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><textarea>&#x05D3;&#x05D4;&#x05D5;</textarea>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><textarea>&#x05D3;&#x05D4;&#x05D5;</textarea>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-L.html
new file mode 100644
index 000000000..0de041fe0
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-L.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with textarea, then L</title>
+ <link rel="match" href="dir_auto-contained-textarea-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of descendant text while ignoring descendant textarea elements.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ &#x05D3; - The Hebrew letter Dalet (strongly RTL).
+ &#x05D4; - The Hebrew letter He (strongly RTL).
+ &#x05D5; - The Hebrew letter Vav (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><textarea>&#x05D3;&#x05D4;&#x05D5;</textarea>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><textarea>&#x05D3;&#x05D4;&#x05D5;</textarea>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="ltr"><textarea>&#x05D3;&#x05D4;&#x05D5;</textarea>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="ltr"><textarea>&#x05D3;&#x05D4;&#x05D5;</textarea>ABC&#x05D0;&#x05D1;&#x05D2;.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-R-ref.html
new file mode 100644
index 000000000..351431fb2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-R-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with textarea, then R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of descendant text while ignoring descendant textarea elements.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="rtl"><textarea>DEF</textarea>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><textarea>DEF</textarea>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><textarea>DEF</textarea>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><textarea>DEF</textarea>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-R.html
new file mode 100644
index 000000000..852de6073
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-R.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, start with textarea, then R</title>
+ <link rel="match" href="dir_auto-contained-textarea-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of descendant text while ignoring descendant textarea elements.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <div dir="auto"><textarea>DEF</textarea>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="auto"><textarea>DEF</textarea>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <div dir="rtl"><textarea>DEF</textarea>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ <div dir="rtl">
+ <div dir="rtl"><textarea>DEF</textarea>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-L-ref.html
new file mode 100644
index 000000000..198d081c2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-L-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with EN+L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A since digits are not strongly
+ directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-L.html
new file mode 100644
index 000000000..d5ade6c09
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-L.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with EN+L</title>
+ <link rel="match" href="dir_auto-input-EN-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A since digits are not strongly
+ directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="auto" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-R-ref.html
new file mode 100644
index 000000000..303afc3c6
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-R-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with EN+R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef since digits are not strongly
+ directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-R.html
new file mode 100644
index 000000000..08ef3ecd7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-EN-R.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with EN+R</title>
+ <link rel="match" href="dir_auto-input-EN-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef since digits are not strongly
+ directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="auto" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-L-ref.html
new file mode 100644
index 000000000..cb3621aa6
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-L-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="ABC&#x05d0;&#x05d1;&#x05d2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="ABC&#x05d0;&#x05d1;&#x05d2;." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="ABC&#x05d0;&#x05d1;&#x05d2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="ABC&#x05d0;&#x05d1;&#x05d2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-L.html
new file mode 100644
index 000000000..0a23f2b86
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-L.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with L</title>
+ <link rel="match" href="dir_auto-input-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="auto" value="ABC&#x05d0;&#x05d1;&#x05d2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="ABC&#x05d0;&#x05d1;&#x05d2;." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="ABC&#x05d0;&#x05d1;&#x05d2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="ABC&#x05d0;&#x05d1;&#x05d2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-L-ref.html
new file mode 100644
index 000000000..3d0f2cf3c
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-L-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with N+EN+L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A since neutrals and digits are not
+ strongly directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-L.html
new file mode 100644
index 000000000..03f85526d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-L.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with N+EN+L</title>
+ <link rel="match" href="dir_auto-input-N-EN-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A since neutrals and digits are not
+ strongly directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="auto" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-R-ref.html
new file mode 100644
index 000000000..26bf27d61
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-R-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with N+EN+R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef since neutrals and digits are not
+ strongly directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-R.html
new file mode 100644
index 000000000..13193d3d7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-R.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with N+EN+R</title>
+ <link rel="match" href="dir_auto-input-N-EN-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef since neutrals and digits are not
+ strongly directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="auto" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-ref.html
new file mode 100644
index 000000000..33f75b730
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-ref.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, all N+EN</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value, or to LTR if there is no such
+ character.
+ In this test, there is no strongly directional character in the value,
+ thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="@123!" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="@123!" />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="@123!" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="@123!" />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN.html
new file mode 100644
index 000000000..03df3c6dc
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-EN.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, all N+EN</title>
+ <link rel="match" href="dir_auto-input-N-EN-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value, or to LTR if there is no such
+ character.
+ In this test, there is no strongly directional character in the value,
+ thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="auto" value="@123!" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="@123!" />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="@123!" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="@123!" />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-L-ref.html
new file mode 100644
index 000000000..b6a89a1d7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-L-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with N+L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A since neutrals are not
+ strongly directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-L.html
new file mode 100644
index 000000000..9c1d3bcee
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-L.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with N+L</title>
+ <link rel="match" href="dir_auto-input-N-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A since neutrals are not
+ strongly directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="auto" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-R-ref.html
new file mode 100644
index 000000000..bcd543044
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-R-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with N+R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef since neutrals are not
+ strongly directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-R.html
new file mode 100644
index 000000000..dbf54f734
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-N-R.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with N+R</title>
+ <link rel="match" href="dir_auto-input-N-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef since neutrals are not
+ strongly directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="auto" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-R-ref.html
new file mode 100644
index 000000000..217972e82
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-R-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-R.html
new file mode 100644
index 000000000..6d2612b31
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-R.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, start with R</title>
+ <link rel="match" href="dir_auto-input-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="auto" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-L-ref.html
new file mode 100644
index 000000000..879e20d6c
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-L-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with EN+L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A since digits are not strongly
+ directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-L.html
new file mode 100644
index 000000000..d0a9e2bb9
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-L.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with EN+L</title>
+ <link rel="match" href="dir_auto-input-script-EN-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A since digits are not strongly
+ directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ This test makes sure that the direction is set correctly for an input whose value is set
+ dynamically by script.
+ </div>
+ <div id="test" class="test">
+ <script>
+ window.onload = function() {
+ var test = document.getElementById('test');
+ var inputs = test.getElementsByTagName('input');
+ for (var i = 0; i != inputs.length; i++) {
+ inputs[i].value = '123ABC\u05D0\u05D1\u05D2.';
+ }
+ }
+ </script>
+ <div dir="ltr">
+ <input type="text" dir="auto" value="&#x05D0;" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="&#x05D0;" />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-R-ref.html
new file mode 100644
index 000000000..15781e252
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-R-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with EN+R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef since digits are not strongly
+ directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-R.html
new file mode 100644
index 000000000..e444b90dc
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-R.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with EN+R</title>
+ <link rel="match" href="dir_auto-input-script-EN-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef since digits are not strongly
+ directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ This test makes sure that the direction is set correctly for an input whose value is set
+ dynamically by script.
+ </div>
+ <div id="test" class="test">
+ <script>
+ window.onload = function() {
+ var test = document.getElementById('test');
+ var inputs = test.getElementsByTagName('input');
+ for (var i = 0; i != inputs.length; i++) {
+ inputs[i].value = '123\u05D0\u05D1\u05D2ABC.';
+ }
+ }
+ </script>
+ <div dir="ltr">
+ <input type="text" dir="auto" value="a" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="a" />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value="123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-L-ref.html
new file mode 100644
index 000000000..0feef2504
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-L-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-L.html
new file mode 100644
index 000000000..e6aa700ad
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-L.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with L</title>
+ <link rel="match" href="dir_auto-input-script-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A, thus the direction must be
+ resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ This test makes sure that the direction is set correctly for an input whose value is set
+ dynamically by script.
+ </div>
+ <div id="test" class="test">
+ <script>
+ window.onload = function() {
+ var test = document.getElementById('test');
+ var inputs = test.getElementsByTagName('input');
+ for (var i = 0; i != inputs.length; i++) {
+ inputs[i].value = 'ABC\u05D0\u05D1\u05D2.';
+ }
+ }
+ </script>
+ <div dir="ltr">
+ <input type="text" dir="auto" value="&#x05D0;" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="&#x05D0;" />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-L-ref.html
new file mode 100644
index 000000000..6d6902f31
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-L-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with N+EN+L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A since neutrals and digits are not
+ strongly directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-L.html
new file mode 100644
index 000000000..7905cee94
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-L.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with N+EN+L</title>
+ <link rel="match" href="dir_auto-input-script-N-EN-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A since neutrals and digits are not
+ strongly directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ This test makes sure that the direction is set correctly for an input whose value is set
+ dynamically by script.
+ </div>
+ <div id="test" class="test">
+ <script>
+ window.onload = function() {
+ var test = document.getElementById('test');
+ var inputs = test.getElementsByTagName('input');
+ for (var i = 0; i != inputs.length; i++) {
+ inputs[i].value = '.-=123ABC\u05D0\u05D1\u05D2.';
+ }
+ }
+ </script>
+ <div dir="ltr">
+ <input type="text" dir="auto" value="&#x05D0;" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="&#x05D0;" />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value=".-=123ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-R-ref.html
new file mode 100644
index 000000000..53dd89209
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-R-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with N+EN+R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef since neutrals and digits are not
+ strongly directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-R.html
new file mode 100644
index 000000000..95faa72ea
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-R.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with N+EN+R</title>
+ <link rel="match" href="dir_auto-input-script-N-EN-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef since neutrals and digits are not
+ strongly directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ This test makes sure that the direction is set correctly for an input whose value is set
+ dynamically by script.
+ </div>
+ <div id="test" class="test">
+ <script>
+ window.onload = function() {
+ var test = document.getElementById('test');
+ var inputs = test.getElementsByTagName('input');
+ for (var i = 0; i != inputs.length; i++) {
+ inputs[i].value = '.-=123\u05D0\u05D1\u05D2ABC.';
+ }
+ }
+ </script>
+ <div dir="ltr">
+ <input type="text" dir="auto" value="a" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="a" />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value=".-=123&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-ref.html
new file mode 100644
index 000000000..11697e53e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-ref.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to all N+EN</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value, or to LTR if there is no such
+ character.
+ In this test, there is no strongly directional character in the value,
+ thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="@123!" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="@123!" />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="@123!" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="@123!" />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN.html
new file mode 100644
index 000000000..2721affae
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to all N+EN</title>
+ <link rel="match" href="dir_auto-input-script-N-EN-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value, or to LTR if there is no such
+ character.
+ In this test, there is no strongly directional character in the value,
+ thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ This test makes sure that the direction is set correctly for an input whose value is set
+ dynamically by script.
+ </div>
+ <div id="test" class="test">
+ <script>
+ window.onload = function() {
+ var test = document.getElementById('test');
+ var inputs = test.getElementsByTagName('input');
+ for (var i = 0; i != inputs.length; i++) {
+ inputs[i].value = '@123!';
+ }
+ };
+ </script>
+ <div dir="ltr">
+ <input type="text" dir="auto" value="&#x05D0;" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="&#x05D0;" />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value="@123!" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value="@123!" />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-L-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-L-ref.html
new file mode 100644
index 000000000..fd7cb10fb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-L-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with N+L</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A since neutrals are not
+ strongly directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-L.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-L.html
new file mode 100644
index 000000000..2ff24db28
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-L.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with N+L</title>
+ <link rel="match" href="dir_auto-input-script-N-L-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Latin letter A since neutrals are not
+ strongly directional, thus the direction must be resolved as LTR." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ This test makes sure that the direction is set correctly for an input whose value is set
+ dynamically by script.
+ </div>
+ <div id="test" class="test">
+ <script>
+ window.onload = function() {
+ var test = document.getElementById('test');
+ var inputs = test.getElementsByTagName('input');
+ for (var i = 0; i != inputs.length; i++) {
+ inputs[i].value = '.-=ABC\u05D0\u05D1\u05D2.';
+ }
+ }
+ </script>
+ <div dir="ltr">
+ <input type="text" dir="auto" value="&#x05D0;" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="&#x05D0;" />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="ltr" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="ltr" value=".-=ABC&#x05D0;&#x05D1;&#x05D2;." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-R-ref.html
new file mode 100644
index 000000000..0fa6da249
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-R-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with N+R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef since neutrals are not
+ strongly directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-R.html
new file mode 100644
index 000000000..0663b28ad
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-N-R.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with N+R</title>
+ <link rel="match" href="dir_auto-input-script-N-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef since neutrals are not
+ strongly directional, thus the direction must be resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ This test makes sure that the direction is set correctly for an input whose value is set
+ dynamically by script.
+ </div>
+ <div id="test" class="test">
+ <script>
+ window.onload = function() {
+ var test = document.getElementById('test');
+ var inputs = test.getElementsByTagName('input');
+ for (var i = 0; i != inputs.length; i++) {
+ inputs[i].value = '.-=\u05D0\u05D1\u05D2ABC.';
+ }
+ }
+ </script>
+ <div dir="ltr">
+ <input type="text" dir="auto" value="a" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="a" />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value=".-=&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-R-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-R-ref.html
new file mode 100644
index 000000000..12b2d1925
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-R-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with R</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-R.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-R.html
new file mode 100644
index 000000000..07becaacc
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-input-script-R.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: input with dir=auto, script assigns to start with R</title>
+ <link rel="match" href="dir_auto-input-script-R-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction of an input element is set according to
+ the first strong character of its value.
+ In this test, it is the Hebrew letter Alef, thus the direction must be
+ resolved as RTL." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x05D1; - The Hebrew letter Bet (strongly RTL).
+ &#x05D2; - The Hebrew letter Gimel (strongly RTL).
+ This test makes sure that the direction is set correctly for an input whose value is set
+ dynamically by script.
+ </div>
+ <div id="test" class="test">
+ <script>
+ window.onload = function() {
+ var test = document.getElementById('test');
+ var inputs = test.getElementsByTagName('input');
+ for (var i = 0; i != inputs.length; i++) {
+ inputs[i].value = '\u05D0\u05D1\u05D2ABC.';
+ }
+ }
+ </script>
+ <div dir="ltr">
+ <input type="text" dir="auto" value="a" />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="auto" value="a" />
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <input type="text" dir="rtl" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ <div dir="rtl">
+ <input type="text" dir="rtl" value="&#x05D0;&#x05D1;&#x05D2;ABC." />
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-isolate-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-isolate-ref.html
new file mode 100644
index 000000000..858a7db23
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-isolate-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, isolated in LTR text</title>
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text, but the element behaves externally as a neutral character.
+ In this test, it allows a preceding R to form a single directional run
+ with a succeeding number." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ &#x202D;1 a! &#x05D0;&#x202C;
+ </div>
+ <div dir="rtl">
+ &#x202D;a !&#x05D0; 1&#x202C;
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ &#x202D;1 a! &#x05D0;&#x202C;
+ </div>
+ <div dir="rtl">
+ &#x202D;a !&#x05D0; 1&#x202C;
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-isolate.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-isolate.html
new file mode 100644
index 000000000..14272c053
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-isolate.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: dir=auto, isolated in LTR text</title>
+ <link rel="match" href="dir_auto-isolate-ref.html" />
+ <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
+ <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text, but the element behaves externally as a neutral character.
+ In this test, it allows a preceding R to form a single directional run
+ with a succeeding number." />
+ <style>
+ input, textarea {
+ font-size:1em;
+ }
+ body {
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ &#x05D0; <span dir="auto">a!</span> 1
+ </div>
+ <div dir="rtl">
+ a <span dir="auto">&#x05D0;!</span> 1
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ &#x202D;1 a! &#x05D0;&#x202C;
+ </div>
+ <div dir="rtl">
+ &#x202D;a !&#x05D0; 1&#x202C;
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-EN-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-EN-ref.html
new file mode 100644
index 000000000..c951c30b2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-EN-ref.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <style>
+ body {
+ font-size:18px;
+ text-align:left;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="test">
+ <div dir="ltr">
+ <pre dir="ltr">
+@123!
+ </pre>
+ </div>
+ <div dir="rtl">
+ <pre dir="ltr">
+@123!
+ </pre>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <pre dir="ltr">
+@123!
+ </pre>
+ </div>
+ <div dir="rtl">
+ <pre dir="ltr">
+@123!
+ </pre>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-EN.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-EN.html
new file mode 100644
index 000000000..cd721d725
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-EN.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: pre with dir=auto, all N+EN</title>
+ <link rel="match" href="dir_auto-pre-N-EN-ref.html" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <link rel="help" href="http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi0" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ For textarea and pre elements, the heuristic is applied on a per-paragraph level.
+ If there is no strong character, as in this test, the direction defaults to LTR." />
+ <style>
+ body {
+ font-size:18px;
+ text-align:left;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x200E; - LRM, the invisible left-to-right mark (strongly LTR).
+ &#x200F; - RLM, the invisible right-to-left mark (strongly RTL).
+ We use text-align:left because neither the dir="auto" nor the unicode-bidi:plaintext
+ specification states whether text-align:start and text-align:end should obey the paragraph
+ direction or the direction property in a unicode-bidi:plaintext element.
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <pre dir="auto">
+@123!
+ </pre>
+ </div>
+ <div dir="rtl">
+ <pre dir="auto">
+@123!
+ </pre>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <pre dir="ltr">
+@123!
+ </pre>
+ </div>
+ <div dir="rtl">
+ <pre dir="ltr">
+@123!
+ </pre>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-between-Rs-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-between-Rs-ref.html
new file mode 100644
index 000000000..2d9caf062
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-between-Rs-ref.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <style>
+ body {
+ font-size:18px;
+ text-align:left;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <pre dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </pre>
+ </div>
+ <div dir="rtl">
+ <pre dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </pre>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <pre dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </pre>
+ </div>
+ <div dir="rtl">
+ <pre dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </pre>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-between-Rs.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-between-Rs.html
new file mode 100644
index 000000000..adca24d88
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-N-between-Rs.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: pre with dir=auto, all-N between all-Rs</title>
+ <link rel="match" href="dir_auto-pre-N-between-Rs-ref.html" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <link rel="help" href="http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi0" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ For textarea and pre elements, the heuristic is applied on a per-paragraph level.
+ If there is no strong character, as in this test, the direction defaults to LTR." />
+ <style>
+ body {
+ font-size:18px;
+ text-align:left;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ We use text-align:left because neither the dir="auto" nor the unicode-bidi:plaintext
+ specification states whether text-align:start and text-align:end should obey the paragraph
+ direction or the direction property in a unicode-bidi:plaintext element.
+ The ...! paragraph, being neutral, is supposed to be displayed LTR (i.e. as ...!, not as !...)
+ despite both the paragraph before it and the paragraph after it being all-RTL, which makes the
+ element as a whole RTL.
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <pre dir="auto">
+&#x05D0;
+...!
+&#x05D0;
+ </pre>
+ </div>
+ <div dir="rtl">
+ <pre dir="auto">
+&#x05D0;
+...!
+&#x05D0;
+ </pre>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <pre dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </pre>
+ </div>
+ <div dir="rtl">
+ <pre dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </pre>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-mixed-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-mixed-ref.html
new file mode 100644
index 000000000..10bd02433
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-mixed-ref.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <style>
+ body {
+ font-size:18px;
+ text-align:left;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="test">
+ <div dir="ltr">
+ <pre dir="ltr">
+@123!
+@123!
+@123!
+@123!
+ </pre>
+ </div>
+ <div dir="rtl">
+ <pre dir="ltr">
+@123!
+@123!
+@123!
+@123!
+ </pre>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <pre dir="ltr">
+@123!
+@123!
+@123!
+@123!
+ </pre>
+ </div>
+ <div dir="rtl">
+ <pre dir="ltr">
+@123!
+@123!
+@123!
+@123!
+ </pre>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-mixed.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-mixed.html
new file mode 100644
index 000000000..906365621
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-pre-mixed.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: pre with dir=auto, mixed L and R paragraphs</title>
+ <link rel="match" href="dir_auto-pre-mixed-ref.html" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <link rel="help" href="http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi0" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ For textarea and pre elements, the heuristic is applied on a per-paragraph level." />
+ <style>
+ body {
+ font-size:18px;
+ text-align:left;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x200E; - LRM, the invisible left-to-right mark (strongly LTR).
+ &#x200F; - RLM, the invisible right-to-left mark (strongly RTL).
+ We use text-align:left because neither the dir="auto" nor the unicode-bidi:plaintext
+ specification states whether text-align:start and text-align:end should obey the paragraph
+ direction or the direction property in a unicode-bidi:plaintext element.
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <pre dir="auto">
+@&#x200E;123&#x200F;!
+!&#x200F;123&#x200E;@
+@123&#x200E;&#x200F;!
+!123&#x200F;&#x200E;@
+ </pre>
+ </div>
+ <div dir="rtl">
+ <pre dir="auto">
+@&#x200E;123&#x200F;!
+!&#x200F;123&#x200E;@
+@123&#x200E;&#x200F;!
+!123&#x200F;&#x200E;@
+ </pre>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <pre dir="ltr">
+@123!
+@123!
+@123!
+@123!
+ </pre>
+ </div>
+ <div dir="rtl">
+ <pre dir="ltr">
+@123!
+@123!
+@123!
+@123!
+ </pre>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-EN-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-EN-ref.html
new file mode 100644
index 000000000..253b84459
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-EN-ref.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <style>
+ body, textarea {
+ font-size:18px;
+ text-align:left;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="test">
+ <div dir="ltr">
+ <textarea rows="2" dir="ltr">
+@123!
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="2" dir="ltr">
+@123!
+ </textarea>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <textarea rows="2" dir="ltr">
+@123!
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="2" dir="ltr">
+@123!
+ </textarea>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-EN.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-EN.html
new file mode 100644
index 000000000..f0fa2161a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-EN.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: textarea with dir=auto, all N+EN</title>
+ <link rel="match" href="dir_auto-textarea-N-EN-ref.html" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <link rel="help" href="http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi0" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ For textarea and pre elements, the heuristic is applied on a per-paragraph level.
+ If there is no strong character, as in this test, the direction defaults to LTR." />
+ <style>
+ body, textarea {
+ font-size:18px;
+ text-align:left;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x200E; - LRM, the invisible left-to-right mark (strongly LTR).
+ &#x200F; - RLM, the invisible right-to-left mark (strongly RTL).
+ We use text-align:left because neither the dir="auto" nor the unicode-bidi:plaintext
+ specification states whether text-align:start and text-align:end should obey the paragraph
+ direction or the direction property in a unicode-bidi:plaintext element.
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <textarea rows="2" dir="auto">
+@123!
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="2" dir="auto">
+@123!
+ </textarea>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <textarea rows="2" dir="ltr">
+@123!
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="2" dir="ltr">
+@123!
+ </textarea>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-between-Rs-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-between-Rs-ref.html
new file mode 100644
index 000000000..afeef08cb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-between-Rs-ref.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <style>
+ body, textarea {
+ font-size:18px;
+ text-align:left;
+ }
+ textarea {
+ resize: none;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <textarea rows="4" dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="4" dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </textarea>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <textarea rows="4" dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="4" dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </textarea>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-between-Rs.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-between-Rs.html
new file mode 100644
index 000000000..ddae91054
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-N-between-Rs.html
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: textarea with dir=auto, all-N between all-Rs</title>
+ <link rel="match" href="dir_auto-textarea-N-between-Rs-ref.html" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <link rel="help" href="http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi0" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ For textarea and pre elements, the heuristic is applied on a per-paragraph level.
+ If there is no strong character, as in this test, the direction defaults to LTR." />
+ <style>
+ body, textarea {
+ font-size:18px;
+ text-align:left;
+ }
+ textarea {
+ resize: none;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ We use text-align:left because neither the dir="auto" nor the unicode-bidi:plaintext
+ specification states whether text-align:start and text-align:end should obey the paragraph
+ direction or the direction property in a unicode-bidi:plaintext element.
+ The ...! paragraph, being neutral, is supposed to be displayed LTR (i.e. as ...!, not as !...)
+ despite both the paragraph before it and the paragraph after it being all-RTL, which makes the
+ element as a whole RTL.
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <textarea rows="4" dir="auto">
+&#x05D0;
+...!
+&#x05D0;
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="4" dir="auto">
+&#x05D0;
+...!
+&#x05D0;
+ </textarea>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <textarea rows="4" dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="4" dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </textarea>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-mixed-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-mixed-ref.html
new file mode 100644
index 000000000..a5a84480f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-mixed-ref.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <style>
+ body, textarea {
+ font-size:18px;
+ text-align:left;
+ }
+ textarea {
+ resize: none;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="test">
+ <div dir="ltr">
+ <textarea rows="5" dir="rtl">
+!123@
+!123@
+!123@
+!123@
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="5" dir="ltr">
+@123!
+@123!
+@123!
+@123!
+ </textarea>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <textarea rows="5" dir="rtl">
+!123@
+!123@
+!123@
+!123@
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="5" dir="ltr">
+@123!
+@123!
+@123!
+@123!
+ </textarea>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-mixed.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-mixed.html
new file mode 100644
index 000000000..4947124c9
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-mixed.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: textarea with dir=auto, mixed L and R paragraphs</title>
+ <link rel="match" href="dir_auto-textarea-mixed-ref.html" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <link rel="help" href="http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi0" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ For textarea and pre elements, the heuristic is applied on a per-paragraph level." />
+ <style>
+ body, textarea {
+ font-size:18px;
+ text-align:left;
+ }
+ textarea {
+ resize: none;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x200E; - LRM, the invisible left-to-right mark (strongly LTR).
+ &#x200F; - RLM, the invisible right-to-left mark (strongly RTL).
+ We use text-align:left because neither the dir="auto" nor the unicode-bidi:plaintext
+ specification states whether text-align:start and text-align:end should obey the paragraph
+ direction or the direction property in a unicode-bidi:plaintext element.
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <textarea rows="5" dir="auto">
+!&#x200F;123&#x200E;@
+@&#x200E;123&#x200F;!
+!123&#x200F;&#x200E;@
+@123&#x200E;&#x200F;!
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="5" dir="auto">
+@&#x200E;123&#x200F;!
+!&#x200F;123&#x200E;@
+@123&#x200E;&#x200F;!
+!123&#x200F;&#x200E;@
+ </textarea>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <textarea rows="5" dir="rtl">
+!123@
+!123@
+!123@
+!123@
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="5" dir="ltr">
+@123!
+@123!
+@123!
+@123!
+ </textarea>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-EN-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-EN-ref.html
new file mode 100644
index 000000000..253b84459
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-EN-ref.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <style>
+ body, textarea {
+ font-size:18px;
+ text-align:left;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="test">
+ <div dir="ltr">
+ <textarea rows="2" dir="ltr">
+@123!
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="2" dir="ltr">
+@123!
+ </textarea>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <textarea rows="2" dir="ltr">
+@123!
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="2" dir="ltr">
+@123!
+ </textarea>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-EN.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-EN.html
new file mode 100644
index 000000000..3c674e2f8
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-EN.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: textarea with dir=auto, script assigns to all N+EN</title>
+ <link rel="match" href="dir_auto-textarea-script-N-EN-ref.html" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <link rel="help" href="http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi0" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ For textarea and pre elements, the heuristic is applied on a per-paragraph level.
+ If there is no strong character, as in this test, the direction defaults to LTR." />
+ <style>
+ body, textarea {
+ font-size:18px;
+ text-align:left;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x200E; - LRM, the invisible left-to-right mark (strongly LTR).
+ &#x200F; - RLM, the invisible right-to-left mark (strongly RTL).
+ This test makes sure that the direction is set correctly for a textarea whose value is set
+ dynamically by script.
+ We use text-align:left because neither the dir="auto" nor the unicode-bidi:plaintext
+ specification states whether text-align:start and text-align:end should obey the paragraph
+ direction or the direction property in a unicode-bidi:plaintext element.
+ </div>
+ <div id="test" class="test">
+ <script>
+ window.onload = function() {
+ var test = document.getElementById('test');
+ var textareas = test.getElementsByTagName('textarea');
+ for (var i = 0; i != textareas.length; i++) {
+ textareas[i].value = '@123!\n';
+ }
+ }
+ </script>
+ <div dir="ltr">
+ <textarea rows="2" dir="auto">
+&#x200F;
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="2" dir="auto">
+&#x200F;
+ </textarea>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <textarea rows="2" dir="ltr">
+@123!
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="2" dir="ltr">
+@123!
+ </textarea>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-between-Rs-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-between-Rs-ref.html
new file mode 100644
index 000000000..814e7b656
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-between-Rs-ref.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="match" href="dir_auto-textarea-N-between-Rs-ref.html" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <style>
+ body, textarea {
+ font-size:18px;
+ text-align:left;
+ }
+ textarea {
+ resize: none;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ <textarea rows="4" dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="4" dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </textarea>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <textarea rows="4" dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="4" dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </textarea>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-between-Rs.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-between-Rs.html
new file mode 100644
index 000000000..d16837b2f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-N-between-Rs.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: textarea with dir=auto, script assigns to all-N between all-Rs</title>
+ <link rel="match" href="dir_auto-textarea-script-N-between-Rs-ref.html" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <link rel="help" href="http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi0" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ For textarea and pre elements, the heuristic is applied on a per-paragraph level.
+ If there is no strong character, as in this test, the direction defaults to LTR." />
+ <style>
+ body, textarea {
+ font-size:18px;
+ text-align:left;
+ }
+ textarea {
+ resize: none;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; - The Hebrew letter Alef (strongly RTL).
+ This test makes sure that the direction is set correctly for a textarea whose value is set
+ dynamically by script.
+ We use text-align:left because neither the dir="auto" nor the unicode-bidi:plaintext
+ specification states whether text-align:start and text-align:end should obey the paragraph
+ direction or the direction property in a unicode-bidi:plaintext element.
+ The ...! paragraph, being neutral, is supposed to be displayed LTR (i.e. as ...!, not as !...)
+ despite both the paragraph before it and the paragraph after it being all-RTL, which makes the
+ element as a whole RTL.
+ </div>
+ <div id="test" class="test">
+ <script>
+ window.onload = function() {
+ var test = document.getElementById('test');
+ var textareas = test.getElementsByTagName('textarea');
+ for (var i = 0; i != textareas.length; i++) {
+ textareas[i].value = '\u05D0\n...!\n\u05D0';
+ }
+ }
+ </script>
+ <div dir="ltr">
+ <textarea rows="4" dir="auto">
+LTR text
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="4" dir="auto">
+LTR text
+ </textarea>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <textarea rows="4" dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="4" dir="rtl">
+&#x05D0;
+!...
+&#x05D0;
+ </textarea>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-mixed-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-mixed-ref.html
new file mode 100644
index 000000000..a5a84480f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-mixed-ref.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <style>
+ body, textarea {
+ font-size:18px;
+ text-align:left;
+ }
+ textarea {
+ resize: none;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="test">
+ <div dir="ltr">
+ <textarea rows="5" dir="rtl">
+!123@
+!123@
+!123@
+!123@
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="5" dir="ltr">
+@123!
+@123!
+@123!
+@123!
+ </textarea>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <textarea rows="5" dir="rtl">
+!123@
+!123@
+!123@
+!123@
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="5" dir="ltr">
+@123!
+@123!
+@123!
+@123!
+ </textarea>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-mixed.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-mixed.html
new file mode 100644
index 000000000..f0c6d4fe4
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir_auto-textarea-script-mixed.html
@@ -0,0 +1,100 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: textarea with dir=auto, script assigns to mixed L and R paragraphs</title>
+ <link rel="match" href="dir_auto-textarea-script-mixed-ref.html" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dir-attribute" />
+ <link rel="help" href="http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi0" />
+ <meta name="assert" content="
+ When dir='auto', the direction is set according to the first strong character
+ of the text.
+ For textarea and pre elements, the heuristic is applied on a per-paragraph level." />
+ <style>
+ body, textarea {
+ font-size:18px;
+ text-align:left;
+ }
+ textarea {
+ resize: none;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x200E; - LRM, the invisible left-to-right mark (strongly LTR).
+ &#x200F; - RLM, the invisible right-to-left mark (strongly RTL).
+ This test makes sure that the direction is set correctly for a textarea whose value is set
+ dynamically by script.
+ We use text-align:left because neither the dir="auto" nor the unicode-bidi:plaintext
+ specification states whether text-align:start and text-align:end should obey the paragraph
+ direction or the direction property in a unicode-bidi:plaintext element.
+ </div>
+ <div id="test" class="test">
+ <script>
+ window.onload = function() {
+ var test = document.getElementById('test');
+ var textareas = test.getElementsByTagName('textarea');
+ for (var i = 0; i != textareas.length; i++) {
+ var input = textareas[i];
+ if (input.parentNode.dir == 'ltr') {
+ // Assign a value whose first strong is RTL.
+ input.value =
+ '!\u200F123\u200E@\n' +
+ '@\u200E123\u200F!\n' +
+ '!123\u200F\u200E@\n' +
+ '@123\u200E\u200F!\n';
+ } else {
+ // Assign a value whose first strong is LTR.
+ input.value =
+ '@\u200E123\u200F!\n' +
+ '!\u200F123\u200E@\n' +
+ '@123\u200E\u200F!\n' +
+ '!123\u200F\u200E@\n';
+ }
+ }
+ }
+ </script>
+ <div dir="ltr">
+ <textarea rows="5" dir="auto">
+&#x200E;
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="5" dir="auto">
+&#x200F;
+ </textarea>
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ <textarea rows="5" dir="rtl">
+!123@
+!123@
+!123@
+!123@
+ </textarea>
+ </div>
+ <div dir="rtl">
+ <textarea rows="5" dir="ltr">
+@123!
+@123!
+@123!
+@123!
+ </textarea>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/document-dir.html b/testing/web-platform/tests/html/dom/elements/global-attributes/document-dir.html
new file mode 100644
index 000000000..675b4bc9d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/document-dir.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html dir="LTR">
+<title>document.dir</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-dir">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#reflect">
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.dir, "ltr");
+ assert_equals(document.documentElement.getAttribute("dir"), "LTR");
+}, "Markup attribute")
+test(function() {
+ document.dir = "x-garbage";
+ assert_equals(document.dir, "");
+ assert_equals(document.documentElement.getAttribute("dir"), "x-garbage");
+}, "Setting the idl attribute to a garbage value")
+test(function() {
+ document.dir = "";
+ assert_true(document.documentElement.hasAttribute("dir"), "Attribute should still be around");
+ assert_equals(document.dir, "");
+ assert_equals(document.documentElement.getAttribute("dir"), "");
+}, "Setting the idl attribute to the empty string")
+</script>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/id-attribute.html b/testing/web-platform/tests/html/dom/elements/global-attributes/id-attribute.html
new file mode 100644
index 000000000..0171148fb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/id-attribute.html
@@ -0,0 +1,130 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>The id attribute</title>
+<meta charset=utf8>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-id-attribute">
+<style>
+
+#abcd {
+ position: absolute;
+ z-index: 1;
+}
+
+#ABCD {
+ position: absolute;
+ z-index: 2;
+}
+
+#a\ b {
+ position: absolute;
+ z-index: 3;
+}
+
+#xyz {
+ position: absolute;
+ z-index: 4;
+}
+
+#foobar {
+ position: absolute;
+ z-index: 5;
+}
+
+#åèiöú {
+ position: absolute;
+ z-index: 6;
+}
+
+</style>
+</head>
+<body>
+<h1>The id attribute</h1>
+<div id="log"></div>
+<i id="abcd"></i>
+<i id="ABCD"></i>
+<i id="a b"></i>
+<i id="åèiöú"></i>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+ // id is associated for purposes of getElementById
+ test(function() {
+ assert_equals(document.getElementById("abcd"), document.getElementsByTagName("i")[0]);
+ }, "User agents must associate the element with an id value for purposes of getElementById.");
+
+ test(function() {
+ assert_equals(document.getElementById("ABCD"), document.getElementsByTagName("i")[1]);
+ }, "Association is exact and therefore case-sensitive for getElementById.");
+
+ test(function() {
+ assert_equals(document.getElementById("a b"), document.getElementsByTagName("i")[2]);
+ }, "Spaces are allowed in an id and still make an association for getElementByID.");
+
+ test(function() {
+ assert_equals(document.getElementById("åèiöú"), document.getElementsByTagName("i")[3]);
+ }, "Non-ASCII is allowed in an id and still make an association for getElementById.");
+
+
+ // id is associated for purposes of CSS
+ test(function() {
+ assert_equals(document.defaultView.getComputedStyle(document.getElementById("abcd"), false).zIndex, "1");
+ }, "User agents must associate the element with an id value for purposes of CSS.");
+
+ test(function() {
+ assert_equals(document.defaultView.getComputedStyle(document.getElementById("ABCD"), false).zIndex, "2");
+ }, "Association for CSS is exact and therefore case-sensitive.");
+
+ test(function() {
+ assert_equals(document.defaultView.getComputedStyle(document.getElementById("a b"), false).zIndex, "3");
+ }, "Spaces are allowed in an id and still make an association.");
+
+ test(function() {
+ assert_equals(document.defaultView.getComputedStyle(document.getElementById("åèiöú"), false).zIndex, "6");
+ }, "Non-ASCII is allowed in an id and still make an association for CSS.");
+
+
+ // id IDL attribute reflects the content attribute
+ var firstSpan = document.getElementById("abcd");
+
+ test(function() {
+ assert_equals(firstSpan.id, "abcd");
+ }, "The id IDL attribute must reflect the id content attribute, for getting.");
+
+ test(function() {
+ firstSpan.id = "xyz";
+ assert_equals(firstSpan.getAttribute("id"), "xyz");
+ }, "The id IDL attribute must reflect the id content attribute, for setting via IDL attribute.");
+
+ test(function() {
+ assert_equals(document.getElementById("xyz"), firstSpan);
+ }, "After setting id via id attribute, getElementById find the element by the new id.");
+
+ test(function() {
+ assert_equals(document.getElementById("abcd"), null);
+ }, "After setting id via id attribute, getElementById doesn't find the element by the old id.");
+
+ test(function() {
+ assert_equals(document.defaultView.getComputedStyle(firstSpan, false).zIndex, "4");
+ }, "After setting id via id attribute, CSS association is via the new ID.");
+
+ test(function() {
+ firstSpan.setAttribute("id", "foobar");
+ assert_equals(firstSpan.id, "foobar");
+ }, "The id IDL attribute must reflect the id content attribute, for setting via setAttribute.");
+
+ test(function() {
+ assert_equals(document.getElementById("foobar"), firstSpan);
+ }, "After setting id via setAttribute attribute, getElementById find the element by the new id.");
+
+ test(function() {
+ assert_equals(document.getElementById("xyz"), null);
+ }, "After setting id via setAttribute attribute, getElementById doesn't find the element by the old id.");
+
+ test(function() {
+ assert_equals(document.defaultView.getComputedStyle(firstSpan, false).zIndex, "5");
+ }, "After setting id via setAttribute attribute, CSS association is via the new ID.");
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/id-name-specialcase.html b/testing/web-platform/tests/html/dom/elements/global-attributes/id-name-specialcase.html
new file mode 100644
index 000000000..77e4100b7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/id-name-specialcase.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<title>HTML5: test id with none pure alpha characters </title>
+<link rel="author" title="justin.shen" href=mailto:cosmichut@msn.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div style="display:none">
+ <input id="123" value="123"></input>
+ <input id="1test" value="1test"></input>
+ <input id="_test" value="_test"></input>
+ <input id="." value="."></input>
+ <input id="中国" value="china"></input>
+</div>
+<script>
+test(function() {
+ assert_equals(document.getElementById("123").value, "123");
+}, "id with digits only");
+test(function() {
+ assert_equals(document.getElementById("1test").value, "1test");
+},"id start with digits");
+test(function() {
+ assert_equals(document.getElementById("_test").value, "_test");
+},"id start with underscore");
+test(function() {
+ assert_equals(document.getElementById(".").value, ".");
+},"id with punctuation only");
+test(function() {
+ assert_equals(document.getElementById("中国").value, "china");
+},"id with chinese character");
+</script>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/id-name.html b/testing/web-platform/tests/html/dom/elements/global-attributes/id-name.html
new file mode 100644
index 000000000..7fdac993b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/id-name.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<title>id and name attributes and getElementById</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-id-attribute">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<div name="abcd"></div>
+<p name="abcd" id="abcd"></p>
+</div>
+<script>
+test(function() {
+ assert_equals(document.getElementById("abcd").nodeName, "P");
+ assert_equals(document.getElementById("abcd").localName, "p");
+});
+</script>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/lang-xmllang-01-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/lang-xmllang-01-ref.html
new file mode 100644
index 000000000..1606bca21
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/lang-xmllang-01-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<title>Languages</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes">
+<link tel="help" href="http://www.w3.org/TR/CSS2/selector.html#lang">
+<meta name="flags" content="css21">
+<style>
+#test > * { background: limegreen; }
+</style>
+<body>
+<p>All lines below should have a green background.</p>
+<div id="test">
+<div><p>{}{lang}{en}</p></div>
+<div><p>{}{xml:lang}{en}</p></div>
+<div><div><p>Parent: {}{lang}{en}</p></div></div>
+<div><div><p>Parent: {}{xml:lang}{en}</p></div></div>
+<div><p>{xml}{lang}{en}</p></div>
+<div><p>{xml}{lang}{en} - {lang}{de}</p></div>
+<div><p>{xml}{lang}{de} - {lang}{en}</p></div>
+</div>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/lang-xmllang-01.html b/testing/web-platform/tests/html/dom/elements/global-attributes/lang-xmllang-01.html
new file mode 100644
index 000000000..9538f15ca
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/lang-xmllang-01.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<title>Languages</title>
+<link rel="match" href="lang-xmllang-01-ref.html">
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes">
+<link tel="help" href="http://www.w3.org/TR/CSS2/selector.html#lang">
+<meta name="flags" content="css21">
+<style>
+#test #a :lang(en) { background: limegreen; }
+#test #b :lang(nl) { background: limegreen; }
+#test #c :lang(en) { background: limegreen; }
+#test #d :lang(nl) { background: limegreen; }
+#test #e :lang(en) { background: limegreen; }
+#test #f :lang(en) { background: limegreen; }
+#test #g :lang(de) { background: limegreen; }
+</style>
+<body>
+<p>All lines below should have a green background.</p>
+<div id="test" lang="nl">
+<div id="a"><p lang="en">{}{lang}{en}</p></div>
+<div id="b"><p xml:lang="en">{}{xml:lang}{en}</p></div>
+<div id="c"><div lang="en"><p>Parent: {}{lang}{en}</p></div></div>
+<div id="d"><div xml:lang="en"><p>Parent: {}{xml:lang}{en}</p></div></div>
+</div>
+<script>
+try {
+ var XML = "http://www.w3.org/XML/1998/namespace";
+ var container = document.getElementById("test");
+
+ var div = document.createElement("div");
+ div.id = "e";
+ var testNode = document.createElement("p");
+ testNode.appendChild(document.createTextNode("{xml}{lang}{en}"));
+ testNode.setAttributeNS(XML, "xml:lang", "en");
+ div.appendChild(testNode);
+ container.appendChild(div);
+
+ div = document.createElement("div");
+ div.id = "f";
+ testNode = document.createElement("p");
+ testNode.appendChild(document.createTextNode("{xml}{lang}{en} - {lang}{de}"));
+ testNode.setAttributeNS(XML, "xml:lang", "en");
+ testNode.setAttributeNS(null, "lang", "de");
+ div.appendChild(testNode);
+ container.appendChild(div);
+
+ div = document.createElement("div");
+ div.id = "g";
+ testNode = document.createElement("p");
+ testNode.appendChild(document.createTextNode("{xml}{lang}{de} - {lang}{en}"));
+ testNode.setAttributeNS(XML, "xml:lang", "de");
+ testNode.setAttributeNS(null, "lang", "en");
+ container.appendChild(testNode);
+ div.appendChild(testNode);
+ container.appendChild(div);
+} catch (e) {
+}
+</script>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/lang-xyzzy-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/lang-xyzzy-ref.html
new file mode 100644
index 000000000..b2037182b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/lang-xyzzy-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<title>Invalid languages</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<meta name="flags" content="css21">
+<style>#testp { color: green; }</style>
+<body>
+<div id="test">
+<p id="testp" lang="xyzzy">ABC</p>
+</div>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/lang-xyzzy.html b/testing/web-platform/tests/html/dom/elements/global-attributes/lang-xyzzy.html
new file mode 100644
index 000000000..d6e6aeb64
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/lang-xyzzy.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<title>Invalid languages</title>
+<link rel="match" href="lang-xyzzy-ref.html">
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes">
+<link tel="help" href="http://www.w3.org/TR/CSS2/selector.html#lang">
+<meta name="flags" content="css21">
+<style>:lang(xyzzy) { color: green; }</style>
+<body>
+<div id="test">
+<p id="testp" lang="xyzzy">ABC</p>
+</div>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/style-01-ref.html b/testing/web-platform/tests/html/dom/elements/global-attributes/style-01-ref.html
new file mode 100644
index 000000000..be8175e61
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/style-01-ref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<title>The style attribute</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-attribute">
+<link rel="help" href="http://www.w3.org/TR/css-style-attr/#syntax">
+<link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#cascading-order">
+<link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#specificity">
+<style>
+#test p { background: limegreen; }
+</style>
+<div id="test">
+<p>This line should have a green background.
+<p>This line should have a green background.
+<p>This line should have a green background.
+<p>This line should have a green background.
+<p>This line should have a green background.
+<p>This line should have a green background.
+<p>This line should have a green background.
+<p>This line should have a green background.
+<p>This line should have a green background.
+<p>This line should have a green background.
+<p>This line should have a green background.
+<p>This line should have a green background.
+</div>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/style-01.html b/testing/web-platform/tests/html/dom/elements/global-attributes/style-01.html
new file mode 100644
index 000000000..c0e099580
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/style-01.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<title>The style attribute</title>
+<link rel="match" href="style-01-ref.html">
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-attribute">
+<link rel="help" href="http://www.w3.org/TR/css-style-attr/#syntax">
+<link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#cascading-order">
+<link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#specificity">
+<style>
+#idsel { background: red; }
+#idsel2 { background: limegreen !important; }
+</style>
+<div id="test">
+<p style="background:limegreen">This line should have a green background.
+<p style="/**/background:limegreen">This line should have a green background.
+<p style="background/**/:limegreen">This line should have a green background.
+<p style="background:/**/limegreen">This line should have a green background.
+<p style="background:limegreen/**/">This line should have a green background.
+<p id="idsel1" style="background:limegreen">This line should have a green background.
+<p id="idsel2" style="background:red">This line should have a green background.
+<p style="background:limegreen; background:r/**/ed">This line should have a green background.
+<p style="background:limegreen;}">This line should have a green background.
+<p style="};background:limegreen">This line should have a green background.
+<p style="background:red;};background:limegreen">This line should have a green background.
+<p style="background:limegreen;{background:red}">This line should have a green background.
+</div>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-001.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-001.html
new file mode 100644
index 000000000..c2966f362
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-001.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html lang="ko" >
+<head>
+<meta charset="utf-8"/>
+<title>lang attribute in html tag</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='dom'>
+<style type='text/css'>
+ #colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
+ #colonlangcontroltest:lang(xx) { display:none; }
+.test div { width: 50px; }
+#box:lang(ko) { width: 100px; }
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box">&#xA0;</div></div>
+<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
+
+
+<!--Notes:
+
+This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "The browser will recognize a language declared in a lang attribute on the html tag.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-002.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-002.html
new file mode 100644
index 000000000..205bc35f2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-002.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html xml:lang="ko" >
+<head>
+<meta charset="utf-8"/>
+<title>xml:lang attribute in html tag</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='dom'>
+<style type='text/css'>
+ #colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
+ #colonlangcontroltest:lang(xx) { display:none; }
+.test div { width: 50px; }
+#box:lang(ko) { width: 100px; }
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box">&#xA0;</div></div>
+<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
+
+
+<!--Notes:
+
+This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
+assert_equals(document.getElementById('box').offsetWidth, 50);
+}, "The browser will NOT recognize a language declared in an xml:lang attribute on the html tag.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-003.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-003.html
new file mode 100644
index 000000000..717aa12e6
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-003.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html >
+<head>
+<meta charset="utf-8"/>
+<title>HTTP header</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http dom'>
+<style type='text/css'>
+ #colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
+ #colonlangcontroltest:lang(xx) { display:none; }
+.test div { width: 50px; }
+#box:lang(ko) { width: 100px; }
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box">&#xA0;</div></div>
+<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
+
+
+<!--Notes:
+
+This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "The browser will recognize a language declared in the HTTP header, when there is no internal language declaration.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-003.html.headers b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-003.html.headers
new file mode 100644
index 000000000..0c47ecd4f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-003.html.headers
@@ -0,0 +1 @@
+Content-Language: ko
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-004.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-004.html
new file mode 100644
index 000000000..ff36f75ad
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-004.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html >
+<head>
+<meta charset="utf-8"/>
+ <meta http-equiv="Content-Language" content="ko" >
+<title>pragma-set default</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='dom'>
+<style type='text/css'>
+ #colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
+ #colonlangcontroltest:lang(xx) { display:none; }
+.test div { width: 50px; }
+#box:lang(ko) { width: 100px; }
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box">&#xA0;</div></div>
+<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
+
+
+<!--Notes:
+
+This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "The browser will recognize a language declared in a meta element in the head using http-equiv='Content-Language' content='..' (with a single language tag value), when there is no other language declaration inside the document.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-005.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-005.html
new file mode 100644
index 000000000..63fb8e3bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-005.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html lang="ko" >
+<head>
+<meta charset="utf-8"/>
+<title>HTTP header and html lang</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http dom'>
+<style type='text/css'>
+ #colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
+ #colonlangcontroltest:lang(xx) { display:none; }
+.test div { width: 50px; }
+#box:lang(ko) { width: 100px; }
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box">&#xA0;</div></div>
+<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
+
+
+<!--Notes:
+
+This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "If there is a conflict between the language declarations in the HTTP header and the html element using lang, the browser will recognize the language declared in the html element.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-005.html.headers b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-005.html.headers
new file mode 100644
index 000000000..1b971b697
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-005.html.headers
@@ -0,0 +1 @@
+Content-Language: zh
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-006.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-006.html
new file mode 100644
index 000000000..ede491202
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-006.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html >
+<head>
+<meta charset="utf-8"/>
+ <meta http-equiv="Content-Language" content="ko" >
+<title>HTTP header and meta element</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http dom'>
+<style type='text/css'>
+ #colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
+ #colonlangcontroltest:lang(xx) { display:none; }
+.test div { width: 50px; }
+#box:lang(ko) { width: 100px; }
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box">&#xA0;</div></div>
+<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
+
+
+<!--Notes:
+
+This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "If there is a conflict between the language declarations in the HTTP header and the Content-Language meta element, the UA will recognize the language declared in the meta element.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-006.html.headers b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-006.html.headers
new file mode 100644
index 000000000..1b971b697
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-006.html.headers
@@ -0,0 +1 @@
+Content-Language: zh
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-007.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-007.html
new file mode 100644
index 000000000..8fafef036
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-007.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html lang="ko" >
+<head>
+<meta charset="utf-8"/>
+ <meta http-equiv="Content-Language" content="zh" >
+<title>html lang and meta elements</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='dom'>
+<style type='text/css'>
+ #colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
+ #colonlangcontroltest:lang(xx) { display:none; }
+.test div { width: 50px; }
+#box:lang(ko) { width: 100px; }
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box">&#xA0;</div></div>
+<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
+
+
+<!--Notes:
+
+This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "If there is a conflict between the language declared using lang in the html element and that in the meta element, the UA will recognize the language declared in the html element.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-008.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-008.html
new file mode 100644
index 000000000..3be54154c
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-008.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html >
+<head>
+<meta charset="utf-8"/>
+<title>lang="..." vs lang=""</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='dom'>
+<style type='text/css'>
+ #colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
+ #colonlangcontroltest:lang(xx) { display:none; }
+.test div { width: 50px; }
+#box:lang(ko) { width: 100px; }
+</style>
+</head>
+<body>
+
+
+
+<div class="test" lang="ko"><div id="box" lang="">&#xA0;</div></div>
+<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
+
+
+<!--Notes:
+
+This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
+assert_equals(document.getElementById('box').offsetWidth, 50);
+}, "If an element contains a lang attribute with an empty value, the value of a lang attribute higher up the document tree will no longer be applied to the content of that element.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-009.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-009.html
new file mode 100644
index 000000000..3a927028e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-009.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html lang="" >
+<head>
+<meta charset="utf-8"/>
+<title>lang="" vs HTTP</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http dom'>
+<style type='text/css'>
+ #colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
+ #colonlangcontroltest:lang(xx) { display:none; }
+.test div { width: 50px; }
+#box:lang(ko) { width: 100px; }
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box">&#xA0;</div></div>
+<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
+
+
+<!--Notes:
+
+This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
+assert_equals(document.getElementById('box').offsetWidth, 50);
+}, "If the HTTP header contains a language declaration but the html element uses an empty lang value, the UA will not recognize the language declared in the HTTP header.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-009.html.headers b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-009.html.headers
new file mode 100644
index 000000000..0c47ecd4f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-009.html.headers
@@ -0,0 +1 @@
+Content-Language: ko
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-010.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-010.html
new file mode 100644
index 000000000..2c2173747
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-010.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html lang="" >
+<head>
+<meta charset="utf-8"/>
+ <meta http-equiv="Content-Language" content="ko" >
+<title>lang="" vs meta Content-Language</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='dom'>
+<style type='text/css'>
+ #colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
+ #colonlangcontroltest:lang(xx) { display:none; }
+.test div { width: 50px; }
+#box:lang(ko) { width: 100px; }
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box">&#xA0;</div></div>
+<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
+
+
+<!--Notes:
+
+This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
+assert_equals(document.getElementById('box').offsetWidth, 50);
+}, "If the meta Content-Language element contains a language declaration but the html element uses an empty lang value, the UA will not recognize the language declared in the meta Content-Language element.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-011.html.headers b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-011.html.headers
new file mode 100644
index 000000000..827b4348f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-lang-attribute-011.html.headers
@@ -0,0 +1 @@
+Content-Language: ko,zh,ja
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-007.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-007.html
new file mode 100644
index 000000000..abce2858a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-007.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8"/>
+<title>no translate attribute</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-translate-attribute'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style type='text/css'>
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box">&nbsp;</div></div>
+
+
+<script>
+test(function() {
+assert_true(document.getElementById('box').translate);
+}, "In the default case, ie. with no translate attribute in the page, javascript will detect the translation mode of text as translate-enabled.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-008.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-008.html
new file mode 100644
index 000000000..70486fe59
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-008.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8"/>
+<title>translate=yes</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-translate-attribute'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style type='text/css'>
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box" translate="yes">&nbsp;</div></div>
+
+
+<script>
+test(function() {
+assert_true(document.getElementById('box').translate);
+}, "If the translate attribute is set to yes, javascript will detect the translation mode of text as translate-enabled.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-009.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-009.html
new file mode 100644
index 000000000..1ab49b030
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-009.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8"/>
+<title>translate=no</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-translate-attribute'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style type='text/css'>
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box" translate="no">&nbsp;</div></div>
+
+
+<script>
+test(function() {
+assert_false(document.getElementById('box').translate);
+}, "If the translate attribute is set to no, javascript will detect the translation mode of text as no-translate.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-010.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-010.html
new file mode 100644
index 000000000..c45965e00
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-010.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8"/>
+<title>translate inherits no</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-translate-attribute'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style type='text/css'>
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box" translate="no">&nbsp; <span id="spantest">&nbsp;</span></div></div>
+
+
+<script>
+test(function() {
+assert_false(document.getElementById('spantest').translate);
+}, "If the translate attribute is set to no, javascript will detect the translation mode of elements inside that element with no translate flag as no-translate.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-011.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-011.html
new file mode 100644
index 000000000..101f70e2e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-011.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8"/>
+<title>translate=yes inside translate=no</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-translate-attribute'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style type='text/css'>
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box" translate="no">&nbsp; <span id="spantest" translate="yes">&nbsp;</span></div></div>
+
+
+<script>
+test(function() {
+assert_true(document.getElementById('spantest').translate);
+}, "If the translate attribute is set to yes on an element inside an element with the translate attribute set to no, javascript will detect the translation mode of text in the inner element as translate-enabled.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-012.html b/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-012.html
new file mode 100644
index 000000000..1d81cfd8b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/the-translate-attribute-012.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8"/>
+<title>translate=""</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-translate-attribute'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style type='text/css'>
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box" translate="">&nbsp;</div></div>
+
+
+<script>
+test(function() {
+assert_true(document.getElementById('box').translate);
+}, "If the translate attribute is set to a null string, javascript will detect the translation mode of text as translate-enabled.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/.gitkeep b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001a.html
new file mode 100644
index 000000000..16a308a2f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following number, opposite direction</title>
+<link rel="author" title="Richard Ishida" href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel="match" href='reference/dir-isolation-001-ref.html'>
+<meta name="assert" content='Element content with a dir attribute is treated as a neutral character and directionally isolated from a following number.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="rtl">&#x5d0;</span> 3</div>
+<div dir="ltr"><span dir="rtl">a</span> 3</div>
+<div dir="rtl"><span dir="ltr">&#x5d0;</span> 3</div>
+<div dir="rtl"><span dir="ltr">a</span> 3</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; 3&#x202c;</div>
+<div dir="ltr">&#x202d;a 3&#x202c;</div>
+<div dir="rtl">&#x202d;3 &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3 a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001b.html
new file mode 100644
index 000000000..197f49aa2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following number, auto</title>
+<link rel="author" title="Richard Ishida" href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel="match" href='reference/dir-isolation-001-ref.html'>
+<meta name="assert" content='Element content with a dir attribute is treated as a neutral character and directionally isolated from a following number.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="auto">&#x5d0;</span> 3</div>
+<div dir="ltr"><span dir="auto">a</span> 3</div>
+<div dir="rtl"><span dir="auto">&#x5d0;</span> 3</div>
+<div dir="rtl"><span dir="auto">a</span> 3</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; 3&#x202c;</div>
+<div dir="ltr">&#x202d;a 3&#x202c;</div>
+<div dir="rtl">&#x202d;3 &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3 a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001c.html
new file mode 100644
index 000000000..95ec6c739
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following number, same direction</title>
+<link rel="author" title="Richard Ishida" href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel="match" href='reference/dir-isolation-001-ref.html'>
+<meta name="assert" content='Element content with a dir attribute is treated as a neutral character and directionally isolated from a following number.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="ltr">&#x5d0;</span> 3</div>
+<div dir="ltr"><span dir="ltr">a</span> 3</div>
+<div dir="rtl"><span dir="rtl">&#x5d0;</span> 3</div>
+<div dir="rtl"><span dir="rtl">a</span> 3</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; 3&#x202c;</div>
+<div dir="ltr">&#x202d;a 3&#x202c;</div>
+<div dir="rtl">&#x202d;3 &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3 a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002a.html
new file mode 100644
index 000000000..7b7029a26
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following number with intervening neutrals, opposite direction</title>
+<link rel="author" title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-002a-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from a following number.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="rtl">> &#x5d0; ></span> > 3 ></div>
+<div dir="ltr"><span dir="rtl">> a ></span> > 3 ></div>
+<div dir="rtl"><span dir="ltr">> &#x5d0; ></span> > 3 ></div>
+<div dir="rtl"><span dir="ltr">> a ></span> > 3 ></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&lt; &#x5d0; &lt; &gt; 3 &gt;&#x202c;</div>
+<div dir="ltr">&#x202d;&lt; a &lt; &gt; 3 &gt;&#x202c;</div>
+<div dir="rtl">&#x202d;&lt; 3 &lt; &gt; &#x5d0; &gt;&#x202c;</div>
+<div dir="rtl">&#x202d;&lt; 3 &lt; &gt; a &gt;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002b.html
new file mode 100644
index 000000000..d448de508
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following number with intervening neutrals, auto</title>
+<link rel="author" title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-002b-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from a following number.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="auto">> &#x5d0; ></span> > 3 ></div>
+<div dir="ltr"><span dir="auto">> a ></span> > 3 ></div>
+<div dir="rtl"><span dir="auto">> &#x5d0; ></span> > 3 ></div>
+<div dir="rtl"><span dir="auto">> a ></span> > 3 ></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&lt; &#x5d0; &lt; &gt; 3 &gt;&#x202c;</div>
+<div dir="ltr">&#x202d;&gt; a &gt; &gt; 3 &gt;&#x202c;</div>
+<div dir="rtl">&#x202d;&lt; 3 &lt; &lt; &#x5d0; &lt;&#x202c;</div>
+<div dir="rtl">&#x202d;&lt; 3 &lt; &gt; a &gt;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002c.html
new file mode 100644
index 000000000..e88fb1c84
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following number with intervening neutrals, same direction</title>
+<link rel="author" title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-002c-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from a following number.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="ltr">&gt; &#x5d0; &gt;</span> &gt; 3 &gt;</div>
+<div dir="ltr"><span dir="ltr">&gt; a &gt;</span> &gt; 3 &gt;</div>
+<div dir="rtl"><span dir="rtl">&gt; &#x5d0; &gt;</span> &gt; 3 &gt;</div>
+<div dir="rtl"><span dir="rtl">&gt; a &gt;</span> &gt; 3 &gt;</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&gt; &#x5d0; &gt; &gt; 3 &gt;&#x202c;</div>
+<div dir="ltr">&#x202d;&gt; a &gt; &gt; 3 &gt;&#x202c;</div>
+<div dir="rtl">&#x202d;&lt; 3 &lt; &lt; &#x5d0; &lt;&#x202c;</div>
+<div dir="rtl">&#x202d;&lt; 3 &lt; &lt; a &lt;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003a.html
new file mode 100644
index 000000000..9cf65c818
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from immediately following number, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-003-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and is directionally isolated from a following number, even with no intervening white space.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="rtl">&#x5d0;</span>3</div>
+<div dir="ltr"><span dir="rtl">a</span>3</div>
+<div dir="rtl"><span dir="ltr">&#x5d0;</span>3</div>
+<div dir="rtl"><span dir="ltr">a</span>3</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0;3&#x202c;</div>
+<div dir="ltr">&#x202d;a3&#x202c;</div>
+<div dir="rtl">&#x202d;3&#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003b.html
new file mode 100644
index 000000000..2c6b55308
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from immediately following number, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-003-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and is directionally isolated from a following number, even with no intervening white space.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="auto">&#x5d0;</span>3</div>
+<div dir="ltr"><span dir="auto">a</span>3</div>
+<div dir="rtl"><span dir="auto">&#x5d0;</span>3</div>
+<div dir="rtl"><span dir="auto">a</span>3</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0;3&#x202c;</div>
+<div dir="ltr">&#x202d;a3&#x202c;</div>
+<div dir="rtl">&#x202d;3&#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003c.html
new file mode 100644
index 000000000..ac8735122
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from immediately following number, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-003-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and is directionally isolated from a following number, even with no intervening white space.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="ltr">&#x5d0;</span>3</div>
+<div dir="ltr"><span dir="ltr">a</span>3</div>
+<div dir="rtl"><span dir="rtl">&#x5d0;</span>3</div>
+<div dir="rtl"><span dir="rtl">a</span>3</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0;3&#x202c;</div>
+<div dir="ltr">&#x202d;a3&#x202c;</div>
+<div dir="rtl">&#x202d;3&#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004a.html
new file mode 100644
index 000000000..27a674ccd
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: numbers isolated from preceding text, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-004-ref.html'>
+<meta name='assert' content='Numeric element content with a dir attribute is treated as a neutral character and directionally isolated from preceding text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; <span dir="rtl">3</span></div>
+<div dir="ltr">a <span dir="rtl">3</span></div>
+<div dir="rtl">&#x5d0; <span dir="ltr">3</span></div>
+<div dir="rtl">a <span dir="ltr">3</span></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; 3&#x202c;</div>
+<div dir="ltr">&#x202d;a 3&#x202c;</div>
+<div dir="rtl">&#x202d;3 &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3 a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004b.html
new file mode 100644
index 000000000..6fe74393a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: numbers isolated from preceding text, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-004-ref.html'>
+<meta name='assert' content='Numeric element content with a dir attribute is treated as a neutral character and directionally isolated from preceding text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; <span dir="auto">3</span></div>
+<div dir="ltr">a <span dir="auto">3</span></div>
+<div dir="rtl">&#x5d0; <span dir="auto">3</span></div>
+<div dir="rtl">a <span dir="auto">3</span></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; 3&#x202c;</div>
+<div dir="ltr">&#x202d;a 3&#x202c;</div>
+<div dir="rtl">&#x202d;3 &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3 a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004c.html
new file mode 100644
index 000000000..43d994b2f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: numbers isolated from preceding text, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-004-ref.html'>
+<meta name='assert' content='Numeric element content with a dir attribute is treated as a neutral character and directionally isolated from preceding text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; <span dir="ltr">3</span></div>
+<div dir="ltr">a <span dir="ltr">3</span></div>
+<div dir="rtl">&#x5d0; <span dir="rtl">3</span></div>
+<div dir="rtl">a <span dir="rtl">3</span></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; 3&#x202c;</div>
+<div dir="ltr">&#x202d;a 3&#x202c;</div>
+<div dir="rtl">&#x202d;3 &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3 a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005a.html
new file mode 100644
index 000000000..2fbddbd71
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following text, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-005-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="rtl">&#x5d0;</span> &#x5d1;...</div>
+<div dir="ltr"><span dir="rtl">a</span> b...</div>
+<div dir="rtl"><span dir="ltr">a</span> b...</div>
+<div dir="rtl"><span dir="ltr">&#x5d0;</span> &#x5d1;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; &#x5d1;...&#x202c;</div>
+<div dir="ltr">&#x202d;a b...&#x202c;</div>
+<div dir="rtl">&#x202d;...b a&#x202c;</div>
+<div dir="rtl">&#x202d;...&#x5d1; &#x5d0;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005b.html
new file mode 100644
index 000000000..d61e258f2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following text, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-005-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="auto">&#x5d0;</span> &#x5d1;...</div>
+<div dir="ltr"><span dir="auto">a</span> b...</div>
+<div dir="rtl"><span dir="auto">a</span> b...</div>
+<div dir="rtl"><span dir="auto">&#x5d0;</span> &#x5d1;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; &#x5d1;...&#x202c;</div>
+<div dir="ltr">&#x202d;a b...&#x202c;</div>
+<div dir="rtl">&#x202d;...b a&#x202c;</div>
+<div dir="rtl">&#x202d;...&#x5d1; &#x5d0;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005c.html
new file mode 100644
index 000000000..d544275b2
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following text, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-005-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="ltr">&#x5d0;</span> &#x5d1;...</div>
+<div dir="ltr"><span dir="ltr">a</span> b...</div>
+<div dir="rtl"><span dir="rtl">a</span> b...</div>
+<div dir="rtl"><span dir="rtl">&#x5d0;</span> &#x5d1;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; &#x5d1;...&#x202c;</div>
+<div dir="ltr">&#x202d;a b...&#x202c;</div>
+<div dir="rtl">&#x202d;...b a&#x202c;</div>
+<div dir="rtl">&#x202d;...&#x5d1; &#x5d0;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006a.html
new file mode 100644
index 000000000..430df00d9
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006a.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following text with intervening neutrals, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-006-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text despite intervening neutrals.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="rtl">&gt; &#x5d0; &gt;</span> &gt; &#x5d1; &gt;...</div>
+<div dir="rtl"><span dir="ltr">&gt; a &gt;</span> &gt; b &gt;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&lt; &#x5d0; &lt; &gt; &#x5d1; &gt;...&#x202c;</div>
+<div dir="rtl">&#x202d;...&lt; b &lt; &gt; a &gt;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006b.html
new file mode 100644
index 000000000..a6da48715
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006b.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following text with intervening neutrals, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-006-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text despite intervening neutrals.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="auto">&gt; &#x5d0; &gt;</span> &gt; &#x5d1; &gt;...</div>
+<div dir="rtl"><span dir="auto">&gt; a &gt;</span> &gt; b &gt;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&lt; &#x5d0; &lt; &gt; &#x5d1; &gt;...&#x202c;</div>
+<div dir="rtl">&#x202d;...&lt; b &lt; &gt; a &gt;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006c.html
new file mode 100644
index 000000000..3407d37f3
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006c.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following text with intervening neutrals, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-006c-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text despite intervening neutrals.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="ltr">&gt; &#x5d0; &gt;</span> &gt; &#x5d1; &gt;...</div>
+<div dir="rtl"><span dir="rtl">&gt; a &gt;</span> &gt; b &gt;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&gt; &#x5d0; &gt; &gt; &#x5d1; &gt;...&#x202c;</div>
+<div dir="rtl">&#x202d;...&lt; b &lt; &lt; a &lt;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007a.html
new file mode 100644
index 000000000..e8b37b1b9
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from immediately following text, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-007-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text even with no intervening white space.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="rtl">&#x5d0;</span>&#x5d1;...</div>
+<div dir="ltr"><span dir="rtl">a</span>b...</div>
+<div dir="rtl"><span dir="ltr">a</span>b...</div>
+<div dir="rtl"><span dir="ltr">&#x5d0;</span>&#x5d1;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0;&#x5d1;...&#x202c;</div>
+<div dir="ltr">&#x202d;ab...&#x202c;</div>
+<div dir="rtl">&#x202d;...ba&#x202c;</div>
+<div dir="rtl">&#x202d;...&#x5d1;&#x5d0;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007b.html
new file mode 100644
index 000000000..c54e63de7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from immediately following text, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-007-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text even with no intervening white space.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="auto">&#x5d0;</span>&#x5d1;...</div>
+<div dir="ltr"><span dir="auto">a</span>b...</div>
+<div dir="rtl"><span dir="auto">a</span>b...</div>
+<div dir="rtl"><span dir="auto">&#x5d0;</span>&#x5d1;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0;&#x5d1;...&#x202c;</div>
+<div dir="ltr">&#x202d;ab...&#x202c;</div>
+<div dir="rtl">&#x202d;...ba&#x202c;</div>
+<div dir="rtl">&#x202d;...&#x5d1;&#x5d0;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007c.html
new file mode 100644
index 000000000..b9c5219b8
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from immediately following text, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-007-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text even with no intervening white space.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="ltr">&#x5d0;</span>&#x5d1;...</div>
+<div dir="ltr"><span dir="ltr">a</span>b...</div>
+<div dir="rtl"><span dir="rtl">a</span>b...</div>
+<div dir="rtl"><span dir="rtl">&#x5d0;</span>&#x5d1;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0;&#x5d1;...&#x202c;</div>
+<div dir="ltr">&#x202d;ab...&#x202c;</div>
+<div dir="rtl">&#x202d;...ba&#x202c;</div>
+<div dir="rtl">&#x202d;...&#x5d1;&#x5d0;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008a.html
new file mode 100644
index 000000000..1455fd552
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from preceding text, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-008-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from preceding text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; <span dir="rtl">&#x5d1;</span></div>
+<div dir="ltr">a <span dir="rtl">b</span></div>
+<div dir="rtl">&#x5d0; <span dir="ltr">&#x5d1;</span></div>
+<div dir="rtl">a <span dir="ltr">b</span></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; &#x5d1;&#x202c;</div>
+<div dir="ltr">&#x202d;a b&#x202c;</div>
+<div dir="rtl">&#x202d;&#x5d1; &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;b a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008b.html
new file mode 100644
index 000000000..f12e6d67b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from preceding text, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-008-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from preceding text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; <span dir="auto">&#x5d1;</span></div>
+<div dir="ltr">a <span dir="auto">b</span></div>
+<div dir="rtl">&#x5d0; <span dir="auto">&#x5d1;</span></div>
+<div dir="rtl">a <span dir="auto">b</span></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; &#x5d1;&#x202c;</div>
+<div dir="ltr">&#x202d;a b&#x202c;</div>
+<div dir="rtl">&#x202d;&#x5d1; &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;b a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008c.html
new file mode 100644
index 000000000..b1754cf23
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from preceding text, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-008-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from preceding text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; <span dir="ltr">&#x5d1;</span></div>
+<div dir="ltr">a <span dir="ltr">b</span></div>
+<div dir="rtl">&#x5d0; <span dir="rtl">&#x5d1;</span></div>
+<div dir="rtl">a <span dir="rtl">b</span></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; &#x5d1;&#x202c;</div>
+<div dir="ltr">&#x202d;a b&#x202c;</div>
+<div dir="rtl">&#x202d;&#x5d1; &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;b a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009a.html
new file mode 100644
index 000000000..63a9706ba
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009a.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from surrounding text, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-009-ref.html'>
+<meta name='assert' content="Element content with a dir attribute is treated as a neutral character and directionally isolated from surrounding text.">
+<style type='text/css'>
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!-- Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+If the BDI in the test's first DIV were a SPAN, its b would prevent the &#x5d0; and the &#x5d1;
+from forming a single RTL run and thus keep the &gt;s between from being mirrored into &lt;s.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; &gt; <span dir="rtl">&gt; b &gt;</span> &gt; &#x5d2;...</div>
+<div dir="rtl">a &gt; <span dir="ltr">&gt; &#x5d1; &gt;</span> &gt; c...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d2; &lt; &lt; b &lt; &lt; &#x5d0;...&#x202c;</div>
+<div dir="rtl">&#x202d;...a &gt; &gt; &#x5d1; &gt; &gt; c&#x202c;</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009b.html
new file mode 100644
index 000000000..57098fa75
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009b.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from surrounding text, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-009b-ref.html'>
+<meta name='assert' content="Element content with a dir attribute is treated as a neutral character and directionally isolated from surrounding text.">
+<style type='text/css'>
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!-- Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+If the BDI in the test's first DIV were a SPAN, its b would prevent the &#x5d0; and the &#x5d1;
+from forming a single RTL run and thus keep the &gt;s between from being mirrored into &lt;s.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; &gt; <span dir="auto">&gt; b &gt;</span> &gt; &#x5d2;...</div>
+<div dir="rtl">a &gt; <span dir="auto">&gt; &#x5d1; &gt;</span> &gt; c...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d2; &lt; &gt; b &gt; &lt; &#x5d0;...&#x202c;</div>
+<div dir="rtl">&#x202d;...a &gt; &lt; &#x5d1; &lt; &gt; c&#x202c;</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009c.html
new file mode 100644
index 000000000..4aac3184e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009c.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from surrounding text, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-009b-ref.html'>
+<meta name='assert' content="Element content with a dir attribute is treated as a neutral character and directionally isolated from surrounding text.">
+<style type='text/css'>
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!-- Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+If the BDI in the test's first DIV were a SPAN, its b would prevent the &#x5d0; and the &#x5d1;
+from forming a single RTL run and thus keep the &gt;s between from being mirrored into &lt;s.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; &gt; <span dir="ltr">&gt; b &gt;</span> &gt; &#x5d2;...</div>
+<div dir="rtl">a &gt; <span dir="rtl">&gt; &#x5d1; &gt;</span> &gt; c...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d2; &lt; &gt; b &gt; &lt; &#x5d0;...&#x202c;</div>
+<div dir="rtl">&#x202d;...a &gt; &lt; &#x5d1; &lt; &gt; c&#x202c;</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-001-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-001-ref.html
new file mode 100644
index 000000000..b5882eb7a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-001-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following number, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1488; 3&#8236;</div><div dir="ltr">&#8237;a 3&#8236;</div><div dir="rtl">&#8237;3 &#1488;&#8236;</div><div dir="rtl">&#8237;3 a&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1488; 3&#8236;</div><div dir="ltr">&#8237;a 3&#8236;</div><div dir="rtl">&#8237;3 &#1488;&#8236;</div><div dir="rtl">&#8237;3 a&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002a-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002a-ref.html
new file mode 100644
index 000000000..f28559b5a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002a-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following number with intervening neutrals, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&lt; &#1488; &lt; &gt; 3 &gt;&#8236;</div><div dir="ltr">&#8237;&lt; a &lt; &gt; 3 &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &gt; &#1488; &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &gt; a &gt;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&lt; &#1488; &lt; &gt; 3 &gt;&#8236;</div><div dir="ltr">&#8237;&lt; a &lt; &gt; 3 &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &gt; &#1488; &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &gt; a &gt;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002b-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002b-ref.html
new file mode 100644
index 000000000..d4eda2189
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002b-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following number with intervening neutrals, auto</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&lt; &#1488; &lt; &gt; 3 &gt;&#8236;</div><div dir="ltr">&#8237;&gt; a &gt; &gt; 3 &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &lt; &#1488; &lt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &gt; a &gt;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&lt; &#1488; &lt; &gt; 3 &gt;&#8236;</div><div dir="ltr">&#8237;&gt; a &gt; &gt; 3 &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &lt; &#1488; &lt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &gt; a &gt;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002c-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002c-ref.html
new file mode 100644
index 000000000..6c21d0147
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002c-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following number with intervening neutrals, same direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&gt; &#1488; &gt; &gt; 3 &gt;&#8236;</div><div dir="ltr">&#8237;&gt; a &gt; &gt; 3 &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &lt; &#1488; &lt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &lt; a &lt;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&gt; &#1488; &gt; &gt; 3 &gt;&#8236;</div><div dir="ltr">&#8237;&gt; a &gt; &gt; 3 &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &lt; &#1488; &lt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &lt; a &lt;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-003-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-003-ref.html
new file mode 100644
index 000000000..4c29838ee
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-003-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from immediately following number, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1488;3&#8236;</div><div dir="ltr">&#8237;a3&#8236;</div><div dir="rtl">&#8237;3&#1488;&#8236;</div><div dir="rtl">&#8237;3a&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1488;3&#8236;</div><div dir="ltr">&#8237;a3&#8236;</div><div dir="rtl">&#8237;3&#1488;&#8236;</div><div dir="rtl">&#8237;3a&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-004-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-004-ref.html
new file mode 100644
index 000000000..cb83dde58
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-004-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: numbers isolated from preceding text, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1488; 3&#8236;</div><div dir="ltr">&#8237;a 3&#8236;</div><div dir="rtl">&#8237;3 &#1488;&#8236;</div><div dir="rtl">&#8237;3 a&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1488; 3&#8236;</div><div dir="ltr">&#8237;a 3&#8236;</div><div dir="rtl">&#8237;3 &#1488;&#8236;</div><div dir="rtl">&#8237;3 a&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-005-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-005-ref.html
new file mode 100644
index 000000000..4a6c301aa
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-005-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following text, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1488; &#1489;...&#8236;</div><div dir="ltr">&#8237;a b...&#8236;</div><div dir="rtl">&#8237;...b a&#8236;</div><div dir="rtl">&#8237;...&#1489; &#1488;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1488; &#1489;...&#8236;</div><div dir="ltr">&#8237;a b...&#8236;</div><div dir="rtl">&#8237;...b a&#8236;</div><div dir="rtl">&#8237;...&#1489; &#1488;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006-ref.html
new file mode 100644
index 000000000..0f6b7bbbd
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following text with intervening neutrals, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&lt; &#1488; &lt; &gt; &#1489; &gt;...&#8236;</div><div dir="rtl">&#8237;...&lt; b &lt; &gt; a &gt;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&lt; &#1488; &lt; &gt; &#1489; &gt;...&#8236;</div><div dir="rtl">&#8237;...&lt; b &lt; &gt; a &gt;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006c-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006c-ref.html
new file mode 100644
index 000000000..0347c0910
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006c-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following text with intervening neutrals, same direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&gt; &#1488; &gt; &gt; &#1489; &gt;...&#8236;</div><div dir="rtl">&#8237;...&lt; b &lt; &lt; a &lt;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&gt; &#1488; &gt; &gt; &#1489; &gt;...&#8236;</div><div dir="rtl">&#8237;...&lt; b &lt; &lt; a &lt;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-007-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-007-ref.html
new file mode 100644
index 000000000..665153d64
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-007-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from immediately following text, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1488;&#1489;...&#8236;</div><div dir="ltr">&#8237;ab...&#8236;</div><div dir="rtl">&#8237;...ba&#8236;</div><div dir="rtl">&#8237;...&#1489;&#1488;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1488;&#1489;...&#8236;</div><div dir="ltr">&#8237;ab...&#8236;</div><div dir="rtl">&#8237;...ba&#8236;</div><div dir="rtl">&#8237;...&#1489;&#1488;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-008-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-008-ref.html
new file mode 100644
index 000000000..8eb90f8b7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-008-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from preceding text, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1488; &#1489;&#8236;</div><div dir="ltr">&#8237;a b&#8236;</div><div dir="rtl">&#8237;&#1489; &#1488;&#8236;</div><div dir="rtl">&#8237;b a&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1488; &#1489;&#8236;</div><div dir="ltr">&#8237;a b&#8236;</div><div dir="rtl">&#8237;&#1489; &#1488;&#8236;</div><div dir="rtl">&#8237;b a&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009-ref.html
new file mode 100644
index 000000000..1d2f57c6c
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from surrounding text, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1490; &lt; &lt; b &lt; &lt; &#1488;...&#8236;</div><div dir="rtl">&#8237;...a &gt; &gt; &#1489; &gt; &gt; c&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1490; &lt; &lt; b &lt; &lt; &#1488;...&#8236;</div><div dir="rtl">&#8237;...a &gt; &gt; &#1489; &gt; &gt; c&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009b-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009b-ref.html
new file mode 100644
index 000000000..30ee14c6c
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009b-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from surrounding text, auto</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1490; &lt; &gt; b &gt; &lt; &#1488;...&#8236;</div><div dir="rtl">&#8237;...a &gt; &lt; &#1489; &lt; &gt; c&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1490; &lt; &gt; b &gt; &lt; &#1488;...&#8236;</div><div dir="rtl">&#8237;...a &gt; &lt; &#1489; &lt; &gt; c&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/semantics-0/.gitkeep b/testing/web-platform/tests/html/dom/elements/semantics-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/semantics-0/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/elements/wai-aria/.gitkeep b/testing/web-platform/tests/html/dom/elements/wai-aria/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/wai-aria/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/elements/wai-aria/README.md b/testing/web-platform/tests/html/dom/elements/wai-aria/README.md
new file mode 100644
index 000000000..bea30702d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/wai-aria/README.md
@@ -0,0 +1 @@
+The test suite for WAI-ARIA is available at: <https://www.w3.org/WAI/PF/testharness/>.
diff --git a/testing/web-platform/tests/html/dom/elements/wai-aria/contains.json b/testing/web-platform/tests/html/dom/elements/wai-aria/contains.json
new file mode 100644
index 000000000..031cde580
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/wai-aria/contains.json
@@ -0,0 +1,18 @@
+[
+ {
+ "id": "aria-role-attribute",
+ "original_id": "aria-role-attribute"
+ },
+ {
+ "id": "state-and-property-attributes",
+ "original_id": "state-and-property-attributes"
+ },
+ {
+ "id": "sec-strong-native-semantics",
+ "original_id": "sec-strong-native-semantics"
+ },
+ {
+ "id": "sec-implicit-aria-semantics",
+ "original_id": "sec-implicit-aria-semantics"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/interactions-with-xpath-and-xslt/.gitkeep b/testing/web-platform/tests/html/dom/interactions-with-xpath-and-xslt/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/interactions-with-xpath-and-xslt/.gitkeep
diff --git a/testing/web-platform/tests/html/dom/interfaces.html b/testing/web-platform/tests/html/dom/interfaces.html
new file mode 100644
index 000000000..302828fc0
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/interfaces.html
@@ -0,0 +1,3339 @@
+<!doctype html>
+<meta charset=utf-8>
+<!-- WARNING: These tests are preliminary and probably partly incorrect. -->
+<title>HTML IDL tests</title>
+<meta name=timeout content=long>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=/resources/WebIDLParser.js></script>
+<script src=/resources/idlharness.js></script>
+
+<h1>HTML IDL tests</h1>
+<div id=log></div>
+
+<script type=text/plain class=untested>
+[Constructor(DOMString type, optional EventInit eventInitDict)/*,
+ Exposed=(Window,Worker)*/]
+interface Event {
+ readonly attribute DOMString type;
+ readonly attribute EventTarget? target;
+ readonly attribute EventTarget? currentTarget;
+
+ const unsigned short NONE = 0;
+ const unsigned short CAPTURING_PHASE = 1;
+ const unsigned short AT_TARGET = 2;
+ const unsigned short BUBBLING_PHASE = 3;
+ readonly attribute unsigned short eventPhase;
+
+ void stopPropagation();
+ void stopImmediatePropagation();
+
+ readonly attribute boolean bubbles;
+ readonly attribute boolean cancelable;
+ void preventDefault();
+ readonly attribute boolean defaultPrevented;
+
+ [Unforgeable] readonly attribute boolean isTrusted;
+ readonly attribute DOMTimeStamp timeStamp;
+
+ void initEvent(DOMString type, boolean bubbles, boolean cancelable);
+};
+
+dictionary EventInit {
+ boolean bubbles = false;
+ boolean cancelable = false;
+};
+
+[Constructor(DOMString type, optional CustomEventInit eventInitDict)/*,
+ Exposed=(Window,Worker)*/]
+interface CustomEvent : Event {
+ readonly attribute any detail;
+
+ void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any detail);
+};
+
+dictionary CustomEventInit : EventInit {
+ any detail = null;
+};
+
+//[Exposed=(Window,Worker)]
+interface EventTarget {
+ void addEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
+ void removeEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
+ boolean dispatchEvent(Event event);
+};
+
+callback interface EventListener {
+ void handleEvent(Event event);
+};
+
+[NoInterfaceObject]
+interface NonElementParentNode {
+ Element? getElementById(DOMString elementId);
+};
+Document implements NonElementParentNode;
+DocumentFragment implements NonElementParentNode;
+
+[NoInterfaceObject]
+interface ParentNode {
+ [SameObject] readonly attribute HTMLCollection children;
+ readonly attribute Element? firstElementChild;
+ readonly attribute Element? lastElementChild;
+ readonly attribute unsigned long childElementCount;
+
+ [Unscopable] void prepend((Node or DOMString)... nodes);
+ [Unscopable] void append((Node or DOMString)... nodes);
+
+ Element? querySelector(DOMString selectors);
+ [NewObject] NodeList querySelectorAll(DOMString selectors);
+};
+Document implements ParentNode;
+DocumentFragment implements ParentNode;
+Element implements ParentNode;
+
+[NoInterfaceObject]
+interface NonDocumentTypeChildNode {
+ readonly attribute Element? previousElementSibling;
+ readonly attribute Element? nextElementSibling;
+};
+Element implements NonDocumentTypeChildNode;
+CharacterData implements NonDocumentTypeChildNode;
+
+[NoInterfaceObject]
+interface ChildNode {
+ [Unscopable] void before((Node or DOMString)... nodes);
+ [Unscopable] void after((Node or DOMString)... nodes);
+ [Unscopable] void replaceWith((Node or DOMString)... nodes);
+ [Unscopable] void remove();
+};
+DocumentType implements ChildNode;
+Element implements ChildNode;
+CharacterData implements ChildNode;
+
+// XXX unrecognized tokens "class", "extends"
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=20020
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=23225
+//class Elements extends Array {
+// Element? query(DOMString relativeSelectors);
+// Elements queryAll(DOMString relativeSelectors);
+//};
+
+interface NodeList {
+ getter Node? item(unsigned long index);
+ readonly attribute unsigned long length;
+// iterable<Node>;
+};
+
+interface HTMLCollection {
+ readonly attribute unsigned long length;
+ getter Element? item(unsigned long index);
+ getter Element? namedItem(DOMString name);
+};
+
+[Constructor(MutationCallback callback)]
+interface MutationObserver {
+ void observe(Node target, MutationObserverInit options);
+ void disconnect();
+ sequence<MutationRecord> takeRecords();
+};
+
+callback MutationCallback = void (sequence<MutationRecord> mutations, MutationObserver observer);
+
+dictionary MutationObserverInit {
+ boolean childList = false;
+ boolean attributes;
+ boolean characterData;
+ boolean subtree = false;
+ boolean attributeOldValue;
+ boolean characterDataOldValue;
+ sequence<DOMString> attributeFilter;
+};
+
+interface MutationRecord {
+ readonly attribute DOMString type;
+ readonly attribute Node target;
+ [SameObject] readonly attribute NodeList addedNodes;
+ [SameObject] readonly attribute NodeList removedNodes;
+ readonly attribute Node? previousSibling;
+ readonly attribute Node? nextSibling;
+ readonly attribute DOMString? attributeName;
+ readonly attribute DOMString? attributeNamespace;
+ readonly attribute DOMString? oldValue;
+};
+
+interface Node : EventTarget {
+ const unsigned short ELEMENT_NODE = 1;
+ const unsigned short ATTRIBUTE_NODE = 2; // historical
+ const unsigned short TEXT_NODE = 3;
+ const unsigned short CDATA_SECTION_NODE = 4;
+ const unsigned short ENTITY_REFERENCE_NODE = 5; // historical
+ const unsigned short ENTITY_NODE = 6; // historical
+ const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
+ const unsigned short COMMENT_NODE = 8;
+ const unsigned short DOCUMENT_NODE = 9;
+ const unsigned short DOCUMENT_TYPE_NODE = 10;
+ const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
+ const unsigned short NOTATION_NODE = 12; // historical
+ readonly attribute unsigned short nodeType;
+ readonly attribute DOMString nodeName;
+
+ readonly attribute DOMString? baseURI;
+
+ readonly attribute Document? ownerDocument;
+ readonly attribute Node? parentNode;
+ readonly attribute Element? parentElement;
+ boolean hasChildNodes();
+ [SameObject] readonly attribute NodeList childNodes;
+ readonly attribute Node? firstChild;
+ readonly attribute Node? lastChild;
+ readonly attribute Node? previousSibling;
+ readonly attribute Node? nextSibling;
+
+ attribute DOMString? nodeValue;
+ attribute DOMString? textContent;
+ void normalize();
+
+ [NewObject] Node cloneNode(optional boolean deep = false);
+ boolean isEqualNode(Node? node);
+
+ const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
+ const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
+ const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
+ const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
+ const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
+ const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
+ unsigned short compareDocumentPosition(Node other);
+ boolean contains(Node? other);
+
+ DOMString? lookupPrefix(DOMString? namespace);
+ DOMString? lookupNamespaceURI(DOMString? prefix);
+ boolean isDefaultNamespace(DOMString? namespace);
+
+ Node insertBefore(Node node, Node? child);
+ Node appendChild(Node node);
+ Node replaceChild(Node node, Node child);
+ Node removeChild(Node child);
+};
+
+[Constructor]
+interface Document : Node {
+ [SameObject] readonly attribute DOMImplementation implementation;
+ readonly attribute DOMString URL;
+ readonly attribute DOMString documentURI;
+ readonly attribute DOMString origin;
+ readonly attribute DOMString compatMode;
+ readonly attribute DOMString characterSet;
+ readonly attribute DOMString charset; // legacy alias of .characterSet
+ readonly attribute DOMString inputEncoding; // legacy alias of .characterSet
+ readonly attribute DOMString contentType;
+
+ readonly attribute DocumentType? doctype;
+ readonly attribute Element? documentElement;
+ HTMLCollection getElementsByTagName(DOMString localName);
+ HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
+ HTMLCollection getElementsByClassName(DOMString classNames);
+
+ [NewObject] Element createElement(DOMString localName);
+ [NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedName);
+ [NewObject] DocumentFragment createDocumentFragment();
+ [NewObject] Text createTextNode(DOMString data);
+ [NewObject] CDATASection createCDATASection(DOMString data);
+ [NewObject] Comment createComment(DOMString data);
+ [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
+
+ [NewObject] Node importNode(Node node, optional boolean deep = false);
+ Node adoptNode(Node node);
+
+ [NewObject] Attr createAttribute(DOMString localName);
+ [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString name);
+
+ [NewObject] Event createEvent(DOMString interface);
+
+ [NewObject] Range createRange();
+
+ // NodeFilter.SHOW_ALL = 0xFFFFFFFF
+ [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
+ [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
+};
+
+interface XMLDocument : Document {};
+
+interface DOMImplementation {
+ [NewObject] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);
+ [NewObject] XMLDocument createDocument(DOMString? namespace, [TreatNullAs=EmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
+ [NewObject] Document createHTMLDocument(optional DOMString title);
+
+ boolean hasFeature(); // useless; always returns true
+};
+
+[Constructor]
+interface DocumentFragment : Node {
+};
+
+interface DocumentType : Node {
+ readonly attribute DOMString name;
+ readonly attribute DOMString publicId;
+ readonly attribute DOMString systemId;
+};
+
+interface Element : Node {
+ readonly attribute DOMString? namespaceURI;
+ readonly attribute DOMString? prefix;
+ readonly attribute DOMString localName;
+ readonly attribute DOMString tagName;
+
+ attribute DOMString id;
+ attribute DOMString className;
+ [SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
+
+ boolean hasAttributes();
+ [SameObject] readonly attribute NamedNodeMap attributes;
+ sequence<DOMString> getAttributeNames();
+ DOMString? getAttribute(DOMString name);
+ DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
+ void setAttribute(DOMString name, DOMString value);
+ void setAttributeNS(DOMString? namespace, DOMString name, DOMString value);
+ void removeAttribute(DOMString name);
+ void removeAttributeNS(DOMString? namespace, DOMString localName);
+ boolean hasAttribute(DOMString name);
+ boolean hasAttributeNS(DOMString? namespace, DOMString localName);
+
+ Attr? getAttributeNode(DOMString name);
+ Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName);
+ Attr? setAttributeNode(Attr attr);
+ Attr? setAttributeNodeNS(Attr attr);
+ Attr removeAttributeNode(Attr attr);
+
+ Element? closest(DOMString selectors);
+ boolean matches(DOMString selectors);
+
+ HTMLCollection getElementsByTagName(DOMString localName);
+ HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
+ HTMLCollection getElementsByClassName(DOMString classNames);
+};
+
+interface NamedNodeMap {
+ readonly attribute unsigned long length;
+ getter Attr? item(unsigned long index);
+ getter Attr? getNamedItem(DOMString name);
+ Attr? getNamedItemNS(DOMString? namespace, DOMString localName);
+ Attr? setNamedItem(Attr attr);
+ Attr? setNamedItemNS(Attr attr);
+ Attr removeNamedItem(DOMString name);
+ Attr removeNamedItemNS(DOMString? namespace, DOMString localName);
+};
+
+interface Attr {
+ readonly attribute DOMString? namespaceURI;
+ readonly attribute DOMString? prefix;
+ readonly attribute DOMString localName;
+ readonly attribute DOMString name;
+ attribute DOMString value;
+ attribute DOMString nodeValue; // legacy alias of .value
+ attribute DOMString textContent; // legacy alias of .value
+
+ readonly attribute Element? ownerElement;
+
+ readonly attribute boolean specified; // useless; always returns true
+};
+
+interface CharacterData : Node {
+ [TreatNullAs=EmptyString] attribute DOMString data;
+ readonly attribute unsigned long length;
+ DOMString substringData(unsigned long offset, unsigned long count);
+ void appendData(DOMString data);
+ void insertData(unsigned long offset, DOMString data);
+ void deleteData(unsigned long offset, unsigned long count);
+ void replaceData(unsigned long offset, unsigned long count, DOMString data);
+};
+
+[Constructor(optional DOMString data = "")]
+interface Text : CharacterData {
+ [NewObject] Text splitText(unsigned long offset);
+ readonly attribute DOMString wholeText;
+};
+
+[Exposed=Window]
+interface CDATASection : Text {
+};
+
+interface ProcessingInstruction : CharacterData {
+ readonly attribute DOMString target;
+};
+
+[Constructor(optional DOMString data = "")]
+interface Comment : CharacterData {
+};
+
+[Constructor]
+interface Range {
+ readonly attribute Node startContainer;
+ readonly attribute unsigned long startOffset;
+ readonly attribute Node endContainer;
+ readonly attribute unsigned long endOffset;
+ readonly attribute boolean collapsed;
+ readonly attribute Node commonAncestorContainer;
+
+ void setStart(Node node, unsigned long offset);
+ void setEnd(Node node, unsigned long offset);
+ void setStartBefore(Node node);
+ void setStartAfter(Node node);
+ void setEndBefore(Node node);
+ void setEndAfter(Node node);
+ void collapse(optional boolean toStart = false);
+ void selectNode(Node node);
+ void selectNodeContents(Node node);
+
+ const unsigned short START_TO_START = 0;
+ const unsigned short START_TO_END = 1;
+ const unsigned short END_TO_END = 2;
+ const unsigned short END_TO_START = 3;
+ short compareBoundaryPoints(unsigned short how, Range sourceRange);
+
+ void deleteContents();
+ [NewObject] DocumentFragment extractContents();
+ [NewObject] DocumentFragment cloneContents();
+ void insertNode(Node node);
+ void surroundContents(Node newParent);
+
+ [NewObject] Range cloneRange();
+ void detach();
+
+ boolean isPointInRange(Node node, unsigned long offset);
+ short comparePoint(Node node, unsigned long offset);
+
+ boolean intersectsNode(Node node);
+
+ stringifier;
+};
+
+interface NodeIterator {
+ [SameObject] readonly attribute Node root;
+ readonly attribute Node referenceNode;
+ readonly attribute boolean pointerBeforeReferenceNode;
+ readonly attribute unsigned long whatToShow;
+ readonly attribute NodeFilter? filter;
+
+ Node? nextNode();
+ Node? previousNode();
+
+ void detach();
+};
+
+interface TreeWalker {
+ [SameObject] readonly attribute Node root;
+ readonly attribute unsigned long whatToShow;
+ readonly attribute NodeFilter? filter;
+ attribute Node currentNode;
+
+ Node? parentNode();
+ Node? firstChild();
+ Node? lastChild();
+ Node? previousSibling();
+ Node? nextSibling();
+ Node? previousNode();
+ Node? nextNode();
+};
+
+callback interface NodeFilter {
+ // Constants for acceptNode()
+ const unsigned short FILTER_ACCEPT = 1;
+ const unsigned short FILTER_REJECT = 2;
+ const unsigned short FILTER_SKIP = 3;
+
+ // Constants for whatToShow
+ const unsigned long SHOW_ALL = 0xFFFFFFFF;
+ const unsigned long SHOW_ELEMENT = 0x1;
+ const unsigned long SHOW_ATTRIBUTE = 0x2; // historical
+ const unsigned long SHOW_TEXT = 0x4;
+ const unsigned long SHOW_CDATA_SECTION = 0x8;
+ const unsigned long SHOW_ENTITY_REFERENCE = 0x10; // historical
+ const unsigned long SHOW_ENTITY = 0x20; // historical
+ const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x40;
+ const unsigned long SHOW_COMMENT = 0x80;
+ const unsigned long SHOW_DOCUMENT = 0x100;
+ const unsigned long SHOW_DOCUMENT_TYPE = 0x200;
+ const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x400;
+ const unsigned long SHOW_NOTATION = 0x800; // historical
+
+ unsigned short acceptNode(Node node);
+};
+
+interface DOMTokenList {
+ readonly attribute unsigned long length;
+ getter DOMString? item(unsigned long index);
+ boolean contains(DOMString token);
+ [CEReactions] void add(DOMString... tokens);
+ [CEReactions] void remove(DOMString... tokens);
+ [CEReactions] boolean toggle(DOMString token, optional boolean force);
+ [CEReactions] void replace(DOMString token, DOMString newToken);
+ boolean supports(DOMString token);
+ [CEReactions] stringifier attribute DOMString value;
+ // iterable<DOMString>;
+};</script>
+<!-- UI Events IDLs -->
+<script type=text/plain class=untested>
+[Constructor(DOMString type, optional UIEventInit eventInitDict)]
+interface UIEvent : Event {
+ readonly attribute WindowProxy? view;
+ readonly attribute long detail;
+};
+
+dictionary UIEventInit : EventInit {
+ WindowProxy? view = null;
+ long detail = 0;
+};
+
+[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
+interface MouseEvent : UIEvent {
+ readonly attribute long screenX;
+ readonly attribute long screenY;
+ readonly attribute long clientX;
+ readonly attribute long clientY;
+ readonly attribute boolean ctrlKey;
+ readonly attribute boolean shiftKey;
+ readonly attribute boolean altKey;
+ readonly attribute boolean metaKey;
+ readonly attribute short button;
+ readonly attribute EventTarget? relatedTarget;
+ // Introduced in DOM Level 3
+ readonly attribute unsigned short buttons;
+ boolean getModifierState (DOMString keyArg);
+};
+
+dictionary MouseEventInit : EventModifierInit {
+ long screenX = 0;
+ long screenY = 0;
+ long clientX = 0;
+ long clientY = 0;
+ short button = 0;
+ unsigned short buttons = 0;
+ EventTarget? relatedTarget = null;
+};
+
+dictionary EventModifierInit : UIEventInit {
+ boolean ctrlKey = false;
+ boolean shiftKey = false;
+ boolean altKey = false;
+ boolean metaKey = false;
+ boolean keyModifierStateAltGraph = false;
+ boolean keyModifierStateCapsLock = false;
+ boolean keyModifierStateFn = false;
+ boolean keyModifierStateFnLock = false;
+ boolean keyModifierStateHyper = false;
+ boolean keyModifierStateNumLock = false;
+ boolean keyModifierStateOS = false;
+ boolean keyModifierStateScrollLock = false;
+ boolean keyModifierStateSuper = false;
+ boolean keyModifierStateSymbol = false;
+ boolean keyModifierStateSymbolLock = false;
+};
+
+partial interface MouseEvent {
+ // Deprecated in DOM Level 3
+ void initMouseEvent (DOMString typeArg, boolean bubblesArg, boolean cancelableArg, Window? viewArg, long detailArg, long screenXArg, long screenYArg, long clientXArg, long clientYArg, boolean ctrlKeyArg, boolean altKeyArg, boolean shiftKeyArg, boolean metaKeyArg, short buttonArg, EventTarget? relatedTargetArg);
+};
+</script>
+<!-- Touch Events IDLs -->
+<script type=text/plain class=untested>
+interface Touch {
+ readonly attribute long identifier;
+ readonly attribute EventTarget target;
+ readonly attribute long screenX;
+ readonly attribute long screenY;
+ readonly attribute long clientX;
+ readonly attribute long clientY;
+ readonly attribute long pageX;
+ readonly attribute long pageY;
+};
+</script>
+<!-- CSSOM IDLs -->
+<script type=text/plain class=untested>
+interface MediaList {
+ stringifier attribute DOMString mediaText;
+ readonly attribute unsigned long length;
+ getter DOMString item(unsigned long index);
+ void appendMedium(DOMString medium);
+ void deleteMedium(DOMString medium);
+};
+
+interface StyleSheet {
+ readonly attribute DOMString type;
+ readonly attribute DOMString href;
+ readonly attribute Node ownerNode;
+ readonly attribute StyleSheet parentStyleSheet;
+ readonly attribute DOMString title;
+ [PutForwards=mediaText] readonly attribute MediaList media;
+ attribute boolean disabled;
+};
+
+interface CSSStyleSheet : StyleSheet {
+ readonly attribute CSSRule ownerRule;
+ readonly attribute CSSRuleList cssRules;
+ unsigned long insertRule(DOMString rule, unsigned long index);
+ void deleteRule(unsigned long index);
+};
+
+typedef sequence<StyleSheet> StyleSheetList;
+
+partial interface Document {
+ readonly attribute StyleSheetList styleSheets;
+ attribute DOMString? selectedStyleSheetSet;
+ readonly attribute DOMString? lastStyleSheetSet;
+ readonly attribute DOMString? preferredStyleSheetSet;
+ readonly attribute DOMStringList styleSheetSets;
+ void enableStyleSheetsForSet(DOMString? name);
+};
+
+[NoInterfaceObject] interface LinkStyle {
+ readonly attribute StyleSheet sheet;
+};
+
+ProcessingInstruction implements LinkStyle;
+
+typedef sequence<CSSRule> CSSRuleList;
+
+interface CSSRule {
+ // Types
+ const unsigned short STYLE_RULE = 1;
+ const unsigned short IMPORT_RULE = 3;
+ const unsigned short MEDIA_RULE = 4;
+ const unsigned short FONT_FACE_RULE = 5;
+ const unsigned short PAGE_RULE = 6;
+ const unsigned short NAMESPACE_RULE = 10;
+ readonly attribute unsigned short type;
+
+ // Parsing and serialization
+ attribute DOMString cssText;
+
+ // Context
+ readonly attribute CSSRule parentRule;
+ readonly attribute CSSStyleSheet parentStyleSheet;
+};
+
+interface CSSStyleRule : CSSRule {
+ attribute DOMString selectorText;
+ readonly attribute CSSStyleDeclaration style;
+};
+
+interface CSSImportRule : CSSRule {
+ readonly attribute DOMString href;
+ [PutForwards=mediaText] readonly attribute MediaList media;
+ readonly attribute CSSStyleSheet styleSheet;
+};
+
+interface CSSMediaRule : CSSRule {
+ [PutForwards=mediaText] readonly attribute MediaList media;
+ readonly attribute CSSRuleList cssRules;
+ unsigned long insertRule(DOMString rule, unsigned long index);
+ void deleteRule(unsigned long index);
+};
+
+interface CSSFontFaceRule : CSSRule {
+ readonly attribute CSSStyleDeclaration style;
+};
+
+interface CSSPageRule : CSSRule {
+ attribute DOMString selectorText;
+ readonly attribute CSSStyleDeclaration style;
+};
+
+interface CSSNamespaceRule : CSSRule {
+ readonly attribute DOMString namespaceURI;
+ readonly attribute DOMString? prefix;
+};
+
+interface CSSStyleDeclaration {
+ attribute DOMString cssText;
+
+ readonly attribute unsigned long length;
+ DOMString item(unsigned long index);
+
+ DOMString getPropertyValue(DOMString property);
+ DOMString getPropertyPriority(DOMString property);
+ void setProperty(DOMString property, DOMString value, optional DOMString priority);
+ DOMString removeProperty(DOMString property);
+
+ readonly attribute CSSStyleDeclarationValue values;
+
+ readonly attribute CSSRule parentRule;
+
+ // CSS Properties
+ attribute DOMString azimuth;
+ attribute DOMString background;
+ attribute DOMString backgroundAttachment;
+ attribute DOMString backgroundColor;
+ attribute DOMString backgroundImage;
+ attribute DOMString backgroundPosition;
+ attribute DOMString backgroundRepeat;
+ attribute DOMString border;
+ attribute DOMString borderCollapse;
+ attribute DOMString borderColor;
+ attribute DOMString borderSpacing;
+ attribute DOMString borderStyle;
+ attribute DOMString borderTop;
+ attribute DOMString borderRight;
+ attribute DOMString borderBottom;
+ attribute DOMString borderLeft;
+ attribute DOMString borderTopColor;
+ attribute DOMString borderRightColor;
+ attribute DOMString borderBottomColor;
+ attribute DOMString borderLeftColor;
+ attribute DOMString borderTopStyle;
+ attribute DOMString borderRightStyle;
+ attribute DOMString borderBottomStyle;
+ attribute DOMString borderLeftStyle;
+ attribute DOMString borderTopWidth;
+ attribute DOMString borderRightWidth;
+ attribute DOMString borderBottomWidth;
+ attribute DOMString borderLeftWidth;
+ attribute DOMString borderWidth;
+ attribute DOMString bottom;
+ attribute DOMString captionSide;
+ attribute DOMString clear;
+ attribute DOMString clip;
+ attribute DOMString color;
+ attribute DOMString content;
+ attribute DOMString counterIncrement;
+ attribute DOMString counterReset;
+ attribute DOMString cue;
+ attribute DOMString cueAfter;
+ attribute DOMString cueBefore;
+ attribute DOMString cursor;
+ attribute DOMString direction;
+ attribute DOMString display;
+ attribute DOMString elevation;
+ attribute DOMString emptyCells;
+ attribute DOMString cssFloat;
+ attribute DOMString font;
+ attribute DOMString fontFamily;
+ attribute DOMString fontSize;
+ attribute DOMString fontSizeAdjust;
+ attribute DOMString fontStretch;
+ attribute DOMString fontStyle;
+ attribute DOMString fontVariant;
+ attribute DOMString fontWeight;
+ attribute DOMString height;
+ attribute DOMString left;
+ attribute DOMString letterSpacing;
+ attribute DOMString lineHeight;
+ attribute DOMString listStyle;
+ attribute DOMString listStyleImage;
+ attribute DOMString listStylePosition;
+ attribute DOMString listStyleType;
+ attribute DOMString margin;
+ attribute DOMString marginTop;
+ attribute DOMString marginRight;
+ attribute DOMString marginBottom;
+ attribute DOMString marginLeft;
+ attribute DOMString marks;
+ attribute DOMString maxHeight;
+ attribute DOMString maxWidth;
+ attribute DOMString minHeight;
+ attribute DOMString minWidth;
+ attribute DOMString orphans;
+ attribute DOMString outline;
+ attribute DOMString outlineColor;
+ attribute DOMString outlineStyle;
+ attribute DOMString outlineWidth;
+ attribute DOMString overflow;
+ attribute DOMString padding;
+ attribute DOMString paddingTop;
+ attribute DOMString paddingRight;
+ attribute DOMString paddingBottom;
+ attribute DOMString paddingLeft;
+ attribute DOMString page;
+ attribute DOMString pageBreakAfter;
+ attribute DOMString pageBreakBefore;
+ attribute DOMString pageBreakInside;
+ attribute DOMString pause;
+ attribute DOMString pauseAfter;
+ attribute DOMString pauseBefore;
+ attribute DOMString pitch;
+ attribute DOMString pitchRange;
+ attribute DOMString playDuring;
+ attribute DOMString position;
+ attribute DOMString quotes;
+ attribute DOMString richness;
+ attribute DOMString right;
+ attribute DOMString size;
+ attribute DOMString speak;
+ attribute DOMString speakHeader;
+ attribute DOMString speakNumeral;
+ attribute DOMString speakPunctuation;
+ attribute DOMString speechRate;
+ attribute DOMString stress;
+ attribute DOMString tableLayout;
+ attribute DOMString textAlign;
+ attribute DOMString textDecoration;
+ attribute DOMString textIndent;
+ attribute DOMString textShadow;
+ attribute DOMString textTransform;
+ attribute DOMString top;
+ attribute DOMString unicodeBidi;
+ attribute DOMString verticalAlign;
+ attribute DOMString visibility;
+ attribute DOMString voiceFamily;
+ attribute DOMString volume;
+ attribute DOMString whiteSpace;
+ attribute DOMString widows;
+ attribute DOMString width;
+ attribute DOMString wordSpacing;
+ attribute DOMString zIndex;
+};
+
+interface CSSStyleDeclarationValue {
+ // ...
+
+ // CSS Properties
+
+};
+
+interface CSSPropertyValue {
+ attribute DOMString cssText;
+};
+
+[NoInterfaceObject] interface CSSMapValue {
+ getter CSSValue (DOMString name);
+};
+
+[NoInterfaceObject] interface CSSPropertyValueList {
+ readonly attribute CSSValue[] list;
+};
+
+[NoInterfaceObject] interface CSSComponentValue {
+ readonly attribute DOMString type;
+ attribute any value;
+};
+
+[NoInterfaceObject] interface CSSStringComponentValue {
+ attribute DOMString string;
+};
+
+[NoInterfaceObject] interface CSSKeywordComponentValue {
+ attribute DOMString keyword;
+};
+
+[NoInterfaceObject] interface CSSIdentifierComponentValue {
+ attribute DOMString identifier;
+};
+
+[NoInterfaceObject] interface CSSColorComponentValue {
+ attribute short red;
+ attribute short green;
+ attribute short blue;
+ attribute float alpha;
+};
+
+[NoInterfaceObject] interface CSSLengthComponentValue {
+ attribute float em;
+ attribute float ex;
+ attribute float px;
+ // figure out what to do with absolute lengths
+};
+
+[NoInterfaceObject] interface CSSPercentageComponentValue {
+ attribute float percent;
+};
+
+[NoInterfaceObject] interface CSSURLComponentValue {
+ attribute DOMString? url;
+};
+
+[NoInterfaceObject] interface ElementCSSInlineStyle {
+ readonly attribute CSSStyleDeclaration style;
+};
+
+//partial interface Window {
+// CSSStyleDeclaration getComputedStyle(Element elt);
+// CSSStyleDeclaration getComputedStyle(Element elt, DOMString pseudoElt);
+//};
+</script>
+
+<!-- HTML IDLs -->
+<script type=text/plain>
+typedef (Int8Array or Uint8Array or Uint8ClampedArray or
+ Int16Array or Uint16Array or
+ Int32Array or Uint32Array or
+ Float32Array or Float64Array or
+ DataView) ArrayBufferView;
+
+[NoInterfaceObject, Exposed=Window]
+interface HTMLHyperlinkElementUtils {
+ stringifier attribute USVString href;
+ readonly attribute USVString origin;
+ attribute USVString protocol;
+ attribute USVString username;
+ attribute USVString password;
+ attribute USVString host;
+ attribute USVString hostname;
+ attribute USVString port;
+ attribute USVString pathname;
+ attribute USVString search;
+ attribute USVString hash;
+};
+
+interface HTMLAllCollection {
+ readonly attribute unsigned long length;
+ getter Element? item(unsigned long index);
+ (HTMLCollection or Element)? item(DOMString name);
+ legacycaller getter (HTMLCollection or Element)? namedItem(DOMString name);
+};
+
+interface HTMLFormControlsCollection : HTMLCollection {
+ // inherits length and item()
+ getter (RadioNodeList or Element)? namedItem(DOMString name); // shadows inherited namedItem()
+};
+
+interface RadioNodeList : NodeList {
+ attribute DOMString value;
+};
+
+interface HTMLOptionsCollection : HTMLCollection {
+ // inherits item()
+ attribute unsigned long length; // shadows inherited length
+ setter creator void (unsigned long index, HTMLOptionElement? option);
+ void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
+ void remove(long index);
+ attribute long selectedIndex;
+};
+
+typedef sequence<any> PropertyValueArray;
+
+[OverrideBuiltins, Exposed=(Window,Worker)]
+interface DOMStringMap {
+ getter DOMString (DOMString name);
+ setter creator void (DOMString name, DOMString value);
+ deleter void (DOMString name);
+};
+
+typedef (ArrayBuffer or MessagePort) Transferable;
+
+callback FileCallback = void (File file);
+
+enum DocumentReadyState { "loading", "interactive", "complete" };
+typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
+
+[OverrideBuiltins]
+partial /*sealed*/ interface Document {
+ // resource metadata management
+ [PutForwards=href, Unforgeable] readonly attribute Location? location;
+ attribute USVString domain;
+ readonly attribute USVString referrer;
+ attribute USVString cookie;
+ readonly attribute DOMString lastModified;
+ readonly attribute DocumentReadyState readyState;
+
+ // DOM tree accessors
+ getter object (DOMString name);
+ [CEReactions] attribute DOMString title;
+ [CEReactions] attribute DOMString dir;
+ [CEReactions] attribute HTMLElement? body;
+ readonly attribute HTMLHeadElement? head;
+ [SameObject] readonly attribute HTMLCollection images;
+ [SameObject] readonly attribute HTMLCollection embeds;
+ [SameObject] readonly attribute HTMLCollection plugins;
+ [SameObject] readonly attribute HTMLCollection links;
+ [SameObject] readonly attribute HTMLCollection forms;
+ [SameObject] readonly attribute HTMLCollection scripts;
+ NodeList getElementsByName(DOMString elementName);
+ readonly attribute HTMLOrSVGScriptElement? currentScript; // classic scripts in a document tree only
+
+ // dynamic markup insertion
+ [CEReactions] Document open(optional DOMString type = "text/html", optional DOMString replace = "");
+ WindowProxy open(USVString url, DOMString name, DOMString features);
+ [CEReactions] void close();
+ [CEReactions] void write(DOMString... text);
+ [CEReactions] void writeln(DOMString... text);
+
+ // user interaction
+ readonly attribute WindowProxy? defaultView;
+ readonly attribute Element? activeElement;
+ boolean hasFocus();
+ [CEReactions] attribute DOMString designMode;
+ [CEReactions] boolean execCommand(DOMString commandId, optional boolean showUI = false, optional DOMString value = "");
+ boolean queryCommandEnabled(DOMString commandId);
+ boolean queryCommandIndeterm(DOMString commandId);
+ boolean queryCommandState(DOMString commandId);
+ boolean queryCommandSupported(DOMString commandId);
+ DOMString queryCommandValue(DOMString commandId);
+
+ // special event handler IDL attributes that only apply to Document objects
+ [LenientThis] attribute EventHandler onreadystatechange;
+
+ // also has obsolete members
+};
+Document implements GlobalEventHandlers;
+Document implements DocumentAndElementEventHandlers;
+
+[NoInterfaceObject]
+interface ElementContentEditable {
+ [CEReactions] attribute DOMString contentEditable;
+ readonly attribute boolean isContentEditable;
+};
+
+interface HTMLElement : Element {
+ // metadata attributes
+ [CEReactions] attribute DOMString title;
+ [CEReactions] attribute DOMString lang;
+ [CEReactions] attribute boolean translate;
+ [CEReactions] attribute DOMString dir;
+ [SameObject] readonly attribute DOMStringMap dataset;
+
+ // user interaction
+ [CEReactions] attribute boolean hidden;
+ void click();
+ [CEReactions] attribute long tabIndex;
+ void focus();
+ void blur();
+ [CEReactions] attribute DOMString accessKey;
+ readonly attribute DOMString accessKeyLabel;
+ [CEReactions] attribute boolean draggable;
+ [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList dropzone;
+ [CEReactions] attribute HTMLMenuElement? contextMenu;
+ [CEReactions] attribute boolean spellcheck;
+ void forceSpellCheck();
+
+ [CEReactions, TreatNullAs=EmptyString] attribute DOMString innerText;
+};
+HTMLElement implements GlobalEventHandlers;
+HTMLElement implements DocumentAndElementEventHandlers;
+HTMLElement implements ElementContentEditable;
+
+interface HTMLUnknownElement : HTMLElement { };
+
+interface HTMLHtmlElement : HTMLElement {
+ // also has obsolete members
+};
+
+interface HTMLHeadElement : HTMLElement {};
+
+interface HTMLTitleElement : HTMLElement {
+ attribute DOMString text;
+};
+
+interface HTMLBaseElement : HTMLElement {
+ attribute DOMString href;
+ attribute DOMString target;
+};
+
+interface HTMLLinkElement : HTMLElement {
+ attribute DOMString href;
+ attribute DOMString? crossOrigin;
+ attribute DOMString rel;
+ [PutForwards=value] readonly attribute DOMTokenList relList;
+ attribute DOMString media;
+ attribute DOMString hreflang;
+ attribute DOMString type;
+ [PutForwards=value] readonly attribute DOMTokenList sizes;
+
+ // also has obsolete members
+};
+HTMLLinkElement implements LinkStyle;
+
+interface HTMLMetaElement : HTMLElement {
+ attribute DOMString name;
+ attribute DOMString httpEquiv;
+ attribute DOMString content;
+
+ // also has obsolete members
+};
+
+interface HTMLStyleElement : HTMLElement {
+ [CEReactions] attribute DOMString media;
+ [CEReactions] attribute DOMString nonce;
+ [CEReactions] attribute DOMString type;
+};
+HTMLStyleElement implements LinkStyle;
+
+interface HTMLBodyElement : HTMLElement {
+
+ // also has obsolete members
+};
+HTMLBodyElement implements WindowEventHandlers;
+
+interface HTMLHeadingElement : HTMLElement {
+ // also has obsolete members
+};
+
+interface HTMLParagraphElement : HTMLElement {
+ // also has obsolete members
+};
+
+interface HTMLHRElement : HTMLElement {
+ // also has obsolete members
+};
+
+interface HTMLPreElement : HTMLElement {
+ // also has obsolete members
+};
+
+interface HTMLQuoteElement : HTMLElement {
+ attribute DOMString cite;
+};
+
+interface HTMLOListElement : HTMLElement {
+ attribute boolean reversed;
+ attribute long start;
+ attribute DOMString type;
+
+ // also has obsolete members
+};
+
+interface HTMLUListElement : HTMLElement {
+ // also has obsolete members
+};
+
+interface HTMLLIElement : HTMLElement {
+ attribute long value;
+
+ // also has obsolete members
+};
+
+interface HTMLDListElement : HTMLElement {
+ // also has obsolete members
+};
+
+interface HTMLDivElement : HTMLElement {
+ // also has obsolete members
+};
+
+interface HTMLAnchorElement : HTMLElement {
+ attribute DOMString target;
+ attribute DOMString download;
+ [CEReactions] attribute USVString ping;
+ attribute DOMString rel;
+ [PutForwards=value] readonly attribute DOMTokenList relList;
+ attribute DOMString hreflang;
+ attribute DOMString type;
+
+ attribute DOMString text;
+};
+HTMLAnchorElement implements HTMLHyperlinkElementUtils;
+
+interface HTMLDataElement : HTMLElement {
+ attribute DOMString value;
+};
+
+interface HTMLTimeElement : HTMLElement {
+ attribute DOMString dateTime;
+};
+
+interface HTMLSpanElement : HTMLElement {};
+
+interface HTMLBRElement : HTMLElement {
+ // also has obsolete members
+};
+
+interface HTMLModElement : HTMLElement {
+ attribute DOMString cite;
+ attribute DOMString dateTime;
+};
+
+interface HTMLPictureElement : HTMLElement {};
+
+partial interface HTMLSourceElement {
+ attribute DOMString srcset;
+ attribute DOMString sizes;
+ attribute DOMString media;
+};
+
+[NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
+interface HTMLImageElement : HTMLElement {
+ attribute DOMString alt;
+ attribute DOMString src;
+ attribute DOMString srcset;
+ attribute DOMString sizes;
+ attribute DOMString? crossOrigin;
+ attribute DOMString useMap;
+ attribute boolean isMap;
+ attribute unsigned long width;
+ attribute unsigned long height;
+ readonly attribute unsigned long naturalWidth;
+ readonly attribute unsigned long naturalHeight;
+ readonly attribute boolean complete;
+ readonly attribute DOMString currentSrc;
+
+ // also has obsolete members
+};
+
+interface HTMLIFrameElement : HTMLElement {
+ attribute DOMString src;
+ attribute DOMString srcdoc;
+ attribute DOMString name;
+ [PutForwards=value] readonly attribute DOMTokenList sandbox;
+ attribute boolean allowFullscreen;
+ attribute DOMString width;
+ attribute DOMString height;
+ readonly attribute Document? contentDocument;
+ readonly attribute WindowProxy? contentWindow;
+
+ // also has obsolete members
+};
+
+interface HTMLEmbedElement : HTMLElement {
+ attribute DOMString src;
+ attribute DOMString type;
+ attribute DOMString width;
+ attribute DOMString height;
+ Document getSVGDocument();
+ legacycaller any (any... arguments);
+
+ // also has obsolete members
+};
+
+interface HTMLObjectElement : HTMLElement {
+ attribute DOMString data;
+ attribute DOMString type;
+ attribute boolean typeMustMatch;
+ attribute DOMString name;
+ attribute DOMString useMap;
+ readonly attribute HTMLFormElement? form;
+ attribute DOMString width;
+ attribute DOMString height;
+ readonly attribute Document? contentDocument;
+ readonly attribute WindowProxy? contentWindow;
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+
+ legacycaller any (any... arguments);
+
+ // also has obsolete members
+};
+
+interface HTMLParamElement : HTMLElement {
+ attribute DOMString name;
+ attribute DOMString value;
+
+ // also has obsolete members
+};
+
+interface HTMLVideoElement : HTMLMediaElement {
+ attribute unsigned long width;
+ attribute unsigned long height;
+ readonly attribute unsigned long videoWidth;
+ readonly attribute unsigned long videoHeight;
+ attribute DOMString poster;
+};
+
+[NamedConstructor=Audio(optional DOMString src)]
+interface HTMLAudioElement : HTMLMediaElement {};
+
+interface HTMLSourceElement : HTMLElement {
+ attribute DOMString src;
+ attribute DOMString type;
+
+ // also has obsolete members
+};
+
+interface HTMLTrackElement : HTMLElement {
+ attribute DOMString kind;
+ attribute DOMString src;
+ attribute DOMString srclang;
+ attribute DOMString label;
+ attribute boolean default;
+
+ const unsigned short NONE = 0;
+ const unsigned short LOADING = 1;
+ const unsigned short LOADED = 2;
+ const unsigned short ERROR = 3;
+ readonly attribute unsigned short readyState;
+
+ readonly attribute TextTrack track;
+};
+
+enum CanPlayTypeResult { "" /* empty string */, "maybe", "probably" };
+interface HTMLMediaElement : HTMLElement {
+
+ // error state
+ readonly attribute MediaError? error;
+
+ // network state
+ attribute DOMString src;
+ readonly attribute DOMString currentSrc;
+ attribute DOMString? crossOrigin;
+ const unsigned short NETWORK_EMPTY = 0;
+ const unsigned short NETWORK_IDLE = 1;
+ const unsigned short NETWORK_LOADING = 2;
+ const unsigned short NETWORK_NO_SOURCE = 3;
+ readonly attribute unsigned short networkState;
+ attribute DOMString preload;
+ readonly attribute TimeRanges buffered;
+ void load();
+ CanPlayTypeResult canPlayType(DOMString type);
+
+ // ready state
+ const unsigned short HAVE_NOTHING = 0;
+ const unsigned short HAVE_METADATA = 1;
+ const unsigned short HAVE_CURRENT_DATA = 2;
+ const unsigned short HAVE_FUTURE_DATA = 3;
+ const unsigned short HAVE_ENOUGH_DATA = 4;
+ readonly attribute unsigned short readyState;
+ readonly attribute boolean seeking;
+
+ // playback state
+ attribute double currentTime;
+ void fastSeek(double time);
+ readonly attribute unrestricted double duration;
+ Date getStartDate();
+ readonly attribute boolean paused;
+ attribute double defaultPlaybackRate;
+ attribute double playbackRate;
+ readonly attribute TimeRanges played;
+ readonly attribute TimeRanges seekable;
+ readonly attribute boolean ended;
+ attribute boolean autoplay;
+ attribute boolean loop;
+ Promise<void> play();
+ void pause();
+
+ // controls
+ attribute boolean controls;
+ attribute double volume;
+ attribute boolean muted;
+ attribute boolean defaultMuted;
+
+ // tracks
+ readonly attribute AudioTrackList audioTracks;
+ readonly attribute VideoTrackList videoTracks;
+ readonly attribute TextTrackList textTracks;
+ TextTrack addTextTrack(TextTrackKind kind, optional DOMString label = "", optional DOMString language = "");
+};
+
+interface MediaError {
+ const unsigned short MEDIA_ERR_ABORTED = 1;
+ const unsigned short MEDIA_ERR_NETWORK = 2;
+ const unsigned short MEDIA_ERR_DECODE = 3;
+ const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
+ readonly attribute unsigned short code;
+};
+
+interface AudioTrackList : EventTarget {
+ readonly attribute unsigned long length;
+ getter AudioTrack (unsigned long index);
+ AudioTrack? getTrackById(DOMString id);
+
+ attribute EventHandler onchange;
+ attribute EventHandler onaddtrack;
+ attribute EventHandler onremovetrack;
+};
+
+interface AudioTrack {
+ readonly attribute DOMString id;
+ readonly attribute DOMString kind;
+ readonly attribute DOMString label;
+ readonly attribute DOMString language;
+ attribute boolean enabled;
+};
+
+interface VideoTrackList : EventTarget {
+ readonly attribute unsigned long length;
+ getter VideoTrack (unsigned long index);
+ VideoTrack? getTrackById(DOMString id);
+ readonly attribute long selectedIndex;
+
+ attribute EventHandler onchange;
+ attribute EventHandler onaddtrack;
+ attribute EventHandler onremovetrack;
+};
+
+interface VideoTrack {
+ readonly attribute DOMString id;
+ readonly attribute DOMString kind;
+ readonly attribute DOMString label;
+ readonly attribute DOMString language;
+ attribute boolean selected;
+};
+
+interface TextTrackList : EventTarget {
+ readonly attribute unsigned long length;
+ getter TextTrack (unsigned long index);
+ TextTrack? getTrackById(DOMString id);
+
+ attribute EventHandler onchange;
+ attribute EventHandler onaddtrack;
+ attribute EventHandler onremovetrack;
+};
+
+enum TextTrackMode { "disabled", "hidden", "showing" };
+enum TextTrackKind { "subtitles", "captions", "descriptions", "chapters", "metadata" };
+interface TextTrack : EventTarget {
+ readonly attribute TextTrackKind kind;
+ readonly attribute DOMString label;
+ readonly attribute DOMString language;
+
+ readonly attribute DOMString id;
+ readonly attribute DOMString inBandMetadataTrackDispatchType;
+
+ attribute TextTrackMode mode;
+
+ readonly attribute TextTrackCueList? cues;
+ readonly attribute TextTrackCueList? activeCues;
+
+ void addCue(TextTrackCue cue);
+ void removeCue(TextTrackCue cue);
+
+ attribute EventHandler oncuechange;
+};
+
+interface TextTrackCueList {
+ readonly attribute unsigned long length;
+ getter TextTrackCue (unsigned long index);
+ TextTrackCue? getCueById(DOMString id);
+};
+
+interface TextTrackCue : EventTarget {
+ readonly attribute TextTrack? track;
+
+ attribute DOMString id;
+ attribute double startTime;
+ attribute double endTime;
+ attribute boolean pauseOnExit;
+
+ attribute EventHandler onenter;
+ attribute EventHandler onexit;
+};
+
+interface TimeRanges {
+ readonly attribute unsigned long length;
+ double start(unsigned long index);
+ double end(unsigned long index);
+};
+
+[Constructor(DOMString type, optional TrackEventInit eventInitDict)]
+interface TrackEvent : Event {
+ readonly attribute (VideoTrack or AudioTrack or TextTrack) track;
+};
+
+dictionary TrackEventInit : EventInit {
+ (VideoTrack or AudioTrack or TextTrack) track;
+};
+
+interface HTMLMapElement : HTMLElement {
+ attribute DOMString name;
+ readonly attribute HTMLCollection areas;
+};
+
+interface HTMLAreaElement : HTMLElement {
+ attribute DOMString alt;
+ attribute DOMString coords;
+ attribute DOMString shape;
+ attribute DOMString target;
+ attribute DOMString download;
+ [CEReactions] attribute USVString ping;
+ attribute DOMString rel;
+ [PutForwards=value] readonly attribute DOMTokenList relList;
+ // hreflang and type are not reflected
+};
+HTMLAreaElement implements HTMLHyperlinkElementUtils;
+
+interface HTMLTableElement : HTMLElement {
+ attribute HTMLTableCaptionElement? caption;
+ HTMLElement createCaption();
+ void deleteCaption();
+ attribute HTMLTableSectionElement? tHead;
+ HTMLElement createTHead();
+ void deleteTHead();
+ attribute HTMLTableSectionElement? tFoot;
+ HTMLElement createTFoot();
+ void deleteTFoot();
+ readonly attribute HTMLCollection tBodies;
+ HTMLElement createTBody();
+ readonly attribute HTMLCollection rows;
+ HTMLElement insertRow(optional long index = -1);
+ void deleteRow(long index);
+
+ // also has obsolete members
+};
+
+interface HTMLTableCaptionElement : HTMLElement {
+ // also has obsolete members
+};
+
+interface HTMLTableColElement : HTMLElement {
+ attribute unsigned long span;
+
+ // also has obsolete members
+};
+
+interface HTMLTableSectionElement : HTMLElement {
+ readonly attribute HTMLCollection rows;
+ HTMLElement insertRow(optional long index = -1);
+ void deleteRow(long index);
+
+ // also has obsolete members
+};
+
+interface HTMLTableRowElement : HTMLElement {
+ readonly attribute long rowIndex;
+ readonly attribute long sectionRowIndex;
+ readonly attribute HTMLCollection cells;
+ HTMLElement insertCell(optional long index = -1);
+ void deleteCell(long index);
+
+ // also has obsolete members
+};
+
+interface HTMLTableCellElement : HTMLElement {
+ [CEReactions] attribute unsigned long colSpan;
+ [CEReactions] attribute unsigned long rowSpan;
+ [CEReactions] attribute DOMString headers;
+ readonly attribute long cellIndex;
+
+ [CEReactions] attribute DOMString scope; // only conforming for th elements
+ [CEReactions] attribute DOMString abbr; // only conforming for th elements
+
+ // also has obsolete members
+};
+
+[OverrideBuiltins]
+interface HTMLFormElement : HTMLElement {
+ attribute DOMString acceptCharset;
+ attribute DOMString action;
+ attribute DOMString autocomplete;
+ attribute DOMString enctype;
+ attribute DOMString encoding;
+ attribute DOMString method;
+ attribute DOMString name;
+ attribute boolean noValidate;
+ attribute DOMString target;
+
+ readonly attribute HTMLFormControlsCollection elements;
+ readonly attribute unsigned long length;
+ getter Element (unsigned long index);
+ getter (RadioNodeList or Element) (DOMString name);
+
+ void submit();
+ void reset();
+ boolean checkValidity();
+ boolean reportValidity();
+};
+
+interface HTMLLabelElement : HTMLElement {
+ readonly attribute HTMLFormElement? form;
+ attribute DOMString htmlFor;
+ readonly attribute HTMLElement? control;
+};
+
+interface HTMLInputElement : HTMLElement {
+ attribute DOMString accept;
+ attribute DOMString alt;
+ attribute DOMString autocomplete;
+ attribute boolean autofocus;
+ attribute boolean defaultChecked;
+ attribute boolean checked;
+ attribute DOMString dirName;
+ attribute boolean disabled;
+ readonly attribute HTMLFormElement? form;
+ readonly attribute FileList? files;
+ attribute DOMString formAction;
+ attribute DOMString formEnctype;
+ attribute DOMString formMethod;
+ attribute boolean formNoValidate;
+ attribute DOMString formTarget;
+ attribute unsigned long height;
+ attribute boolean indeterminate;
+ attribute DOMString inputMode;
+ readonly attribute HTMLElement? list;
+ attribute DOMString max;
+ attribute long maxLength;
+ attribute DOMString min;
+ attribute long minLength;
+ attribute boolean multiple;
+ attribute DOMString name;
+ attribute DOMString pattern;
+ attribute DOMString placeholder;
+ attribute boolean readOnly;
+ attribute boolean required;
+ attribute unsigned long size;
+ attribute DOMString src;
+ attribute DOMString step;
+ attribute DOMString type;
+ attribute DOMString defaultValue;
+ [TreatNullAs=EmptyString] attribute DOMString value;
+ attribute Date? valueAsDate;
+ attribute unrestricted double valueAsNumber;
+ attribute unsigned long width;
+
+ void stepUp(optional long n = 1);
+ void stepDown(optional long n = 1);
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+
+ readonly attribute NodeList labels;
+
+ void select();
+ attribute unsigned long? selectionStart;
+ attribute unsigned long? selectionEnd;
+ attribute DOMString? selectionDirection;
+ void setRangeText(DOMString replacement);
+ void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve");
+ void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
+
+ // also has obsolete members
+};
+
+interface HTMLButtonElement : HTMLElement {
+ attribute boolean autofocus;
+ attribute boolean disabled;
+ readonly attribute HTMLFormElement? form;
+ attribute DOMString formAction;
+ attribute DOMString formEnctype;
+ attribute DOMString formMethod;
+ attribute boolean formNoValidate;
+ attribute DOMString formTarget;
+ attribute DOMString name;
+ attribute DOMString type;
+ attribute DOMString value;
+ attribute HTMLMenuElement? menu;
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+
+ readonly attribute NodeList labels;
+};
+
+interface HTMLSelectElement : HTMLElement {
+ attribute DOMString autocomplete;
+ attribute boolean autofocus;
+ attribute boolean disabled;
+ readonly attribute HTMLFormElement? form;
+ attribute boolean multiple;
+ attribute DOMString name;
+ attribute boolean required;
+ attribute unsigned long size;
+
+ readonly attribute DOMString type;
+
+ readonly attribute HTMLOptionsCollection options;
+ attribute unsigned long length;
+ getter Element? item(unsigned long index);
+ HTMLOptionElement? namedItem(DOMString name);
+ void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
+ void remove(); // ChildNode overload
+ void remove(long index);
+ setter creator void (unsigned long index, HTMLOptionElement? option);
+
+ readonly attribute HTMLCollection selectedOptions;
+ attribute long selectedIndex;
+ attribute DOMString value;
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+
+ readonly attribute NodeList labels;
+};
+
+interface HTMLDataListElement : HTMLElement {
+ readonly attribute HTMLCollection options;
+};
+
+interface HTMLOptGroupElement : HTMLElement {
+ attribute boolean disabled;
+ attribute DOMString label;
+};
+
+[NamedConstructor=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false)]
+interface HTMLOptionElement : HTMLElement {
+ attribute boolean disabled;
+ readonly attribute HTMLFormElement? form;
+ attribute DOMString label;
+ attribute boolean defaultSelected;
+ attribute boolean selected;
+ attribute DOMString value;
+
+ attribute DOMString text;
+ readonly attribute long index;
+};
+
+interface HTMLTextAreaElement : HTMLElement {
+ attribute DOMString autocomplete;
+ attribute boolean autofocus;
+ attribute unsigned long cols;
+ attribute DOMString dirName;
+ attribute boolean disabled;
+ readonly attribute HTMLFormElement? form;
+ attribute DOMString inputMode;
+ attribute long maxLength;
+ attribute long minLength;
+ attribute DOMString name;
+ attribute DOMString placeholder;
+ attribute boolean readOnly;
+ attribute boolean required;
+ attribute unsigned long rows;
+ attribute DOMString wrap;
+
+ readonly attribute DOMString type;
+ attribute DOMString defaultValue;
+ [TreatNullAs=EmptyString] attribute DOMString value;
+ readonly attribute unsigned long textLength;
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+
+ readonly attribute NodeList labels;
+
+ void select();
+ attribute unsigned long? selectionStart;
+ attribute unsigned long? selectionEnd;
+ attribute DOMString? selectionDirection;
+ void setRangeText(DOMString replacement);
+ void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve");
+ void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
+};
+
+interface HTMLKeygenElement : HTMLElement {
+ attribute boolean autofocus;
+ attribute DOMString challenge;
+ attribute boolean disabled;
+ readonly attribute HTMLFormElement? form;
+ attribute DOMString keytype;
+ attribute DOMString name;
+
+ readonly attribute DOMString type;
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+
+ readonly attribute NodeList labels;
+};
+
+interface HTMLOutputElement : HTMLElement {
+ [PutForwards=value] readonly attribute DOMTokenList htmlFor;
+ readonly attribute HTMLFormElement? form;
+ attribute DOMString name;
+
+ readonly attribute DOMString type;
+ attribute DOMString defaultValue;
+ attribute DOMString value;
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+
+ readonly attribute NodeList labels;
+};
+
+interface HTMLProgressElement : HTMLElement {
+ attribute double value;
+ attribute double max;
+ readonly attribute double position;
+ readonly attribute NodeList labels;
+};
+
+interface HTMLMeterElement : HTMLElement {
+ attribute double value;
+ attribute double min;
+ attribute double max;
+ attribute double low;
+ attribute double high;
+ attribute double optimum;
+ readonly attribute NodeList labels;
+};
+
+interface HTMLFieldSetElement : HTMLElement {
+ attribute boolean disabled;
+ readonly attribute HTMLFormElement? form;
+ attribute DOMString name;
+
+ readonly attribute DOMString type;
+
+ readonly attribute HTMLFormControlsCollection elements;
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+};
+
+interface HTMLLegendElement : HTMLElement {
+ readonly attribute HTMLFormElement? form;
+
+ // also has obsolete members
+};
+
+enum SelectionMode {
+ "select",
+ "start",
+ "end",
+ "preserve"/*,*/ // default
+};
+
+interface ValidityState {
+ readonly attribute boolean valueMissing;
+ readonly attribute boolean typeMismatch;
+ readonly attribute boolean patternMismatch;
+ readonly attribute boolean tooLong;
+ readonly attribute boolean tooShort;
+ readonly attribute boolean rangeUnderflow;
+ readonly attribute boolean rangeOverflow;
+ readonly attribute boolean stepMismatch;
+ readonly attribute boolean badInput;
+ readonly attribute boolean customError;
+ readonly attribute boolean valid;
+};
+
+interface HTMLDetailsElement : HTMLElement {
+ attribute boolean open;
+};
+
+interface HTMLMenuElement : HTMLElement {
+ attribute DOMString type;
+ attribute DOMString label;
+
+ // also has obsolete members
+};
+
+interface HTMLMenuItemElement : HTMLElement {
+ attribute DOMString type;
+ attribute DOMString label;
+ attribute DOMString icon;
+ attribute boolean disabled;
+ attribute boolean checked;
+ attribute DOMString radiogroup;
+ attribute boolean default;
+ readonly attribute HTMLElement? command;
+};
+
+[Constructor(DOMString type, optional RelatedEventInit eventInitDict)]
+interface RelatedEvent : Event {
+ readonly attribute EventTarget? relatedTarget;
+};
+
+dictionary RelatedEventInit : EventInit {
+ EventTarget? relatedTarget;
+};
+
+interface HTMLDialogElement : HTMLElement {
+ attribute boolean open;
+ attribute DOMString returnValue;
+ void show(optional (MouseEvent or Element) anchor);
+ void showModal(optional (MouseEvent or Element) anchor);
+ void close(optional DOMString returnValue);
+};
+
+interface HTMLScriptElement : HTMLElement {
+ attribute DOMString src;
+ attribute DOMString type;
+ attribute DOMString charset;
+ attribute boolean async;
+ attribute boolean defer;
+ attribute DOMString? crossOrigin;
+ attribute DOMString text;
+
+ // also has obsolete members
+};
+
+interface HTMLTemplateElement : HTMLElement {
+ readonly attribute DocumentFragment content;
+};
+
+interface HTMLSlotElement : HTMLElement {
+ /*[CEReactions]*/ attribute DOMString name;
+ sequence<Node> assignedNodes(optional AssignedNodesOptions options);
+};
+
+dictionary AssignedNodesOptions {
+ boolean flatten = false;
+};
+
+typedef (CanvasRenderingContext2D or WebGLRenderingContext) RenderingContext;
+callback BlobCallback = void (Blob? blob);
+
+interface HTMLCanvasElement : HTMLElement {
+ attribute unsigned long width;
+ attribute unsigned long height;
+
+ RenderingContext? getContext(DOMString contextId, any... arguments);
+
+ DOMString toDataURL(optional DOMString type, any... arguments);
+ void toBlob(BlobCallback _callback, optional DOMString type, any... arguments);
+};
+
+typedef (HTMLImageElement or
+ SVGImageElement) HTMLOrSVGImageElement;
+
+typedef (HTMLOrSVGImageElement or
+ HTMLVideoElement or
+ HTMLCanvasElement or
+ ImageBitmap) CanvasImageSource;
+
+enum CanvasFillRule { "nonzero", "evenodd" };
+
+dictionary CanvasRenderingContext2DSettings {
+ boolean alpha = true;
+};
+
+enum ImageSmoothingQuality { "low", "medium", "high" };
+
+interface CanvasRenderingContext2D {
+ // back-reference to the canvas
+ readonly attribute HTMLCanvasElement canvas;
+};
+CanvasRenderingContext2D implements CanvasState;
+CanvasRenderingContext2D implements CanvasTransform;
+CanvasRenderingContext2D implements CanvasCompositing;
+CanvasRenderingContext2D implements CanvasImageSmoothing;
+CanvasRenderingContext2D implements CanvasFillStrokeStyles;
+CanvasRenderingContext2D implements CanvasShadowStyles;
+CanvasRenderingContext2D implements CanvasFilters;
+CanvasRenderingContext2D implements CanvasRect;
+CanvasRenderingContext2D implements CanvasDrawPath;
+CanvasRenderingContext2D implements CanvasUserInterface;
+CanvasRenderingContext2D implements CanvasText;
+CanvasRenderingContext2D implements CanvasDrawImage;
+CanvasRenderingContext2D implements CanvasHitRegion;
+CanvasRenderingContext2D implements CanvasImageData;
+CanvasRenderingContext2D implements CanvasPathDrawingStyles;
+CanvasRenderingContext2D implements CanvasTextDrawingStyles;
+CanvasRenderingContext2D implements CanvasPath;
+
+[NoInterfaceObject]
+interface CanvasState {
+ // state
+ void save(); // push state on state stack
+ void restore(); // pop state stack and restore state
+};
+
+[NoInterfaceObject]
+interface CanvasTransform {
+ // transformations (default transform is the identity matrix)
+ void scale(unrestricted double x, unrestricted double y);
+ void rotate(unrestricted double angle);
+ void translate(unrestricted double x, unrestricted double y);
+ void transform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
+
+ [NewObject] DOMMatrix getTransform();
+ void setTransform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
+ void setTransform(optional DOMMatrixInit transform);
+ void resetTransform();
+
+};
+
+[NoInterfaceObject]
+interface CanvasCompositing {
+ // compositing
+ attribute unrestricted double globalAlpha; // (default 1.0)
+ attribute DOMString globalCompositeOperation; // (default source-over)
+};
+
+[NoInterfaceObject]
+interface CanvasImageSmoothing {
+ // image smoothing
+ attribute boolean imageSmoothingEnabled; // (default true)
+ attribute ImageSmoothingQuality imageSmoothingQuality; // (default low)
+
+};
+
+[NoInterfaceObject]
+interface CanvasFillStrokeStyles {
+ // colours and styles (see also the CanvasPathDrawingStyles and CanvasTextDrawingStyles interfaces)
+ attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black)
+ attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black)
+ CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
+ CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
+ CanvasPattern? createPattern(CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition);
+
+};
+
+[NoInterfaceObject]
+interface CanvasShadowStyles {
+ // shadows
+ attribute unrestricted double shadowOffsetX; // (default 0)
+ attribute unrestricted double shadowOffsetY; // (default 0)
+ attribute unrestricted double shadowBlur; // (default 0)
+ attribute DOMString shadowColor; // (default transparent black)
+};
+
+[NoInterfaceObject]
+interface CanvasFilters {
+ // filters
+ attribute DOMString filter; // (default "none")
+};
+
+[NoInterfaceObject]
+interface CanvasRect {
+ // rects
+ void clearRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);
+ void fillRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);
+ void strokeRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);
+};
+
+[NoInterfaceObject]
+interface CanvasDrawPath {
+ // path API (see also CanvasPath)
+ void beginPath();
+ void fill(optional CanvasFillRule fillRule = "nonzero");
+ void fill(Path2D path, optional CanvasFillRule fillRule = "nonzero");
+ void stroke();
+ void stroke(Path2D path);
+ void clip(optional CanvasFillRule fillRule = "nonzero");
+ void clip(Path2D path, optional CanvasFillRule fillRule = "nonzero");
+ void resetClip();
+ boolean isPointInPath(unrestricted double x, unrestricted double y, optional CanvasFillRule fillRule = "nonzero");
+ boolean isPointInPath(Path2D path, unrestricted double x, unrestricted double y, optional CanvasFillRule fillRule = "nonzero");
+ boolean isPointInStroke(unrestricted double x, unrestricted double y);
+ boolean isPointInStroke(Path2D path, unrestricted double x, unrestricted double y);
+};
+
+[NoInterfaceObject]
+interface CanvasUserInterface {
+ void drawFocusIfNeeded(Element element);
+ void drawFocusIfNeeded(Path2D path, Element element);
+ void scrollPathIntoView();
+ void scrollPathIntoView(Path2D path);
+};
+
+[NoInterfaceObject]
+interface CanvasText {
+ // text (see also the CanvasPathDrawingStyles and CanvasTextDrawingStyles interfaces)
+ void fillText(DOMString text, unrestricted double x, unrestricted double y, optional unrestricted double maxWidth);
+ void strokeText(DOMString text, unrestricted double x, unrestricted double y, optional unrestricted double maxWidth);
+ TextMetrics measureText(DOMString text);
+};
+
+[NoInterfaceObject]
+interface CanvasDrawImage {
+ // drawing images
+ void drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy);
+ void drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
+ void drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
+};
+
+[NoInterfaceObject]
+interface CanvasHitRegion {
+ // hit regions
+ void addHitRegion(optional HitRegionOptions options);
+ void removeHitRegion(DOMString id);
+ void clearHitRegions();
+};
+
+[NoInterfaceObject]
+interface CanvasImageData {
+ // pixel manipulation
+ ImageData createImageData(double sw, double sh);
+ ImageData createImageData(ImageData imagedata);
+ ImageData getImageData(double sx, double sy, double sw, double sh);
+ void putImageData(ImageData imagedata, double dx, double dy);
+ void putImageData(ImageData imagedata, double dx, double dy, double dirtyX, double dirtyY, double dirtyWidth, double dirtyHeight);
+};
+
+enum CanvasLineCap { "butt", "round", "square" };
+enum CanvasLineJoin { "round", "bevel", "miter"};
+enum CanvasTextAlign { "start", "end", "left", "right", "center" };
+enum CanvasTextBaseline { "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" };
+enum CanvasDirection { "ltr", "rtl", "inherit" };
+
+[NoInterfaceObject]
+interface CanvasPathDrawingStyles {
+ // line caps/joins
+ attribute unrestricted double lineWidth; // (default 1)
+ attribute CanvasLineCap lineCap; // (default "butt")
+ attribute CanvasLineJoin lineJoin; // (default "miter")
+ attribute unrestricted double miterLimit; // (default 10)
+
+ // dashed lines
+ void setLineDash(sequence<unrestricted double> segments); // default empty
+ sequence<unrestricted double> getLineDash();
+ attribute unrestricted double lineDashOffset;
+};
+
+[NoInterfaceObject]
+interface CanvasTextDrawingStyles {
+ // text
+ attribute DOMString font; // (default 10px sans-serif)
+ attribute CanvasTextAlign textAlign; // (default: "start")
+ attribute CanvasTextBaseline textBaseline; // (default: "alphabetic")
+ attribute CanvasDirection direction; // (default: "inherit")
+};
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface CanvasPath {
+ // shared path API methods
+ void closePath();
+ void moveTo(unrestricted double x, unrestricted double y);
+ void lineTo(unrestricted double x, unrestricted double y);
+ void quadraticCurveTo(unrestricted double cpx, unrestricted double cpy, unrestricted double x, unrestricted double y);
+ void bezierCurveTo(unrestricted double cp1x, unrestricted double cp1y, unrestricted double cp2x, unrestricted double cp2y, unrestricted double x, unrestricted double y);
+ void arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radius);
+ void arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radiusX, unrestricted double radiusY, unrestricted double rotation);
+ void rect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);
+ void arc(unrestricted double x, unrestricted double y, unrestricted double radius, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false);
+ void ellipse(unrestricted double x, unrestricted double y, unrestricted double radiusX, unrestricted double radiusY, unrestricted double rotation, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false);
+};
+
+interface CanvasGradient {
+ // opaque object
+ void addColorStop(double offset, DOMString color);
+};
+
+interface CanvasPattern {
+ // opaque object
+ void setTransform(optional DOMMatrixInit transform);
+};
+
+interface TextMetrics {
+ // x-direction
+ readonly attribute double width; // advance width
+ readonly attribute double actualBoundingBoxLeft;
+ readonly attribute double actualBoundingBoxRight;
+
+ // y-direction
+ readonly attribute double fontBoundingBoxAscent;
+ readonly attribute double fontBoundingBoxDescent;
+ readonly attribute double actualBoundingBoxAscent;
+ readonly attribute double actualBoundingBoxDescent;
+ readonly attribute double emHeightAscent;
+ readonly attribute double emHeightDescent;
+ readonly attribute double hangingBaseline;
+ readonly attribute double alphabeticBaseline;
+ readonly attribute double ideographicBaseline;
+};
+
+dictionary HitRegionOptions {
+ Path2D? path = null;
+ CanvasFillRule fillRule = "nonzero";
+ DOMString id = "";
+ DOMString? parentID = null;
+ DOMString cursor = "inherit";
+ // for control-backed regions:
+ Element? control = null;
+ // for unbacked regions:
+ DOMString? label = null;
+ DOMString? role = null;
+};
+
+[Constructor(unsigned long sw, unsigned long sh),
+ Constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh),
+ Exposed=(Window,Worker)]
+interface ImageData {
+ readonly attribute unsigned long width;
+ readonly attribute unsigned long height;
+ readonly attribute Uint8ClampedArray data;
+};
+
+[Constructor,
+ Constructor(Path2D path),
+ Constructor(sequence<Path2D> paths, optional CanvasFillRule fillRule = "nonzero"),
+ Constructor(DOMString d), Exposed=(Window,Worker)]
+interface Path2D {
+ void addPath(Path2D path, optional DOMMatrixInit transform);
+};
+Path2D implements CanvasPath;
+
+partial interface MouseEvent {
+ readonly attribute DOMString? region;
+};
+
+// https://github.com/w3c/testharness.js/issues/84
+//partial dictionary MouseEventInit {
+// DOMString? region;
+//};
+
+partial interface Touch {
+ readonly attribute DOMString? region;
+};
+
+interface DataTransfer {
+ attribute DOMString dropEffect;
+ attribute DOMString effectAllowed;
+
+ readonly attribute DataTransferItemList items;
+
+ void setDragImage(Element image, long x, long y);
+
+ /* old interface */
+ readonly attribute DOMString[] types;
+ DOMString getData(DOMString format);
+ void setData(DOMString format, DOMString data);
+ void clearData(optional DOMString format);
+ readonly attribute FileList files;
+};
+
+interface DataTransferItemList {
+ readonly attribute unsigned long length;
+ getter DataTransferItem (unsigned long index);
+ DataTransferItem? add(DOMString data, DOMString type);
+ DataTransferItem? add(File data);
+ void remove(unsigned long index);
+ void clear();
+};
+
+interface DataTransferItem {
+ readonly attribute DOMString kind;
+ readonly attribute DOMString type;
+ void getAsString(FunctionStringCallback? _callback);
+ File? getAsFile();
+};
+
+callback FunctionStringCallback = void (DOMString data);
+
+[Constructor(DOMString type, optional DragEventInit eventInitDict)]
+interface DragEvent : MouseEvent {
+ readonly attribute DataTransfer? dataTransfer;
+};
+
+dictionary DragEventInit : MouseEventInit {
+ DataTransfer? dataTransfer;
+};
+
+// For purposes of this test, just treat WindowProxy as the same thing as
+// Window.
+typedef Window WindowProxy;
+
+[PrimaryGlobal]
+/*sealed*/ interface Window : EventTarget {
+ // the current browsing context
+ [Unforgeable] readonly attribute WindowProxy window;
+ [Replaceable] readonly attribute WindowProxy self;
+ [Unforgeable] readonly attribute Document document;
+ attribute DOMString name;
+ [PutForwards=href, Unforgeable] readonly attribute Location location;
+ readonly attribute History history;
+ [Replaceable] readonly attribute BarProp locationbar;
+ [Replaceable] readonly attribute BarProp menubar;
+ [Replaceable] readonly attribute BarProp personalbar;
+ [Replaceable] readonly attribute BarProp scrollbars;
+ [Replaceable] readonly attribute BarProp statusbar;
+ [Replaceable] readonly attribute BarProp toolbar;
+ attribute DOMString status;
+ void close();
+ readonly attribute boolean closed;
+ void stop();
+ void focus();
+ void blur();
+
+ // other browsing contexts
+ [Replaceable] readonly attribute WindowProxy frames;
+ [Replaceable] readonly attribute unsigned long length;
+ [Unforgeable] readonly attribute WindowProxy top;
+ attribute any opener;
+ [Replaceable] readonly attribute WindowProxy parent;
+ readonly attribute Element? frameElement;
+ WindowProxy open(optional DOMString url = "about:blank", optional DOMString target = "_blank", [TreatNullAs=EmptyString] optional DOMString features = "", optional boolean replace = false);
+ getter WindowProxy (unsigned long index);
+ getter object (DOMString name);
+
+ // the user agent
+ readonly attribute Navigator navigator;
+ [Replaceable] readonly attribute External external;
+ readonly attribute ApplicationCache applicationCache;
+
+ // user prompts
+ void alert();
+ //void alert(DOMString message);
+ boolean confirm(optional DOMString message = "");
+ DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
+ void print();
+ any showModalDialog(DOMString url, optional any argument);
+
+ void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);
+
+ // also has obsolete members
+};
+Window implements GlobalEventHandlers;
+Window implements WindowEventHandlers;
+
+interface BarProp {
+ readonly attribute boolean visible;
+};
+
+enum ScrollRestoration { "auto", "manual" };
+interface History {
+
+ readonly attribute long length;
+ attribute ScrollRestoration scrollRestoration;
+ readonly attribute any state;
+ void go(optional long delta);
+ void back();
+ void forward();
+ void pushState(any data, DOMString title, optional DOMString? url = null);
+ void replaceState(any data, DOMString title, optional DOMString? url = null);
+};
+
+[Unforgeable] interface Location {
+ stringifier attribute USVString href;
+ readonly attribute USVString origin;
+ attribute USVString protocol;
+ attribute USVString host;
+ attribute USVString hostname;
+ attribute USVString port;
+ attribute USVString pathname;
+ attribute USVString search;
+ attribute USVString hash;
+
+ void assign(USVString url);
+ void replace(USVString url);
+ void reload();
+
+ [SameObject] readonly attribute USVString[] ancestorOrigins;
+};
+
+[Constructor(DOMString type, optional PopStateEventInit eventInitDict), Exposed=(Window,Worker)]
+interface PopStateEvent : Event {
+ readonly attribute any state;
+};
+
+dictionary PopStateEventInit : EventInit {
+ any state;
+};
+
+[Constructor(DOMString type, optional HashChangeEventInit eventInitDict), Exposed=(Window,Worker)]
+interface HashChangeEvent : Event {
+ readonly attribute DOMString oldURL;
+ readonly attribute DOMString newURL;
+};
+
+dictionary HashChangeEventInit : EventInit {
+ DOMString oldURL;
+ DOMString newURL;
+};
+
+[Constructor(DOMString type, optional PageTransitionEventInit eventInitDict), Exposed=(Window,Worker)]
+interface PageTransitionEvent : Event {
+ readonly attribute boolean persisted;
+};
+
+dictionary PageTransitionEventInit : EventInit {
+ boolean persisted;
+};
+
+interface BeforeUnloadEvent : Event {
+ attribute DOMString returnValue;
+};
+
+[Exposed=(Window,SharedWorker)]
+interface ApplicationCache : EventTarget {
+
+ // update status
+ const unsigned short UNCACHED = 0;
+ const unsigned short IDLE = 1;
+ const unsigned short CHECKING = 2;
+ const unsigned short DOWNLOADING = 3;
+ const unsigned short UPDATEREADY = 4;
+ const unsigned short OBSOLETE = 5;
+ readonly attribute unsigned short status;
+
+ // updates
+ void update();
+ void abort();
+ void swapCache();
+
+ // events
+ attribute EventHandler onchecking;
+ attribute EventHandler onerror;
+ attribute EventHandler onnoupdate;
+ attribute EventHandler ondownloading;
+ attribute EventHandler onprogress;
+ attribute EventHandler onupdateready;
+ attribute EventHandler oncached;
+ attribute EventHandler onobsolete;
+};
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface NavigatorOnLine {
+ readonly attribute boolean onLine;
+};
+
+[Constructor(DOMString type, optional ErrorEventInit eventInitDict), Exposed=(Window,Worker)]
+interface ErrorEvent : Event {
+ readonly attribute DOMString message;
+ readonly attribute DOMString filename;
+ readonly attribute unsigned long lineno;
+ readonly attribute unsigned long colno;
+ readonly attribute any error;
+};
+
+dictionary ErrorEventInit : EventInit {
+ DOMString message;
+ DOMString filename;
+ unsigned long lineno;
+ unsigned long colno;
+ any error;
+};
+
+[TreatNonCallableAsNull]
+callback EventHandlerNonNull = any (Event event);
+typedef EventHandlerNonNull? EventHandler;
+
+[TreatNonCallableAsNull]
+callback OnErrorEventHandlerNonNull = any ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column, optional any error);
+typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;
+
+[TreatNonCallableAsNull]
+callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event);
+typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler;
+
+[NoInterfaceObject]
+interface GlobalEventHandlers {
+ attribute EventHandler onabort;
+ attribute EventHandler onblur;
+ attribute EventHandler oncancel;
+ attribute EventHandler oncanplay;
+ attribute EventHandler oncanplaythrough;
+ attribute EventHandler onchange;
+ attribute EventHandler onclick;
+ attribute EventHandler onclose;
+ attribute EventHandler oncontextmenu;
+ attribute EventHandler oncuechange;
+ attribute EventHandler ondblclick;
+ attribute EventHandler ondrag;
+ attribute EventHandler ondragend;
+ attribute EventHandler ondragenter;
+ attribute EventHandler ondragexit;
+ attribute EventHandler ondragleave;
+ attribute EventHandler ondragover;
+ attribute EventHandler ondragstart;
+ attribute EventHandler ondrop;
+ attribute EventHandler ondurationchange;
+ attribute EventHandler onemptied;
+ attribute EventHandler onended;
+ attribute OnErrorEventHandler onerror;
+ attribute EventHandler onfocus;
+ attribute EventHandler oninput;
+ attribute EventHandler oninvalid;
+ attribute EventHandler onkeydown;
+ attribute EventHandler onkeypress;
+ attribute EventHandler onkeyup;
+ attribute EventHandler onload;
+ attribute EventHandler onloadeddata;
+ attribute EventHandler onloadedmetadata;
+ attribute EventHandler onloadstart;
+ attribute EventHandler onmousedown;
+ [LenientThis] attribute EventHandler onmouseenter;
+ [LenientThis] attribute EventHandler onmouseleave;
+ attribute EventHandler onmousemove;
+ attribute EventHandler onmouseout;
+ attribute EventHandler onmouseover;
+ attribute EventHandler onmouseup;
+ attribute EventHandler onmousewheel;
+ attribute EventHandler onpause;
+ attribute EventHandler onplay;
+ attribute EventHandler onplaying;
+ attribute EventHandler onprogress;
+ attribute EventHandler onratechange;
+ attribute EventHandler onreset;
+ attribute EventHandler onresize;
+ attribute EventHandler onscroll;
+ attribute EventHandler onseeked;
+ attribute EventHandler onseeking;
+ attribute EventHandler onselect;
+ attribute EventHandler onshow;
+ attribute EventHandler onstalled;
+ attribute EventHandler onsubmit;
+ attribute EventHandler onsuspend;
+ attribute EventHandler ontimeupdate;
+ attribute EventHandler ontoggle;
+ attribute EventHandler onvolumechange;
+ attribute EventHandler onwaiting;
+};
+
+[NoInterfaceObject]
+interface DocumentAndElementEventHandlers {
+ attribute EventHandler oncopy;
+ attribute EventHandler oncut;
+ attribute EventHandler onpaste;
+};
+
+[NoInterfaceObject]
+interface WindowEventHandlers {
+ attribute EventHandler onafterprint;
+ attribute EventHandler onbeforeprint;
+ attribute OnBeforeUnloadEventHandler onbeforeunload;
+ attribute EventHandler onhashchange;
+ attribute EventHandler onlanguagechange;
+ attribute EventHandler onmessage;
+ attribute EventHandler onoffline;
+ attribute EventHandler ononline;
+ attribute EventHandler onpagehide;
+ attribute EventHandler onpageshow;
+ attribute EventHandler onpopstate;
+ attribute EventHandler onstorage;
+ attribute EventHandler onunload;
+};
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface WindowBase64 {
+ DOMString btoa(DOMString btoa);
+ DOMString atob(DOMString atob);
+};
+Window implements WindowBase64;
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface WindowTimers {
+ long setTimeout(Function handler, optional long timeout = 0, any... arguments);
+ long setTimeout(DOMString handler, optional long timeout = 0, any... arguments);
+ void clearTimeout(optional long handle = 0);
+ long setInterval(Function handler, optional long timeout = 0, any... arguments);
+ long setInterval(DOMString handler, optional long timeout = 0, any... arguments);
+ void clearInterval(optional long handle = 0);
+};
+Window implements WindowTimers;
+
+[NoInterfaceObject]
+interface WindowModal {
+ readonly attribute any dialogArguments;
+ attribute any returnValue;
+};
+
+interface Navigator {
+ // objects implementing this interface also implement the interfaces given below
+};
+Navigator implements NavigatorID;
+Navigator implements NavigatorLanguage;
+Navigator implements NavigatorOnLine;
+Navigator implements NavigatorContentUtils;
+Navigator implements NavigatorCookies;
+Navigator implements NavigatorPlugins;
+Navigator implements NavigatorConcurrentHardware;
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface NavigatorID {
+ [Exposed=Window] readonly attribute DOMString appCodeName; // constant "Mozilla"
+ readonly attribute DOMString appName; // constant "Netscape"
+ readonly attribute DOMString appVersion;
+ readonly attribute DOMString platform;
+ [Exposed=Window] readonly attribute DOMString product; // constant "Gecko"
+ [Exposed=Window] readonly attribute DOMString productSub;
+ readonly attribute DOMString userAgent;
+ [Exposed=Window] readonly attribute DOMString vendor;
+ [Exposed=Window] readonly attribute DOMString vendorSub; // constant ""
+};
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface NavigatorLanguage {
+ readonly attribute DOMString language;
+ readonly attribute FrozenArray<DOMString> languages;
+};
+
+[NoInterfaceObject]
+interface NavigatorContentUtils {
+ // content handler registration
+ void registerProtocolHandler(DOMString scheme, USVString url, DOMString title);
+ void registerContentHandler(DOMString mimeType, USVString url, DOMString title);
+ DOMString isProtocolHandlerRegistered(DOMString scheme, USVString url);
+ DOMString isContentHandlerRegistered(DOMString mimeType, USVString url);
+ void unregisterProtocolHandler(DOMString scheme, USVString url);
+ void unregisterContentHandler(DOMString mimeType, USVString url);
+};
+
+[NoInterfaceObject]
+interface NavigatorCookies {
+ readonly attribute boolean cookieEnabled;
+};
+
+[NoInterfaceObject]
+interface NavigatorPlugins {
+ [SameObject] readonly attribute PluginArray plugins;
+ [SameObject] readonly attribute MimeTypeArray mimeTypes;
+ boolean javaEnabled();
+};
+
+interface PluginArray {
+ void refresh(optional boolean reload = false);
+ readonly attribute unsigned long length;
+ getter Plugin? item(unsigned long index);
+ getter Plugin? namedItem(DOMString name);
+};
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface NavigatorConcurrentHardware {
+ readonly attribute unsigned long long hardwareConcurrency;
+};
+
+interface MimeTypeArray {
+ readonly attribute unsigned long length;
+ getter MimeType? item(unsigned long index);
+ getter MimeType? namedItem(DOMString name);
+};
+
+interface Plugin {
+ readonly attribute DOMString name;
+ readonly attribute DOMString description;
+ readonly attribute DOMString filename;
+ readonly attribute unsigned long length;
+ getter MimeType? item(unsigned long index);
+ getter MimeType? namedItem(DOMString name);
+};
+
+interface MimeType {
+ readonly attribute DOMString type;
+ readonly attribute DOMString description;
+ readonly attribute DOMString suffixes; // comma-separated
+ readonly attribute Plugin enabledPlugin;
+};
+
+interface External {
+ void AddSearchProvider(DOMString engineURL);
+ unsigned long IsSearchProviderInstalled(DOMString engineURL);
+};
+
+[Exposed=(Window,Worker)]
+interface ImageBitmap {
+ readonly attribute unsigned long width;
+ readonly attribute unsigned long height;
+};
+
+typedef (HTMLImageElement or
+ HTMLVideoElement or
+ HTMLCanvasElement or
+ Blob or
+ ImageData or
+ CanvasRenderingContext2D or
+ ImageBitmap) ImageBitmapSource;
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface ImageBitmapFactories {
+ Promise createImageBitmap(ImageBitmapSource image, optional long sx, long sy, long sw, long sh);
+};
+Window implements ImageBitmapFactories;
+WorkerGlobalScope implements ImageBitmapFactories;
+
+[Constructor(DOMString type, optional MessageEventInit eventInitDict), Exposed=(Window,Worker)]
+interface MessageEvent : Event {
+ readonly attribute any data;
+ readonly attribute DOMString origin;
+ readonly attribute DOMString lastEventId;
+ readonly attribute (WindowProxy or MessagePort)? source;
+ readonly attribute MessagePort[]? ports;
+
+ void initMessageEvent(DOMString typeArg, boolean canBubbleArg, boolean cancelableArg, any dataArg, DOMString originArg, DOMString lastEventIdArg, (WindowProxy or MessagePort) sourceArg, MessagePort[]? portsArg);
+};
+
+dictionary MessageEventInit : EventInit {
+ any data;
+ DOMString origin;
+ DOMString lastEventId;
+ (WindowProxy or MessagePort)? source;
+ sequence<MessagePort> ports;
+};
+
+[Constructor(DOMString url, optional EventSourceInit eventSourceInitDict), Exposed=(Window,Worker)]
+interface EventSource : EventTarget {
+ readonly attribute DOMString url;
+ readonly attribute boolean withCredentials;
+
+ // ready state
+ const unsigned short CONNECTING = 0;
+ const unsigned short OPEN = 1;
+ const unsigned short CLOSED = 2;
+ readonly attribute unsigned short readyState;
+
+ // networking
+ attribute EventHandler onopen;
+ attribute EventHandler onmessage;
+ attribute EventHandler onerror;
+ void close();
+};
+
+dictionary EventSourceInit {
+ boolean withCredentials = false;
+};
+
+enum BinaryType { "blob", "arraybuffer" };
+[Constructor(DOMString url, optional (DOMString or DOMString[]) protocols), Exposed=(Window,Worker)]
+interface WebSocket : EventTarget {
+ readonly attribute DOMString url;
+
+ // ready state
+ const unsigned short CONNECTING = 0;
+ const unsigned short OPEN = 1;
+ const unsigned short CLOSING = 2;
+ const unsigned short CLOSED = 3;
+ readonly attribute unsigned short readyState;
+ readonly attribute unsigned long bufferedAmount;
+
+ // networking
+ attribute EventHandler onopen;
+ attribute EventHandler onerror;
+ attribute EventHandler onclose;
+ readonly attribute DOMString extensions;
+ readonly attribute DOMString protocol;
+ void close([Clamp] optional unsigned short code, optional USVString reason);
+
+ // messaging
+ attribute EventHandler onmessage;
+ attribute BinaryType binaryType;
+ void send(USVString data);
+ void send(Blob data);
+ void send(ArrayBuffer data);
+ void send(ArrayBufferView data);
+};
+
+[Constructor(DOMString type, optional CloseEventInit eventInitDict), Exposed=(Window,Worker)]
+interface CloseEvent : Event {
+ readonly attribute boolean wasClean;
+ readonly attribute unsigned short code;
+ readonly attribute DOMString reason;
+};
+
+dictionary CloseEventInit : EventInit {
+ boolean wasClean;
+ unsigned short code;
+ DOMString reason;
+};
+
+[Constructor, Exposed=(Window,Worker)]
+interface MessageChannel {
+ readonly attribute MessagePort port1;
+ readonly attribute MessagePort port2;
+};
+
+[Exposed=(Window,Worker)]
+interface MessagePort : EventTarget {
+ void postMessage(any message, optional sequence<Transferable> transfer);
+ void start();
+ void close();
+
+ // event handlers
+ attribute EventHandler onmessage;
+};
+// MessagePort implements Transferable;
+
+[Constructor(DOMString channel), Exposed=(Window,Worker)]
+interface BroadcastChannel : EventTarget {
+ readonly attribute DOMString name;
+ void postMessage(any message);
+ void close();
+ attribute EventHandler onmessage;
+};
+
+[Exposed=Worker]
+interface WorkerGlobalScope : EventTarget {
+ readonly attribute WorkerGlobalScope self;
+ readonly attribute WorkerLocation location;
+
+ void close();
+ attribute OnErrorEventHandler onerror;
+ attribute EventHandler onlanguagechange;
+ attribute EventHandler onoffline;
+ attribute EventHandler ononline;
+
+ // also has additional members in a partial interface
+};
+
+[Global=(Worker,DedicatedWorker),Exposed=DedicatedWorker]
+/*sealed*/ interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
+ void postMessage(any message, optional sequence<Transferable> transfer);
+ attribute EventHandler onmessage;
+};
+
+[Global=(Worker,SharedWorker),Exposed=SharedWorker]
+/*sealed*/ interface SharedWorkerGlobalScope : WorkerGlobalScope {
+ readonly attribute DOMString name;
+ readonly attribute ApplicationCache applicationCache;
+ attribute EventHandler onconnect;
+};
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface AbstractWorker {
+ attribute EventHandler onerror;
+};
+
+[Constructor(DOMString scriptURL), Exposed=(Window,Worker)]
+interface Worker : EventTarget {
+ void terminate();
+
+ void postMessage(any message, optional sequence<Transferable> transfer);
+ attribute EventHandler onmessage;
+};
+Worker implements AbstractWorker;
+
+[Constructor(DOMString scriptURL, optional DOMString name), Exposed=(Window,Worker)]
+interface SharedWorker : EventTarget {
+ readonly attribute MessagePort port;
+};
+SharedWorker implements AbstractWorker;
+
+partial interface WorkerGlobalScope { // not obsolete
+ void importScripts(DOMString... urls);
+ readonly attribute WorkerNavigator navigator;
+};
+WorkerGlobalScope implements WindowTimers;
+WorkerGlobalScope implements WindowBase64;
+
+[Exposed=Worker]
+interface WorkerNavigator {};
+WorkerNavigator implements NavigatorID;
+WorkerNavigator implements NavigatorLanguage;
+WorkerNavigator implements NavigatorOnLine;
+
+[Exposed=Worker]
+interface WorkerLocation {
+ stringifier readonly attribute USVString href;
+ readonly attribute USVString origin;
+ readonly attribute USVString protocol;
+ readonly attribute USVString host;
+ readonly attribute USVString hostname;
+ readonly attribute USVString port;
+ readonly attribute USVString pathname;
+ readonly attribute USVString search;
+ readonly attribute USVString hash;
+};
+
+interface Storage {
+ readonly attribute unsigned long length;
+ DOMString? key(unsigned long index);
+ getter DOMString? getItem(DOMString key);
+ setter creator void setItem(DOMString key, DOMString value);
+ deleter void removeItem(DOMString key);
+ void clear();
+};
+
+[NoInterfaceObject]
+interface WindowSessionStorage {
+ readonly attribute Storage sessionStorage;
+};
+Window implements WindowSessionStorage;
+
+[NoInterfaceObject]
+interface WindowLocalStorage {
+ readonly attribute Storage localStorage;
+};
+Window implements WindowLocalStorage;
+
+[Constructor(DOMString type, optional StorageEventInit eventInitDict)]
+interface StorageEvent : Event {
+ readonly attribute DOMString? key;
+ readonly attribute DOMString? oldValue;
+ readonly attribute DOMString? newValue;
+ readonly attribute DOMString url;
+ readonly attribute Storage? storageArea;
+};
+
+dictionary StorageEventInit : EventInit {
+ DOMString? key;
+ DOMString? oldValue;
+ DOMString? newValue;
+ DOMString url;
+ Storage? storageArea;
+};
+
+interface HTMLAppletElement : HTMLElement {
+ attribute DOMString align;
+ attribute DOMString alt;
+ attribute DOMString archive;
+ attribute DOMString code;
+ attribute DOMString codeBase;
+ attribute DOMString height;
+ attribute unsigned long hspace;
+ attribute DOMString name;
+ attribute DOMString _object; // the underscore is not part of the identifier
+ attribute unsigned long vspace;
+ attribute DOMString width;
+};
+
+interface HTMLMarqueeElement : HTMLElement {
+ attribute DOMString behavior;
+ attribute DOMString bgColor;
+ attribute DOMString direction;
+ attribute DOMString height;
+ attribute unsigned long hspace;
+ attribute long loop;
+ attribute unsigned long scrollAmount;
+ attribute unsigned long scrollDelay;
+ attribute boolean trueSpeed;
+ attribute unsigned long vspace;
+ attribute DOMString width;
+
+ attribute EventHandler onbounce;
+ attribute EventHandler onfinish;
+ attribute EventHandler onstart;
+
+ void start();
+ void stop();
+};
+
+interface HTMLFrameSetElement : HTMLElement {
+ attribute DOMString cols;
+ attribute DOMString rows;
+};
+HTMLFrameSetElement implements WindowEventHandlers;
+
+interface HTMLFrameElement : HTMLElement {
+ attribute DOMString name;
+ attribute DOMString scrolling;
+ attribute DOMString src;
+ attribute DOMString frameBorder;
+ attribute DOMString longDesc;
+ attribute boolean noResize;
+ readonly attribute Document? contentDocument;
+ readonly attribute WindowProxy? contentWindow;
+
+ [TreatNullAs=EmptyString] attribute DOMString marginHeight;
+ [TreatNullAs=EmptyString] attribute DOMString marginWidth;
+};
+
+partial interface HTMLAnchorElement {
+ attribute DOMString coords;
+ attribute DOMString charset;
+ attribute DOMString name;
+ attribute DOMString rev;
+ attribute DOMString shape;
+};
+
+partial interface HTMLAreaElement {
+ attribute boolean noHref;
+};
+
+partial interface HTMLBodyElement {
+ [TreatNullAs=EmptyString] attribute DOMString text;
+ [TreatNullAs=EmptyString] attribute DOMString link;
+ [TreatNullAs=EmptyString] attribute DOMString vLink;
+ [TreatNullAs=EmptyString] attribute DOMString aLink;
+ [TreatNullAs=EmptyString] attribute DOMString bgColor;
+ attribute DOMString background;
+};
+
+partial interface HTMLBRElement {
+ attribute DOMString clear;
+};
+
+partial interface HTMLTableCaptionElement {
+ attribute DOMString align;
+};
+
+partial interface HTMLTableColElement {
+ attribute DOMString align;
+ attribute DOMString ch;
+ attribute DOMString chOff;
+ attribute DOMString vAlign;
+ attribute DOMString width;
+};
+
+interface HTMLDirectoryElement : HTMLElement {
+ attribute boolean compact;
+};
+
+partial interface HTMLDivElement {
+ attribute DOMString align;
+};
+
+partial interface HTMLDListElement {
+ attribute boolean compact;
+};
+
+partial interface HTMLEmbedElement {
+ attribute DOMString align;
+ attribute DOMString name;
+};
+
+interface HTMLFontElement : HTMLElement {
+ [TreatNullAs=EmptyString] attribute DOMString color;
+ attribute DOMString face;
+ attribute DOMString size;
+};
+
+partial interface HTMLHeadingElement {
+ attribute DOMString align;
+};
+
+partial interface HTMLHRElement {
+ attribute DOMString align;
+ attribute DOMString color;
+ attribute boolean noShade;
+ attribute DOMString size;
+ attribute DOMString width;
+};
+
+partial interface HTMLHtmlElement {
+ attribute DOMString version;
+};
+
+partial interface HTMLIFrameElement {
+ attribute DOMString align;
+ attribute DOMString scrolling;
+ attribute DOMString frameBorder;
+ attribute DOMString longDesc;
+
+ [TreatNullAs=EmptyString] attribute DOMString marginHeight;
+ [TreatNullAs=EmptyString] attribute DOMString marginWidth;
+};
+
+partial interface HTMLImageElement {
+ attribute DOMString name;
+ attribute DOMString lowsrc;
+ attribute DOMString align;
+ attribute unsigned long hspace;
+ attribute unsigned long vspace;
+ attribute DOMString longDesc;
+
+ [TreatNullAs=EmptyString] attribute DOMString border;
+};
+
+partial interface HTMLInputElement {
+ attribute DOMString align;
+ attribute DOMString useMap;
+};
+
+partial interface HTMLLegendElement {
+ attribute DOMString align;
+};
+
+partial interface HTMLLIElement {
+ attribute DOMString type;
+};
+
+partial interface HTMLLinkElement {
+ attribute DOMString charset;
+ attribute DOMString rev;
+ attribute DOMString target;
+};
+
+partial interface HTMLMenuElement {
+ attribute boolean compact;
+};
+
+partial interface HTMLMetaElement {
+ attribute DOMString scheme;
+};
+
+partial interface HTMLObjectElement {
+ attribute DOMString align;
+ attribute DOMString archive;
+ attribute DOMString code;
+ attribute boolean declare;
+ attribute unsigned long hspace;
+ attribute DOMString standby;
+ attribute unsigned long vspace;
+ attribute DOMString codeBase;
+ attribute DOMString codeType;
+
+ [TreatNullAs=EmptyString] attribute DOMString border;
+};
+
+partial interface HTMLOListElement {
+ attribute boolean compact;
+};
+
+partial interface HTMLParagraphElement {
+ attribute DOMString align;
+};
+
+partial interface HTMLParamElement {
+ attribute DOMString type;
+ attribute DOMString valueType;
+};
+
+partial interface HTMLPreElement {
+ attribute long width;
+};
+
+partial interface HTMLScriptElement {
+ attribute DOMString event;
+ attribute DOMString htmlFor;
+};
+
+partial interface HTMLTableElement {
+ attribute DOMString align;
+ attribute DOMString border;
+ attribute DOMString frame;
+ attribute DOMString rules;
+ attribute DOMString summary;
+ attribute DOMString width;
+
+ [TreatNullAs=EmptyString] attribute DOMString bgColor;
+ [TreatNullAs=EmptyString] attribute DOMString cellPadding;
+ [TreatNullAs=EmptyString] attribute DOMString cellSpacing;
+};
+
+partial interface HTMLTableSectionElement {
+ attribute DOMString align;
+ attribute DOMString ch;
+ attribute DOMString chOff;
+ attribute DOMString vAlign;
+};
+
+partial interface HTMLTableCellElement {
+ attribute DOMString align;
+ attribute DOMString axis;
+ attribute DOMString height;
+ attribute DOMString width;
+
+ attribute DOMString ch;
+ attribute DOMString chOff;
+ attribute boolean noWrap;
+ attribute DOMString vAlign;
+
+ [TreatNullAs=EmptyString] attribute DOMString bgColor;
+};
+
+partial interface HTMLTableRowElement {
+ attribute DOMString align;
+ attribute DOMString ch;
+ attribute DOMString chOff;
+ attribute DOMString vAlign;
+
+ [TreatNullAs=EmptyString] attribute DOMString bgColor;
+};
+
+partial interface HTMLUListElement {
+ attribute boolean compact;
+ attribute DOMString type;
+};
+
+partial interface Document {
+ [TreatNullAs=EmptyString] attribute DOMString fgColor;
+ [TreatNullAs=EmptyString] attribute DOMString linkColor;
+ [TreatNullAs=EmptyString] attribute DOMString vlinkColor;
+ [TreatNullAs=EmptyString] attribute DOMString alinkColor;
+ [TreatNullAs=EmptyString] attribute DOMString bgColor;
+
+ readonly attribute HTMLCollection anchors;
+ readonly attribute HTMLCollection applets;
+
+ void clear();
+ void captureEvents();
+ void releaseEvents();
+
+ readonly attribute HTMLAllCollection all;
+};
+
+partial interface Window {
+ void captureEvents();
+ void releaseEvents();
+};
+
+</script>
+<script>
+"use strict";
+var idlArray;
+var errorVideo; // used to get a MediaError object
+var iframe; // used to get a Document object (can't use `document` because some test clears the page)
+setup(function() {
+ idlArray = new IdlArray();
+ [].forEach.call(document.querySelectorAll("script[type=text\\/plain]"), function(node) {
+ if (node.className == "untested") {
+ idlArray.add_untested_idls(node.textContent);
+ } else {
+ idlArray.add_idls(node.textContent);
+ }
+ });
+ errorVideo = document.createElement('video');
+ errorVideo.src = 'data:,';
+ errorVideo.preload = 'auto';
+ iframe = document.createElement('iframe');
+ iframe.hidden = true;
+ document.body.appendChild(iframe);
+}, {explicit_done:true});
+
+function createInput(type) {
+ var input = document.createElement('input');
+ input.type = type;
+ return input;
+}
+
+window.onload = function() {
+ idlArray.add_objects({
+ NodeList: ['document.getElementsByName("name")'],
+ HTMLAllCollection: ['document.all'],
+ HTMLFormControlsCollection: ['document.createElement("form").elements'],
+ RadioNodeList: [],
+ HTMLOptionsCollection: ['document.createElement("select").options'],
+ DOMStringMap: ['document.head.dataset'],
+ Transferable: [],
+ Document: ['iframe.contentDocument', 'new Document()'],
+ XMLDocument: ['document.implementation.createDocument(null, "", null)'],
+ HTMLElement: ['document.createElement("noscript")'], // more tests in html/semantics/interfaces.js
+ HTMLUnknownElement: ['document.createElement("bgsound")'], // more tests in html/semantics/interfaces.js
+ HTMLHtmlElement: ['document.createElement("html")'],
+ HTMLHeadElement: ['document.createElement("head")'],
+ HTMLTitleElement: ['document.createElement("title")'],
+ HTMLBaseElement: ['document.createElement("base")'],
+ HTMLLinkElement: ['document.createElement("link")'],
+ HTMLMetaElement: ['document.createElement("meta")'],
+ HTMLStyleElement: ['document.createElement("style")'],
+ HTMLScriptElement: ['document.createElement("script")'],
+ HTMLBodyElement: ['document.createElement("body")'],
+ HTMLHeadingElement: ['document.createElement("h1")'],
+ HTMLParagraphElement: ['document.createElement("p")'],
+ HTMLHRElement: ['document.createElement("hr")'],
+ HTMLPreElement: [
+ 'document.createElement("pre")',
+ 'document.createElement("listing")',
+ 'document.createElement("xmp")',
+ ],
+ HTMLQuoteElement: [
+ 'document.createElement("blockquote")',
+ 'document.createElement("q")',
+ ],
+ HTMLOlistElement: ['document.createElement("ol")'],
+ HTMLUlistElement: ['document.createElement("ul")'],
+ HTMLLIElement: ['document.createElement("li")'],
+ HTMLDlistElement: ['document.createElement("dl")'],
+ HTMLDivElement: ['document.createElement("div")'],
+ HTMLAnchorElement: ['document.createElement("a")'],
+ HTMLDataElement: ['document.createElement("data")'],
+ HTMLTimeElement: ['document.createElement("time")'],
+ HTMLSpanElement: ['document.createElement("span")'],
+ HTMLBRElement: ['document.createElement("br")'],
+ HTMLModElement: [
+ 'document.createElement("ins")',
+ 'document.createElement("del")',
+ ],
+ HTMLPictureElement: ['document.createElement("picture")'],
+ HTMLImageElement: ['document.createElement("img")', 'new Image()'],
+ HTMLIframeElement: ['document.createElement("iframe")'],
+ HTMLEmbedElement: ['document.createElement("embed")'],
+ HTMLObjectElement: ['document.createElement("object")'],
+ HTMLParamElement: ['document.createElement("param")'],
+ HTMLVideoElement: ['document.createElement("video")'],
+ HTMLAudioElement: ['document.createElement("audio")', 'new Audio()'],
+ HTMLSourceElement: ['document.createElement("source")'],
+ HTMLTrackElement: ['document.createElement("track")'],
+ HTMLMediaElement: [],
+ MediaError: ['errorVideo.error'],
+ AudioTrackList: [],
+ AudioTrack: [],
+ VideoTrackList: [],
+ VideoTrack: [],
+ TextTrackList: ['document.createElement("video").textTracks'],
+ TextTrack: ['document.createElement("track").track'],
+ TextTrackCueList: ['document.createElement("video").addTextTrack("subtitles").cues'],
+ TextTrackCue: [],
+ DataCue: [],
+ TimeRanges: ['document.createElement("video").buffered'],
+ TrackEvent: ['new TrackEvent("addtrack", {track:document.createElement("track").track})'],
+ HTMLTemplateElement: ['document.createElement("template")'],
+ HTMLSlotElement: ['document.createElement("slot")'],
+ HTMLCanvasElement: ['document.createElement("canvas")'],
+ CanvasRenderingContext2D: ['document.createElement("canvas").getContext("2d")'],
+ CanvasGradient: [],
+ CanvasPattern: [],
+ TextMetrics: [],
+ ImageData: [],
+ HTMLMapElement: ['document.createElement("map")'],
+ HTMLAreaElement: ['document.createElement("area")'],
+ HTMLTableElement: ['document.createElement("table")'],
+ HTMLTableCaptionElement: ['document.createElement("caption")'],
+ HTMLTableColElement: [
+ 'document.createElement("colgroup")',
+ 'document.createElement("col")',
+ ],
+ HTMLTableSectionElement: [
+ 'document.createElement("tbody")',
+ 'document.createElement("thead")',
+ 'document.createElement("tfoot")',
+ ],
+ HTMLTableRowElement: ['document.createElement("tr")'],
+ HTMLTableCellElement: [
+ 'document.createElement("td")',
+ 'document.createElement("th")',
+ ],
+ HTMLFormElement: ['document.createElement("form")'],
+ HTMLFieldsetElement: ['document.createElement("fieldset")'],
+ HTMLLegendElement: ['document.createElement("legend")'],
+ HTMLLabelElement: ['document.createElement("label")'],
+ HTMLInputElement: [
+ 'document.createElement("input")',
+ 'createInput("text")',
+ 'createInput("hidden")',
+ 'createInput("search")',
+ 'createInput("tel")',
+ 'createInput("url")',
+ 'createInput("email")',
+ 'createInput("password")',
+ 'createInput("date")',
+ 'createInput("month")',
+ 'createInput("week")',
+ 'createInput("time")',
+ 'createInput("datetime-local")',
+ 'createInput("number")',
+ 'createInput("range")',
+ 'createInput("color")',
+ 'createInput("checkbox")',
+ 'createInput("radio")',
+ 'createInput("file")',
+ 'createInput("submit")',
+ 'createInput("image")',
+ 'createInput("reset")',
+ 'createInput("button")'
+ ],
+ HTMLButtonElement: ['document.createElement("button")'],
+ HTMLSelectElement: ['document.createElement("select")'],
+ HTMLDataListElement: ['document.createElement("datalist")'],
+ HTMLOptGroupElement: ['document.createElement("optgroup")'],
+ HTMLOptionElement: ['document.createElement("option")', 'new Option()'],
+ HTMLTextAreaElement: ['document.createElement("textarea")'],
+ HTMLKeygenElement: ['document.createElement("keygen")'],
+ HTMLOutputElement: ['document.createElement("output")'],
+ HTMLProgressElement: ['document.createElement("progress")'],
+ HTMLMeterElement: ['document.createElement("meter")'],
+ ValidityState: ['document.createElement("input").validity'],
+ HTMLDetailsElement: ['document.createElement("details")'],
+ HTMLMenuElement: ['document.createElement("menu")'],
+ Window: ['window'],
+ BarProp: [],
+ History: ['window.history'],
+ Location: ['window.location'],
+ PopStateEvent: ['new PopStateEvent("popstate", { data: {} })'],
+ HashChangeEvent: [],
+ PageTransitionEvent: [],
+ BeforeUnloadEvent: [],
+ ApplicationCache: ['window.applicationCache'],
+ WindowModal: [],
+ Navigator: ['window.navigator'],
+ External: ['window.external'],
+ DataTransfer: [],
+ DataTransferItemList: [],
+ DataTransferItem: [],
+ DragEvent: [],
+ NavigatorUserMediaError: [],
+ MediaStream: [],
+ LocalMediaStream: [],
+ MediaStreamTrack: [],
+ MediaStreamRecorder: [],
+ PeerConnection: [],
+ MediaStreamEvent: [],
+ ErrorEvent: [],
+ WebSocket: ['new WebSocket("ws://foo")'],
+ CloseEvent: ['new CloseEvent("close")'],
+ AbstractWorker: [],
+ Worker: [],
+ SharedWorker: [],
+ MessageEvent: [],
+ MessageChannel: [],
+ MessagePort: [],
+ HTMLAppletElement: ['document.createElement("applet")'],
+ HTMLMarqueeElement: ['document.createElement("marquee")'],
+ HTMLFrameSetElement: ['document.createElement("frameset")'],
+ HTMLFrameElement: ['document.createElement("frame")'],
+ HTMLDirectoryElement: ['document.createElement("dir")'],
+ HTMLFontElement: ['document.createElement("font")'],
+ });
+ idlArray.prevent_multiple_testing("HTMLElement");
+ idlArray.test();
+ done();
+};
+</script>
diff --git a/testing/web-platform/tests/html/dom/new-harness.js b/testing/web-platform/tests/html/dom/new-harness.js
new file mode 100644
index 000000000..f7481996e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/new-harness.js
@@ -0,0 +1,22 @@
+// We override only the things we need to -- the rest we'll just inherit from
+// original-harness.js. Polymorphism, kind of.
+ReflectionHarness.catchUnexpectedExceptions = false;
+
+ReflectionHarness.test = function(expected, actual, description) {
+ test(function() {
+ assert_equals(expected, actual);
+ }, this.getTypeDescription() + ": " + description);
+ // This is the test suite that will rate conformance, so we don't want to
+ // bail out early if a test fails -- we want all tests to always run.
+ return true;
+}
+
+ReflectionHarness.run = function(fun, description) {
+ test(fun, this.getTypeDescription() + ": " + description);
+}
+
+ReflectionHarness.testException = function(exceptionName, fn, description) {
+ test(function() {
+ assert_throws(exceptionName, fn);
+ }, this.getTypeDescription() + ": " + description);
+}
diff --git a/testing/web-platform/tests/html/dom/original-harness.js b/testing/web-platform/tests/html/dom/original-harness.js
new file mode 100644
index 000000000..3cfa05bcb
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/original-harness.js
@@ -0,0 +1,332 @@
+var ReflectionHarness = {};
+
+// @private
+ReflectionHarness.passed = document.getElementById("passed");
+ReflectionHarness.failed = document.getElementById("failed");
+
+/**
+ * Should we report a failure for unexpected exceptions, or just rethrow them?
+ * The original test framework reports an exception, but testharness.js doesn't
+ * want that.
+ *
+ * @public
+ */
+ReflectionHarness.catchUnexpectedExceptions = true;
+
+/**
+ * Returns a string representing val. Basically just adds quotes for strings,
+ * and passes through other recognized types literally.
+ *
+ * @public
+ */
+ReflectionHarness.stringRep = function(val) {
+ if (val === null) {
+ // typeof is object, so the switch isn't useful
+ return "null";
+ }
+ // In JavaScript, -0 === 0 and String(-0) == "0", so we have to
+ // special-case.
+ if (val === -0 && 1/val === -Infinity) {
+ return "-0";
+ }
+ switch (typeof val) {
+ case "string":
+ for (var i = 0; i < 32; i++) {
+ var replace = "\\";
+ switch (i) {
+ case 0: replace += "0"; break;
+ case 1: replace += "x01"; break;
+ case 2: replace += "x02"; break;
+ case 3: replace += "x03"; break;
+ case 4: replace += "x04"; break;
+ case 5: replace += "x05"; break;
+ case 6: replace += "x06"; break;
+ case 7: replace += "x07"; break;
+ case 8: replace += "b"; break;
+ case 9: replace += "t"; break;
+ case 10: replace += "n"; break;
+ case 11: replace += "v"; break;
+ case 12: replace += "f"; break;
+ case 13: replace += "r"; break;
+ case 14: replace += "x0e"; break;
+ case 15: replace += "x0f"; break;
+ case 16: replace += "x10"; break;
+ case 17: replace += "x11"; break;
+ case 18: replace += "x12"; break;
+ case 19: replace += "x13"; break;
+ case 20: replace += "x14"; break;
+ case 21: replace += "x15"; break;
+ case 22: replace += "x16"; break;
+ case 23: replace += "x17"; break;
+ case 24: replace += "x18"; break;
+ case 25: replace += "x19"; break;
+ case 26: replace += "x1a"; break;
+ case 27: replace += "x1b"; break;
+ case 28: replace += "x1c"; break;
+ case 29: replace += "x1d"; break;
+ case 30: replace += "x1e"; break;
+ case 31: replace += "x1f"; break;
+ }
+ val = val.replace(String.fromCharCode(i), replace);
+ }
+ return '"' + val.replace('"', '\\"') + '"';
+ case "boolean":
+ case "undefined":
+ case "number":
+ return val + "";
+ default:
+ return typeof val + ' "' + val + '"';
+ }
+}
+
+/**
+ * An object representing info about the current test, used for printing out
+ * nice messages and so forth.
+ */
+ReflectionHarness.currentTestInfo = {};
+
+/**
+ * This is called when we want to test a single element/attribute combination.
+ * For the original harness, it does nothing special (just calls the function),
+ * but for testharness.js, it can wrap everything in a test() call.
+ */
+ReflectionHarness.testWrapper = function(fn) {
+ fn();
+}
+
+/**
+ * If question === answer, output a success, else report a failure with the
+ * given description. Currently success and failure both increment counters,
+ * and failures output a message to a <ul>. Which <ul> is decided by the type
+ * parameter -- different attribute types are separated for readability.
+ *
+ * @public
+ */
+ReflectionHarness.test = function(expected, actual, description) {
+ // Special-case -0 yay!
+ if (expected === 0 && actual === 0 && 1/expected === 1/actual) {
+ this.increment(this.passed);
+ return true;
+ } else if (expected === actual) {
+ this.increment(this.passed);
+ return true;
+ } else {
+ this.increment(this.failed);
+ this.reportFailure(description + ' (expected ' + this.stringRep(actual) + ', got ' + this.stringRep(expected) + ')');
+ return false;
+ }
+}
+
+ReflectionHarness.run = function(fun, description) {
+ try {
+ fun();
+ } catch (err) {
+ ReflectionHarness.failure(description);
+ }
+}
+
+/**
+ * If calling fn causes a DOMException of the type given by the string
+ * exceptionName (e.g., "INDEX_SIZE_ERR"), output a success. Otherwise, report
+ * a failure with the given description.
+ *
+ * @public
+ */
+ReflectionHarness.testException = function(exceptionName, fn, description) {
+ try {
+ fn();
+ } catch (e) {
+ if (e instanceof DOMException && e.code == DOMException[exceptionName]) {
+ this.increment(this.passed);
+ return true;
+ }
+ }
+ this.increment(this.failed);
+ this.reportFailure(description);
+ return false;
+}
+
+/**
+ * Get a description of the current type, e.g., "a.href".
+ */
+ReflectionHarness.getTypeDescription = function() {
+ var domNode = this.currentTestInfo.domObj.tagName.toLowerCase();
+ var idlNode = this.currentTestInfo.idlObj.nodeName.toLowerCase();
+ var domName = this.currentTestInfo.domName;
+ var idlName = this.currentTestInfo.idlName;
+ var comment = this.currentTestInfo.data.comment;
+ var typeDesc = idlNode + "." + idlName;
+ if (!comment && (domNode != idlNode || domName != idlName)) {
+ comment = "<" + domNode + " " + domName + ">";
+ }
+ if (comment) {
+ typeDesc += " (" + comment + ")";
+ }
+ return typeDesc;
+}
+
+/**
+ * Report a failure with the given description, adding context from the
+ * currentTestInfo member.
+ *
+ * @private
+ */
+ReflectionHarness.reportFailure = function(description) {
+ var typeDesc = this.getTypeDescription();
+ var idlName = this.currentTestInfo.idlName;
+ var comment = this.currentTestInfo.data.comment;
+ typeDesc = typeDesc.replace("&", "&amp;").replace("<", "&lt;");
+ description = description.replace("&", "&amp;").replace("<", "&lt;");
+
+ var type = this.currentTestInfo.data.type;
+
+ // Special case for undefined attributes, which we don't want getting in
+ // the way of everything else.
+ if (description.search('^typeof IDL attribute \\(expected ".*", got "undefined"\\)$') != -1) {
+ type = "undefined";
+ }
+
+ var done = false;
+ var ul = document.getElementById("errors-" + type.replace(" ", "-"));
+ if (ul === null) {
+ ul = document.createElement("ul");
+ ul.id = "errors-" + type.replace(" ", "-");
+ var div = document.getElementById("errors");
+ p = document.createElement("p");
+ if (type == "undefined") {
+ div.parentNode.insertBefore(ul, div.nextSibling);
+ p.innerHTML = "These IDL attributes were of undefined type, presumably representing unimplemented features (cordoned off into a separate section for tidiness):";
+ } else {
+ div.appendChild(ul);
+ p.innerHTML = "Errors for type " + type + ":";
+ }
+ ul.parentNode.insertBefore(p, ul);
+ } else if (type != "undefined") {
+ var existingErrors = ul.getElementsByClassName("desc");
+ for (var i = 0; i < existingErrors.length; i++) {
+ if (existingErrors[i].innerHTML == description) {
+ var typeSpan = existingErrors[i].parentNode.getElementsByClassName("type")[0];
+ // Check if we have lots of the same error for the same
+ // attribute. If so, we want to collapse them -- the exact
+ // elements that exhibit the error aren't going to be important
+ // to report in this case, and it can take a lot of space if
+ // there's an error in a global attribute like dir or id.
+ var types = typeSpan.innerHTML.split(", ");
+ var count = 0;
+ for (var i = 0; i < types.length; i++) {
+ if (types[i].search("^\\([0-9]* elements\\)\\." + idlName + "$") != -1) {
+ types[i] = "(" + (1 + parseInt(/[0-9]+/.exec(types[i])[0])) + " elements)." + idlName;
+ typeSpan.innerHTML = types.join(", ");
+ return;
+ } else if (types[i].search("\\." + idlName + "$") != -1) {
+ count++;
+ }
+ }
+ if (comment || count < 10) {
+ // Just add the extra error to the end, not many duplicates
+ // (or we have a comment)
+ typeSpan.innerHTML += ", " + typeDesc;
+ } else {
+ var filteredTypes = types.filter(function(type) { return type.search("\\." + idlName + "$") == -1; });
+ if (filteredTypes.length) {
+ typeSpan.innerHTML = filteredTypes.join(", ") + ", ";
+ } else {
+ typeSpan.innerHTML = "";
+ }
+ typeSpan.innerHTML += "(" + (types.length - filteredTypes.length) + " elements)." + idlName;
+ }
+ return;
+ }
+ }
+ }
+
+ if (type == "undefined") {
+ ul.innerHTML += "<li>" + typeDesc;
+ } else {
+ ul.innerHTML += "<li><span class=\"type\">" + typeDesc + "</span>: <span class=\"desc\">" + description + "</span>";
+ }
+}
+
+/**
+ * Shorthand function for when we have a failure outside of test(). Generally
+ * used when the failure is an exception thrown unexpectedly or such, something
+ * not equality-based.
+ *
+ * @public
+ */
+ReflectionHarness.failure = function(message) {
+ this.increment(this.failed);
+ this.reportFailure(message);
+}
+
+/**
+ * Shorthand function for when we have a success outside of test(). Only
+ * called if catchUnexpectedExceptions is true.
+ *
+ * @public
+ */
+ReflectionHarness.success = function() {
+ this.increment(this.passed);
+}
+
+/**
+ * Increment the count in either "passed" or "failed". el should always be one
+ * of those two variables. The implementation of this function amuses me.
+ *
+ * @private
+ */
+ReflectionHarness.increment = function(el) {
+ el.innerHTML = parseInt(el.innerHTML) + 1;
+ var percent = document.getElementById("percent");
+ var passed = document.getElementById("passed");
+ var failed = document.getElementById("failed");
+ percent.innerHTML = (parseInt(passed.innerHTML)/(parseInt(passed.innerHTML) + parseInt(failed.innerHTML))*100).toPrecision(3);
+}
+
+/**
+ * Hide all displayed errors matching a given regex, so it's easier to filter
+ * out repetitive failures. TODO: Fix this so it works right with the new
+ * "lump many errors in one <li>" thing.
+ *
+ * @private (kind of, only called in the original reflection.html)
+ */
+ReflectionHarness.maskErrors = function(regex) {
+ var uls = document.getElementsByTagName("ul");
+ for (var i = 0; i < uls.length; i++) {
+ var lis = uls[i].children;
+ for (var j = 0; j < lis.length; j++) {
+ if (regex !== "" && lis[j].innerHTML.match(regex)) {
+ lis[j].style.display = "none";
+ } else {
+ lis[j].style.display = "list-item";
+ }
+ }
+ }
+}
+
+// Now for some stuff that has nothing to do with ReflectionHarness and
+// everything to do with initialization needed for reflection.js, which seems
+// pointless to put in an extra file.
+
+var elements = {};
+
+var extraTests = [];
+
+/**
+ * Used for combining a number of small arrays of element data into one big
+ * one.
+ */
+function mergeElements(src) {
+ for (var key in src) {
+ if (!src.hasOwnProperty(key)) {
+ // This is inherited from a prototype or something.
+ continue;
+ }
+
+ if (key in elements) {
+ elements[key] = elements[key].concat(src[key]);
+ } else {
+ elements[key] = src[key];
+ }
+ }
+}
diff --git a/testing/web-platform/tests/html/dom/reflection-embedded.html b/testing/web-platform/tests/html/dom/reflection-embedded.html
new file mode 100644
index 000000000..0a362f817
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/reflection-embedded.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>HTML5 reflection tests: embedded elements</title>
+<meta name=timeout content=long>
+<p>Implementers looking to fix bugs might want to use the <a
+href=reflection-original.html>original version</a> of this suite's test
+framework, which conveniently aggregates similar errors and only reports
+failures. This file is (part of) the authoritative conformance test suite, and
+is suitable for incorporation into automated test suites.
+
+<div id=log></div>
+
+<script src="/resources/testharness.js"></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=original-harness.js></script>
+<script src=new-harness.js></script>
+<script src=elements-embedded.js></script>
+<script src=reflection.js></script>
diff --git a/testing/web-platform/tests/html/dom/reflection-forms.html b/testing/web-platform/tests/html/dom/reflection-forms.html
new file mode 100644
index 000000000..2fe251a6f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/reflection-forms.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>HTML5 reflection tests: form elements</title>
+<meta name=timeout content=long>
+<p>Implementers looking to fix bugs might want to use the <a
+href=reflection-original.html>original version</a> of this suite's test
+framework, which conveniently aggregates similar errors and only reports
+failures. This file is (part of) the authoritative conformance test suite, and
+is suitable for incorporation into automated test suites.
+
+<div id=log></div>
+
+<script src="/resources/testharness.js"></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=original-harness.js></script>
+<script src=new-harness.js></script>
+<script src=elements-forms.js></script>
+<script src=reflection.js></script>
diff --git a/testing/web-platform/tests/html/dom/reflection-grouping.html b/testing/web-platform/tests/html/dom/reflection-grouping.html
new file mode 100644
index 000000000..e59f5f569
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/reflection-grouping.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>HTML5 reflection tests: grouping elements</title>
+<meta name=timeout content=long>
+<p>Implementers looking to fix bugs might want to use the <a
+href=reflection-original.html>original version</a> of this suite's test
+framework, which conveniently aggregates similar errors and only reports
+failures. This file is (part of) the authoritative conformance test suite, and
+is suitable for incorporation into automated test suites.
+
+<div id=log></div>
+
+<script src="/resources/testharness.js"></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=original-harness.js></script>
+<script src=new-harness.js></script>
+<script src=elements-grouping.js></script>
+<script src=reflection.js></script>
diff --git a/testing/web-platform/tests/html/dom/reflection-metadata.html b/testing/web-platform/tests/html/dom/reflection-metadata.html
new file mode 100644
index 000000000..f21b6863e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/reflection-metadata.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>HTML5 reflection tests: metadata elements</title>
+<meta name=timeout content=long>
+<p>Implementers looking to fix bugs might want to use the <a
+href=reflection-original.html>original version</a> of this suite's test
+framework, which conveniently aggregates similar errors and only reports
+failures. This file is (part of) the authoritative conformance test suite, and
+is suitable for incorporation into automated test suites.
+
+<div id=log></div>
+
+<script src="/resources/testharness.js"></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=original-harness.js></script>
+<script src=new-harness.js></script>
+<script src=elements-metadata.js></script>
+<script src=reflection.js></script>
diff --git a/testing/web-platform/tests/html/dom/reflection-misc.html b/testing/web-platform/tests/html/dom/reflection-misc.html
new file mode 100644
index 000000000..915f6fad4
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/reflection-misc.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>HTML5 reflection tests: miscellaneous elements</title>
+<meta name=timeout content=long>
+<p>Implementers looking to fix bugs might want to use the <a
+href=reflection-original.html>original version</a> of this suite's test
+framework, which conveniently aggregates similar errors and only reports
+failures. This file is (part of) the authoritative conformance test suite, and
+is suitable for incorporation into automated test suites.
+
+<div id=log></div>
+
+<script src="/resources/testharness.js"></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=original-harness.js></script>
+<script src=new-harness.js></script>
+<script src=elements-misc.js></script>
+<script src=reflection.js></script>
diff --git a/testing/web-platform/tests/html/dom/reflection-obsolete.html b/testing/web-platform/tests/html/dom/reflection-obsolete.html
new file mode 100644
index 000000000..0aa439813
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/reflection-obsolete.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>HTML5 reflection tests: obsolete elements</title>
+<meta name=timeout content=long>
+<p>Implementers looking to fix bugs might want to use the <a
+href=reflection-original.html>original version</a> of this suite's test
+framework, which conveniently aggregates similar errors and only reports
+failures. This file is (part of) the authoritative conformance test suite, and
+is suitable for incorporation into automated test suites.
+
+<div id=log></div>
+
+<script src="/resources/testharness.js"></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=original-harness.js></script>
+<script src=new-harness.js></script>
+<script src=elements-obsolete.js></script>
+<script src=reflection.js></script>
diff --git a/testing/web-platform/tests/html/dom/reflection-original.html b/testing/web-platform/tests/html/dom/reflection-original.html
new file mode 100644
index 000000000..0f7b43e37
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/reflection-original.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<title>HTML5 reflection tests</title>
+<meta name=timeout content=long>
+<p>This is <em>not</em> the authoritative conformance test suite for
+reflection. The authoritative tests can be found here, split up into sections:
+
+<ul>
+ <li><a href=reflection-metadata.html>Metadata elements</a>
+ <li><a href=reflection-sections.html>Section elements</a>
+ <li><a href=reflection-grouping.html>Grouping elements</a>
+ <li><a href=reflection-text.html>Text elements</a>
+ <li><a href=reflection-embedded.html>Embedded elements</a>
+ <li><a href=reflection-tabular.html>Tabular elements</a>
+ <li><a href=reflection-forms.html>Form elements</a>
+ <li><a href=reflection-misc.html>Miscellaneous elements</a>
+ <li><a href=reflection-obsolete.html>Obsolete elements</a>
+</ul>
+
+<p>This test suite is provided for implementers' convenience in debugging
+failures. It groups similar failures in a fashion that should help fix them.
+It is not intended to be suitable for incorporation into automated testing
+frameworks.
+
+<p>Filter out errors matching a regex (operates on HTML not text, you have to manually escape entities): <input oninput="maskErrors(this.value)">
+
+<p>Passed: <span id=passed>0</span> (<span id=percent></span>%). Failed: <span id=failed>0</span>. Time to complete: <span id=time>0</span> s.
+
+<div id=errors></div>
+
+<script src=original-harness.js></script>
+<script src=elements-metadata.js></script>
+<script src=elements-sections.js></script>
+<script src=elements-grouping.js></script>
+<script src=elements-text.js></script>
+<script src=elements-embedded.js></script>
+<script src=elements-tabular.js></script>
+<script src=elements-forms.js></script>
+<script src=elements-misc.js></script>
+<script src=elements-obsolete.js></script>
+<script src=reflection.js></script>
diff --git a/testing/web-platform/tests/html/dom/reflection-sections.html b/testing/web-platform/tests/html/dom/reflection-sections.html
new file mode 100644
index 000000000..223566541
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/reflection-sections.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>HTML5 reflection tests: section elements</title>
+<meta name=timeout content=long>
+<p>Implementers looking to fix bugs might want to use the <a
+href=reflection-original.html>original version</a> of this suite's test
+framework, which conveniently aggregates similar errors and only reports
+failures. This file is (part of) the authoritative conformance test suite, and
+is suitable for incorporation into automated test suites.
+
+<div id=log></div>
+
+<script src="/resources/testharness.js"></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=original-harness.js></script>
+<script src=new-harness.js></script>
+<script src=elements-sections.js></script>
+<script src=reflection.js></script>
diff --git a/testing/web-platform/tests/html/dom/reflection-tabular.html b/testing/web-platform/tests/html/dom/reflection-tabular.html
new file mode 100644
index 000000000..f790da253
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/reflection-tabular.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>HTML5 reflection tests: tabular elements</title>
+<meta name=timeout content=long>
+<p>Implementers looking to fix bugs might want to use the <a
+href=reflection-original.html>original version</a> of this suite's test
+framework, which conveniently aggregates similar errors and only reports
+failures. This file is (part of) the authoritative conformance test suite, and
+is suitable for incorporation into automated test suites.
+
+<div id=log></div>
+
+<script src="/resources/testharness.js"></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=original-harness.js></script>
+<script src=new-harness.js></script>
+<script src=elements-tabular.js></script>
+<script src=reflection.js></script>
diff --git a/testing/web-platform/tests/html/dom/reflection-text.html b/testing/web-platform/tests/html/dom/reflection-text.html
new file mode 100644
index 000000000..a2dc6f615
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/reflection-text.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>HTML5 reflection tests: text elements</title>
+<meta name=timeout content=long>
+<p>Implementers looking to fix bugs might want to use the <a
+href=reflection-original.html>original version</a> of this suite's test
+framework, which conveniently aggregates similar errors and only reports
+failures. This file is (part of) the authoritative conformance test suite, and
+is suitable for incorporation into automated test suites.
+
+<div id=log></div>
+
+<script src="/resources/testharness.js"></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=original-harness.js></script>
+<script src=new-harness.js></script>
+<script src=elements-text.js></script>
+<script src=reflection.js></script>
diff --git a/testing/web-platform/tests/html/dom/reflection.js b/testing/web-platform/tests/html/dom/reflection.js
new file mode 100644
index 000000000..72ed01ef7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/reflection.js
@@ -0,0 +1,824 @@
+ReflectionTests = {};
+
+ReflectionTests.start = new Date().getTime();
+
+/**
+ * Resolve the given URL to an absolute URL, relative to the current document's
+ * address. There's no API that I know of that exposes this directly, so we
+ * actually just create an <a> element, set its href, and stitch together the
+ * various properties. Seems to work. We don't try to reimplement the
+ * algorithm here, because we're not concerned with its correctness -- we're
+ * only testing HTML reflection, not Web Addresses.
+ *
+ * Return the input if the URL couldn't be resolved, per the spec for
+ * reflected URL attributes.
+ *
+ * It seems like IE9 doesn't implement URL decomposition attributes correctly
+ * for <a>, which causes all these tests to fail. Ideally I'd do this in some
+ * other way, but the failure does stem from an incorrect implementation of
+ * HTML, so I'll leave it alone for now.
+ *
+ * TODO: This relies on reflection to test reflection, so it could mask bugs.
+ * Either get a JS implementation of the "resolve a URL" algorithm, or just
+ * specify expected values manually here. It shouldn't be too hard to write
+ * special cases for all the values we test.
+ */
+ReflectionTests.resolveUrl = function(url) {
+ url = String(url);
+ var el = document.createElement("a");
+ el.href = url;
+ var ret = el.protocol + "//" + el.host + el.pathname + el.search + el.hash;
+ if (ret == "//") {
+ return url;
+ } else {
+ return ret;
+ }
+};
+
+/**
+ * The "rules for parsing non-negative integers" from the HTML spec. They're
+ * mostly used for reflection, so here seems like as good a place to test them
+ * as any. Returns false on error.
+ */
+ReflectionTests.parseNonneg = function(input) {
+ var value = this.parseInt(input);
+ if (value === false || value < 0) {
+ return false;
+ }
+ return value;
+};
+
+/**
+ * The "rules for parsing integers" from the HTML spec. Returns false on
+ * error.
+ */
+ReflectionTests.parseInt = function(input) {
+ var position = 0;
+ var sign = 1;
+ // Skip whitespace
+ while (input.length > position && /^[ \t\n\f\r]$/.test(input[position])) {
+ position++;
+ }
+ if (position >= input.length) {
+ return false;
+ }
+ if (input[position] == "-") {
+ sign = -1;
+ position++;
+ } else if (input[position] == "+") {
+ position++;
+ }
+ if (position >= input.length) {
+ return false;
+ }
+ if (!/^[0-9]$/.test(input[position])) {
+ return false;
+ }
+ var value = 0;
+ while (input.length > position && /^[0-9]$/.test(input[position])) {
+ value *= 10;
+ // Don't use parseInt even for single-digit strings . . .
+ value += input.charCodeAt(position) - "0".charCodeAt(0);
+ position++;
+ }
+ if (value === 0) {
+ return 0;
+ }
+ return sign * value;
+};
+
+// Used in initializing typeMap
+var binaryString = "\x00\x01\x02\x03\x04\x05\x06\x07 "
+ + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f "
+ + "\x10\x11\x12\x13\x14\x15\x16\x17 "
+ + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f ";
+var maxInt = 2147483647;
+var minInt = -2147483648;
+var maxUnsigned = 4294967295;
+
+/**
+ * Array containing the tests and other information for each type of reflected
+ * attribute. Meaning of keys:
+ *
+ * "jsType": What typeof idlObj[idlName] is supposed to be.
+ * "defaultVal": The default value to be returned if the attribute is not
+ * present and no default is specifically set for this attribute.
+ * "domTests": What values to test with setAttribute().
+ * "domExpected": What values to expect with IDL get after setAttribute().
+ * Defaults to the same as domTests.
+ * "idlTests": What values to test with IDL set. Defaults to domTests.
+ * "idlDomExpected": What to expect from getAttribute() after IDL set.
+ * Defaults to idlTests.
+ * "idlIdlExpected": What to expect from IDL get after IDL set. Defaults to
+ * idlDomExpected.
+ *
+ * Note that all tests/expected values are only baselines, and can be expanded
+ * with additional tests hardcoded into the function for particular types if
+ * necessary. For example, a special codepath is used for enums, and for
+ * IDL setters which throw an exception. null means "defaultVal" is the
+ * expected value. Expected DOM values are cast to strings by adding "".
+ *
+ * TODO: Test strings that aren't valid UTF-16. Desired behavior is not clear
+ * here at the time of writing, see
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=12100
+ *
+ * TODO: Test deleting an IDL attribute, and maybe doing other fun stuff to it.
+ *
+ * TODO: Test IDL sets of integer types to out-of-range or other weird values.
+ * WebIDL says to wrap, but I'm not sure offhand if that's what we want.
+ *
+ * TODO: tokenlist, settable tokenlist, limited
+ */
+
+
+ReflectionTests.typeMap = {
+ /**
+ * "If a reflecting IDL attribute is a DOMString but doesn't fall into any
+ * of the above categories, then the getting and setting must be done in a
+ * transparent, case-preserving manner."
+ *
+ * The data object passed to reflects() can contain an optional key
+ * treatNullAsEmptyString, whose value is ignored. If it does contain the
+ * key, null will be cast to "" instead of "null", per WebIDL
+ * [TreatNullAs=EmptyString].
+ */
+ "string": {
+ "jsType": "string",
+ "defaultVal": "",
+ "domTests": ["", " " + binaryString + " foo ", undefined, 7, 1.5, true,
+ false, {"test": 6}, NaN, +Infinity, -Infinity, "\0", null,
+ {"toString":function(){return "test-toString";}},
+ {"valueOf":function(){return "test-valueOf";}, toString:null}
+ ]
+ },
+ /**
+ * "If a reflecting IDL attribute is a USVString attribute whose content
+ * attribute is defined to contain a URL, then on getting, if the content
+ * attribute is absent, the IDL attribute must return the empty string.
+ * Otherwise, the IDL attribute must parse the value of the content
+ * attribute relative to the element's node document and if that is
+ * successful, return the resulting URL string. If parsing fails, then the
+ * value of the content attribute must be returned instead, converted to a
+ * USVString. On setting, the content attribute must be set to the specified
+ * new value."
+ *
+ * Also HTMLHyperLinkElementUtils href, used by a.href and area.href
+ */
+ "url": {
+ "jsType": "string",
+ "defaultVal": "",
+ "domTests": ["", " foo ", "http://site.example/",
+ "//site.example/path???@#l", binaryString, undefined, 7, 1.5, true,
+ false, {"test": 6}, NaN, +Infinity, -Infinity, "\0", null,
+ {"toString":function(){return "test-toString";}},
+ {"valueOf":function(){return "test-valueOf";}, toString:null}],
+ "domExpected": ReflectionTests.resolveUrl,
+ "idlIdlExpected": ReflectionTests.resolveUrl
+ },
+ /**
+ * "If a reflecting IDL attribute is a DOMString whose content attribute is
+ * an enumerated attribute, and the IDL attribute is limited to only known
+ * values, then, on getting, the IDL attribute must return the conforming
+ * value associated with the state the attribute is in (in its canonical
+ * case), or the empty string if the attribute is in a state that has no
+ * associated keyword value; and on setting, if the new value is an ASCII
+ * case-insensitive match for one of the keywords given for that attribute,
+ * then the content attribute must be set to the conforming value
+ * associated with the state that the attribute would be in if set to the
+ * given new value, otherwise, if the new value is the empty string, then
+ * the content attribute must be removed, otherwise, the content attribute
+ * must be set to the given new value."
+ *
+ * "Some attributes are defined as taking one of a finite set of keywords.
+ * Such attributes are called enumerated attributes. The keywords are each
+ * defined to map to a particular state (several keywords might map to the
+ * same state, in which case some of the keywords are synonyms of each
+ * other; additionally, some of the keywords can be said to be
+ * non-conforming, and are only in the specification for historical
+ * reasons). In addition, two default states can be given. The first is the
+ * invalid value default, the second is the missing value default.
+ *
+ * . . .
+ *
+ * When the attribute is specified, if its value is an ASCII
+ * case-insensitive match for one of the given keywords then that keyword's
+ * state is the state that the attribute represents. If the attribute value
+ * matches none of the given keywords, but the attribute has an invalid
+ * value default, then the attribute represents that state. Otherwise, if
+ * the attribute value matches none of the keywords but there is a missing
+ * value default state defined, then that is the state represented by the
+ * attribute. Otherwise, there is no default, and invalid values must be
+ * ignored.
+ *
+ * When the attribute is not specified, if there is a missing value default
+ * state defined, then that is the state represented by the (missing)
+ * attribute. Otherwise, the absence of the attribute means that there is
+ * no state represented."
+ *
+ * This is only used for enums that are limited to known values, not other
+ * enums (those are treated as generic strings by the spec). The data
+ * object passed to reflects() can contain these keys:
+ *
+ * "defaultVal": missing value default (defaults to "")
+ * "invalidVal": invalid value default (defaults to defaultVal)
+ * "keywords": array of keywords as given by the spec (required)
+ * "nonCanon": dictionary mapping non-canonical values to their
+ * canonical equivalents (defaults to {})
+ * "isNullable": Indicates if attribute is nullable (defaults to false)
+ *
+ * Tests are mostly hardcoded into reflects(), since they depend on the
+ * keywords. All expected values are computed in reflects() using a helper
+ * function.
+ */
+ "enum": {
+ "jsType": "string",
+ "defaultVal": "",
+ "domTests": ["", " " + binaryString + " foo ", undefined, 7, 1.5, true,
+ false, {"test": 6}, NaN, +Infinity, -Infinity, "\0", null,
+ {"toString":function(){return "test-toString";}},
+ {"valueOf":function(){return "test-valueOf";}, toString:null}]
+ },
+ /**
+ * "If a reflecting IDL attribute is a boolean attribute, then on getting
+ * the IDL attribute must return true if the content attribute is set, and
+ * false if it is absent. On setting, the content attribute must be removed
+ * if the IDL attribute is set to false, and must be set to the empty
+ * string if the IDL attribute is set to true. (This corresponds to the
+ * rules for boolean content attributes.)"
+ */
+ "boolean": {
+ "jsType": "boolean",
+ "defaultVal": false,
+ "domTests": ["", " foo ", undefined, null, 7, 1.5, true, false,
+ {"test": 6}, NaN, +Infinity, -Infinity, "\0",
+ {"toString":function(){return "test-toString";}},
+ {"valueOf":function(){return "test-valueOf";}, toString:null}],
+ "domExpected": function(val) {
+ return true;
+ }
+ },
+ /**
+ * "If a reflecting IDL attribute is a signed integer type (long) then, on
+ * getting, the content attribute must be parsed according to the rules for
+ * parsing signed integers, and if that is successful, and the value is in
+ * the range of the IDL attribute's type, the resulting value must be
+ * returned. If, on the other hand, it fails or returns an out of range
+ * value, or if the attribute is absent, then the default value must be
+ * returned instead, or 0 if there is no default value. On setting, the
+ * given value must be converted to the shortest possible string
+ * representing the number as a valid integer and then that string must be
+ * used as the new content attribute value."
+ */
+ "long": {
+ "jsType": "number",
+ "defaultVal": 0,
+ "domTests": [-36, -1, 0, 1, maxInt, minInt, maxInt + 1, minInt - 1,
+ maxUnsigned, maxUnsigned + 1, "", "-1", "-0", "0", "1",
+ " " + binaryString + " foo ",
+ // Test various different whitespace. Only 20, 9, A, C,
+ // and D are whitespace.
+ "\u00097", "\u000B7", "\u000C7", "\u00207", "\u00A07", "\uFEFF7",
+ "\u000A7", "\u000D7", "\u20287", "\u20297", "\u16807", "\u180E7",
+ "\u20007", "\u20017", "\u20027", "\u20037", "\u20047", "\u20057",
+ "\u20067", "\u20077", "\u20087", "\u20097", "\u200A7", "\u202F7",
+ "\u30007",
+ undefined, 1.5, true, false, {"test": 6}, NaN, +Infinity,
+ -Infinity, "\0",
+ {toString:function() {return 2;}, valueOf: null},
+ {valueOf:function() {return 3;}}],
+ "domExpected": function(val) {
+ var parsed = ReflectionTests.parseInt(String(val));
+ if (parsed === false || parsed > maxInt || parsed < minInt) {
+ return null;
+ }
+ return parsed;
+ },
+ "idlTests": [-36, -1, 0, 1, 2147483647, -2147483648],
+ "idlDomExpected": [-36, -1, 0, 1, 2147483647, -2147483648]
+ },
+ /**
+ * "If a reflecting IDL attribute is a signed integer type (long) that is
+ * limited to only non-negative numbers then, on getting, the content
+ * attribute must be parsed according to the rules for parsing non-negative
+ * integers, and if that is successful, and the value is in the range of
+ * the IDL attribute's type, the resulting value must be returned. If, on
+ * the other hand, it fails or returns an out of range value, or if the
+ * attribute is absent, the default value must be returned instead, or −1
+ * if there is no default value. On setting, if the value is negative, the
+ * user agent must fire an INDEX_SIZE_ERR exception. Otherwise, the given
+ * value must be converted to the shortest possible string representing the
+ * number as a valid non-negative integer and then that string must be used
+ * as the new content attribute value."
+ */
+ "limited long": {
+ "jsType": "number",
+ "defaultVal": -1,
+ "domTests": [minInt - 1, minInt, -36, -1, -0, 0, 1, maxInt, maxInt + 1,
+ maxUnsigned, maxUnsigned + 1, "", "-1", "-0", "0", "1",
+ " " + binaryString + " foo ",
+ "\u00097", "\u000B7", "\u000C7", "\u00207", "\u00A07", "\uFEFF7",
+ "\u000A7", "\u000D7", "\u20287", "\u20297", "\u16807", "\u180E7",
+ "\u20007", "\u20017", "\u20027", "\u20037", "\u20047", "\u20057",
+ "\u20067", "\u20077", "\u20087", "\u20097", "\u200A7", "\u202F7",
+ "\u30007",
+ undefined, 1.5, true, false, {"test": 6}, NaN, +Infinity,
+ -Infinity, "\0",
+ {toString:function() {return 2;}, valueOf: null},
+ {valueOf:function() {return 3;}}],
+ "domExpected": function(val) {
+ var parsed = ReflectionTests.parseNonneg(String(val));
+ if (parsed === false || parsed > maxInt || parsed < minInt) {
+ return null;
+ }
+ return parsed;
+ },
+ "idlTests": [minInt, -36, -1, 0, 1, maxInt],
+ "idlDomExpected": [null/*exception*/, null/*exception*/, null/*exception*/, 0, 1, maxInt]
+ },
+ /**
+ * "If a reflecting IDL attribute is an unsigned integer type (unsigned
+ * long) then, on getting, the content attribute must be parsed according
+ * to the rules for parsing non-negative integers, and if that is
+ * successful, and the value is in the range 0 to 2147483647 inclusive, the
+ * resulting value must be returned. If, on the other hand, it fails or
+ * returns an out of range value, or if the attribute is absent, the
+ * default value must be returned instead, or 0 if there is no default
+ * value. On setting, the given value must be converted to the shortest
+ * possible string representing the number as a valid non-negative integer
+ * and then that string must be used as the new content attribute value."
+ */
+ "unsigned long": {
+ "jsType": "number",
+ "defaultVal": 0,
+ "domTests": [minInt - 1, minInt, -36, -1, 0, 1, 257, maxInt,
+ maxInt + 1, maxUnsigned, maxUnsigned + 1, "", "-1", "-0", "0", "1",
+ "\u00097", "\u000B7", "\u000C7", "\u00207", "\u00A07", "\uFEFF7",
+ "\u000A7", "\u000D7", "\u20287", "\u20297", "\u16807", "\u180E7",
+ "\u20007", "\u20017", "\u20027", "\u20037", "\u20047", "\u20057",
+ "\u20067", "\u20077", "\u20087", "\u20097", "\u200A7", "\u202F7",
+ "\u30007",
+ " " + binaryString + " foo ", undefined, 1.5, true, false,
+ {"test": 6}, NaN, +Infinity, -Infinity, "\0",
+ {toString:function() {return 2;}, valueOf: null},
+ {valueOf:function() {return 3;}}],
+ "domExpected": function(val) {
+ var parsed = ReflectionTests.parseNonneg(String(val));
+ // Note maxInt, not maxUnsigned.
+ if (parsed === false || parsed < 0 || parsed > maxInt) {
+ return null;
+ }
+ return parsed;
+ },
+ "idlTests": [0, 1, 257, maxInt, "-0", maxInt + 1, maxUnsigned],
+ "idlIdlExpected": [0, 1, 257, maxInt, 0, null, null],
+ "idlDomExpected": [0, 1, 257, maxInt, 0, null, null],
+ },
+ /**
+ * "If a reflecting IDL attribute is an unsigned integer type (unsigned
+ * long) that is limited to only non-negative numbers greater than zero,
+ * then the behavior is similar to the previous case, but zero is not
+ * allowed. On getting, the content attribute must first be parsed
+ * according to the rules for parsing non-negative integers, and if that is
+ * successful, and the value is in the range 1 to 2147483647 inclusive, the
+ * resulting value must be returned. If, on the other hand, it fails or
+ * returns an out of range value, or if the attribute is absent, the
+ * default value must be returned instead, or 1 if there is no default
+ * value. On setting, if the value is zero, the user agent must fire an
+ * INDEX_SIZE_ERR exception. Otherwise, the given value must be converted
+ * to the shortest possible string representing the number as a valid
+ * non-negative integer and then that string must be used as the new
+ * content attribute value."
+ */
+ "limited unsigned long": {
+ "jsType": "number",
+ "defaultVal": 1,
+ "domTests": [minInt - 1, minInt, -36, -1, 0, 1, maxInt,
+ maxInt + 1, maxUnsigned, maxUnsigned + 1, "", "-1", "-0", "0", "1",
+ "\u00097", "\u000B7", "\u000C7", "\u00207", "\u00A07", "\uFEFF7",
+ "\u000A7", "\u000D7", "\u20287", "\u20297", "\u16807", "\u180E7",
+ "\u20007", "\u20017", "\u20027", "\u20037", "\u20047", "\u20057",
+ "\u20067", "\u20077", "\u20087", "\u20097", "\u200A7", "\u202F7",
+ "\u30007",
+ " " + binaryString + " foo ", undefined, 1.5, true, false,
+ {"test": 6}, NaN, +Infinity, -Infinity, "\0",
+ {toString:function() {return 2;}, valueOf: null},
+ {valueOf:function() {return 3;}}],
+ "domExpected": function(val) {
+ var parsed = ReflectionTests.parseNonneg(String(val));
+ // Note maxInt, not maxUnsigned.
+ if (parsed === false || parsed < 1 || parsed > maxInt) {
+ return null;
+ }
+ return parsed;
+ },
+ "idlTests": [0, 1, maxInt, maxInt + 1, maxUnsigned],
+ "idlDomExpected": [null/*exception*/, 1, maxInt, null, null]
+ },
+ /**
+ * "If a reflecting IDL attribute has an unsigned integer type (unsigned
+ * long) that is limited to only non-negative numbers greater than zero
+ * with fallback, then the behaviour is similar to the previous case, but
+ * disallowed values are converted to the default value. On getting, the
+ * content attribute must first be parsed according to the rules for
+ * parsing non-negative integers, and if that is successful, and the value
+ * is in the range 1 to 2147483647 inclusive, the resulting value must be
+ * returned. If, on the other hand, it fails or returns an out of range
+ * value, or if the attribute is absent, the default value must be returned
+ * instead. On setting, first, if the new value is in the range 1 to
+ * 2147483647, then let n be the new value, otherwise let n be the default
+ * value; then, n must be converted to the shortest possible string
+ * representing the number as a valid non-negative integer and that string
+ * must be used as the new content attribute value."
+ */
+ "limited unsigned long with fallback": {
+ "jsType": "number",
+ "domTests": [minInt - 1, minInt, -36, -1, 0, 1, maxInt,
+ maxInt + 1, maxUnsigned, maxUnsigned + 1, "", "-1", "-0", "0", "1",
+ "\u00097", "\u000B7", "\u000C7", "\u00207", "\u00A07", "\uFEFF7",
+ "\u000A7", "\u000D7", "\u20287", "\u20297", "\u16807", "\u180E7",
+ "\u20007", "\u20017", "\u20027", "\u20037", "\u20047", "\u20057",
+ "\u20067", "\u20077", "\u20087", "\u20097", "\u200A7", "\u202F7",
+ "\u30007",
+ " " + binaryString + " foo ", undefined, 1.5, true, false,
+ {"test": 6}, NaN, +Infinity, -Infinity, "\0",
+ {toString:function() {return 2;}, valueOf: null},
+ {valueOf:function() {return 3;}}],
+ "domExpected": function(val) {
+ var parsed = ReflectionTests.parseNonneg(String(val));
+ // Note maxInt, not maxUnsigned.
+ if (parsed === false || parsed < 1 || parsed > maxInt) {
+ return null;
+ }
+ return parsed;
+ },
+ "idlTests": [0, 1, maxInt, maxInt + 1, maxUnsigned],
+ "idlDomExpected": [null, 1, maxInt, null, null]
+ },
+ /**
+ * "If a reflecting IDL attribute is a floating point number type (double),
+ * then, on getting, the content attribute must be parsed according to the
+ * rules for parsing floating point number values, and if that is
+ * successful, the resulting value must be returned. If, on the other hand,
+ * it fails, or if the attribute is absent, the default value must be
+ * returned instead, or 0.0 if there is no default value. On setting, the
+ * given value must be converted to the best representation of the number
+ * as a floating point number and then that string must be used as the new
+ * content attribute value."
+ *
+ * TODO: Check this:
+ *
+ * "Except where otherwise specified, if an IDL attribute that is a
+ * floating point number type (double) is assigned an Infinity or
+ * Not-a-Number (NaN) value, a NOT_SUPPORTED_ERR exception must be raised."
+ *
+ * TODO: Implement the actual algorithm so we can run lots more tests. For
+ * now we're stuck with manually setting up expected values. Of course,
+ * a lot of care has to be taken in checking equality for floats . . .
+ * maybe we should have some tolerance for comparing them. I'm not even
+ * sure whether setting the content attribute to 0 should return 0.0 or
+ * -0.0 (the former, I hope).
+ */
+ "double": {
+ "jsType": "number",
+ "defaultVal": 0.0,
+ "domTests": [minInt - 1, minInt, -36, -1, 0, 1, maxInt,
+ maxInt + 1, maxUnsigned, maxUnsigned + 1, "",
+ "\u00097", "\u000B7", "\u000C7", "\u00207", "\u00A07", "\uFEFF7",
+ "\u000A7", "\u000D7", "\u20287", "\u20297", "\u16807", "\u180E7",
+ "\u20007", "\u20017", "\u20027", "\u20037", "\u20047", "\u20057",
+ "\u20067", "\u20077", "\u20087", "\u20097", "\u200A7", "\u202F7",
+ "\u30007",
+ " " + binaryString + " foo ", undefined, 1.5, true, false,
+ {"test": 6}, NaN, +Infinity, -Infinity, "\0",
+ {toString:function() {return 2;}, valueOf: null},
+ {valueOf:function() {return 3;}}],
+ "domExpected": [minInt - 1, minInt, -36, -1, 0, 1, maxInt,
+ maxInt + 1, maxUnsigned, maxUnsigned + 1, null,
+ // Leading whitespace tests
+ 7, null, 7, 7, null, null,
+ 7, 7, null, null, null, null,
+ null, null, null, null, null, null,
+ null, null, null, null, null, null,
+ null,
+ // End leading whitespace tests
+ null, null, 1.5, null, null,
+ null, null, null, null, null,
+ 2, 3],
+ // I checked that ES ToString is well-defined for all of these (I
+ // think). Yes, String(-0) == "0".
+ "idlTests": [ -10000000000, -1, -0, 0, 1, 10000000000],
+ "idlDomExpected": ["-10000000000", "-1", "0", "0", "1", "10000000000"],
+ "idlIdlExpected": [ -10000000000, -1, -0, 0, 1, 10000000000]
+ }
+};
+
+for (var type in ReflectionTests.typeMap) {
+ var props = ReflectionTests.typeMap[type];
+ var cast = window[props.jsType[0].toUpperCase() + props.jsType.slice(1)];
+ if (props.domExpected === undefined) {
+ props.domExpected = props.domTests.map(cast);
+ } else if (typeof props.domExpected == "function") {
+ props.domExpected = props.domTests.map(props.domExpected);
+ }
+ if (props.idlTests === undefined) {
+ props.idlTests = props.domTests;
+ }
+ if (props.idlDomExpected === undefined) {
+ props.idlDomExpected = props.idlTests.map(cast);
+ } else if (typeof props.idlDomExpected == "function") {
+ props.idlDomExpected = props.idlTests.map(props.idlDomExpected);
+ }
+ if (props.idlIdlExpected === undefined) {
+ props.idlIdlExpected = props.idlDomExpected;
+ } else if (typeof props.idlIdlExpected == "function") {
+ props.idlIdlExpected = props.idlTests.map(props.idlIdlExpected);
+ }
+}
+
+/**
+ * Tests that the JavaScript attribute named idlName on the object idlObj
+ * reflects the DOM attribute named domName on domObj. The data argument is an
+ * object that must contain at least one key, "type", which contains the
+ * expected type of the IDL attribute ("string", "enum", etc.). The "comment"
+ * key will add a parenthesized comment in the type info if there's a test
+ * failure, to indicate that there's something special about the element you're
+ * testing (like it has an attribute set to some value). Other keys in the
+ * data object are type-specific, e.g., "defaultVal" for numeric types. If the
+ * data object is a string, it's converted to {"type": data}. If idlObj is a
+ * string, we set idlObj = domObj = document.createElement(idlObj).
+ */
+ReflectionTests.reflects = function(data, idlName, idlObj, domName, domObj) {
+ // Do some setup first so that getTypeDescription() works in testWrapper()
+ if (typeof data == "string") {
+ data = {type: data};
+ }
+ if (domName === undefined) {
+ domName = idlName;
+ }
+ if (typeof idlObj == "string") {
+ idlObj = document.createElement(idlObj);
+ }
+ if (domObj === undefined) {
+ domObj = idlObj;
+ }
+
+ // Note: probably a hack? This kind of assumes that the variables here
+ // won't change over the course of the tests, which is wrong, but it's
+ // probably safe enough. Just don't read stuff that will change.
+ ReflectionHarness.currentTestInfo = {data: data, idlName: idlName, idlObj: idlObj, domName: domName, domObj: domObj};
+
+ ReflectionHarness.testWrapper(function() {
+ ReflectionTests.doReflects(data, idlName, idlObj, domName, domObj);
+ });
+};
+
+/**
+ * Actual implementation of the above.
+ */
+ReflectionTests.doReflects = function(data, idlName, idlObj, domName, domObj) {
+ // If we don't recognize the type, testing is impossible.
+ if (this.typeMap[data.type] === undefined) {
+ if (unimplemented.indexOf(data.type) == -1) {
+ unimplemented.push(data.type);
+ }
+ return;
+ }
+
+ var typeInfo = this.typeMap[data.type];
+
+ if (typeof data.isNullable == "undefined") {
+ data.isNullable = false;
+ }
+
+ // Test that typeof idlObj[idlName] is correct. If not, further tests are
+ // probably pointless, so bail out.
+ var isDefaultValueNull = data.isNullable && data.defaultVal === null;
+ if (!ReflectionHarness.test(typeof idlObj[idlName], isDefaultValueNull ? "object" : typeInfo.jsType, "typeof IDL attribute")) {
+ return;
+ }
+
+ // Test default
+ var defaultVal = data.defaultVal;
+ if (defaultVal === undefined) {
+ defaultVal = typeInfo.defaultVal;
+ }
+ if (defaultVal !== null || data.isNullable) {
+ ReflectionHarness.test(idlObj[idlName], defaultVal, "IDL get with DOM attribute unset");
+ }
+
+ var domTests = typeInfo.domTests.slice(0);
+ var domExpected = typeInfo.domExpected.map(function(val) { return val === null ? defaultVal : val; });
+ var idlTests = typeInfo.idlTests.slice(0);
+ var idlDomExpected = typeInfo.idlDomExpected.map(function(val) { return val === null ? defaultVal : val; });
+ var idlIdlExpected = typeInfo.idlIdlExpected.map(function(val) { return val === null ? defaultVal : val; });
+ switch (data.type) {
+ // Extra tests and other special-casing
+ case "boolean":
+ domTests.push(domName);
+ domExpected.push(true);
+ break;
+
+ case "enum":
+ // Whee, enum is complicated.
+ if (typeof data.invalidVal == "undefined") {
+ data.invalidVal = defaultVal;
+ }
+ if (typeof data.nonCanon == "undefined") {
+ data.nonCanon = {};
+ }
+ for (var i = 0; i < data.keywords.length; i++) {
+ if (data.keywords[i] != "") {
+ domTests.push(data.keywords[i], "x" + data.keywords[i], data.keywords[i] + "\0");
+ idlTests.push(data.keywords[i], "x" + data.keywords[i], data.keywords[i] + "\0");
+ }
+
+ if (data.keywords[i].length > 1) {
+ domTests.push(data.keywords[i].slice(1));
+ idlTests.push(data.keywords[i].slice(1));
+ }
+
+ if (data.keywords[i] != data.keywords[i].toLowerCase()) {
+ domTests.push(data.keywords[i].toLowerCase());
+ idlTests.push(data.keywords[i].toLowerCase());
+ }
+ if (data.keywords[i] != data.keywords[i].toUpperCase()) {
+ domTests.push(data.keywords[i].toUpperCase());
+ idlTests.push(data.keywords[i].toUpperCase());
+ }
+ }
+
+ // Per spec, the expected DOM values are the same as the value we set
+ // it to.
+ if (!data.isNullable) {
+ idlDomExpected = idlTests.slice(0);
+ } else {
+ idlDomExpected = [];
+ for (var i = 0; i < idlTests.length; i++) {
+ idlDomExpected.push((idlTests[i] === null || idlTests[i] === undefined) ? null : idlTests[i]);
+ }
+ }
+
+ // Now we have the fun of calculating what the expected IDL values are.
+ domExpected = [];
+ idlIdlExpected = [];
+ for (var i = 0; i < domTests.length; i++) {
+ domExpected.push(this.enumExpected(data.keywords, data.nonCanon, data.invalidVal, domTests[i]));
+ }
+ for (var i = 0; i < idlTests.length; i++) {
+ if (data.isNullable && (idlTests[i] === null || idlTests[i] === undefined)) {
+ idlIdlExpected.push(null);
+ } else {
+ idlIdlExpected.push(this.enumExpected(data.keywords, data.nonCanon, data.invalidVal, idlTests[i]));
+ }
+ }
+ break;
+
+ case "string":
+ if ("treatNullAsEmptyString" in data) {
+ for (var i = 0; i < idlTests.length; i++) {
+ if (idlTests[i] === null) {
+ idlDomExpected[i] = idlIdlExpected[i] = "";
+ }
+ }
+ }
+ break;
+ }
+ if (domObj.tagName.toLowerCase() == "canvas" && (domName == "width" || domName == "height")) {
+ // Opera tries to allocate a canvas with the given width and height, so
+ // it OOMs when given excessive sizes. This is permissible under the
+ // hardware-limitations clause, so cut out those checks. TODO: Must be
+ // a way to make this more succinct.
+ domTests = domTests.filter(function(element, index, array) { return domExpected[index] < 1000; });
+ domExpected = domExpected.filter(function(element, index, array) { return element < 1000; });
+ idlTests = idlTests.filter(function(element, index, array) { return idlIdlExpected[index] < 1000; });
+ idlDomExpected = idlDomExpected.filter(function(element, index, array) { return idlIdlExpected[index] < 1000; });
+ idlIdlExpected = idlIdlExpected.filter(function(element, index, array) { return idlIdlExpected[index] < 1000; });
+ }
+
+ if (!data.customGetter) {
+ for (var i = 0; i < domTests.length; i++) {
+ if (domExpected[i] === null && !data.isNullable) {
+ // If you follow all the complicated logic here, you'll find that
+ // this will only happen if there's no expected value at all (like
+ // for tabIndex, where the default is too complicated). So skip
+ // the test.
+ continue;
+ }
+ try {
+ domObj.setAttribute(domName, domTests[i]);
+ ReflectionHarness.test(domObj.getAttribute(domName), String(domTests[i]), "setAttribute() to " + ReflectionHarness.stringRep(domTests[i]) + " followed by getAttribute()");
+ ReflectionHarness.test(idlObj[idlName], domExpected[i], "setAttribute() to " + ReflectionHarness.stringRep(domTests[i]) + " followed by IDL get");
+ if (ReflectionHarness.catchUnexpectedExceptions) {
+ ReflectionHarness.success();
+ }
+ } catch (err) {
+ if (ReflectionHarness.catchUnexpectedExceptions) {
+ ReflectionHarness.failure("Exception thrown during tests with setAttribute() to " + ReflectionHarness.stringRep(domTests[i]));
+ } else {
+ throw err;
+ }
+ }
+ }
+ }
+
+ for (var i = 0; i < idlTests.length; i++) {
+ if ((data.type == "limited long" && idlTests[i] < 0) ||
+ (data.type == "limited unsigned long" && idlTests[i] == 0)) {
+ ReflectionHarness.testException("INDEX_SIZE_ERR", function() {
+ idlObj[idlName] = idlTests[i];
+ }, "IDL set to " + ReflectionHarness.stringRep(idlTests[i]) + " must throw INDEX_SIZE_ERR");
+ } else {
+ ReflectionHarness.run(function() {
+ idlObj[idlName] = idlTests[i];
+ if (data.type == "boolean") {
+ // Special case yay
+ ReflectionHarness.test(domObj.hasAttribute(domName), Boolean(idlTests[i]), "IDL set to " + ReflectionHarness.stringRep(idlTests[i]) + " followed by hasAttribute()");
+ } else if (idlDomExpected[i] !== null || data.isNullable) {
+ var expected = idlDomExpected[i] + "";
+ if (data.isNullable && idlDomExpected[i] === null) {
+ expected = null;
+ }
+ ReflectionHarness.test(domObj.getAttribute(domName), expected, "IDL set to " + ReflectionHarness.stringRep(idlTests[i]) + " followed by getAttribute()");
+ }
+ if (idlIdlExpected[i] !== null || data.isNullable) {
+ ReflectionHarness.test(idlObj[idlName], idlIdlExpected[i], "IDL set to " + ReflectionHarness.stringRep(idlTests[i]) + " followed by IDL get");
+ }
+ if (ReflectionHarness.catchUnexpectedExceptions) {
+ ReflectionHarness.success();
+ }
+ }, "IDL set to " + ReflectionHarness.stringRep(idlTests[i]) + " should not throw");
+ }
+ }
+};
+
+/**
+ * If we have an enumerated attribute limited to the array of values in
+ * keywords, with nonCanon being a map of non-canonical values to their
+ * canonical equivalents, and invalidVal being the invalid value default (or ""
+ * for none), then what would we expect from an IDL get if the content
+ * attribute is equal to contentVal?
+ */
+ReflectionTests.enumExpected = function(keywords, nonCanon, invalidVal, contentVal) {
+ var ret = invalidVal;
+ for (var i = 0; i < keywords.length; i++) {
+ if (String(contentVal).toLowerCase() == keywords[i].toLowerCase()) {
+ ret = keywords[i];
+ break;
+ }
+ }
+ if (typeof nonCanon[ret] != "undefined") {
+ return nonCanon[ret];
+ }
+ return ret;
+};
+
+/**
+ * Now we have the data structures that tell us which elements have which
+ * attributes.
+ *
+ * The elements object (which must have been defined in earlier files) is a map
+ * from element name to an object whose keys are IDL attribute names and whose
+ * values are types. A type is of the same format as
+ * ReflectionTests.reflects() accepts, except that there's an extra optional
+ * domAttrName key that gets passed as the fourth argument to reflects() if
+ * it's provided. (TODO: drop the fourth and fifth reflects() arguments and
+ * make it take them from the dictionary instead?)
+ */
+
+// Now we actually run all the tests.
+var unimplemented = [];
+for (var element in elements) {
+ ReflectionTests.reflects("string", "title", element);
+ ReflectionTests.reflects("string", "lang", element);
+ ReflectionTests.reflects({type: "enum", keywords: ["ltr", "rtl", "auto"]}, "dir", element);
+ ReflectionTests.reflects("string", "className", element, "class");
+ ReflectionTests.reflects("tokenlist", "classList", element, "class");
+ ReflectionTests.reflects("boolean", "hidden", element);
+ ReflectionTests.reflects("string", "accessKey", element);
+ // Don't try to test the defaultVal -- it should be either 0 or -1, but the
+ // rules are complicated, and a lot of them are SHOULDs.
+ ReflectionTests.reflects({type: "long", defaultVal: null}, "tabIndex", element);
+ // TODO: classList, contextMenu, itemProp, itemRef, dropzone (require
+ // tokenlist support)
+
+ for (var idlAttrName in elements[element]) {
+ var type = elements[element][idlAttrName];
+ ReflectionTests.reflects(type, idlAttrName, element,
+ typeof type == "object" && "domAttrName" in type ? type.domAttrName : idlAttrName);
+ }
+}
+
+for (var i = 0; i < extraTests.length; i++) {
+ extraTests[i]();
+}
+
+var time = document.getElementById("time");
+if (time) {
+ time.innerHTML = (new Date().getTime() - ReflectionTests.start)/1000;
+}
+
+if (unimplemented.length) {
+ var p = document.createElement("p");
+ p.textContent = "(Note: missing tests for types " + unimplemented.join(", ") + ".)";
+ document.body.appendChild(p);
+}
diff --git a/testing/web-platform/tests/html/editing/.gitkeep b/testing/web-platform/tests/html/editing/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/activation/.gitkeep b/testing/web-platform/tests/html/editing/activation/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/activation/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/activation/click.html b/testing/web-platform/tests/html/editing/activation/click.html
new file mode 100644
index 000000000..edbc477db
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/activation/click.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLElement#click</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function() {
+ var element = document.createElement("div");
+ var received = false;
+ element.addEventListener("click", this.step_func(function(e) {
+ received = true;
+ assert_false(e.isTrusted, "Event should not be trusted")
+ }));
+ element.click();
+ assert_true(received, "click event should have been dispatched synchronously");
+})
+</script>
diff --git a/testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/.gitkeep b/testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/introduction-6/.gitkeep b/testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/introduction-6/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/introduction-6/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/processing-model-4/.gitkeep b/testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/processing-model-4/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/processing-model-4/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/the-accesskey-attribute/.gitkeep b/testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/the-accesskey-attribute/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/assigning-keyboard-shortcuts/the-accesskey-attribute/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/dnd/README b/testing/web-platform/tests/html/editing/dnd/README
new file mode 100644
index 000000000..aeda217e2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/README
@@ -0,0 +1,23 @@
+This is a test suite for the drag and drop API described in the HTML5
+specification:
+
+ http://dev.w3.org/html5/spec/dnd.html#dnd
+
+Tests in target-origin/ relate to a proposed spec extension and are not covered
+by HTML5 drafts at the time of writing. Contact Opera Sofware for details, and
+mention CT-1656.
+
+Tests in synthetic/ relate to incomplete parts of the HTML5 specification,
+which allows synthetic events to be created. For compatibility with others,
+the dataTransfer parameter allows null, undefined and other objects. Objects
+will create a synthetic dataTransfer. To provide maximum functionality,
+synthetic dataTransfer will have its own synthetic data store, detatched from
+the real data store used by real drag events (actual user interaction). For
+security, real dataTransfer objects will remember the real event's protection
+status inside synthetic events (the spec bases their protection only on the
+event type, and does not consider the difference between real and synthetic
+events).
+
+Tests in platform/plugin are based on assumed "good" behaviour, where the
+appropriate events are passed to the plugin. Platforms should determine if any
+deviations from the expected results are problematic. \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/001.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/001.xhtml
new file mode 100644
index 000000000..fbb452117
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/001.xhtml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Canvas drag and drop carrying image as dataURL</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list'));
+ document.querySelector('div').appendChild(c);}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/uri-list', document.querySelector('canvas').toDataURL('image/png'));}
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)">Canvas</canvas>
+</p>
+<p>Drag canvas pattern above to the box below. It should be copied to the box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/002.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/002.xhtml
new file mode 100644
index 000000000..9cd8eed06
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/002.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop: dropping block element onto canvas</title>
+<style type="text/css">
+div
+ {width:20px;
+ height:20px;
+ background-color:green;}
+</style>
+<script type="application/ecmascript">
+function paint(color)
+ {var canvas = document.querySelector('canvas'),
+ c = canvas.getContext('2d');
+ c.fillStyle = color;
+ c.beginPath();
+ c.moveTo(0,0);
+ c.lineTo(100,0);
+ c.lineTo(100,100);
+ c.lineTo(0,100);
+ c.closePath();
+ c.fill();}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body onload="paint('gray')">
+<div draggable="true" ondragstart="start(event)"/>
+<p>Drag green box above to the gray canvas below. Canvas should turn green when you drop green box on it.</p>
+<p>
+ <canvas width="100" height="100" ondragenter="event.preventDefault()" ondragover="return false" ondrop="paint(event.dataTransfer.getData('text/plain'))">Canvas</canvas>
+</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/003-1.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/003-1.xhtml
new file mode 100644
index 000000000..fe1e4ab30
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/003-1.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Canvas drag and drop: helper file</title>
+<style type="text/css">
+div
+ {width:20px;
+ height:20px;
+ background-color:green;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/003.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/003.xhtml
new file mode 100644
index 000000000..fa98ebe8d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/003.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop from iframe: dropping block element onto canvas</title>
+<style type="text/css">
+iframe
+ {width:150px;
+ height:150px;
+ border-style:none;}
+</style>
+<script type="application/ecmascript">
+function paint(color)
+ {var canvas = document.querySelector('canvas'),
+ c = canvas.getContext('2d');
+ c.fillStyle = color;
+ c.beginPath();
+ c.moveTo(0,0);
+ c.lineTo(100,0);
+ c.lineTo(100,100);
+ c.lineTo(0,100);
+ c.closePath();
+ c.fill();}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body onload="paint('gray')">
+<p><iframe src="003-1.xhtml">Green box</iframe></p>
+<p>Drag green box above to the gray canvas below. Canvas should turn green when you drop green box on it.</p>
+<p>
+ <canvas width="100" height="100" ondragenter="event.preventDefault()" ondragover="return false" ondrop="paint(event.dataTransfer.getData('text/plain'))">Canvas</canvas>
+</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/004.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/004.xhtml
new file mode 100644
index 000000000..d1c2ef06e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/004.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop from object: dropping block element onto canvas</title>
+<style type="text/css">
+object
+ {width:150px;
+ height:150px;
+ border-style:none;}
+</style>
+<script type="application/ecmascript">
+function paint(color)
+ {var canvas = document.querySelector('canvas'),
+ c = canvas.getContext('2d');
+ c.fillStyle = color;
+ c.beginPath();
+ c.moveTo(0,0);
+ c.lineTo(100,0);
+ c.lineTo(100,100);
+ c.lineTo(0,100);
+ c.closePath();
+ c.fill();}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body onload="paint('gray')">
+<p><object type="application/xhtml+xml" data="data:application/xhtml+xml,%3Chtml%20xmlns%3D%22http%3A//www.w3.org/1999/xhtml%22%3E%3Chead%3E%3Ctitle%3ECanvas%20drag%20and%20drop%3C/title%3E%3Cstyle%20type%3D%22text/css%22%3Ediv%7Bwidth%3A20px%3Bheight%3A20px%3Bbackground-color%3Agreen%3B%7D%3C/style%3E%3Cscript%20type%3D%22application/ecmascript%22%3Efunction%20start%28event%29%7Bevent.dataTransfer.effectAllowed%20%3D%20%27copy%27%3Bevent.dataTransfer.setData%28%27text/plain%27%2C%20%27green%27%29%3B%7D%3C/script%3E%3C/head%3E%3Cbody%3E%3Cdiv%20draggable%3D%22true%22%20ondragstart%3D%22start%28event%29%22/%3E%3C/body%3E%3C/html%3E">Green box</object></p>
+<p>Drag green box above to the gray canvas below. Canvas should turn green when you drop green box on it.</p>
+<p>
+ <canvas width="100" height="100" ondragenter="event.preventDefault()" ondragover="return false" ondrop="paint(event.dataTransfer.getData('text/plain'))">Canvas</canvas>
+</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/005.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/005.xhtml
new file mode 100644
index 000000000..fd9c9389e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/005.xhtml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop to iframe: dropping block element onto canvas</title>
+<style type="text/css">
+div
+ {width:20px;
+ height:20px;
+ background-color:green;}
+iframe
+ {width:200px;
+ height:200px;
+ border-style:none;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)"/>
+<p>Drag green box above to the gray canvas below. Canvas should turn green when you drop green box on it.</p>
+<p><iframe src="helper-drop-here-canvas.xhtml">Canvas</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/006.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/006.xhtml
new file mode 100644
index 000000000..003df8f06
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/006.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop to object: dropping block element onto canvas</title>
+<style type="text/css">
+div
+ {width:20px;
+ height:20px;
+ background-color:green;}
+object
+ {width:200px;
+ height:200px;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)"/>
+<p>Drag green box above to the gray canvas below. Canvas should turn green when you drop green box on it.</p>
+<p><object type="application/xhtml+xml" data="data:application/xhtml+xml,%3Chtml%20xmlns%3D%22http%3A//www.w3.org/1999/xhtml%22%3E%3Chead%3E%3Ctitle%3ECanvas%20drag%20and%20drop%3C/title%3E%3Cscript%20type%3D%22application/ecmascript%22%3Efunction%20paint%28color%29%7Bvar%20canvas%20%3D%20document.querySelector%28%27canvas%27%29%2Cc%20%3D%20canvas.getContext%28%272d%27%29%3Bc.fillStyle%20%3D%20color%3Bc.beginPath%28%29%3Bc.moveTo%280%2C0%29%3Bc.lineTo%28100%2C0%29%3Bc.lineTo%28100%2C100%29%3Bc.lineTo%280%2C100%29%3Bc.closePath%28%29%3Bc.fill%28%29%3B%7Dfunction%20start%28event%29%7Bevent.dataTransfer.effectAllowed%20%3D%20%27copy%27%3Bevent.dataTransfer.setData%28%27text/plain%27%2C%20document.querySelector%28%27input%27%29.value%29%3B%7D%3C/script%3E%3C/head%3E%3Cbody%20onload%3D%22paint%28%27gray%27%29%22%3E%3Cp%3E%3Ccanvas%20width%3D%22100%22%20height%3D%22100%22%20ondragenter%3D%22event.preventDefault%28%29%22%20ondragover%3D%22return%20false%22%20ondrop%3D%22paint%28event.dataTransfer.getData%28%27text/plain%27%29%29%22%3ECanvas%3C/canvas%3E%3C/p%3E%3C/body%3E%3C/html%3E">Canvas</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/007.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/007.xhtml
new file mode 100644
index 000000000..8ee869f0b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/007.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop between iframes: dropping block element onto canvas</title>
+<style type="text/css">
+iframe
+ {width:300px;
+ height:200px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-green-box.xhtml">Green box</iframe></p>
+<p>Drag green box above to the gray canvas below. Canvas should turn green when you drop green box on it.</p>
+<p><iframe src="helper-drop-here-canvas.xhtml">Canvas</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/008.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/008.xhtml
new file mode 100644
index 000000000..d3f21acd7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/008.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop from iframe to object: dropping block element onto canvas</title>
+<style type="text/css">
+iframe, object
+ {width:300px;
+ height:200px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-green-box.xhtml">Green box</iframe></p>
+<p>Drag green box above to the gray canvas below. Canvas should turn green when you drop green box on it.</p>
+<p><object type="application/xhtml+xml" data="data:application/xhtml+xml,%3Chtml%20xmlns%3D%22http%3A//www.w3.org/1999/xhtml%22%3E%3Chead%3E%3Ctitle%3ECanvas%20drag%20and%20drop%3C/title%3E%3Cscript%20type%3D%22application/ecmascript%22%3Efunction%20paint%28color%29%7Bvar%20canvas%20%3D%20document.querySelector%28%27canvas%27%29%2Cc%20%3D%20canvas.getContext%28%272d%27%29%3Bc.fillStyle%20%3D%20color%3Bc.beginPath%28%29%3Bc.moveTo%280%2C0%29%3Bc.lineTo%28100%2C0%29%3Bc.lineTo%28100%2C100%29%3Bc.lineTo%280%2C100%29%3Bc.closePath%28%29%3Bc.fill%28%29%3B%7Dfunction%20start%28event%29%7Bevent.dataTransfer.effectAllowed%20%3D%20%27copy%27%3Bevent.dataTransfer.setData%28%27text/plain%27%2C%20document.querySelector%28%27input%27%29.value%29%3B%7D%3C/script%3E%3C/head%3E%3Cbody%20onload%3D%22paint%28%27gray%27%29%22%3E%3Cp%3E%3Ccanvas%20width%3D%22100%22%20height%3D%22100%22%20ondragenter%3D%22event.preventDefault%28%29%22%20ondragover%3D%22return%20false%22%20ondrop%3D%22paint%28event.dataTransfer.getData%28%27text/plain%27%29%29%22%3ECanvas%3C/canvas%3E%3C/p%3E%3C/body%3E%3C/html%3E">Canvas</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/009.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/009.xhtml
new file mode 100644
index 000000000..9f73037bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/009.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop between objects: dropping block element onto canvas</title>
+<style type="text/css">
+object
+ {width:300px;
+ height:200px;}
+</style>
+</head>
+<body>
+<p><object type="application/xhtml+xml" data="data:application/xhtml+xml,%3Chtml%20xmlns%3D%22http%3A//www.w3.org/1999/xhtml%22%3E%3Chead%3E%3Ctitle%3ECanvas%20drag%20and%20drop%3C/title%3E%3Cstyle%20type%3D%22text/css%22%3Ediv%7Bwidth%3A20px%3Bheight%3A20px%3Bbackground-color%3Agreen%3B%7D%3C/style%3E%3Cscript%20type%3D%22application/ecmascript%22%3Efunction%20start%28event%29%7Bevent.dataTransfer.effectAllowed%20%3D%20%27copy%27%3Bevent.dataTransfer.setData%28%27text/plain%27%2C%20%27green%27%29%3B%7D%3C/script%3E%3C/head%3E%3Cbody%3E%3Cdiv%20draggable%3D%22true%22%20ondragstart%3D%22start%28event%29%22/%3E%3C/body%3E%3C/html%3E">Green box</object></p>
+<p>Drag green box above to the gray canvas below. Canvas should turn green when you drop green box on it.</p>
+<p><object type="application/xhtml+xml" data="data:application/xhtml+xml,%3Chtml%20xmlns%3D%22http%3A//www.w3.org/1999/xhtml%22%3E%3Chead%3E%3Ctitle%3ECanvas%20drag%20and%20drop%3C/title%3E%3Cscript%20type%3D%22application/ecmascript%22%3Efunction%20paint%28color%29%7Bvar%20canvas%20%3D%20document.querySelector%28%27canvas%27%29%2Cc%20%3D%20canvas.getContext%28%272d%27%29%3Bc.fillStyle%20%3D%20color%3Bc.beginPath%28%29%3Bc.moveTo%280%2C0%29%3Bc.lineTo%28100%2C0%29%3Bc.lineTo%28100%2C100%29%3Bc.lineTo%280%2C100%29%3Bc.closePath%28%29%3Bc.fill%28%29%3B%7Dfunction%20start%28event%29%7Bevent.dataTransfer.effectAllowed%20%3D%20%27copy%27%3Bevent.dataTransfer.setData%28%27text/plain%27%2C%20document.querySelector%28%27input%27%29.value%29%3B%7D%3C/script%3E%3C/head%3E%3Cbody%20onload%3D%22paint%28%27gray%27%29%22%3E%3Cp%3E%3Ccanvas%20width%3D%22100%22%20height%3D%22100%22%20ondragenter%3D%22event.preventDefault%28%29%22%20ondragover%3D%22return%20false%22%20ondrop%3D%22paint%28event.dataTransfer.getData%28%27text/plain%27%29%29%22%3ECanvas%3C/canvas%3E%3C/p%3E%3C/body%3E%3C/html%3E">Canvas</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/010-1.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/010-1.xhtml
new file mode 100644
index 000000000..0f12e6fcd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/010-1.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Canvas drag and drop: helper file</title>
+<style type="text/css">
+div
+ {width:20px;
+ height:20px;
+ background-color:green;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)"/>
+<p>Drag green box above to the gray canvas below. Canvas should turn green when you drop green box on it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/010.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/010.xhtml
new file mode 100644
index 000000000..0b24a3082
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/010.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop between frames: dropping block element onto canvas</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="010-1.xhtml"/>
+<frame src="helper-drop-here-canvas.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/011.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/011.xhtml
new file mode 100644
index 000000000..40da4e967
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/011.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop between dataURL frames: dropping block element onto canvas</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="data:application/xhtml+xml,%3Chtml%20xmlns%3D%22http%3A//www.w3.org/1999/xhtml%22%3E%3Chead%3E%3Ctitle%3ECanvas%20drag%20and%20drop%3C/title%3E%3Cstyle%20type%3D%22text/css%22%3Ediv%7Bwidth%3A20px%3Bheight%3A20px%3Bbackground-color%3Agreen%3B%7D%3C/style%3E%3Cscript%20type%3D%22application/ecmascript%22%3Efunction%20start%28event%29%7Bevent.dataTransfer.effectAllowed%20%3D%20%27copy%27%3Bevent.dataTransfer.setData%28%27text/plain%27%2C%20%27green%27%29%3B%7D%3C/script%3E%3C/head%3E%3Cbody%3E%3Cdiv%20draggable%3D%22true%22%20ondragstart%3D%22start%28event%29%22/%3E%3Cp%3EDrag%20green%20box%20above%20to%20the%20gray%20canvas%20below.%20Canvas%20should%20turn%20green%20when%20you%20drop%20green%20box%20on%20it.%3C/p%3E%3C/body%3E%3C/html%3E"/>
+<frame src="data:application/xhtml+xml,%3Chtml%20xmlns%3D%22http%3A//www.w3.org/1999/xhtml%22%3E%3Chead%3E%3Ctitle%3ECanvas%20drag%20and%20drop%3C/title%3E%3Cscript%20type%3D%22application/ecmascript%22%3Efunction%20paint%28color%29%7Bvar%20canvas%20%3D%20document.querySelector%28%27canvas%27%29%2Cc%20%3D%20canvas.getContext%28%272d%27%29%3Bc.fillStyle%20%3D%20color%3Bc.beginPath%28%29%3Bc.moveTo%280%2C0%29%3Bc.lineTo%28100%2C0%29%3Bc.lineTo%28100%2C100%29%3Bc.lineTo%280%2C100%29%3Bc.closePath%28%29%3Bc.fill%28%29%3B%7Dfunction%20start%28event%29%7Bevent.dataTransfer.effectAllowed%20%3D%20%27copy%27%3Bevent.dataTransfer.setData%28%27text/plain%27%2C%20document.querySelector%28%27input%27%29.value%29%3B%7D%3C/script%3E%3C/head%3E%3Cbody%20onload%3D%22paint%28%27gray%27%29%22%3E%3Cp%3E%3Ccanvas%20width%3D%22100%22%20height%3D%22100%22%20ondragenter%3D%22event.preventDefault%28%29%22%20ondragover%3D%22return%20false%22%20ondrop%3D%22paint%28event.dataTransfer.getData%28%27text/plain%27%29%29%22%3ECanvas%3C/canvas%3E%3C/p%3E%3C/body%3E%3C/html%3E"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/012.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/012.xhtml
new file mode 100644
index 000000000..d2069142c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/012.xhtml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop and vertical scrolling: dropping block element onto canvas inside scrollable container</title>
+<style type="text/css">
+div[draggable]
+ {width:20px;
+ height:20px;
+ background-color:green;}
+p + div
+ {height:100px;
+ width:150px;
+ overflow-y:scroll;}
+canvas
+ {display:block;
+ margin-top:100px;}
+</style>
+<script type="application/ecmascript">
+function paint(color)
+ {var canvas = document.querySelector('canvas'),
+ c = canvas.getContext('2d');
+ c.fillStyle = color;
+ c.beginPath();
+ c.moveTo(0,0);
+ c.lineTo(100,0);
+ c.lineTo(100,100);
+ c.lineTo(0,100);
+ c.closePath();
+ c.fill();}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body onload="paint('gray')">
+<div draggable="true" ondragstart="start(event)"/>
+<p>You should be able to drag green box above to the gray canvas at the bottom of scrollable container (dragging towards the bottom edge triggers scrolling). Canvas should be repainted to match dropped color.</p>
+<div>
+ <canvas width="100" height="100" ondragenter="event.preventDefault()" ondragover="return false" ondrop="paint(event.dataTransfer.getData('text/plain'))">Canvas</canvas>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/013.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/013.xhtml
new file mode 100644
index 000000000..c63a5d4d0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/013.xhtml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop and horizontal scrolling: dropping block element onto canvas inside scrollable container</title>
+<style type="text/css">
+div[draggable]
+ {width:20px;
+ height:20px;
+ background-color:green;}
+p + div
+ {height:150px;
+ width:100px;
+ overflow-x:scroll;}
+canvas
+ {display:block;
+ margin-left:100px;}
+</style>
+<script type="application/ecmascript">
+function paint(color)
+ {var canvas = document.querySelector('canvas'),
+ c = canvas.getContext('2d');
+ c.fillStyle = color;
+ c.beginPath();
+ c.moveTo(0,0);
+ c.lineTo(100,0);
+ c.lineTo(100,100);
+ c.lineTo(0,100);
+ c.closePath();
+ c.fill();}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body onload="paint('gray')">
+<div draggable="true" ondragstart="start(event)"/>
+<p>You should be able to drag green box above to the gray canvas at the right edge of scrollable container (dragging towards the right edge triggers scrolling). Canvas should be repainted to match dropped color.</p>
+<div>
+ <canvas width="100" height="100" ondragenter="event.preventDefault()" ondragover="return false" ondrop="paint(event.dataTransfer.getData('text/plain'))">Canvas</canvas>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/014.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/014.xhtml
new file mode 100644
index 000000000..561597eea
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/014.xhtml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop and scrolling: dropping block element onto canvas inside scrollable container</title>
+<style type="text/css">
+div[draggable]
+ {width:20px;
+ height:20px;
+ background-color:green;}
+p + div
+ {height:100px;
+ width:100px;
+ overflow:scroll;}
+canvas
+ {display:block;
+ margin:100px 0 0 100px;}
+</style>
+<script type="application/ecmascript">
+function paint(color)
+ {var canvas = document.querySelector('canvas'),
+ c = canvas.getContext('2d');
+ c.fillStyle = color;
+ c.beginPath();
+ c.moveTo(0,0);
+ c.lineTo(100,0);
+ c.lineTo(100,100);
+ c.lineTo(0,100);
+ c.closePath();
+ c.fill();}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body onload="paint('gray')">
+<div draggable="true" ondragstart="start(event)"/>
+<p>You should be able to drag green box above to the gray canvas in the right-bottom corner of the scrollable container (dragging towards the corner triggers scrolling). Canvas should be repainted to match dropped color.</p>
+<div>
+ <canvas width="100" height="100" ondragenter="event.preventDefault()" ondragover="return false" ondrop="paint(event.dataTransfer.getData('text/plain'))">Canvas</canvas>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/cross-domain/001.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/cross-domain/001.xhtml
new file mode 100644
index 000000000..d99c73e6e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/cross-domain/001.xhtml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross-domain canvas data must not populate the dataTransfer</title>
+<script src="../../resources/crossorigin.js"></script>
+<style type="text/css">
+div {
+ width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;
+}
+p:first-child {
+ padding-left:12px;
+}
+#image { visibility: hidden; }
+</style>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true">Canvas</canvas>
+</p>
+<p>Drag the navy square above to the box below.</p>
+<div></div>
+<p><img id="image" alt="" width="100" height="100" /></p>
+
+<script><![CDATA[
+document.getElementsByTagName("img")[0].src = crossOriginUrl("www", "../../resources/100x100-navy.png");
+
+window.onload = function() {
+ var canvas = document.getElementsByTagName('canvas')[0], div = document.getElementsByTagName('div')[0], failed = [];
+ var context = canvas.getContext('2d');
+ var image = document.getElementById('image');
+ context.drawImage(image, 0, 0);
+ div.ondragover = div.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ div.ondrop = canvas.ondragstart = function(e) {
+ if( e.type == 'dragstart' ) {
+ e.dataTransfer.setData('Text', 'dummy text');
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ for( var i = 0; i < e.dataTransfer.types.length; i++ ) {
+ if( e.dataTransfer.types[i].match(/image\//) ) {
+ failed[failed.length] = e.dataTransfer.types[i];
+ }
+ }
+ if( e.type == 'drop' ) {
+ e.preventDefault();
+ document.getElementsByTagName('p')[1].innerHTML = failed.length ? ( 'FAIL (found ' + failed.join() + ')' ) : 'PASS';
+ }
+ };
+};
+]]></script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/helper-drag-me-green-box.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/helper-drag-me-green-box.xhtml
new file mode 100644
index 000000000..cb722babd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/helper-drag-me-green-box.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Canvas drag and drop: helper file</title>
+<style type="text/css">
+div
+ {width:20px;
+ height:20px;
+ background-color:green;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)"/></body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/helper-drop-here-canvas.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/helper-drop-here-canvas.xhtml
new file mode 100644
index 000000000..dcbf7e33f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/helper-drop-here-canvas.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Canvas drag and drop: helper file</title>
+<script type="application/ecmascript">
+function paint(color)
+ {var canvas = document.querySelector('canvas'),
+ c = canvas.getContext('2d');
+ c.fillStyle = color;
+ c.beginPath();
+ c.moveTo(0,0);
+ c.lineTo(100,0);
+ c.lineTo(100,100);
+ c.lineTo(0,100);
+ c.closePath();
+ c.fill();}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body onload="paint('gray')">
+<p>
+ <canvas width="100" height="100" ondragenter="event.preventDefault()" ondragover="return false" ondrop="paint(event.dataTransfer.getData('text/plain'))">Canvas</canvas>
+</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/crashers/dialog-001.html b/testing/web-platform/tests/html/editing/dnd/crashers/dialog-001.html
new file mode 100644
index 000000000..23484c7bd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/crashers/dialog-001.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset='utf-8'>
+<title>drag &amp; drop – crash when drag is interrupted by dialogs</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ p {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ var doneonce = false;
+ document.getElementsByTagName('div')[0].ondragstart = function(e) {
+ alert( doneonce ? 'Dismiss this dialog. PASS if the browser does not crash.' : 'Dismiss this dialog. The browser should not crash. Without re-focusing the page first, try dragging the orange square a second time. If a second alert does not appear, release the drag, and then try dragging the orange square a third time.' );
+ doneonce = true;
+ };
+};
+</script>
+
+<div draggable='true' itemscope></div><div></div>
+
+<p>Try to drag the orange square onto the blue square.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/cross-document/001-1.html b/testing/web-platform/tests/html/editing/dnd/cross-document/001-1.html
new file mode 100644
index 000000000..8eb79d17f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/cross-document/001-1.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - cross-document data drop</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ var blue = document.getElementsByTagName('div')[0], fails = [];
+ blue.ondragover = blue.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ if( e.dataTransfer.getData('text') ) {
+ fails[fails.length] = '"' + e.dataTransfer.getData('text') + '" exposed during event ' + e.type;
+ }
+ };
+ blue.ondrop = function(e) {
+ e.preventDefault();
+ if( !e.dataTransfer.types.length ) {
+ fails[fails.length] = 'no types found during event drop';
+ }
+ var foundtext = false;
+ for( var i = 0; i < e.dataTransfer.types.length; i++ ) {
+ if( e.dataTransfer.types[i] == 'text/plain' ) {
+ foundtext = true;
+ break;
+ }
+ }
+ if( !foundtext ) {
+ fails[fails.length] = 'text/plain type not found during event drop';
+ }
+ if( e.dataTransfer.getData('text') != 'dummy text' ) {
+ fails[fails.length] = 'getData returned ' + e.dataTransfer.getData('text') + ' instead of "dummy text"';
+ }
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL:<br>' + fails.join('<br>') ) : 'PASS';
+ };
+};
+</script>
+
+<p>Drag the orange square onto the blue square. Fail if this text does not change.</p>
+<div></div>
+
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/cross-document/001.html b/testing/web-platform/tests/html/editing/dnd/cross-document/001.html
new file mode 100644
index 000000000..02012e86b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/cross-document/001.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - simple cross-document data drop</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text', 'dummy text');
+ };
+};
+</script>
+
+<div draggable="true"></div>
+<p><iframe src="001-1.html" height="300" width="500"></iframe></p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/cross-document/002.html b/testing/web-platform/tests/html/editing/dnd/cross-document/002.html
new file mode 100644
index 000000000..7b48d3e16
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/cross-document/002.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - cross-domain cross-document data drop</title>
+<script src="../resources/crossorigin.js"></script>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text', 'dummy text');
+ };
+};
+</script>
+
+<div draggable="true"></div>
+<p><iframe height="300" width="500"></iframe></p>
+<script>document.getElementsByTagName("iframe")[0].src = crossOriginUrl("www", "001-1.html");
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/cross-document/003-1.html b/testing/web-platform/tests/html/editing/dnd/cross-document/003-1.html
new file mode 100644
index 000000000..b1357c10a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/cross-document/003-1.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - cross-document data drop</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ var blue = document.getElementsByTagName('div')[0], fails = [];
+ blue.ondragover = blue.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ if( !parent.evs[e.type] ) { parent.evs[e.type] = {}; }
+ parent.evs[e.type].dataTransfer = e.dataTransfer;
+ parent.evs[e.type].items = e.dataTransfer.items;
+ parent.evs[e.type].types = e.dataTransfer.types;
+ parent.evs[e.type].files = e.dataTransfer.files;
+ if( parent.evs[e.type].dataTransfer != e.dataTransfer ) {
+ fails[fails.length] = '.dataTransfer is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.items ) {
+ fails[fails.length] = '.items is not returning anything during '+e.type;
+ } else if( parent.evs[e.type].items !== e.dataTransfer.items ) {
+ fails[fails.length] = '.items is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.types ) {
+ fails[fails.length] = '.types is not returning anything during '+e.type;
+ } else if( parent.evs[e.type].types !== e.dataTransfer.types ) {
+ fails[fails.length] = '.types is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = '.files is not returning anything during '+e.type;
+ } else if( parent.evs[e.type].files !== e.dataTransfer.files ) {
+ fails[fails.length] = '.files is not returning the same object during '+e.type;
+ }
+ //http://dev.w3.org/html5/spec/dnd.html#datatransfer
+ //"The * attribute must return a * object associated with the DataTransfer object."
+ //Note that it is associated with the DataTransfer object, *not* the data store
+ //http://dev.w3.org/html5/spec/dnd.html#dragevent
+ //"when a user agent is required to fire a DND event named e at an element, using a particular drag data store...
+ //Let dataTransfer be a newly created DataTransfer object associated with the given drag data store."
+ //A new DataTransfer object therefore means a new set of properties, not the same ones as last event
+ if( parent.evs.dragstart.dataTransfer === e.dataTransfer ) {
+ fails[fails.length] = '.dataTransfer is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ if( e.dataTransfer.items && parent.evs.dragstart.items === e.dataTransfer.items ) {
+ fails[fails.length] = '.items is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ if( e.dataTransfer.types && parent.evs.dragstart.types === e.dataTransfer.types ) {
+ fails[fails.length] = '.types is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ if( e.dataTransfer.files && parent.evs.dragstart.files === e.dataTransfer.files ) {
+ fails[fails.length] = '.files is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ };
+ blue.ondrop = function(e) {
+ parent.evs[e.type] = {};
+ parent.evs[e.type].dataTransfer = e.dataTransfer;
+ parent.evs[e.type].items = e.dataTransfer.items;
+ parent.evs[e.type].types = e.dataTransfer.types;
+ parent.evs[e.type].files = e.dataTransfer.files;
+ if( parent.evs[e.type].dataTransfer !== e.dataTransfer ) {
+ fails[fails.length] = '.dataTransfer is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.items ) {
+ fails[fails.length] = '.items is not returning anything during '+e.type;
+ } else if( parent.evs[e.type].items !== e.dataTransfer.items ) {
+ fails[fails.length] = '.items is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.types ) {
+ fails[fails.length] = '.types is not returning anything during '+e.type;
+ } else if( parent.evs[e.type].types !== e.dataTransfer.types ) {
+ fails[fails.length] = '.types is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = '.files is not returning anything during '+e.type;
+ } else if( parent.evs[e.type].files !== e.dataTransfer.files ) {
+ fails[fails.length] = '.files is not returning the same object during '+e.type;
+ }
+ if( parent.evs.dragstart.dataTransfer === e.dataTransfer ) {
+ fails[fails.length] = '.dataTransfer is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ if( e.dataTransfer.items && parent.evs.dragstart.items === e.dataTransfer.items ) {
+ fails[fails.length] = '.items is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ if( e.dataTransfer.types && parent.evs.dragstart.types === e.dataTransfer.types ) {
+ fails[fails.length] = '.types is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ if( e.dataTransfer.files && parent.evs.dragstart.files === e.dataTransfer.files ) {
+ fails[fails.length] = '.files is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL:<br>' + fails.join('<br>') ) : 'PASS';
+ };
+};
+</script>
+
+<p>Drag the orange square onto the blue square. Fail if this text does not change.</p>
+<div></div>
+
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/cross-document/003.html b/testing/web-platform/tests/html/editing/dnd/cross-document/003.html
new file mode 100644
index 000000000..6b7c4d074
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/cross-document/003.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - cross-document variable retention within event handlers</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+var evs = {};
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text', 'dummy text');
+ evs[e.type] = {};
+ evs[e.type].dataTransfer = e.dataTransfer;
+ evs[e.type].items = e.dataTransfer.items;
+ evs[e.type].types = e.dataTransfer.types;
+ evs[e.type].files = e.dataTransfer.files;
+ };
+};
+</script>
+
+<div draggable="true"></div>
+<p><iframe src="003-1.html" height="300" width="500"></iframe></p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/001.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/001.xhtml
new file mode 100644
index 000000000..a6f538710
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/001.xhtml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.setData/getData during canvas drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ }
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)" ondrag="dragElement(event)">Canvas</canvas>
+</p>
+<p>Drag canvas pattern to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+data[1] = canvas.toDataURL('image/png');
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/002.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/002.xhtml
new file mode 100644
index 000000000..5bbfb9a4d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/002.xhtml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.setData/getData during PNG image drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><img ondragstart="start(event)" ondrag="dragElement(event)" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag circle above to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/003.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/003.xhtml
new file mode 100644
index 000000000..dbd5851a5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/003.xhtml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.setData/getData during SVG image drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ }
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><img ondragstart="start(event)" ondrag="dragElement(event)" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle"/></p>
+<p>Drag circle above to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/004.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/004.xhtml
new file mode 100644
index 000000000..cdf2d16c7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/004.xhtml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.setData/getData during text input selection drag and drop</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['Drag me', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ }
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragstart="start(event)" ondrag="dragElement(event)"/></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/005.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/005.xhtml
new file mode 100644
index 000000000..949e6c3ca
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/005.xhtml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.setData/getData during selection drag and drop</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['Drag me', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ }
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('span'))">
+<p><span ondragstart="start(event)" ondrag="dragElement(event)">Drag me</span></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/006.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/006.xhtml
new file mode 100644
index 000000000..24e30bd83
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/006.xhtml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.setData/getData during link drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:text/plain,1', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ }
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondrag="dragElement(event)">Drag me</a></p>
+<p>Drag link above to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/007.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/007.xhtml
new file mode 100644
index 000000000..66c89a24f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/007.xhtml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.setData/getData during block element drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:green;}
+p + div
+ {background-color:gray;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ }
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('p + div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)" ondrag="dragElement(event)"/>
+<p>Drag green box above to the gray box below and drop it. Gray box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/008.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/008.xhtml
new file mode 100644
index 000000000..1ff328d9e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/008.xhtml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Influence of reload during drag and drop on datastore</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:green;}
+p + div
+ {background-color:gray;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ window.location.reload();}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('p + div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)" ondrag="dragElement(event)"/>
+<p>Drag green box above to the gray box below and drop it. Gray box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/009-1.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/009-1.xhtml
new file mode 100644
index 000000000..ed55dc5a4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/009-1.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Redirect during drag and drop: helper file</title>
+<style type="text/css">
+html, body
+ {height:100%;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('body').setAttribute('style','background-color:teal;color:white;');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)">
+<p>Drop box here. Page should turn green and test results should appear below.</p>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/009.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/009.xhtml
new file mode 100644
index 000000000..d0719fdfd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/009.xhtml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Influence of redirect during drag and drop on datastore</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:navy;}
+p + div
+ {background-color:gray;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ window.location = '009-1.xhtml'}
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)"/>
+<p>Try to drag box above. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/010-1.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/010-1.xhtml
new file mode 100644
index 000000000..427624a6f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/010-1.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>History navigation during drag and drop: helper file</title>
+<style type="text/css">
+div[ondragenter]
+ {margin:200px 0 0 200px;
+ width:200px;
+ height:100px;
+ color:white;
+ background-color:navy;}
+div[ondragenter]:before
+ {display:block;
+ content:"";
+ border-style:solid;
+ position:relative;
+ top:-50px;
+ left:-200px;
+ border-width:100px;
+ border-color:transparent navy transparent transparent;}
+</style>
+</head>
+<body>
+<p>Drag box to the blue arrow but don't drop it yet. You should be returned back to start page.</p>
+<div ondragenter="event.preventDefault()" ondragover="history.go(-1)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/010.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/010.xhtml
new file mode 100644
index 000000000..9e32b36f3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/010.xhtml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Influence of history navigation during drag and drop on datastore</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:green;}
+p + div
+ {background-color:gray;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ window.location = '010-1.xhtml'}
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('p + div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)"/>
+<p>Drag green box above. You will be redirected to new page. When you return back drop it on the gray box below. Gray box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/011.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/011.xhtml
new file mode 100644
index 000000000..6b51611eb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/011.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop datastore: dragging element to iframe</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:navy;}
+iframe
+ {width:500px;
+ height:500px;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ }
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)"/>
+<p>Drag box above to the frame below.</p>
+<iframe src="helper-drop-box-here.xhtml">XHTML document</iframe>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/012.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/012.xhtml
new file mode 100644
index 000000000..b80ed24fa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/012.xhtml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop datastore: dragging element to object</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:navy;}
+object
+ {width:500px;
+ height:500px;
+ border:solid medium navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ }
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)"/>
+<p>Drag box above to the frame below.</p>
+<object type="application/xhtml+xml" data="helper-drop-box-here.xhtml">XHTML document</object>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/013-1.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/013-1.xhtml
new file mode 100644
index 000000000..d724679e6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/013-1.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop datastore: helper file</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ }
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)"/>
+<p>Drag box above to the frame below.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/013.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/013.xhtml
new file mode 100644
index 000000000..312a66d1f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/013.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop datastore: dragging element between frames</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="013-1.xhtml"/>
+<frame src="helper-drop-box-here.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/014-1.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/014-1.xhtml
new file mode 100644
index 000000000..7a5069317
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/014-1.xhtml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop datastore: helper file</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:text/plain,1', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ }
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondrag="dragElement(event)">Drag me</a></p>
+<p>Drag link from one frame to the silver box in another frame and drop it. Silver box should turn green and test results should appear.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/014.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/014.xhtml
new file mode 100644
index 000000000..e1892c5a3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/014.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop datastore: dragging element between two instances of document</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="014-1.xhtml"/>
+<frame src="014-1.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/015-manual.html b/testing/web-platform/tests/html/editing/dnd/datastore/015-manual.html
new file mode 100644
index 000000000..74fff038d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/015-manual.html
@@ -0,0 +1,62 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Using dataTransfer in new thread</title>
+ <style type="text/css">
+blockquote { height: 100px; width: 100px; background: orange; margin: 0; padding: 0; float: left; }
+blockquote + blockquote { background: blue; }
+blockquote + blockquote + blockquote { background: fuchsia; }
+blockquote + div { clear: left; }
+ </style>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript">
+setup(function () {},{explicit_done:true,explicit_timeout:true});
+window.onload = function () {
+
+ var orange = document.getElementsByTagName('blockquote')[0],
+ blue = document.getElementsByTagName('blockquote')[1],
+ fuchsia = document.getElementsByTagName('blockquote')[2],
+ evtdone = {};
+
+ orange.ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dragstart real data');
+ var dataTransfer = e.dataTransfer;
+ setTimeout(function () {
+ test(function () {
+ assert_equals( dataTransfer.getData('text'), '', 'step 1' );
+ dataTransfer.setData('text','new thread after dragstart');
+ assert_equals( dataTransfer.getData('text'), '', 'step 2' );
+ },'dragstart data store should be protected after new thread starts');
+ },0);
+ };
+
+ fuchsia.ondragenter = fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ };
+
+ fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ var dataTransfer = e.dataTransfer;
+ setTimeout(function () {
+ test(function () {
+ assert_equals( dataTransfer.getData('text'), '', 'step 1' );
+ dataTransfer.setData('text','new thread after dragstart');
+ assert_equals( dataTransfer.getData('text'), '', 'step 2' );
+ },'drop data store should be protected after new thread starts');
+ done();
+ },0);
+ };
+
+};
+ </script>
+ </head>
+ <body>
+ <p>Drag the orange square over the blue square then the fuchsia square, then release it.</p>
+ <blockquote draggable="true"></blockquote>
+ <blockquote></blockquote>
+ <blockquote></blockquote>
+ <div id="log"></div>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/016.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/016.xhtml
new file mode 100644
index 000000000..5c5a49a2a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/016.xhtml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.clearData during PNG image drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:text/plain,FAIL', 'FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'],
+l = 0;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.clearData(dataTypes[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length > l)
+ {say('items.length (dragover) : FAIL' + event.dataTransfer.items.length)}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><img ondragstart="start(event)" ondrag="dragElement(event)" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag circle above to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/017.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/017.xhtml
new file mode 100644
index 000000000..2cf031c12
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/017.xhtml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.clearData during SVG image drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E', 'FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'],
+l = 0;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.clearData(dataTypes[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length > l)
+ {say('items.length (dragover) : FAIL' + event.dataTransfer.items.length)}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><img ondragstart="start(event)" ondrag="dragElement(event)" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle"/></p>
+<p>Drag circle above to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/018.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/018.xhtml
new file mode 100644
index 000000000..ecf703b73
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/018.xhtml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.clearData during text input selection drag and drop</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['FAIL', 'data:text/plain,FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'],
+l = 0;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.clearData(dataTypes[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length > l)
+ {say('items.length (dragover) : FAIL' + event.dataTransfer.items.length)}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragstart="start(event)" ondrag="dragElement(event)"/></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/019.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/019.xhtml
new file mode 100644
index 000000000..2aa803c61
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/019.xhtml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.clearData during selection drag and drop</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['FAIL', 'data:text/plain,FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'],
+l = 0;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.clearData(dataTypes[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length > l)
+ {say('items.length (dragover) : FAIL' + event.dataTransfer.items.length)}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('span'))">
+<p><span ondragstart="start(event)" ondrag="dragElement(event)">Drag me</span></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/020.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/020.xhtml
new file mode 100644
index 000000000..73689e1da
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/020.xhtml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.clearData during link drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:text/plain,FAIL', 'FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'],
+l = 0;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ }
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.clearData(dataTypes[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length > l)
+ {say('items.length (dragover) : FAIL' + event.dataTransfer.items.length)}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondrag="dragElement(event)">Drag me</a></p>
+<p>Drag link above to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/021.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/021.xhtml
new file mode 100644
index 000000000..a32ce7280
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/021.xhtml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.clearData during block element drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:green;}
+p + div
+ {background-color:gray;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['FAIL', 'data:text/plain,FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'],
+l = 0;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.clearData(dataTypes[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length > l)
+ {say('items.length (dragover) : FAIL' + event.dataTransfer.items.length)}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('p + div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)" ondrag="dragElement(event)"/>
+<p>Drag green box above to the navy box below and drop it. Navy box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/022.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/022.xhtml
new file mode 100644
index 000000000..1e1eb64ce
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/022.xhtml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.clearData during canvas drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['FAIL', 'data:text/plain,FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'],
+l = 0;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.clearData(dataTypes[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length > l)
+ {say('items.length (dragover) : FAIL' + event.dataTransfer.items.length)}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length < l)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)" ondrag="dragElement(event)">Canvas</canvas>
+</p>
+<p>Drag canvas pattern to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+data[1] = canvas.toDataURL('image/png');
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/023.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/023.xhtml
new file mode 100644
index 000000000..bf58316e6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/023.xhtml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.clearData and reload during block element drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:green;}
+p + div
+ {background-color:gray;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['FAIL', 'data:text/plain,FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.clearData(dataTypes[i]);}
+ window.location.reload();}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ }
+function dataDrop(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('p + div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)" ondrag="dragElement(event)"/>
+<p>Drag green box above to the navy box below and drop it. Navy box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/024.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/024.xhtml
new file mode 100644
index 000000000..5629bd746
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/024.xhtml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Clear datastore data during PNG image drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:text/plain,FAIL', 'FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ event.dataTransfer.clearData();
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length != 0)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><img ondragstart="start(event)" ondrag="dragElement(event)" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag circle above to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/025.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/025.xhtml
new file mode 100644
index 000000000..7ac04e6e3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/025.xhtml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Clear datastore data during SVG image drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E', 'FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ event.dataTransfer.clearData();
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length != 0)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><img ondragstart="start(event)" ondrag="dragElement(event)" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle"/></p>
+<p>Drag circle above to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/026.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/026.xhtml
new file mode 100644
index 000000000..8b2fd3714
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/026.xhtml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Clear datastore data during text input selection drag and drop</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['FAIL', 'data:text/plain,FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ event.dataTransfer.clearData();
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length != 0)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragstart="start(event)" ondrag="dragElement(event)"/></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/027.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/027.xhtml
new file mode 100644
index 000000000..ecd57b3ac
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/027.xhtml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Clear datastore data during selection drag and drop</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['FAIL', 'data:text/plain,FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'],
+l = 0;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ event.dataTransfer.clearData();
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length != 0)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('span'))">
+<p><span ondragstart="start(event)" ondrag="dragElement(event)">Drag me</span></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/028.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/028.xhtml
new file mode 100644
index 000000000..e6aec005e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/028.xhtml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Clear datastore data during link drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:text/plain,FAIL', 'FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ }
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ event.dataTransfer.clearData();
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length != 0)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondrag="dragElement(event)">Drag me</a></p>
+<p>Drag link above to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/029.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/029.xhtml
new file mode 100644
index 000000000..e8471a198
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/029.xhtml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Clear datastore data during block element drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:green;}
+p + div
+ {background-color:gray;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['FAIL', 'data:text/plain,FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ event.dataTransfer.clearData();
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length != 0)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('p + div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)" ondrag="dragElement(event)"/>
+<p>Drag green box above to the navy box below and drop it. Navy box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/030.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/030.xhtml
new file mode 100644
index 000000000..31263c3f5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/030.xhtml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Clear datastore data during canvas drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['FAIL', 'data:text/plain,FAIL', '<result>FAIL</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">FAIL</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>FAIL</p></body></html>', 'FAIL'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ l = event.dataTransfer.items.length;
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ event.dataTransfer.clearData();
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length != 0)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length == 0)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == '')?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)" ondrag="dragElement(event)">Canvas</canvas>
+</p>
+<p>Drag canvas pattern to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+data[1] = canvas.toDataURL('image/png');
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/031.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/031.xhtml
new file mode 100644
index 000000000..a275fcb74
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/031.xhtml
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items during canvas drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {if(dataTypes.indexOf(event.dataTransfer.items[i-1].type) == -1)
+ {delete event.dataTransfer.items[i-1]}
+ }
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)" ondrag="dragElement(event)">Canvas</canvas>
+</p>
+<p>Drag canvas pattern to the silver box below and drop it. Silver box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+data[1] = canvas.toDataURL('image/png');
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/032.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/032.xhtml
new file mode 100644
index 000000000..9aca29597
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/032.xhtml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items during PNG image drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {if(dataTypes.indexOf(event.dataTransfer.items[i-1].type) == -1)
+ {delete event.dataTransfer.items[i-1]}
+ }
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><img ondragstart="start(event)" ondrag="dragElement(event)" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag circle above to the silver box below and drop it. Silver box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/033.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/033.xhtml
new file mode 100644
index 000000000..d7aa67d3a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/033.xhtml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items during SVG image drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {if(dataTypes.indexOf(event.dataTransfer.items[i-1].type) == -1)
+ {delete event.dataTransfer.items[i-1]}
+ }
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><img ondragstart="start(event)" ondrag="dragElement(event)" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle"/></p>
+<p>Drag circle above to the silver box below and drop it. Silver box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/034.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/034.xhtml
new file mode 100644
index 000000000..1eeb227fc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/034.xhtml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items during text input selection drag and drop</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['Drag me', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {if(dataTypes.indexOf(event.dataTransfer.items[i-1].type) == -1)
+ {delete event.dataTransfer.items[i-1]}
+ }
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragstart="start(event)" ondrag="dragElement(event)"/></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/035.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/035.xhtml
new file mode 100644
index 000000000..797f7669e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/035.xhtml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items during selection drag and drop</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['Drag me', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {if(dataTypes.indexOf(event.dataTransfer.items[i-1].type) == -1)
+ {delete event.dataTransfer.items[i-1]}
+ }
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('span'))">
+<p><span ondragstart="start(event)" ondrag="dragElement(event)">Drag me</span></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/036.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/036.xhtml
new file mode 100644
index 000000000..ce4bd16ab
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/036.xhtml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items during link drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:text/plain,1', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {if(dataTypes.indexOf(event.dataTransfer.items[i-1].type) == -1)
+ {delete event.dataTransfer.items[i-1]}
+ }
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondrag="dragElement(event)">Drag me</a></p>
+<p>Drag link above to the silver box below and drop it. Silver box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/037.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/037.xhtml
new file mode 100644
index 000000000..4a2023ac7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/037.xhtml
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items during block element drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:green;}
+p + div
+ {background-color:gray;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {if(dataTypes.indexOf(event.dataTransfer.items[i-1].type) == -1)
+ {delete event.dataTransfer.items[i-1]}
+ }
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('p + div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)" ondrag="dragElement(event)"/>
+<p>Drag green box above to the gray box below and drop it. Gray box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/038.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/038.xhtml
new file mode 100644
index 000000000..35826b0cd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/038.xhtml
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items and getData during canvas drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.items.clear();
+ event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)" ondrag="dragElement(event)">Canvas</canvas>
+</p>
+<p>Drag canvas pattern to the silver box below and drop it. Silver box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+data[1] = canvas.toDataURL('image/png');
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/039.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/039.xhtml
new file mode 100644
index 000000000..37f165fe1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/039.xhtml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items and getData during PNG image drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {delete event.dataTransfer.items[i-1]}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><img ondragstart="start(event)" ondrag="dragElement(event)" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag circle above to the silver box below and drop it. Silver box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/040.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/040.xhtml
new file mode 100644
index 000000000..19ed6e146
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/040.xhtml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items and getData during SVG image drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {delete event.dataTransfer.items[i-1]}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><img ondragstart="start(event)" ondrag="dragElement(event)" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle"/></p>
+<p>Drag circle above to the silver box below and drop it. Silver box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/041.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/041.xhtml
new file mode 100644
index 000000000..7bd22d848
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/041.xhtml
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items and getData during text input selection drag and drop</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['Drag me', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {delete event.dataTransfer.items[i-1]}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragstart="start(event)" ondrag="dragElement(event)"/></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/042.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/042.xhtml
new file mode 100644
index 000000000..945de1171
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/042.xhtml
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items and getData during selection drag and drop</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['Drag me', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {delete event.dataTransfer.items[i-1]}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('span'))">
+<p><span ondragstart="start(event)" ondrag="dragElement(event)">Drag me</span></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/043.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/043.xhtml
new file mode 100644
index 000000000..c42baa09d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/043.xhtml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items and getData during link drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:text/plain,1', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {delete event.dataTransfer.items[i-1]}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondrag="dragElement(event)">Drag me</a></p>
+<p>Drag link above to the silver box below and drop it. Silver box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/044.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/044.xhtml
new file mode 100644
index 000000000..9a1efdcc0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/044.xhtml
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.items and getData during block element drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:green;}
+p + div
+ {background-color:gray;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.items.clear();
+ event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('p + div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)" ondrag="dragElement(event)"/>
+<p>Drag green box above to the gray box below and drop it. Gray box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/045.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/045.xhtml
new file mode 100644
index 000000000..e354ff7f1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/045.xhtml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Text and url aliases</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:green;}
+p + div
+ {background-color:gray;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text', 'url', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ }
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('p + div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)" ondrag="dragElement(event)"/>
+<p>Drag green box above to the gray box below and drop it. Gray box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/046.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/046.xhtml
new file mode 100644
index 000000000..8a4a3cbae
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/046.xhtml
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.types during canvas drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.items.clear();
+ event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragstart): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrag): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragenter): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragover): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrop): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)" ondrag="dragElement(event)">Canvas</canvas>
+</p>
+<p>Drag canvas pattern to the silver box below and drop it. Silver box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+data[1] = canvas.toDataURL('image/png');
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/047.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/047.xhtml
new file mode 100644
index 000000000..fc43f811c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/047.xhtml
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.types during PNG image drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {delete event.dataTransfer.items[i-1]}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragstart): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrag): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragenter): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragover): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrop): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><img ondragstart="start(event)" ondrag="dragElement(event)" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag circle above to the silver box below and drop it. Silver box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/048.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/048.xhtml
new file mode 100644
index 000000000..49c87f722
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/048.xhtml
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.types during SVG image drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {delete event.dataTransfer.items[i-1]}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragstart): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrag): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragenter): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragover): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrop): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><img ondragstart="start(event)" ondrag="dragElement(event)" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle"/></p>
+<p>Drag circle above to the silver box below and drop it. Silver box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/049.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/049.xhtml
new file mode 100644
index 000000000..5c810dd2a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/049.xhtml
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.types during text input selection drag and drop</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['Drag me', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {delete event.dataTransfer.items[i-1]}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragstart): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrag): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragenter): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragover): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrop): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragstart="start(event)" ondrag="dragElement(event)"/></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/050.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/050.xhtml
new file mode 100644
index 000000000..33e41c653
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/050.xhtml
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.types during selection drag and drop</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['Drag me', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {delete event.dataTransfer.items[i-1]}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragstart): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrag): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragenter): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragover): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrop): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('span'))">
+<p><span ondragstart="start(event)" ondrag="dragElement(event)">Drag me</span></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/051.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/051.xhtml
new file mode 100644
index 000000000..f073c6078
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/051.xhtml
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.types during link drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:text/plain,1', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {delete event.dataTransfer.items[i-1]}
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragstart): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrag): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragenter): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragover): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrop): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondrag="dragElement(event)">Drag me</a></p>
+<p>Drag link above to the silver box below and drop it. Silver box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/052.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/052.xhtml
new file mode 100644
index 000000000..65983990f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/052.xhtml
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataTransfer.types during block element drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:green;}
+p + div
+ {background-color:gray;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+e = 0, result = true;
+function start(event)
+ {event.dataTransfer.items.clear();
+ event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.items.add(data[i],dataTypes[i])}
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondragstart): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragstart): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ }
+function dragElement(event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrag): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function enterElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragenter): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ }
+function overElement(event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondragover): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ }
+function dataDrop(event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ if(event.dataTransfer.types.length != dataTypes.length)
+ {say('types.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.types[i] != dataTypes[i])
+ {say('Types (ondrop): FAIL (dataTransfer.types[' + i + '] returns wrong value)')}
+ if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData (ondrop): FAIL (getData(' + dataTypes[i] + ') returns wrong data)')}
+ }
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ document.querySelector('p + div').setAttribute('style','background-color:' + (result?'green':'red'));}
+function say(it)
+ {result = false;
+ document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)" ondrag="dragElement(event)"/>
+<p>Drag green box above to the gray box below and drop it. Gray box should turn green.</p>
+<div ondragenter="enterElement(event)" ondragover="overElement(event)" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/053.html b/testing/web-platform/tests/html/editing/dnd/datastore/053.html
new file mode 100644
index 000000000..9f1a0d730
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/053.html
@@ -0,0 +1,83 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Adding a file to dnd data store</title>
+ <style type="text/css">
+span { display: inline-block; height: 100px; width: 100px; background: orange; }
+span + span { background: blue; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('span')[0];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'copy';
+ var filein = document.getElementsByTagName('input')[0];
+ if( !filein.files ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file API is not supported.';
+ return;
+ }
+ if( !filein.files[0] ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - no file was found in the file input.';
+ return;
+ }
+ var thefile = filein.files[0];
+ try {
+ e.dataTransfer.items.add(thefile);
+ } catch(err) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - error when adding file';
+ e.preventDefault();
+ return;
+ }
+ if( e.dataTransfer.files.length != 1 ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file was not attached to data store';
+ e.preventDefault();
+ return;
+ }
+ };
+ var drop = document.getElementsByTagName('span')[1];
+ drop.ondragenter = drop.ondragover = function (e) {
+ e.preventDefault();
+ };
+ drop.ondrop = function (e) {
+ e.preventDefault();
+ if( document.getElementsByTagName('p')[0].innerHTML ) { return; }
+ if( e.dataTransfer.files.length != 1 ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file was not attached to data store during drop';
+ e.preventDefault();
+ return;
+ }
+ if( !window.FileReader ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'No FileReader constructor';
+ e.preventDefault();
+ return;
+ }
+ var reader = new FileReader();
+ reader.onload = function () {
+ if( !reader.result ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'No file data after load';
+ } else if( !document.getElementsByTagName('p')[0].innerHTML ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'PASS';
+ }
+ };
+ reader.readAsBinaryString(e.dataTransfer.files[0]);
+ setTimeout(function () {
+ if( !reader.result ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'No file data after timeout';
+ }
+ },1000);
+ };
+};
+ </script>
+ </head>
+ <body>
+ <ol>
+ <li>Select a non-empty file on your computer using the following input: <input type="file"></li>
+ <li>Drag the orange square onto the blue square and release it:<br><span draggable="true"></span> <span></span><br>
+ If a prompt appears, accept it.</li>
+ <li>Fail if new text does not appear below.</li>
+ </ol>
+ <p></p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/054.html b/testing/web-platform/tests/html/editing/dnd/datastore/054.html
new file mode 100644
index 000000000..0c6a1200a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/054.html
@@ -0,0 +1,83 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Adding a file to dnd data store with drag out of window</title>
+ <style type="text/css">
+span { display: inline-block; height: 100px; width: 100px; background: orange; }
+span + span { background: blue; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('span')[0];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'copy';
+ var filein = document.getElementsByTagName('input')[0];
+ if( !filein.files ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file API is not supported.';
+ return;
+ }
+ if( !filein.files[0] ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - no file was found in the file input.';
+ return;
+ }
+ var thefile = filein.files[0];
+ try {
+ e.dataTransfer.items.add(thefile);
+ } catch(err) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - error when adding file';
+ e.preventDefault();
+ return;
+ }
+ if( e.dataTransfer.files.length != 1 ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file was not attached to data store';
+ e.preventDefault();
+ return;
+ }
+ };
+ var drop = document.getElementsByTagName('span')[1];
+ drop.ondragenter = drop.ondragover = function (e) {
+ e.preventDefault();
+ };
+ drop.ondrop = function (e) {
+ e.preventDefault();
+ if( document.getElementsByTagName('p')[0].innerHTML ) { return; }
+ if( e.dataTransfer.files.length != 1 ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file was not attached to data store during drop';
+ e.preventDefault();
+ return;
+ }
+ if( !window.FileReader ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'No FileReader constructor';
+ e.preventDefault();
+ return;
+ }
+ var reader = new FileReader();
+ reader.onload = function () {
+ if( !reader.result ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'No file data after load';
+ } else if( !document.getElementsByTagName('p')[0].innerHTML ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'PASS';
+ }
+ };
+ reader.readAsBinaryString(e.dataTransfer.files[0]);
+ setTimeout(function () {
+ if( !reader.result ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'No file data after timeout';
+ }
+ },1000);
+ };
+};
+ </script>
+ </head>
+ <body>
+ <ol>
+ <li>Select a non-empty file on your computer using the following input: <input type="file"></li>
+ <li>Drag the orange square outside the browser window (not over the taskbar), then back onto the blue square and release it:<br><span draggable="true"></span> <span></span><br>
+ If a prompt appears, accept it.</li>
+ <li>Fail if new text does not appear below.</li>
+ </ol>
+ <p></p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/055.html b/testing/web-platform/tests/html/editing/dnd/datastore/055.html
new file mode 100644
index 000000000..570571e9b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/055.html
@@ -0,0 +1,46 @@
+<!doctype html>
+<html>
+ <head>
+ <title>text/uri-list conversion</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0], fails = [];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('url','http://example.com/');
+ if( !e.dataTransfer.getData('url') ) {
+ document.getElementsByTagName('p')[0].innerHTML = "FAIL - getData('url') returned nothing";
+ } else if( e.dataTransfer.getData('url') != e.dataTransfer.getData('text/uri-list') ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - text/uri-list is not the same as url';
+ } else {
+
+ e.dataTransfer.setData('url','#foo\r\n http://example.com/#bar \r\n http://example.org/');
+ if( e.dataTransfer.getData('url') != 'http://example.com/#bar' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - only the first URL should be returned - "'+e.dataTransfer.getData('url')+'"';
+ } else if( e.dataTransfer.getData('text/uri-list') != '#foo\r\n http://example.com/#bar \r\n http://example.org/' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - text/uri-list should return the full data';
+ } else {
+
+ e.dataTransfer.setData('url',' ');
+ if( e.dataTransfer.getData('url') ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - space was not a valid URL so an empty string should have been returned';
+ } else {
+ document.getElementsByTagName('p')[0].innerHTML = 'PASS';
+ }
+
+ }
+
+ }
+ e.preventDefault();
+ };
+};
+ </script>
+ </head>
+ <body>
+ <div draggable="true"></div>
+ <p>Attempt to drag the orange square.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/056.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/056.xhtml
new file mode 100644
index 000000000..dd85dbe88
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/056.xhtml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Caseinsensitivity in dataTransfer.setData/getData</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:text/plain,1', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData((i%2 == 0)?(dataTypes[i].toUpperCase()):(dataTypes[i].replace(/i/g,'I')), data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ }
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData((i%2 == 0)?(dataTypes[i].replace(/t/g,'T')):(dataTypes[i].toUpperCase())) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondrag="dragElement(event)">Drag me</a></p>
+<p>Drag link above to the silver box below and drop it. Silver box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/057.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/057.xhtml
new file mode 100644
index 000000000..4c6f6f579
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/057.xhtml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Various data item type strings in dataTransfer.setData/getData</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'http://', '<?xml version="1.0" encoding="utf-8"?>', '<html xmlns="http://www.w3.org/1999/xhtml"/>', '<mn>1</mn>', '☺', 'type="text/html"', '[({#;:,.`~*-_=+\|/%!?&$@^})]'],
+data = ['Drag me', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ say('items.length (dragstart) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ }
+function dragElement(event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ }
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(string' + i + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('div').setAttribute('style','background-color:green');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('span'))">
+<p><span ondragstart="start(event)" ondrag="dragElement(event)">Drag me</span></p>
+<p>Drag selection above to the navy box below and drop it. Navy box should turn green and test results should appear below.</p>
+<div ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)"/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/058.html b/testing/web-platform/tests/html/editing/dnd/datastore/058.html
new file mode 100644
index 000000000..1bf9e5801
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/058.html
@@ -0,0 +1,79 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dropping file into dropzone</title>
+ <style type="text/css">
+span { display: inline-block; height: 100px; width: 100px; background: orange; }
+span + span { background: blue; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('span')[0];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'copy';
+ var filein = document.getElementsByTagName('input')[0];
+ if( !filein.files ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file API is not supported.';
+ return;
+ }
+ if( !filein.files[0] ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - no file was found in the file input.';
+ return;
+ }
+ var thefile = filein.files[0];
+ try {
+ e.dataTransfer.items.add(thefile);
+ } catch(err) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - error when adding file';
+ e.preventDefault();
+ return;
+ }
+ if( e.dataTransfer.files.length != 1 ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file was not attached to data store';
+ e.preventDefault();
+ return;
+ }
+ };
+ document.getElementsByTagName('span')[1].ondrop = function (e) {
+ e.preventDefault();
+ if( document.getElementsByTagName('p')[0].innerHTML ) { return; }
+ if( e.dataTransfer.files.length != 1 ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file was not attached to data store during drop';
+ e.preventDefault();
+ return;
+ }
+ if( !window.FileReader ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'No FileReader constructor';
+ e.preventDefault();
+ return;
+ }
+ var reader = new FileReader();
+ reader.onload = function () {
+ if( !reader.result ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'No file data after load';
+ } else if( !document.getElementsByTagName('p')[0].innerHTML ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'PASS';
+ }
+ };
+ reader.readAsBinaryString(e.dataTransfer.files[0]);
+ setTimeout(function () {
+ if( !reader.result ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'No file data after timeout';
+ }
+ },1000);
+ };
+};
+ </script>
+ </head>
+ <body>
+ <ol>
+ <li>Select a non-empty plain text file on your computer using the following input: <input type="file"></li>
+ <li>Drag the orange square onto the blue square and release it:<br><span draggable="true"></span> <span dropzone="copy file:text/plain"></span><br>
+ If a prompt appears, accept it.</li>
+ <li>Fail if new text does not appear below.</li>
+ </ol>
+ <p></p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/datastore/helper-drop-box-here.xhtml b/testing/web-platform/tests/html/editing/dnd/datastore/helper-drop-box-here.xhtml
new file mode 100644
index 000000000..70341c5c6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/datastore/helper-drop-box-here.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop datastore: helper file</title>
+<style type="text/css">
+html, body
+ {height:100%;}
+</style>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/plain', 'text/uri-list', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['PASS', 'data:text/plain,1', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'];
+function enterElement(event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ say('items.length (dragenter) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));}
+function dataDrop(event)
+ {say('items.length (drop) : ' + ((event.dataTransfer.items.length >= dataTypes.length)?'PASS':'FAIL'));
+ for(var i = 0; i != dataTypes.length; i++)
+ {say('getData(' + dataTypes[i] + ') : ' + ((event.dataTransfer.getData(dataTypes[i]) == data[i])?'PASS':'FAIL'));}
+ document.querySelector('body').setAttribute('style','background-color:teal;color:white;');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+]]>
+</script>
+</head>
+<body ondragenter="enterElement(event)" ondragover="return false;" ondrop="dataDrop(event)">
+<p>Drop box here. Frame should turn green and test results should appear below.</p>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dom/draggable.html b/testing/web-platform/tests/html/editing/dnd/dom/draggable.html
new file mode 100644
index 000000000..600b0ee35
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dom/draggable.html
@@ -0,0 +1,207 @@
+<!DOCTYPE html>
+<meta charset='utf-8'>
+<title>drag &amp; drop – draggable attribute</title>
+<style>div#test_elements { display: none; }</style>
+
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+
+<noscript><p>Enable JavaScript and reload.</p></noscript>
+
+<div id='log'></div>
+
+<div id='test_elements'>
+
+ <div id='defaults'>
+ <a href='#'>.</a>
+ <div></div>
+ <img src='../resources/1x1-transparent.gif'>
+ </div>
+
+ <div id='draggable'>
+ <a draggable='true' href='#'>.</a>
+ <div draggable='true'></div>
+ <img draggable='true' src='../resources/1x1-transparent.gif'>
+ </div>
+
+ <div id='draggable_false'>
+ <a draggable='false' href='#'>.</a>
+ <div draggable='false'></div>
+ <img draggable='false' src='../resources/1x1-transparent.gif'>
+ </div>
+
+ <div id='draggable_auto'>
+ <a draggable='auto' href='#'>.</a>
+ <div draggable='auto'></div>
+ <img draggable='auto' src='../resources/1x1-transparent.gif'>
+ </div>
+
+ <div id='draggable_foo'>
+ <a draggable='foo' href='#'>.</a>
+ <div draggable='foo'></div>
+ <img draggable='foo' src='../resources/1x1-transparent.gif'>
+ </div>
+
+ <div id='changable_true'>
+ <a href='#'>.</a>
+ <div></div>
+ <img src='../resources/1x1-transparent.gif'>
+ </div>
+
+ <div id='changable_false'>
+ <a href='#'>.</a>
+ <div></div>
+ <img src='../resources/1x1-transparent.gif'>
+ </div>
+
+ <div id='changable_foo'>
+ <a href='#'>.</a>
+ <div></div>
+ <img src='../resources/1x1-transparent.gif'>
+ </div>
+
+
+</div>
+
+<script>
+var foo = document.getElementById('foo');
+
+/* Does the .draggable property exist? */
+test(function () {
+ assert_idl_attribute(document.querySelector('#defaults a'), 'draggable');
+}, 'an <a> element should have a draggable property');
+
+test(function () {
+ assert_idl_attribute(document.querySelector('#defaults div'), 'draggable');
+}, 'a <div> element should have a draggable property');
+
+test(function () {
+ assert_idl_attribute(document.querySelector('#defaults img'), 'draggable');
+}, 'an <img> element should have a draggable property');
+
+
+/* Check the default values on different types of elements */
+test(function () {
+ assert_true(document.querySelector('#defaults a').draggable);
+}, 'an <a> element should be draggable by default');
+
+test(function () {
+ assert_false(document.querySelector('#defaults div').draggable);
+}, 'a <div> element should not be draggable by default');
+
+test(function () {
+ assert_true(document.querySelector('#defaults img').draggable);
+}, 'an <img> element should be draggable by default');
+
+
+/* If draggable="true" is set, all the elements should be draggable */
+test(function () {
+ assert_true(document.querySelector('#draggable a').draggable);
+}, 'an <a> element with draggable="true" should be draggable');
+
+test(function () {
+ assert_true(document.querySelector('#draggable div').draggable);
+}, 'a <div> element with draggable="true" should be draggable');
+
+test(function () {
+ assert_true(document.querySelector('#draggable img').draggable);
+}, 'an <img> element with draggable="true" should be draggable');
+
+
+/* If draggable="false" is set, none of the elements should be draggable */
+test(function () {
+ assert_false(document.querySelector('#draggable_false a').draggable);
+}, 'an <a> element with draggable="false" should not be draggable');
+
+test(function () {
+ assert_false(document.querySelector('#draggable_false div').draggable);
+}, 'a <div> element with draggable="false" should not be draggable');
+
+test(function () {
+ assert_false(document.querySelector('#draggable_false img').draggable);
+}, 'an <img> element with draggable="false" should not be draggable');
+
+
+/* If draggable="auto" is set, fall back to the defaults */
+test(function () {
+ assert_true(document.querySelector('#draggable_auto a').draggable);
+}, 'an <a> element with draggable="auto" should be draggable');
+
+test(function () {
+ assert_false(document.querySelector('#draggable_auto div').draggable);
+}, 'a <div> element with draggable="auto" should not be draggable');
+
+test(function () {
+ assert_true(document.querySelector('#draggable_auto img').draggable);
+}, 'an <img> element with draggable="auto" should be draggable');
+
+
+/* If draggable="foo" is set, fall back to the defaults */
+test(function () {
+ assert_true(document.querySelector('#draggable_foo a').draggable);
+}, 'an <a> element with draggable="foo" should be draggable');
+
+test(function () {
+ assert_false(document.querySelector('#draggable_foo div').draggable);
+}, 'a <div> element with draggable="foo" should not be draggable');
+
+test(function () {
+ assert_true(document.querySelector('#draggable_foo img').draggable);
+}, 'an <img> element with draggable="foo" should be draggable');
+
+
+/* Setting the element.droppable attribute to true for all elements */
+test(function () {
+ document.querySelector('#changable_true a').draggable = true;
+ assert_true(document.querySelector('#changable_true a').draggable);
+}, 'an <a> element with the draggable property set to true through a script should be draggable');
+
+test(function () {
+ document.querySelector('#changable_true div').draggable = true;
+ assert_true(document.querySelector('#changable_true div').draggable);
+}, 'a <div> element with the draggable property set to true through a script should be draggable');
+
+test(function () {
+ document.querySelector('#changable_true img').draggable = true;
+ assert_true(document.querySelector('#changable_true img').draggable);
+}, 'an <img> element with the draggable property set to true through a script should be draggable');
+
+
+/* Setting the element.droppable attribute to false for all elements */
+test(function () {
+ document.querySelector('#changable_false a').draggable = false;
+ assert_false(document.querySelector('#changable_false a').draggable);
+}, 'an <a> element with the draggable property set to false through a script should not be draggable');
+
+test(function () {
+ document.querySelector('#changable_false div').draggable = false;
+ assert_false(document.querySelector('#changable_false div').draggable);
+}, 'a <div> element with the draggable property set to false through a script should not be draggable');
+
+test(function () {
+ document.querySelector('#changable_false img').draggable = false;
+ assert_false(document.querySelector('#changable_false img').draggable);
+}, 'an <img> element with the draggable property set to false through a script should not be draggable');
+
+
+/* Setting the element.droppable attribute to "foo" for all elements */
+test(function () {
+ document.querySelector('#changable_foo a').draggable = 'foo';
+ assert_true(document.querySelector('#changable_foo a').draggable);
+}, 'an <a> element with the draggable property set to "foo" through a script should be draggable');
+
+test(function () {
+ document.querySelector('#changable_foo div').draggable = 'auto';
+ assert_true(document.querySelector('#changable_foo div').draggable);
+}, 'a <div> element with the draggable property set to "foo" through a script should be draggable');
+
+test(function () {
+ document.querySelector('#changable_foo img').draggable = 'foo';
+ assert_true(document.querySelector('#changable_foo img').draggable);
+}, 'an <img> element with the draggable property set to "foo" through a script should be draggable');
+</script>
+
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/dom/events.html b/testing/web-platform/tests/html/editing/dnd/dom/events.html
new file mode 100644
index 000000000..e2b521f27
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dom/events.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<meta charset='utf-8'>
+<title>drag &amp; drop – events</title>
+
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+
+
+<noscript><p>Enable JavaScript and reload.</p></noscript>
+
+<div id='log'></div>
+
+<script>
+
+var element = document.createElement('div');
+
+test(function () {
+ assert_equals(element.ondragstart, null);
+}, 'element.ondragstart initial value');
+
+test(function () {
+ assert_equals(element.ondrag, null);
+}, 'element.ondrag must initial value');
+
+test(function () {
+ assert_equals(element.ondragenter, null);
+}, 'element.ondragenter initial value');
+
+test(function () {
+ assert_equals(element.ondragleave, null);
+}, 'element.ondragleave initial value');
+
+test(function () {
+ assert_equals(element.ondragover, null);
+}, 'element.ondragover initial value');
+
+test(function () {
+ assert_equals(element.ondrop, null);
+}, 'element.ondrop initial value');
+
+test(function () {
+ assert_equals(element.ondragend, null);
+}, 'element.ondragend initial value');
+
+</script>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/dom/specials.html b/testing/web-platform/tests/html/editing/dnd/dom/specials.html
new file mode 100644
index 000000000..e83eb68aa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dom/specials.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Exposing drag &amp; drop events on document and window</title>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+
+ <div id="log">Enable script and reload</div>
+ <script type="text/javascript">
+var allEvents = ['ondragstart','ondrag','ondragover','ondragenter','ondragleave','ondrop','ondragend'];
+var allObjects = [['window',window],['document',document],['HTMLElement',document.createElement('div')]];
+var fails = [];
+for( var i = 0; i < allObjects.length; i++ ) {
+ for( var j = 0; j < allEvents.length; j++ ) {
+ test(function () {
+ assert_true(allEvents[j] in allObjects[i][1]);
+ }, allEvents[j] + ' in ' + allObjects[i][0]);
+ }
+}
+ </script>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/draggable-areas/border-radius.html b/testing/web-platform/tests/html/editing/dnd/draggable-areas/border-radius.html
new file mode 100644
index 000000000..f767850f9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/draggable-areas/border-radius.html
@@ -0,0 +1,25 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – draggable area boundaries, border-radius</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ border-radius: 100px;
+}
+div {
+ border: 1px solid black;
+ height: 200px;
+ width: 200px;
+}
+</style>
+
+<ol>
+ <li>Try dragging the white area within the black square, outside the blue
+ circle. It should <em>not</em> be draggable.</li>
+ <li>Drag the blue circle below. It should be draggable.</li>
+</ol>
+
+<div><a draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'"></a></div>
diff --git a/testing/web-platform/tests/html/editing/dnd/draggable-areas/border.html b/testing/web-platform/tests/html/editing/dnd/draggable-areas/border.html
new file mode 100644
index 000000000..1b6f8e955
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/draggable-areas/border.html
@@ -0,0 +1,16 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – draggable areas – border</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ border: 10px solid orange;
+}
+</style>
+
+<p>Try dragging the orange border of the blue box below, in a downwards direction. It should be draggable.</p>
+
+<a href='#' draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'"></a>
diff --git a/testing/web-platform/tests/html/editing/dnd/draggable-areas/box-shadow.html b/testing/web-platform/tests/html/editing/dnd/draggable-areas/box-shadow.html
new file mode 100644
index 000000000..4fc40cb0f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/draggable-areas/box-shadow.html
@@ -0,0 +1,16 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – draggable areas – box-shadow</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ box-shadow: 10px 10px 0 orange;
+}
+</style>
+
+<p>Try dragging the orange area along the sides of the blue box below. It should <em>not</em> be draggable.</p>
+
+<a href='#' draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'"></a>
diff --git a/testing/web-platform/tests/html/editing/dnd/draggable-areas/outline.html b/testing/web-platform/tests/html/editing/dnd/draggable-areas/outline.html
new file mode 100644
index 000000000..8872997fc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/draggable-areas/outline.html
@@ -0,0 +1,16 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – draggable areas – outline</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ outline: 10px solid orange;
+}
+</style>
+
+<p>Try dragging the orange border of the blue box below. It should <em>not</em> be draggable.</p>
+
+<a href='#' draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'"></a>
diff --git a/testing/web-platform/tests/html/editing/dnd/draggable-areas/transform.html b/testing/web-platform/tests/html/editing/dnd/draggable-areas/transform.html
new file mode 100644
index 000000000..6800c64ad
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/draggable-areas/transform.html
@@ -0,0 +1,22 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – draggable area boundaries – transformed elements</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ margin-left: 100px;
+ -moz-transform: rotate(-45deg) skew(15deg, 15deg);
+ -o-transform: rotate(-45deg) skew(15deg, 15deg);
+ -webkit-transform: rotate(-45deg) skew(15deg, 15deg);
+ transform: rotate(-45deg) skew(15deg, 15deg);
+}
+</style>
+<ol>
+ <li>Try dragging the blue box below by clicking and holding <em>just</em>
+ outside its skewed edges. It should <em>not</em> be draggable.</li>
+ <li><p>Drag the blue box below. It should be draggable.</p>
+
+<a draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'">TEST</a>
diff --git a/testing/web-platform/tests/html/editing/dnd/draggable-areas/z-index.html b/testing/web-platform/tests/html/editing/dnd/draggable-areas/z-index.html
new file mode 100644
index 000000000..b1f08cb78
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/draggable-areas/z-index.html
@@ -0,0 +1,35 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay for heavily styled elements – 008</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ position: absolute;
+ top: 100px;
+ left: 10px;
+ z-index: 1;
+}
+
+div {
+ background-color: orange;
+ position: absolute;
+ height: 200px;
+ width: 200px;
+ top: 150px;
+ left: 20px;
+ z-index: 2;
+ opacity: 0.9;
+}
+
+
+</style>
+
+<p>Click and hold the part of the orange box that overlaps the blue box. Then
+move your pointing device. The blue box should <em>not</em> be dragged.
+
+<a draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'">TEST</a>
+
+<div></div>
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/001.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/001.xhtml
new file mode 100644
index 000000000..970e077e6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/001.xhtml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: allowed effects 'copy','move','link'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'], i = 0;
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[i] &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;
+ selectText();}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i]}
+</script>
+</head>
+<body onload="selectText()">
+<p ondragstart="start(event)">Drag me</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/002.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/002.xhtml
new file mode 100644
index 000000000..13c64251a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/002.xhtml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Text input selection drag and drop: allowed effects 'copy','move','link'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'], i = 0;
+function selectText()
+ {document.querySelector('input').select()}
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[i] &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;
+ selectText();}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i]}
+</script>
+</head>
+<body onload="selectText()">
+<p><input value="Drag me" ondragstart="start(event)"/></p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/003.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/003.xhtml
new file mode 100644
index 000000000..44b907ac7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/003.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop: allowed effects 'copy','move','link'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'], i = 0;
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[i] &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i]}
+</script>
+</head>
+<body onload="selectText()">
+<p><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag link and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/004.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/004.xhtml
new file mode 100644
index 000000000..7376d045b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/004.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>PNG image drag and drop: allowed effects 'copy','move','link'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'], i = 0;
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[i] &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i]}
+</script>
+</head>
+<body onload="selectText()">
+<p><img ondragstart="start(event)" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag circle and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/005.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/005.xhtml
new file mode 100644
index 000000000..c74572f0e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/005.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>SVG image drag and drop: allowed effects 'copy','move','link'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'], i = 0;
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[i] &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i]}
+</script>
+</head>
+<body onload="selectText()">
+<p><img ondragstart="start(event)" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle"/></p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag circle and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/006.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/006.xhtml
new file mode 100644
index 000000000..03deb62f2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/006.xhtml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Canvas drag and drop: allowed effects 'copy','move','link'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'], i = 0;
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[i] &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i]}
+</script>
+</head>
+<body onload="selectText()">
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)" ondragenter="event.preventDefault()" ondragover="return false" ondrop="addImage(event)">Canvas</canvas>
+</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag canvas pattern and drop it onto any of the green boxes.</p>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/007.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/007.xhtml
new file mode 100644
index 000000000..0072eb123
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/007.xhtml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: allowed effects 'copy','copyLink','copyMove'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','copyLink','copyMove'], i = 0;
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == 'copy' &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;
+ selectText();}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i]}
+</script>
+</head>
+<body onload="selectText()">
+<p ondragstart="start(event)">Drag me</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/008.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/008.xhtml
new file mode 100644
index 000000000..79b743ff9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/008.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop: allowed effects 'link','linkMove','uninitialized'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['link','linkMove','copyMove'], i = 0;
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[i].substring(0,4) &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i]}
+</script>
+</head>
+<body onload="selectText()">
+<p><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag link and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/009.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/009.xhtml
new file mode 100644
index 000000000..fcd38df4a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/009.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Text input selection drag and drop: allowed effects 'move','uninitialized'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+</style>
+<script type="application/ecmascript">
+var effects = ['move','uninitialized'], i = 0;
+function selectText()
+ {document.querySelector('input').select()}
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == 'move' &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%2;
+ selectText();}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i];
+ event.dataTransfer.dropEffect = 'move'}
+</script>
+</head>
+<body onload="selectText()">
+<p><input value="Drag me" ondragstart="start(event)"/></p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/010.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/010.xhtml
new file mode 100644
index 000000000..50fc1e236
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/010.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: allowed effects 'all','uninitialized'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+</style>
+<script type="application/ecmascript">
+var effects = ['all','uninitialized'], i = 0;
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == 'copy' &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%2;
+ selectText();}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i]}
+</script>
+</head>
+<body onload="selectText()">
+<p ondragstart="start(event)">Drag me</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/011.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/011.xhtml
new file mode 100644
index 000000000..aa8c411c7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/011.xhtml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: allowed effects 'link','copyLink','linkMove'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['link','copyLink','linkMove'], i = 0;
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[i].substring(0,4) &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;
+ selectText();}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i];}
+</script>
+</head>
+<body onload="selectText()">
+<p ondragstart="start(event)">Drag me</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/012.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/012.xhtml
new file mode 100644
index 000000000..e5b4b7b55
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/012.xhtml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: allowed effects 'move','copyMove','linkMove'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['move','copyMove','linkMove'], i = 0;
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[i].substring(0,4) &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;
+ selectText();}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i];}
+</script>
+</head>
+<body onload="selectText()">
+<p ondragstart="start(event)">Drag me</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/013.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/013.xhtml
new file mode 100644
index 000000000..629b66ddd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/013.xhtml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: allowed effects 'copy','all','uninitialized'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','all','uninitialized'], i = 0;
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == 'copy' &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;
+ selectText();}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i]}
+</script>
+</head>
+<body onload="selectText()">
+<p ondragstart="start(event)">Drag me</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/014.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/014.xhtml
new file mode 100644
index 000000000..93747099e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/014.xhtml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: allowed effects 'copy','copyMove','invalid'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','all','uninitialized'], i = 0;
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == 'copy' &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;
+ selectText();}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i]}
+</script>
+</head>
+<body onload="selectText()">
+<p ondragstart="start(event)">Drag me</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/015.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/015.xhtml
new file mode 100644
index 000000000..23b4b43ee
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/015.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: dropzone 'copy','move' and 'link'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'];
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event,element)
+ {document.querySelectorAll('div')[element].appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[element])?' PASS ':' FAIL '));
+ selectText();}
+</script>
+</head>
+<body onload="selectText()">
+<div ondrop="dropSelection(event,0)" dropzone="copy string:text/plain"/>
+<div ondrop="dropSelection(event,1)" dropzone="move string:text/plain"/>
+<div ondrop="dropSelection(event,2)" dropzone="link string:text/plain"/>
+<p>Drag me</p>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/016.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/016.xhtml
new file mode 100644
index 000000000..23fc81907
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/016.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Text input selection drag and drop: dropzone 'copy','move' and 'link'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'];
+function selectText()
+ {document.querySelector('input').select()}
+function dropSelection(event,element)
+ {document.querySelectorAll('div')[element].appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[element])?' PASS ':' FAIL '));
+ selectText();}
+</script>
+</head>
+<body onload="selectText()">
+<div ondrop="dropSelection(event,0)" dropzone="copy string:text/plain"/>
+<div ondrop="dropSelection(event,1)" dropzone="move string:text/plain"/>
+<div ondrop="dropSelection(event,2)" dropzone="link string:text/plain"/>
+<p><input value="Drag me"/></p>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/017.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/017.xhtml
new file mode 100644
index 000000000..a9dd0d74d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/017.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop: dropzone 'copy','move' and 'link'</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'];
+function dropSelection(event,element)
+ {document.querySelectorAll('div')[element].appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[element])?' PASS ':' FAIL '));}
+</script>
+</head>
+<body>
+<div ondrop="dropSelection(event,0)" dropzone="copy string:text/uri-list"/>
+<div ondrop="dropSelection(event,1)" dropzone="move string:text/uri-list"/>
+<div ondrop="dropSelection(event,2)" dropzone="link string:text/uri-list"/>
+<p><a href="data:text/plain,1">Drag me</a></p>
+<p>You should be able to drag link and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/018.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/018.xhtml
new file mode 100644
index 000000000..055448f1d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/018.xhtml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: setting dropzone attribute ondragstart</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'];
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event,element)
+ {document.querySelectorAll('div')[element].appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[element])?' PASS ':' FAIL '));
+ selectText();}
+function start(event)
+ {for(var i = 0; i != 3; i++)
+ {document.querySelectorAll('div')[i].setAttribute('dropzone',effects[i] + ' string:text/plain')}
+ }
+</script>
+</head>
+<body onload="selectText()">
+<div ondrop="dropSelection(event,0)"/>
+<div ondrop="dropSelection(event,1)"/>
+<div ondrop="dropSelection(event,2)"/>
+<p ondragstart="start(event)">Drag me</p>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/019.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/019.xhtml
new file mode 100644
index 000000000..5dd86f211
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/019.xhtml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Text input selection drag and drop: setting dropzone attribute ondragstart</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'];
+function selectText()
+ {document.querySelector('input').select()}
+function dropSelection(event,element)
+ {document.querySelectorAll('div')[element].appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[element])?' PASS ':' FAIL '));
+ selectText();}
+function start(event)
+ {for(var i = 0; i != 3; i++)
+ {document.querySelectorAll('div')[i].setAttribute('dropzone',effects[i] + ' string:text/plain')}
+ }
+</script>
+</head>
+<body onload="selectText()">
+<div ondrop="dropSelection(event,0)"/>
+<div ondrop="dropSelection(event,1)"/>
+<div ondrop="dropSelection(event,2)"/>
+<p ondragstart="start(event)"><input value="Drag me" ondragstart="start(event)"/></p>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/020.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/020.xhtml
new file mode 100644
index 000000000..8fa4c0622
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/020.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop: setting dropzone attribute ondragstart</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'];
+function dropSelection(event,element)
+ {document.querySelectorAll('div')[element].appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[element])?' PASS ':' FAIL '));}
+function start(event)
+ {for(var i = 0; i != 3; i++)
+ {document.querySelectorAll('div')[i].setAttribute('dropzone',effects[i] + ' string:text/uri-list')}
+ }
+</script>
+</head>
+<body>
+<div ondrop="dropSelection(event,0)"/>
+<div ondrop="dropSelection(event,1)"/>
+<div ondrop="dropSelection(event,2)"/>
+<p ondragstart="start(event)"><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<p>You should be able to drag link and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/021.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/021.xhtml
new file mode 100644
index 000000000..5e9f24928
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/021.xhtml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: removing dropzone attribute ondragstart</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:maroon;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:purple;}
+div:nth-child(3)
+ {background-color:fuchsia;}
+</style>
+<script type="application/ecmascript">
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event,element)
+ {document.querySelectorAll('div')[element].appendChild(document.createTextNode(' FAIL '));
+ selectText();}
+function start(event)
+ {for(var i = 0; i != 3; i++)
+ {document.querySelectorAll('div')[i].removeAttribute('dropzone')}
+ }
+</script>
+</head>
+<body onload="selectText()">
+<div ondrop="dropSelection(event,0)" dropzone="copy string:text/plain"/>
+<div ondrop="dropSelection(event,1)" dropzone="move string:text/plain"/>
+<div ondrop="dropSelection(event,2)" dropzone="link string:text/plain"/>
+<p ondragstart="start(event)">Drag me</p>
+<p>You should not be able to drop selection onto any of the red boxes above.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/022.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/022.xhtml
new file mode 100644
index 000000000..ed1b02659
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/022.xhtml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: changing dropzone attribute ondragstart</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'];
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event,element)
+ {document.querySelectorAll('div')[element].appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[element])?' PASS ':' FAIL '));
+ selectText();}
+function start(event)
+ {for(var i = 0; i != 3; i++)
+ {document.querySelectorAll('div')[i].setAttribute('dropzone',effects[i] + ' string:text/plain')}
+ }
+</script>
+</head>
+<body onload="selectText()">
+<div ondrop="dropSelection(event,0)" dropzone="link string:text/plain"/>
+<div ondrop="dropSelection(event,1)" dropzone="copy string:text/plain"/>
+<div ondrop="dropSelection(event,2)" dropzone="move string:text/plain"/>
+<p ondragstart="start(event)">Drag me</p>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/023.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/023.xhtml
new file mode 100644
index 000000000..be2ffae9a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/023.xhtml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>drofEffect after drop event is cancelled</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'], result = false, e = 0;
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event,element)
+ {event.preventDefault();
+ e = element;
+ if(event.dataTransfer.dropEffect == effects[element])
+ {result = true}
+ selectText();}
+function endDrag(event)
+ {document.querySelectorAll('div')[e].appendChild(document.createTextNode((result &amp;&amp; event.dataTransfer.dropEffect == effects[e])?' PASS ':' FAIL '));}
+</script>
+</head>
+<body onload="selectText()">
+<div ondrop="dropSelection(event,0)" dropzone="copy string:text/plain"/>
+<div ondrop="dropSelection(event,1)" dropzone="move string:text/plain"/>
+<div ondrop="dropSelection(event,2)" dropzone="link string:text/plain"/>
+<p ondragend="endDrag(event)">Drag me</p>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/024.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/024.xhtml
new file mode 100644
index 000000000..4f880974e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/024.xhtml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: invalid value of effectAllowed</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'], i = 0;
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event)
+ {event.target.appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[i] &amp;&amp; event.dataTransfer.effectAllowed == effects[i])?' PASS ':' FAIL '));
+ i = (i + 1)%3;
+ selectText();}
+function start(event)
+ {event.dataTransfer.effectAllowed = effects[i];
+ event.dataTransfer.effectAllowed = 'fail';}
+</script>
+</head>
+<body onload="selectText()">
+<p ondragstart="start(event)">Drag me</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="dropSelection(event)"/>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/025.html b/testing/web-platform/tests/html/editing/dnd/drop/025.html
new file mode 100644
index 000000000..288836fe4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/025.html
@@ -0,0 +1,162 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - writing to dropEffect</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], fails = [], doneonce = false, seenevent = {};
+ orange.ondragstart = function(e) {
+ e.dataTransfer.setData('Text', 'dummy text');
+ e.dataTransfer.effectAllowed = 'all';
+ if( seenevent[e.type] ) { return; }
+ seenevent[e.type] = true;
+ if( e.dataTransfer.dropEffect != 'none' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of none';
+ }
+ try{ e.dataTransfer.dropEffect = 'move' } catch(err) {
+ fails[fails.length] = e.type + ' dropEffect threw on setting';
+ }
+ if( e.dataTransfer.dropEffect != 'move' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of move (seems to be readonly)';
+ }
+ };
+ orange.ondrag = orange.nextSibling.ondragleave = function(e) {
+ if( seenevent[e.type] ) { return; }
+ seenevent[e.type] = true;
+ if( e.dataTransfer.dropEffect != 'none' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of none';
+ }
+ try{ e.dataTransfer.dropEffect = 'move' } catch(err) {
+ fails[fails.length] = e.type + ' dropEffect threw on setting';
+ }
+ if( e.dataTransfer.dropEffect != 'move' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of move (seems to be readonly)';
+ }
+ };
+ orange.nextSibling.ondragenter = function(e) {
+ e.preventDefault();
+ if( seenevent[e.type] ) { return; }
+ seenevent[e.type] = true;
+ if( e.dataTransfer.dropEffect != 'copy' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of copy';
+ }
+ try{ e.dataTransfer.dropEffect = 'move' } catch(err) {
+ fails[fails.length] = e.type + ' dropEffect threw on setting';
+ }
+ if( e.dataTransfer.dropEffect != 'move' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of move (seems to be readonly)';
+ }
+ };
+ orange.nextSibling.ondragover = function(e) {
+ e.preventDefault();
+ if( seenevent[e.type] ) {
+ e.dataTransfer.dropEffect = 'link';
+ return;
+ }
+ if( !doneonce ) {
+ if( e.dataTransfer.dropEffect != 'copy' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of copy';
+ }
+ try{ e.dataTransfer.dropEffect = 'move' } catch(err) {
+ fails[fails.length] = e.type + ' dropEffect threw on setting';
+ }
+ if( e.dataTransfer.dropEffect != 'move' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of move (seems to be readonly)';
+ }
+ doneonce = true;
+ } else {
+ seenevent[e.type] = true;
+ if( e.dataTransfer.dropEffect != 'copy' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of copy on second attempt';
+ }
+ try{ e.dataTransfer.dropEffect = 'link' } catch(err2) {
+ fails[fails.length] = e.type + ' dropEffect threw on setting';
+ }
+ if( e.dataTransfer.dropEffect != 'link' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of link on second attempt (seems to be readonly)';
+ }
+ doneonce = true;
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ e.preventDefault();
+ if( seenevent[e.type] ) { return; }
+ seenevent[e.type] = true;
+ if( e.dataTransfer.dropEffect != 'link' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of link';
+ }
+ try{ e.dataTransfer.dropEffect = 'move' } catch(err) {
+ fails[fails.length] = e.type + ' dropEffect threw on setting';
+ }
+ if( e.dataTransfer.dropEffect != 'move' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of move (seems to be readonly)';
+ }
+ };
+ orange.ondragend = function(e) {
+ if( seenevent[e.type] ) { return; }
+ seenevent[e.type] = true;
+ if( e.dataTransfer.dropEffect != 'move' ) {
+ //under-specified in the spec, but part of the spec related to cancelling a drag says:
+ //"set the current drag operation to the value of the dropEffect attribute of the DragEvent
+ //object's dataTransfer object as it stood after the event dispatch finished."
+ //this does not cover successful drags, but it makes sense to be consistent
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of move';
+ }
+ try{ e.dataTransfer.dropEffect = 'copy' } catch(err) {
+ fails[fails.length] = e.type + ' dropEffect threw on setting';
+ }
+ if( e.dataTransfer.dropEffect != 'copy' ) {
+ fails[fails.length] = e.type + ' dropEffect ' + e.dataTransfer.dropEffect + ' instead of copy (seems to be readonly)';
+ }
+ if( !seenevent.dragstart ) {
+ fails[fails.length] = 'dragstart did not fire';
+ }
+ if( !seenevent.drag ) {
+ fails[fails.length] = 'drag did not fire';
+ }
+ if( !seenevent.dragenter ) {
+ fails[fails.length] = 'dragenter did not fire';
+ }
+ if( !seenevent.dragover ) {
+ fails[fails.length] = 'dragover did not fire enough times';
+ }
+ if( !seenevent.dragleave ) {
+ fails[fails.length] = 'dragleave did not fire';
+ }
+ if( !seenevent.drop ) {
+ fails[fails.length] = 'drop did not fire';
+ }
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ };
+};
+
+</script>
+
+<div draggable='true'></div><div></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/026.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/026.xhtml
new file mode 100644
index 000000000..d3ae0d827
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/026.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: multiple values in dropzone</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:olive;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:green;}
+div:nth-child(3)
+ {background-color:teal;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','move','link'];
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event,element)
+ {document.querySelectorAll('div')[element].appendChild(document.createTextNode((event.dataTransfer.dropEffect == effects[element])?' PASS ':' FAIL '));
+ selectText();}
+</script>
+</head>
+<body onload="selectText()">
+<div ondrop="dropSelection(event,0)" dropzone="copy string:text/plain string:text/x-example"/>
+<div ondrop="dropSelection(event,1)" dropzone="move file:text/plain string:text/plain"/>
+<div ondrop="dropSelection(event,2)" dropzone="link file:image/png string:text/plain"/>
+<p>Drag me</p>
+<p>You should be able to drag selection and drop it onto any of the green boxes.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/027.xhtml b/testing/web-platform/tests/html/editing/dnd/drop/027.xhtml
new file mode 100644
index 000000000..482a655c1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/027.xhtml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: non matching values in dropzone</title>
+<style type="text/css">
+div
+ {display:inline-block;
+ vertical-align:top;
+ background-color:maroon;
+ color:white;
+ padding:20px;
+ width:100px;
+ height:100px;}
+div:nth-child(2)
+ {background-color:purple;}
+div:nth-child(3)
+ {background-color:fuchsia;}
+</style>
+<script type="application/ecmascript">
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropSelection(event,element)
+ {document.querySelectorAll('div')[element].appendChild(document.createTextNode(' FAIL '));
+ selectText();}
+</script>
+</head>
+<body onload="selectText()">
+<div ondrop="dropSelection(event,0)" dropzone="copy file:text/plain"/>
+<div ondrop="dropSelection(event,1)" dropzone="move file:text/plain string:text/x-example"/>
+<div ondrop="dropSelection(event,2)" dropzone="link string:text/x-example"/>
+<p ondragstart="start(event)">Drag me</p>
+<p>You should not be able to drop selection onto any of the red boxes above.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/drop/028.html b/testing/web-platform/tests/html/editing/dnd/drop/028.html
new file mode 100644
index 000000000..22b823f70
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/drop/028.html
@@ -0,0 +1,42 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dropping element with uninitialized effectAllowed</title>
+ <style type="text/css">
+div, p {
+ margin: 0.2em;
+ height: 70px;
+ width: 400px;
+ background: orange;
+ color: black;
+}
+p {
+ background: navy;
+ color: white;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var dragmicro = document.getElementsByTagName('div')[0];
+ dragmicro.ondragstart = function (e) {
+ e.dataTransfer.setData('text/plain','dummy text');
+ };
+ var droptarget = document.getElementsByTagName('p')[0];
+ droptarget.ondragenter = droptarget.ondragover = function (e) {
+ e.preventDefault();
+ };
+ droptarget.ondrop = function (e) {
+ e.preventDefault();
+ this.innerHTML = 'PASS';
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div draggable="true">Drag this rectangle.</div>
+ <p>Drop onto this rectangle. Fail if this text does not change.</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/001.xhtml b/testing/web-platform/tests/html/editing/dnd/dropzone/001.xhtml
new file mode 100644
index 000000000..4fc405af3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/001.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropzone attribute: copy</title>
+<style type="text/css">
+div
+ {background-color:navy;
+ width:40px;
+ height:40px;
+ padding:40px;
+ color:white;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<div dropzone="copy string:text/plain" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'))"/>
+<p>You should be able to drag selection to navy box below. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/002.xhtml b/testing/web-platform/tests/html/editing/dnd/dropzone/002.xhtml
new file mode 100644
index 000000000..87a64b3ee
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/002.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropzone attribute: move</title>
+<style type="text/css">
+div
+ {background-color:navy;
+ width:40px;
+ height:40px;
+ padding:40px;
+ color:white;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me"/></p>
+<div dropzone="move string:text/plain" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'))"/>
+<p>You should be able to drag selection to navy box below. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/003.xhtml b/testing/web-platform/tests/html/editing/dnd/dropzone/003.xhtml
new file mode 100644
index 000000000..7683b1c17
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/003.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropzone attribute: link</title>
+<style type="text/css">
+div
+ {background-color:navy;
+ width:40px;
+ height:40px;
+ padding:40px;
+ color:white;}
+</style>
+</head>
+<body>
+<p><a href="data:text/plain,1">Drag me</a></p>
+<div dropzone="link string:text/plain" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'))"/>
+<p>You should be able to drag link to navy box below. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/004.xhtml b/testing/web-platform/tests/html/editing/dnd/dropzone/004.xhtml
new file mode 100644
index 000000000..683956899
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/004.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropzone and link drag and drop: allowed effects 'link','copyLink','linkMove' and 'all'</title>
+<style type="text/css">
+div
+ {background-color:gray;
+ width:200px;
+ height:200px;}
+</style>
+<script type="application/ecmascript">
+var effects = ['link','copyLink','linkMove','all'];
+function start(event)
+ {var e = parseInt(event.target.href.substring(16));
+ event.dataTransfer.effectAllowed = effects[e];}
+function finish(event)
+ {var e = parseInt(event.dataTransfer.getData('text/uri-list').substring(16,17));
+ document.querySelectorAll('a')[e].firstChild.nodeValue = (event.dataTransfer.dropEffect == 'link' &amp;&amp; event.dataTransfer.effectAllowed == effects[e])?'PASS':'FAIL';}
+</script>
+</head>
+<body>
+<p>Drag links one by one and drop them into gray box below, link text should be updated as you drop them.</p>
+<p ondragstart="start(event)">
+ <a href="data:text/plain,0">Link</a>
+ <a href="data:text/plain,1">Link</a>
+ <a href="data:text/plain,2">Link</a>
+ <a href="data:text/plain,3">Link</a>
+</p>
+<div dropzone="link string:text/uri-list" ondrop="finish(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/005.xhtml b/testing/web-platform/tests/html/editing/dnd/dropzone/005.xhtml
new file mode 100644
index 000000000..5cdba423f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/005.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropzone and link drag and drop: allowed effects 'copy','copyMove','copyLink' and 'all'</title>
+<style type="text/css">
+div
+ {background-color:gray;
+ width:200px;
+ height:200px;}
+</style>
+<script type="application/ecmascript">
+var effects = ['copy','copyMove','copyLink','all'];
+function start(event)
+ {var e = parseInt(event.target.href.substring(16));
+ event.dataTransfer.effectAllowed = effects[e];}
+function finish(event)
+ {var e = parseInt(event.dataTransfer.getData('text/uri-list').substring(16,17));
+ document.querySelectorAll('a')[e].firstChild.nodeValue = (event.dataTransfer.dropEffect == 'copy' &amp;&amp; event.dataTransfer.effectAllowed == effects[e])?'PASS':'FAIL';}
+</script>
+</head>
+<body>
+<p>Drag links one by one and drop them into gray box below, link text should be updated as you drop them.</p>
+<p ondragstart="start(event)">
+ <a href="data:text/plain,0">Link</a>
+ <a href="data:text/plain,1">Link</a>
+ <a href="data:text/plain,2">Link</a>
+ <a href="data:text/plain,3">Link</a>
+</p>
+<div dropzone="copy string:text/uri-list" ondrop="finish(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/006.xhtml b/testing/web-platform/tests/html/editing/dnd/dropzone/006.xhtml
new file mode 100644
index 000000000..eb5da24fc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/006.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropzone and link drag and drop: allowed effects 'move','copyMove','linkMove' and 'all'</title>
+<style type="text/css">
+div
+ {background-color:gray;
+ width:200px;
+ height:200px;}
+</style>
+<script type="application/ecmascript">
+var effects = ['move','copyMove','linkMove','all'];
+function start(event)
+ {var e = parseInt(event.target.href.substring(16));
+ event.dataTransfer.effectAllowed = effects[e];}
+function finish(event)
+ {var e = parseInt(event.dataTransfer.getData('text/uri-list').substring(16,17));
+ document.querySelectorAll('a')[e].firstChild.nodeValue = (event.dataTransfer.dropEffect == 'move' &amp;&amp; event.dataTransfer.effectAllowed == effects[e])?'PASS':'FAIL';}
+</script>
+</head>
+<body>
+<p>Drag links one by one and drop them into gray box below, link text should be updated as you drop them.</p>
+<p ondragstart="start(event)">
+ <a href="data:text/plain,0">Link</a>
+ <a href="data:text/plain,1">Link</a>
+ <a href="data:text/plain,2">Link</a>
+ <a href="data:text/plain,3">Link</a>
+</p>
+<div dropzone="move string:text/uri-list" ondrop="finish(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/007.html b/testing/web-platform/tests/html/editing/dnd/dropzone/007.html
new file mode 100644
index 000000000..3140e768f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/007.html
@@ -0,0 +1,54 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dropzone should not affect the dropEffect seen by dragenter and dragover</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ var drop = document.getElementsByTagName('div')[1], dragenter, dragover;
+ drop.ondragenter = function (e) {
+ dragenter = e.dataTransfer.dropEffect;
+ };
+ drop.ondragover = function (e) {
+ dragover = e.dataTransfer.dropEffect;
+ };
+ drop.ondrop = function (e) {
+ var sequence = ([dragenter,dragover,e.dataTransfer.dropEffect]).join('=&gt;')
+ var desiredsequence = (['copy','copy','link']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[2].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[2].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div dropzone="link string:text/plain"></div>
+ <div>&nbsp;</div>
+ <p>Drag the orange square onto the blue square and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/008.html b/testing/web-platform/tests/html/editing/dnd/dropzone/008.html
new file mode 100644
index 000000000..a82813c04
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/008.html
@@ -0,0 +1,56 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dropzone should not affect the dropEffect if dragover is cancelled</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ var drop = document.getElementsByTagName('div')[1], dragenter, dragover;
+ drop.ondragenter = function (e) {
+ dragenter = e.dataTransfer.dropEffect;
+ e.preventDefault();
+ };
+ drop.ondragover = function (e) {
+ dragover = e.dataTransfer.dropEffect;
+ e.preventDefault();
+ };
+ drop.ondrop = function (e) {
+ var sequence = ([dragenter,dragover,e.dataTransfer.dropEffect]).join('=&gt;')
+ var desiredsequence = (['copy','copy','copy']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[2].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[2].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div dropzone="link string:text/plain"></div>
+ <div>&nbsp;</div>
+ <p>Drag the orange square onto the blue square and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/009.html b/testing/web-platform/tests/html/editing/dnd/dropzone/009.html
new file mode 100644
index 000000000..cc94dba03
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/009.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dropping selection onto dropzone with JS disabled</title>
+ </head>
+ <body>
+
+ <ol>
+ <li>Disable JavaScript</li>
+ <li>Select some text in this sentence.</li>
+ <li dropzone="copy string:text/plain">Drag the selection over this text.</li>
+ <li>If supported by the platform, the mouse cursor should show the drop-allowed cursor.</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/dropzone/010.html b/testing/web-platform/tests/html/editing/dnd/dropzone/010.html
new file mode 100644
index 000000000..ff787b829
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/dropzone/010.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dropping selection onto dropzone with no padding</title>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Select some text in this sentence.</li>
+ <li dropzone="copy string:text/plain" ondrop="this.parentNode.getElementsByTagName('li')[2].textContent='PASS';">Drag the selection over this text and release it.</li>
+ <li>This text should change.</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/001-1.xhtml b/testing/web-platform/tests/html/editing/dnd/events/001-1.xhtml
new file mode 100644
index 000000000..14eab24ca
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/001-1.xhtml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame drag and drop: helper file</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function start(event)
+ {if(step++ == 1)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragstart should be first event to fire.')}
+ }
+function leavePage(event)
+ {if(step++ > 1)
+ {setColor('green green silver silver')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragleave should fire after dragstart.')}
+ }
+function endDrag(event)
+ {if(step++ > 2)
+ {setColor('green')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragend should fire after dragstart and dragleave.')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))" ondragleave="leavePage(event)">
+<p ondragstart="start(event)" ondragend="endDrag(event)">Drag me</p>
+<p>Drag selected text to the frame below and drop it there. Both circles should turn green once text is dropped into lower frame.</p>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/001.xhtml b/testing/web-platform/tests/html/editing/dnd/events/001.xhtml
new file mode 100644
index 000000000..4c8e7d563
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/001.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of selection between frames</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="001-1.xhtml"/>
+<frame src="helper-drop-here-body-circle.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/002-1.xhtml b/testing/web-platform/tests/html/editing/dnd/events/002-1.xhtml
new file mode 100644
index 000000000..ef47895d6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/002-1.xhtml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame drag and drop: helper file</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function start(event)
+ {if(step++ == 1)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragstart should be first event to fire.')}
+ }
+function leavePage(event)
+ {if(step++ > 1)
+ {setColor('green green silver silver')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragleave should fire after dragstart.')}
+ }
+function endDrag(event)
+ {if(step++ > 2)
+ {setColor('green')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragend should fire after dragstart and dragleave.')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body onload="document.querySelector('input').select()" ondragleave="leavePage(event)">
+<p ondragstart="start(event)" ondragend="endDrag(event)"><input value="Drag me"/></p>
+<p>Drag selected text to the frame below and drop it there. Both circles should turn green once text is dropped into lower frame.</p>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/002.xhtml b/testing/web-platform/tests/html/editing/dnd/events/002.xhtml
new file mode 100644
index 000000000..9bd76db26
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/002.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of text input selection between frames</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="002-1.xhtml"/>
+<frame src="helper-drop-here-body-circle.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/003-1.xhtml b/testing/web-platform/tests/html/editing/dnd/events/003-1.xhtml
new file mode 100644
index 000000000..8990404b1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/003-1.xhtml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame drag and drop: helper file</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function start(event)
+ {if(step++ == 1)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragstart should be first event to fire.')}
+ }
+function leavePage(event)
+ {if(step++ > 1)
+ {setColor('green green silver silver')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragleave should fire after dragstart.')}
+ }
+function endDrag(event)
+ {if(step++ > 2)
+ {setColor('green')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragend should fire after dragstart and dragleave.')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body ondragleave="leavePage(event)">
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondragend="endDrag(event)">Drag me</a></p>
+<p>Drag link to the frame below and drop it there. Both circles should turn green once link is dropped into lower frame.</p>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/003.xhtml b/testing/web-platform/tests/html/editing/dnd/events/003.xhtml
new file mode 100644
index 000000000..c853e931d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/003.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of link between frames</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="003-1.xhtml"/>
+<frame src="helper-drop-here-body-circle.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/004.xhtml b/testing/web-platform/tests/html/editing/dnd/events/004.xhtml
new file mode 100644
index 000000000..f8a27e69f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/004.xhtml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of selection to iframe</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+iframe
+ {width:100%;
+ height:500px;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function start(event)
+ {if(step++ == 1)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragstart should be first event to fire.')}
+ }
+function leavePage(event)
+ {if(step++ > 1)
+ {setColor('green green silver silver')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragleave should fire after dragstart.')}
+ }
+function endDrag(event)
+ {if(step++ > 2)
+ {setColor('green')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragend should fire after dragstart and dragleave.')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))" ondragleave="leavePage(event)">
+<p ondragstart="start(event)" ondragend="endDrag(event)">Drag me</p>
+<p>Drag selected text to the frame below and drop it there. Both circles should turn green once text is dropped into lower frame.</p>
+<div/>
+<pre/>
+<iframe src="helper-drop-here-body-circle.xhtml">XHTML document</iframe>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/005.xhtml b/testing/web-platform/tests/html/editing/dnd/events/005.xhtml
new file mode 100644
index 000000000..b84055fec
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/005.xhtml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of text input selection to iframe</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+iframe
+ {width:100%;
+ height:500px;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function start(event)
+ {if(step++ == 1)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragstart should be first event to fire.')}
+ }
+function leavePage(event)
+ {if(step++ > 1)
+ {setColor('green green silver silver')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragleave should fire after dragstart.')}
+ }
+function endDrag(event)
+ {if(step++ > 2)
+ {setColor('green')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragend should fire after dragstart and dragleave.')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body onload="document.querySelector('input').select()" ondragleave="leavePage(event)">
+<p ondragstart="start(event)" ondragend="endDrag(event)"><input value="Drag me"/></p>
+<p>Drag selected text to the frame below and drop it there. Both circles should turn green once text is dropped into lower frame.</p>
+<div/>
+<pre/>
+<iframe src="helper-drop-here-body-circle.xhtml">XHTML document</iframe>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/006.xhtml b/testing/web-platform/tests/html/editing/dnd/events/006.xhtml
new file mode 100644
index 000000000..40369c570
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/006.xhtml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of link to iframe</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+iframe
+ {width:100%;
+ height:500px;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function start(event)
+ {if(step++ == 1)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragstart should be first event to fire.')}
+ }
+function leavePage(event)
+ {if(step++ > 1)
+ {setColor('green green silver silver')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragleave should fire after dragstart.')}
+ }
+function endDrag(event)
+ {if(step++ > 2)
+ {setColor('green')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragend should fire after dragstart and dragleave.')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body ondragleave="leavePage(event)">
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondragend="endDrag(event)">Drag me</a></p>
+<p>Drag link to the frame below and drop it there. Both circles should turn green once link is dropped into lower frame.</p>
+<div/>
+<pre/>
+<iframe src="helper-drop-here-body-circle.xhtml">XHTML document</iframe>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/007.xhtml b/testing/web-platform/tests/html/editing/dnd/events/007.xhtml
new file mode 100644
index 000000000..a7e91cdd0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/007.xhtml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of selection to object</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+object
+ {width:100%;
+ height:500px;
+ border:solid medium navy;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function start(event)
+ {if(step++ == 1)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragstart should be first event to fire.')}
+ }
+function leavePage(event)
+ {if(step++ > 1)
+ {setColor('green green silver silver')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragleave should fire after dragstart.')}
+ }
+function endDrag(event)
+ {if(step++ > 2)
+ {setColor('green')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragend should fire after dragstart and dragleave.')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))" ondragleave="leavePage(event)">
+<p ondragstart="start(event)" ondragend="endDrag(event)">Drag me</p>
+<p>Drag selected text to the frame below and drop it there. Both circles should turn green once text is dropped into lower frame.</p>
+<div/>
+<pre/>
+<object type="application/xhtml+xml" data="helper-drop-here-body-circle.xhtml">XHTML document</object>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/008.xhtml b/testing/web-platform/tests/html/editing/dnd/events/008.xhtml
new file mode 100644
index 000000000..8b2752414
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/008.xhtml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of text input selection to object</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+object
+ {width:100%;
+ height:500px;
+ border:solid medium navy;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function start(event)
+ {if(step++ == 1)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragstart should be first event to fire.')}
+ }
+function leavePage(event)
+ {if(step++ > 1)
+ {setColor('green green silver silver')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragleave should fire after dragstart.')}
+ }
+function endDrag(event)
+ {if(step++ > 2)
+ {setColor('green')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragend should fire after dragstart and dragleave.')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body onload="document.querySelector('input').select()" ondragleave="leavePage(event)">
+<p ondragstart="start(event)" ondragend="endDrag(event)"><input value="Drag me"/></p>
+<p>Drag selected text to the frame below and drop it there. Both circles should turn green once text is dropped into lower frame.</p>
+<div/>
+<pre/>
+<object type="application/xhtml+xml" data="helper-drop-here-body-circle.xhtml">XHTML document</object>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/009.xhtml b/testing/web-platform/tests/html/editing/dnd/events/009.xhtml
new file mode 100644
index 000000000..d2eac9693
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/009.xhtml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of link to object</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+object
+ {width:100%;
+ height:500px;
+ border:solid medium navy;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function start(event)
+ {if(step++ == 1)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragstart should be first event to fire.')}
+ }
+function leavePage(event)
+ {if(step++ > 1)
+ {setColor('green green silver silver')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragleave should fire after dragstart.')}
+ }
+function endDrag(event)
+ {if(step++ > 2)
+ {setColor('green')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragend should fire after dragstart and dragleave.')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body ondragleave="leavePage(event)">
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondragend="endDrag(event)">Drag me</a></p>
+<p>Drag link to the frame below and drop it there. Both circles should turn green once link is dropped into lower frame.</p>
+<div/>
+<pre/>
+<object type="application/xhtml+xml" data="helper-drop-here-body-circle.xhtml">XHTML document</object>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/010.xhtml b/testing/web-platform/tests/html/editing/dnd/events/010.xhtml
new file mode 100644
index 000000000..1a9566822
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/010.xhtml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of selection from iframe</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+iframe
+ {width:100%;
+ height:300px;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function enterPage(event)
+ {event.preventDefault();
+ if(step++ > 0)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragenter should fire before dragover and drop');}
+ }
+function overPage(event)
+ {event.preventDefault();
+ if(step++ > 1)
+ {setColor('green green silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function dropIt(event)
+ {if(step++ > 1)
+ {setColor('green');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body ondragenter="enterPage(event)" ondragover="overPage(event)" ondrop="dropIt(event)">
+<iframe src="helper-drag-me-p-with-circle.xhtml">XHTML document</iframe>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/011.xhtml b/testing/web-platform/tests/html/editing/dnd/events/011.xhtml
new file mode 100644
index 000000000..a4564bcba
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/011.xhtml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of text input selection from iframe</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+iframe
+ {width:100%;
+ height:300px;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function enterPage(event)
+ {event.preventDefault();
+ if(step++ > 0)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragenter should fire before dragover and drop');}
+ }
+function overPage(event)
+ {event.preventDefault();
+ if(step++ > 1)
+ {setColor('green green silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function dropIt(event)
+ {if(step++ > 1)
+ {setColor('green');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body ondragenter="enterPage(event)" ondragover="overPage(event)" ondrop="dropIt(event)">
+<iframe src="helper-drag-me-input-with-circle.xhtml">XHTML document</iframe>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/012.xhtml b/testing/web-platform/tests/html/editing/dnd/events/012.xhtml
new file mode 100644
index 000000000..875d4ef56
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/012.xhtml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of link from iframe</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+iframe
+ {width:100%;
+ height:300px;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function enterPage(event)
+ {event.preventDefault();
+ if(step++ > 0)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragenter should fire before dragover and drop');}
+ }
+function overPage(event)
+ {event.preventDefault();
+ if(step++ > 1)
+ {setColor('green green silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function dropIt(event)
+ {if(step++ > 1)
+ {setColor('green');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body ondragenter="enterPage(event)" ondragover="overPage(event)" ondrop="dropIt(event)">
+<iframe src="helper-drag-me-link-with-circle.xhtml">XHTML document</iframe>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/013.xhtml b/testing/web-platform/tests/html/editing/dnd/events/013.xhtml
new file mode 100644
index 000000000..e6df03c1a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/013.xhtml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of selection from object</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+object
+ {width:100%;
+ height:300px;
+ border:solid medium navy;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function enterPage(event)
+ {event.preventDefault();
+ if(step++ > 0)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragenter should fire before dragover and drop');}
+ }
+function overPage(event)
+ {event.preventDefault();
+ if(step++ > 1)
+ {setColor('green green silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function dropIt(event)
+ {if(step++ > 1)
+ {setColor('green');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body ondragenter="enterPage(event)" ondragover="overPage(event)" ondrop="dropIt(event)">
+<object type="application/xhtml+xml" data="helper-drag-me-p-with-circle.xhtml">XHTML document</object>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/014.xhtml b/testing/web-platform/tests/html/editing/dnd/events/014.xhtml
new file mode 100644
index 000000000..f82d57b15
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/014.xhtml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of text input selection from object</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+object
+ {width:100%;
+ height:300px;
+ border:solid medium navy;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function enterPage(event)
+ {event.preventDefault();
+ if(step++ > 0)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragenter should fire before dragover and drop');}
+ }
+function overPage(event)
+ {event.preventDefault();
+ if(step++ > 1)
+ {setColor('green green silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function dropIt(event)
+ {if(step++ > 1)
+ {setColor('green');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body ondragenter="enterPage(event)" ondragover="overPage(event)" ondrop="dropIt(event)">
+<object type="application/xhtml+xml" data="helper-drag-me-input-with-circle.xhtml">XHTML document</object>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/015.xhtml b/testing/web-platform/tests/html/editing/dnd/events/015.xhtml
new file mode 100644
index 000000000..bcd076b21
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/015.xhtml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of link from object</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+object
+ {width:100%;
+ height:300px;
+ border:solid medium navy;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function enterPage(event)
+ {event.preventDefault();
+ if(step++ > 0)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragenter should fire before dragover and drop');}
+ }
+function overPage(event)
+ {event.preventDefault();
+ if(step++ > 1)
+ {setColor('green green silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function dropIt(event)
+ {if(step++ > 1)
+ {setColor('green');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body ondragenter="enterPage(event)" ondragover="overPage(event)" ondrop="dropIt(event)">
+<object type="application/xhtml+xml" data="helper-drag-me-link-with-circle.xhtml">XHTML document</object>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/016.xhtml b/testing/web-platform/tests/html/editing/dnd/events/016.xhtml
new file mode 100644
index 000000000..91e991fdb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/016.xhtml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: events after dragenter is cancelled</title>
+<script type="application/ecmascript">
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function start(event)
+ {event.preventDefault();}
+function dragMe(event)
+ {say('FAIL (drag event should not fire if dragstart is cancelled)');}
+function enterBody(event)
+ {event.preventDefault();
+ say('FAIL (dragover event should not fire if dragstart is cancelled)');}
+function overBody(event)
+ {event.preventDefault();
+ say('FAIL (dragover event should not fire if dragstart is cancelled)');}
+function dropIt(event)
+ {say('FAIL (drop event should not fire if dragstart is cancelled)');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+</script>
+</head>
+<body onload="selectText()" ondragenter="enterBody(event)" ondragover="overBody(event)" ondrop="dropIt(event)">
+<p ondragstart="start(event)" ondrag="dragMe(event)">Try to drag me</p>
+<p>You should not be able to drag text selection above.</p>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/017.xhtml b/testing/web-platform/tests/html/editing/dnd/events/017.xhtml
new file mode 100644
index 000000000..e679ac0d3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/017.xhtml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Text input selection drag and drop: events after dragenter is cancelled</title>
+<script type="application/ecmascript">
+function selectText()
+ {document.querySelector('input').select()}
+function start(event)
+ {event.preventDefault();}
+function dragMe(event)
+ {say('FAIL (drag event should not fire if dragstart is cancelled)');}
+function enterBody(event)
+ {event.preventDefault();
+ say('FAIL (dragover event should not fire if dragstart is cancelled)');}
+function overBody(event)
+ {event.preventDefault();
+ say('FAIL (dragover event should not fire if dragstart is cancelled)');}
+function dropIt(event)
+ {say('FAIL (drop event should not fire if dragstart is cancelled)');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+</script>
+</head>
+<body onload="selectText()" ondragenter="enterBody(event)" ondragover="overBody(event)" ondrop="dropIt(event)">
+<p ondragstart="start(event)"><input value="Try to drag me" ondrag="dragMe(event)"/></p>
+<p>You should not be able to drag text selection above.</p>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/018.xhtml b/testing/web-platform/tests/html/editing/dnd/events/018.xhtml
new file mode 100644
index 000000000..65110f5c2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/018.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop: events after dragenter is cancelled</title>
+<script type="application/ecmascript">
+function start(event)
+ {event.preventDefault();}
+function dragMe(event)
+ {say('FAIL (drag event should not fire if dragstart is cancelled)');}
+function enterBody(event)
+ {event.preventDefault();
+ say('FAIL (dragover event should not fire if dragstart is cancelled)');}
+function overBody(event)
+ {event.preventDefault();
+ say('FAIL (dragover event should not fire if dragstart is cancelled)');}
+function dropIt(event)
+ {say('FAIL (drop event should not fire if dragstart is cancelled)');}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+</script>
+</head>
+<body ondragenter="enterBody(event)" ondragover="overBody(event)" ondrop="dropIt(event)">
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondrag="dragMe(event)">Try to drag me</a></p>
+<p>You should not be able to drag link above.</p>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/019.xhtml b/testing/web-platform/tests/html/editing/dnd/events/019.xhtml
new file mode 100644
index 000000000..3c4928fc2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/019.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: events after drag is cancelled</title>
+<script type="application/ecmascript">
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dragMe(event)
+ {event.preventDefault();}
+function dropIt(event)
+ {say('FAIL (no drop should occur after drag is cancelled)')}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+</script>
+</head>
+<body onload="selectText()" dropzone="copy string:text/plain" ondrop="dropIt(event)">
+<p ondrag="dragMe(event)">Try to drag me</p>
+<p>You should not be able to drop text selection above.</p>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/020.xhtml b/testing/web-platform/tests/html/editing/dnd/events/020.xhtml
new file mode 100644
index 000000000..dfd9138b1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/020.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Text input selection drag and drop: events after drag is cancelled</title>
+<script type="application/ecmascript">
+function selectText()
+ {document.querySelector('input').select()}
+function dragMe(event)
+ {event.preventDefault();}
+function dropIt(event)
+ {say('FAIL (no drop should occur after drag is cancelled)')}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+</script>
+</head>
+<body onload="selectText()" dropzone="copy string:text/plain" ondrop="dropIt(event)">
+<p><input value="Try to drag me" ondrag="dragMe(event)"/></p>
+<p>You should not be able to drop text selection above.</p>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/021.xhtml b/testing/web-platform/tests/html/editing/dnd/events/021.xhtml
new file mode 100644
index 000000000..87313e9db
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/021.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop: events after drag is cancelled</title>
+<script type="application/ecmascript">
+function dragMe(event)
+ {event.preventDefault();}
+function dropIt(event)
+ {say('FAIL (no drop should occur after drag is cancelled)')}
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+</script>
+</head>
+<body dropzone="copy string:text/uri-list" ondrop="dropIt(event)">
+<p><a href="data:text/plain,1" ondrag="dragMe(event)">Try to drag me</a></p>
+<p>You should not be able to drag link above.</p>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/022.xhtml b/testing/web-platform/tests/html/editing/dnd/events/022.xhtml
new file mode 100644
index 000000000..7d85f4218
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/022.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: events after drag and drop is cancelled</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;}
+</style>
+<script type="application/ecmascript">
+var result = true;
+function selectText()
+ {window.getSelection().selectAllChildren(document.querySelector('p'))}
+function dropIt(event)
+ {result = false;
+ setColor('maroon');
+ say('drop event : FAIL (no drop should occur once drag and drop is cancelled)')}
+function endDrag(event)
+ {if(result)
+ {setColor('teal')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body onload="selectText()" dropzone="copy string:text/plain" ondrop="dropIt(event)">
+<p ondragstart="setColor('teal silver silver silver')" ondragend="endDrag(event)">Drag me</p>
+<p>Drag selected text and press Esc before you drop it. Circle below should turn green once drag and drop is cancelled.</p>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/023.xhtml b/testing/web-platform/tests/html/editing/dnd/events/023.xhtml
new file mode 100644
index 000000000..7a10c5b39
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/023.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Text input selection drag and drop: events after drag and drop is cancelled</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;}
+</style>
+<script type="application/ecmascript">
+var result = true;
+function selectText()
+ {document.querySelector('input').select()}
+function dropIt(event)
+ {result = false;
+ setColor('maroon');
+ say('drop event : FAIL (no drop should occur once drag and drop is cancelled)')}
+function endDrag(event)
+ {if(result)
+ {setColor('teal')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body onload="selectText()" dropzone="copy string:text/plain" ondrop="dropIt(event)">
+<p><input value="Drag me" ondragstart="setColor('teal silver silver silver')" ondragend="endDrag(event)"/></p>
+<p>Drag selected text and press Esc before you drop it. Circle below should turn green once drag and drop is cancelled.</p>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/024.xhtml b/testing/web-platform/tests/html/editing/dnd/events/024.xhtml
new file mode 100644
index 000000000..cb079da39
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/024.xhtml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop: events after drag and drop is cancelled</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;}
+</style>
+<script type="application/ecmascript">
+var result = true;
+function dropIt(event)
+ {result = false;
+ setColor('maroon');
+ say('drop event : FAIL (no drop should occur once drag and drop is cancelled)')}
+function endDrag(event)
+ {if(result)
+ {setColor('teal')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'));}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body dropzone="copy string:text/uri-list" ondrop="dropIt(event)">
+<p><a href="data:text/plain,1" ondragstart="setColor('teal silver silver silver')" ondragend="endDrag(event)">Drag me</a></p>
+<p>Drag link and press Esc before you drop it. Circle below should turn green once drag and drop is cancelled.</p>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/025.html b/testing/web-platform/tests/html/editing/dnd/events/025.html
new file mode 100644
index 000000000..043b40eed
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/025.html
@@ -0,0 +1,69 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dragover repeating</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var numsecs = 5, maxpolltime = 0.550, minpolltime = 0.150;
+ var blue = document.getElementsByTagName('div')[1], p = document.getElementsByTagName('p')[0];
+ var numfired = 0, readytocount = false;
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'all';
+ e.dataTransfer.setData('text','dummy text');
+ };
+ blue.ondrop = function (e) {
+ e.preventDefault();
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ if( readytocount ) { numfired++; }
+ };
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ p.innerHTML = 'Keep the mouse perfectly still...';
+ //give the tester a second to get ready
+ setTimeout(function () {
+ readytocount = true;
+ numfired = 0;
+ p.innerHTML = 'Keep the mouse perfectly still for '+numsecs+' seconds';
+ var countsecs = numsecs;
+ var intr = setInterval(function () {
+ countsecs--;
+ if( countsecs ) {
+ p.innerHTML = 'Keep the mouse perfectly still for '+countsecs+' seconds';
+ } else {
+ clearInterval(intr);
+ var passed = numfired >= Math.floor( numsecs / maxpolltime ) && numfired <= Math.floor( numsecs / minpolltime );
+ document.getElementsByTagName('p')[0].innerHTML = ( passed ? 'PASS' : 'FAIL' ) +
+ '<br><br>(Fired ' + numfired + ' times in ' + numsecs + ' seconds, must be between ' +
+ Math.floor( numsecs / maxpolltime ) + ' and ' + Math.floor( numsecs / minpolltime ) + ')<br>You can release the drag now';
+ }
+ },1000);
+ },1000);
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <p>Drag the orange square over the blue square, then keep the mouse perfectly still until the result appears.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/026.html b/testing/web-platform/tests/html/editing/dnd/events/026.html
new file mode 100644
index 000000000..7ea175553
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/026.html
@@ -0,0 +1,61 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Drag repeating</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var numsecs = 5, maxpolltime = 0.550, minpolltime = 0.150;
+ var orange = document.getElementsByTagName('div')[0], p = document.getElementsByTagName('p')[0];
+ var numfired = 0, readytocount = false;
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'all';
+ e.dataTransfer.setData('text','dummy text');
+ p.innerHTML = 'Keep the mouse perfectly still...';
+ //give the tester a second to get ready
+ setTimeout(function () {
+ readytocount = true;
+ numfired = 0;
+ p.innerHTML = 'Keep the mouse perfectly still for '+numsecs+' seconds';
+ var countsecs = numsecs;
+ var intr = setInterval(function () {
+ countsecs--;
+ if( countsecs ) {
+ p.innerHTML = 'Keep the mouse perfectly still for '+countsecs+' seconds';
+ } else {
+ clearInterval(intr);
+ var passed = numfired >= Math.floor( numsecs / maxpolltime ) && numfired <= Math.floor( numsecs / minpolltime );
+ document.getElementsByTagName('p')[0].innerHTML = ( passed ? 'PASS' : 'FAIL' ) +
+ '<br><br>(Fired ' + numfired + ' times in ' + numsecs + ' seconds, must be between ' +
+ Math.floor( numsecs / maxpolltime ) + ' and ' + Math.floor( numsecs / minpolltime ) + ')<br>You can release the drag now';
+ }
+ },1000);
+ },1000);
+ };
+ orange.ondrag = function (e) {
+ if( readytocount ) { numfired++; }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <p>Drag the orange square sideways until the drag placeholder appears, then keep the mouse perfectly still until the result appears.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/027.xhtml b/testing/web-platform/tests/html/editing/dnd/events/027.xhtml
new file mode 100644
index 000000000..f61036197
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/027.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>PNG image drag and drop: 'return false' should not cancel event</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body onload="document.querySelector('img').addEventListener('drag',function (){return false},false)">
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy'" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag green circle to the silver box below and drop it. It should be copied to the box once you drop it there.</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="addImage(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/028.xhtml b/testing/web-platform/tests/html/editing/dnd/events/028.xhtml
new file mode 100644
index 000000000..ce4944106
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/028.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop: 'return false' should not cancel event</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('a').addEventListener('drag',function (){return false},false)">
+<p><a href="data:text/plain,1" ondragstart="event.dataTransfer.effectAllowed = 'copy'">Drag me</a></p>
+<p>Drag link above to the navy box below and drop it. You should see word PASS once you drop it in the box.</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'))"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/029.html b/testing/web-platform/tests/html/editing/dnd/events/029.html
new file mode 100644
index 000000000..c02cd95b3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/029.html
@@ -0,0 +1,79 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Drag and drop without cancelling dragenter</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript">
+
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0], sequence = [];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+ drag.ondragenter = drag.ondragover = function (e) {
+ e.preventDefault();
+ };
+ var drop = document.getElementsByTagName('div')[1], dragoverhasfired = false;
+ drop.ondragenter = function (e) {
+ dragoverhasfired = true; //events targeting body will be ignored until this event has fired
+ sequence[sequence.length] = 'drop.dragenter';
+ };
+ drop.ondragover = function (e) {
+ e.preventDefault();
+ if( sequence[sequence.length-1] != 'drop.dragover' ) {
+ sequence[sequence.length] = 'drop.dragover';
+ }
+ };
+ drop.ondrop = function (e) {
+ e.preventDefault();
+ sequence[sequence.length] = 'drop.ondrop';
+ };
+ document.body.ondragenter = function (e) {
+ if( e.target != this ) { return; }
+ if( dragoverhasfired ) {
+ sequence[sequence.length] = 'body.dragenter';
+ }
+ };
+ document.body.ondragover = function (e) {
+ if( e.target != this ) { return; }
+ if( dragoverhasfired ) {
+ if( sequence[sequence.length-1] != 'body.dragover' ) {
+ sequence[sequence.length] = 'body.dragover';
+ }
+ }
+ };
+ drag.ondragend = function (e) {
+ sequence = sequence.join('=&gt;')
+ var desiredsequence = (['drop.dragenter','body.dragenter','body.dragover']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[2].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[2].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div><div></div>
+ <div>&nbsp;</div>
+ <p>Drag the orange square onto the blue square and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/030.html b/testing/web-platform/tests/html/editing/dnd/events/030.html
new file mode 100644
index 000000000..5d5eaa284
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/030.html
@@ -0,0 +1,61 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Drag and drop without cancelling dragenter on body</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ margin-left: 100px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript">
+//If dragenter is cancelled the body should then become the target element, receiving both a dragenter and a dragover event.
+//When the body is the actual immediate user selection (first time over the body), that means it gets *2* dragenter events
+//Then when a div becomes immediate user selection (blue) but does not cancel the dragenter event, dragenter does not need
+//to fire on body because body is already the current target element
+//Then when the body is the actual immediate user selection again (second time over the body), it is already the current
+//target element, so does not get a dragenter event
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0], beforecount = 0, aftercount = 0, switchcount = false;
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+ drag.ondragenter = drag.ondrop = drag.ondragover = function (e) {
+ e.preventDefault();
+ };
+ var drop = document.getElementsByTagName('div')[1];
+ drop.ondragenter = function (e) {
+ switchcount = true;
+ };
+ drop.ondragover = function (e) {
+ e.preventDefault();
+ };
+ document.body.ondragenter = function (e) {
+ if( e.target != this ) { return; }
+ if( switchcount ) { aftercount++; } else { beforecount++; }
+ };
+ drag.ondragend = function (e) {
+ document.getElementsByTagName('div')[2].innerHTML = ( beforecount == 2 && aftercount == 0 ) ? 'PASS' : ( 'FAIL, dragenter fired on body '+beforecount+' time(s) before blue.ondragenter and '+aftercount+' time(s) afterwards, instead of 2 and 0 times respectively' );
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div><div></div>
+ <div>&nbsp;</div>
+ <p>Drag the orange square onto the blue square, then back to the orange square, and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/031-1.html b/testing/web-platform/tests/html/editing/dnd/events/031-1.html
new file mode 100644
index 000000000..1574c5904
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/031-1.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Non-rendered body should still become current target element</title>
+ <style type="text/css">
+html { background: blue; }
+ </style>
+ </head>
+ <body>
+
+ <script type="text/javascript">
+var seentypes = {};
+document.body.ondragenter = document.body.ondragover = document.body.ondrop = function (e) {
+ e.preventDefault();
+ //document.body.innerHTML += e.type;
+ if( e.type == 'drop' ) {
+ document.body.innerHTML = ( seentypes.dragenter && seentypes.dragover ) ? 'PASS' : 'FAIL';
+ } else {
+ seentypes[e.type] = true;
+ }
+}
+ </script>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/031.html b/testing/web-platform/tests/html/editing/dnd/events/031.html
new file mode 100644
index 000000000..101edeafb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/031.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Non-rendered body should still become current target element</title>
+ <style type="text/css">
+span { background: orange; display: inline-block; height: 200px; width: 200px; }
+iframe { border: none; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('span')[0].ondragstart = function (e) {
+ e.dataTransfer.setData('text','dummy text');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Drag the orange square onto the blue square and release it. Fail if text does not appear in the blue square.</p>
+ <p><span draggable="true"></span> <iframe height="200" width="200" src="031-1.html"></iframe></p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/032.html b/testing/web-platform/tests/html/editing/dnd/events/032.html
new file mode 100644
index 000000000..af1e2253f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/032.html
@@ -0,0 +1,81 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Drag and drop passing over body without cancelling dragenter</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ margin-left: 200px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript">
+//this test enforces the following spec statement:
+//"if this immediate user selection is not the same as the current target element"
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0], sequence = [];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+ drag.ondragenter = function (e) {
+ sequence[sequence.length] = 'drag.dragenter';
+ };
+ drag.ondragover = function (e) {
+ if( sequence[sequence.length-1] != 'drag.dragover' ) {
+ sequence[sequence.length] = 'drag.dragover';
+ }
+ };
+ var drop = document.getElementsByTagName('div')[1];
+ drop.ondragenter = function (e) {
+ e.preventDefault();
+ sequence[sequence.length] = 'drop.dragenter';
+ };
+ drop.ondragover = function (e) {
+ e.preventDefault();
+ if( sequence[sequence.length-1] != 'drop.dragover' ) {
+ sequence[sequence.length] = 'drop.dragover';
+ }
+ };
+ drop.ondrop = function (e) {
+ e.preventDefault();
+ sequence[sequence.length] = 'drop.ondrop';
+ };
+ document.body.ondragenter = function (e) {
+ sequence[sequence.length] = ( e.target == this ) ? 'body.dragenter' : 'bubble.dragenter';
+ };
+ document.body.ondragover = function (e) {
+ if( e.target != this ) { return; }
+ if( sequence[sequence.length-1] != 'body.dragover' ) {
+ sequence[sequence.length] = 'body.dragover';
+ }
+ };
+ drag.ondragend = function (e) {
+ sequence = sequence.join('=&gt;')
+ var desiredsequence = (['drag.dragenter','bubble.dragenter','body.dragenter','body.dragover','drop.dragenter','bubble.dragenter','drop.dragover','drop.ondrop']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[2].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[2].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div><div></div>
+ <div>&nbsp;</div>
+ <p>Drag the orange square onto the blue square and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/033.html b/testing/web-platform/tests/html/editing/dnd/events/033.html
new file mode 100644
index 000000000..c33aa5546
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/033.html
@@ -0,0 +1,79 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Drag and drop without cancelling dragenter from non-target to non-target</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0], sequence = [];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+ drag.ondragenter = function (e) {
+ sequence[sequence.length] = 'drag.dragenter';
+ };
+ drag.ondragover = function (e) {
+ if( sequence[sequence.length-1] != 'drag.dragover' ) {
+ sequence[sequence.length] = 'drag.dragover';
+ }
+ };
+ drag.ondragleave = function (e) {
+ sequence[sequence.length] = 'drag.dragleave';
+ };
+ var drop = document.getElementsByTagName('div')[1];
+ drop.ondragenter = function (e) {
+ sequence[sequence.length] = 'drop.dragenter';
+ };
+ drop.ondragover = function (e) {
+ if( sequence[sequence.length-1] != 'drop.dragover' ) {
+ sequence[sequence.length] = 'drop.dragover';
+ }
+ };
+ drop.ondrop = function (e) {
+ e.preventDefault();
+ sequence[sequence.length] = 'drop.ondrop';
+ };
+ document.body.ondragenter = function (e) {
+ sequence[sequence.length] = ( e.target == this ) ? 'body.dragenter' : 'bubble.dragenter';
+ };
+ document.body.ondragover = function (e) {
+ if( e.target != this ) { return; }
+ if( sequence[sequence.length-1] != 'body.dragover' ) {
+ sequence[sequence.length] = 'body.dragover';
+ }
+ };
+ drag.ondragend = function (e) {
+ sequence = sequence.join('=&gt;')
+ var desiredsequence = (['drag.dragenter','bubble.dragenter','body.dragenter','body.dragover','drop.dragenter','bubble.dragenter','body.dragover']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[2].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[2].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div><div></div>
+ <div>&nbsp;</div>
+ <p>Drag the orange square onto the blue square and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/034.html b/testing/web-platform/tests/html/editing/dnd/events/034.html
new file mode 100644
index 000000000..ed13d00ca
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/034.html
@@ -0,0 +1,56 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Drag and drop with cancelling dragenter on body</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ margin-left: 100px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0], beforecount = 0, aftercount = 0, switchcount = false;
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+ drag.ondragenter = drag.ondrop = drag.ondragover = function (e) {
+ e.preventDefault();
+ };
+ var drop = document.getElementsByTagName('div')[1];
+ drop.ondragenter = function (e) {
+ switchcount = true;
+ };
+ drop.ondragover = function (e) {
+ e.preventDefault();
+ };
+ document.body.ondragenter = function (e) {
+ if( e.target != this ) { return; }
+ e.preventDefault(); //don't cancel when it bubbles from the child elements
+ if( switchcount ) { aftercount++; } else { beforecount++; }
+ };
+ drag.ondragend = function (e) {
+ document.getElementsByTagName('div')[2].innerHTML = ( beforecount == 1 && aftercount == 0 ) ? 'PASS' : ( 'FAIL, dragenter fired on body '+beforecount+' time(s) before blue.ondragenter and '+aftercount+' time(s) afterwards, instead of 1 and 0 times respectively' );
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div><div></div>
+ <div>&nbsp;</div>
+ <p>Drag the orange square onto the blue square, then back to the orange square, and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/035.html b/testing/web-platform/tests/html/editing/dnd/events/035.html
new file mode 100644
index 000000000..3d1ba04c7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/035.html
@@ -0,0 +1,83 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Drag and drop passing over body with cancelling dragenter</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ margin-left: 200px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript">
+//this test enforces the following spec statement:
+//"if this immediate user selection is not the same as the current target element"
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0], sequence = [];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+ drag.ondragenter = function (e) {
+ sequence[sequence.length] = 'drag.dragenter';
+ };
+ drag.ondragover = function (e) {
+ if( sequence[sequence.length-1] != 'drag.dragover' ) {
+ sequence[sequence.length] = 'drag.dragover';
+ }
+ };
+ var drop = document.getElementsByTagName('div')[1];
+ drop.ondragenter = function (e) {
+ e.preventDefault();
+ sequence[sequence.length] = 'drop.dragenter';
+ };
+ drop.ondragover = function (e) {
+ e.preventDefault();
+ if( sequence[sequence.length-1] != 'drop.dragover' ) {
+ sequence[sequence.length] = 'drop.dragover';
+ }
+ };
+ drop.ondrop = function (e) {
+ e.preventDefault();
+ sequence[sequence.length] = 'drop.ondrop';
+ };
+ document.body.ondragenter = function (e) {
+ sequence[sequence.length] = ( e.target == this ) ? 'body.dragenter' : 'bubble.dragenter';
+ if( e.target != this ) { return; }
+ e.preventDefault(); //don't cancel when it bubbles from the child elements
+ };
+ document.body.ondragover = function (e) {
+ if( e.target != this ) { return; }
+ if( sequence[sequence.length-1] != 'body.dragover' ) {
+ sequence[sequence.length] = 'body.dragover';
+ }
+ };
+ drag.ondragend = function (e) {
+ sequence = sequence.join('=&gt;')
+ var desiredsequence = (['drag.dragenter','bubble.dragenter','body.dragenter','body.dragover','drop.dragenter','bubble.dragenter','drop.dragover','drop.ondrop']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[2].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[2].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div><div></div>
+ <div>&nbsp;</div>
+ <p>Drag the orange square onto the blue square and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/036.html b/testing/web-platform/tests/html/editing/dnd/events/036.html
new file mode 100644
index 000000000..5a2d3c337
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/036.html
@@ -0,0 +1,70 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Drag and drop passing over body with all events handled at body</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ margin-left: 200px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('div')[0], drop = document.getElementsByTagName('div')[1], sequence = [];
+ function targ(el) {
+ if( el == drag ) { return 'drag'; }
+ else if( el == drop ) { return 'drop'; }
+ else if( el == document.body ) { return 'body'; }
+ else { return el; }
+ }
+ document.body.ondragstart = function (e) {
+ e.dataTransfer.setData('text','data');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+ document.body.ondragenter = function (e) {
+ e.preventDefault();
+ sequence[sequence.length] = targ(e.target)+'.ondragenter';
+ };
+ document.body.ondragover = function (e) {
+ e.preventDefault();
+ var seqname = targ(e.target)+'.ondragover';
+ if( sequence[sequence.length-1] != seqname ) {
+ sequence[sequence.length] = seqname;
+ }
+ };
+ document.body.ondrop = function (e) {
+ e.preventDefault();
+ sequence[sequence.length] = targ(e.target)+'.ondrop';
+ sequence[sequence.length] = e.dataTransfer.getData('text');
+ };
+ document.body.ondragend = function (e) {
+ sequence[sequence.length] = targ(e.target)+'.ondragend';
+ sequence = sequence.join('=&gt;')
+ var desiredsequence = (['drag.ondragenter','drag.ondragover','body.ondragenter','body.ondragover','drop.ondragenter','drop.ondragover','drop.ondrop','data','drag.ondragend']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[2].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[2].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div><div></div>
+ <div>&nbsp;</div>
+ <p>Drag the orange square onto the blue square and release it. For the entire duration of the drag, if supported by the platform, the mouse cursor should show as a drop-allowed or drop-copy-allowed cursor.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/037-proposed.xhtml b/testing/web-platform/tests/html/editing/dnd/events/037-proposed.xhtml
new file mode 100644
index 000000000..6fdd1b2f4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/037-proposed.xhtml
@@ -0,0 +1,86 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Drag and drop without cancelling dragenter and without body</title>
+ <style type="text/css">
+html {
+ padding:20px;
+}
+head + div {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+head + div + div {
+ height: 100px;
+ width: 100px;
+ margin-left: 100px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript"><![CDATA[
+//Drag passes from orange to root element. Dragenter fires at root element.
+//Dragenter is not cancelled. Body does not exist. Dragenter fires at root element again.
+//Drag passes from root element to blue. Dragenter fires at blue.
+//Dragenter is not cancelled. Body does not exist. Current target element is root element.
+//Drag passes from blue to root element. Current target element is already root element.
+//Drag passes from root element to orange. Dragenter fires at orange, and is cancelled.
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], sequence = [];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+ orange.ondragenter = orange.ondrop = function (e) {
+ sequence[sequence.length] = 'orange.'+e.type;
+ e.preventDefault();
+ };
+ orange.ondragleave = function (e) {
+ sequence[sequence.length] = 'orange.dragleave';
+ };
+ orange.ondragover = function (e) {
+ if( sequence[sequence.length-1] != 'orange.dragover' ) {
+ sequence[sequence.length] = 'orange.dragover';
+ }
+ e.preventDefault();
+ };
+ var blue = document.getElementsByTagName('div')[1];
+ blue.ondragenter = blue.ondragover = blue.ondragleave = function (e) {
+ sequence[sequence.length] = 'blue.'+e.type;
+ };
+ document.documentElement.ondragenter = document.documentElement.ondragleave = function (e) {
+ if( e.target != this ) { return; }
+ sequence[sequence.length] = 'html.'+e.type;
+ };
+ document.documentElement.ondragover = function (e) {
+ if( e.target != this ) { return; }
+ if( sequence[sequence.length-1] != 'html.dragover' ) {
+ sequence[sequence.length] = 'html.dragover';
+ }
+ };
+ document.ondragenter = document.ondragleave = document.ondragover = document.ondragleave = function (e) {
+ if( e.target != this ) { return; }
+ sequence[sequence.length] = 'document.'+e.type;
+ };
+ orange.ondragend = function (e) {
+ sequence = sequence.join('=>')
+ var desiredsequence = (['orange.dragenter','orange.dragover','html.dragenter','html.dragenter','orange.dragleave','html.dragover','blue.dragenter','html.dragover','orange.dragenter','html.dragleave','orange.dragover','orange.drop']).join('=>')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[2].textContent = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[2].textContent = 'FAIL, got: '+sequence+' instead of: '+desiredsequence;
+ }
+ };
+};
+ ]]></script>
+ </head>
+ <!--body-->
+
+ <div draggable="true"></div><div></div>
+ <div>&#160;</div>
+ <p>Drag the orange square onto the blue square, then back to the orange square, and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ <!--/body-->
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/037-spec.xhtml b/testing/web-platform/tests/html/editing/dnd/events/037-spec.xhtml
new file mode 100644
index 000000000..611891cb7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/037-spec.xhtml
@@ -0,0 +1,88 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Drag and drop without cancelling dragenter and without body (spec compliant)</title>
+ <style type="text/css">
+head + div {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+head + div + div {
+ height: 100px;
+ width: 100px;
+ margin-left: 100px;
+ background: blue;
+ display: inline-block;
+}
+ </style>
+ <script type="text/javascript"><![CDATA[
+//Drag passes from orange to root element. Dragenter fires at root element.
+//Dragenter is not cancelled. Body does not exist. Dragenter fires at document.
+//Spec says the body (which does not exist) becomes current target element => null.
+//Drag passes from root element to blue. Dragenter fires at blue.
+//Dragenter is not cancelled. Body does not exist. Current target element is null.
+//Dragenter fires at document. Current target is set to null again.
+//Drag passes from blue to root element. Dragenter fires at root element.
+//Dragenter is not cancelled. Body does not exist. Current target element is null.
+//Dragenter is not cancelled. Body does not exist. Dragenter fires at document.
+//Current target is set to null. Yet again.
+//Drag passes from root element to orange. Dragenter fires at orange, and is cancelled.
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], sequence = [];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+ orange.ondragenter = orange.ondrop = function (e) {
+ sequence[sequence.length] = 'orange.'+e.type;
+ e.preventDefault();
+ };
+ orange.ondragleave = function (e) {
+ sequence[sequence.length] = 'orange.dragleave';
+ };
+ orange.ondragover = function (e) {
+ if( sequence[sequence.length-1] != 'orange.dragover' ) {
+ sequence[sequence.length] = 'orange.dragover';
+ }
+ e.preventDefault();
+ };
+ var blue = document.getElementsByTagName('div')[1];
+ blue.ondragenter = blue.ondragover = blue.ondragleave = function (e) {
+ sequence[sequence.length] = 'blue.'+e.type;
+ };
+ document.documentElement.ondragenter = document.documentElement.ondragleave = function (e) {
+ if( e.target != this ) { return; }
+ sequence[sequence.length] = 'html.'+e.type;
+ };
+ document.documentElement.ondragover = function (e) {
+ if( e.target != this ) { return; }
+ if( sequence[sequence.length-1] != 'html.dragover' ) {
+ sequence[sequence.length] = 'html.dragover';
+ }
+ };
+ document.ondragenter = document.ondragleave = document.ondragover = document.ondragleave = function (e) {
+ if( e.target != this ) { return; }
+ sequence[sequence.length] = 'document.'+e.type;
+ };
+ orange.ondragend = function (e) {
+ sequence = sequence.join('=>')
+ var desiredsequence = (['orange.dragenter','orange.dragover','html.dragenter','document.dragenter','orange.dragleave','blue.dragenter','document.dragenter','document.dragenter','orange.dragenter','orange.dragover','orange.drop']).join('=>')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[2].textContent = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[2].textContent = 'FAIL, got: '+sequence+' instead of: '+desiredsequence;
+ }
+ };
+};
+ ]]></script>
+ </head>
+ <!--body-->
+
+ <div draggable="true"></div><div></div>
+ <div>&#160;</div>
+ <p>Drag the orange square onto the blue square, then back to the orange square, and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ <!--/body-->
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/038-proposed.html b/testing/web-platform/tests/html/editing/dnd/events/038-proposed.html
new file mode 100644
index 000000000..85d987612
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/038-proposed.html
@@ -0,0 +1,84 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Drag and drop without cancelling dragenter and without body or html</title>
+ <style type="text/css">
+body > div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+iframe {
+ height: 100px;
+ width: 100px;
+ margin-left: 100px;
+ display: inline-block;
+ border: none;
+}
+ </style>
+ <script type="text/javascript">
+//Drag passes from parent to blue. Dragenter fires at blue. Root element is deleted.
+//Dragenter is not cancelled. Body does not exist. Root element does not exist.
+//Current target element is set to null. Drag now points at unrendered document - null.
+//Current target element remains null.
+//Drag passes over parent to orange. Dragenter fires at orange, and is cancelled.
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], sequence = [];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','hello');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+ orange.ondragenter = orange.ondrop = function (e) {
+ sequence[sequence.length] = 'orange.'+e.type;
+ e.preventDefault();
+ };
+ orange.ondragleave = function (e) {
+ sequence[sequence.length] = 'orange.dragleave';
+ };
+ orange.ondragover = function (e) {
+ if( sequence[sequence.length-1] != 'orange.dragover' ) {
+ sequence[sequence.length] = 'orange.dragover';
+ }
+ e.preventDefault();
+ };
+ var blue = document.getElementsByTagName('iframe')[0].contentDocument;
+ if( !blue.documentElement ) { blue.appendChild(blue.createElement('html')); }
+ blue.documentElement.style.margin = '0';
+ blue.documentElement.style.padding = '0';
+ if( !blue.body ) { blue.documentElement.appendChild(blue.createElement('body')); }
+ blue.body.style.margin = '0';
+ blue.body.style.padding = '0';
+ var bluediv = blue.body.appendChild(blue.createElement('div'));
+ bluediv.style.height = '100px';
+ bluediv.style.width = '100px';
+ bluediv.style.background = 'blue';
+ bluediv.ondragenter = bluediv.ondragover = function (e) {
+ sequence[sequence.length] = 'blue.'+e.type;
+ if( blue.documentElement ) { blue.removeChild(blue.documentElement); }
+ };
+ blue.ondragenter = blue.ondragover = blue.ondragleave = function (e) {
+ if( e.target != this ) { return; }
+ sequence[sequence.length] = 'bluedocument.'+e.type;
+ };
+ orange.ondragend = function (e) {
+ sequence = sequence.join('=&gt;')
+ var desiredsequence = (['orange.dragenter','orange.dragover','orange.dragleave','blue.dragenter','orange.dragenter','orange.dragover','orange.drop']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[1].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[1].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div><iframe src="about:blank"></iframe>
+ <div>&nbsp;</div>
+ <p>Drag the orange square onto the blue square, then back to the orange square, and release it.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/events-cross-document-suite-HELPER-1.html b/testing/web-platform/tests/html/editing/dnd/events/events-cross-document-suite-HELPER-1.html
new file mode 100644
index 000000000..efd53c6b8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/events-cross-document-suite-HELPER-1.html
@@ -0,0 +1,205 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - event sequence for cross-document drag</title>
+<style type="text/css">
+ /* use margins instead of padding to make sure the body begins at the top of the page */
+ html, body {
+ margin: 0;
+ }
+ body {
+ padding: 116px 8px 8px;
+ }
+ #testhere div {
+ height: 100px;
+ width: 100px;
+ position: absolute;
+ top: 8px;
+ }
+ #orange {
+ background-color: orange;
+ left: 8px;
+ }
+ #fuchsia {
+ background-color: fuchsia;
+ left: 158px;
+ }
+</style>
+
+<script>
+parent.setup(function () {},{explicit_done:true,explicit_timeout:true});
+window.onload = function () {
+ var orange = document.querySelector('#orange')
+ var fuchsia = document.querySelector('#fuchsia')
+ var body = document.body;
+
+ orange.ondragstart = function (e) {
+ parent.events.push('doc1.orange.ondragstart');
+ e.dataTransfer.effectAllowed = 'all';
+ e.dataTransfer.setData('Text', 'foo');
+ };
+ orange.ondrag = function () { parent.events.push('doc1.orange.ondrag'); };
+ orange.ondragenter = function () { parent.events.push('doc1.orange.ondragenter'); };
+ orange.ondragover = function () { parent.events.push('doc1.orange.ondragover'); };
+ orange.ondrop = function () { parent.events.push('doc1.orange.ondrop'); return false; };
+ orange.ondragend = function () { parent.events.push('doc1.orange.ondragend'); setTimeout(finish,100); };
+ orange.onmousedown = function () { parent.events.push('doc1.orange.onmousedown'); };
+ orange.onmouseup = function () { parent.events.push('doc1.orange.onmouseup'); };
+
+ /* Events for the fuchsia box */
+ fuchsia.ondragstart = function () { parent.events.push('doc1.pink.ondragstart'); };
+ fuchsia.ondrag = function () { parent.events.push('doc1.pink.ondrag'); };
+ fuchsia.ondragenter = function () { parent.events.push('doc1.pink.ondragenter'); };
+ fuchsia.ondragover = function () { parent.events.push('doc1.pink.ondragover'); };
+ fuchsia.ondrop = function () { parent.events.push('doc1.pink.ondrop'); return false; };
+ fuchsia.ondragend = function () { parent.events.push('doc1.pink.ondragend'); };
+ fuchsia.onmousedown = function () { parent.events.push('doc1.pink.onmousedown'); };
+ fuchsia.onmouseup = function () { parent.events.push('doc1.pink.onmouseup'); };
+
+ /* Events for the page body */
+ body.ondragstart = function (e) { parent.events.push( ( e.target == body ) ? 'doc1.body.ondragstart': 'doc1.bubble.ondragstart' ); };
+ body.ondrag = function (e) { parent.events.push( ( e.target == body ) ? 'doc1.body.ondrag': 'doc1.bubble.ondrag' ); };
+ body.ondragenter = function (e) { parent.events.push( ( e.target == body ) ? 'doc1.body.ondragenter': 'doc1.bubble.ondragenter' ); };
+ body.ondragover = function (e) { parent.events.push( ( e.target == body ) ? 'doc1.body.ondragover': 'doc1.bubble.ondragover' ); };
+ body.ondrop = function (e) { parent.events.push( ( e.target == body ) ? 'doc1.body.ondrop': 'doc1.bubble.ondrop' ); };
+ body.ondragend = function (e) { parent.events.push( ( e.target == body ) ? 'doc1.body.ondragend': 'doc1.bubble.ondragend' ); };
+ body.onmousedown = function (e) { parent.events.push( ( e.target == body ) ? 'doc1.body.onmousedown': 'doc1.bubble.onmousedown' ); };
+ body.onmouseup = function (e) { parent.events.push( ( e.target == body ) ? 'doc1.body.onmouseup': 'doc1.bubble.onmouseup' ); };
+
+ function finish(e) {
+ var i, evindex;
+ var events = parent.events.join('-');
+ /*
+ Normalise; reduce repeating event sequences to only 2 occurrences.
+ This makes the final event sequence predictable, no matter how many times the drag->dragover sequences repeat.
+ Two occurrances are kept in each case to allow testing to make sure the sequence really is repeating.
+ */
+ //spec compliant - div dragenter is not cancelled, so body dragenter fires and body becomes current target
+ //repeats while drag is over orange or fuchsia or the body
+ events = events.replace(/(-doc1\.orange\.ondrag-doc1\.bubble\.ondrag-doc1\.body\.ondragover){3,}/g,'$1$1');
+ events = events.replace(/(-doc1\.orange\.ondrag-doc1\.bubble\.ondrag-doc2\.body\.ondragover){3,}/g,'$1$1');
+ //repeats while dragging over yellow
+ events = events.replace(/(-doc1\.orange\.ondrag-doc1\.bubble\.ondrag-doc2\.yellow\.ondragover-doc2\.bubble\.ondragover){3,}/g,'$1$1');
+ //repeats while dragging over blue
+ events = events.replace(/(-doc1\.orange\.ondrag-doc1\.bubble\.ondrag-doc2\.blue\.ondragover-doc2\.bubble\.ondragover){3,}/g,'$1$1');
+ //non-spec-compliant repeats while dragging over orange
+ events = events.replace(/(-doc1\.orange\.ondrag-doc1\.bubble\.ondrag-doc1\.orange\.ondragover-doc1\.bubble\.ondragover){3,}/g,'$1$1');
+ //non-spec-compliant repeats while dragging over fuchsia
+ events = events.replace(/(-doc1\.orange\.ondrag-doc1\.bubble\.ondrag-doc1\.pink\.ondragover-doc1\.bubble\.ondragover){3,}/g,'$1$1');
+ events = events.split(/-/g);
+
+ parent.test(function () {
+ parent.assert_array_equals(events,
+
+ ['doc1.orange.onmousedown', //mouse down
+ 'doc1.bubble.onmousedown',
+
+ 'doc1.orange.ondragstart', //dragging begins
+ 'doc1.bubble.ondragstart',
+
+ 'doc1.orange.ondrag', //mouse is over orange
+ 'doc1.bubble.ondrag',
+ 'doc1.orange.ondragenter', //not cancelled
+ 'doc1.bubble.ondragenter',
+ 'doc1.body.ondragenter', //so body becomes current target, and the event fires there as well
+ 'doc1.body.ondragover',
+
+ 'doc1.orange.ondrag', //start repeating (some over orange, some over body)
+ 'doc1.bubble.ondrag',
+ 'doc1.body.ondragover',
+ 'doc1.orange.ondrag', //...twice to make sure it actually repeats
+ 'doc1.bubble.ondrag',
+ 'doc1.body.ondragover', //end repeating
+
+ 'doc1.orange.ondrag', //mouse moves over pink
+ 'doc1.bubble.ondrag',
+ 'doc1.pink.ondragenter', //not cancelled
+ 'doc1.bubble.ondragenter',
+ 'doc1.body.ondragover', //so body becomes current target, but since it was already the target, dragenter does not need to fire again
+
+ 'doc1.orange.ondrag', //start repeating (some over pink, some over body)
+ 'doc1.bubble.ondrag',
+ 'doc1.body.ondragover',
+ 'doc1.orange.ondrag', //...twice to make sure it actually repeats
+ 'doc1.bubble.ondrag',
+ 'doc1.body.ondragover', //end repeating
+
+ 'doc1.orange.ondrag', //mouse moves over second frame
+ 'doc1.bubble.ondrag',
+ 'doc2.body.ondragenter', //not cancelled
+ 'doc2.body.ondragenter', //so it fires again and sets body as current target
+ 'doc2.body.ondragover',
+
+ 'doc1.orange.ondrag', //start repeating (over second body)
+ 'doc1.bubble.ondrag',
+ 'doc2.body.ondragover',
+ 'doc1.orange.ondrag', //...twice to make sure it actually repeats
+ 'doc1.bubble.ondrag',
+ 'doc2.body.ondragover', //end repeating
+
+ 'doc1.orange.ondrag', //mouse moves over yellow
+ 'doc1.bubble.ondrag',
+ 'doc2.yellow.ondragenter',
+ 'doc2.bubble.ondragenter',
+ 'doc2.yellow.ondragover',
+ 'doc2.bubble.ondragover',
+
+ 'doc1.orange.ondrag', //start repeating (over yellow)
+ 'doc1.bubble.ondrag',
+ 'doc2.yellow.ondragover',
+ 'doc2.bubble.ondragover',
+ 'doc1.orange.ondrag', //...twice to make sure it actually repeats
+ 'doc1.bubble.ondrag',
+ 'doc2.yellow.ondragover',
+ 'doc2.bubble.ondragover', //end repeating
+
+ 'doc1.orange.ondrag', //mouse moves over body
+ 'doc1.bubble.ondrag',
+ 'doc2.body.ondragenter', //not cancelled
+ 'doc2.body.ondragenter', //so it fires again and sets body as current target
+ 'doc2.body.ondragover',
+
+ 'doc1.orange.ondrag', //start repeating (over body)
+ 'doc1.bubble.ondrag',
+ 'doc2.body.ondragover',
+ 'doc1.orange.ondrag', //...twice to make sure it actually repeats
+ 'doc1.bubble.ondrag',
+ 'doc2.body.ondragover', //end repeating
+
+ 'doc1.orange.ondrag', //mouse moves over blue
+ 'doc1.bubble.ondrag',
+ 'doc2.blue.ondragenter',
+ 'doc2.bubble.ondragenter',
+ 'doc2.blue.ondragover',
+ 'doc2.bubble.ondragover',
+
+ 'doc1.orange.ondrag', //start repeating (over blue)
+ 'doc1.bubble.ondrag',
+ 'doc2.blue.ondragover',
+ 'doc2.bubble.ondragover',
+ 'doc1.orange.ondrag', //...twice to make sure it actually repeats
+ 'doc1.bubble.ondrag',
+ 'doc2.blue.ondragover',
+ 'doc2.bubble.ondragover', //end repeating
+
+ 'doc2.blue.ondrop', //release
+ 'doc2.bubble.ondrop',
+ 'doc1.orange.ondragend',
+ 'doc1.bubble.ondragend']
+
+ );
+ }, 'Overall sequence');
+ var div = parent.document.createElement("div");
+ div.setAttribute("id", "log");
+ parent.document.documentElement.appendChild(div);
+ parent.done();
+ document.body.appendChild(parent.document.querySelector("div"));
+ }
+};
+</script>
+
+<div id="testhere">
+<div draggable='true' id='orange'></div>
+<div id='fuchsia'></div>
+</div>
+
+<p>If you have already clicked on this page, reload it.</p>
+<p>Use your pointing device to slowly drag the orange square over the pink square, then the grey square, then the yellow square, then the blue square, and release it over the blue square (make sure the mouse remains over each square for at least 1 second, and over the gaps between squares for at least 1 second). Fail if no new text appears below.</p>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/events-cross-document-suite-HELPER-2.html b/testing/web-platform/tests/html/editing/dnd/events/events-cross-document-suite-HELPER-2.html
new file mode 100644
index 000000000..ba5a25009
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/events-cross-document-suite-HELPER-2.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - event sequence for cross-document drag</title>
+<style type="text/css">
+ /* use margins instead of padding to make sure the body begins at the top of the page */
+ html, body {
+ margin: 0;
+ padding: 0;
+ height: 100%;
+ }
+ #testhere div {
+ height: 100px;
+ width: 100px;
+ position: absolute;
+ top: 8px;
+ }
+ body::before {
+ height: 100px;
+ width: 100px;
+ position: absolute;
+ top: 8px;
+ left: 0px;
+ content: "";
+ background-color: silver;
+ }
+ #yellow {
+ background-color: yellow;
+ left: 150px;
+ }
+ #blue {
+ background-color: navy;
+ left: 300px;
+ }
+</style>
+
+<script>
+window.onload = function () {
+ var yellow = document.querySelector('#yellow')
+ var blue = document.querySelector('#blue')
+ var body = document.body;
+
+ /* Events for the fuchsia box */
+ yellow.ondragstart = function () { parent.events.push('doc2.yellow.ondragstart'); };
+ yellow.ondrag = function () { parent.events.push('doc2.yellow.ondrag'); };
+ yellow.ondragenter = function () { parent.events.push('doc2.yellow.ondragenter'); return false; };
+ yellow.ondragover = function () { parent.events.push('doc2.yellow.ondragover'); return false; };
+ yellow.ondrop = function () { parent.events.push('doc2.yellow.ondrop'); return false; };
+ yellow.ondragend = function () { parent.events.push('doc2.yellow.ondragend'); };
+ yellow.onmousedown = function () { parent.events.push('doc2.yellow.onmousedown'); };
+ yellow.onmouseup = function () { parent.events.push('doc2.yellow.onmouseup'); };
+
+ /* Events for the blue box (droppable) */
+ blue.ondragstart = function () { parent.events.push('doc2.blue.ondragstart'); };
+ blue.ondrag = function () { parent.events.push('doc2.blue.ondrag'); };
+ blue.ondragenter = function () { parent.events.push('doc2.blue.ondragenter'); return false; };
+ blue.ondragover = function () { parent.events.push('doc2.blue.ondragover'); return false; };
+ blue.ondrop = function () { parent.events.push('doc2.blue.ondrop'); return false; };
+ blue.ondragend = function () { parent.events.push('doc2.blue.ondragend'); };
+ blue.onmousedown = function () { parent.events.push('doc2.blue.onmousedown'); };
+ blue.onmouseup = function () { parent.events.push('doc2.blue.onmouseup'); };
+
+ /* Events for the page body */
+ body.ondragstart = function (e) { parent.events.push( ( e.target == body ) ? 'doc2.body.ondragstart': 'doc2.bubble.ondragstart' ); };
+ body.ondrag = function (e) { parent.events.push( ( e.target == body ) ? 'doc2.body.ondrag': 'doc2.bubble.ondrag' ); };
+ body.ondragenter = function (e) { parent.events.push( ( e.target == body ) ? 'doc2.body.ondragenter': 'doc2.bubble.ondragenter' ); };
+ body.ondragover = function (e) { parent.events.push( ( e.target == body ) ? 'doc2.body.ondragover': 'doc2.bubble.ondragover' ); };
+ body.ondrop = function (e) { parent.events.push( ( e.target == body ) ? 'doc2.body.ondrop': 'doc2.bubble.ondrop' ); };
+ body.ondragend = function (e) { parent.events.push( ( e.target == body ) ? 'doc2.body.ondragend': 'doc2.bubble.ondragend' ); };
+ body.onmousedown = function (e) { parent.events.push( ( e.target == body ) ? 'doc2.body.onmousedown': 'doc2.bubble.onmousedown' ); };
+ body.onmouseup = function (e) { parent.events.push( ( e.target == body ) ? 'doc2.body.onmouseup': 'doc2.bubble.onmouseup' ); };
+
+};
+</script>
+
+<div id="testhere">
+<div id='yellow'></div>
+<div id='blue'></div>
+</div>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/events-cross-document-suite-manual.html b/testing/web-platform/tests/html/editing/dnd/events/events-cross-document-suite-manual.html
new file mode 100644
index 000000000..689c75237
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/events-cross-document-suite-manual.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - event sequence for cross-document drag</title>
+<script type="text/javascript" src="/resources/testharness.js"></script>
+<script>
+var events = new Array();
+</script>
+
+<frameset cols="308,*" frameborder="no" border="0">
+ <frame src="events-cross-document-suite-HELPER-1.html">
+ <frame src="events-cross-document-suite-HELPER-2.html">
+</frameset>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/events-file-suite-manual.html b/testing/web-platform/tests/html/editing/dnd/events/events-file-suite-manual.html
new file mode 100644
index 000000000..7f78749cf
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/events-file-suite-manual.html
@@ -0,0 +1,175 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - event sequence for file drops</title>
+<script type="text/javascript" src="/resources/testharness.js"></script>
+<style type="text/css">
+ /* use margins instead of padding to make sure the body begins at the top of the page */
+ html, body {
+ margin: 0;
+ }
+ body {
+ padding: 116px 8px 8px;
+ }
+ body::before {
+ height: 108px;
+ width: 108px;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ content: "";
+ background-color: orange;
+ }
+ #testhere div {
+ height: 100px;
+ width: 100px;
+ position: absolute;
+ top: 8px;
+ }
+ #fuchsia {
+ background-color: fuchsia;
+ left: 158px;
+ }
+ #yellow {
+ background-color: yellow;
+ left: 308px;
+ }
+ #blue {
+ background-color: navy;
+ left: 458px;
+ }
+</style>
+
+<script>
+setup(function () {},{explicit_done:true,explicit_timeout:true});
+window.onload = function () {
+ var fuchsia = document.querySelector('#fuchsia')
+ var yellow = document.querySelector('#yellow')
+ var blue = document.querySelector('#blue')
+ var body = document.body;
+
+ var events = new Array
+
+ /* Events for the fuchsia box */
+ fuchsia.ondragstart = function () { events.push('pink.ondragstart'); };
+ fuchsia.ondrag = function () { events.push('pink.ondrag'); };
+ fuchsia.ondragenter = function () { events.push('pink.ondragenter'); };
+ fuchsia.ondragover = function () { events.push('pink.ondragover'); };
+ fuchsia.ondragleave = function () { events.push('pink.ondragleave'); };
+ fuchsia.ondrop = function () { events.push('pink.ondrop'); return false; };
+ fuchsia.ondragend = function () { events.push('pink.ondragend'); };
+ fuchsia.onmousedown = function () { events.push('pink.onmousedown'); };
+ fuchsia.onmouseup = function () { events.push('pink.onmouseup'); };
+
+ /* Events for the fuchsia box */
+ yellow.ondragstart = function () { events.push('yellow.ondragstart'); };
+ yellow.ondrag = function () { events.push('yellow.ondrag'); };
+ yellow.ondragenter = function () { events.push('yellow.ondragenter'); return false; };
+ yellow.ondragover = function () { events.push('yellow.ondragover'); return false; };
+ yellow.ondragleave = function () { events.push('yellow.ondragleave'); };
+ yellow.ondrop = function () { events.push('yellow.ondrop'); return false; };
+ yellow.ondragend = function () { events.push('yellow.ondragend'); };
+ yellow.onmousedown = function () { events.push('yellow.onmousedown'); };
+ yellow.onmouseup = function () { events.push('yellow.onmouseup'); };
+
+ /* Events for the blue box (droppable) */
+ blue.ondragstart = function () { events.push('blue.ondragstart'); };
+ blue.ondrag = function () { events.push('blue.ondrag'); };
+ blue.ondragenter = function () { events.push('blue.ondragenter'); return false; };
+ blue.ondragover = function () { events.push('blue.ondragover'); return false; };
+ blue.ondragleave = function () { events.push('blue.ondragleave'); };
+ blue.ondrop = function () { events.push('blue.ondrop'); return false; };
+ blue.ondragend = function () { events.push('blue.ondragend'); };
+ blue.onmousedown = function () { events.push('blue.onmousedown'); };
+ blue.onmouseup = function () { events.push('blue.onmouseup'); };
+
+ /* Events for the page body */
+ body.ondragstart = function (e) { events.push( ( e.target == body ) ? 'body.ondragstart': 'bubble.ondragstart' ); };
+ body.ondrag = function (e) { events.push( ( e.target == body ) ? 'body.ondrag': 'bubble.ondrag' ); };
+ body.ondragenter = function (e) { events.push( ( e.target == body ) ? 'body.ondragenter': 'bubble.ondragenter' ); };
+ body.ondragover = function (e) { events.push( ( e.target == body ) ? 'body.ondragover': 'bubble.ondragover' ); };
+ body.ondragleave = function (e) { events.push( ( e.target == body ) ? 'body.ondragleave': 'bubble.ondragleave' ); };
+ body.ondrop = function (e) { events.push( ( e.target == body ) ? 'body.ondrop': 'bubble.ondrop' ); setTimeout(finish,200); };
+ body.ondragend = function (e) { events.push( ( e.target == body ) ? 'body.ondragend': 'bubble.ondragend' ); };
+ body.onmousedown = function (e) { events.push( ( e.target == body ) ? 'body.onmousedown': 'bubble.onmousedown' ); };
+ body.onmouseup = function (e) { events.push( ( e.target == body ) ? 'body.onmouseup': 'bubble.onmouseup' ); };
+
+ function finish(e) {
+ var i, evindex;
+ events = events.join('-');
+ /*
+ Normalise; reduce repeating event sequences to only 2 occurrences.
+ This makes the final event sequence predictable, no matter how many times the drag->dragover sequences repeat.
+ Two occurrances are kept in each case to allow testing to make sure the sequence really is repeating.
+ */
+ //spec compliant - div dragenter is not cancelled, so body dragenter fires and body becomes current target
+ //repeats while drag is over fuchsia or the body
+ events = events.replace(/(-body\.ondragover){3,}/g,'$1$1');
+ //repeats while dragging over yellow
+ events = events.replace(/(-yellow\.ondragover-bubble\.ondragover){3,}/g,'$1$1');
+ //repeats while dragging over blue
+ events = events.replace(/(-blue\.ondragover-bubble\.ondragover){3,}/g,'$1$1');
+ //non-spec-compliant repeats while dragging over fuchsia
+ events = events.replace(/(-pink\.ondragover-bubble\.ondragover){3,}/g,'$1$1');
+ events = events.split(/-/g);
+
+ test(function () {
+ assert_array_equals(events,
+
+ [/* 1 */ 'body.ondragenter', //mouse moves over body, which does not cancel event
+ /* 2 */ 'body.ondragenter', //so it fires again and sets body as current target
+
+ /* 3 */ 'body.ondragover', //start repeating over body
+ /* 4 */ 'body.ondragover', //...twice to make sure it actually repeats
+
+ /* 5 */ 'pink.ondragenter', //mouse moves over pink - not cancelled
+ /* 6 */ 'bubble.ondragenter',
+
+ /* 7 */ 'body.ondragover', //so body becomes current target, but since it was already the target, dragenter does not need to fire again
+ /* 8 */ 'body.ondragover', //...twice to make sure it actually repeats
+
+ /* 9 */ 'yellow.ondragenter', //mouse moves over yellow
+ /* 10 */ 'bubble.ondragenter',
+ /* 11 */ 'body.ondragleave',
+
+ /* 12 */ 'yellow.ondragover', //start repeating (over yellow)
+ /* 13 */ 'bubble.ondragover',
+ /* 14 */ 'yellow.ondragover', //...twice to make sure it actually repeats
+ /* 15 */ 'bubble.ondragover', //end repeating
+
+ /* 16 */ 'body.ondragenter', //mouse moves over body, not cancelled
+ /* 17 */ 'body.ondragenter', //so it fires again and sets body as current target
+ /* 18 */ 'yellow.ondragleave',
+ /* 19 */ 'bubble.ondragleave',
+
+ /* 20 */ 'body.ondragover', //start repeating (over body)
+ /* 21 */ 'body.ondragover', //...twice to make sure it actually repeats
+
+ /* 22 */ 'blue.ondragenter', //mouse moves over blue
+ /* 23 */ 'bubble.ondragenter',
+ /* 24 */ 'body.ondragleave',
+
+ /* 25 */ 'blue.ondragover', //start repeating (over blue)
+ /* 26 */ 'bubble.ondragover',
+ /* 27 */ 'blue.ondragover', //...twice to make sure it actually repeats
+ /* 28 */ 'bubble.ondragover',
+
+ /* 29 */ 'blue.ondrop', //release
+ /* 30 */ 'bubble.ondrop']
+
+ );
+ }, 'Overall sequence');
+
+ done();
+ }
+};
+</script>
+
+<div id="testhere">
+<div id='fuchsia'></div>
+<div id='yellow'></div>
+<div id='blue'></div>
+</div>
+
+<p>If you have already clicked on this page, reload it.</p>
+<p>Use your pointing device to slowly drag a file from your system's file manager, over the orange square (ensure that this is the first part of the page that you drag the file over, not an otherwise blank part of the page), then the pink square, then the yellow square, then the blue square, and release it over the blue square (make sure the mouse remains over each square for at least 1 second, and over the gaps between squares for at least 1 second). If a prompt appears, accept it. Fail if no new text appears below.</p>
+
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/events-non-draggable-001.html b/testing/web-platform/tests/html/editing/dnd/events/events-non-draggable-001.html
new file mode 100644
index 000000000..0315ccdc8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/events-non-draggable-001.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<meta charset='utf-8'>
+<title>drag &amp; drop – events should not fire with non-draggable elements – 001</title>
+<style type="text/css">
+ div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ div + p {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+window.onload = function() {
+
+ var elem = document.getElementsByTagName('div')[0];
+ var pass = true;
+
+ function fail() {
+ pass = false;
+ }
+
+ elem.addEventListener('drag',fail,false);
+ elem.addEventListener('dragend',fail,false);
+ elem.addEventListener('dragenter',fail,false);
+ elem.addEventListener('dragleave',fail,false);
+ elem.addEventListener('dragover',fail,false);
+ elem.addEventListener('dragstart',fail,false);
+ elem.addEventListener('drop',fail,false);
+
+ elem.ondrag = fail;
+ elem.ondragend = fail;
+ elem.ondragenter = fail;
+ elem.ondragleave = fail;
+ elem.ondragover = fail;
+ elem.ondragstart = fail;
+ elem.ondrop = fail;
+
+ elem.onmouseup = function () {
+ setTimeout(function () {
+ if (pass == true) {
+ document.body.innerHTML = 'PASS';
+ } else {
+ document.body.innerHTML = 'FAIL';
+ }
+ }, 100 );
+ };
+
+}
+</script>
+
+<div></div>
+
+<p>Click once on the orange box above, without moving the mouse while
+clicking. The word &quot;PASS&quot; should appear.</p>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/events-non-draggable-002.html b/testing/web-platform/tests/html/editing/dnd/events/events-non-draggable-002.html
new file mode 100644
index 000000000..c890cb482
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/events-non-draggable-002.html
@@ -0,0 +1,101 @@
+<!DOCTYPE html>
+<meta charset='utf-8'>
+<title>drag &amp; drop – events should not fire with non-draggable elements – 002</title>
+<style type="text/css">
+ div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ div + div {
+ background-color: navy;
+ left: 250px;
+ }
+
+ div + p {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+window.onload = function() {
+
+ var orange = document.getElementsByTagName('div')[0];
+ var blue = document.getElementsByTagName('div')[1];
+ var body = document.body;
+
+ var pass = true;
+
+ function fail() {
+ pass = false;
+ }
+
+ body.addEventListener('drag',fail,false);
+ body.addEventListener('dragend',fail,false);
+ body.addEventListener('dragenter',fail,false);
+ body.addEventListener('dragleave',fail,false);
+ body.addEventListener('dragover',fail,false);
+ body.addEventListener('dragstart',fail,false);
+ body.addEventListener('drop',fail,false);
+
+ body.ondrag = fail;
+ body.ondragend = fail;
+ body.ondragenter = fail;
+ body.ondragleave = fail;
+ body.ondragover = fail;
+ body.ondragstart = fail;
+ body.ondrop = fail;
+
+ orange.addEventListener('drag',fail,false);
+ orange.addEventListener('dragend',fail,false);
+ orange.addEventListener('dragenter',fail,false);
+ orange.addEventListener('dragleave',fail,false);
+ orange.addEventListener('dragover',fail,false);
+ orange.addEventListener('dragstart',fail,false);
+ orange.addEventListener('drop',fail,false);
+
+ orange.ondrag = fail;
+ orange.ondragend = fail;
+ orange.ondragenter = fail;
+ orange.ondragleave = fail;
+ orange.ondragover = fail;
+ orange.ondragstart = fail;
+ orange.ondrop = fail;
+
+ blue.addEventListener('drag',fail,false);
+ blue.addEventListener('dragend',fail,false);
+ blue.addEventListener('dragenter',fail,false);
+ blue.addEventListener('dragleave',fail,false);
+ blue.addEventListener('dragover',fail,false);
+ blue.addEventListener('dragstart',fail,false);
+ blue.addEventListener('drop',fail,false);
+
+ blue.ondrag = fail;
+ blue.ondragend = fail;
+ blue.ondragenter = fail;
+ blue.ondragleave = fail;
+ blue.ondragover = fail;
+ blue.ondragstart = fail;
+ blue.ondrop = fail;
+
+ body.onmouseup = function () {
+ setTimeout(function () {
+ if (pass == true) {
+ document.body.innerHTML = 'PASS';
+ } else {
+ document.body.innerHTML = 'FAIL';
+ }
+ }, 100 );
+ };
+
+}
+</script>
+
+<div></div>
+<div></div>
+
+<p>Use your pointing device to drag from the orange box to the blue box. The
+word &quot;PASS&quot; should appear.
diff --git a/testing/web-platform/tests/html/editing/dnd/events/events-suite-manual.html b/testing/web-platform/tests/html/editing/dnd/events/events-suite-manual.html
new file mode 100644
index 000000000..a29ea56a6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/events-suite-manual.html
@@ -0,0 +1,370 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - event sequence for draggable elements</title>
+<script type="text/javascript" src="/resources/testharness.js"></script>
+<style type="text/css">
+ /* use margins instead of padding to make sure the body begins at the top of the page */
+ html, body {
+ margin: 0;
+ }
+ body {
+ padding: 116px 8px 8px;
+ }
+ #testhere div {
+ height: 100px;
+ width: 100px;
+ position: absolute;
+ top: 8px;
+ }
+ #orange {
+ background-color: orange;
+ left: 8px;
+ }
+ #fuchsia {
+ background-color: fuchsia;
+ left: 158px;
+ }
+ #yellow {
+ background-color: yellow;
+ left: 308px;
+ }
+ #blue {
+ background-color: navy;
+ left: 458px;
+ }
+</style>
+
+<script>
+setup(function () {},{explicit_done:true,explicit_timeout:true});
+window.onload = function () {
+ var orange = document.querySelector('#orange')
+ var fuchsia = document.querySelector('#fuchsia')
+ var yellow = document.querySelector('#yellow')
+ var blue = document.querySelector('#blue')
+ var body = document.body;
+
+ var events = new Array
+
+ orange.ondragstart = function (e) {
+ events.push('orange.ondragstart');
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'foo');
+ };
+ orange.ondrag = function () { events.push('orange.ondrag'); };
+ orange.ondragenter = function () { events.push('orange.ondragenter'); };
+ orange.ondragover = function () { events.push('orange.ondragover'); };
+ orange.ondragleave = function () { events.push('orange.ondragleave'); };
+ orange.ondrop = function () { events.push('orange.ondrop'); return false; };
+ orange.ondragend = function () { events.push('orange.ondragend'); };
+ orange.onmousedown = function () { events.push('orange.onmousedown'); };
+ orange.onmouseup = function () { events.push('orange.onmouseup'); };
+
+ /* Events for the fuchsia box */
+ fuchsia.ondragstart = function () { events.push('pink.ondragstart'); };
+ fuchsia.ondrag = function () { events.push('pink.ondrag'); };
+ fuchsia.ondragenter = function () { events.push('pink.ondragenter'); };
+ fuchsia.ondragover = function () { events.push('pink.ondragover'); };
+ fuchsia.ondragleave = function () { events.push('pink.ondragleave'); };
+ fuchsia.ondrop = function () { events.push('pink.ondrop'); return false; };
+ fuchsia.ondragend = function () { events.push('pink.ondragend'); };
+ fuchsia.onmousedown = function () { events.push('pink.onmousedown'); };
+ fuchsia.onmouseup = function () { events.push('pink.onmouseup'); };
+
+ /* Events for the fuchsia box */
+ yellow.ondragstart = function () { events.push('yellow.ondragstart'); };
+ yellow.ondrag = function () { events.push('yellow.ondrag'); };
+ yellow.ondragenter = function () { events.push('yellow.ondragenter'); return false; };
+ yellow.ondragover = function () { events.push('yellow.ondragover'); return false; };
+ yellow.ondragleave = function () { events.push('yellow.ondragleave'); };
+ yellow.ondrop = function () { events.push('yellow.ondrop'); return false; };
+ yellow.ondragend = function () { events.push('yellow.ondragend'); };
+ yellow.onmousedown = function () { events.push('yellow.onmousedown'); };
+ yellow.onmouseup = function () { events.push('yellow.onmouseup'); };
+
+ /* Events for the blue box (droppable) */
+ blue.ondragstart = function () { events.push('blue.ondragstart'); };
+ blue.ondrag = function () { events.push('blue.ondrag'); };
+ blue.ondragenter = function () { events.push('blue.ondragenter'); return false; };
+ blue.ondragover = function () { events.push('blue.ondragover'); return false; };
+ blue.ondragleave = function () { events.push('blue.ondragleave'); };
+ blue.ondrop = function () { events.push('blue.ondrop'); return false; };
+ blue.ondragend = function () { events.push('blue.ondragend'); };
+ blue.onmousedown = function () { events.push('blue.onmousedown'); };
+ blue.onmouseup = function () { events.push('blue.onmouseup'); };
+
+ /* Events for the page body */
+ body.ondragstart = function (e) { events.push( ( e.target == body ) ? 'body.ondragstart': 'bubble.ondragstart' ); };
+ body.ondrag = function (e) { events.push( ( e.target == body ) ? 'body.ondrag': 'bubble.ondrag' ); };
+ body.ondragenter = function (e) { events.push( ( e.target == body ) ? 'body.ondragenter': 'bubble.ondragenter' ); };
+ body.ondragover = function (e) { events.push( ( e.target == body ) ? 'body.ondragover': 'bubble.ondragover' ); };
+ body.ondragleave = function (e) { events.push( ( e.target == body ) ? 'body.ondragleave': 'bubble.ondragleave' ); };
+ body.ondrop = function (e) { events.push( ( e.target == body ) ? 'body.ondrop': 'bubble.ondrop' ); };
+ body.ondragend = function (e) { events.push( ( e.target == body ) ? 'body.ondragend': 'bubble.ondragend' ); setTimeout(finish,100); };
+ body.onmousedown = function (e) { events.push( ( e.target == body ) ? 'body.onmousedown': 'bubble.onmousedown' ); };
+ body.onmouseup = function (e) { events.push( ( e.target == body ) ? 'body.onmouseup': 'bubble.onmouseup' ); };
+
+ function finish(e) {
+ var i, evindex;
+ events = events.join('-');
+ /*
+ Normalise; reduce repeating event sequences to only 2 occurrences.
+ This makes the final event sequence predictable, no matter how many times the drag->dragover sequences repeat.
+ Two occurrances are kept in each case to allow testing to make sure the sequence really is repeating.
+ */
+ //spec compliant - div dragenter is not cancelled, so body dragenter fires and body becomes current target
+ //repeats while drag is over orange or fuchsia or the body
+ events = events.replace(/(-orange\.ondrag-bubble\.ondrag-body\.ondragover){3,}/g,'$1$1');
+ //repeats while dragging over yellow
+ events = events.replace(/(-orange\.ondrag-bubble\.ondrag-yellow\.ondragover-bubble\.ondragover){3,}/g,'$1$1');
+ //repeats while dragging over blue
+ events = events.replace(/(-orange\.ondrag-bubble\.ondrag-blue\.ondragover-bubble\.ondragover){3,}/g,'$1$1');
+ //non-spec-compliant repeats while dragging over orange
+ events = events.replace(/(-orange\.ondrag-bubble\.ondrag-orange\.ondragover-bubble\.ondragover){3,}/g,'$1$1');
+ //non-spec-compliant repeats while dragging over fuchsia
+ events = events.replace(/(-orange\.ondrag-bubble\.ondrag-pink\.ondragover-bubble\.ondragover){3,}/g,'$1$1');
+ events = events.split(/-/g);
+
+ test(function () {
+ assert_array_equals(events,
+
+ [/* 1 */ 'orange.onmousedown', //mouse down
+ /* 2 */ 'bubble.onmousedown',
+
+ /* 3 */ 'orange.ondragstart', //dragging begins
+ /* 4 */ 'bubble.ondragstart',
+
+ /* 5 */ 'orange.ondrag', //mouse is over orange
+ /* 6 */ 'bubble.ondrag',
+ /* 7 */ 'orange.ondragenter', //not cancelled
+ /* 8 */ 'bubble.ondragenter',
+ /* 9 */ 'body.ondragenter', //so body becomes current target, and the event fires there as well
+ /* 10 */ 'body.ondragover',
+
+ /* 11 */ 'orange.ondrag', //start repeating (some over orange, some over body)
+ /* 12 */ 'bubble.ondrag',
+ /* 13 */ 'body.ondragover',
+ /* 14 */ 'orange.ondrag', //...twice to make sure it actually repeats
+ /* 15 */ 'bubble.ondrag',
+ /* 16 */ 'body.ondragover', //end repeating
+
+ /* 17 */ 'orange.ondrag', //mouse moves over pink
+ /* 18 */ 'bubble.ondrag',
+ /* 19 */ 'pink.ondragenter', //not cancelled
+ /* 20 */ 'bubble.ondragenter',
+ /* 21 */ 'body.ondragover', //so body becomes current target, but since it was already the target, dragenter does not need to fire again
+
+ /* 22 */ 'orange.ondrag', //start repeating (some over pink, some over body)
+ /* 23 */ 'bubble.ondrag',
+ /* 24 */ 'body.ondragover',
+ /* 25 */ 'orange.ondrag', //...twice to make sure it actually repeats
+ /* 26 */ 'bubble.ondrag',
+ /* 27 */ 'body.ondragover', //end repeating
+
+ /* 28 */ 'orange.ondrag', //mouse moves over yellow
+ /* 29 */ 'bubble.ondrag',
+ /* 30 */ 'yellow.ondragenter',
+ /* 31 */ 'bubble.ondragenter',
+ /* 32 */ 'body.ondragleave',
+ /* 33 */ 'yellow.ondragover',
+ /* 34 */ 'bubble.ondragover',
+
+ /* 35 */ 'orange.ondrag', //start repeating (over yellow)
+ /* 36 */ 'bubble.ondrag',
+ /* 37 */ 'yellow.ondragover',
+ /* 38 */ 'bubble.ondragover',
+ /* 39 */ 'orange.ondrag', //...twice to make sure it actually repeats
+ /* 40 */ 'bubble.ondrag',
+ /* 41 */ 'yellow.ondragover',
+ /* 42 */ 'bubble.ondragover', //end repeating
+
+ /* 43 */ 'orange.ondrag', //mouse moves over body
+ /* 44 */ 'bubble.ondrag',
+ /* 45 */ 'body.ondragenter', //not cancelled
+ /* 46 */ 'body.ondragenter', //so it fires again and sets body as current target
+ /* 47 */ 'yellow.ondragleave',
+ /* 48 */ 'bubble.ondragleave',
+ /* 49 */ 'body.ondragover',
+
+ /* 50 */ 'orange.ondrag', //start repeating (over body)
+ /* 51 */ 'bubble.ondrag',
+ /* 52 */ 'body.ondragover',
+ /* 53 */ 'orange.ondrag', //...twice to make sure it actually repeats
+ /* 54 */ 'bubble.ondrag',
+ /* 55 */ 'body.ondragover', //end repeating
+
+ /* 56 */ 'orange.ondrag', //mouse moves over blue
+ /* 57 */ 'bubble.ondrag',
+ /* 58 */ 'blue.ondragenter',
+ /* 59 */ 'bubble.ondragenter',
+ /* 60 */ 'body.ondragleave',
+ /* 61 */ 'blue.ondragover',
+ /* 62 */ 'bubble.ondragover',
+
+ /* 63 */ 'orange.ondrag', //start repeating (over blue)
+ /* 64 */ 'bubble.ondrag',
+ /* 65 */ 'blue.ondragover',
+ /* 66 */ 'bubble.ondragover',
+ /* 67 */ 'orange.ondrag', //...twice to make sure it actually repeats
+ /* 68 */ 'bubble.ondrag',
+ /* 69 */ 'blue.ondragover',
+ /* 70 */ 'bubble.ondragover', //end repeating
+
+ /* 71 */ 'blue.ondrop', //release
+ /* 72 */ 'bubble.ondrop',
+ /* 73 */ 'orange.ondragend',
+ /* 74 */ 'bubble.ondragend']
+
+ );
+ }, 'Overall sequence');
+
+ /* ondragstart */
+ test(function () { assert_true( events.indexOf('orange.ondragstart') != -1 ); }, "orange.ondragstart should fire");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'orange.ondragstart') return e; }).length, 1); }, "orange.ondragstart should fire 1 time");
+ test(function () { assert_equals( events[2], 'orange.ondragstart' ); }, "orange.ondragstart should be event handler #3");
+ test(function () { assert_equals( events.indexOf('pink.ondragstart'), -1 ); }, "pink.ondragstart should not fire");
+ test(function () { assert_equals( events.indexOf('yellow.ondragstart'), -1 ); }, "yellow.ondragstart should not fire");
+ test(function () { assert_equals( events.indexOf('blue.ondragstart'), -1 ); }, "blue.ondragstart should not fire");
+ test(function () { assert_equals( events.indexOf('body.ondragstart'), -1 ); }, "ondragstart should not fire at the body");
+ test(function () { assert_true( events.indexOf('bubble.ondragstart') != -1 ); }, "ondragstart should bubble to body");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'bubble.ondragstart') return e; }).length, 1); }, "ondragstart should only bubble to body 1 time");
+ test(function () { assert_equals( events[3], 'bubble.ondragstart' ); }, "ondragstart should bubble to body as event handler #4");
+
+ /* ondrag */
+ test(function () { assert_true( events.indexOf('orange.ondrag') != -1 ); }, "orange.ondrag should fire");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'orange.ondrag') return e; }).length, 15); }, "orange.ondrag should fire 15 times");
+ for( var i = 0, evindex = [4,10,13,16,21,24,27,34,38,42,49,52,55,62,66]; i < evindex.length; i++ ) {
+ test(function () { assert_equals( events[evindex[i]], 'orange.ondrag' ); }, "orange.ondrag should be event handler #"+(evindex[i]+1));
+ }
+ test(function () { assert_equals( events.indexOf('pink.ondrag'), -1 ); }, "pink.ondrag should not fire");
+ test(function () { assert_equals( events.indexOf('yellow.ondrag'), -1 ); }, "yellow.ondrag should not fire");
+ test(function () { assert_equals( events.indexOf('blue.ondrag'), -1 ); }, "blue.ondrag should not fire");
+ test(function () { assert_equals( events.indexOf('body.ondrag'), -1 ); }, "ondrag should not fire at the body");
+ test(function () { assert_true( events.indexOf('bubble.ondrag') != -1 ); }, "ondrag should bubble to body");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'bubble.ondrag') return e; }).length, 15); }, "ondrag should bubble to body 15 times");
+ for( var i = 0, evindex = [5,11,14,17,22,25,28,35,39,43,50,53,56,63,67]; i < evindex.length; i++ ) {
+ test(function () { assert_equals( events[evindex[i]], 'bubble.ondrag' ); }, "ondrag should bubble to body as event handler #"+(evindex[i]+1));
+ }
+
+ /* ondragenter */
+ test(function () { assert_true( events.indexOf('orange.ondragenter') != -1 ); }, "orange.ondragenter should fire");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'orange.ondragenter') return e; }).length, 1); }, "orange.ondragenter should fire 1 time");
+ test(function () { assert_equals( events[6], 'orange.ondragenter' ); }, "orange.ondragenter should be event handler #7");
+ test(function () { assert_true( events.indexOf('pink.ondragenter') != -1 ); }, "pink.ondragenter should fire");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'pink.ondragenter') return e; }).length, 1); }, "pink.ondragenter should fire 1 time");
+ test(function () { assert_equals( events[18], 'pink.ondragenter' ); }, "pink.ondragenter should be event handler #19");
+ test(function () { assert_true( events.indexOf('yellow.ondragenter') != -1 ); }, "yellow.ondragenter should fire");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'yellow.ondragenter') return e; }).length, 1); }, "yellow.ondragenter should fire 1 time");
+ test(function () { assert_equals( events[29], 'yellow.ondragenter' ); }, "yellow.ondragenter should be event handler #30");
+ test(function () { assert_true( events.indexOf('blue.ondragenter') != -1 ); }, "blue.ondragenter should fire");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'blue.ondragenter') return e; }).length, 1); }, "blue.ondragenter should fire 1 time");
+ test(function () { assert_equals( events[57], 'blue.ondragenter' ); }, "blue.ondragenter should be event handler #58");
+ test(function () { assert_true( events.indexOf('body.ondragenter') != -1 ); }, "ondragenter should fire at body");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'body.ondragenter') return e; }).length, 3); }, "ondragenter should fire at body 2 times");
+ for( var i = 0, evindex = [8,44,45]; i < evindex.length; i++ ) {
+ test(function () { assert_equals( events[evindex[i]], 'body.ondragenter' ); }, "ondragenter should fire at body as event handler #"+(evindex[i]+1));
+ }
+ test(function () { assert_true( events.indexOf('bubble.ondragenter') != -1 ); }, "ondragenter should bubble to body");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'bubble.ondragenter') return e; }).length, 4); }, "ondragenter should bubble to body 4 times");
+ for( var i = 0, evindex = [7,19,30,58]; i < evindex.length; i++ ) {
+ test(function () { assert_equals( events[evindex[i]], 'bubble.ondragenter' ); }, "ondragenter should bubble to body as event handler #"+(evindex[i]+1));
+ }
+
+ /* ondragover */
+ test(function () { assert_equals( events.indexOf('orange.ondragover'), -1 ); }, "orange.ondragover should not fire");
+ test(function () { assert_equals( events.indexOf('pink.ondragover'), -1 ); }, "pink.ondragover should not fire");
+ test(function () { assert_true( events.indexOf('yellow.ondragover') != -1 ); }, "yellow.ondragover should fire");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'yellow.ondragover') return e; }).length, 3); }, "yellow.ondragover should fire 3 times");
+ for( var i = 0, evindex = [32,36,40]; i < evindex.length; i++ ) {
+ test(function () { assert_equals( events[evindex[i]], 'yellow.ondragover' ); }, "yellow.ondragover should be event handler #"+(evindex[i]+1));
+ }
+ test(function () { assert_true( events.indexOf('blue.ondragover') != -1 ); }, "blue.ondragover should fire");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'blue.ondragover') return e; }).length, 3); }, "blue.ondragover should fire 9 times");
+ for( var i = 0, evindex = [60,64,68]; i < evindex.length; i++ ) {
+ test(function () { assert_equals( events[evindex[i]], 'blue.ondragover' ); }, "blue.ondragover should be event handler #"+(evindex[i]+1));
+ }
+ test(function () { assert_true( events.indexOf('body.ondragover') != -1 ); }, "ondragover should fire at body");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'body.ondragover') return e; }).length, 9); }, "ondragover should fire at body 2 times");
+ for( var i = 0, evindex = [9,12,15,20,23,26,48,51,54]; i < evindex.length; i++ ) {
+ test(function () { assert_equals( events[evindex[i]], 'body.ondragover' ); }, "ondragover should fire at body as event handler #"+(evindex[i]+1));
+ }
+ test(function () { assert_true( events.indexOf('bubble.ondragover') != -1 ); }, "ondragover should bubble to body");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'bubble.ondragover') return e; }).length, 6); }, "ondragover should bubble to body 6 times");
+ for( var i = 0, evindex = [33,37,41,61,65,69]; i < evindex.length; i++ ) {
+ test(function () { assert_equals( events[evindex[i]], 'bubble.ondragover' ); }, "ondragover should bubble to body as event handler #"+(evindex[i]+1));
+ }
+
+ /* ondragleave */
+ test(function () { assert_equals( events.indexOf('orange.ondragleave'), -1 ); }, "orange.ondragleave should not fire");
+ test(function () { assert_equals( events.indexOf('pink.ondragleave'), -1 ); }, "pink.ondragleave should not fire");
+ test(function () { assert_true( events.indexOf('yellow.ondragleave') != -1 ); }, "yellow.ondragleave should fire");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'yellow.ondragleave') return e; }).length, 1); }, "yellow.ondragleave should fire 1 time");
+ test(function () { assert_equals( events[46], 'yellow.ondragleave' ); }, "yellow.ondragleave should be event handler #47");
+ test(function () { assert_equals( events.indexOf('blue.ondragleave'), -1 ); }, "blue.ondragleave should not fire");
+ test(function () { assert_true( events.indexOf('body.ondragleave') != -1 ); }, "ondragleave should fire at body");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'body.ondragleave') return e; }).length, 2); }, "ondragleave should fire at body 2 times");
+ for( var i = 0, evindex = [31,59]; i < evindex.length; i++ ) {
+ test(function () { assert_equals( events[evindex[i]], 'body.ondragleave' ); }, "ondragleave should fire at body as event handler #"+(evindex[i]+1));
+ }
+ test(function () { assert_true( events.indexOf('bubble.ondragleave') != -1 ); }, "ondragleave should bubble to body");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'bubble.ondragleave') return e; }).length, 1); }, "ondragleave should bubble to body 1 time");
+ test(function () { assert_equals( events[47], 'bubble.ondragleave' ); }, "ondragleave should bubble to body as event handler #48");
+
+ /* ondrop */
+ test(function () { assert_equals( events.indexOf('orange.ondrop'), -1 ); }, "orange.ondrop should not fire");
+ test(function () { assert_equals( events.indexOf('pink.ondrop'), -1 ); }, "pink.ondrop should not fire");
+ test(function () { assert_equals( events.indexOf('yellow.ondrop'), -1 ); }, "yellow.ondrop should not fire");
+ test(function () { assert_true( events.indexOf('blue.ondrop') != -1 ); }, "blue.ondrop should fire");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'blue.ondrop') return e; }).length, 1); }, "blue.ondrop should fire 1 time");
+ test(function () { assert_equals( events[70], 'blue.ondrop' ); }, "blue.ondrop should be event handler #71");
+ test(function () { assert_equals( events.indexOf('body.ondrop'), -1 ); }, "ondrop should not fire at body");
+ test(function () { assert_true( events.indexOf('bubble.ondrop') != -1 ); }, "ondrop should bubble to body");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'bubble.ondrop') return e; }).length, 1); }, "ondrop should bubble to body 1 time");
+ test(function () { assert_equals( events[71], 'bubble.ondrop' ); }, "ondrop should bubble to body as event handler #72");
+
+ /* ondragend */
+ test(function () { assert_true( events.indexOf('orange.ondragend') != -1 ); }, "orange.ondragend should fire");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'orange.ondragend') return e; }).length, 1); }, "orange.ondragend should fire 1 time");
+ test(function () { assert_equals( events[72], 'orange.ondragend' ); }, "orange.ondragend should be event handler #73");
+ test(function () { assert_equals( events.indexOf('pink.ondragend'), -1 ); }, "pink.ondragend should not fire");
+ test(function () { assert_equals( events.indexOf('yellow.ondragend'), -1 ); }, "yellow.ondragend should not fire");
+ test(function () { assert_equals( events.indexOf('blue.ondragend'), -1 ); }, "blue.ondragend should not fire");
+ test(function () { assert_equals( events.indexOf('body.ondragend'), -1 ); }, "ondragend should not fire at body");
+ test(function () { assert_true( events.indexOf('bubble.ondragend') != -1 ); }, "ondragend should bubble to body");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'bubble.ondragend') return e; }).length, 1); }, "ondragend should bubble to body 1 time");
+ test(function () { assert_equals( events[73], 'bubble.ondragend' ); }, "ondragend should bubble to body as event handler #74");
+
+ /* onmousedown */
+ test(function () { assert_true( events.indexOf('orange.onmousedown') != -1 ); }, "orange.onmousedown should fire");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'orange.onmousedown') return e; }).length, 1); }, "orange.onmousedown should fire 1 time");
+ test(function () { assert_equals( events[0], 'orange.onmousedown' ); }, "orange.onmousedown should be event handler #1");
+ test(function () { assert_equals( events.indexOf('pink.onmousedown'), -1 ); }, "pink.onmousedown should not fire");
+ test(function () { assert_equals( events.indexOf('yellow.onmousedown'), -1 ); }, "yellow.onmousedown should not fire");
+ test(function () { assert_equals( events.indexOf('blue.onmousedown'), -1 ); }, "blue.onmousedown should not fire");
+ test(function () { assert_equals( events.indexOf('body.onmousedown'), -1 ); }, "onmousedown should not fire at body");
+ test(function () { assert_true( events.indexOf('bubble.onmousedown') != -1 ); }, "onmousedown should bubble to body");
+ test(function () { assert_equals( events.filter(function (e) { if (e == 'bubble.onmousedown') return e; }).length, 1); }, "onmousedown should bubble to body 1 time");
+ test(function () { assert_equals( events[1], 'bubble.onmousedown' ); }, "onmousedown should bubble to body as event handler #1");
+
+ /* onmouseup */
+ test(function () { assert_equals( events.indexOf('orange.onmouseup'), -1 ); }, "orange.onmouseup should not fire");
+ test(function () { assert_equals( events.indexOf('pink.onmouseup'), -1 ); }, "pink.onmouseup should not fire");
+ test(function () { assert_equals( events.indexOf('yellow.onmouseup'), -1 ); }, "yellow.onmouseup should not fire");
+ test(function () { assert_equals( events.indexOf('blue.onmouseup'), -1 ); }, "blue.onmouseup should not fire");
+ test(function () { assert_equals( events.indexOf('body.onmouseup'), -1 ); }, "onmouseup should not fire at body");
+ test(function () { assert_equals( events.indexOf('bubble.onmouseup'), -1 ); }, "onmouseup should not bubble to body");
+
+ done();
+ }
+};
+</script>
+
+<div id="testhere">
+<div draggable='true' id='orange'></div>
+<div id='fuchsia'></div>
+<div id='yellow'></div>
+<div id='blue'></div>
+</div>
+
+<p>If you have already clicked on this page, reload it.</p>
+<p>Use your pointing device to slowly drag the orange square over the pink square then the yellow square, then the blue square, and release it over the blue square (make sure the mouse remains over each square for at least 1 second, and over the gaps between squares for at least 1 second). Fail if no new text appears below.</p>
+
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/editing/dnd/events/helper-drag-me-input-with-circle.xhtml b/testing/web-platform/tests/html/editing/dnd/events/helper-drag-me-input-with-circle.xhtml
new file mode 100644
index 000000000..77e6a1301
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/helper-drag-me-input-with-circle.xhtml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame drag and drop: helper file</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function start(event)
+ {if(step++ == 1)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragstart should be first event to fire.')}
+ }
+function leavePage(event)
+ {if(step++ > 1)
+ {setColor('green green silver silver')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragleave should fire after dragstart.')}
+ }
+function endDrag(event)
+ {if(step++ > 2)
+ {setColor('green')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragend should fire after dragstart and dragleave.')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body onload="document.querySelector('input').select()" ondragleave="leavePage(event)">
+<p ondragstart="start(event)" ondragend="endDrag(event)"><input value="Drag me"/></p>
+<p>Drag selected text out of frame and drop it somewhere on the page. Both circles should turn green once text is dropped.</p>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/helper-drag-me-link-with-circle.xhtml b/testing/web-platform/tests/html/editing/dnd/events/helper-drag-me-link-with-circle.xhtml
new file mode 100644
index 000000000..813a06a7d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/helper-drag-me-link-with-circle.xhtml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame drag and drop: helper file</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function start(event)
+ {if(step++ == 1)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragstart should be first event to fire.')}
+ }
+function leavePage(event)
+ {if(step++ > 1)
+ {setColor('green green silver silver')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragleave should fire after dragstart.')}
+ }
+function endDrag(event)
+ {if(step++ > 2)
+ {setColor('green')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragend should fire after dragstart and dragleave.')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body ondragleave="leavePage(event)">
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondragend="endDrag(event)">Drag me</a></p>
+<p>Drag link out of frame and drop it somewhere on the page. Both circles should turn green once link is dropped.</p>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/helper-drag-me-p-with-circle.xhtml b/testing/web-platform/tests/html/editing/dnd/events/helper-drag-me-p-with-circle.xhtml
new file mode 100644
index 000000000..bd27af79a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/helper-drag-me-p-with-circle.xhtml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame drag and drop: helper file</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function start(event)
+ {if(step++ == 1)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragstart should be first event to fire.')}
+ }
+function leavePage(event)
+ {if(step++ > 1)
+ {setColor('green green silver silver')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragleave should fire after dragstart.')}
+ }
+function endDrag(event)
+ {if(step++ > 2)
+ {setColor('green')}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragend should fire after dragstart and dragleave.')}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))" ondragleave="leavePage(event)">
+<p ondragstart="start(event)" ondragend="endDrag(event)">Drag me</p>
+<p>Drag selected text out of frame and drop it somewhere on the page. Both circles should turn green once text is dropped.</p>
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/events/helper-drop-here-body-circle.xhtml b/testing/web-platform/tests/html/editing/dnd/events/helper-drop-here-body-circle.xhtml
new file mode 100644
index 000000000..10f66d764
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/events/helper-drop-here-body-circle.xhtml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame drag and drop: helper file</title>
+<style type="text/css">
+div
+ {width:0;
+ height:0;
+ border:solid 50px silver;
+ border-radius:50px;
+ margin-left:auto;}
+</style>
+<script type="application/ecmascript">
+var step = 1;
+function enterPage(event)
+ {event.preventDefault();
+ if(step++ > 0)
+ {setColor('green silver silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragenter should fire before dragover and drop');}
+ }
+function overPage(event)
+ {event.preventDefault();
+ if(step++ > 1)
+ {setColor('green green silver silver');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function dropIt(event)
+ {if(step++ > 1)
+ {setColor('green');}
+ else
+ {step = 0;
+ setColor('maroon');
+ say('Dragover should fire after dragenter');}
+ }
+function say(it)
+ {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
+function setColor(c)
+ {document.querySelector('div').setAttribute('style','border-color:' + c)}
+</script>
+</head>
+<body ondragenter="enterPage(event)" ondragover="overPage(event)" ondrop="dropIt(event)">
+<div/>
+<pre/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/file/001.html b/testing/web-platform/tests/html/editing/dnd/file/001.html
new file mode 100644
index 000000000..45a44c394
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/001.html
@@ -0,0 +1,103 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - simple file drop</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+var filename = 'fail.png', filesize = '759', filetype = 'image/png';
+var fails = [], finished = false;
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = 'No dataTransfer.files for '+e.type;
+ }
+ if( !window.FileList ) {
+ fails[fails.length] = 'No FileList interface object';
+ return;
+ }
+ if( !( e.dataTransfer.files instanceof FileList ) ) {
+ fails[fails.length] = 'dataTransfer.files is not a FileList';
+ }
+ if( e.dataTransfer.files.length ) {
+ fails[fails.length] = 'dataTransfer.files.length is '+e.dataTransfer.files.length+' instead of 0 for '+e.type;
+ }
+ };
+ orange.ondrop = function(e) {
+ e.preventDefault();
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = 'No dataTransfer.files for '+e.type;
+ }
+ if( !window.FileList ) {
+ fails[fails.length] = 'No FileList interface object';
+ finish();
+ return;
+ }
+ if( !( e.dataTransfer.files instanceof FileList ) ) {
+ fails[fails.length] = 'dataTransfer.files is not a FileList';
+ }
+ if( e.dataTransfer.files.length != 1 ) {
+ fails[fails.length] = 'dataTransfer.files.length is '+e.dataTransfer.files.length+' instead of 1 for '+e.type;
+ }
+ if( !e.dataTransfer.files[0] ) {
+ fails[fails.length] = 'no dataTransfer.files[0] for drop';
+ finish();
+ return;
+ }
+ if( e.dataTransfer.files[0].size != filesize ) {
+ fails[fails.length] = 'dataTransfer.files[0].size '+e.dataTransfer.files[0].size+' instead of '+filesize;
+ }
+ /*
+ if( !e.dataTransfer.files[0].lastModifiedDate ) {
+ fails[fails.length] = 'no dataTransfer.files[0].lastModifiedDate';
+ }
+ */
+ if( e.dataTransfer.files[0].name != filename ) {
+ fails[fails.length] = 'dataTransfer.files[0].name '+e.dataTransfer.files[0].name+' instead of '+filename;
+ }
+ if( e.dataTransfer.files[0].type != filetype ) {
+ fails[fails.length] = 'dataTransfer.files[0].type '+e.dataTransfer.files[0].type+' instead of '+filetype;
+ }
+ if( !window.FileReader ) {
+ fails[fails.length] = 'No FileReader constructor';
+ finish();
+ return;
+ }
+ var reader = new FileReader();
+ reader.onload = function () {
+ if( !reader.result ) {
+ fails[fails.length] = 'No file data after load';
+ }
+ if( reader.result.length != filesize ) {
+ fails[fails.length] = 'File data length '+reader.result.length+' instead of '+filesize;
+ }
+ finish();
+ };
+ reader.readAsBinaryString(e.dataTransfer.files[0]);
+ setTimeout(function () {
+ if( !reader.result ) {
+ fails[fails.length] = 'No file data after timeout';
+ }
+ finish();
+ },1000);
+ };
+
+};
+function finish() {
+ if( finished ) { return; }
+ finished = true;
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+}
+</script>
+
+<div></div>
+
+<p>Save <a href="../resources/fail.png">this image</a> to your desktop. Use your pointing device to drag the saved file from your desktop onto the orange box, and release it. If a confirmation dialog appears, accept it. Fail if nothing happens, or if the browser simply displays the image.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/002.html b/testing/web-platform/tests/html/editing/dnd/file/002.html
new file mode 100644
index 000000000..a60b2b201
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/002.html
@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - multiple file drop</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+var filename1 = 'fail.png', filesize1 = '759', filetype1 = 'image/png', filename2 = 'fail.txt', filesize2 = '4', filetype2 = 'text/plain';
+var fails = [], finished = false, donecount = 0;
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = 'No dataTransfer.files for '+e.type;
+ }
+ if( !window.FileList ) {
+ fails[fails.length] = 'No FileList interface object';
+ return;
+ }
+ if( !( e.dataTransfer.files instanceof FileList ) ) {
+ fails[fails.length] = 'dataTransfer.files is not a FileList';
+ }
+ if( e.dataTransfer.files.length ) {
+ fails[fails.length] = 'dataTransfer.files.length is '+e.dataTransfer.files.length+' instead of 0 for '+e.type;
+ }
+ };
+ orange.ondrop = function(e) {
+ e.preventDefault();
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = 'No dataTransfer.files for '+e.type;
+ }
+ if( !window.FileList ) {
+ fails[fails.length] = 'No FileList interface object';
+ finish();
+ return;
+ }
+ if( !( e.dataTransfer.files instanceof FileList ) ) {
+ fails[fails.length] = 'dataTransfer.files is not a FileList';
+ }
+ if( e.dataTransfer.files.length != 2 ) {
+ fails[fails.length] = 'dataTransfer.files.length is '+e.dataTransfer.files.length+' instead of 2 for '+e.type;
+ }
+ if( !e.dataTransfer.files[0] ) {
+ fails[fails.length] = 'no dataTransfer.files[0] for drop';
+ finish();
+ return;
+ }
+ if( !e.dataTransfer.files[1] ) {
+ fails[fails.length] = 'no dataTransfer.files[1] for drop';
+ finish();
+ return;
+ }
+ //allow files to be dropped in any order, since this will be determined by the OS
+ var i0 = 0, i1 = 1;
+ if( e.dataTransfer.files[0].name == filename2 ) {
+ i0 = 1;
+ i1 = 0;
+ }
+ if( e.dataTransfer.files[i0].size != filesize1 ) {
+ fails[fails.length] = 'dataTransfer.files['+i0+'].size '+e.dataTransfer.files[i0].size+' instead of '+filesize1;
+ }
+ /*
+ if( !e.dataTransfer.files[i0].lastModifiedDate ) {
+ fails[fails.length] = 'no dataTransfer.files['+i0+'].lastModifiedDate';
+ }
+ */
+ if( e.dataTransfer.files[i0].name != filename1 ) {
+ fails[fails.length] = 'dataTransfer.files['+i0+'].name '+e.dataTransfer.files[i0].name+' instead of '+filename1;
+ }
+ if( e.dataTransfer.files[i0].type != filetype1 ) {
+ fails[fails.length] = 'dataTransfer.files['+i0+'].type '+e.dataTransfer.files[i0].type+' instead of '+filetype1;
+ }
+ if( e.dataTransfer.files[i1].size != filesize2 ) {
+ fails[fails.length] = 'dataTransfer.files['+i1+'].size '+e.dataTransfer.files[i1].size+' instead of '+filesize2;
+ }
+ /*
+ if( !e.dataTransfer.files[i1].lastModifiedDate ) {
+ fails[fails.length] = 'no dataTransfer.files['+i1+'].lastModifiedDate';
+ }
+ */
+ if( e.dataTransfer.files[i1].name != filename2 ) {
+ fails[fails.length] = 'dataTransfer.files['+i1+'].name '+e.dataTransfer.files[i1].name+' instead of '+filename2;
+ }
+ if( e.dataTransfer.files[i1].type != filetype2 ) {
+ fails[fails.length] = 'dataTransfer.files['+i1+'].type '+e.dataTransfer.files[i1].type+' instead of '+filetype2;
+ }
+ if( !window.FileReader ) {
+ fails[fails.length] = 'No FileReader constructor';
+ finish();
+ return;
+ }
+ var reader1 = new FileReader();
+ reader1.readAsBinaryString(e.dataTransfer.files[i0]);
+ reader1.onload = function () {
+ if( !reader1.result ) {
+ fails[fails.length] = 'No files['+i0+'] data after load';
+ }
+ if( reader1.result.length != filesize1 ) {
+ fails[fails.length] = 'files['+i0+'] file data length '+reader1.result.length+' instead of '+filesize1;
+ }
+ if( donecount++ ) {
+ finish();
+ }
+ };
+ var reader2 = new FileReader();
+ reader2.onload = function () {
+ if( !reader2.result ) {
+ fails[fails.length] = 'No files['+i1+'] data after load';
+ }
+ if( reader2.result.length != filesize2 ) {
+ fails[fails.length] = 'files['+i1+'] file data length '+reader2.result.length+' instead of '+filesize2;
+ }
+ if( donecount++ ) {
+ finish();
+ }
+ };
+ reader2.readAsBinaryString(e.dataTransfer.files[i1]);
+ setTimeout(function () {
+ if( !reader1.result ) {
+ fails[fails.length] = 'No files['+i0+'] data after timeout';
+ }
+ if( !reader2.result ) {
+ fails[fails.length] = 'No files['+i1+'] data after timeout';
+ }
+ finish();
+ },1000);
+ };
+
+};
+function finish() {
+ if( finished ) { return; }
+ finished = true;
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+}
+</script>
+
+<div></div>
+
+<p>Save <a href="../resources/fail.png">this image</a> and <a href="fail.txt">this text file</a> to your desktop. Use your pointing device to drag both saved files (at the same time) from your desktop onto the orange box, and release them. If a confirmation dialog appears, accept it. Fail if nothing happens, or if the browser simply displays one/both of the files.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/003.html b/testing/web-platform/tests/html/editing/dnd/file/003.html
new file mode 100644
index 000000000..86a3e7fce
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/003.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - prompting before exposing files</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+var filename = 'fail.png', filesize = '759', filetype = 'image/png';
+var fails = [], finished = false;
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ orange.ondrop = function(e) {
+ e.preventDefault();
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = 'No dataTransfer.files for '+e.type;
+ }
+ if( !window.FileList ) {
+ fails[fails.length] = 'No FileList interface object';
+ finish();
+ return;
+ }
+ if( !( e.dataTransfer.files instanceof FileList ) ) {
+ fails[fails.length] = 'dataTransfer.files is not a FileList';
+ }
+ if( e.dataTransfer.files.length != 1 ) {
+ fails[fails.length] = 'dataTransfer.files.length is '+e.dataTransfer.files.length+' instead of 1 for '+e.type;
+ }
+ if( !e.dataTransfer.files[0] ) {
+ fails[fails.length] = 'no dataTransfer.files[0] for drop';
+ finish();
+ return;
+ }
+ if( e.dataTransfer.files[0].size != filesize ) {
+ fails[fails.length] = 'dataTransfer.files[0].size '+e.dataTransfer.files[0].size+' instead of '+filesize;
+ }
+ /*
+ if( !e.dataTransfer.files[0].lastModifiedDate ) {
+ fails[fails.length] = 'no dataTransfer.files[0].lastModifiedDate';
+ }
+ */
+ if( e.dataTransfer.files[0].name != filename ) {
+ fails[fails.length] = 'dataTransfer.files[0].name '+e.dataTransfer.files[0].name+' instead of '+filename;
+ }
+ if( e.dataTransfer.files[0].type != filetype ) {
+ fails[fails.length] = 'dataTransfer.files[0].type '+e.dataTransfer.files[0].type+' instead of '+filetype;
+ }
+ if( !window.FileReader ) {
+ fails[fails.length] = 'No FileReader constructor';
+ finish();
+ return;
+ }
+ var reader = new FileReader();
+ reader.onload = function () {
+ if( !reader.result ) {
+ fails[fails.length] = 'No file data after load';
+ }
+ if( reader.result.length != filesize ) {
+ fails[fails.length] = 'File data length '+reader.result.length+' instead of '+filesize;
+ }
+ finish();
+ };
+ reader.readAsBinaryString(e.dataTransfer.files[0]);
+ setTimeout(function () {
+ if( !reader.result ) {
+ fails[fails.length] = 'No file data after timeout';
+ }
+ finish();
+ },1000);
+ };
+
+};
+function finish() {
+ if( finished ) { return; }
+ finished = true;
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+}
+</script>
+
+<div></div>
+
+<p>Save <a href="../resources/fail.png">this image</a> to your desktop. Use your pointing device to drag the saved file from your desktop onto the orange box, and release it. <strong>A confirmation dialog must appear, allowing you to choose to cancel the upload</strong>. Accept it. Fail if nothing happens, or if the browser simply displays the image, or if &quot;PASS&quot; appears as the page text <strong>before</strong> you have accepted the upload.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/004.html b/testing/web-platform/tests/html/editing/dnd/file/004.html
new file mode 100644
index 000000000..ea2d35759
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/004.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - cancelling the dropped file upload</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+var fails = [];
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ orange.ondrop = function(e) {
+ //if the browser simulates a drop, it must do so with an empty FileList
+ e.preventDefault();
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = 'No dataTransfer.files for '+e.type;
+ }
+ if( !window.FileList ) {
+ fails[fails.length] = 'No FileList interface object';
+ finish();
+ return;
+ }
+ if( !( e.dataTransfer.files instanceof FileList ) ) {
+ fails[fails.length] = 'dataTransfer.files is not a FileList';
+ }
+ if( e.dataTransfer.files.length ) {
+ fails[fails.length] = 'dataTransfer.files.length is '+e.dataTransfer.files.length+' instead of 0 for '+e.type;
+ }
+ if( e.dataTransfer.files[0] ) {
+ fails[fails.length] = 'dataTransfer.files[0] exists for drop';
+ finish();
+ }
+ };
+
+};
+function finish() {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+}
+</script>
+
+<div></div>
+
+<p>Save <a href="../resources/pass.png">this image</a> to your desktop. Use your pointing device to drag the saved file from your desktop onto the orange box, and release it. <strong>A confirmation dialog must appear, allowing you to choose to cancel the upload</strong>. Refuse it. Pass if nothing happens, or if the browser simply displays the image.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/005.html b/testing/web-platform/tests/html/editing/dnd/file/005.html
new file mode 100644
index 000000000..007d2b20f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/005.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - dragging text onto a file input</title>
+
+<ol>
+ <li>Save <a href="../resources/filler.html">this file</a> to your computer.</li>
+ <li>Write the full /path/and/name to that file, into the first input below, then select all of the text you just entered.</li>
+ <li>Drag selected text to the file input. If no prompt appears, and the text is not added to the file input, pass and ignore further steps.</li>
+ <li>If a prompt appears, accept it. Fail if the file input's value is set without any prompts.</li>
+ <li>If a prompt appears; fail if the file input's value is not set after accepting the prompt.</li>
+</ol>
+<p><input value="/tmp/filler.html"></p>
+<p><input type="file"></p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/006.html b/testing/web-platform/tests/html/editing/dnd/file/006.html
new file mode 100644
index 000000000..58d651870
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/006.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - cancelling dragging text onto a file input</title>
+
+<ol>
+ <li>Save <a href="../resources/filler.html">this file</a> to your computer.</li>
+ <li>Write the full /path/and/name to that file, into the first input below, then select all of the text you just entered.</li>
+ <li>Drag selected text to the file input. If no prompt appears, and the text is not added to the file input, pass and ignore further steps.</li>
+ <li>If a prompt appears, refuse it. Fail if the file input's value is set without any prompts.</li>
+ <li>If a prompt appears; fail if the file input's value is set after refusing the prompt.</li>
+</ol>
+<p><input value="/tmp/filler.html"></p>
+<p><input type="file"></p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/007.html b/testing/web-platform/tests/html/editing/dnd/file/007.html
new file mode 100644
index 000000000..60be19b0a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/007.html
@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - file drop for large file</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+//JavaScript can support file sizes up to 9007199254740992 bytes ... in theory
+//This test uses a more sane value, just for the sake of UI testing - 32 MB
+var filesize1 = 33554432, filesize2 = 134217728;
+var fails = [], finished = false;
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = 'No dataTransfer.files for '+e.type;
+ }
+ if( !window.FileList ) {
+ fails[fails.length] = 'No FileList interface object';
+ return;
+ }
+ if( !( e.dataTransfer.files instanceof FileList ) ) {
+ fails[fails.length] = 'dataTransfer.files is not a FileList';
+ }
+ if( e.dataTransfer.files.length ) {
+ fails[fails.length] = 'dataTransfer.files.length is '+e.dataTransfer.files.length+' instead of 0 for '+e.type;
+ }
+ };
+ orange.ondrop = function(e) {
+ e.preventDefault();
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = 'No dataTransfer.files for '+e.type;
+ }
+ if( !window.FileList ) {
+ fails[fails.length] = 'No FileList interface object';
+ finish();
+ return;
+ }
+ if( !( e.dataTransfer.files instanceof FileList ) ) {
+ fails[fails.length] = 'dataTransfer.files is not a FileList';
+ }
+ if( e.dataTransfer.files.length != 1 ) {
+ fails[fails.length] = 'dataTransfer.files.length is '+e.dataTransfer.files.length+' instead of 1 for '+e.type;
+ }
+ if( !e.dataTransfer.files[0] ) {
+ fails[fails.length] = 'no dataTransfer.files[0] for drop';
+ finish();
+ return;
+ }
+ if( e.dataTransfer.files[0].size != filesize1 && e.dataTransfer.files[0].size != filesize2 ) {
+ fails[fails.length] = 'dataTransfer.files[0].size '+e.dataTransfer.files[0].size+' instead of '+filesize1+' or '+filesize2;
+ }
+ /*
+ if( !e.dataTransfer.files[0].lastModifiedDate ) {
+ fails[fails.length] = 'no dataTransfer.files[0].lastModifiedDate';
+ }
+ */
+ if( !window.FileReader ) {
+ fails[fails.length] = 'No FileReader constructor';
+ finish();
+ return;
+ }
+ var reader = new FileReader();
+ reader.readAsBinaryString(e.dataTransfer.files[0]);
+ reader.onload = function () {
+ if( !reader.result ) {
+ fails[fails.length] = 'No file data after load';
+ }
+ if( reader.result.length != filesize1 && reader.result.length != filesize2 ) {
+ fails[fails.length] = 'File data length '+reader.result.length+' instead of '+filesize1+' or '+filesize2;
+ }
+ finish();
+ };
+ setTimeout(function () {
+ if( !reader.result ) {
+ fails[fails.length] = 'No file data after timeout';
+ }
+ finish();
+ },1000);
+ };
+
+};
+function finish() {
+ if( finished ) { return; }
+ finished = true;
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS if the UI did not lock up';
+}
+</script>
+
+<div></div>
+
+<p>Save <a href="/common/large.py?size=32Mb">32MB.txt</a> to your desktop. Use your pointing device to drag the saved file from your desktop onto the orange box, and release it. If a confirmation dialog appears, accept it. Fail if this text is not replaced with a pass message. Fail if the UI locks up immediately after dropping the file.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/008.html b/testing/web-platform/tests/html/editing/dnd/file/008.html
new file mode 100644
index 000000000..d610d8ee6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/008.html
@@ -0,0 +1,113 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - dropping folders</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+var fails = [], finished = false;
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = 'No dataTransfer.files for '+e.type;
+ }
+ if( !window.FileList ) {
+ fails[fails.length] = 'No FileList interface object';
+ return;
+ }
+ if( !( e.dataTransfer.files instanceof FileList ) ) {
+ fails[fails.length] = 'dataTransfer.files is not a FileList';
+ } else if( e.dataTransfer.files.length ) {
+ fails[fails.length] = 'dataTransfer.files.length is '+e.dataTransfer.files.length+' instead of 0 for '+e.type;
+ }
+ };
+ orange.ondrop = function(e) {
+ e.preventDefault();
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = 'No dataTransfer.files for '+e.type;
+ }
+ if( !window.FileList ) {
+ fails[fails.length] = 'No FileList interface object';
+ finish();
+ return;
+ }
+ if( !( e.dataTransfer.files instanceof FileList ) ) {
+ fails[fails.length] = 'dataTransfer.files is not a FileList';
+ }
+ //browsers represent it as a single file (name matching the folder)
+ //also allow no files, since that is a valid solution
+ if( e.dataTransfer.files.length > 1 ) {
+ //dropping the contents of the folder would be crazy, since there could literally be millions of files, or the entire disk contents
+ fails[fails.length] = 'dataTransfer.files.length is '+e.dataTransfer.files.length+' instead of 1 for '+e.type;
+ }
+ if( !e.dataTransfer.files[0] ) {
+ finish();
+ return;
+ }
+ /*
+ Windows 7 sometimes randomly assigns size to folders, and that is presented to the browser.
+ Strangely, packing and unpacking that folder can remove its size.
+ Since this is an OS quirk that we have no control over, the test will not check the size.
+ if( e.dataTransfer.files[0].size ) {
+ fails[fails.length] = 'dataTransfer.files[0].size '+e.dataTransfer.files[0].size+' instead of 0';
+ }
+ */
+ /*
+ if( !e.dataTransfer.files[0].lastModifiedDate ) {
+ fails[fails.length] = 'no dataTransfer.files[0].lastModifiedDate';
+ }
+ */
+ if( !window.FileReader ) {
+ fails[fails.length] = 'No FileReader constructor';
+ finish();
+ return;
+ }
+ var reader = new FileReader();
+ reader.onload = function () {
+ fails[fails.length] = 'File managed to load even though it was a folder '+e.type;
+ finish();
+ };
+ reader.onerror = function () {
+ finish();
+ };
+ try {
+ reader.readAsBinaryString(e.dataTransfer.files[0]);
+ } catch(err) {
+ fails[fails.length] = 'Threw an error when trying to read the file '+e.type;
+ finish();
+ return;
+ }
+ setTimeout(function () {
+ fails[fails.length] = 'Onerror failed to fire '+reader.error.code;
+ finish();
+ },1000);
+ };
+
+};
+function finish() {
+ if( finished ) { return; }
+ finished = true;
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+}
+</script>
+
+<div></div>
+
+<p>Drag a folder containing at least 2 files, from your computer's file manager, onto the orange box above. If a no-drop cursor was shown and no text changes when the folder is dropped, pass and ignore further conditions. If a prompt appears, accept it. Fail if the mouse cursor makes it look like it will work but nothing happens.</p>
+<p>This test needs to be repeated with:</p>
+<ul>
+ <li>A regular folder containing at least 2 items</li>
+ <li>A disk drive (if your OS exposes them) containing at least 2 items</li>
+ <li>The system trash/recycle bin folder (if your OS exposes one) containing at least 2 items</li>
+ <li>The &quot;My Computer&quot; folder (if your OS provides it)</li>
+ <li>Your &quot;My Documents&quot; folder (if your OS provides it)</li>
+ <li>A folder that you do not have permissions to access</li>
+</ul>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/009.html b/testing/web-platform/tests/html/editing/dnd/file/009.html
new file mode 100644
index 000000000..72381863f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/009.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - no dnd event listeners</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<!-- This test assumes that the browser's default behaviour is to open dropped files. Test 010 continues with this assumption. -->
+
+<div></div>
+
+<p>Save <a href="../resources/pass.png">this image</a> to your desktop. Use your pointing device to drag the saved file from your desktop onto the orange box, and release it. Fail if nothing happens.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/010.html b/testing/web-platform/tests/html/editing/dnd/file/010.html
new file mode 100644
index 000000000..ba24ae600
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/010.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - blocked drop</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+//This test assumes that if the page does not want to use the drop, that the browser will revert to default behaviour of opening the file
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'none';
+ };
+ orange.ondrop = function(e) {
+ e.preventDefault();
+ };
+
+};
+</script>
+
+<div></div>
+
+<p>Save <a href="../resources/pass.png">this image</a> to your desktop. Use your pointing device to drag the saved file from your desktop onto the orange box, and release it. Fail if nothing happens.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/011.html b/testing/web-platform/tests/html/editing/dnd/file/011.html
new file mode 100644
index 000000000..f05929c77
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/011.html
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - simple file drop with dropzone attribute</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+var filename = 'fail.png', filesize = '759', filetype = 'image/png';
+var fails = [], finished = false;
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragenter = function(e) {
+ e.dataTransfer.dropEffect = 'copy';
+ };
+/* orange.ondragover = function(e) {
+ e.preventDefault();
+ };
+*/
+ orange.ondrop = function(e) {
+ e.preventDefault();
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = 'No dataTransfer.files for '+e.type;
+ }
+ if( !window.FileList ) {
+ fails[fails.length] = 'No FileList interface object';
+ finish();
+ return;
+ }
+ if( !( e.dataTransfer.files instanceof FileList ) ) {
+ fails[fails.length] = 'dataTransfer.files is not a FileList';
+ }
+ if( e.dataTransfer.files.length != 1 ) {
+ fails[fails.length] = 'dataTransfer.files.length is '+e.dataTransfer.files.length+' instead of 1 for '+e.type;
+ }
+ if( !e.dataTransfer.files[0] ) {
+ fails[fails.length] = 'no dataTransfer.files[0] for drop';
+ finish();
+ return;
+ }
+ if( e.dataTransfer.files[0].size != filesize ) {
+ fails[fails.length] = 'dataTransfer.files[0].size '+e.dataTransfer.files[0].size+' instead of '+filesize;
+ }
+ /*
+ if( !e.dataTransfer.files[0].lastModifiedDate ) {
+ fails[fails.length] = 'no dataTransfer.files[0].lastModifiedDate';
+ }
+ */
+ if( e.dataTransfer.files[0].name != filename ) {
+ fails[fails.length] = 'dataTransfer.files[0].name '+e.dataTransfer.files[0].name+' instead of '+filename;
+ }
+ if( e.dataTransfer.files[0].type != filetype ) {
+ fails[fails.length] = 'dataTransfer.files[0].type '+e.dataTransfer.files[0].type+' instead of '+filetype;
+ }
+ if( !window.FileReader ) {
+ fails[fails.length] = 'No FileReader constructor';
+ finish();
+ return;
+ }
+ var reader = new FileReader();
+ reader.onload = function () {
+ if( !reader.result ) {
+ fails[fails.length] = 'No file data after load';
+ }
+ if( reader.result.length != filesize ) {
+ fails[fails.length] = 'File data length '+reader.result.length+' instead of '+filesize;
+ }
+ finish();
+ };
+ reader.readAsBinaryString(e.dataTransfer.files[0]);
+ setTimeout(function () {
+ if( !reader.result ) {
+ fails[fails.length] = 'No file data after timeout';
+ }
+ finish();
+ },1000);
+ };
+
+};
+function finish() {
+ if( finished ) { return; }
+ finished = true;
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+}
+</script>
+
+<div dropzone="copy file:image/png"></div>
+
+<p>Save <a href="../resources/fail.png">this image</a> to your desktop. Use your pointing device to drag the saved file from your desktop onto the orange box, and release it. If a confirmation dialog appears, accept it. Fail if nothing happens, or if the browser simply displays the image.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/fail.txt b/testing/web-platform/tests/html/editing/dnd/file/fail.txt
new file mode 100644
index 000000000..fc2616251
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/fail.txt
@@ -0,0 +1 @@
+FAIL \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/file/prompt/001.html b/testing/web-platform/tests/html/editing/dnd/file/prompt/001.html
new file mode 100644
index 000000000..dc54aac5e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/prompt/001.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - file drop prompt for basic server name</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ if( location.protocol != 'http:' && location.protocol != 'https:' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'This test should be loaded over http or https.';
+ return;
+ }
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = orange.ondrop = function(e) {
+ e.preventDefault();
+ };
+ document.getElementsByTagName('span')[0].innerHTML = location.hostname;
+};
+</script>
+
+<div></div>
+
+<p>Drag a file from your desktop onto the orange square. A prompt should appear, correctly identifying the server name as <span></span></p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/prompt/002.html b/testing/web-platform/tests/html/editing/dnd/file/prompt/002.html
new file mode 100644
index 000000000..7bad40a2f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/prompt/002.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - file drop prompt for server name and document.domain</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ if( location.protocol != 'http:' && location.protocol != 'https:' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'This test should be loaded over http or https.';
+ return;
+ }
+ if( !location.hostname.match(/[^\.]\.[^\.]+\.[^\.]/) ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'This test should be loaded from a subdomain that allows document.domain to be set to a parent domain (try using a server name that contains at least two or three dots, for example www.example.org).';
+ return;
+ }
+ var realhost = location.hostname, newdomain = location.hostname.replace(/^[^.]+\./,'');
+ try {
+ document.domain = location.hostname.replace(/^[^.]+\./,'');
+ } catch(e) {
+ document.getElementsByTagName('p')[0].innerHTML = 'This test should be loaded from a subdomain that allows document.domain to be set to a parent domain.';
+ return;
+ }
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = orange.ondrop = function(e) {
+ e.preventDefault();
+ };
+ document.getElementsByTagName('span')[0].innerHTML = realhost;
+};
+</script>
+
+<div></div>
+
+<p>Drag a file from your desktop onto the orange square. A prompt should appear, identifying the server name as <span></span></p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/prompt/003.html b/testing/web-platform/tests/html/editing/dnd/file/prompt/003.html
new file mode 100644
index 000000000..4b7a98aae
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/prompt/003.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - file drop prompt for ftp server name</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ if( location.protocol != 'ftp:' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'This test should be loaded over ftp.';
+ return;
+ }
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = orange.ondrop = function(e) {
+ e.preventDefault();
+ };
+ document.getElementsByTagName('span')[0].innerHTML = location.hostname;
+};
+</script>
+
+<div></div>
+
+<p>Drag a file from your desktop onto the orange square. A prompt should appear, correctly identifying the server name as <span></span></p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/prompt/004.html b/testing/web-platform/tests/html/editing/dnd/file/prompt/004.html
new file mode 100644
index 000000000..539668819
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/prompt/004.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - file drop prompt for file:</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ if( location.protocol != 'file:' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'Save this page to your local filesystem, and load it from there.';
+ return;
+ }
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = orange.ondrop = function(e) {
+ e.preventDefault();
+ };
+};
+</script>
+
+<div></div>
+
+<p>Drag a file from your desktop onto the orange square. A prompt should appear, either showing the server name as localhost, or otherwise identifying this file as the target of the upload.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/prompt/005.html b/testing/web-platform/tests/html/editing/dnd/file/prompt/005.html
new file mode 100644
index 000000000..395d37d62
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/prompt/005.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - file drop prompt for special cases</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ if( location.protocol == 'file:' || location.protocol == 'http:' || location.protocol == 'https:' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'Use the source of this file as the source of special-case URLs within your browser, such as scriptable chrome: or opera: or attachment: URLs (eg. opera:config and send yourself the file as an email attachments and open the attachment in the browser).';
+ return;
+ }
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = orange.ondrop = function(e) {
+ e.preventDefault();
+ };
+};
+</script>
+
+<div></div>
+
+<p>Drag a file from your desktop onto the orange square. A prompt should appear, either showing the server name as unknown, or otherwise identifying this URL as the target of the upload.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/file/prompt/006.html b/testing/web-platform/tests/html/editing/dnd/file/prompt/006.html
new file mode 100644
index 000000000..5f0f9b306
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/prompt/006.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - file drop prompt for data URI with inherited origin</title>
+<style>
+iframe { border: none; height: 250px; width: 250px; }
+</style>
+
+<script>
+window.onload = function() {
+ if( location.protocol != 'http:' && location.protocol != 'https:' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'This test should be loaded over http or https.';
+ return;
+ }
+ var url = "data:text/html,"+escape(
+'<!DOCTYPE html>\
+<title>drag &amp; drop - file drop prompt for data URI with inherited origin<\/title>\
+<style>\
+ body > div {\
+ height: 200px;\
+ width: 200px;\
+ background-color: orange;\
+ }\
+<\/style>\
+<script>\
+window.onload = function() {\
+ var orange = document.getElementsByTagName("div")[0];\
+ orange.ondragover = orange.ondragenter = orange.ondrop = function(e) {\
+ e.preventDefault();\
+ };\
+};\
+<\/script>\
+<div><\/div>'
+ );
+ var frame = document.createElement('iframe');
+ frame.setAttribute('src',url);
+ document.body.appendChild(frame);
+ document.getElementsByTagName('span')[0].innerHTML = location.hostname;
+};
+</script>
+
+<p>Drag a file from your desktop onto the orange square. A prompt should appear, correctly identifying the server name <span></span>.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/file/prompt/007.html b/testing/web-platform/tests/html/editing/dnd/file/prompt/007.html
new file mode 100644
index 000000000..5a5b982d6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/prompt/007.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - file drop prompt for data URI without inherited origin</title>
+<script>
+window.onload = function() {
+ var url = "data:text/html,"+escape(
+'<!DOCTYPE html>\
+<title>drag &amp; drop - file drop prompt for data URI with inherited origin<\/title>\
+<style>\
+ body > div {\
+ height: 200px;\
+ width: 200px;\
+ background-color: orange;\
+ }\
+<\/style>\
+<script>\
+window.onload = function() {\
+ var orange = document.getElementsByTagName("div")[0];\
+ orange.ondragover = orange.ondragenter = orange.ondrop = function(e) {\
+ e.preventDefault();\
+ };\
+};\
+<\/script>\
+<div><\/div>\
+<p>Drag a file from your desktop onto the orange square. A prompt should appear, either showing the server name as unknown, or otherwise identifying this URL as the target of the upload.<\/p>'
+ );
+ document.getElementsByTagName('p')[1].textContent = url;
+};
+</script>
+
+<p>Load the following URL in a new tab (copy &amp; paste it into the address bar):</p>
+<p></p>
+<noscript><p>Enable JavaScript and reload</p></noscript> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/file/prompt/008.html b/testing/web-platform/tests/html/editing/dnd/file/prompt/008.html
new file mode 100644
index 000000000..ff07b78de
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/prompt/008.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - file drop prompt for javascript URL with inherited origin</title>
+<style>
+iframe { border: none; height: 250px; width: 250px; }
+</style>
+
+<script>
+window.onload = function() {
+ if( location.protocol != 'http:' && location.protocol != 'https:' ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'This test should be loaded over http or https.';
+ return;
+ }
+ var url = "javascript:'"+escape(
+'<!DOCTYPE html>\
+<title>drag &amp; drop - file drop prompt for data URI with inherited origin<\/title>\
+<style>\
+ body > div {\
+ height: 200px;\
+ width: 200px;\
+ background-color: orange;\
+ }\
+<\/style>\
+<script>\
+window.onload = function() {\
+ var orange = document.getElementsByTagName("div")[0];\
+ orange.ondragover = orange.ondragenter = orange.ondrop = function(e) {\
+ e.preventDefault();\
+ };\
+};\
+<\/script>\
+<div><\/div>'
+ +"'");
+ var frame = document.createElement('iframe');
+ frame.setAttribute('src',url);
+ document.body.appendChild(frame);
+ document.getElementsByTagName('span')[0].innerHTML = location.hostname;
+};
+</script>
+
+<p>Drag a file from your desktop onto the orange square. A prompt should appear, correctly identifying the server name <span></span></p>
+<noscript><p>Enable JavaScript and reload</p></noscript> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/file/prompt/009.html b/testing/web-platform/tests/html/editing/dnd/file/prompt/009.html
new file mode 100644
index 000000000..6fa18b975
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/file/prompt/009.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - file drop prompt for javascript URL without inherited origin</title>
+<script>
+window.onload = function() {
+ var url = "javascript:'"+escape(
+'<!DOCTYPE html>\
+<title>drag &amp; drop - file drop prompt for data URI with inherited origin<\/title>\
+<style>\
+ body > div {\
+ height: 200px;\
+ width: 200px;\
+ background-color: orange;\
+ }\
+<\/style>\
+<script>\
+window.onload = function() {\
+ var orange = document.getElementsByTagName("div")[0];\
+ orange.ondragover = orange.ondragenter = orange.ondrop = function(e) {\
+ e.preventDefault();\
+ };\
+};\
+<\/script>\
+<div><\/div>\
+<p>Drag a file from your desktop onto the orange square. A prompt should appear, either showing the server name as unknown, or otherwise identifying this URL as the target of the upload (it may alternatively identify the security context about:blank).<\/p>'
+ +"'");
+ document.getElementsByTagName('p')[1].textContent = url;
+};
+</script>
+
+<p>Load the following URL in a new tab (copy &amp; paste it into the address bar):</p>
+<p></p>
+<noscript><p>Enable JavaScript and reload</p></noscript> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/001.xhtml b/testing/web-platform/tests/html/editing/dnd/images/001.xhtml
new file mode 100644
index 000000000..e5ea49969
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/001.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img src="../resources/circle.png" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/002.xhtml b/testing/web-platform/tests/html/editing/dnd/images/002.xhtml
new file mode 100644
index 000000000..65584e857
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/002.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataURL image drag and drop</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/003.xhtml b/testing/web-platform/tests/html/editing/dnd/images/003.xhtml
new file mode 100644
index 000000000..ae94a8b3f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/003.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop outside browser window</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above outside the window and then back inside and drop in the box below. It should be copied to the box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/images/004.xhtml b/testing/web-platform/tests/html/editing/dnd/images/004.xhtml
new file mode 100644
index 000000000..e0fff9523
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/004.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Object with image drag and drop</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/uri-list', document.querySelector('object').getAttribute('data'));}
+</script>
+</head>
+<body>
+<p><object draggable="true" ondragstart="start(event)" type="image/png" data="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle">PNG image</object></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/005.xhtml b/testing/web-platform/tests/html/editing/dnd/images/005.xhtml
new file mode 100644
index 000000000..49eaabdfc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/005.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>JPG image drag and drop</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCxAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6AQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgsRAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/AABEIAGQAZAMBIgACEQEDEQH/2gAMAwEAAhEDEQA/AP7+KKK8v+Mvxl+Gn7P3w08V/F74veK9P8GfD/wZp51HXdd1EuVRS6wWtlZWsCy3mp6tqd5LBp+k6Tp8FxqGp6hcQWdnBLPKiHOtWo4ejVxGIq06FChTnVrVqs406VKlTi5VKlSpJqMIQinKUpNKKV2Y4jEUMJQrYrFVqWHw2HpTr4jEV5xpUaFGlFzqVatSbUKdOnBOU5yajGKbbsekXV1a2Frc319cwWdlZwTXV5eXU0dva2trbxtLcXNzcSskUEEESNLNNKyxxxqzuwUE1+B37ZX/AAcDfsvfAK61bwV8BNOm/aZ+ImnyS2U+p6Fqa6J8ItIvIzsk8zx19mv5/FjQEiVE8G6VqOiX6rJB/wAJZYTg7f54f+Clf/BX34z/ALc2tax4C8H3OrfCv9mS1v2TR/h7ZXX2bXfHVvayA2mt/FTULKd11SeaRBfWvhC0nbwvob/ZVZdd1bTo/EU/47V/KHHn0gsQ61bLeB4wp0YN055/iqKqVKzWnNl2ErL2dOn/AC18XTqyqLbDUbKcv4l8TPpR4t4jEZR4cQp0cPTcqU+JsZQVatXa0csqwNePsqVH+TE46nWnVT0wmHtGcv14+PH/AAXF/wCCiHxvub+Kx+LsPwV8NXe8ReGfgpo1t4Ra0jPCGPxndtrHxEFxs/1kkPi63gaTMkVrB8qJ+bPjH44fGr4iXLXnxA+L/wAUfHN2+4vdeMfH/ivxNcvu+9un1rVr2Rt38WW5715bRX87ZpxLxDnVSVTNs6zTMJS6YrG4irBeUKTn7KnHtCnCMV0R/KWc8XcU8Q1ZVs84hznNJTd7Y3McVWpR1vy06EqnsaMO1OlThCP2Yo19P17XNJm+0aVrOraZcbt/n6fqN3Zzb+u/zbeaN93+1nNfV/ws/wCChP7b/wAF7q2ufh3+1N8a9JhtMeRo2qeONX8X+Fl29N3g/wAZTeIPCsvp+90d8r8p+XivjmiuHCZlmOXzVXAY/G4GqndVMJiq+Gmn3U6M4SX3nm4DN81yqoq2WZnmGXVou8auAxuJwlRNdVPD1Kck/mf01/swf8HJ3xp8KXOmaF+1d8LvD/xY8OhkhvvHfw4it/BHxDt4f+Wt/c+HJZT4F8S3I6R6fp6/D+DDZa8ymJP6if2Vv21/2bP2zvCT+K/gB8SNL8VNYxRN4i8JXYbRvHnhGSU7BH4l8I6h5eq2MLTboLbV4Y7rQNTljl/sjVtQjQvX+YXXoXwt+K/xI+CXjnQviX8JfGniDwB478NXQu9G8S+G7+Sw1C2bjzbeXbmC+068jzb6lpOoQ3Wl6pZvLZajZ3VpNLC/7Pwf48cVZHVpUM/m+JMruoz+scsc1ow6yoY2y+sSXxOGO9q6nwLEUF7x/QXAX0l+NOG61HC8T1JcW5LeMan1pxjneHp7OeHzGy+tSXxOnmKryrP3FisNfnP9V6ivwp/4JQf8FjfCv7altYfBP43f2N4G/af0+ykNh9kA0/wr8Y7HT7dprrVPCsMsjLpXi+0tYpLvX/B3msk9vHPr3hkyaYmp6T4a/dav7H4e4iyjinK6Gb5Lio4rB1tP5atCskvaYbE0vio4indc1OXRxnBzpThOX99cK8V5Fxpk2Gz7h7GxxuAxGj+zXw1eKTq4TGUX72HxVHmXPTl0calOU6NSnUkUUUV7h9GVru7tNPtLq/v7q3srGyt5ru9vbuaO2tLS0to2muLm5uJmSGC3ghR5ZppXWOKNWd2Cgmv8/L/gr9/wUq1r9uX40XPg7wFrF9a/syfCvVrqx+HukRtJbW/jvXbbzrHUPiprdr8rzTaorz2vg+2vRv0Pwu6sttp+ra74hjm/ob/4OB/2y7v4Bfsv6b8A/BWrSaf8RP2mJdU0PVLiyl2XmkfCHRFtv+E5fehLW7+Lbi/0vwdGkqbL/Q7/AMXCCRZ7HK/wtV/Jn0gePKzxEeB8srOFGnClic/nTlrWqVEq2Ey6Vv8Al3Tp8mLrx2qSq4Zaexmpfw/9KPxMxDxcPDjKMRKnh6VOhjOJp0pWderVUa+ByqTX/LmlS9njsTDVVZ1sItPYTUiiiiv5aP4vCiiigAooooAKKKKANnw94h13wlr2jeKfC+sal4e8SeHdUsdb0HXdGvJ9O1bRtY0u5jvNO1PTb+1eO5s76yu4Yri1uYJElhmjV0YMK/0If+CRf/BROz/b0+ARj8YXFpa/tBfCSPStA+LWnRJDax+Io7qKZNA+JOk2kISGKx8VpY3S6vZWscUWj+JrPU7aK1tdJudDa6/zxa+5P+CdP7XWr/sUftY/DT4zw3d4ngz+0U8JfFnSrXzGGufDDxJcW1t4mie1jBa9utE2WnizRbYbfM1/w/palxGZAf1Dwp47r8E8SUHWqy/sLM6lLCZxRb/dwhJ8tLMEtlVwMpe0k0rzw3t6O84uP7L4J+JWJ8O+LcNKvXn/AKt5zVo4HPsO5fuqdOcuShmkY7Ktl05+1lJLmqYT6zQ3qRlH/S8oqnp9/Y6tYWWqaZd29/pupWltf6ffWkqT2t7Y3kKXFpd208ZMc1vcQSJNDKhKSRurKSDVyv8AQhO+q1T1TXU/1LTTSad09U1s13R/nq/8Fw/jvc/G/wD4KI/F+zivzeeGvgvHo3wT8MQhhssz4PtjdeMoSq/J53/CxtY8YI8nMphitoZD/o6JH+RNen/G3xlc/Eb4z/Fz4g3jmW78d/E7x74yupCdxkufE/irVdbnctxuLSXrHOBnNeYV/mHxJmlTOuIM6zapJylmGaY3Fa9IVcROVKC/u06XJTgukIpH+OPF2c1OIeKOIc8qyc5ZrnOY41X+zTr4qpKjTX9ylR5KVNfZhCK6BRRRXhnzoUUUUAFFFFABRRRQAUUUUAf6JX/BFr483Xx8/wCCeHwR1HV9Q/tHxN8MYNW+CviSZpfOlWT4eXK2fhZLh2Jka6f4eXfg24uXmJllmneYlvMDH9Vq/gD/AOCc/wC3h4v/AGXvgl4o8A6BdGGz1f4p634wkUTXEf8ApN/4S8EaK7YikRf9V4fhGcZ4+lfff/D4H4l/9BB//Aq9/wDj9f1XknjdWwWS5RgqsKdWrhMrwGFqVZqTnUnQwtKlOpN9ZTlFyk+rZ/bHDn0iq+XcPZFl9anSrVsDk2V4OrWqKUqlWphsFQozqVJdZzlByk+rZ/LrrlhNpetavplzu+06dql/YXG773nWl3Lby7s87t8Zz71lV9i/8FB/hZc/Bf8Abe/am+HVxbfY4dI+NfjnU9FgwRt8LeLtXm8Y+D2+b/nr4V1/R5s/dbflSVINfHVfzFmWEqZfmOPwFVctXBY3FYSonuqmGrzozT9JQZ/HGbYCrlea5nllZONbLswxmAqp7qrhMRUw80/SVNhRRRXCecFFFFABRRRQAUUUUAFFFFAHv3wr+Feu+OPD95qumTarHBb6zcaewsSfK82Ky0+5JbH/AC02XaZ/2dtel/8ADPPi/wD5+/EX5tX9Mn/BCL9jPwZ48/YeuviJ8R9HjuZvHXxr8fat4UnNtBKZPC2j6T4Q8FtlriJj8vinwt4oj+Q+X8n9/fX7P/8ADBnwE/6AEP8A4Baf/wDGK/Xst8Lc6zDLsBj6WFrSpY3BYXF02oTs4YmhCtBrXrGaP3jKPBniLNMpyvM6ODryo5jl2Cx1KSpztKni8NTrwa8nGomfzN/8HJv7MFz4S+Nnww/au0HTHHh34teHofh147voUYwwfETwPbSP4eub+Y8JceJfAfk6fp0K8GH4f38h2t9/+Zev9PP9tj9lXwl+2f8As1/Ej4A+K2hspPFGli88IeIpIzI/hHx7ox+3+EfEsewGbybLVEjg1e3tzHLqXh+71fSPMSPUHNf5pvxW+F3jn4J/Efxn8JviXoN34Z8d+AdfvvDfiXRbxfntdQsZMeZBL/q7zTr6Aw6hpWpW5ez1TTLq01GylmtLqGV/X8eOD6uRcVTz7D0n/ZfEjeI54r3KOaxivrtCVtpYj/foOWtR1cQo/wACR7f0l+Aq3DfGlTibC0X/AGNxbJ4r2kV7mHzuMV/aOHm+ksVZZjTcv4sq+KUNMNM8+ooor8KP5sCiiigAooooAKKKKACt/wAK+GNf8b+J/DngzwppdzrfijxdrukeGfDejWSh7zVte16/t9L0jTLVSQGuL6/ure1hBIBklXJFYFf0zf8ABvV+wJd/EP4lT/ts/EnRpo/Afwru7zR/gxb31uVt/FvxKkgmsdX8VW6y8XWkfD6ynltbScRNBL4y1CCWzvEv/B2oW9fT8H8M4zi/iHLsiwal/tVZPFVktMJgabUsXipdF7KlfkUv4lZ0qK96pFH2PAXB+P474qynhrARl/ttdPGYhK8cDltJqeOxs/sr2NC/s1K3tcRKjQXv1Yo/q4/ZT+BWlfsy/s3/AAY+A2j+S0Pwy8A6H4ev7q3/ANVqniMW/wBt8W64vyR8694pvNY1l/3afPfN8q9K+gqKK/0qwuGo4LC4bB4aCp4fCUKOGw9NbU6NCnGlSgvKMIpH+u2CweHy7B4TL8JTVHCYHDUMHhaUdqWHw1KNGjTXlCnCMV6BX4Uf8Fjf+CUNt+2n4V/4Xf8ABPT7Kw/af8DaMtp9gMlvp9j8Y/Cmn75IvCuqXU7w2tp4u0lXl/4Q/X7uSOCeNj4Y12ZdNk0jUvDf7r0V5XEXD2V8U5Rislzeh7bB4qPSyrUKsf4WJw1Sz9niKMvepys1vCcZ0pzhLxeK+Fcm40yLG8PZ9hvrGAxsd1aNfDV460cZhKrUvY4rDy96nOzXxU6kalGdSnL/ACePEPh7XvCWu6x4X8U6Nqnh3xJ4e1K80bXdB1uxudL1jRtW06d7W/03U9OvI4buyvrO5jkgubW4ijmhlRkdQwrGr/Q4/wCCin/BIv4Cft6WVz4xhMPwk/aEtrSOLTvi1oOlRXMXiNLSFYLTSfiVoMc1iniqxjgjitLLWFubTxNosMVrHbald6TaNoV1/FV+13/wTq/aw/Yo1i7h+M/w01H/AIQxLz7LpXxZ8JJceJPhfrgdxHavD4mtraP+xLq8Y4t9E8WWnh/X5NrsulmICVv4T478KuI+Ca9as6FTM8i5m6OcYWlKUIU+izClHmlgaq0TdT/Z5v8AhV5u8Y/5reJXgnxb4d4mvXlhquccN8zeHz7BUZTpwpX92OaUYc88urxVlKVX/ZKkn+4xNR80Y/DlFFFfl5+NhRRRQAUVv+GPCvifxtr+l+FPBnhzXfFvijW7lbLRvDnhnSL/AF7XtXvHyUtNM0jS4Lq/vrlgCVhtbeWQgE7eK/pH/YD/AODer4lfEO80X4k/tszXfws8BJLBf2/wY0e+gf4meK4VIlS38V6tZSXFj8P9Hu12C5tLWe/8ZyQG6spYPB9+sGoL9PwzwfxDxfjFg8iy6tiveSr4pp08DhE/t4rFyXsqWnvKF3WqWtRpVJe6fY8H8BcVcd4+OA4byqvjPfUcRjXF0stwMX/y8xuOkvY0Uo+8qd5YiqlahRqztE/OT/gmP/wTH+Jf/BQD4lwXNzBqvg/9nbwfqsA+J3xOEAi+0+UI7p/A3gZ7qN7fVPGmqW7xiaYR3On+EtPuU1vW0lkl0bRtd/0Hfhr8N/BPwf8AAPhL4X/Dfw9Y+FPAvgXQ7Hw54Y8P6arC103S9PiEcKb5Gee6uZTuub6/u5Z77Ub6a4v7+4uLy4nmc+G/w18A/B/wT4e+G/wv8JaH4F8C+FLFdN8P+GPDljFp+l6bahmkfZDGMy3N1O8t3f31y019qN9PcX9/cXF5cTTv3Ff3T4ceHGW8AZbKEJLG5zjVH+08z5eXm5dY4XCxfvUsHSlqk/3lep+9q/8ALqlR/wBJPCbwmynwvymdOnOOYcQZhGH9sZxycvPy6xwWCi/eo5fRlqk/3mJqfv69rUaNAooor9IP1sKKKKACqd/YWGq2V1puqWVpqWnX0EtrfWF/bw3lleWsylJra6tbhJILiCVCUkhlRo3UlWUirlFG+j1TBpNNNXT0aezXZn5TfHj/AIIr/wDBO/493N/q198Eofhf4l1De0viL4Katc/Dtkkk5eaPwpaJefDv7Q7/AL2S4m8GSzyyEtK77mz/ACn/ALev/BO/4K/st+Lb7Qfh/wCJ/ijq9pbPdKknjHWvCl/cnyDhdzaL4J8Px8/xYhHtiv8AQJr+On/gsR/yUjVv+u2o/wDoQr+UfG/JMlwNSNXBZRleDq1aXPUqYXAYXDzqTb1nOdKlGUpPrKTbP4l+kZw5w9ltWFfLsiybAVq1KNWtVwWWYLC1atSU/eqVJ0KEJTnLrKTbZ/PJ8LfhrofjfX20rVbrVre3F6Lffp89pFNs3hc7rixuk3f9s8e1f1c/sX/8EJP2H/H/AIM0n4kfES7+NfjiabyvP8Kap4+0jR/C02UEh3N4N8H+F/FS5+7+68UR/L0+b5q/mI/Z8/5HOT/sKL/6NFf6Cn7Av/JBNF/7Y/8ApOtfmXhZluXZhneGpY/AYLHUnXgnTxeFoYmDV9nCtCcX9x+PeCuUZVmnEWEo5nlmX5jRlXpKVLH4LD4um05vRwxFOpFr5Hq/wI/ZR/Zu/Zj0r+x/gL8F/APwyhkhFvd6h4e0OD/hJNVhBBVdd8XX/wBs8Va/t2ja2tazfsuBg8V9CUUV/emGwuFwVGGGweGoYTDUlanh8NRp0KNNdoUqUYwiv8KR/plg8Fg8uw9PB5fhMNgcJRXLRwuDoUsNh6Ue1OjRjCnBeUYoKKKK3OkKKKKAAP/Z" alt="JPG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/006.xhtml b/testing/web-platform/tests/html/editing/dnd/images/006.xhtml
new file mode 100644
index 000000000..4011085ca
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/006.xhtml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataURL image drag and drop from iframe</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+iframe
+ {width:150px;
+ height:150px;
+ border-style:none;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><iframe src="helper-drag-me-data-url-image.xhtml">XHTML with image</iframe></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/007.xhtml b/testing/web-platform/tests/html/editing/dnd/images/007.xhtml
new file mode 100644
index 000000000..e257a28c7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/007.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataURL image drag and drop to iframe</title>
+<style type="text/css">
+iframe
+ {width:160px;
+ height:160px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+<p><iframe src="helper-drop-image-here.xhtml">XHTML with image</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/008.xhtml b/testing/web-platform/tests/html/editing/dnd/images/008.xhtml
new file mode 100644
index 000000000..b3f1042c9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/008.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dataURL image drag and drop between iframes</title>
+<style type="text/css">
+iframe
+ {width:160px;
+ height:160px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-data-url-image.xhtml">XHTML with image</iframe></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+<p><iframe src="helper-drop-image-here.xhtml">XHTML with image</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/009.xhtml b/testing/web-platform/tests/html/editing/dnd/images/009.xhtml
new file mode 100644
index 000000000..c8da488e8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/009.xhtml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop from iframe</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+iframe
+ {width:150px;
+ height:150px;
+ border-style:none;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><iframe src="helper-circle.xhtml">XHTML with image</iframe></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/010.xhtml b/testing/web-platform/tests/html/editing/dnd/images/010.xhtml
new file mode 100644
index 000000000..bec92d9f7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/010.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop to iframe</title>
+<style type="text/css">
+p:first-child
+ {padding-left:20px;}
+iframe
+ {width:160px;
+ height:160px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><img src="../resources/circle.png" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+<p><iframe src="helper-drop-image-here.xhtml">XHTML with image</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/011.xhtml b/testing/web-platform/tests/html/editing/dnd/images/011.xhtml
new file mode 100644
index 000000000..4fa7c3eff
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/011.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop between iframes</title>
+<style type="text/css">
+iframe
+ {width:160px;
+ height:160px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-circle.xhtml">XHTML with image</iframe></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+<p><iframe src="helper-drop-image-here.xhtml">XHTML with image</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/012-1.xhtml b/testing/web-platform/tests/html/editing/dnd/images/012-1.xhtml
new file mode 100644
index 000000000..3dc4f8064
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/012-1.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop: helper file</title>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/012.xhtml b/testing/web-platform/tests/html/editing/dnd/images/012.xhtml
new file mode 100644
index 000000000..d323d0a02
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/012.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of dataURL image between frames</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="012-1.xhtml"/>
+<frame src="helper-drop-image-here.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/images/013-1.xhtml b/testing/web-platform/tests/html/editing/dnd/images/013-1.xhtml
new file mode 100644
index 000000000..7a78528c8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/013-1.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop: helper file</title>
+</head>
+<body>
+<p><img src="../resources/circle.png" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/013.xhtml b/testing/web-platform/tests/html/editing/dnd/images/013.xhtml
new file mode 100644
index 000000000..ffa7f3b74
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/013.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of image between frames</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="013-1.xhtml"/>
+<frame src="helper-drop-image-here.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/images/014-1.xhtml b/testing/web-platform/tests/html/editing/dnd/images/014-1.xhtml
new file mode 100644
index 000000000..a433bde98
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/014-1.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop: helper file</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ background-color:silver;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img src="../resources/circle.png" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle from one frame to the silver box in <strong>another</strong> frame. It should be copied to the box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/014.xhtml b/testing/web-platform/tests/html/editing/dnd/images/014.xhtml
new file mode 100644
index 000000000..1acb985a8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/014.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of image between two instances of document</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="014-1.xhtml"/>
+<frame src="014-1.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/images/015.xhtml b/testing/web-platform/tests/html/editing/dnd/images/015.xhtml
new file mode 100644
index 000000000..656f05953
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/015.xhtml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropping image on horizontal scrollbar of a scrollable block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:3em;
+ height:3em;
+ margin-top:1em;
+ font-size:1.5em;
+ white-space:nowrap;
+ overflow-x:scroll;}
+p:first-child
+ {padding-left:1em;}
+img
+ {width:5px;
+ height:5px;}
+</style>
+<script type="application/ecmascript">
+function checkImage(event)
+ {document.querySelector('div').firstChild.nodeValue = (document.querySelector('img').getAttribute('src') == event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''))?'PASS':'FAIL';}
+</script>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag little square above and drop it on scrollbar below. You should see word PASS when you drop it on scrollbar.</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="checkImage(event)">↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/016.xhtml b/testing/web-platform/tests/html/editing/dnd/images/016.xhtml
new file mode 100644
index 000000000..3479c8f50
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/016.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropping image on vertical scrollbar of a scrollable block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:2em;
+ height:5em;
+ margin-top:1em;
+ font-size:1.5em;
+ overflow-y:scroll;}
+p:first-child
+ {padding-left:1em;}
+img
+ {width:5px;
+ height:5px;}
+</style>
+<script type="application/ecmascript">
+function checkImage(event)
+ {document.querySelector('div').firstChild.nodeValue = (document.querySelector('img').getAttribute('src') == event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''))?'P A S S':'F A I L';}
+</script>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag little square above and drop it on scrollbar below. You should see word PASS when you drop it on scrollbar.</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="checkImage(event)">→ → → → → → → → → → → → → → → → → → → →</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/017.xhtml b/testing/web-platform/tests/html/editing/dnd/images/017.xhtml
new file mode 100644
index 000000000..0231c719e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/017.xhtml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropping image on horizontal page scrollbar</title>
+<style type="text/css">
+p:first-child
+ {padding-left:1em;}
+div
+ {position:fixed;
+ bottom:0;
+ left:0;}
+img
+ {width:5px;
+ height:5px;}
+body
+ {width:3000px;}
+</style>
+<script type="application/ecmascript">
+function dragImage()
+ {event.dataTransfer.effectAllowed = 'copy';}
+function dropImage(event)
+ {document.querySelector('div').firstChild.nodeValue = 'PASS';}
+</script>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false">
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="dragImage()" ondragend="dropImage(event)"/></p>
+<p>Drag little square above and drop it on vertical scrollbar. Word PASS should appear near scrollbar once you drop it.</p>
+<div>↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/018.xhtml b/testing/web-platform/tests/html/editing/dnd/images/018.xhtml
new file mode 100644
index 000000000..a4b6cca35
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/018.xhtml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropping image on vertical page scrollbar</title>
+<style type="text/css">
+p:first-child
+ {padding-left:1em;}
+div
+ {width:1ex;
+ margin-left:auto;}
+img
+ {width:5px;
+ height:5px;}
+body
+ {height:3000px;}
+</style>
+<script type="application/ecmascript">
+function dragImage()
+ {event.dataTransfer.effectAllowed = 'copy';}
+function dropImage(event)
+ {document.querySelector('div').firstChild.nodeValue = 'P A S S';}
+</script>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false">
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="dragImage()" ondragend="dropImage(event)"/></p>
+<p>Drag little square above and drop it on vertical scrollbar. Word PASS should appear near scrollbar once you drop it.</p>
+<div>→ → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → →</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/021.xhtml b/testing/web-platform/tests/html/editing/dnd/images/021.xhtml
new file mode 100644
index 000000000..33acd9203
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/021.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropping image on horizontal iframe scrollbar</title>
+<style type="text/css">
+p:first-child
+ {padding-left:1em;}
+iframe
+ {height:3em;
+ width:4em;}
+img
+ {width:5px;
+ height:5px;}
+</style>
+<script type="application/ecmascript">
+function dragImage()
+ {event.dataTransfer.effectAllowed = 'copy';}
+function dropImage(event)
+ {document.querySelector('p + p').firstChild.nodeValue = 'PASS';}
+</script>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false">
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="dragImage()" ondragend="dropImage(event)"/></p>
+<p>Drag little square above and drop it on horizontal scrollbar. Word PASS should appear once you drop it.</p>
+<iframe src="helper-drop-horizontal-scrollbar.xhtml">XHTML document</iframe>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/022.xhtml b/testing/web-platform/tests/html/editing/dnd/images/022.xhtml
new file mode 100644
index 000000000..41edef04a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/022.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropping image on vertical iframe scrollbar</title>
+<style type="text/css">
+p:first-child
+ {padding-left:1em;}
+iframe
+ {height:6em;
+ width:3em;}
+img
+ {width:5px;
+ height:5px;}
+</style>
+<script type="application/ecmascript">
+function dragImage()
+ {event.dataTransfer.effectAllowed = 'copy';}
+function dropImage(event)
+ {document.querySelector('p + p').firstChild.nodeValue = 'PASS';}
+</script>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false">
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="dragImage()" ondragend="dropImage(event)"/></p>
+<p>Drag little square above and drop it on vertical scrollbar. Word PASS should appear once you drop it.</p>
+<iframe src="helper-drop-vertical-scrollbar.xhtml">XHTML document</iframe>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/023.xhtml b/testing/web-platform/tests/html/editing/dnd/images/023.xhtml
new file mode 100644
index 000000000..a282570d0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/023.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropping image on horizontal object scrollbar</title>
+<style type="text/css">
+p:first-child
+ {padding-left:1em;}
+object
+ {height:3em;
+ width:4em;}
+img
+ {width:5px;
+ height:5px;}
+</style>
+<script type="application/ecmascript">
+function dragImage()
+ {event.dataTransfer.effectAllowed = 'copy';}
+function dropImage(event)
+ {document.querySelector('p + p').firstChild.nodeValue = 'PASS';}
+</script>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false">
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="dragImage()" ondragend="dropImage(event)"/></p>
+<p>Drag little square above and drop it on horizontal scrollbar. Word PASS should appear once you drop it.</p>
+<object type="application/xhtml+xml" data="helper-drop-horizontal-scrollbar.xhtml">XHTML document</object>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/024.xhtml b/testing/web-platform/tests/html/editing/dnd/images/024.xhtml
new file mode 100644
index 000000000..789f8ea8b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/024.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropping image on vertical object scrollbar</title>
+<style type="text/css">
+p:first-child
+ {padding-left:1em;}
+object
+ {height:6em;
+ width:3em;}
+img
+ {width:5px;
+ height:5px;}
+</style>
+<script type="application/ecmascript">
+function dragImage()
+ {event.dataTransfer.effectAllowed = 'copy';}
+function dropImage(event)
+ {document.querySelector('p + p').firstChild.nodeValue = 'PASS';}
+</script>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false">
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="dragImage()" ondragend="dropImage(event)"/></p>
+<p>Drag little square above and drop it on vertical scrollbar. Word PASS should appear once you drop it.</p>
+<object type="application/xhtml+xml" data="helper-drop-vertical-scrollbar.xhtml">XHTML document</object>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/025.xhtml b/testing/web-platform/tests/html/editing/dnd/images/025.xhtml
new file mode 100644
index 000000000..d0b443830
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/025.xhtml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of image to scrollable container with horizontal scrollbar</title>
+<style type="text/css">
+p + div
+ {height:150px;
+ width:150px;
+ overflow-x:scroll;}
+div[ondragenter]
+ {margin-left:200px;
+ width:105px;
+ min-height:105px;
+ text-align:center;
+ padding:10px;
+ background-color:silver;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div > div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the silver box inside scrollable container below (dragging towards edge of container triggers scrolling).</p>
+<p>It should be copied to the silver box once you drop it there.</p>
+<div>
+ <div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+ />
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/026.xhtml b/testing/web-platform/tests/html/editing/dnd/images/026.xhtml
new file mode 100644
index 000000000..68ad4eb95
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/026.xhtml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of image to scrollable container with vertical scrollbar</title>
+<style type="text/css">
+p + div
+ {height:150px;
+ width:150px;
+ overflow-y:scroll;}
+div[ondragenter]
+ {margin-top:200px;
+ width:105px;
+ min-height:105px;
+ text-align:center;
+ padding:10px;
+ background-color:silver;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div > div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the silver box inside scrollable container below (dragging towards edge of container triggers scrolling).</p>
+<p>It should be copied to the silver box once you drop it there.</p>
+<div>
+↓↓↓↓↓↓↓↓↓
+ <div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+ />
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/027.xhtml b/testing/web-platform/tests/html/editing/dnd/images/027.xhtml
new file mode 100644
index 000000000..51428a1ac
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/027.xhtml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of image to scrollable container</title>
+<style type="text/css">
+p + div
+ {height:150px;
+ width:150px;
+ overflow:scroll;}
+div[ondragenter]
+ {margin:200px 0 0 200px;
+ width:105px;
+ min-height:105px;
+ text-align:center;
+ padding:10px;
+ background-color:silver;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div > div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the silver box inside scrollable container below (dragging towards edge of container triggers scrolling).</p>
+<p>It should be copied to the silver box once you drop it there.</p>
+<div>
+↘
+ <div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+ />
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/028.xhtml b/testing/web-platform/tests/html/editing/dnd/images/028.xhtml
new file mode 100644
index 000000000..1bb7a5e93
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/028.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop and url alias</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('url'));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above outside the window and then back inside and drop in the box below. It should be copied to the box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/images/cross-domain/001.xhtml b/testing/web-platform/tests/html/editing/dnd/images/cross-domain/001.xhtml
new file mode 100644
index 000000000..9eb5c7be3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/cross-domain/001.xhtml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross-domain image data must not populate the dataTransfer</title>
+<script src="../../resources/crossorigin.js"></script>
+<style type="text/css">
+div {
+ width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;
+}
+</style>
+</head>
+<body>
+<p><img id="image" draggable="true" alt="" width="100" height="100" /></p>
+<p>Drag the navy square above to the box below.</p>
+<div></div>
+<script><![CDATA[
+
+document.getElementsByTagName("img")[0].src = crossOriginUrl("www", "../../resources/100x100-navy.png");
+
+window.onload = function() {
+ var image = document.getElementsByTagName('img')[0], div = document.getElementsByTagName('div')[0], failed = [];
+ div.ondragover = div.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ div.ondrop = image.ondragstart = function(e) {
+ if( e.type == 'dragstart' ) {
+ e.dataTransfer.setData('Text', 'dummy text');
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ for( var i = 0; i < e.dataTransfer.types.length; i++ ) {
+ if( e.dataTransfer.types[i].match(/image\//) ) {
+ failed[failed.length] = e.dataTransfer.types[i];
+ }
+ }
+ if( e.type == 'drop' ) {
+ e.preventDefault();
+ document.getElementsByTagName('p')[1].innerHTML = failed.length ? ( 'FAIL (found ' + failed.join() + ')' ) : 'PASS';
+ }
+ };
+};
+]]></script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/images/helper-circle.xhtml b/testing/web-platform/tests/html/editing/dnd/images/helper-circle.xhtml
new file mode 100644
index 000000000..1df3ee3fa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/helper-circle.xhtml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop: helper file</title>
+</head>
+<body>
+<p><img src="../resources/circle.png" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/helper-drag-me-data-url-image.xhtml b/testing/web-platform/tests/html/editing/dnd/images/helper-drag-me-data-url-image.xhtml
new file mode 100644
index 000000000..640b42b4d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/helper-drag-me-data-url-image.xhtml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop: helper file</title>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/helper-drop-horizontal-scrollbar.xhtml b/testing/web-platform/tests/html/editing/dnd/images/helper-drop-horizontal-scrollbar.xhtml
new file mode 100644
index 000000000..ca1a677cc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/helper-drop-horizontal-scrollbar.xhtml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop: helper file</title>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false">
+<div>↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/helper-drop-image-here.xhtml b/testing/web-platform/tests/html/editing/dnd/images/helper-drop-image-here.xhtml
new file mode 100644
index 000000000..00fb97a63
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/helper-drop-image-here.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop: helper file</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/images/helper-drop-vertical-scrollbar.xhtml b/testing/web-platform/tests/html/editing/dnd/images/helper-drop-vertical-scrollbar.xhtml
new file mode 100644
index 000000000..619723882
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/images/helper-drop-vertical-scrollbar.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Image drag and drop: helper file</title>
+<style type="text/css">
+div
+ {width:1ex;}
+</style>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false">
+<div>→ → → → → → → → → → → → → → → → → → → →</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactive/frames-1.html b/testing/web-platform/tests/html/editing/dnd/interactive/frames-1.html
new file mode 100644
index 000000000..7df4fab4e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactive/frames-1.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop should allow dragging of iframes and object iframes</title>
+ <style type="text/css">
+html { background: black; color: white; }
+ </style>
+ </head>
+ <body>
+
+ <script type="text/javascript">
+if( self == top ) {
+ document.write('<p>This is a helper file, not a testcase.<\/p>');
+}
+ </script>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactive/frames.html b/testing/web-platform/tests/html/editing/dnd/interactive/frames.html
new file mode 100644
index 000000000..0414c5249
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactive/frames.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop should allow dragging of iframes and object iframes</title>
+ <style type="text/css">
+iframe, object {
+ border: 10px solid orange;
+ background: blue;
+ padding: 10px;
+ height: 100px;
+ width: 100px;
+}
+ </style>
+ </head>
+ <body>
+
+ <p>It should be possible to drag the following two blocks by both their orange and blue borders.</p>
+ <p><iframe draggable="true" src="frames-1.html"></iframe></p>
+ <p><object draggable="true" data="frames-1.html"></object></p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactive/object-retention.html b/testing/web-platform/tests/html/editing/dnd/interactive/object-retention.html
new file mode 100644
index 000000000..92a71d526
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactive/object-retention.html
@@ -0,0 +1,144 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - variable retention within event handlers</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+ body > div + div {
+ margin-top: 10px;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1], fails = [], evs = {};
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ var foo = {};
+ e.dataTransfer.setData('text', foo);
+ if( e.dataTransfer.getData('text') === foo ) {
+ fails[fails.length] = 'object was not cast to string';
+ }
+ evs[e.type] = {};
+ evs[e.type].dataTransfer = e.dataTransfer;
+ evs[e.type].items = e.dataTransfer.items;
+ evs[e.type].types = e.dataTransfer.types;
+ evs[e.type].files = e.dataTransfer.files;
+ //"The same object must be returned each time."
+ if( evs[e.type].dataTransfer !== e.dataTransfer ) {
+ fails[fails.length] = '.dataTransfer is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.items ) {
+ fails[fails.length] = '.items is not returning anything during '+e.type;
+ } else if( evs[e.type].items !== e.dataTransfer.items ) {
+ fails[fails.length] = '.items is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.types ) {
+ fails[fails.length] = '.types is not returning anything during '+e.type;
+ } else if( evs[e.type].types !== e.dataTransfer.types ) {
+ fails[fails.length] = '.types is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = '.files is not returning anything during '+e.type;
+ } else if( evs[e.type].files !== e.dataTransfer.files ) {
+ fails[fails.length] = '.files is not returning the same object during '+e.type;
+ }
+ };
+ blue.ondragover = blue.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ if( !evs[e.type] ) { evs[e.type] = {}; }
+ evs[e.type].dataTransfer = e.dataTransfer;
+ evs[e.type].items = e.dataTransfer.items;
+ evs[e.type].types = e.dataTransfer.types;
+ evs[e.type].files = e.dataTransfer.files;
+ if( evs[e.type].dataTransfer != e.dataTransfer ) {
+ fails[fails.length] = '.dataTransfer is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.items ) {
+ fails[fails.length] = '.items is not returning anything during '+e.type;
+ } else if( evs[e.type].items !== e.dataTransfer.items ) {
+ fails[fails.length] = '.items is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.types ) {
+ fails[fails.length] = '.types is not returning anything during '+e.type;
+ } else if( evs[e.type].types !== e.dataTransfer.types ) {
+ fails[fails.length] = '.types is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = '.files is not returning anything during '+e.type;
+ } else if( evs[e.type].files !== e.dataTransfer.files ) {
+ fails[fails.length] = '.files is not returning the same object during '+e.type;
+ }
+ //http://dev.w3.org/html5/spec/dnd.html#datatransfer
+ //"The * attribute must return a * object associated with the DataTransfer object."
+ //Note that it is associated with the DataTransfer object, *not* the data store
+ //http://dev.w3.org/html5/spec/dnd.html#dragevent
+ //"when a user agent is required to fire a DND event named e at an element, using a particular drag data store...
+ //Let dataTransfer be a newly created DataTransfer object associated with the given drag data store."
+ //A new DataTransfer object therefore means a new set of properties, not the same ones as last event
+ if( evs.dragstart.dataTransfer === e.dataTransfer ) {
+ fails[fails.length] = '.dataTransfer is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ if( e.dataTransfer.items && evs.dragstart.items === e.dataTransfer.items ) {
+ fails[fails.length] = '.items is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ if( e.dataTransfer.types && evs.dragstart.types === e.dataTransfer.types ) {
+ fails[fails.length] = '.types is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ if( e.dataTransfer.files && evs.dragstart.files === e.dataTransfer.files ) {
+ fails[fails.length] = '.files is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ };
+ blue.ondrop = function(e) {
+ e.preventDefault();
+ evs[e.type] = {};
+ evs[e.type].dataTransfer = e.dataTransfer;
+ evs[e.type].items = e.dataTransfer.items;
+ evs[e.type].types = e.dataTransfer.types;
+ evs[e.type].files = e.dataTransfer.files;
+ if( evs[e.type].dataTransfer !== e.dataTransfer ) {
+ fails[fails.length] = '.dataTransfer is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.items ) {
+ fails[fails.length] = '.items is not returning anything during '+e.type;
+ } else if( evs[e.type].items !== e.dataTransfer.items ) {
+ fails[fails.length] = '.items is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.types ) {
+ fails[fails.length] = '.types is not returning anything during '+e.type;
+ } else if( evs[e.type].types !== e.dataTransfer.types ) {
+ fails[fails.length] = '.types is not returning the same object during '+e.type;
+ }
+ if( !e.dataTransfer.files ) {
+ fails[fails.length] = '.files is not returning anything during '+e.type;
+ } else if( evs[e.type].files !== e.dataTransfer.files ) {
+ fails[fails.length] = '.files is not returning the same object during '+e.type;
+ }
+ if( evs.dragstart.dataTransfer === e.dataTransfer ) {
+ fails[fails.length] = '.dataTransfer is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ if( e.dataTransfer.items && evs.dragstart.items === e.dataTransfer.items ) {
+ fails[fails.length] = '.items is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ if( e.dataTransfer.types && evs.dragstart.types === e.dataTransfer.types ) {
+ fails[fails.length] = '.types is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ if( e.dataTransfer.files && evs.dragstart.files === e.dataTransfer.files ) {
+ fails[fails.length] = '.files is returning the same object during '+e.type+' as it did during dragstart';
+ }
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL:<br>' + fails.join('<br>') ) : 'PASS';
+ };
+};
+</script>
+
+<p>Drag the orange square onto the blue square. Fail if this text does not change.</p>
+<div draggable="true"></div>
+<div></div>
+
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/interactive/plugins.html b/testing/web-platform/tests/html/editing/dnd/interactive/plugins.html
new file mode 100644
index 000000000..7be5ec939
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactive/plugins.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop should not remove styling of plugin object elements</title>
+ <style type="text/css">
+div {
+ border: 10px solid orange;
+ background: yellow;
+ padding: 10px;
+ height: 140px;
+ width: 140px;
+}
+object {
+ border: 10px solid gray;
+ background: fuchsia;
+ padding: 10px;
+ height: 100px;
+ width: 100px;
+}
+ </style>
+ </head>
+ <body>
+
+ <p>Drag the following block by the orange border. The drag placeholder should contain all inner borders, but may optionally show white or pink instead of the navy square.</p>
+ <div draggable="true" ondragstart="event.dataTransfer.setData('Text','dummy text');"><object data="../resources/boxnavy.swf"></object></div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/001.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/001.html
new file mode 100644
index 000000000..33c6518e0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/001.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Select input inside draggable element</title>
+ <style type="text/css">
+select { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It should open and select items in the dropdown, and should <strong>not</strong> drag the block or text.</p>
+ <div draggable="true">
+ <select>
+ <option>Option 1</option>
+ <option>Option 2</option>
+ <option>Option 3</option>
+ </select>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/002.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/002.html
new file mode 100644
index 000000000..8734a3e3a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/002.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Select multiple input inside draggable element</title>
+ <style type="text/css">
+select { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It should open and select items in the dropdown, and should <strong>not</strong> drag the block or text.</p>
+ <div draggable="true">
+ <select multiple size="3">
+ <option>Option 1</option>
+ <option>Option 2</option>
+ <option>Option 3</option>
+ </select>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/003.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/003.html
new file mode 100644
index 000000000..3399c2f02
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/003.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Draggable select</title>
+ <style type="text/css">
+select { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('select')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It should open and select items in the dropdown, and should <strong>not</strong> drag the block or text.</p>
+ <div>
+ <select draggable="true">
+ <option>Option 1</option>
+ <option>Option 2</option>
+ <option>Option 3</option>
+ </select>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/004.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/004.html
new file mode 100644
index 000000000..5f58b207a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/004.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Draggable select multiple</title>
+ <style type="text/css">
+select { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('select')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It should open and select items in the dropdown, and should <strong>not</strong> drag the block or text.</p>
+ <div>
+ <select multiple size="3" draggable="true">
+ <option>Option 1</option>
+ <option>Option 2</option>
+ <option>Option 3</option>
+ </select>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/005.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/005.html
new file mode 100644
index 000000000..6647375c6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/005.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Text input inside draggable element</title>
+ <style type="text/css">
+input { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It should focus the dummy text. Use your mouse to select part of the dummy text. It should <strong>not</strong> drag the block or text in either case.</p>
+ <div draggable="true">
+ <input value="Dummy text">
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/006.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/006.html
new file mode 100644
index 000000000..0ca353212
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/006.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Draggable text input</title>
+ <style type="text/css">
+input { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('input')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It should focus the dummy text. Use your mouse to select part of the dummy text. It should <strong>not</strong> drag the block or text in either case.</p>
+ <div>
+ <input value="Dummy text" draggable="true">
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/007.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/007.html
new file mode 100644
index 000000000..6bcdc80e9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/007.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Textarea inside draggable element</title>
+ <style type="text/css">
+textarea { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It may optionally focus the dummy text. Use your mouse to select part of the dummy text, moving the mouse vertically and horizontally. It should select the text. Try to drag the input's scrollbar thumb. It should <strong>not</strong> drag the block or text in any case.</p>
+ <div draggable="true">
+<textarea rows="5" cols="50" wrap="off">Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</textarea>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/008.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/008.html
new file mode 100644
index 000000000..7cb97518f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/008.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Draggable textarea</title>
+ <style type="text/css">
+textarea { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('textarea')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It may optionally focus the dummy text. Use your mouse to select part of the dummy text, moving the mouse vertically and horizontally. It should select the text. Try to drag the input's scrollbar thumb. It should <strong>not</strong> drag the block or text in any case.</p>
+ <div>
+<textarea rows="5" cols="50" wrap="off">Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+Dummy text
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</textarea>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/009.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/009.html
new file mode 100644
index 000000000..6c240c06f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/009.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Input button inside draggable element</title>
+ <style type="text/css">
+input { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It should <strong>not</strong> drag the block or text.</p>
+ <div draggable="true">
+ <input type="button" value="Dummy text">
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/010.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/010.html
new file mode 100644
index 000000000..2253e8bae
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/010.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Draggable input button</title>
+ <style type="text/css">
+input { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('input')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It should <strong>not</strong> drag the block or text.</p>
+ <div>
+ <input type="button" value="Dummy text" draggable="true">
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/011.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/011.html
new file mode 100644
index 000000000..e90cfc349
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/011.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Button inside draggable element</title>
+ <style type="text/css">
+button { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It should <strong>not</strong> drag the block or text.</p>
+ <div draggable="true">
+ <button>Dummy text</button>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/012.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/012.html
new file mode 100644
index 000000000..15659cdc9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/012.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Draggable button</title>
+ <style type="text/css">
+button { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('button')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It should <strong>not</strong> drag the block or text.</p>
+ <div>
+ <button draggable="true">Dummy text</button>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/015.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/015.html
new file mode 100644
index 000000000..a2c66a145
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/015.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Contenteditable inside draggable element</title>
+ <style type="text/css">
+div div { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It should <strong>not</strong> drag the text or the orange block. Use your mouse to select the dummy text. It should <strong>not</strong> drag the text or the orange block.</p>
+ <div draggable="true">
+ <div contenteditable="true">Dummy text</div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/016.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/016.html
new file mode 100644
index 000000000..b9bc169e4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/016.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Draggable contenteditable element</title>
+ <style type="text/css">
+div div { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[1].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. It should <strong>not</strong> drag the text or the orange block. Use your mouse to select the dummy text. It should <strong>not</strong> drag the text or the orange block.</p>
+ <div>
+ <div draggable="true" contenteditable="true">Dummy text</div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/017.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/017.html
new file mode 100644
index 000000000..8de64c08b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/017.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Scrollable element inside draggable element</title>
+ <style type="text/css">
+div div { width: 300px; height: 100px; overflow: auto; border: 1px solid orange; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>It should be possible to drag the scrollbar thumbs of the box below without dragging the whole box.</p>
+ <div draggable="true">
+ <div>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/018.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/018.html
new file mode 100644
index 000000000..67d8ad0f8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/018.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Draggable scrollable element</title>
+ <style type="text/css">
+div div { width: 300px; height: 100px; overflow: auto; border: 1px solid orange; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[1].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>It should be possible to drag the scrollbar thumbs of the box below without dragging the whole box.</p>
+ <div>
+ <div draggable="true">Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>Dummy text<br>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/019.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/019.html
new file mode 100644
index 000000000..77e6e813c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/019.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Disabled text input with inside draggable element</title>
+ <style type="text/css">
+input { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. Use your mouse to attempt to select part of the dummy text. It should <strong>not</strong> drag the block or text in either case.</p>
+ <div draggable="true">
+ <input value="Dummy text" disabled>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/020.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/020.html
new file mode 100644
index 000000000..2bad55312
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/020.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Disabled draggable text input</title>
+ <style type="text/css">
+input { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('input')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. Use your mouse to attempt to select part of the dummy text. It should <strong>not</strong> drag the block or text in either case.</p>
+ <div>
+ <input value="Dummy text" draggable="true" disabled>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/021.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/021.html
new file mode 100644
index 000000000..954c59509
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/021.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Readonly text input with inside draggable element</title>
+ <style type="text/css">
+input { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. Use your mouse to attempt to select part of the dummy text. It should <strong>not</strong> drag the block or text in either case.</p>
+ <div draggable="true">
+ <input value="Dummy text" readonly>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/interactiveelements/022.html b/testing/web-platform/tests/html/editing/dnd/interactiveelements/022.html
new file mode 100644
index 000000000..fb1d796ba
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/interactiveelements/022.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Readonly draggable text input</title>
+ <style type="text/css">
+input { border: 1px solid orange; border-top-width: 20px; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('input')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Press your mouse button down on the orange block and drag downwards. Use your mouse to attempt to select part of the dummy text. It should <strong>not</strong> drag the block or text in either case.</p>
+ <div>
+ <input value="Dummy text" draggable="true" readonly>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/media/001.xhtml b/testing/web-platform/tests/html/editing/dnd/media/001.xhtml
new file mode 100644
index 000000000..2f90f5c3e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/media/001.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Video drag and drop</title>
+<style type="text/css">
+canvas
+ {background-color:silver;}
+</style>
+<script type="application/ecmascript">
+var draggedFrame = 'data:text/plain,FAIL';
+function dropIt(event)
+ {document.querySelector('p + p').firstChild.nodeValue = (draggedFrame == event.dataTransfer.getData('text/uri-list'))?'PASS':'FAIL';}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ var canvas = document.querySelector('canvas'),
+ c = canvas.getContext('2d');
+ c.drawImage(document.querySelector('video'),0,0,640,360);
+ draggedFrame = canvas.toDataURL('image/png');
+ event.dataTransfer.setData('text/uri-list',draggedFrame);}
+</script>
+<script src="/common/media.js"></script>
+</head>
+<body dropzone="copy string:text/uri-list" ondrop="dropIt(event)">
+<p>
+ <video draggable="true" ondragstart="start(event)" controls="true"/>
+ <script>
+ var video = document.querySelector('video');
+ video.src = getVideoURI('/media/movie_5');
+ </script>
+</p>
+<p>Drag video and drop it somewhere on the page. Dragged frame should be copied to the canvas below and you should see word PASS once you drop video.</p>
+<p>
+ <canvas width="640" height="360">Canvas</canvas>
+</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/000.html b/testing/web-platform/tests/html/editing/dnd/microdata/000.html
new file mode 100644
index 000000000..6ec402e7d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/000.html
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - no microdata for no itemscope</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items collection'; }
+ if( md.items.length != 0 ) { return 'unexpected items found'; }
+ return '';
+}
+
+</script>
+
+<div draggable='true'></div><div></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/001.html b/testing/web-platform/tests/html/editing/dnd/microdata/001.html
new file mode 100644
index 000000000..eda592fc6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/001.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata for non looping simple drop</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+
+ orange.appendChild( makeEl('meta',{itemprop:'foo',content:'test'}) );
+ orange.appendChild( makeEl('audio',{itemprop:'bar',src:'test'},'fail') );
+ orange.appendChild( makeEl('embed',{itemprop:'foo',src:'test'}) );
+ orange.appendChild( makeEl('iframe',{itemprop:'bar',src:'test'},'fail') );
+ orange.appendChild( makeEl('img',{itemprop:'foo',src:'test'}) );
+ orange.appendChild( makeEl('source',{itemprop:'bar',src:'test'}) );
+ orange.appendChild( makeEl('track',{itemprop:'foo',src:'test'}) );
+ orange.appendChild( makeEl('video',{itemprop:'bar',src:'test'},'fail') );
+ orange.appendChild( makeEl('a',{itemprop:'foo',href:'test'},'fail') );
+ orange.appendChild( makeEl('area',{itemprop:'bar',href:'test'}) );
+ orange.appendChild( makeEl('link',{itemprop:'foo',href:'test'}) );
+ orange.appendChild( makeEl('object',{itemprop:'bar',data:'test'},'fail') );
+ orange.appendChild( makeEl('time',{itemprop:'foo'},'fail') );
+ orange.appendChild( makeEl('time',{itemprop:'baz',datetime:'test'},'fail') );
+ orange.appendChild( makeEl('div',{itemprop:'baz'},'test') );
+ orange.appendChild( makeEl('madeuponthespot',{itemprop:'foo'},'test') );
+ orange.appendChild( makeEl('madeuponthespot',{itemprop:'foo',content:'test',src:'test',href:'test',data:'test',datetime:'test',value:'test'},'test') );
+ orange.appendChild( makeEl('input',{itemprop:'foo',value:'test'},'test') );
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items || md.items.length != 1 ) { return 'no items'; }
+ if( !md.items[0].properties ) { return 'no properties'; }
+ if( !md.items[0].properties.foo ) { return 'no properties.foo'; }
+ if( !md.items[0].properties.bar ) { return 'no properties.bar'; }
+ if( !md.items[0].properties.baz ) { return 'no properties.baz'; }
+ if( md.items[0].properties.foo.length != 10 ) { return 'properties.foo length '+md.items[0].properties.foo.length+' instead of 10'; }
+ if( md.items[0].properties.bar.length != 6 ) { return 'properties.bar length '+md.items[0].properties.bar.length+' instead of 6'; }
+ if( md.items[0].properties.baz.length != 2 ) { return 'properties.baz length '+md.items[0].properties.baz.length+' instead of 2'; }
+ for( i = 0; i < 10; i++ ) {
+ if( md.items[0].properties.foo[i] != orange.properties.namedItem('foo').getValues()[i] ) { return 'properties.foo['+i+'] <i>'+md.items[0].properties.foo[i]+'</i> instead of <i>'+orange.properties.namedItem('foo').getValues()[i]+'</i>'; }
+ }
+ for( i = 0; i < 6; i++ ) {
+ if( md.items[0].properties.bar[i] != orange.properties.namedItem('bar').getValues()[i] ) { return 'properties.bar['+i+'] <i>'+md.items[0].properties.bar[i]+'</i> instead of <i>'+orange.properties.namedItem('bar').getValues()[i]+'</i>'; }
+ }
+ for( i = 0; i < 2; i++ ) {
+ if( md.items[0].properties.baz[i] != orange.properties.namedItem('baz').getValues()[i] ) { return 'properties.baz['+i+'] <i>'+md.items[0].properties.baz[i]+'</i> instead of <i>'+orange.properties.namedItem('baz').getValues()[i]+'</i>'; }
+ }
+ return '';
+}
+
+</script>
+
+<div draggable='true' itemscope></div><div></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/002.html b/testing/web-platform/tests/html/editing/dnd/microdata/002.html
new file mode 100644
index 000000000..bf75986bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/002.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata with itemref</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div *, span {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+
+ orange.parentNode.insertBefore( makeEl('span',{itemprop:'foo',id:'id1'},'dummytext1 '), orange );
+ orange.parentNode.appendChild( makeEl('span',{itemprop:'bar',id:'id2'},'dummytext2 ') );
+ orange.parentNode.appendChild( makeEl('span',{itemprop:'foo',id:'id3'},'dummytext3 ') );
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items || md.items.length != 1 ) { return 'no items'; }
+ if( !md.items[0].properties ) { return 'no properties'; }
+ if( !md.items[0].properties.foo ) { return 'no properties.foo'; }
+ if( !md.items[0].properties.bar ) { return 'no properties.bar'; }
+ if( md.items[0].properties.foo.length != 2 ) { return 'properties.foo length '+md.items[0].properties.foo.length+' instead of 2'; }
+ if( md.items[0].properties.bar.length != 1 ) { return 'properties.bar length '+md.items[0].properties.bar.length+' instead of 1'; }
+ for( i = 0; i < 2; i++ ) {
+ if( md.items[0].properties.foo[i] != orange.properties.namedItem('foo').getValues()[i] ) { return 'properties.foo['+i+'] <i>'+md.items[0].properties.foo[i]+'</i> instead of <i>'+orange.properties.namedItem('foo').getValues()[i]+'</i>'; }
+ }
+ if( md.items[0].properties.bar[0] != orange.properties.namedItem('bar').getValues()[0] ) { return 'properties.bar[0] <i>'+md.items[0].properties.bar[i]+'</i> instead of <i>'+orange.properties.namedItem('bar').getValues()[0]+'</i>'; }
+ return '';
+}
+
+</script>
+
+<div draggable='true' itemscope itemref='id3 id2 id1'></div><div></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/003.html b/testing/web-platform/tests/html/editing/dnd/microdata/003.html
new file mode 100644
index 000000000..0b9cca7f3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/003.html
@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata changes after dragstart</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+
+ orange.appendChild( makeEl('meta',{itemprop:'foo',content:'test'}) );
+ orange.appendChild( makeEl('audio',{itemprop:'bar',src:'test'},'fail') );
+ orange.appendChild( makeEl('embed',{itemprop:'foo',src:'test'}) );
+ orange.appendChild( makeEl('iframe',{itemprop:'bar',src:'test'},'fail') );
+ orange.appendChild( makeEl('img',{itemprop:'foo',src:'test'}) );
+ orange.appendChild( makeEl('source',{itemprop:'bar',src:'test'}) );
+ orange.appendChild( makeEl('track',{itemprop:'foo',src:'test'}) );
+ orange.appendChild( makeEl('video',{itemprop:'bar',src:'test'},'fail') );
+ orange.appendChild( makeEl('a',{itemprop:'foo',href:'test'},'fail') );
+ orange.appendChild( makeEl('area',{itemprop:'bar',href:'test'}) );
+ orange.appendChild( makeEl('link',{itemprop:'foo',href:'test'}) );
+ orange.appendChild( makeEl('object',{itemprop:'bar',data:'test'},'fail') );
+ orange.appendChild( makeEl('time',{itemprop:'foo'},'fail') );
+ orange.appendChild( makeEl('time',{itemprop:'baz',datetime:'test'},'fail') );
+ orange.appendChild( makeEl('div',{itemprop:'baz'},'test') );
+ orange.appendChild( makeEl('madeuponthespot',{itemprop:'foo'},'test') );
+ orange.appendChild( makeEl('madeuponthespot',{itemprop:'foo',content:'test',src:'test',href:'test',data:'test',datetime:'test',value:'test'},'test') );
+ orange.appendChild( makeEl('input',{itemprop:'foo',value:'test'},'test') );
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ //microdata should be stored and reused after the dragstart event
+ //removing the item should not cause the microdata tohave disappeared when the drop event fires
+ this.itemScope = false;
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err, md = e.dataTransfer.getData('application/microdata+json');
+ orange.itemScope = true;
+ if( err = checkprops(md) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items || md.items.length != 1 ) { return 'no items'; }
+ if( !md.items[0].properties ) { return 'no properties'; }
+ if( !md.items[0].properties.foo ) { return 'no properties.foo'; }
+ if( !md.items[0].properties.bar ) { return 'no properties.bar'; }
+ if( !md.items[0].properties.baz ) { return 'no properties.baz'; }
+ if( md.items[0].properties.foo.length != 10 ) { return 'properties.foo length '+md.items[0].properties.foo.length+' instead of 10'; }
+ if( md.items[0].properties.bar.length != 6 ) { return 'properties.bar length '+md.items[0].properties.bar.length+' instead of 6'; }
+ if( md.items[0].properties.baz.length != 2 ) { return 'properties.baz length '+md.items[0].properties.baz.length+' instead of 2'; }
+ for( i = 0; i < 10; i++ ) {
+ if( md.items[0].properties.foo[i] != orange.properties.namedItem('foo').getValues()[i] ) { return 'properties.foo['+i+'] <i>'+md.items[0].properties.foo[i]+'</i> instead of <i>'+orange.properties.namedItem('foo').getValues()[i]+'</i>'; }
+ }
+ for( i = 0; i < 6; i++ ) {
+ if( md.items[0].properties.bar[i] != orange.properties.namedItem('bar').getValues()[i] ) { return 'properties.bar['+i+'] <i>'+md.items[0].properties.bar[i]+'</i> instead of <i>'+orange.properties.namedItem('bar').getValues()[i]+'</i>'; }
+ }
+ for( i = 0; i < 2; i++ ) {
+ if( md.items[0].properties.baz[i] != orange.properties.namedItem('baz').getValues()[i] ) { return 'properties.baz['+i+'] <i>'+md.items[0].properties.baz[i]+'</i> instead of <i>'+orange.properties.namedItem('baz').getValues()[i]+'</i>'; }
+ }
+ return '';
+}
+
+</script>
+
+<div draggable='true' itemscope></div><div></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/004.html b/testing/web-platform/tests/html/editing/dnd/microdata/004.html
new file mode 100644
index 000000000..335533264
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/004.html
@@ -0,0 +1,116 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata with nested item as property</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+
+ orange.appendChild( makeEl('div',{itemprop:'foo',itemscope:'itemscope'},'') );
+ orange.appendChild( makeEl('div',{itemprop:'foo',itemscope:'itemscope'},'') );
+ orange.lastChild.appendChild( makeEl('div',{itemprop:'bar'},'test') );
+ orange.appendChild( makeEl('div',{itemprop:'bar',itemscope:'itemscope'},'') );
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 1 ) { return md.items.length+' items instead of 1'; }
+ if( !md.items[0].properties ) { return 'no properties'; }
+ if( !md.items[0].properties.foo ) { return 'no properties.foo'; }
+ if( !md.items[0].properties.bar ) { return 'no properties.bar'; }
+ if( md.items[0].properties.foo.length != 2 ) { return 'properties.foo length '+md.items[0].properties.foo.length+' instead of 2'; }
+ if( md.items[0].properties.bar.length != 1 ) { return 'properties.bar length '+md.items[0].properties.bar.length+' instead of 1'; }
+
+ if( !md.items[0].properties.foo[0] ) { return 'properties.foo[0] <i>'+md.items[0].properties.foo[0]+'</i> instead of <i>{properties:{}}</i>'; }
+ if( !md.items[0].properties.foo[0].properties ) { return 'properties.foo[0].properties <i>'+md.items[0].properties.foo[0].properties+'</i> instead of <i>{}</i>'; }
+
+ if( !md.items[0].properties.foo[1] ) { return 'properties.foo[1] <i>'+md.items[0].properties.foo[1]+'</i> instead of <i>{properties:{bar:[test]}}</i>'; }
+ if( !md.items[0].properties.foo[1].properties ) { return 'properties.foo[1].properties <i>'+md.items[0].properties.foo[1].properties+'</i> instead of <i>{bar:[test]}</i>'; }
+ if( !md.items[0].properties.foo[1].properties.bar ) { return 'properties.foo[1].properties.bar <i>'+md.items[0].properties.foo[1].properties.bar+'</i> instead of <i>[test]</i>'; }
+ if( !md.items[0].properties.foo[1].properties.bar.length ) { return 'properties.foo[1].properties.bar.length <i>'+md.items[0].properties.foo[1].properties.bar.length+'</i> instead of 1'; }
+ if( md.items[0].properties.foo[1].properties.bar[0] != 'test') { return 'properties.foo[1].properties.bar[0] <i>'+md.items[0].properties.foo[1].properties.bar[0]+'</i> instead of <i>test</i>'; }
+
+ if( !md.items[0].properties.bar[0] ) { return 'properties.bar[0] <i>'+md.items[0].properties.bar[0]+'</i> instead of <i>{properties:{}}</i>'; }
+ if( !md.items[0].properties.bar[0].properties ) { return 'properties.bar[0].properties <i>'+md.items[0].properties.bar[0].properties+'</i> instead of <i>{}</i>'; }
+ return '';
+}
+
+</script>
+
+<div draggable='true' itemscope></div><div></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/005.html b/testing/web-platform/tests/html/editing/dnd/microdata/005.html
new file mode 100644
index 000000000..3a10d90a1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/005.html
@@ -0,0 +1,115 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata with nested item as non-property</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+
+ orange.appendChild( makeEl('div',{itemprop:'foo',itemscope:'itemscope'},'') );
+ orange.appendChild( makeEl('div',{itemscope:'itemscope'},'') );
+ orange.lastChild.appendChild( makeEl('div',{itemprop:'bar'},'test') );
+ orange.appendChild( makeEl('div',{itemprop:'bar',itemscope:'itemscope'},'') );
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ // http://dev.w3.org/html5/md/#drag-and-drop
+ //"The user agent must take the list of dragged nodes and extract the microdata from those nodes into a JSON form"
+ // http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model
+ //"the list of dragged nodes contains only the source node, if any."
+ //nested items should only be in the items list if they are in a dragged *selection*
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 1 ) { return md.items.length+' items instead of 1'; }
+ if( !md.items[0].properties ) { return 'no properties'; }
+ if( !md.items[0].properties.foo ) { return 'no properties.foo'; }
+ if( !md.items[0].properties.bar ) { return 'no properties.bar'; }
+ if( md.items[0].properties.foo.length != 1 ) { return 'properties.foo length '+md.items[0].properties.foo.length+' instead of 1'; }
+ if( md.items[0].properties.bar.length != 1 ) { return 'properties.bar length '+md.items[0].properties.bar.length+' instead of 1'; }
+
+ if( !md.items[0].properties.foo[0] ) { return 'properties.foo[0] <i>'+md.items[0].properties.foo[0]+'</i> instead of <i>{properties:{}}</i>'; }
+ if( !md.items[0].properties.foo[0].properties ) { return 'properties.foo[0].properties <i>'+md.items[0].properties.foo[0].properties+'</i> instead of <i>{}</i>'; }
+
+ if( !md.items[0].properties.bar[0] ) { return 'properties.bar[0] <i>'+md.items[0].properties.bar[0]+'</i> instead of <i>{properties:{}}</i>'; }
+ if( !md.items[0].properties.bar[0].properties ) { return 'properties.bar[0].properties <i>'+md.items[0].properties.bar[0].properties+'</i> instead of <i>{}</i>'; }
+ return '';
+}
+
+</script>
+
+<div draggable='true' itemscope></div><div></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/006.html b/testing/web-platform/tests/html/editing/dnd/microdata/006.html
new file mode 100644
index 000000000..ce45f47ed
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/006.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata with type and id</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+
+ orange.appendChild( makeEl('div',{itemprop:'foo',itemscope:'itemscope',itemtype:'http://example.com/',id:'id2',itemid:'http://example.com/bar'},'') );
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 1 ) { return md.items.length+' items instead of 1'; }
+ if( md.items[0].type != orange.getAttribute('itemtype') ) { return 'items[0].type <i>'+md.items[0].type+'</i> instead of <i>'+orange.getAttribute('itemtype')+'</i>'; }
+ if( md.items[0].id != orange.getAttribute('itemid') ) { return 'items[0].id <i>'+md.items[0].id+'</i> instead of <i>'+orange.getAttribute('itemid')+'</i>'; }
+ if( !md.items[0].properties ) { return 'no properties'; }
+ if( !md.items[0].properties.foo ) { return 'no properties.foo'; }
+ if( md.items[0].properties.foo.length != 1 ) { return 'properties.foo length '+md.items[0].properties.foo.length+' instead of 1'; }
+ if( !md.items[0].properties.foo[0] ) { return 'properties.foo[0] <i>'+md.items[0].properties.foo[0]+'</i> instead of <i>{...}</i>'; }
+ if( md.items[0].properties.foo[0].type != orange.firstChild.getAttribute('itemtype') ) { return 'items[0].properties.foo[0].type <i>'+md.items[0].properties.foo[0].type+'</i> instead of <i>'+orange.firstChild.getAttribute('itemtype')+'</i>'; }
+ if( md.items[0].properties.foo[0].id != orange.firstChild.getAttribute('itemid') ) { return 'items[0].properties.foo[0].id <i>'+md.items[0].properties.foo[0].id+'</i> instead of <i>'+orange.firstChild.getAttribute('itemid')+'</i>'; }
+ if( !md.items[0].properties.foo[0].properties ) { return 'properties.foo[0].properties <i>'+md.items[0].properties.foo[0].properties+'</i> instead of <i>{}</i>'; }
+ return '';
+}
+
+</script>
+
+<div draggable='true' itemscope id='id1' itemtype='http://example.org/' itemid='http://example.org/foo'></div><div></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/007.html b/testing/web-platform/tests/html/editing/dnd/microdata/007.html
new file mode 100644
index 000000000..e890d8035
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/007.html
@@ -0,0 +1,116 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata with multiply named item as property</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+
+ orange.appendChild( makeEl('div',{itemprop:'foo bar',itemscope:'itemscope'},'') );
+ orange.lastChild.appendChild( makeEl('div',{itemprop:'baz'},'test') );
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 1 ) { return md.items.length+' items instead of 1'; }
+ if( !md.items[0].properties ) { return 'no properties'; }
+ if( !md.items[0].properties.foo ) { return 'no properties.foo'; }
+ if( !md.items[0].properties.bar ) { return 'no properties.bar'; }
+ if( md.items[0].properties.baz ) { return 'properties.baz should not exist'; }
+ if( md.items[0].properties.foo.length != 1 ) { return 'properties.foo length '+md.items[0].properties.foo.length+' instead of 1'; }
+ if( md.items[0].properties.bar.length != 1 ) { return 'properties.bar length '+md.items[0].properties.bar.length+' instead of 1'; }
+
+ if( !md.items[0].properties.foo[0] ) { return 'properties.foo[1] <i>'+md.items[0].properties.foo[0]+'</i> instead of <i>{properties:{baz:[test]}}</i>'; }
+ if( !md.items[0].properties.foo[0].properties ) { return 'properties.foo[0].properties <i>'+md.items[0].properties.foo[0].properties+'</i> instead of <i>{baz:[test]}</i>'; }
+ if( !md.items[0].properties.foo[0].properties.baz ) { return 'properties.foo[0].properties.baz <i>'+md.items[0].properties.foo[0].properties.baz+'</i> instead of <i>[test]</i>'; }
+ if( !md.items[0].properties.foo[0].properties.baz.length ) { return 'properties.foo[0].properties.baz.length <i>'+md.items[0].properties.foo[0].properties.baz.length+'</i> instead of 1'; }
+ if( md.items[0].properties.foo[0].properties.baz[0] != 'test') { return 'properties.foo[0].properties.baz[0] <i>'+md.items[0].properties.foo[0].properties.baz[0]+'</i> instead of <i>test</i>'; }
+
+ if( !md.items[0].properties.bar[0] ) { return 'properties.bar[1] <i>'+md.items[0].properties.bar[0]+'</i> instead of <i>{properties:{baz:[test]}}</i>'; }
+ if( !md.items[0].properties.bar[0].properties ) { return 'properties.bar[0].properties <i>'+md.items[0].properties.bar[0].properties+'</i> instead of <i>{baz:[test]}</i>'; }
+ if( !md.items[0].properties.bar[0].properties.baz ) { return 'properties.bar[0].properties.baz <i>'+md.items[0].properties.bar[0].properties.baz+'</i> instead of <i>[test]</i>'; }
+ if( !md.items[0].properties.bar[0].properties.baz.length ) { return 'properties.bar[0].properties.baz.length <i>'+md.items[0].properties.bar[0].properties.baz.length+'</i> instead of 1'; }
+ if( md.items[0].properties.bar[0].properties.baz[0] != 'test') { return 'properties.bar[0].properties.baz[0] <i>'+md.items[0].properties.bar[0].properties.baz[0]+'</i> instead of <i>test</i>'; }
+
+ return '';
+}
+
+</script>
+
+<div draggable='true' itemscope></div><div></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/008.html b/testing/web-platform/tests/html/editing/dnd/microdata/008.html
new file mode 100644
index 000000000..00ca61e05
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/008.html
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - no microdata for selection with no items</title>
+<style>
+ body > div {
+ height: 100px;
+ width: 200px;
+ background-color: fuchsia;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ span span {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ top: 116px;
+ }
+ body > div + div + div {
+ background-color: orange;
+ top: 224px;
+ }
+ p:first-of-type {
+ margin-top: 350px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[2];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.previousSibling.ondragenter = orange.previousSibling.ondragleave = orange.previousSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.previousSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items collection'; }
+ if( md.items.length != 0 ) { return 'unexpected items found'; }
+ return '';
+}
+
+</script>
+
+<div></div><div></div><div>01<span>23</span>45<span>67</span>89</div>
+
+<p>Use your pointing device to select the text substring "12345678" above, drag the selection upwards to the pink box,
+then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/009.html b/testing/web-platform/tests/html/editing/dnd/microdata/009.html
new file mode 100644
index 000000000..7ac0a6576
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/009.html
@@ -0,0 +1,98 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata for selection surrounding one item</title>
+<style>
+ body > div {
+ height: 100px;
+ width: 200px;
+ background-color: fuchsia;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ span * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ top: 116px;
+ }
+ body > div + div + div {
+ background-color: orange;
+ top: 224px;
+ }
+ p:first-of-type {
+ margin-top: 350px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[2];
+ orange.childNodes[1].appendChild( makeEl('span',{itemprop:'foo'},'test') );
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.previousSibling.ondragenter = orange.previousSibling.ondragleave = orange.previousSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.previousSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items || md.items.length != 1 ) { return 'no items'; }
+ if( !md.items[0].properties ) { return 'no properties'; }
+ if( !md.items[0].properties.foo ) { return 'no properties.foo'; }
+ if( md.items[0].properties.foo.length != 1 ) { return 'properties.foo length '+md.items[0].properties.foo.length+' instead of 1'; }
+ if( md.items[0].properties.foo[0] != orange.childNodes[1].properties.namedItem('foo').getValues()[0] ) { return 'properties.foo[0] <i>'+md.items[0].properties.foo[0]+'</i> instead of <i>'+orange.childNodes[1].properties.namedItem('foo').getValues()[0]+'</i>'; }
+ return '';
+}
+
+</script>
+
+<div></div><div></div><div>01<span itemscope>23</span>45<span>67</span>89</div>
+
+<p>Use your pointing device to select the text substring "12345678" above, drag the selection upwards to the pink box,
+then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/010.html b/testing/web-platform/tests/html/editing/dnd/microdata/010.html
new file mode 100644
index 000000000..bada1b706
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/010.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata for selection surrounding multiple items</title>
+<style>
+ body > div {
+ height: 100px;
+ width: 200px;
+ background-color: fuchsia;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ span * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ top: 116px;
+ }
+ body > div + div + div {
+ background-color: orange;
+ top: 224px;
+ }
+ p:first-of-type {
+ margin-top: 350px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[2];
+ orange.childNodes[1].appendChild( makeEl('span',{itemprop:'foo'},'test') );
+ orange.childNodes[3].appendChild( makeEl('span',{itemprop:'bar'},'test') );
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.previousSibling.ondragenter = orange.previousSibling.ondragleave = orange.previousSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.previousSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 2 ) { return md.items.length+' items instead of 2'; }
+ if( !md.items[0].properties ) { return 'no items[0].properties'; }
+ if( !md.items[0].properties.foo ) { return 'no items[0].properties.foo'; }
+ if( md.items[0].properties.foo.length != 1 ) { return 'items[0].properties.foo length '+md.items[0].properties.foo.length+' instead of 1'; }
+ if( md.items[0].properties.foo[0] != orange.childNodes[1].properties.namedItem('foo').getValues()[0] ) { return 'items[0].properties.foo[0] <i>'+md.items[0].properties.foo[0]+'</i> instead of <i>'+orange.childNodes[1].properties.namedItem('foo').getValues()[0]+'</i>'; }
+ if( !md.items[1].properties ) { return 'no items[1].properties'; }
+ if( !md.items[1].properties.bar ) { return 'no items[1].properties.bar'; }
+ if( md.items[1].properties.bar.length != 1 ) { return 'items[1].properties.bar length '+md.items[1].properties.bar.length+' instead of 1'; }
+ if( md.items[1].properties.bar[0] != orange.childNodes[1].properties.namedItem('foo').getValues()[0] ) { return 'items[1].properties.bar[0] <i>'+md.items[1].properties.bar[0]+'</i> instead of <i>'+orange.childNodes[1].properties.namedItem('foo').getValues()[0]+'</i>'; }
+ return '';
+}
+
+</script>
+
+<div></div><div></div><div>01<span itemscope>23</span>45<span itemscope>67</span>89</div>
+
+<p>Use your pointing device to select the text substring "12345678" above, drag the selection upwards to the pink box,
+then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/011.html b/testing/web-platform/tests/html/editing/dnd/microdata/011.html
new file mode 100644
index 000000000..04b49992b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/011.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata for selection partially intersecting multiple items</title>
+<style>
+ body > div {
+ height: 100px;
+ width: 200px;
+ background-color: fuchsia;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ span * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ top: 116px;
+ }
+ body > div + div + div {
+ background-color: orange;
+ top: 224px;
+ }
+ p:first-of-type {
+ margin-top: 350px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[2];
+ orange.childNodes[1].appendChild( makeEl('span',{itemprop:'foo'},'test') );
+ orange.childNodes[3].appendChild( makeEl('span',{itemprop:'bar'},'test') );
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.previousSibling.ondragenter = orange.previousSibling.ondragleave = orange.previousSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.previousSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ // http://dev.w3.org/html5/spec/dnd.html#list-of-dragged-nodes
+ //"If it is a selection that is being dragged, then the list of dragged nodes contains, in tree order, every node that is partially or completely included in the selection (including all their ancestors)."
+ //given this "ancestors" situation, what is to stop every item in the body from being included? oversight perhaps? tests 18-20 cover this more extensively
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 2 ) { return md.items.length+' items instead of 2'; }
+ if( !md.items[0].properties ) { return 'no items[0].properties'; }
+ if( !md.items[0].properties.foo ) { return 'no items[0].properties.foo'; }
+ if( md.items[0].properties.foo.length != 1 ) { return 'items[0].properties.foo length '+md.items[0].properties.foo.length+' instead of 1'; }
+ if( md.items[0].properties.foo[0] != orange.childNodes[1].properties.namedItem('foo').getValues()[0] ) { return 'items[0].properties.foo[0] <i>'+md.items[0].properties.foo[0]+'</i> instead of <i>'+orange.childNodes[1].properties.namedItem('foo').getValues()[0]+'</i>'; }
+ if( !md.items[1].properties ) { return 'no items[1].properties'; }
+ if( !md.items[1].properties.bar ) { return 'no items[1].properties.bar'; }
+ if( md.items[1].properties.bar.length != 1 ) { return 'items[1].properties.bar length '+md.items[1].properties.bar.length+' instead of 1'; }
+ if( md.items[1].properties.bar[0] != orange.childNodes[1].properties.namedItem('foo').getValues()[0] ) { return 'items[1].properties.bar[0] <i>'+md.items[1].properties.bar[0]+'</i> instead of <i>'+orange.childNodes[1].properties.namedItem('foo').getValues()[0]+'</i>'; }
+ return '';
+}
+
+</script>
+
+<div></div><div></div><div>01<span itemscope>23</span>45<span itemscope>67</span>89</div>
+
+<p>Use your pointing device to select the text substring "3456" above, drag the selection upwards to the pink box,
+then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/012.html b/testing/web-platform/tests/html/editing/dnd/microdata/012.html
new file mode 100644
index 000000000..c09453faa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/012.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata for selection surrounding nested property items</title>
+<style>
+ body > div {
+ height: 100px;
+ width: 200px;
+ background-color: fuchsia;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ span * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ top: 116px;
+ }
+ body > div + div + div {
+ background-color: orange;
+ top: 224px;
+ }
+ p:first-of-type {
+ margin-top: 350px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[2];
+ orange.childNodes[1].appendChild( makeEl('span',{itemscope:'itemscope',itemprop:'foo'},'test') );
+ orange.childNodes[1].lastChild.appendChild( makeEl('span',{itemprop:'bar'},'test') );
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.previousSibling.ondragenter = orange.previousSibling.ondragleave = orange.previousSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.previousSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ //items should be represented at the top level only if they do not have the itemprop attribute
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 1 ) { return md.items.length+' items instead of 1'; }
+ if( !md.items[0].properties ) { return 'no items[0].properties'; }
+ if( !md.items[0].properties.foo ) { return 'no items[0].properties.foo'; }
+ if( md.items[0].properties.foo.length != 1 ) { return 'items[0].properties.foo length '+md.items[0].properties.foo.length+' instead of 1'; }
+ if( !md.items[0].properties.foo[0].properties ) { return 'items[1].properties.foo[0].properties <i>'+md.items[0].properties.foo[0].properties+'</i> instead of <i>{bar:[test]}</i>'; }
+ if( !md.items[0].properties.foo[0].properties.bar ) { return 'items[1].properties.foo[0].properties.bar <i>'+md.items[0].properties.foo[0].properties.bar+'</i> instead of <i>[test]</i>'; }
+ if( md.items[0].properties.foo[0].properties.bar.length != 1 ) { return 'items[1].properties.foo[0].properties.bar.length <i>'+md.items[0].properties.foo[0].properties.bar.length+'</i> instead of 1'; }
+ if( md.items[0].properties.foo[0].properties.bar[0] != 'test') { return 'items[1].properties.foo[0].properties.bar[0] <i>'+md.items[0].properties.foo[0].properties.bar[0]+'</i> instead of <i>test</i>'; }
+ return '';
+}
+
+</script>
+
+<div></div><div></div><div>01<span itemscope>23</span>45<span itemscope itemprop="baz">67</span>89</div>
+
+<p>Use your pointing device to select the text substring "12345678" above, drag the selection upwards to the pink box,
+then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/013.html b/testing/web-platform/tests/html/editing/dnd/microdata/013.html
new file mode 100644
index 000000000..67f3b31f2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/013.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata for selection surrounding nested non-property items</title>
+<style>
+ body > div {
+ height: 100px;
+ width: 200px;
+ background-color: fuchsia;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ span * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ top: 116px;
+ }
+ body > div + div + div {
+ background-color: orange;
+ top: 224px;
+ }
+ p:first-of-type {
+ margin-top: 350px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[2];
+ orange.childNodes[1].appendChild( makeEl('span',{itemscope:'itemscope'},'test') );
+ orange.childNodes[1].lastChild.appendChild( makeEl('span',{itemprop:'bar'},'test') );
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.previousSibling.ondragenter = orange.previousSibling.ondragleave = orange.previousSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.previousSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ //*all* items should be represented at the top level, even if they are nested
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 2 ) { return md.items.length+' items instead of 2'; }
+ if( !md.items[0].properties ) { return 'no items[0].properties'; }
+ if( md.items[0].properties.bar ) { return 'unexpected items[0].properties.bar'; }
+
+ if( !md.items[1].properties ) { return 'no items[1].properties'; }
+ if( !md.items[1].properties.bar ) { return 'no items[1].properties.bar'; }
+ if( md.items[1].properties.bar.length != 1 ) { return 'items[1].properties.bar length '+md.items[1].properties.bar.length+' instead of 1'; }
+ if( md.items[1].properties.bar[0] != 'test' ) { return 'items[1].properties.bar[0] <i>'+md.items[1].properties.bar[0]+'</i> instead of <i>test</i>'; }
+ return '';
+}
+
+</script>
+
+<div></div><div></div><div>01<span itemscope>23</span>45<span>67</span>89</div>
+
+<p>Use your pointing device to select the text substring "12345678" above, drag the selection upwards to the pink box,
+then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/014.html b/testing/web-platform/tests/html/editing/dnd/microdata/014.html
new file mode 100644
index 000000000..bd0b84c2f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/014.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata with sibling itemref loop</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div *, span {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ // http://dev.w3.org/html5/md/#extracting-json
+ //"check if the element is a top-level microdata item, and if it is"
+ //as it has itemprop, it is not a top-level item, and should be ignored
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 0 ) { return md.items.length+' items instead of 0'; }
+ return '';
+}
+
+</script>
+
+<div draggable='true' itemscope itemprop='foo' id='id1' itemref='id2'></div><div id='id2' itemprop='bar' itemscope itemref='id1'></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/015.html b/testing/web-platform/tests/html/editing/dnd/microdata/015.html
new file mode 100644
index 000000000..597a9e405
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/015.html
@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata with parent itemref loop</title>
+<style>
+ blockquote > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ blockquote > div *, span {
+ display: none;
+ }
+ blockquote > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ blockquote > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ // http://dev.w3.org/html5/md/#extracting-json
+ //"check if the element is a top-level microdata item, and if it is"
+ //as it has itemprop, it is not a top-level item, and should be ignored
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 0 ) { return md.items.length+' items instead of 0'; }
+ return '';
+}
+
+</script>
+
+<blockquote id='id1' itemprop='bar' itemscope>
+<div draggable='true' itemscope itemprop='foo' itemref='id1'></div><div></div><div></div>
+</blockquote>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/016.html b/testing/web-platform/tests/html/editing/dnd/microdata/016.html
new file mode 100644
index 000000000..4d37d65a2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/016.html
@@ -0,0 +1,160 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata with nested sibling itemref loop</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div *, span {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ // http://dev.w3.org/html5/md/#extracting-json
+ //"If value is an item, then: If value is in memory, then let value be the string "ERROR"."
+ /*
+Loop detection happens only after the loop has been created, at which point it returns a property value
+of "ERROR" instead of the value which has already been encountered on the stringifying stack.
+Should create the following construct:
+{
+ items:[
+ {
+ properties:{
+ foo:[
+ {
+ properties:{
+ bar:[
+ {
+ properties:{
+ foo:[
+ "ERROR"
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ],
+ bar:[
+ {
+ properties:{
+ foo:[
+ {
+ properties:{
+ bar:[
+ "ERROR"
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+}
+ */
+
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 1 ) { return md.items.length+' items instead of 1'; }
+ if( !md.items[0].properties ) { return 'no items[0].properties'; }
+ if( !md.items[0].properties.foo ) { return 'no items[0].properties.foo'; }
+ if( md.items[0].properties.foo.length != 1 ) { return 'items[0].properties.foo length '+md.items[0].properties.foo.length+' instead of 1'; }
+ if( !md.items[0].properties.foo[0].properties ) { return 'items[1].properties.foo[0].properties <i>'+md.items[0].properties.foo[0].properties+'</i> instead of object'; }
+ if( !md.items[0].properties.foo[0].properties.bar ) { return 'items[1].properties.foo[0].properties.bar <i>'+md.items[0].properties.foo[0].properties.bar+'</i> instead of array'; }
+ if( md.items[0].properties.foo[0].properties.bar.length != 1 ) { return 'items[1].properties.foo[0].properties.bar.length <i>'+md.items[0].properties.foo[0].properties.bar.length+'</i> instead of 1'; }
+ if( !md.items[0].properties.foo[0].properties.bar[0].properties ) { return 'items[1].properties.foo[0].properties.bar[0].properties <i>'+md.properties.foo[0].properties.bar[0].properties+'</i> instead of object'; }
+ if( !md.items[0].properties.foo[0].properties.bar[0].properties.foo ) { return 'items[1].properties.foo[0].properties.bar[0].properties.foo <i>'+md.items[0].properties.foo[0].properties.bar[0].properties.foo+'</i> instead of array'; }
+ if( md.items[0].properties.foo[0].properties.bar[0].properties.foo.length != 1 ) { return 'items[1].properties.foo[0].properties.bar[0].properties.foo.length <i>'+md.items[0].properties.foo[0].properties.bar[0].properties.foo.length+'</i> instead of 1'; }
+ if( md.items[0].properties.foo[0].properties.bar[0].properties.foo[0] != 'ERROR' ) { return 'items[1].properties.foo[0].properties.bar[0].properties.foo.length <i>'+md.items[0].properties.foo[0].properties.bar[0].properties.foo[0]+'</i> instead of <i>ERROR</a>'; }
+
+ if( !md.items[0].properties.bar ) { return 'no items[0].properties.bar'; }
+ if( md.items[0].properties.bar.length != 1 ) { return 'items[0].properties.bar length '+md.items[0].properties.bar.length+' instead of 1'; }
+ if( !md.items[0].properties.bar[0].properties ) { return 'items[1].properties.bar[0].properties <i>'+md.items[0].properties.bar[0].properties+'</i> instead of object'; }
+ if( !md.items[0].properties.bar[0].properties.foo ) { return 'items[1].properties.bar[0].properties.foo <i>'+md.items[0].properties.bar[0].properties.foo+'</i> instead of array'; }
+ if( md.items[0].properties.bar[0].properties.foo.length != 1 ) { return 'items[1].properties.bar[0].properties.foo.length <i>'+md.items[0].properties.bar[0].properties.foo.length+'</i> instead of 1'; }
+ if( !md.items[0].properties.bar[0].properties.foo[0].properties ) { return 'items[1].properties.bar[0].properties.foo[0].properties <i>'+md.properties.bar[0].properties.foo[0].properties+'</i> instead of object'; }
+ if( !md.items[0].properties.bar[0].properties.foo[0].properties.bar ) { return 'items[1].properties.bar[0].properties.foo[0].properties.bar <i>'+md.items[0].properties.bar[0].properties.foo[0].properties.bar+'</i> instead of array'; }
+ if( md.items[0].properties.bar[0].properties.foo[0].properties.bar.length != 1 ) { return 'items[1].properties.bar[0].properties.foo[0].properties.bar.length <i>'+md.items[0].properties.bar[0].properties.foo[0].properties.bar.length+'</i> instead of 1'; }
+ if( md.items[0].properties.bar[0].properties.foo[0].properties.bar[0] != 'ERROR' ) { return 'items[1].properties.bar[0].properties.foo[0].properties.bar.length <i>'+md.items[0].properties.bar[0].properties.foo[0].properties.bar[0]+'</i> instead of <i>ERROR</a>'; }
+ return '';
+}
+
+</script>
+
+<div draggable='true' itemscope><div itemscope itemprop='foo' id='id1' itemref='id2'></div><div itemscope itemprop='bar' id='id2' itemref='id1'></div></div><div></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/017.html b/testing/web-platform/tests/html/editing/dnd/microdata/017.html
new file mode 100644
index 000000000..378c7c979
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/017.html
@@ -0,0 +1,137 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata with nested parent itemref loop</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div *, span {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ // http://dev.w3.org/html5/md/#extracting-json
+ //"If value is an item, then: If value is in memory, then let value be the string "ERROR"."
+ /*
+Loop detection happens only after the loop has been created, at which point it returns a property value
+of "ERROR" instead of the value which has already been encountered on the stringifying stack.
+Should create the following construct:
+{
+ items:[
+ {
+ properties:{
+ foo:[
+ {
+ properties:{
+ bar:[
+ {
+ properties:{
+ foo:[
+ "ERROR"
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+}
+ */
+
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 1 ) { return md.items.length+' items instead of 1'; }
+ if( !md.items[0].properties ) { return 'no items[0].properties'; }
+ if( !md.items[0].properties.foo ) { return 'no items[0].properties.foo'; }
+ if( md.items[0].properties.foo.length != 1 ) { return 'items[0].properties.foo length '+md.items[0].properties.foo.length+' instead of 1'; }
+ if( !md.items[0].properties.foo[0].properties ) { return 'items[1].properties.foo[0].properties <i>'+md.items[0].properties.foo[0].properties+'</i> instead of object'; }
+ if( !md.items[0].properties.foo[0].properties.bar ) { return 'items[1].properties.foo[0].properties.bar <i>'+md.items[0].properties.foo[0].properties.bar+'</i> instead of array'; }
+ if( md.items[0].properties.foo[0].properties.bar.length != 1 ) { return 'items[1].properties.foo[0].properties.bar.length <i>'+md.items[0].properties.foo[0].properties.bar.length+'</i> instead of 1'; }
+ if( !md.items[0].properties.foo[0].properties.bar[0].properties ) { return 'items[1].properties.foo[0].properties.bar[0].properties <i>'+md.properties.foo[0].properties.bar[0].properties+'</i> instead of object'; }
+ if( !md.items[0].properties.foo[0].properties.bar[0].properties.foo ) { return 'items[1].properties.foo[0].properties.bar[0].properties.foo <i>'+md.items[0].properties.foo[0].properties.bar[0].properties.foo+'</i> instead of array'; }
+ if( md.items[0].properties.foo[0].properties.bar[0].properties.foo.length != 1 ) { return 'items[1].properties.foo[0].properties.bar[0].properties.foo.length <i>'+md.items[0].properties.foo[0].properties.bar[0].properties.foo.length+'</i> instead of 1'; }
+ if( md.items[0].properties.foo[0].properties.bar[0].properties.foo[0] != 'ERROR' ) { return 'items[1].properties.foo[0].properties.bar[0].properties.foo.length <i>'+md.items[0].properties.foo[0].properties.bar[0].properties.foo[0]+'</i> instead of <i>ERROR</a>'; }
+ return '';
+}
+
+</script>
+
+<div draggable='true' itemscope>
+ <span id='id1' itemprop='foo' itemscope><span itemscope itemprop='bar' itemref='id1'></span></span>
+</div><div></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/018.html b/testing/web-platform/tests/html/editing/dnd/microdata/018.html
new file mode 100644
index 000000000..2dcaeaa75
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/018.html
@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata for selection partially intersecting a single item</title>
+<style>
+ body > div {
+ height: 100px;
+ width: 200px;
+ background-color: fuchsia;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: navy;
+ top: 116px;
+ }
+ body > div + div + div {
+ background-color: orange;
+ top: 224px;
+ }
+ p:first-of-type {
+ margin-top: 350px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[2];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.previousSibling.ondragenter = orange.previousSibling.ondragleave = orange.previousSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.previousSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ // http://dev.w3.org/html5/spec/dnd.html#list-of-dragged-nodes
+ //"If it is a selection that is being dragged, then the list of dragged nodes contains, in tree order, every node that is partially or completely included in the selection (including all their ancestors)."
+ //this test checks that the parent of the text node is included
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 1 ) { return md.items.length+' items instead of 1'; }
+ if( md.items[0].id != 'http://example.com/item1' ) { return 'items[0].id incorrect'; }
+ return '';
+}
+
+</script>
+
+<div></div><div></div><div itemscope itemid="http://example.com/item1">abc</div>
+
+<p>Use your pointing device to select the text substring "b" above, drag the selection upwards to the pink box,
+then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/019.html b/testing/web-platform/tests/html/editing/dnd/microdata/019.html
new file mode 100644
index 000000000..95224174c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/019.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata for selection partially intersecting nested items</title>
+<style>
+ body > div {
+ height: 100px;
+ width: 200px;
+ background-color: fuchsia;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: navy;
+ top: 116px;
+ }
+ body > div + div + div {
+ background-color: orange;
+ top: 224px;
+ }
+ p:first-of-type {
+ margin-top: 350px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[2];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.previousSibling.ondragenter = orange.previousSibling.ondragleave = orange.previousSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.previousSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ // http://dev.w3.org/html5/spec/dnd.html#list-of-dragged-nodes
+ //"If it is a selection that is being dragged, then the list of dragged nodes contains, in tree order, every node that is partially or completely included in the selection (including all their ancestors)."
+ //this test checks that all ancestors of the text node are included
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 2 ) { return md.items.length+' items instead of 2'; }
+ if( md.items[0].id != 'http://example.com/item1' ) { return 'items[0].id incorrect'; }
+ if( md.items[1].id != 'http://example.com/item2' ) { return 'items[1].id incorrect'; }
+ return '';
+}
+
+</script>
+
+<div></div><div></div><div itemscope itemid="http://example.com/item1">a<span itemscope itemid="http://example.com/item2">bcd</span>e</div>
+
+<p>Use your pointing device to select the text substring "d" above, drag the selection upwards to the pink box,
+then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/020.html b/testing/web-platform/tests/html/editing/dnd/microdata/020.html
new file mode 100644
index 000000000..007aecc3a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/020.html
@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata for selection partially intersecting multiple items but not siblings</title>
+<style>
+ body > div {
+ height: 100px;
+ width: 400px;
+ background-color: fuchsia;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: navy;
+ top: 116px;
+ }
+ body > div + div + div {
+ background-color: orange;
+ top: 224px;
+ }
+ p:first-of-type {
+ margin-top: 350px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[2];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.previousSibling.ondragenter = orange.previousSibling.ondragleave = orange.previousSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.previousSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ // http://dev.w3.org/html5/spec/dnd.html#list-of-dragged-nodes
+ //"If it is a selection that is being dragged, then the list of dragged nodes contains, in tree order, every node that is partially or completely included in the selection (including all their ancestors)."
+ //this test checks that all ancestors of the selection's end points are included, and all elements enclosed by the selection are included, but no non-selected siblings of ancestors are included
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 5 ) { return md.items.length+' items instead of 5'; }
+ if( md.items[0].id != 'http://example.com/item1' ) { return 'items[0].id incorrect'; }
+ if( md.items[1].id != 'http://example.com/item4' ) { return 'items[1].id incorrect'; }
+ if( md.items[2].id != 'http://example.com/item5' ) { return 'items[2].id incorrect'; }
+ if( md.items[3].id != 'http://example.com/item6' ) { return 'items[3].id incorrect'; }
+ if( md.items[4].id != 'http://example.com/item7' ) { return 'items[4].id incorrect'; }
+ return '';
+}
+
+</script>
+
+<div></div><div></div><div itemscope itemid="http://example.com/item1"><span itemscope itemid="http://example.com/item2">ab<span itemscope itemid="http://example.com/item3">cd</span>ef</span><span itemscope itemid="http://example.com/item4">gh<span itemscope itemid="http://example.com/item5">ij</span>kl</span><span itemscope itemid="http://example.com/item6">mn<span itemscope itemid="http://example.com/item7">op</span>qr</span><span itemscope itemid="http://example.com/item8">st<span itemscope itemid="http://example.com/item9">uv</span>wx</span></div>
+
+<p>Use your pointing device to select the text substring "hijklmnopq" above, drag the selection upwards to the pink box,
+then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/021.html b/testing/web-platform/tests/html/editing/dnd/microdata/021.html
new file mode 100644
index 000000000..792e3e2ce
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/021.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - microdata when addElement is used</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div * {
+ display: none;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+function makeEl(eltype,props,contents) {
+ var elem = document.createElement(eltype);
+ for( var i in props ) {
+ if( props.hasOwnProperty(i) ) {
+ elem.setAttribute(i,props[i]);
+ }
+ }
+ if( contents ) {
+ elem.innerHTML = contents;
+ }
+ return elem;
+}
+
+var orange, fails = [], doneonce = false;
+window.onload = function() {
+ orange = document.getElementsByTagName('div')[0];
+
+ orange.appendChild( makeEl('div',{itemprop:'foo'},'test') );
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.addElement(document.getElementById('side1'));
+ e.dataTransfer.addElement(document.getElementById('side2'));
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ };
+ orange.nextSibling.ondragenter = orange.nextSibling.ondragleave = orange.nextSibling.ondragover =
+ orange.ondrag = orange.ondragend = function(e) {
+ if( e.type == 'dragover' || e.type == 'dragenter' ) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ if( e.dataTransfer.getData('application/microdata+json') ) {
+ fails[fails.length] = e.type + ' unexpectedly had microdata (security restriction)';
+ }
+ };
+ orange.nextSibling.ondrop = function(e) {
+ var err;
+ if( err = checkprops(e.dataTransfer.getData('application/microdata+json')) ) {
+ fails[fails.length] = e.type + ' ' + err;
+ }
+ if( e.type != 'drop' ) { return; }
+ if( doneonce ) { return; }
+ doneonce = true;
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL: ' + fails.join('<br>') ) : 'PASS';
+ fails = [];
+ }, 200 );
+ };
+
+};
+function checkprops(md) {
+ var i;
+ if( !md ) { return 'no microdata'; }
+ md = JSON.parse(md);
+ if( !md.items ) { return 'no items'; }
+ if( md.items.length != 1 ) { return 'items.length '+md.items.length+' instead of 1'; }
+ if( !md.items[0].properties ) { return 'no properties'; }
+ if( !md.items[0].properties.foo ) { return 'no properties.foo'; }
+ if( md.items[0].properties.bar ) { return 'unexpected properties.bar'; }
+ if( md.items[0].properties.foo.length != 1 ) { return 'properties.foo length '+md.items[0].properties.foo.length+' instead of 1'; }
+ if( md.items[0].properties.foo[0] != orange.properties.namedItem('foo').getValues()[0] ) { return 'properties.foo[0] <i>'+md.items[0].properties.foo[0]+'</i> instead of <i>'+orange.properties.namedItem('foo').getValues()[0]+'</i>'; }
+ return '';
+}
+
+</script>
+
+<div draggable='true' itemscope></div><div></div><div></div>
+<h4 itemscope id="side1">xxx</h4><h4 itemprop="bar" id="side2">yyy</h4>
+
+<p>Use your pointing device to drag the orange box to the pink box, then back to the blue box, and release it.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/microdata/test b/testing/web-platform/tests/html/editing/dnd/microdata/test
new file mode 100644
index 000000000..42d41d980
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/microdata/test
@@ -0,0 +1,2 @@
+<!doctype html>
+<!-- The tests in this folder point to this file in e.g. <img src> -->
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/001-1.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/001-1.xhtml
new file mode 100644
index 000000000..631753421
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/001-1.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+html, body
+ {height:100%;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('body').appendChild(c);}
+</script>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false" ondrop="addImage(event)">
+<p>Drop canvas now, it should be copied to this page once you drop it here.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/001.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/001.xhtml
new file mode 100644
index 000000000..8c297c203
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/001.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Canvas cross page drag and drop</title>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/uri-list', document.querySelector('canvas').toDataURL('image/png'));
+ window.location = '001-1.xhtml';}
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)">Canvas</canvas>
+</p>
+<p>Drag canvas pattern. You should be redirected to the new page and be able to drop it there.</p>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/002.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/002.xhtml
new file mode 100644
index 000000000..252bf33ba
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/002.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>PNG image cross page drag and drop</title>
+<style type="text/css">
+img
+ {margin:0 2px;}
+</style>
+</head>
+<body>
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = 'helper-drop-image-now.xhtml'" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag circle above. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/003.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/003.xhtml
new file mode 100644
index 000000000..89c53d381
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/003.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>SVG image cross page drag and drop</title>
+</head>
+<body>
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = 'helper-drop-image-now.xhtml'" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="PNG circle"/></p>
+<p>Drag circle above. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/004.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/004.xhtml
new file mode 100644
index 000000000..9cd885de3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/004.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Text input selection cross page drag and drop</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = 'helper-drop-now.xhtml'"/></p>
+<p>Drag selected text. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/005.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/005.xhtml
new file mode 100644
index 000000000..887ae3931
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/005.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection cross page drag and drop</title>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = 'helper-drop-now.xhtml'">Drag me</p>
+<p>Drag selected text. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/006.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/006.xhtml
new file mode 100644
index 000000000..4cb8d3e1c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/006.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link cross page drag and drop</title>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = 'helper-drop-link-now.xhtml'">Drag me</a></p>
+<p>Drag link above. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/007-1.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/007-1.xhtml
new file mode 100644
index 000000000..a1c982e72
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/007-1.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+html, body
+ {height:100%;}
+</style>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false" ondrop="event.preventDefault();document.querySelector('p').firstChild.nodeValue = event.dataTransfer.getData('text/plain')">
+<p>Drop box now, you should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/007.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/007.xhtml
new file mode 100644
index 000000000..5cabbbd3e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/007.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop with text/plain data</title>
+<style type="text/css">
+div[ondragstart]
+ {width:40px;
+ min-height:40px;
+ margin-top:20px;
+ padding:40px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div draggable="true" ondragstart="event.dataTransfer.effectAllowed = 'copy';event.dataTransfer.setData('text/plain','PASS');window.location = '007-1.xhtml'"/>
+<p>Drag blue box. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/008-1.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/008-1.xhtml
new file mode 100644
index 000000000..218b5873f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/008-1.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+html, body
+ {height:100%;}
+</style>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false" ondrop="event.preventDefault();document.querySelector('p').firstChild.nodeValue = event.dataTransfer.getData('text/uri-list').substr(16,4)">
+<p>Drop box now, you should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/008.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/008.xhtml
new file mode 100644
index 000000000..11b29a8f4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/008.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop with text/uri-list data</title>
+<style type="text/css">
+div[ondragstart]
+ {width:40px;
+ min-height:40px;
+ margin-top:20px;
+ padding:40px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div draggable="true" ondragstart="event.dataTransfer.effectAllowed = 'copy';event.dataTransfer.setData('text/uri-list','data:text/plain,PASS');window.location = '008-1.xhtml'"/>
+<p>Drag blue box. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/009-1.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/009-1.xhtml
new file mode 100644
index 000000000..8604fd534
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/009-1.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+html, body
+ {height:100%;}
+</style>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="window.location = 'helper-drop-link-now.xhtml'">
+<p>Don't drop link yet, you should be redirected to another page.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/009.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/009.xhtml
new file mode 100644
index 000000000..b93cdff31
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/009.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop through three pages</title>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = '009-1.xhtml'">Drag me</a></p>
+<p>Drag link above. You should be redirected to the new page.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/010-1.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/010-1.xhtml
new file mode 100644
index 000000000..620f1af87
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/010-1.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+div[ondragenter]
+ {margin:200px 0 0 200px;
+ width:200px;
+ height:100px;
+ color:white;
+ background-color:navy;}
+div[ondragenter]:before
+ {display:block;
+ content:"";
+ border-style:solid;
+ position:relative;
+ top:-50px;
+ left:-200px;
+ border-width:100px;
+ border-color:transparent navy transparent transparent;}
+</style>
+</head>
+<body>
+<p>Drag link to the blue arrow but don't drop it yet. You should be returned back to start page.</p>
+<div ondragenter="event.preventDefault()" ondragover="history.go(-1)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/010.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/010.xhtml
new file mode 100644
index 000000000..0af5b258f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/010.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop and history navigation roundtrip</title>
+<script type="application/ecmascript">
+function checkLink(event)
+ {document.querySelector('a').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = '010-1.xhtml'" ondragenter="event.preventDefault()" ondrop="checkLink(event)" ondragover="return false">Drag me around and drop here once you return back</a></p>
+<p>Drag link around. You will be redirected to new page. When you return back drop link on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/011-1.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/011-1.xhtml
new file mode 100644
index 000000000..85f016441
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/011-1.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+div[ondragenter]
+ {margin:200px 0 0 200px;
+ width:200px;
+ height:100px;
+ color:white;
+ background-color:navy;}
+div[ondragenter]:before
+ {display:block;
+ content:"";
+ border-style:solid;
+ position:relative;
+ top:-50px;
+ left:-200px;
+ border-width:100px;
+ border-color:transparent navy transparent transparent;}
+</style>
+</head>
+<body>
+<p>Drag canvas to the blue arrow but don't drop it yet. You should be returned back to start page.</p>
+<div ondragenter="event.preventDefault()" ondragover="history.go(-1)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/011.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/011.xhtml
new file mode 100644
index 000000000..a4d86a1d2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/011.xhtml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Canvas drag and drop and history navigation roundtrip</title>
+<style type="text/css">
+img
+ {margin:0 2px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('p').appendChild(c);}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/uri-list', document.querySelector('canvas').toDataURL('image/png'));
+ window.location = '011-1.xhtml'}
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)" ondragenter="event.preventDefault()" ondragover="return false" ondrop="addImage(event)">Canvas</canvas>
+</p>
+<p>Drag canvas around. You will be redirected to new page. When you return back drop canvas on itself. It should be duplicated once you drop it.</p>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/012.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/012.xhtml
new file mode 100644
index 000000000..842b75fa6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/012.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>PNG image drag and drop and history navigation roundtrip</title>
+<style type="text/css">
+img
+ {margin:0 2px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('p').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = 'helper-drag-image-dont-drop.xhtml'" ondragenter="event.preventDefault()" ondrop="addImage(event)" ondragover="return false" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag circle around. You will be redirected to new page. When you return back drop circle on itself. It should be duplicated once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/013.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/013.xhtml
new file mode 100644
index 000000000..59d48a041
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/013.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>SVG image drag and drop and history navigation roundtrip</title>
+<style type="text/css">
+img
+ {margin:0 2px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('p').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = 'helper-drag-image-dont-drop.xhtml'" ondragenter="event.preventDefault()" ondrop="addImage(event)" ondragover="return false" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle"/></p>
+<p>Drag circle around. You will be redirected to new page. When you return back drop circle on itself. It should be duplicated once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/014.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/014.xhtml
new file mode 100644
index 000000000..589679775
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/014.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Text input selection drag and drop and history navigation roundtrip</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragstart="window.location = 'helper-drag-selection-dont-drop.xhtml'" ondragenter="event.preventDefault()" ondragover="return false" ondrop="event.preventDefault();this.value = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'"/></p>
+<p>Drag selected text around. You will be redirected to new page. When you return back drop selection on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/015.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/015.xhtml
new file mode 100644
index 000000000..cb194a52c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/015.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop and history navigation roundtrip</title>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('span'))">
+<p><span ondragstart="window.location = 'helper-drag-selection-dont-drop.xhtml'" ondragenter="event.preventDefault()" ondragover="return false" ondrop="document.querySelector('span').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">Drag me</span></p>
+<p>Drag selected text around. You will be redirected to new page. When you return back drop selection on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/016-1.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/016-1.xhtml
new file mode 100644
index 000000000..5e25edaad
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/016-1.xhtml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+p
+ {border:solid medium navy;
+ height:200px;
+ padding:1em;
+ margin:0;}
+div
+ {margin:100px;
+ padding:50px;}
+img
+ {display:block;
+ margin:1em;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('p').appendChild(c);}
+</script>
+</head>
+<body>
+<div ondragenter="window.location.reload()">
+<p ondragenter="event.stopPropagation()" dropzone="copy string:text/uri-list" ondrop="addImage(event)">Drop canvas here, it should be copied to this page once you drop it here.</p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/016.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/016.xhtml
new file mode 100644
index 000000000..1ac642fe1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/016.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during canvas cross page drag and drop</title>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/uri-list', document.querySelector('canvas').toDataURL('image/png'));
+ window.location = '016-1.xhtml';}
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)">Canvas</canvas>
+</p>
+<p>Drag canvas pattern. You should be redirected to the new page and be able to drop it there.</p>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/017.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/017.xhtml
new file mode 100644
index 000000000..36b8987a2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/017.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during PNG image cross page drag and drop</title>
+<style type="text/css">
+img
+ {margin:0 2px;}
+</style>
+</head>
+<body>
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = 'helper-drop-here-reload.xhtml'" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag circle above. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/018.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/018.xhtml
new file mode 100644
index 000000000..b8849c4a3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/018.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during SVG image cross page drag and drop</title>
+</head>
+<body>
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = 'helper-drop-here-reload.xhtml'" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="PNG circle"/></p>
+<p>Drag circle above. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/019.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/019.xhtml
new file mode 100644
index 000000000..f09041604
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/019.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during text input selection cross page drag and drop</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = 'helper-drop-selection-here.xhtml'"/></p>
+<p>Drag selected text. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/020.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/020.xhtml
new file mode 100644
index 000000000..cf653bcad
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/020.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during selection cross page drag and drop</title>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = 'helper-drop-selection-here.xhtml'">Drag me</p>
+<p>Drag selected text. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/021-1.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/021-1.xhtml
new file mode 100644
index 000000000..e38204ca4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/021-1.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+p
+ {border:solid medium navy;
+ height:200px;
+ padding:1em;
+ margin:0;}
+div
+ {margin:100px;
+ padding:50px;}
+</style>
+<script type="application/ecmascript">
+function checkLink(event)
+ {document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'}
+</script>
+</head>
+<body>
+<div ondragenter="window.location.reload()">
+<p ondragenter="event.stopPropagation()" dropzone="copy string:text/uri-list" ondrop="checkLink(event)">Drop link here, you should see word PASS once you drop it.</p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/021.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/021.xhtml
new file mode 100644
index 000000000..5c7fad0ca
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/021.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during link cross page drag and drop</title>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location = '021-1.xhtml'">Drag me</a></p>
+<p>Drag link above. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/022-1.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/022-1.xhtml
new file mode 100644
index 000000000..ff96e273b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/022-1.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+p
+ {border:solid medium navy;
+ height:200px;
+ padding:1em;
+ margin:0;}
+div
+ {margin:100px;
+ padding:50px;}
+</style>
+</head>
+<body>
+<div ondragenter="window.location.reload()">
+<p ondragenter="event.stopPropagation()" dropzone="copy string:text/plain" ondrop="event.preventDefault();document.querySelector('p').firstChild.nodeValue = event.dataTransfer.getData('text/plain')">Drop box here, you should see word PASS once you drop it.</p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/022.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/022.xhtml
new file mode 100644
index 000000000..70aa3d93b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/022.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during cross page drag and drop with text/plain data</title>
+<style type="text/css">
+div[ondragstart]
+ {width:40px;
+ min-height:40px;
+ margin-top:20px;
+ padding:40px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div draggable="true" ondragstart="event.dataTransfer.effectAllowed = 'copy';event.dataTransfer.setData('text/plain','PASS');window.location = '022-1.xhtml'"/>
+<p>Drag blue box. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/023-1.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/023-1.xhtml
new file mode 100644
index 000000000..29f51732f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/023-1.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+p
+ {border:solid medium navy;
+ height:200px;
+ padding:1em;
+ margin:0;}
+div
+ {margin:100px;
+ padding:50px;}
+</style>
+</head>
+<body>
+<div ondragenter="window.location.reload()">
+<p ondragenter="event.stopPropagation()" dropzone="copy string:text/uri-list" ondrop="event.preventDefault();document.querySelector('p').firstChild.nodeValue = event.dataTransfer.getData('text/uri-list').substr(16,4)">Drop box here, you should see word PASS once you drop it.</p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/023.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/023.xhtml
new file mode 100644
index 000000000..eb286ace8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/023.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during cross page drag and drop with text/uri-list data</title>
+<style type="text/css">
+div[ondragstart]
+ {width:40px;
+ min-height:40px;
+ margin-top:20px;
+ padding:40px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div draggable="true" ondragstart="event.dataTransfer.effectAllowed = 'copy';event.dataTransfer.setData('text/uri-list','data:text/plain,PASS');window.location = '023-1.xhtml'"/>
+<p>Drag blue box. You should be redirected to the new page and be able to drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/helper-drag-image-dont-drop.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drag-image-dont-drop.xhtml
new file mode 100644
index 000000000..883649e43
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drag-image-dont-drop.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+div[ondragenter]
+ {margin:200px 0 0 200px;
+ width:200px;
+ height:100px;
+ color:white;
+ background-color:navy;}
+div[ondragenter]:before
+ {display:block;
+ content:"";
+ border-style:solid;
+ position:relative;
+ top:-50px;
+ left:-200px;
+ border-width:100px;
+ border-color:transparent navy transparent transparent;}
+</style>
+</head>
+<body>
+<p>Drag image to the blue arrow but don't drop it yet. You should be returned back to start page.</p>
+<div ondragenter="event.preventDefault()" ondragover="history.go(-1)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/helper-drag-selection-dont-drop.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drag-selection-dont-drop.xhtml
new file mode 100644
index 000000000..76712a6db
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drag-selection-dont-drop.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+div[ondragenter]
+ {margin:200px 0 0 200px;
+ width:200px;
+ height:100px;
+ color:white;
+ background-color:navy;}
+div[ondragenter]:before
+ {display:block;
+ content:"";
+ border-style:solid;
+ position:relative;
+ top:-50px;
+ left:-200px;
+ border-width:100px;
+ border-color:transparent navy transparent transparent;}
+</style>
+</head>
+<body>
+<p>Drag selection to the blue arrow but don't drop it yet. You should be returned back to start page.</p>
+<div ondragenter="event.preventDefault()" ondragover="history.go(-1)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-here-reload.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-here-reload.xhtml
new file mode 100644
index 000000000..481692f79
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-here-reload.xhtml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+p
+ {border:solid medium navy;
+ height:200px;
+ padding:1em;
+ margin:0;}
+div
+ {margin:100px;
+ padding:50px;}
+img
+ {display:block;
+ margin:1em;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('p').appendChild(c);}
+</script>
+</head>
+<body>
+<div ondragenter="window.location.reload()">
+<p ondragenter="event.stopPropagation()" dropzone="copy string:text/uri-list" ondrop="addImage(event)">Drop image here, it should be copied to this page once you drop it here.</p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-image-now.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-image-now.xhtml
new file mode 100644
index 000000000..a2c5ce4db
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-image-now.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+html, body
+ {height:100%;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('body').appendChild(c);}
+</script>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false" ondrop="addImage(event)">
+<p>Drop image now, it should be copied to this page once you drop it here.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-link-now.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-link-now.xhtml
new file mode 100644
index 000000000..f6a3c6c30
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-link-now.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+html, body
+ {height:100%;}
+</style>
+<script type="application/ecmascript">
+function checkLink(event)
+ {document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'}
+</script>
+</head>
+<body ondragenter="event.preventDefault()" ondrop="checkLink(event)" ondragover="return false">
+<p>Drop link now, you should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-now.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-now.xhtml
new file mode 100644
index 000000000..e391b342a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-now.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+html, body
+ {height:100%;}
+</style>
+</head>
+<body ondragenter="event.preventDefault()" ondragover="return false" ondrop="event.preventDefault();document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
+<p>Drop selection now, you should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-selection-here.xhtml b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-selection-here.xhtml
new file mode 100644
index 000000000..a88d34eb8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/navigation/helper-drop-selection-here.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross page drag and drop: helper file</title>
+<style type="text/css">
+p
+ {border:solid medium navy;
+ height:200px;
+ padding:1em;
+ margin:0;}
+div
+ {margin:100px;
+ padding:50px;}
+</style>
+</head>
+<body>
+<div ondragenter="window.location.reload()">
+<p ondragenter="event.stopPropagation()" dropzone="copy string:text/plain" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">Drop selection here, you should see word PASS once you drop it.</p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/001.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/001.xhtml
new file mode 100644
index 000000000..58e2811c3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/001.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag feedback overlay size</title>
+<style type="text/css">
+img
+ {height:100px;
+ width:100px;}
+</style>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Try to drag green box above. Size of feedback overlay should match size of green box.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/002.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/002.xhtml
new file mode 100644
index 000000000..4e30fa790
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/002.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Setting drag image during drag and drop</title>
+<style type="text/css">
+span
+ {color:green;
+ background-color:yellow;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelector('span'), 1, 1);}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<p>Try to drag link above. You should see word <span>PASS</span> in feedback overlay.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/003.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/003.xhtml
new file mode 100644
index 000000000..2683013ae
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/003.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Adding element to datastore</title>
+<style type="text/css">
+span
+ {color:green;
+ background-color:yellow;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector('span'));}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<p>Try to drag link above. You should see word <span>PASS</span> in feedback overlay.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/004.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/004.xhtml
new file mode 100644
index 000000000..1bb85f771
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/004.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Resetting drag image on dragenter</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+div
+ {width:100px;
+ height:100px;
+ background-color:silver;
+ margin-top:20px;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelector('span'), 1, 1);}
+function resetImage(event)
+ {event.preventDefault();
+ event.dataTransfer.setDragImage(document.querySelector('strong'), 1, 1);}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<p>Try to drag link above to the silver box. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+<div ondragenter="resetImage(event)" ondragover="return false"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/005.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/005.xhtml
new file mode 100644
index 000000000..4b9fd33d3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/005.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Adding element to datastore on dragenter</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+div
+ {width:100px;
+ height:100px;
+ background-color:silver;
+ margin-top:20px;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector('span'));}
+function resetImage(event)
+ {event.preventDefault();
+ event.dataTransfer.addElement(document.querySelector('strong'));}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<p>Try to drag link above to the silver box. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+<div ondragenter="resetImage(event)" ondragover="return false"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/006.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/006.xhtml
new file mode 100644
index 000000000..1681adb06
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/006.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Resetting drag image on dragover</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+div
+ {width:100px;
+ height:100px;
+ background-color:silver;
+ margin-top:20px;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelector('span'), 1, 1);}
+function resetImage(event)
+ {event.preventDefault();
+ event.dataTransfer.setDragImage(document.querySelector('strong'), 1, 1);}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<p>Try to drag link above to the silver box. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+<div ondragenter="event.preventDefault()" ondragover="resetImage(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/007.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/007.xhtml
new file mode 100644
index 000000000..c8461ea3c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/007.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Adding element to datastore on dragover</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+div
+ {width:100px;
+ height:100px;
+ background-color:silver;
+ margin-top:20px;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector('span'));}
+function resetImage(event)
+ {event.preventDefault()
+ event.dataTransfer.addElement(document.querySelector('strong'));}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<p>Try to drag link above to the silver box. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+<div ondragenter="event.preventDefault()" ondragover="resetImage(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/008.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/008.xhtml
new file mode 100644
index 000000000..9c94229fa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/008.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Resetting drag image on drag</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelector('span'), 1, 1);}
+function resetImage(event)
+ {event.dataTransfer.setDragImage(document.querySelector('strong'), 1, 1);}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondrag="resetImage(event)">Drag me</a></p>
+<p>Try to drag link above. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/009.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/009.xhtml
new file mode 100644
index 000000000..d9ffbcfcf
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/009.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Adding element to datastore on drag</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector('span'));}
+function resetImage(event)
+ {event.dataTransfer.addElement(document.querySelector('strong'));}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)" ondrag="resetImage(event)">Drag me</a></p>
+<p>Try to drag link above. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/010.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/010.xhtml
new file mode 100644
index 000000000..1401823ec
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/010.xhtml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Resetting drag image on new drag</title>
+<style type="text/css">
+span
+ {color:green;
+ background-color:yellow;}
+</style>
+<script type="application/ecmascript">
+var i = 0;
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelectorAll('span')[i++%2], 1, 1);}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<p>Drag link above around the page drop it and try to drag again.</p>
+<p>First time you drag it you should see word <span>Odd</span> in feedback overlay, second time overlay should change to <span>Even</span>.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/011.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/011.xhtml
new file mode 100644
index 000000000..d62be17f6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/011.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Feedback image for circle</title>
+<style type="text/css">
+body
+ {background-color:silver;
+ margin:0;}
+div
+ {background-color:white;}
+</style>
+</head>
+<body>
+<div><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></div>
+<p>Try to drag green circle above. Feedback overlay should be a circle.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/012.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/012.xhtml
new file mode 100644
index 000000000..5b069b99d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/012.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Feedback image and border-radius</title>
+<style type="text/css">
+body
+ {background-color:silver;
+ margin:0;}
+div
+ {background-color:white;}
+div > div
+ {display:block;
+ width:100px;
+ height:100px;
+ border:solid thin green;
+ border-radius:50px;}
+</style>
+</head>
+<body>
+<div>
+ <div draggable="true" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/>
+</div>
+<p>Try to drag green circle above. Feedback overlay should be a circle.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/013.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/013.xhtml
new file mode 100644
index 000000000..17ba67d19
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/013.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Feedback image and CSS transforms</title>
+<style type="text/css">
+body
+ {background-color:silver;
+ margin:0;}
+div
+ {background-color:white;}
+div > div
+ {display:block;
+ width:100px;
+ height:87px;
+ transform-origin:bottom right;
+ transform:skew(-30deg);
+ -o-transform-origin:bottom right;
+ -o-transform:skew(-30deg);
+ background-color:green;}
+</style>
+</head>
+<body>
+<div>
+ <div draggable="true" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/>
+</div>
+<p>Try to drag green rhomb above. Feedback overlay should not be rectangular.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/014.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/014.xhtml
new file mode 100644
index 000000000..c853fa9cb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/014.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Setting drag image during drag and drop of selection</title>
+<style type="text/css">
+span
+ {color:green;
+ background-color:yellow;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelector('span'), 1, 1);}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p ondragstart="start(event)">Drag me</p>
+<p>Try to drag selection above. You should see word <span>PASS</span> in feedback overlay.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/015.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/015.xhtml
new file mode 100644
index 000000000..63eb0f07e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/015.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Adding element to datastore during drag and drop of selection</title>
+<style type="text/css">
+span
+ {color:green;
+ background-color:yellow;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector('span'));}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p ondragstart="start(event)">Drag me</p>
+<p>Try to drag selection above. You should see word <span>PASS</span> in feedback overlay.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/016.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/016.xhtml
new file mode 100644
index 000000000..d60351b74
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/016.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Setting drag image during drag and drop of PNG image</title>
+<style type="text/css">
+span
+ {color:green;
+ background-color:yellow;}
+img
+ {height:100px;
+ width:100px;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelector('span'), 1, 1);}
+</script>
+</head>
+<body>
+<p ondragstart="start(event)">
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel"/>
+</p>
+<p>Try to drag green box above. You should see word <span>PASS</span> in feedback overlay.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/017.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/017.xhtml
new file mode 100644
index 000000000..6bae357d6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/017.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Adding element to datastore during drag and drop of PNG image</title>
+<style type="text/css">
+span
+ {color:green;
+ background-color:yellow;}
+img
+ {height:100px;
+ width:100px;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector('span'));}
+</script>
+</head>
+<body>
+<p ondragstart="start(event)">
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel"/>
+</p>
+<p>Try to drag green box above. You should see word <span>PASS</span> in feedback overlay.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/018.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/018.xhtml
new file mode 100644
index 000000000..bfde05660
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/018.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Setting drag image during drag and drop of SVG image</title>
+<style type="text/css">
+span
+ {color:green;
+ background-color:yellow;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelector('span'), 1, 1);}
+</script>
+</head>
+<body>
+<p><img src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle" ondragstart="start(event)"/></p>
+<p>Try to drag green circle above. You should see word <span>PASS</span> in feedback overlay.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/019.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/019.xhtml
new file mode 100644
index 000000000..130e716d6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/019.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Adding element to datastore during drag and drop of SVG image</title>
+<style type="text/css">
+span
+ {color:green;
+ background-color:yellow;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector('span'));}
+</script>
+</head>
+<body>
+<p><img src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle" ondragstart="start(event)"/></p>
+<p>Try to drag green circle above. You should see word <span>PASS</span> in feedback overlay.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/020.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/020.xhtml
new file mode 100644
index 000000000..80257d1d7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/020.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Setting drag image during drag and drop of block element</title>
+<style type="text/css">
+div
+ {width:100px;
+ height:100px;
+ background-color:navy;}
+span
+ {color:green;
+ background-color:yellow;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelector('span'), 1, 1);}
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)"/>
+<p>Try to drag blue box above. You should see word <span>PASS</span> in feedback overlay.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/021.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/021.xhtml
new file mode 100644
index 000000000..d9400c711
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/021.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Adding element to datastore during drag and drop of block element</title>
+<style type="text/css">
+div
+ {width:100px;
+ height:100px;
+ background-color:navy;}
+span
+ {color:green;
+ background-color:yellow;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector('span'));}
+</script>
+</head>
+<body>
+<div draggable="true" ondragstart="start(event)"/>
+<p>Try to drag blue box above. You should see word <span>PASS</span> in feedback overlay.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/022.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/022.xhtml
new file mode 100644
index 000000000..8b8a0925a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/022.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Block element drag and drop: changing draggable attribute</title>
+<style type="text/css">
+div
+ {width:100px;
+ height:100px;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('div').setAttribute('draggable','false')">
+<div draggable="true" ondragstart="document.querySelector('p').firstChild.nodeValue = 'FAIL'"/>
+<p>You should not be able to drag blue box.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/023.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/023.xhtml
new file mode 100644
index 000000000..c3f7ddf51
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/023.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop: changing draggable attribute</title>
+</head>
+<body onload="document.querySelector('a').setAttribute('draggable','false')">
+<p><a href="data:text/plain,1" ondragstart="document.querySelector('p').firstChild.nodeValue = 'FAIL'">Try to drag me</a></p>
+<p>You should not be able to drag link above.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/024.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/024.xhtml
new file mode 100644
index 000000000..f514b208c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/024.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>PNG image drag and drop: changing draggable attribute</title>
+<style type="text/css">
+img
+ {width:100px;
+ height:100px;}
+</style>
+</head>
+<body onload="document.querySelector('img').setAttribute('draggable','false')">
+<p><img ondragstart="document.querySelector('p').firstChild.nodeValue = 'FAIL'" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel"/></p>
+<p>You should not be able to drag green box.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/025.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/025.xhtml
new file mode 100644
index 000000000..7bb8debd6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/025.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>SVG image drag and drop: changing draggable attribute</title>
+<style type="text/css">
+img
+ {width:100px;
+ height:100px;}
+</style>
+</head>
+<body onload="document.querySelector('img').setAttribute('draggable','false')">
+<p><img ondragstart="document.querySelector('p').firstChild.nodeValue = 'FAIL'" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle"/></p>
+<p>You should not be able to drag green circle.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/026.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/026.xhtml
new file mode 100644
index 000000000..0793daaee
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/026.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of overlapping links: zero height</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+div
+ {width:4em;
+ padding:1em;
+ line-height:0;}
+a
+ {background-color:white;
+ padding:1ex;}
+</style>
+<script type="application/ecmascript">
+function start(event,feedback)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector(feedback));}
+</script>
+</head>
+<body>
+<div>
+ <a href="data:text/plain,1" ondragstart="start(event,'strong')">    </a>
+ <a href="data:text/plain,2" ondragstart="start(event,'span')">Link</a>
+</div>
+<p>Try to drag link above. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/027.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/027.xhtml
new file mode 100644
index 000000000..7b2945ed9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/027.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of overlapping links: negative margin</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+div
+ {height:2em;}
+div + div
+ {margin-top:-2em;}
+</style>
+<script type="application/ecmascript">
+function start(event,feedback)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector(feedback));}
+</script>
+</head>
+<body>
+<div>
+ <a href="data:text/plain,1" ondragstart="start(event,'strong')">   </a>
+</div>
+<div>
+ <a href="data:text/plain,2" ondragstart="start(event,'span')">Link</a>
+</div>
+<p>Try to drag link above. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/028.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/028.xhtml
new file mode 100644
index 000000000..cba934b6d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/028.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of overlapping links: relative position</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+div
+ {height:2em;}
+div + div
+ {position:relative;
+ top:-2em;}
+</style>
+<script type="application/ecmascript">
+function start(event,feedback)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector(feedback));}
+</script>
+</head>
+<body>
+<div>
+ <a href="data:text/plain,1" ondragstart="start(event,'strong')">   </a>
+</div>
+<div>
+ <a href="data:text/plain,2" ondragstart="start(event,'span')">Link</a>
+</div>
+<p>Try to drag link above. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/029.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/029.xhtml
new file mode 100644
index 000000000..dd02b1cda
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/029.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of overlapping links: absolute position</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+div
+ {height:2em;
+ position:absolute;
+ top:10px;
+ left:10px;}
+div + div
+ {z-index:2;}
+p
+ {margin-top:3em;}
+</style>
+<script type="application/ecmascript">
+function start(event,feedback)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector(feedback));}
+</script>
+</head>
+<body>
+<div>
+ <a href="data:text/plain,1" ondragstart="start(event,'strong')">   </a>
+</div>
+<div>
+ <a href="data:text/plain,2" ondragstart="start(event,'span')">Link</a>
+</div>
+<p>Try to drag link above. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/030.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/030.xhtml
new file mode 100644
index 000000000..d86072dc8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/030.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of overlapping links: fixed position</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+div
+ {height:2em;
+ position:fixed;
+ top:10px;
+ left:10px;}
+div + div
+ {z-index:2;}
+p
+ {margin-top:3em;}
+</style>
+<script type="application/ecmascript">
+function start(event,feedback)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector(feedback));}
+</script>
+</head>
+<body>
+<div>
+ <a href="data:text/plain,1" ondragstart="start(event,'strong')">   </a>
+</div>
+<div>
+ <a href="data:text/plain,2" ondragstart="start(event,'span')">Link</a>
+</div>
+<p>Try to drag link above. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/031.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/031.xhtml
new file mode 100644
index 000000000..72ed95972
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/031.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of overlapping images: negative margin</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+img
+ {display:block;
+ width:100px;
+ height:100px;}
+img + img
+ {margin-top:-100px;}
+</style>
+<script type="application/ecmascript">
+function start(event,feedback)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector(feedback));}
+</script>
+</head>
+<body>
+<div>
+ <img ondragstart="start(event,'strong')" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP4z8DwHwAFAAH/VscvDQAAAABJRU5ErkJggg=="/>
+ <img ondragstart="start(event,'span')" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNgaGD4DwAChAGAJVtEDQAAAABJRU5ErkJggg=="/>
+</div>
+<p>Try to drag box above. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/032.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/032.xhtml
new file mode 100644
index 000000000..22ae40193
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/032.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of overlapping images: absolute position</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+div
+ {height:100px;
+ position:relative;}
+img
+ {display:block;
+ position:absolute;
+ top:0;
+ bottom:0;
+ width:100px;
+ height:100px;}
+</style>
+<script type="application/ecmascript">
+function start(event,feedback)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector(feedback));}
+</script>
+</head>
+<body>
+<div>
+ <img ondragstart="start(event,'strong')" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP4z8DwHwAFAAH/VscvDQAAAABJRU5ErkJggg=="/>
+ <img ondragstart="start(event,'span')" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNgaGD4DwAChAGAJVtEDQAAAABJRU5ErkJggg=="/>
+</div>
+<p>Try to drag box above. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/033.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/033.xhtml
new file mode 100644
index 000000000..ba597bdcd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/033.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of overlapping images: fixed position</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+div
+ {height:100px;
+ position:relative;}
+img
+ {display:block;
+ position:fixed;
+ top:0;
+ bottom:0;
+ width:100px;
+ height:100px;}
+</style>
+<script type="application/ecmascript">
+function start(event,feedback)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector(feedback));}
+</script>
+</head>
+<body>
+<div>
+ <img ondragstart="start(event,'strong')" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP4z8DwHwAFAAH/VscvDQAAAABJRU5ErkJggg=="/>
+ <img ondragstart="start(event,'span')" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNgaGD4DwAChAGAJVtEDQAAAABJRU5ErkJggg=="/>
+</div>
+<p>Try to drag box above. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay all the time.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/034.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/034.xhtml
new file mode 100644
index 000000000..d6b64da75
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/034.xhtml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of overlapping elements: negative margins</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ margin-top:-50px;
+ background-color:navy;}
+div:nth-child(odd)
+ {background-color:maroon;
+ margin-left:50px;}
+div[draggable]
+ {background-color:teal;}
+</style>
+</head>
+<body>
+<div/>
+<div/>
+<div draggable="true"/>
+<div/>
+<div/>
+<div draggable="true"/>
+<div/>
+<div/>
+<p>Only green areas should be draggable.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/035.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/035.xhtml
new file mode 100644
index 000000000..e0d26ce7d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/035.xhtml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of floated overlapping elements: negative margins</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ float:left;
+ margin-left:-50px;
+ background-color:navy;}
+div:nth-child(odd)
+ {background-color:maroon;
+ margin-top:50px;}
+div[draggable]
+ {background-color:teal;}
+</style>
+</head>
+<body>
+<p>Only green areas should be draggable.</p>
+<div/>
+<div/>
+<div draggable="true"/>
+<div/>
+<div/>
+<div draggable="true"/>
+<div/>
+<div/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/036.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/036.xhtml
new file mode 100644
index 000000000..6ccb58fc2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/036.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag feedback when multiple elements are added to dragstore</title>
+<style type="text/css">
+div > div
+ {height:100px;
+ width:100px;
+ float:left;
+ background-color:navy;}
+div + div
+ {margin-left:-60px;
+ background-color:maroon;}
+div[draggable]
+ {background-color:teal;
+ margin-top:50px;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {var div = document.querySelectorAll('div > div:nth-child(odd)');
+ event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != div.length; i++)
+ {event.dataTransfer.addElement(div[i]);}
+ }
+</script>
+</head>
+<body>
+<p>Try to drag green box below. Feedback overlay should include all three boxes when you drag green one.</p>
+<div ondragstart="start(event)">
+ <div/>
+ <div draggable="true"/>
+ <div/>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/038.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/038.xhtml
new file mode 100644
index 000000000..db3f747ad
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/038.xhtml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Resetting drag image after element was added to dragstore</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelector('strong'));
+ event.dataTransfer.setDragImage(document.querySelector('span'), 1, 1);}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<p>Try to drag link above. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/039.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/039.xhtml
new file mode 100644
index 000000000..500f5dabe
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/039.xhtml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Resetting drag image during drag and drop of link</title>
+<style type="text/css">
+span, strong
+ {color:green;
+ background-color:yellow;}
+strong
+ {color:red;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelector('strong'), 1, 1);
+ event.dataTransfer.setDragImage(document.querySelector('span'), 1, 1);}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<p>Try to drag link above. You should see word <span>PASS</span> not <strong>FAIL</strong> in feedback overlay.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/040.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/040.xhtml
new file mode 100644
index 000000000..73ab31aac
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/040.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cursor position and drag image</title>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelector('canvas'), 50, 50);}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="start(event)">Drag me</a></p>
+<p>Try to drag link above. Feedback overlay should be based on canvas below and mouse pointer should be anchored in its center.</p>
+<p>
+ <canvas width="100" height="100">Canvas</canvas>
+</p>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/041.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/041.xhtml
new file mode 100644
index 000000000..2b1bc0636
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/041.xhtml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cursor position and drag image after new element is added to dragstore</title>
+<script type="application/ecmascript">
+function start(event,element)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelectorAll('canvas')[element]);}
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event,1)">Canvas</canvas>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event,0)">Canvas</canvas>
+</p>
+<p>Try to drag canvas above. Feedback overlay should include both canvases and mouse pointer should be anchored in dragged ones center.</p>
+<script type="application/ecmascript">
+var canvases = document.querySelectorAll('canvas');
+paintCanvas(canvases[0],'navy');
+paintCanvas(canvases[1],'green');
+function paintCanvas(canvas,color)
+ {var c = canvas.getContext('2d');
+ for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?color:'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+ }
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/042.html b/testing/web-platform/tests/html/editing/dnd/overlay/042.html
new file mode 100644
index 000000000..8a7db0e5d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/042.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - dragging elements that overlay each other</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: navy;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ height: 100px;
+ width: 100px;
+ background-color: orange;
+ left: 58px;
+ top: 58px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 258px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+window.onload = function() {
+ var passed = true, orange = document.getElementsByTagName('div')[1], blue = document.getElementsByTagName('div')[0], fuchsia = document.getElementsByTagName('div')[2];
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text/plain', 'PASS');
+ };
+ blue.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text/plain', 'FAIL');
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ fuchsia.ondrop = function(e) {
+ //it's possible this could get called twice if the browser drags both items, so it uses the "passed" variable to make sure
+ //that if blue gets dropped first, it remains false when orange then gets dropped
+ passed = passed && ( e.dataTransfer.getData('text/plain') == 'PASS' );
+ document.getElementsByTagName('p')[0].innerHTML = passed ? 'PASS' : 'FAIL';
+ };
+
+};
+
+</script>
+
+<div draggable='true'></div><div draggable='true'></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then release it. While dragging, the drag placeholder should show that only the orange box is being dragged.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/043.html b/testing/web-platform/tests/html/editing/dnd/overlay/043.html
new file mode 100644
index 000000000..3b8093244
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/043.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - dragging nested draggable elements</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: navy;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div div {
+ height: 100px;
+ width: 100px;
+ background-color: orange;
+ position: absolute;
+ left: 50px;
+ top: 50px;
+ }
+ body > div + div {
+ background-color: fuchsia;
+ height: 100px;
+ width: 100px;
+ left: 258px;
+ top: 58px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+window.onload = function() {
+ var passed = true, orange = document.getElementsByTagName('div')[1], blue = document.getElementsByTagName('div')[0], fuchsia = document.getElementsByTagName('div')[2];
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text/plain', 'child targeted');
+ };
+ blue.ondragstart = function(e) {
+ if( e.target == this ) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text/plain', 'parent targeted');
+ } else {
+ e.dataTransfer.setData('extra/data', 'parent bubble');
+ }
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ fuchsia.ondrop = function(e) {
+ e.preventDefault();
+ //it's possible this could get called twice if the browser drags both items, so it uses the "passed" variable to make sure
+ //that if blue gets dropped first, it remains false when orange then gets dropped
+ passed = passed && ( e.dataTransfer.getData('text/plain') == 'child targeted' ) && ( e.dataTransfer.getData('extra/data') == 'parent bubble' );
+ document.getElementsByTagName('p')[0].innerHTML = passed ? 'PASS' : 'FAIL';
+ };
+
+};
+
+</script>
+
+<div draggable='true'><div draggable='true'></div></div><div></div>
+
+<p>Use your pointing device to drag the orange box to the pink box, then release it. While dragging, the drag placeholder should show that only the orange box is being dragged.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/044.html b/testing/web-platform/tests/html/editing/dnd/overlay/044.html
new file mode 100644
index 000000000..a24ca2b7b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/044.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - dragging selections inside draggable elements</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: fuchsia;
+ left: 250px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], fuchsia = document.getElementsByTagName('div')[1];
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('extra/data', 'parent bubble');
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ fuchsia.ondrop = function(e) {
+ e.preventDefault();
+ var passed = ( e.dataTransfer.getData('text/plain') == 'text dummy' ) && ( e.dataTransfer.getData('extra/data') == 'parent bubble' );
+ document.getElementsByTagName('p')[0].innerHTML = passed ? 'PASS' : 'FAIL';
+ };
+ var range = document.createRange();
+ range.selectNodeContents(orange);
+ range.setStart(orange.firstChild,6);
+ range.setEnd(orange.firstChild,16);
+ window.getSelection().addRange(range);
+
+};
+
+</script>
+
+<div draggable='true'>Dummy text dummy text</div><div></div>
+
+<p>Use your pointing device to <strong>drag the selected text</strong> to the pink box, then release it. While dragging, the drag placeholder should show that only the selected text is being dragged.</p>
+<p>(If no text is selected, you will need to use your browser's functionality to select &quot;text dummy&quot; in the orange box.)</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/045.html b/testing/web-platform/tests/html/editing/dnd/overlay/045.html
new file mode 100644
index 000000000..80cd27c28
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/045.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - dragging iframes overlaying draggable elements</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: fuchsia;
+ left: 258px;
+ }
+ iframe {
+ border: 5px solid yellow;
+ height: 130px;
+ width: 130px;
+ position: absolute;
+ top: 38px;
+ left: 38px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], fuchsia = document.getElementsByTagName('div')[1];
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text/plain', 'FAIL');
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ fuchsia.ondrop = function(e) {
+ e.preventDefault();
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL';
+ };
+
+};
+
+</script>
+
+<div draggable='true'></div><div></div>
+
+<p>Use your pointing device to begin dragging inside the yellow border (not on any scrollbars that may appear), over to the pink box, then release it. Pass if nothing is dragged, and if this text does not change.
+<iframe src="about:blank"></iframe></p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/046.html b/testing/web-platform/tests/html/editing/dnd/overlay/046.html
new file mode 100644
index 000000000..89d67cd7b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/046.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - dragging iframes inside draggable elements</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: fuchsia;
+ left: 258px;
+ }
+ iframe {
+ border: 5px solid yellow;
+ height: 130px;
+ width: 130px;
+ position: absolute;
+ top: 30px;
+ left: 30px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], fuchsia = document.getElementsByTagName('div')[1];
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text/plain', 'FAIL');
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ fuchsia.ondrop = function(e) {
+ e.preventDefault();
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL';
+ };
+
+};
+
+</script>
+
+<div draggable='true'><iframe src="about:blank"></iframe></div><div></div>
+
+<p>Use your pointing device to begin dragging inside the yellow border (not on any scrollbars that may appear), over to the pink box, then release it. Pass if nothing is dragged, and if this text does not change.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/047.html b/testing/web-platform/tests/html/editing/dnd/overlay/047.html
new file mode 100644
index 000000000..10f167a87
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/047.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - dragging objects overlaying draggable elements</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: fuchsia;
+ left: 258px;
+ }
+ object {
+ border: 5px solid yellow;
+ height: 130px;
+ width: 130px;
+ position: absolute;
+ top: 38px;
+ left: 38px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], fuchsia = document.getElementsByTagName('div')[1];
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text/plain', 'FAIL');
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ fuchsia.ondrop = function(e) {
+ e.preventDefault();
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL';
+ };
+
+};
+
+</script>
+
+<div draggable='true'></div><div></div>
+
+<p>Use your pointing device to begin dragging inside the yellow border (not on any scrollbars that may appear), over to the pink box, then release it. Pass if nothing is dragged, and if this text does not change.
+<object data="about:blank"></object></p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/048.html b/testing/web-platform/tests/html/editing/dnd/overlay/048.html
new file mode 100644
index 000000000..d319fa272
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/048.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - dragging objects inside draggable elements</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: fuchsia;
+ left: 258px;
+ }
+ object {
+ border: 5px solid yellow;
+ height: 130px;
+ width: 130px;
+ position: absolute;
+ top: 30px;
+ left: 30px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script>
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], fuchsia = document.getElementsByTagName('div')[1];
+
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text/plain', 'FAIL');
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ fuchsia.ondrop = function(e) {
+ e.preventDefault();
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL';
+ };
+
+};
+
+</script>
+
+<div draggable='true'><object data="about:blank"></object></div><div></div>
+
+<p>Use your pointing device to begin dragging inside the yellow border (not on any scrollbars that may appear), over to the pink box, then release it. Pass if nothing is dragged, and if this text does not change.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/049.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/049.xhtml
new file mode 100644
index 000000000..4f63d6eba
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/049.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag feedback for partly visible image: negative margins</title>
+<style type="text/css">
+p:first-child
+ {margin:-50px 0 0 -50px;}
+img
+ {height:100px;
+ width:100px;}
+</style>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Try to drag green box above. Feedback overlay should be green square.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/050.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/050.xhtml
new file mode 100644
index 000000000..112fbd0a7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/050.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag feedback for partly visible image: relative position</title>
+<style type="text/css">
+p:first-child
+ {margin:0;
+ position:relative;
+ top:-50px;
+ left:-50px;}
+img
+ {display:block;
+ height:100px;
+ width:100px;}
+</style>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Try to drag green box above. Feedback overlay should be green square.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/051.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/051.xhtml
new file mode 100644
index 000000000..befd07790
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/051.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag feedback for partly visible image: absolute position</title>
+<style type="text/css">
+img
+ {position:absolute;
+ top:-50px;
+ left:-50px;}
+p + p
+ {margin-top:100px;}
+img
+ {height:100px;
+ width:100px;}
+</style>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Try to drag green box above. Feedback overlay should be green square.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/052.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/052.xhtml
new file mode 100644
index 000000000..36e9e704c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/052.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag feedback for partly visible image: fixed position</title>
+<style type="text/css">
+img
+ {position:fixed;
+ top:-50px;
+ left:-50px;}
+p + p
+ {margin-top:100px;}
+img
+ {height:100px;
+ width:100px;}
+</style>
+</head>
+<body>
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVR42mNgaGD4D8YwBgAw9AX9Y9zBwwAAAABJRU5ErkJggg==" alt="PNG green pixel" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Try to drag green box above. Feedback overlay should be green square.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/053.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/053.xhtml
new file mode 100644
index 000000000..b66a6e6f6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/053.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag feedback for partly visible element: negative margins</title>
+<style type="text/css">
+div
+ {margin:-160px 0 0 -160px;
+ height:200px;
+ width:200px;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div draggable="true" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/>
+<p>Try to drag blue box above. Feedback overlay should be square.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/054.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/054.xhtml
new file mode 100644
index 000000000..2b34d647e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/054.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag feedback for partly visible element: relative position</title>
+<style type="text/css">
+div
+ {position:relative;
+ top:-150px;
+ left:-150px;
+ height:200px;
+ width:200px;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div draggable="true" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/>
+<p>Try to drag blue box above. Feedback overlay should be square.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/055.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/055.xhtml
new file mode 100644
index 000000000..93df7ebc3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/055.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag feedback for partly visible element: absolute position</title>
+<style type="text/css">
+div
+ {position:absolute;
+ top:-150px;
+ left:-150px;
+ height:200px;
+ width:200px;
+ background-color:navy;}
+p
+ {margin-top:100px;}
+</style>
+</head>
+<body>
+<div draggable="true" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/>
+<p>Try to drag blue box above. Feedback overlay should be square.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/056.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/056.xhtml
new file mode 100644
index 000000000..838d43891
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/056.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag feedback for partly visible element: fixed position</title>
+<style type="text/css">
+div
+ {position:fixed;
+ top:-150px;
+ left:-150px;
+ height:200px;
+ width:200px;
+ background-color:navy;}
+p
+ {margin-top:100px;}
+</style>
+</head>
+<body>
+<div draggable="true" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/>
+<p>Try to drag blue box above. Feedback overlay should be square.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/057.xhtml b/testing/web-platform/tests/html/editing/dnd/overlay/057.xhtml
new file mode 100644
index 000000000..5f5805b2e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/057.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag feedback for partly visible float: negative margins</title>
+<style type="text/css">
+p
+ {margin-top:0;}
+div
+ {float:left;
+ margin:-150px 0 0 -150px;
+ height:200px;
+ width:200px;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div draggable="true" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/>
+<p>Try to drag blue box above. Feedback overlay should be square.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/058.html b/testing/web-platform/tests/html/editing/dnd/overlay/058.html
new file mode 100644
index 000000000..560c6fdfe
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/058.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>drag &amp; drop - dragging elements by children that extend out of them</title>
+<style type="text/css">
+div {
+ height: 200px;
+ width: 200px;
+ background: blue;
+ white-space: nowrap;
+}
+span {
+ display: inline-block;
+ width: 210px;
+ height: 100px;
+}
+span + span {
+ background: orange;
+ width: 100px;
+}
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+</script>
+<div draggable="true"><span></span><span></span></div>
+<p>Drag the orange square sideways. Pass if the drag placeholder shows that both the blue and orange squares are being dragged.</p> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/059.html b/testing/web-platform/tests/html/editing/dnd/overlay/059.html
new file mode 100644
index 000000000..db6572033
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/059.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>drag &amp; drop - dragging elements by text that extends out of them</title>
+<style type="text/css">
+div {
+ height: 200px;
+ width: 200px;
+ background: blue;
+ white-space: nowrap;
+}
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+</script>
+<div draggable="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Drag me</div>
+<p>Drag the above text sideways. Pass if the drag placeholder shows that both the text and blue square are being dragged.</p> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/060.html b/testing/web-platform/tests/html/editing/dnd/overlay/060.html
new file mode 100644
index 000000000..b8d169f0e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/060.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<title>drag &amp; drop - dragging elements by children that are positioned outside them</title>
+<style type="text/css">
+div {
+ height: 200px;
+ width: 200px;
+ background: blue;
+ white-space: nowrap;
+ position: relative;
+}
+span {
+ display: block;
+ top: 0;
+ left: 210px;
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: orange;
+}
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+</script>
+<div draggable="true"><span></span></div>
+<p>Drag the orange square sideways. Pass if the drag placeholder shows that both the blue and orange squares are being dragged.</p> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/061.html b/testing/web-platform/tests/html/editing/dnd/overlay/061.html
new file mode 100644
index 000000000..b1665171f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/061.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<title>drag &amp; drop - dragging elements by overflowing children that are positioned outside them</title>
+<style type="text/css">
+div {
+ height: 200px;
+ width: 200px;
+ background: blue;
+ white-space: nowrap;
+ position: relative;
+}
+span {
+ display: block;
+ top: 0;
+ left: 210px;
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: yellow;
+}
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+</script>
+<div draggable="true"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Drag me</span></div>
+<p>Drag the above text sideways. Pass if the drag placeholder shows that the text and both the yellow and blue squares are being dragged.</p> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/062.html b/testing/web-platform/tests/html/editing/dnd/overlay/062.html
new file mode 100644
index 000000000..43fc8342d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/062.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Selection spanning hidden elements</title>
+ <script type="text/javascript">
+window.onload = function () {
+ var range = document.createRange(), p = document.getElementsByTagName('p')[0];
+ range.selectNodeContents(p);
+ range.setStart(p.firstChild.firstChild,4);
+ range.setEnd(p.lastChild.firstChild,5);
+ window.getSelection().addRange(range);
+};
+ </script>
+ </head>
+ <body>
+
+ <p><span style="display:none">FAILPASS_</span>drag<span style="display:none">_THIS_</span>text<span style="display:none">_PASSFAIL</span></p>
+ <p><textarea rows="3" cols="50"></textarea></p>
+ <p>Drag the selected text into the input box. The drag placeholder should match the visible text that is being dragged. When dropped, either &quot;dragtext&quot; or &quot;PASS_drag_THIS_text_PASS&quot; should appear in the input.</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-001.html b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-001.html
new file mode 100644
index 000000000..05f69fa61
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-001.html
@@ -0,0 +1,16 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay for heavily styled elements – 001</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ box-shadow: 10px 10px 10px gray;
+}
+</style>
+
+<p>Drag the blue box below downwards. The drag placeholder should resemble the blue box. It may optionally also include the box's shadow.</p>
+
+<a href='#' draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'"></a>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-002.html b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-002.html
new file mode 100644
index 000000000..de3b2e296
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-002.html
@@ -0,0 +1,16 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay for heavily styled elements – 002</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ border: 10px solid orange;
+}
+</style>
+
+<p>Drag the blue box below downwards. The drag placeholder should resemble the blue box, including the orange border.</p>
+
+<a href='#' draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'"></a>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-003.html b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-003.html
new file mode 100644
index 000000000..adb0a3581
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-003.html
@@ -0,0 +1,16 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay for heavily styled elements – 002</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ outline: 10px solid orange;
+}
+</style>
+
+<p>Drag the blue box below downwards. The drag placeholder should resemble the blue box. It may optionally also include include the orange border.</p>
+
+<a href='#' draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'"></a>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-004.html b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-004.html
new file mode 100644
index 000000000..d6a5da41c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-004.html
@@ -0,0 +1,19 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay for heavily styled elements – 004</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ box-shadow: 10px 10px 10px gray;
+}
+div {
+ background-color: orange;
+}
+</style>
+
+<p>Drag the blue box below downwards. The drag placeholder should resemble the blue box. It may optionally also include the box's shadow, but must not include the orange rectangle.</p>
+
+<div><a href='#' draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'"></a></div>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-005.html b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-005.html
new file mode 100644
index 000000000..2bbdb3cf7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-005.html
@@ -0,0 +1,15 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay for heavily styled elements – 005</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: rgba(0,0,255,0.5);
+}
+</style>
+
+<p>Drag the blue box below downwards. The drag placeholder should resemble the blue box, including the text within it.</p>
+
+<a draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'">TEST</a>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-006.html b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-006.html
new file mode 100644
index 000000000..c067878f2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-006.html
@@ -0,0 +1,16 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay for heavily styled elements – 006</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ opacity: 0.5;
+}
+</style>
+
+<p>Drag the blue box below downwards. The drag placeholder should resemble the blue box, including the text within it.</p>
+
+<a draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'">TEST</a>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-007.html b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-007.html
new file mode 100644
index 000000000..56ba9594f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-007.html
@@ -0,0 +1,20 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay for heavily styled elements – 007</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ margin-left: 100px;
+ -moz-transform: rotate(-45deg) skew(15deg, 15deg);
+ -o-transform: rotate(-45deg) skew(15deg, 15deg);
+ -webkit-transform: rotate(-45deg) skew(15deg, 15deg);
+ transform: rotate(-45deg) skew(15deg, 15deg);
+}
+</style>
+
+<p>Drag the blue box below downwards. The drag placeholder should resemble the blue box, including the text within it, and with the same rotation.</p>
+
+<a draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'">TEST</a>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-008.html b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-008.html
new file mode 100644
index 000000000..7a78f814e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-008.html
@@ -0,0 +1,31 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay for heavily styled elements – 008</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: green;
+ position: absolute;
+ top: 100px;
+ left: 10px;
+ z-index: 1;
+}
+
+a + a {
+ background-color: red;
+ position: absolute;
+ top: 150px;
+ left: 20px;
+ z-index: 2;
+}
+
+
+</style>
+
+<p>Drag the green box below downwards. The drag placeholder should resemble the green box, including the text within it. It may optionally be a complete square, or the same shape as the visible part of the green box. There should be no red in the drag placeholder.</p>
+
+<a draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'">TEST</a>
+
+<a href='#'>TEST</a>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-009.html b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-009.html
new file mode 100644
index 000000000..0f36fe083
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/heavy-styling-009.html
@@ -0,0 +1,16 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay for heavily styled elements – 009</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ border-radius: 50px;
+}
+</style>
+
+<p>Drag the blue box below downwards. The drag placeholder should resemble the blue box, including the rounded corners.</p>
+
+<a draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'"></a>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-001.html b/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-001.html
new file mode 100644
index 000000000..ecc7ebbf3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-001.html
@@ -0,0 +1,22 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay of elements partly outside the viewport – 001</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ position: absolute;
+ top: 10px;
+ right: -100px;
+}
+
+p {
+ margin-right: 200px;
+}
+</style>
+
+<a href='#'></a>
+
+<p>Drag the blue box on the right downwards. The drag placeholder should ideally be a blue square. It may optionally be a rectangle the same shape as the visible part of the blue box. No part of the UI should be dragged with the box.</p>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-002.html b/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-002.html
new file mode 100644
index 000000000..3878c31d0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-002.html
@@ -0,0 +1,22 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay of elements partly outside the viewport – 002</title>
+<style>
+img {
+ height: 200px;
+ width: 200px;
+ position: absolute;
+ top: 10px;
+ right: -100px;
+}
+
+p {
+ margin-right: 200px;
+}
+</style>
+
+
+<img alt=''
+src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAACRJREFUOE9jZGBoYCARADWQhEhTDXIOScaPaiAyuEaDlXBAAQBiw3iCaRp9LAAAAABJRU5ErkJggg%3D%3D'>
+
+<p>Drag the blue box on the right. The drag placeholder should ideally be a blue square. It may optionally be a rectangle the same shape as the visible part of the blue box. No part of the UI should be dragged with the box.</p>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-003.html b/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-003.html
new file mode 100644
index 000000000..895a008f9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-003.html
@@ -0,0 +1,22 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay of elements partly outside the viewport – 003</title>
+<style>
+a {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ position: absolute;
+ top: -100px;
+ right: -100px;
+}
+
+p {
+ margin-right: 200px;
+}
+</style>
+
+<a href='#'></a>
+
+<p>Drag the blue box on the right downwards. The drag placeholder should ideally be a blue square twice as high and wide as the visible part of the blue box. It may optionally be a square the same size as the visible part of the blue box. No part of the UI should be dragged with the box.</p>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-004.html b/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-004.html
new file mode 100644
index 000000000..61bc22eef
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-004.html
@@ -0,0 +1,21 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay of elements partly outside the viewport – 004</title>
+<style>
+img {
+ height: 200px;
+ width: 200px;
+ position: absolute;
+ top: -100px;
+ right: -100px;
+}
+
+p {
+ margin-right: 200px;
+}
+</style>
+
+<img alt=''
+src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAACRJREFUOE9jZGBoYCARADWQhEhTDXIOScaPaiAyuEaDlXBAAQBiw3iCaRp9LAAAAABJRU5ErkJggg%3D%3D'>
+
+<p>Drag the blue box on the right. The drag placeholder should ideally be a blue square twice as high and wide as the visible part of the blue box. It may optionally be a square the same size as the visible part of the blue box. No part of the UI should be dragged with the box.</p>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-005.html b/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-005.html
new file mode 100644
index 000000000..26e4bff2e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-005.html
@@ -0,0 +1,22 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay of elements partly outside the viewport – 005</title>
+<style>
+div {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ position: absolute;
+ top: 10px;
+ right: -100px;
+}
+
+p {
+ margin-right: 200px;
+}
+</style>
+
+<div draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'"></div>
+
+<p>Drag the blue box on the right. The drag placeholder should ideally be a blue square. It may optionally be a rectangle the same shape as the visible part of the blue box. No part of the UI should be dragged with the box.</p>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-006.html b/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-006.html
new file mode 100644
index 000000000..d10f06dfd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/outside-viewport-006.html
@@ -0,0 +1,22 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay of elements partly outside the viewport – 006</title>
+<style>
+div {
+ display: block;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ position: absolute;
+ top: -100px;
+ right: -100px;
+}
+
+p {
+ margin-right: 200px;
+}
+</style>
+
+<div draggable="true" ondragstart="event.dataTransfer.effectAllowed ='copy'"></div>
+
+<p>Drag the blue box on the right. The drag placeholder should ideally be a blue square twice as high and wide as the visible part of the blue box. It may optionally be a square the same size as the visible part of the blue box. No part of the UI should be dragged with the box.</p>
diff --git a/testing/web-platform/tests/html/editing/dnd/overlay/oversized-001.html b/testing/web-platform/tests/html/editing/dnd/overlay/oversized-001.html
new file mode 100644
index 000000000..e13f6b190
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/overlay/oversized-001.html
@@ -0,0 +1,18 @@
+<!DOCTYPe html>
+<meta charset='utf-8'>
+<title>drag and drop – feedback overlay of oversized element</title>
+<style>
+html, body, p + p { height: 100%; width: 100%; }
+a {
+ display: block;
+ height: 100%;
+ width: 100%;
+ background-color: blue;
+ border: 50px solid orange; /* makes it higher and wider than the viewport */
+}
+
+</style>
+
+<p>Drag the blue box below downwards. The drag placeholder should ideally be a blue rectangle with an orange border on all sides. It may optionally match the visible part of the blue-and-orange box. It may optionally be a rectangle with the same pattern and size as the visible part of the blue-and-orange box. It may optionally be shrunk to a manageable size. No part of the UI should be dragged with the box.</p>
+
+<p><a href='#'></a></p>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/alttab.html b/testing/web-platform/tests/html/editing/dnd/platform/alttab.html
new file mode 100644
index 000000000..c3375d3d8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/alttab.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - alt+tab while dragging</title>
+ </head>
+ <body>
+
+ <p>This test is only relevant on platforms where alt+tab (or some equivalent) switches applications.</p>
+ <p>Ensure that at least one other application is open. Select this text. Drag the selection downwards a little, then alt+tab (or your system's equivalent) to the other application. Pass if the drag placeholder continues to follow the mouse/pointing device. Release the drag. Pass if the drag placeholder disappears.</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cancel-middle-click.html b/testing/web-platform/tests/html/editing/dnd/platform/cancel-middle-click.html
new file mode 100644
index 000000000..4136e2be7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cancel-middle-click.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with middle click</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: orange;
+ float: left;
+}
+div + div {
+ background: blue;
+}
+div + div + div {
+ background: fuchsia;
+}
+ol {
+ clear: left;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <div draggable="true"></div>
+ <div></div>
+ <div></div>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the orange square over the blue square.</li>
+ <li>Without releasing the drag, click the middle mouse button.</li>
+ <li>If the platform's normal behaviour is to cancel a drag (eg. Windows and Unix+KDE), then the drag should be cancelled;<ul>
+ <li>The drag placeholder should disappear, and the cursor should return to the normal mouse cursor.</li>
+ <li>Move the mouse over the pink square and release the drag. The mouse cursor should remain the normal mouse cursor.</li>
+ </ul></li>
+ <li>If the platform's normal behaviour is not to cancel a drag (eg. Mac and Unix+Gnome), then the drag should not be cancelled;<ul>
+ <li>The drag placeholder should not disappear, and the cursor should be the no-drop cursor.</li>
+ <li>Move the mouse over the pink square and release the drag. The drag placeholder should disappear, and the cursor should return to the normal mouse cursor.</li>
+ </ul></li>
+ <li>Fail in either case if an inappropriate middle click function begins (eg. paste-and-go).</li>
+ </ol>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cancel-right-click.html b/testing/web-platform/tests/html/editing/dnd/platform/cancel-right-click.html
new file mode 100644
index 000000000..85416da52
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cancel-right-click.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with right click</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: orange;
+ float: left;
+}
+div + div {
+ background: blue;
+}
+div + div + div {
+ background: fuchsia;
+}
+ol {
+ clear: left;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <div draggable="true"></div>
+ <div></div>
+ <div></div>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the orange square over the blue square.</li>
+ <li>Without releasing the drag, click the right mouse button.</li>
+ <li>If the platform's normal behaviour is to cancel a drag (eg. Windows and Unix+KDE), then the drag should be cancelled;<ul>
+ <li>The drag placeholder should disappear, and the cursor should return to the normal mouse cursor.</li>
+ <li>Move the mouse over the pink square and release the drag. The mouse cursor should remain the normal mouse cursor.</li>
+ </ul></li>
+ <li>If the platform's normal behaviour is not to cancel a drag (eg. Mac and Unix+Gnome), then the drag should not be cancelled;<ul>
+ <li>The drag placeholder should not disappear, and the cursor should be the no-drop cursor.</li>
+ <li>Move the mouse over the pink square and release the drag. The drag placeholder should disappear, and the cursor should return to the normal mouse cursor.</li>
+ </ul></li>
+ <li>Fail in either case if an inappropriate right click function begins (eg. context menu opens).</li>
+ </ol>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/close-drag-001.html b/testing/web-platform/tests/html/editing/dnd/platform/close-drag-001.html
new file mode 100644
index 000000000..ed275943c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/close-drag-001.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<title>drag &amp; drop - closing a popup while a drag is in operation</title>
+<style type="text/css">
+p.gone, ul { display: none; }
+p.gone + ul { display: block; }
+</style>
+<script type="text/javascript">
+window.onload = function() {
+ if( location.href.match(/#popup$/) ) { document.getElementsByTagName('p')[0].className = 'gone'; }
+ document.getElementsByTagName('ul')[0].ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ setTimeout(function () { window.close(); },100);
+ };
+};
+</script>
+<p><a href="javascript:alert('Click the link normally');" onclick="window.open('close-drag-001.html#popup','_blank');return false;">Open this page in a popup</a>.</p>
+<ul draggable='true'>
+ <li>Drag this text downwards, and do not release the drag.</li>
+ <li>The browser may optionally cancel the drag. The browser may optionally close the popup. Fail if the drag placeholder gets stuck. Fail if the browser crashes. Fail if anything horrible happens. Fail if your pet kitten gets sick.</li>
+ <li>Release the drag.</li>
+ <li>Fail if the drag placeholder gets stuck. Fail if the browser crashes.</li>
+</ul>
+<noscript><p>Enable JavaScript and reload</p></noscript> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/close-drag-002.html b/testing/web-platform/tests/html/editing/dnd/platform/close-drag-002.html
new file mode 100644
index 000000000..3ca09e8b5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/close-drag-002.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>drag &amp; drop - closing the only window while a drag is in operation</title>
+<style type="text/css">
+p.gone, ul { display: none; }
+p.gone + ul { display: block; }
+</style>
+<script type="text/javascript">
+window.onload = function() {
+ if( location.href.match(/#popup$/) ) { document.getElementsByTagName('p')[0].className = 'gone'; }
+ document.getElementsByTagName('ul')[0].ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ setTimeout(function () { window.close(); },100);
+ };
+};
+</script>
+<p><a href="javascript:alert('Click the link normally');" onclick="window.open('close-drag-002.html#popup','_blank');return false;">Open this page in a popup</a>.</p>
+<ul draggable='true'>
+ <li>Close all pages/browser windows except the popup.</li>
+ <li>Drag this text downwards, and do not release the drag.</li>
+ <li>The browser may optionally cancel the drag. The browser may optionally close the popup/window. Fail if the drag placeholder gets stuck. Fail if the browser crashes. Fail if anything horrible happens. Fail if zombie Michael Jackson resurects.</li>
+ <li>Release the drag.</li>
+ <li>Fail if the drag placeholder gets stuck. Fail if the browser crashes.</li>
+</ul>
+<noscript><p>Enable JavaScript and reload</p></noscript> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/close-drag-003.html b/testing/web-platform/tests/html/editing/dnd/platform/close-drag-003.html
new file mode 100644
index 000000000..6d67ac1fe
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/close-drag-003.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>drag &amp; drop - closing a popup while a drag is in operation out of the window</title>
+<style type="text/css">
+p.gone, ul { display: none; }
+p.gone + ul { display: block; }
+</style>
+<script type="text/javascript">
+window.onload = function() {
+ if( location.href.match(/#popup$/) ) { document.getElementsByTagName('p')[0].className = 'gone'; }
+ document.getElementsByTagName('ul')[0].ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ setTimeout(function () { window.close(); },2000);
+ };
+};
+</script>
+<p><a href="javascript:alert('Click the link normally');" onclick="window.open('close-drag-003.html#popup','_blank');return false;">Open this page in a popup</a>.</p>
+<ul draggable='true'>
+ <li>Close all pages/browser windows except the popup.</li>
+ <li>Ensure that the browser window is not maximised.</li>
+ <li>Quickly drag this text out of the browser window (not over the taskbar), and do not release the drag.</li>
+ <li>The browser may optionally cancel the drag. The browser may optionally close the popup/window. Fail if the drag placeholder gets stuck. Fail if the browser crashes. Fail if anything horrible happens. Fail if your grandmother does not invite you over for Christmas.</li>
+ <li>After 2 seconds, fail if the address field shows that the page has closed, but it is still visibly rendered.</li>
+ <li>Continue dragging back into the browser window (if it is still open).</li>
+ <li>Release the drag.</li>
+ <li>Fail if the drag placeholder gets stuck. Fail if the browser crashes or hangs.</li>
+</ul>
+<noscript><p>Enable JavaScript and reload</p></noscript> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/close-drag-004.html b/testing/web-platform/tests/html/editing/dnd/platform/close-drag-004.html
new file mode 100644
index 000000000..49337e2b8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/close-drag-004.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>drag &amp; drop - manually closing a tab while a drag is in operation</title>
+<style type="text/css">
+p.gone, ul { display: none; }
+p.gone + ul { display: block; }
+</style>
+<script type="text/javascript">
+window.onload = function() {
+ if( location.href.match(/#popup$/) ) { document.getElementsByTagName('p')[0].className = 'gone'; }
+ document.getElementsByTagName('ul')[0].ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+</script>
+<p><a href="#popup" target="_blank">Open this page in a new tab</a>.</p>
+<ul draggable='true'>
+ <li>Drag this text downwards, and do not release the drag.</li>
+ <li>Use a keyboard shortcut (eg. Ctrl+W on Windows) to close the tab.</li>
+ <li>The browser may optionally cancel the drag. The browser may optionally close the tab. Fail if the drag placeholder gets stuck. Fail if the browser crashes.</li>
+</ul>
+<noscript><p>Enable JavaScript and reload</p></noscript> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/close-drag-005.html b/testing/web-platform/tests/html/editing/dnd/platform/close-drag-005.html
new file mode 100644
index 000000000..3f6b479af
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/close-drag-005.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>drag &amp; drop - manually closing a window while a drag is in operation</title>
+<script type="text/javascript">
+window.onload = function() {
+ document.getElementsByTagName('ul')[0].ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+</script>
+<ul draggable='true'>
+ <li>Drag this text downwards, and do not release the drag.</li>
+ <li>Use a keyboard shortcut (eg. Alt+F4 on Windows) to close the window.</li>
+ <li>The browser may optionally cancel the drag. The browser may optionally close the window. Fail if the drag placeholder gets stuck. Fail if the browser crashes.</li>
+</ul>
+<noscript><p>Enable JavaScript and reload</p></noscript> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/close-drag-006.html b/testing/web-platform/tests/html/editing/dnd/platform/close-drag-006.html
new file mode 100644
index 000000000..4e00a8472
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/close-drag-006.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>drag &amp; drop - dropping on window decoration after source tab is closed</title>
+<style type="text/css">
+p.gone, ul { display: none; }
+p.gone + ul { display: block; }
+</style>
+<script type="text/javascript">
+window.onload = function() {
+ if( location.href.match(/#popup$/) ) { document.getElementsByTagName('p')[0].className = 'gone'; }
+ document.getElementsByTagName('ul')[0].ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ setTimeout(function () { window.close(); },2000);
+ };
+};
+</script>
+<p><a href="javascript:alert('Click the link normally');" onclick="window.open('close-drag-006.html#popup','_blank');return false;">Open this page in a popup</a>.</p>
+<ul draggable='true'>
+ <li>Ensure the browser window is not maximised.</li>
+ <li>Quickly drag this text upwards out of the browser window, and do not release the drag.</li>
+ <li>This tab should close after a couple of seconds.</li>
+ <li>Dragging downwards over the browser window's title bar, then release the drag.</li>
+ <li>Fail if the drag placeholder gets stuck. Fail if the browser crashes.</li>
+</ul>
+<noscript><p>Enable JavaScript and reload</p></noscript> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cursors/001.html b/testing/web-platform/tests/html/editing/dnd/platform/cursors/001.html
new file mode 100644
index 000000000..953927f91
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cursors/001.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - no special cursor for draggable item</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<div draggable='true'></div><div></div>
+
+<!-- In theory a "move" cursor would be better, but browsers have decided to allow the author to choose that
+- this test checks for browser compatibility. -->
+<p>Move your mouse over the orange box and blue box. It should show the same default mouse cursor in both cases.</p>
+<p>This test only applies to platforms with a mouse cursor that can change to indicate drop status.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cursors/002.html b/testing/web-platform/tests/html/editing/dnd/platform/cursors/002.html
new file mode 100644
index 000000000..9cca00077
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cursors/002.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - CSS cursor must be settable on draggable item</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ cursor: pointer;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<div draggable='true'></div><div></div>
+
+<p>Move your mouse over the orange box and blue box. It should show the same &quot;pointer&quot; mouse cursor in both cases (the one normally used for links).</p>
+<p>This test only applies to platforms with a mouse cursor that can change to indicate drop status.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cursors/003.html b/testing/web-platform/tests/html/editing/dnd/platform/cursors/003.html
new file mode 100644
index 000000000..a1a5c4918
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cursors/003.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - should show no-drop for non-dropzones</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script type="text/javascript">
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+
+</script>
+
+<div draggable='true'></div><div></div>
+
+<p>Use your mouse to drag the orange box over the blue box. While dragging, the mouse cursor should appear as a &quot;no-drop&quot; cursor.<br>
+Release the drag. The cursor should revert to the default mouse cursor.</p>
+<p>This test only applies to platforms with a mouse cursor that can change to indicate drop status.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cursors/004.html b/testing/web-platform/tests/html/editing/dnd/platform/cursors/004.html
new file mode 100644
index 000000000..640ad37ca
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cursors/004.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - no-drop should override CSS cursor when dragging</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div:first-child {
+ cursor: pointer;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script type="text/javascript">
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+
+</script>
+
+<div draggable='true'></div><div></div>
+
+<p>Move your mouse over the orange box. It should show the &quot;pointer&quot; cursor (normally used for links).<br>
+Use your mouse to drag the orange box over the blue box. While dragging, the mouse cursor should appear as a &quot;no-drop&quot; cursor.<br>
+Release the drag. The cursor should revert to the default mouse cursor.</p>
+<p>This test only applies to platforms with a mouse cursor that can change to indicate drop status.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cursors/005.html b/testing/web-platform/tests/html/editing/dnd/platform/cursors/005.html
new file mode 100644
index 000000000..9aa78f25a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cursors/005.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - should show no-drop for refused-dropzones</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script type="text/javascript">
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+ blue.ondragenter = blue.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'none';
+ };
+ blue.ondrop = function(e) {
+ e.preventDefault();
+ };
+};
+
+</script>
+
+<div draggable='true'></div><div></div>
+
+<p>Use your mouse to drag the orange box over the blue box. While dragging, the mouse cursor should appear as a &quot;no-drop&quot; cursor.<br>
+Release the drag. The cursor should revert to the default mouse cursor.</p>
+<p>This test only applies to platforms with a mouse cursor that can change to indicate drop status.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cursors/006.html b/testing/web-platform/tests/html/editing/dnd/platform/cursors/006.html
new file mode 100644
index 000000000..61eb8ec30
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cursors/006.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - should show drop-allowed for dropzones</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script type="text/javascript">
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+ blue.ondragenter = blue.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ blue.ondrop = function(e) {
+ e.preventDefault();
+ };
+};
+
+</script>
+
+<div draggable='true'></div><div></div>
+
+<p>Use your mouse to drag the orange box over the blue box. While dragging over the blue box, the mouse cursor should appear as a &quot;drop-allowed&quot; or &quot;drop-clopy-allowed&quot; cursor.<br>
+Release the drag. The cursor should revert to the default mouse cursor.</p>
+<p>This test only applies to platforms with a mouse cursor that can change to indicate drop status.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cursors/007.html b/testing/web-platform/tests/html/editing/dnd/platform/cursors/007.html
new file mode 100644
index 000000000..c2abfaa31
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cursors/007.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - should show drop-allowed for move dropzones</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script type="text/javascript">
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'move';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+ blue.ondragenter = blue.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'move';
+ };
+ blue.ondrop = function(e) {
+ e.preventDefault();
+ };
+};
+
+</script>
+
+<div draggable='true'></div><div></div>
+
+<p>Use your mouse to drag the orange box over the blue box. While dragging over the blue box, the mouse cursor should appear as a &quot;drop-allowed&quot; or &quot;drop-move-allowed&quot; cursor.<br>
+Release the drag. The cursor should revert to the default mouse cursor.</p>
+<p>This test only applies to platforms with a mouse cursor that can change to indicate drop status.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cursors/008.html b/testing/web-platform/tests/html/editing/dnd/platform/cursors/008.html
new file mode 100644
index 000000000..53b843467
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cursors/008.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - cursor should show drop-allowed for file drops</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ left: 500px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script type="text/javascript">
+
+window.onload = function() {
+ var blue = document.getElementsByTagName('div')[1], fuchsia = document.getElementsByTagName('div')[2];
+ blue.ondragenter = blue.ondragover = function(e) {
+ //this test assumes the browser will default to opening the file if the page does not want it
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'none';
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ fuchsia.ondrop = function(e) {
+ e.preventDefault();
+ };
+};
+
+</script>
+
+<div></div><div></div><div></div>
+
+<p>Use your mouse to drag a *.html file from your computer's desktop over the three coloured squares on this page. The mouse cursor should appear as a &quot;drop-allowed&quot; cursor over all three squares.<br>
+Release the drag over the pink square. If a prompt appears, accept it. The cursor should revert to the default mouse cursor.</p>
+<p>This test only applies to platforms with a mouse cursor that can change to indicate drop status.</p>
+<p>This test assumes the browser will open dropped files natively if they are not handled by a script.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cursors/009.html b/testing/web-platform/tests/html/editing/dnd/platform/cursors/009.html
new file mode 100644
index 000000000..4f0953932
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cursors/009.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - should show drop-allowed for link dropzones</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ }
+ body > div + div {
+ background-color: navy;
+ left: 250px;
+ }
+ p:first-of-type {
+ margin-top: 220px;
+ }
+</style>
+
+<script type="text/javascript">
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'link';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+ blue.ondragenter = blue.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'link';
+ };
+ blue.ondrop = function(e) {
+ e.preventDefault();
+ };
+};
+
+</script>
+
+<div draggable='true'></div><div></div>
+
+<p>Use your mouse to drag the orange box over the blue box. While dragging over the blue box, the mouse cursor should appear as a &quot;drop-allowed&quot; or &quot;drop-link-allowed&quot; cursor.<br>
+Release the drag. The cursor should revert to the default mouse cursor.</p>
+<p>This test only applies to platforms with a mouse cursor that can change to indicate drop status.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cursors/010.html b/testing/web-platform/tests/html/editing/dnd/platform/cursors/010.html
new file mode 100644
index 000000000..bcc408e80
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cursors/010.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - drag ending over draggable element</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background: orange url(../../resources/100x100-navy.png) repeat-y scroll right top;
+ }
+</style>
+
+<script type="text/javascript">
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'link';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+};
+
+</script>
+
+<div draggable='true'></div>
+
+<p>Use your mouse to drag the orange box over the blue box, and release. While dragging over the blue box, the mouse cursor should appear as a &quot;no-drop&quot; cursor.<br>
+Release the drag. The cursor should revert to the default mouse cursor.</p>
+<p>This test only applies to platforms with a mouse cursor that can change to indicate drop status.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/cursors/011.html b/testing/web-platform/tests/html/editing/dnd/platform/cursors/011.html
new file mode 100644
index 000000000..15f78849f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/cursors/011.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - cursors after dragging outside window</title>
+<style>
+ body > div {
+ height: 100px;
+ width: 100px;
+ display: inline-block;
+ background: orange;
+ }
+ body > div + div {
+ background: blue;
+ color: black;
+ }
+</style>
+
+<script type="text/javascript">
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'all';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+ var copydiv = document.getElementsByTagName('div')[1];
+ copydiv.ondragenter = copydiv.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ var movediv = document.getElementsByTagName('div')[2];
+ movediv.ondragenter = movediv.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'move';
+ };
+ var linkdiv = document.getElementsByTagName('div')[3];
+ linkdiv.ondragenter = linkdiv.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'link';
+ };
+ var nodrop = document.getElementsByTagName('div')[4];
+ nodrop.ondragenter = nodrop.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'none';
+ };
+};
+
+</script>
+
+<div draggable='true'>&nbsp;</div>
+<div>Copy</div>
+<div>Move</div>
+<div>Link</div>
+<div>No-drop</div>
+
+<p>Use your mouse to drag the orange box out of the browser window (not over the system taskbar), then back into the browser window, and over each of the blue squares in turn.
+While dragging over the squares, the mouse cursor should be the one given by the text in the relevant square.</p>
+<p>This test only applies to platforms with a mouse cursor that can change to indicate drop status.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/drag-keypress.html b/testing/web-platform/tests/html/editing/dnd/platform/drag-keypress.html
new file mode 100644
index 000000000..adb543ad4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/drag-keypress.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - pressing tab while dragging</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+ body {
+ height: 5000px;
+ }
+ p {
+ margin-top: 1000px;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ window.scrollBy(0,1000);
+ document.getElementsByTagName('div')[0].ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text', 'dummy text');
+ };
+};
+</script>
+<noscript>Enable JavaScript and reload</noscript>
+<p>Drag the orange square. While still dragging, press the Tab key on your keyboard. Fail if the page scrolls.</p>
+<div draggable="true"></div> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/drag-link.html b/testing/web-platform/tests/html/editing/dnd/platform/drag-link.html
new file mode 100644
index 000000000..c308d504f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/drag-link.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dragging vs selecting links</title>
+ </head>
+ <body>
+
+ <p><a href="">Test link, test link, test link, test link, test link, test link, test link, test link, test link</a></p>
+ <p>Drag the test link above. When dragging vertically, it should drag the link. When dragging horizontally, it should select the text within the link.</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/drag-to-title.html b/testing/web-platform/tests/html/editing/dnd/platform/drag-to-title.html
new file mode 100644
index 000000000..b7fe31c13
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/drag-to-title.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>Dropping onto the title bar and UI</title>
+<script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('ul')[0].ondragstart = function () {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','c');
+ };
+};
+</script>
+<ul draggable="true">
+ <li>Drag this text upwards to the browser window's title bar.</li>
+ <li>Release the drag. Fail if the drag placeholder does not disappear.</li>
+ <li>Start dragging again over a blank part of the page (below the text). Fail if the placeholder starts following the mouse again.</li>
+ <li>Release the drag over the browser's UI (e.g. the address bar). Fail if the browser crashes.</li>
+</ul> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/file-drop-position.html b/testing/web-platform/tests/html/editing/dnd/platform/file-drop-position.html
new file mode 100644
index 000000000..62115c7cf
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/file-drop-position.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - mouse coordinates during drop</title>
+<style>
+ body > div {
+ height: 5px;
+ width: 5px;
+ background-color: orange;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragover = orange.ondragenter = orange.ondrop = function(e) {
+ e.preventDefault();
+ };
+};
+</script>
+
+<div></div>
+
+<p>Save <a href="../resources/fail.png">this image</a> to your desktop. Minimise your browser. Use your pointing device to drag the saved file from your desktop <strong>via your browser's button on your operating system's taskbar</strong> (so that it maximises your browser), onto the small orange box above this text, and release it. If a confirmation dialog appears, accept it. Fail if the browser simply displays the image.</p>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/file-os-to-os.html b/testing/web-platform/tests/html/editing/dnd/platform/file-os-to-os.html
new file mode 100644
index 000000000..b3db18077
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/file-os-to-os.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - dragging items from the OS to the OS, via the browser window</title>
+ </head>
+ <body>
+
+ <p>This test is only relevant on platforms where it is possible to switch applications in mid-drag (eg. alt+tab, dragging over taskbar buttons, dragging between restored windows).</p>
+ <p>This testcase requires an external application that accepts dragging and dropping of files - eg. your system's file manager. Ensure that two application windows are open for the external application, showing different folders.</p>
+ <p>Select a file in the first external application window. Drag the file over the browser window, then over the other external application window and release it. Pass if the file is copied/moved to the second window, as expected by the system.</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/file-to-system.html b/testing/web-platform/tests/html/editing/dnd/platform/file-to-system.html
new file mode 100644
index 000000000..af9840e8c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/file-to-system.html
@@ -0,0 +1,50 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dragging a file to the system</title>
+ <style type="text/css">
+span { display: inline-block; height: 100px; width: 100px; background: orange; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var drag = document.getElementsByTagName('span')[0];
+ drag.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'copy';
+ var filein = document.getElementsByTagName('input')[0];
+ if( !filein.files ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file API is not supported.';
+ return;
+ }
+ if( !filein.files[0] ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - no file was found in the file input.';
+ return;
+ }
+ var thefile = filein.files[0];
+ try {
+ e.dataTransfer.items.add(thefile);
+ } catch(err) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - error when adding file';
+ e.preventDefault();
+ return;
+ }
+ if( e.dataTransfer.files.length != 1 ) {
+ document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file was not attached to data store';
+ e.preventDefault();
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+ <div>This test only applies to platforms where dropping a file onto a folder in the system's file manager copies/moves the file to that folder.</div>
+ <ol>
+ <li>Open an empty folder in your system's file manager.</li>
+ <li>Select a non-empty file on your computer using the following input: <input type="file"></li>
+ <li>Drag the orange square onto the folder in your system's file manager, and release it:<br><span draggable="true"></span></li>
+ <li>Pass if the file is copied to the folder.</li>
+ </ol>
+ <p></p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/html-to-os-HELPER-FILE.html b/testing/web-platform/tests/html/editing/dnd/platform/html-to-os-HELPER-FILE.html
new file mode 100644
index 000000000..608026f20
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/html-to-os-HELPER-FILE.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - dragging HTML onto the OS - helper file</title>
+ </head>
+ <body>
+
+ <p>This is the helper file. Drop the paragraph here --&gt;</p>
+ <script type="text/javascript">
+document.body.contentEditable = true;
+ </script>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/html-to-os.html b/testing/web-platform/tests/html/editing/dnd/platform/html-to-os.html
new file mode 100644
index 000000000..6283c24ce
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/html-to-os.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - dragging HTML onto the OS</title>
+ </head>
+ <body>
+
+ <p>This test is only relevant on platforms where it is possible to switch applications in mid-drag (eg. alt+tab, dragging over taskbar buttons, dragging between restored windows).</p>
+ <p>This testcase requires an external application that accepts dropping of HTML from other applications - eg. Google Chrome and Internet Explorer (not Firefox). Load <a href="html-to-os-HELPER-FILE.html">the helper file</a> in the external application.</p>
+ <p draggable="true">Drag this paragraph to the other application and release it. De-select the text in that application if it is selected. Pass if &quot;Pass if this text is on a green background&quot; appears in the other application, and if it has a green background, and if the drag placeholder disappears when the drag is released.</p>
+ <script type="text/javascript">
+document.getElementsByTagName('p')[2].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text/html', '<span style="background:lime;color:black;">Pass if this text is on a green background</span>');
+};
+ </script>
+ <p>Disable JavaScript in this browser and repeat the test. Pass if the entire dragged paragraph appears in the other application. Vendors may optionally choose to ignore this requirement.</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/html-unicode-to-os.html b/testing/web-platform/tests/html/editing/dnd/platform/html-unicode-to-os.html
new file mode 100644
index 000000000..b915865d4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/html-unicode-to-os.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - dragging HTML onto the OS</title>
+ </head>
+ <body>
+
+ <p>This test is only relevant on platforms where it is possible to switch applications in mid-drag (eg. alt+tab, dragging over taskbar buttons, dragging between restored windows).</p>
+ <p>This testcase requires an external application that accepts dropping of unicode HTML from other applications - eg. Google Chrome (not Firefox or Internet Explorer). Load <a href="html-to-os-HELPER-FILE.html">the helper file</a> in the external application.</p>
+ <p draggable="true">Drag this paragraph to the other application and release it. De-select the text in that application if it is selected. Pass if &quot;Pass if this text is on a green background 中文אידישрусский&quot; appears in the other application, and if it has a green background, and if the drag placeholder disappears when the drag is released.</p>
+ <script type="text/javascript">
+document.getElementsByTagName('p')[2].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text/html', '<span style="background:lime;color:black;">Pass if this text is on a green background 中文אידישрусский</span>');
+};
+ </script>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/inputs-no-js.html b/testing/web-platform/tests/html/editing/dnd/platform/inputs-no-js.html
new file mode 100644
index 000000000..876f0b58a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/inputs-no-js.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dropping selections with JS disabled</title>
+ </head>
+ <body>
+
+ <ol>
+ <li>Disable JavaScript</li>
+ <li>Select some text in <input type="text" value="this input"> and drag it into the following input: <input type="text" value=""> - the text you dragged should appear in there.</li>
+ <li>Select some text in this sentence and drag it into the following input: <input type="text" value=""> - the text you dragged should appear in there.</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/001.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/001.html
new file mode 100644
index 000000000..0a527b499
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/001.html
@@ -0,0 +1,47 @@
+<!doctype html>
+<title>Interrupted drag with second drag attempt</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+ body > div + div {
+ background-color: navy;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1], fuchsia = document.getElementsByTagName('div')[2];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ blue.ondragenter = function (e) {
+ alert('JS alert');
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ };
+ fuchsia.ondrop = function (e) {
+ document.getElementsByTagName('ol')[0].textContent = e.dataTransfer.getData('text');
+ e.preventDefault();
+ };
+};
+</script>
+<div draggable="true"></div>
+<div></div>
+<div></div>
+
+<ol>
+ <li>Drag the orange square over the blue square.</li>
+ <li>An alert may appear. Do not dismiss it. If an alert does not appear, PASS, and ignore any further steps.</li>
+ <li>Drag a file that your browser cannot open natively from your computer onto a blank part of the page. If a download dialog appears at any point after this, cancel it, and return to this page.</li>
+ <li>Dismiss the alert without using the left mouse button (eg. use keyboard, or mouse gestures such as gesture-down,gesture-right).</li>
+ <li>Do a short drag and drop within the pink square. If nothing happens, PASS, and ignore any further steps.</li>
+ <li>The word &quot;PASS&quot; should appear in place of this text.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/002.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/002.html
new file mode 100644
index 000000000..4b1806ac0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/002.html
@@ -0,0 +1,49 @@
+<!doctype html>
+<title>Interrupted drag with second drag attempt and tab change</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+ body > div + div {
+ background-color: navy;
+ }
+ body > div + div + div {
+ background-color: fuchsia;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1], fuchsia = document.getElementsByTagName('div')[2];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ blue.ondragenter = function (e) {
+ alert('JS alert');
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ };
+ fuchsia.ondrop = function (e) {
+ document.getElementsByTagName('ol')[0].textContent = e.dataTransfer.getData('text');
+ e.preventDefault();
+ };
+};
+</script>
+<div draggable="true"></div>
+<div></div>
+<div></div>
+
+<ol>
+ <li>Make sure at least one other tab is open.</li>
+ <li>Drag the orange square over the blue square.</li>
+ <li>An alert may appear. Do not dismiss it. If an alert does not appear, PASS, and ignore any further steps.</li>
+ <li>Click the other tab to focus it (or focus it in whatever way works). If you cannot change tabs, PASS, and ignore any further steps.</li>
+ <li>Drag a file that your browser cannot open natively from your computer and drop onto that page, then click the tab for this page to return here. If a download dialog appears at any point after this, cancel it, and return to this page.</li>
+ <li>Dismiss the alert without using the left mouse button (eg. use keyboard, or mouse gestures such as gesture-down,gesture-right).</li>
+ <li>Do a short drag and drop within the pink square. If nothing happens, PASS, and ignore any further steps.</li>
+ <li>The word &quot;PASS&quot; should appear in place of this text.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/003.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/003.html
new file mode 100644
index 000000000..85f20badf
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/003.html
@@ -0,0 +1,59 @@
+<!doctype html>
+<title>Interrupted drag with second in-document drag attempt</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+ body > div + div {
+ background-color: navy;
+ }
+ body > div + div + div {
+ background-color: yellow;
+ }
+ body > div + div + div + div {
+ background-color: fuchsia;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1], yellow = document.getElementsByTagName('div')[2], fuchsia = document.getElementsByTagName('div')[3];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ yellow.ondragstart = function (e) {
+ e.dataTransfer.setData('text','FAIL');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ blue.ondragenter = function (e) {
+ alert('JS alert');
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ };
+ fuchsia.ondrop = function (e) {
+ document.getElementsByTagName('ol')[0].textContent = e.dataTransfer.getData('text');
+ e.preventDefault();
+ };
+};
+</script>
+<div draggable="true"></div>
+<div></div>
+<div draggable="true"></div>
+<div></div>
+
+<ol>
+ <li>Open this page in two separate tabs, and start on tab #1.</li>
+ <li>Drag the orange square over the blue square.</li>
+ <li>An alert may appear. Do not dismiss it. If an alert does not appear, PASS, and ignore any further steps.</li>
+ <li>Click the other tab to focus it (or focus it in whatever way works). If you cannot change tabs, PASS, and ignore any further steps.</li>
+ <li>On tab #2, drag the yellow square over the blue square. If you cannot drag the yellow square, PASS, and ignore any further steps.</li>
+ <li>An alert may appear. Do not dismiss it.</li>
+ <li>Return to tab #1.</li>
+ <li>Dismiss the alert without using the left mouse button (eg. use keyboard, or mouse gestures such as gesture-down,gesture-right).</li>
+ <li>Do a short drag and drop within the pink square. If nothing happens, PASS, and ignore any further steps.</li>
+ <li>The word &quot;PASS&quot; should appear in place of this text.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/004.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/004.html
new file mode 100644
index 000000000..c66c4681a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/004.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<title>File drag during prompt for upload</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragenter = orange.ondragover = function (e) {
+ e.preventDefault();
+ };
+ orange.ondrop = function (e) {
+ e.preventDefault();
+ document.getElementsByTagName('ol')[0].innerHTML = ( e.dataTransfer.files[0] && e.dataTransfer.files[0].name == 'pass.txt' ) ? 'PASS' : 'FAIL';
+ };
+};
+</script>
+<div draggable="true"></div>
+
+<ol>
+ <li>Save <a href="pass.txt">pass.txt</a> and <a href="fail.txt">fail.txt</a> onto your computer.</li>
+ <li>Drag pass.txt from your computer onto the orange square.</li>
+ <li>A prompt should appear. Do not dismiss it. If a prompt does not appear, ignore any further steps, and check the tests in ../../file/</li>
+ <li>Drag fail.txt from your computer onto a blank part of this page. Fail if this page is replaced.</li>
+ <li>Accept the prompt. Fail if nothing happens.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/005.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/005.html
new file mode 100644
index 000000000..efb5a5b79
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/005.html
@@ -0,0 +1,35 @@
+<!doctype html>
+<title>File drag and tab change during prompt for upload</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragenter = orange.ondragover = function (e) {
+ e.preventDefault();
+ };
+ orange.ondrop = function (e) {
+ e.preventDefault();
+ document.getElementsByTagName('ol')[0].innerHTML = ( e.dataTransfer.files[0] && e.dataTransfer.files[0].name );
+ };
+};
+</script>
+<div draggable="true"></div>
+
+<ol>
+ <li>Save <a href="file1.txt">file1.txt</a> and <a href="file2.txt">file2.txt</a> onto your computer.</li>
+ <li>Open this page in two separate tabs, and start on tab #1.</li>
+ <li>Drag file1.txt from your computer onto the orange square.</li>
+ <li>A prompt should appear. Do not dismiss it. If a prompt does not appear, ignore any further steps, and check the tests in ../../file/</li>
+ <li>Click the other tab to focus it (or focus it in whatever way works). If you cannot change tabs, PASS, and ignore any further steps.</li>
+ <li>Drag file2.txt from your computer onto the orange square. Fail if this text (but not the orange square) is replaced without any prompt.</li>
+ <li>If a prompt appears, do not dismiss it.</li>
+ <li>Return to tab #1.</li>
+ <li>Accept the prompt. Fail if it cannot be accepted. Pass if this text (but not the orange square) is replaced with the text: file1.txt</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/006.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/006.html
new file mode 100644
index 000000000..83e6fa7f4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/006.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<title>Alert during dragstart</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1], hasfired = false;
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ if( hasfired ) { return; }
+ hasfired = true;
+ alert('JS alert');
+ };
+};
+</script>
+<div draggable="true"></div>
+
+<ol>
+ <li>Drag the orange square downwards until the drag placeholder appears.</li>
+ <li>An alert may appear - release the mouse over the page, not the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag.</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+ <li>Try to drag the orange square downwards again. Fail if that is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/007.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/007.html
new file mode 100644
index 000000000..1d79b85ef
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/007.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<title>Alert during drag</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1], hasfired = false;
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ orange.ondrag = function (e) {
+ if( hasfired ) { return; }
+ hasfired = true;
+ alert('JS alert');
+ };
+};
+</script>
+<div draggable="true"></div>
+
+<ol>
+ <li>Drag the orange square downwards until the drag placeholder appears.</li>
+ <li>An alert may appear - release the mouse over the page, not the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag.</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+ <li>Try to drag the orange square downwards again. Fail if that is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/008.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/008.html
new file mode 100644
index 000000000..b2de74169
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/008.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<title>Alert during dragenter</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+ body > div + div {
+ background-color: navy;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ alert('JS alert');
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ };
+};
+</script>
+<div draggable="true"></div>
+<div></div>
+
+<ol>
+ <li>Drag the orange square over the blue square.</li>
+ <li>An alert may appear - release the mouse over the page, not the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag.</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+ <li>Try to drag the orange square downwards. Fail if it is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/009.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/009.html
new file mode 100644
index 000000000..ce1fec808
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/009.html
@@ -0,0 +1,42 @@
+<!doctype html>
+<title>Alert during dragover</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+ body > div + div {
+ background-color: navy;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1], hasfired = false;
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ if( hasfired ) { return; }
+ hasfired = true;
+ alert('JS alert');
+ };
+};
+</script>
+<div draggable="true"></div>
+<div></div>
+
+<ol>
+ <li>Drag the orange square over the blue square.</li>
+ <li>An alert may appear - release the mouse over the page, not the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag.</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+ <li>Try to drag the orange square downwards. Fail if it is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/010.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/010.html
new file mode 100644
index 000000000..c5ec66488
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/010.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<title>Alert during dragleave</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+ body > div + div {
+ background-color: navy;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ blue.ondragenter = blue.ondragover = function (e) {
+ e.preventDefault();
+ };
+ blue.ondragleave = function (e) {
+ alert('JS alert');
+ };
+};
+</script>
+<div draggable="true"></div>
+<div></div>
+
+<ol>
+ <li>Drag the orange square over the blue square, then back over the orange square.</li>
+ <li>An alert may appear - release the mouse over the page, not the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag.</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+ <li>Try to drag the orange square downwards. Fail if it is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/011.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/011.html
new file mode 100644
index 000000000..61b73ba84
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/011.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<title>Alert during drop</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+ body > div + div {
+ background-color: navy;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ blue.ondragenter = blue.ondragover = function (e) {
+ e.preventDefault();
+ };
+ blue.ondrop = function (e) {
+ e.preventDefault();
+ alert('JS alert');
+ };
+};
+</script>
+<div draggable="true"></div>
+<div></div>
+
+<ol>
+ <li>Drag the orange square over the blue square, then release it.</li>
+ <li>An alert may appear - release the mouse over the page, not the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right).</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+ <li>Try to drag the orange square downwards. Fail if it is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/012.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/012.html
new file mode 100644
index 000000000..bcf65ce9e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/012.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<title>Alert during dragend</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+ body > div + div {
+ background-color: navy;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1], hasfired = false;
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ blue.ondragenter = blue.ondragover = function (e) {
+ e.preventDefault();
+ };
+ blue.ondrop = function (e) {
+ e.preventDefault();
+ };
+ orange.ondragend = function (e) {
+ if( hasfired ) { return; }
+ hasfired = true;
+ alert('JS alert');
+ };
+};
+</script>
+<div draggable="true"></div>
+<div></div>
+
+<ol>
+ <li>Drag the orange square over the blue square, then release it.</li>
+ <li>An alert may appear - release the mouse over the page, not the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right).</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+ <li>Try to drag the orange square downwards. Fail if it is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/013.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/013.html
new file mode 100644
index 000000000..31dd82e51
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/013.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - drag interrupted by alert must not break mouse interaction with UI</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+ body > div + div {
+ margin-top: 10px;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text', 'dummy text');
+ };
+ blue.ondragover = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ if( !window.doneonce ) {
+ alert('2. It should also ideally be possible to dismiss this dialog with your mouse/pointing device (do not use mouse gestures).');
+ }
+ window.doneonce = true;
+ };
+ blue.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ alert('1. It should ideally be possible to dismiss this dialog with your mouse/pointing device (do not use mouse gestures).');
+ };
+ blue.ondrop = function(e) {
+ e.preventDefault();
+ };
+};
+</script>
+
+<p>Drag the orange square onto the blue square.</p>
+<div draggable="true"></div>
+<div></div>
+
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/014.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/014.html
new file mode 100644
index 000000000..94258e44a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/014.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - drop interrupted by alert must not break mouse interaction with UI</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ }
+ body > div + div {
+ margin-top: 10px;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ }
+</style>
+
+<script>
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text', 'dummy text');
+ };
+ blue.ondragover = blue.ondragenter = function(e) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ };
+ blue.ondrop = function(e) {
+ e.preventDefault();
+ alert('It should ideally be possible to dismiss this dialog with your mouse/pointing device (do not use mouse gestures).');
+ };
+};
+</script>
+
+<p>Drag the orange square onto the blue square.</p>
+<div draggable="true"></div>
+<div></div>
+
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/015.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/015.html
new file mode 100644
index 000000000..1fc6ef84d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/015.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<title>Alert during dragstart with release over dialog</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1], hasfired = false;
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ if( hasfired ) { return; }
+ hasfired = true;
+ alert('Release the mouse over this dialog');
+ };
+};
+</script>
+<div draggable="true"></div>
+
+<ol>
+ <li>Drag the orange square downwards until the drag placeholder appears.</li>
+ <li>An alert may appear - release the mouse over the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag.</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+ <li>Try to drag the orange square downwards again. Fail if that is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/016.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/016.html
new file mode 100644
index 000000000..f28191d46
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/016.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<title>Alert during drag with release over dialog</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1], hasfired = false;
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ orange.ondrag = function (e) {
+ if( hasfired ) { return; }
+ hasfired = true;
+ alert('Release the mouse over this dialog');
+ };
+};
+</script>
+<div draggable="true"></div>
+
+<ol>
+ <li>Drag the orange square downwards until the drag placeholder appears.</li>
+ <li>An alert may appear - release the mouse over the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag.</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+ <li>Try to drag the orange square downwards again. Fail if that is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/017.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/017.html
new file mode 100644
index 000000000..6e3926c9d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/017.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<title>Alert during dragenter with release over dialog</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+ body > div + div {
+ background-color: navy;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ alert('Release the mouse over this dialog');
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ };
+};
+</script>
+<div draggable="true"></div>
+<div></div>
+
+<ol>
+ <li>Drag the orange square over the blue square.</li>
+ <li>An alert may appear - release the mouse over the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag.</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+ <li>Try to drag the orange square downwards. Fail if it is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/018.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/018.html
new file mode 100644
index 000000000..6fdb79aa9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/018.html
@@ -0,0 +1,42 @@
+<!doctype html>
+<title>Alert during dragover with release over dialog</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+ body > div + div {
+ background-color: navy;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1], hasfired = false;
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ if( hasfired ) { return; }
+ hasfired = true;
+ alert('Release the mouse over this dialog');
+ };
+};
+</script>
+<div draggable="true"></div>
+<div></div>
+
+<ol>
+ <li>Drag the orange square over the blue square.</li>
+ <li>An alert may appear - release the mouse over the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag.</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+ <li>Try to drag the orange square downwards. Fail if it is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/019.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/019.html
new file mode 100644
index 000000000..d9af799a5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/019.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<title>Alert during dragleave with release over dialog</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+ body > div + div {
+ background-color: navy;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], blue = document.getElementsByTagName('div')[1];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','PASS');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ blue.ondragenter = blue.ondragover = function (e) {
+ e.preventDefault();
+ };
+ blue.ondragleave = function (e) {
+ alert('Release the mouse over this dialog');
+ };
+};
+</script>
+<div draggable="true"></div>
+<div></div>
+
+<ol>
+ <li>Drag the orange square over the blue square, then back over the orange square.</li>
+ <li>An alert may appear - release the mouse over the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag.</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+ <li>Try to drag the orange square downwards. Fail if it is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/020.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/020.html
new file mode 100644
index 000000000..c57b25dcb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/020.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<title>Alert during dragenter for file drag</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragenter = function (e) {
+ e.preventDefault();
+ alert('JS alert');
+ };
+ orange.ondragover = orange.ondrop = function (e) {
+ e.preventDefault();
+ };
+};
+</script>
+<div draggable="true"></div>
+
+<ol>
+ <li>Drag a file (one that your browser cannot open natively, such as an executable file) from your system file manager over the orange square.</li>
+ <li>An alert may appear - release the mouse over a blank part of the page, not the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag and accept any prompt to upload the file.</li>
+ <li>If a file download dialog appears, cancel it and return to this page.</li>
+ <li>Fail if the alert reappears.</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/021.html b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/021.html
new file mode 100644
index 000000000..e30416b4f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/021.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<title>Alert during dragenter for file drag with release over dialog</title>
+<style>
+ body > div {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragenter = function (e) {
+ e.preventDefault();
+ alert('JS alert');
+ };
+ orange.ondragover = orange.ondrop = function (e) {
+ e.preventDefault();
+ };
+};
+</script>
+<div draggable="true"></div>
+
+<ol>
+ <li>Drag a file (one that your browser cannot open natively, such as an executable file) from your system file manager over the orange square.</li>
+ <li>An alert may appear - release the mouse over the dialog. Dismiss it (you may need to use keyboard or mouse gestures such as gesture-down,gesture-right). If it does not appear, release the drag and accept any prompt to upload the file.</li>
+ <li>If a file download dialog appears, cancel it and return to this page.</li>
+ <li>Fail if the alert reappears.</li>
+ <li>The mouse cursor may continue to show that a drag is in operation. If so, attempt to select some of this text with the mouse before continuing to the text step.</li>
+ <li>Fail if the mouse continues to show that a drag is in operation.</li>
+ <li>Try to select some text in this sentence. Fail if it is not possible.</li>
+</ol> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/fail.txt b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/fail.txt
new file mode 100644
index 000000000..fc2616251
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/fail.txt
@@ -0,0 +1 @@
+FAIL \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/file1.txt b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/file1.txt
new file mode 100644
index 000000000..6c8db5df2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/file1.txt
@@ -0,0 +1 @@
+file 1 \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/file2.txt b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/file2.txt
new file mode 100644
index 000000000..dd4128ed9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/file2.txt
@@ -0,0 +1 @@
+file 2 \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/interrupt/pass.txt b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/pass.txt
new file mode 100644
index 000000000..fc2616251
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/interrupt/pass.txt
@@ -0,0 +1 @@
+FAIL \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/keyboardshortcuts.html b/testing/web-platform/tests/html/editing/dnd/platform/keyboardshortcuts.html
new file mode 100644
index 000000000..13340f442
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/keyboardshortcuts.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Keyboard shortcuts during drag/drop</title>
+ </head>
+ <body>
+
+ <ol>
+ <li>Select some text in this sentence and begin dragging it.</li>
+ <li>While dragging, use your keyboard shortcut to reload the page. It should work without cancelling the drag.</li>
+ <li>While dragging, use your keyboard shortcut to select all text on the page. It should work without cancelling the drag.</li>
+ <li>While dragging, use your keyboard shortcut to open a new tab. It should work without cancelling the drag.</li>
+ <li>While dragging, use your keyboard shortcut to switch to another tab. It should work without cancelling the drag.</li>
+ <li>While dragging, use your keyboard shortcuts to go back and forward in history (<a href="#next">use this link first to add a history entry if needed</a>). It should work without cancelling the drag.</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/modifiers/all.html b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/all.html
new file mode 100644
index 000000000..3f91fb5fe
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/all.html
@@ -0,0 +1,175 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Modifier keys selecting dropEffect with 'all'</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+div:first-child + div + div {
+ height: 100px;
+ width: 100px;
+ background: fuchsia;
+ display: inline-block;
+}
+table {
+ display: inline-table;
+ margin-right: 1em;
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px solid black;
+}
+thead th {
+ background: silver;
+ color: black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var countedDrops = 0, bde, bdo, bdo2, fde, fdo, fdr;
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','http://example.com/');
+ e.dataTransfer.effectAllowed = 'all';
+ bde = bdo = bdo2 = fde = fdo = fdr = '';
+ };
+ var blue = document.getElementsByTagName('div')[1];
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ if( !bde ) { bde = e.dataTransfer.dropEffect; }
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ if( !bdo ) {
+ bdo = e.dataTransfer.dropEffect;
+ }
+ //bdo2 always collects dropEffect, since it can change multiple times in rapid succession when pressing multiple modifiers
+ //test cares about the last dropEffect that was seen before leaving the blue square, and that will be stored in bdo2
+ bdo2 = e.dataTransfer.dropEffect;
+ };
+ var fuchsia = document.getElementsByTagName('div')[2];
+ fuchsia.ondragenter = function (e) {
+ e.preventDefault();
+ if( !fde ) { fde = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ if( !fdo ) { fdo = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ fdr = e.dataTransfer.dropEffect;
+ };
+ orange.ondragend = function (e) {
+ var ode = e.dataTransfer.dropEffect, temparray;
+ if( bde == bdo && bdo2 == fdr && fde == fdr && fdo == fdr && ode == fdr ) {
+ if( bde == fdr ) {
+ tmparray = [fdr];
+ } else {
+ tmparray = [bde,fdr];
+ }
+ } else if( bde == bdo && bdo2 == fdo && fde == fdo && !fdr ) {
+ tmparray = [bde,fdo,ode];
+ } else {
+ tmparray = [bde,bdo,bdo2,fde,fdo,fdr,ode];
+ }
+ tmparray[ tmparray.length - 1 ] = '<strong>' + tmparray[ tmparray.length - 1 ] + '<\/strong>';
+ document.getElementsByTagName('div')[3].innerHTML = (++countedDrops) + '. ' + tmparray.join('=&gt;');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <div></div>
+ <div><strong>&nbsp;</strong></div>
+ <ol>
+ <li>Drag the orange square over the blue square</li>
+ <li>Press the relevant modifier keys for your platform</li>
+ <li>Continue dragging over the pink square</li>
+ <li>Release the drag, then the keys</li>
+ <li>Check that the correct drop effect is produced in each case. If the mouse cursor can change to indicate the final type of drop effect that will take place, it should change to the relevant type (the one in bold) once the modifier keys are pressed.</li>
+ </ol>
+ <!-- Windows Explorer uses Ctrl for copy, Shift for move, Alt or Ctrl+Shift for link. -->
+ <!-- Anything else invalidates the modifiers, and reverts to default. -->
+ <table>
+ <caption>Windows</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td>None</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift</td><td>copy=&gt;<strong>move</strong></td></tr>
+ <tr><td>Alt</td><td>copy=&gt;<strong>link</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td>copy=&gt;<strong>link</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Alt+Shift</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td><strong>copy</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- KDE Konqueror uses Ctrl for copy, Shift for move, Ctrl+Shift for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <!-- Gnome Nautilus uses Ctrl for copy, Shift for move, Ctrl+Shift for link (and Alt to open a context menu). -->
+ <!-- Anything else (including Alt when combined with other modifiers) is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Unix/Linux</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td>None</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift</td><td>copy=&gt;<strong>move</strong></td></tr>
+ <tr><td>Alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td>copy=&gt;<strong>link</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Alt+Shift</td><td>copy=&gt;<strong>move</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td>copy=&gt;<strong>link</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- Mac Finder uses Option for copy, Command for move, Command+Option for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Mac</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td>None</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift</td><td><strong>copy</strong></td></tr>
+ <tr><td>Option/alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Command</td><td>copy=&gt;<strong>move</strong></td></tr>
+
+ <tr><td>Ctrl+Shift</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Option</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Command</td><td>copy=&gt;<strong>move</strong></td></tr>
+ <tr><td>Shift+Option</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift+Command</td><td>copy=&gt;<strong>move</strong></td></tr>
+ <tr><td>Command+Option</td><td>copy=&gt;<strong>link</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Option</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Shift+Command</td><td>copy=&gt;<strong>move</strong></td></tr>
+ <tr><td>Ctrl+Command+Option</td><td>copy=&gt;<strong>link</strong></td></tr>
+ <tr><td>Shift+Command+Option</td><td>copy=&gt;<strong>link</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Command+Option</td><td>copy=&gt;<strong>link</strong></td></tr>
+ </tbody>
+ </table>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/modifiers/copy.html b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/copy.html
new file mode 100644
index 000000000..6366dd4dc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/copy.html
@@ -0,0 +1,175 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Modifier keys selecting dropEffect with 'copy'</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+div:first-child + div + div {
+ height: 100px;
+ width: 100px;
+ background: fuchsia;
+ display: inline-block;
+}
+table {
+ display: inline-table;
+ margin-right: 1em;
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px solid black;
+}
+thead th {
+ background: silver;
+ color: black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var countedDrops = 0, bde, bdo, bdo2, fde, fdo, fdr;
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','http://example.com/');
+ e.dataTransfer.effectAllowed = 'copy';
+ bde = bdo = bdo2 = fde = fdo = fdr = '';
+ };
+ var blue = document.getElementsByTagName('div')[1];
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ if( !bde ) { bde = e.dataTransfer.dropEffect; }
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ if( !bdo ) {
+ bdo = e.dataTransfer.dropEffect;
+ }
+ //bdo2 always collects dropEffect, since it can change multiple times in rapid succession when pressing multiple modifiers
+ //test cares about the last dropEffect that was seen before leaving the blue square, and that will be stored in bdo2
+ bdo2 = e.dataTransfer.dropEffect;
+ };
+ var fuchsia = document.getElementsByTagName('div')[2];
+ fuchsia.ondragenter = function (e) {
+ e.preventDefault();
+ if( !fde ) { fde = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ if( !fdo ) { fdo = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ fdr = e.dataTransfer.dropEffect;
+ };
+ orange.ondragend = function (e) {
+ var ode = e.dataTransfer.dropEffect, temparray;
+ if( bde == bdo && bdo2 == fdr && fde == fdr && fdo == fdr && ode == fdr ) {
+ if( bde == fdr ) {
+ tmparray = [fdr];
+ } else {
+ tmparray = [bde,fdr];
+ }
+ } else if( bde == bdo && bdo2 == fdo && fde == fdo && !fdr ) {
+ tmparray = [bde,fdo,ode];
+ } else {
+ tmparray = [bde,bdo,bdo2,fde,fdo,fdr,ode];
+ }
+ tmparray[ tmparray.length - 1 ] = '<strong>' + tmparray[ tmparray.length - 1 ] + '<\/strong>';
+ document.getElementsByTagName('div')[3].innerHTML = (++countedDrops) + '. ' + tmparray.join('=&gt;');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <div></div>
+ <div><strong>&nbsp;</strong></div>
+ <ol>
+ <li>Drag the orange square over the blue square</li>
+ <li>Press the relevant modifier keys for your platform</li>
+ <li>Continue dragging over the pink square</li>
+ <li>Release the drag, then the keys</li>
+ <li>Check that the correct drop effect is produced in each case. If the mouse cursor can change to indicate the final type of drop effect that will take place, it should change to the relevant type (the one in bold) once the modifier keys are pressed.</li>
+ </ol>
+ <!-- Windows Explorer uses Ctrl for copy, Shift for move, Alt or Ctrl+Shift for link. -->
+ <!-- Anything else invalidates the modifiers, and reverts to default. -->
+ <table>
+ <caption>Windows</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td>None</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Alt</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Alt+Shift</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td><strong>copy</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- KDE Konqueror uses Ctrl for copy, Shift for move, Ctrl+Shift for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <!-- Gnome Nautilus uses Ctrl for copy, Shift for move, Ctrl+Shift for link (and Alt to open a context menu). -->
+ <!-- Anything else (including Alt when combined with other modifiers) is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Unix/Linux</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td><strong>none</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Alt+Shift</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- Mac Finder uses Option for copy, Command for move, Command+Option for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Mac</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td><strong>none</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift</td><td><strong>copy</strong></td></tr>
+ <tr><td>Option/alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Command</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+
+ <tr><td>Ctrl+Shift</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Option</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Command</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift+Option</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift+Command</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Command+Option</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Option</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Shift+Command</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Command+Option</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift+Command+Option</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Command+Option</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+ </tbody>
+ </table>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/modifiers/copylink.html b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/copylink.html
new file mode 100644
index 000000000..27d9126a9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/copylink.html
@@ -0,0 +1,175 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Modifier keys selecting dropEffect with 'copyLink'</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+div:first-child + div + div {
+ height: 100px;
+ width: 100px;
+ background: fuchsia;
+ display: inline-block;
+}
+table {
+ display: inline-table;
+ margin-right: 1em;
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px solid black;
+}
+thead th {
+ background: silver;
+ color: black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var countedDrops = 0, bde, bdo, bdo2, fde, fdo, fdr;
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','http://example.com/');
+ e.dataTransfer.effectAllowed = 'copyLink';
+ bde = bdo = bdo2 = fde = fdo = fdr = '';
+ };
+ var blue = document.getElementsByTagName('div')[1];
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ if( !bde ) { bde = e.dataTransfer.dropEffect; }
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ if( !bdo ) {
+ bdo = e.dataTransfer.dropEffect;
+ }
+ //bdo2 always collects dropEffect, since it can change multiple times in rapid succession when pressing multiple modifiers
+ //test cares about the last dropEffect that was seen before leaving the blue square, and that will be stored in bdo2
+ bdo2 = e.dataTransfer.dropEffect;
+ };
+ var fuchsia = document.getElementsByTagName('div')[2];
+ fuchsia.ondragenter = function (e) {
+ e.preventDefault();
+ if( !fde ) { fde = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ if( !fdo ) { fdo = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ fdr = e.dataTransfer.dropEffect;
+ };
+ orange.ondragend = function (e) {
+ var ode = e.dataTransfer.dropEffect, temparray;
+ if( bde == bdo && bdo2 == fdr && fde == fdr && fdo == fdr && ode == fdr ) {
+ if( bde == fdr ) {
+ tmparray = [fdr];
+ } else {
+ tmparray = [bde,fdr];
+ }
+ } else if( bde == bdo && bdo2 == fdo && fde == fdo && !fdr ) {
+ tmparray = [bde,fdo,ode];
+ } else {
+ tmparray = [bde,bdo,bdo2,fde,fdo,fdr,ode];
+ }
+ tmparray[ tmparray.length - 1 ] = '<strong>' + tmparray[ tmparray.length - 1 ] + '<\/strong>';
+ document.getElementsByTagName('div')[3].innerHTML = (++countedDrops) + '. ' + tmparray.join('=&gt;');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <div></div>
+ <div><strong>&nbsp;</strong></div>
+ <ol>
+ <li>Drag the orange square over the blue square</li>
+ <li>Press the relevant modifier keys for your platform</li>
+ <li>Continue dragging over the pink square</li>
+ <li>Release the drag, then the keys</li>
+ <li>Check that the correct drop effect is produced in each case. If the mouse cursor can change to indicate the final type of drop effect that will take place, it should change to the relevant type (the one in bold) once the modifier keys are pressed.</li>
+ </ol>
+ <!-- Windows Explorer uses Ctrl for copy, Shift for move, Alt or Ctrl+Shift for link. -->
+ <!-- Anything else invalidates the modifiers, and reverts to default. -->
+ <table>
+ <caption>Windows</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td>None</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Alt</td><td>copy=&gt;<strong>link</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td>copy=&gt;<strong>link</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Alt+Shift</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td><strong>copy</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- KDE Konqueror uses Ctrl for copy, Shift for move, Ctrl+Shift for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <!-- Gnome Nautilus uses Ctrl for copy, Shift for move, Ctrl+Shift for link (and Alt to open a context menu). -->
+ <!-- Anything else (including Alt when combined with other modifiers) is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Unix/Linux</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td><strong>none</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td>copy=&gt;<strong>link</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Alt+Shift</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td>copy=&gt;<strong>link</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- Mac Finder uses Option for copy, Command for move, Command+Option for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Mac</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td><strong>none</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift</td><td><strong>copy</strong></td></tr>
+ <tr><td>Option/alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Command</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+
+ <tr><td>Ctrl+Shift</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Option</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Command</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift+Option</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift+Command</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Command+Option</td><td>copy=&gt;<strong>link</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Option</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Shift+Command</td><td>copy=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Command+Option</td><td>copy=&gt;<strong>link</strong></td></tr>
+ <tr><td>Shift+Command+Option</td><td>copy=&gt;<strong>link</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Command+Option</td><td>copy=&gt;<strong>link</strong></td></tr>
+ </tbody>
+ </table>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/modifiers/copymove.html b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/copymove.html
new file mode 100644
index 000000000..352e831dc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/copymove.html
@@ -0,0 +1,175 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Modifier keys selecting dropEffect with 'copyMove'</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+div:first-child + div + div {
+ height: 100px;
+ width: 100px;
+ background: fuchsia;
+ display: inline-block;
+}
+table {
+ display: inline-table;
+ margin-right: 1em;
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px solid black;
+}
+thead th {
+ background: silver;
+ color: black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var countedDrops = 0, bde, bdo, bdo2, fde, fdo, fdr;
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','http://example.com/');
+ e.dataTransfer.effectAllowed = 'copyMove';
+ bde = bdo = bdo2 = fde = fdo = fdr = '';
+ };
+ var blue = document.getElementsByTagName('div')[1];
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ if( !bde ) { bde = e.dataTransfer.dropEffect; }
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ if( !bdo ) {
+ bdo = e.dataTransfer.dropEffect;
+ }
+ //bdo2 always collects dropEffect, since it can change multiple times in rapid succession when pressing multiple modifiers
+ //test cares about the last dropEffect that was seen before leaving the blue square, and that will be stored in bdo2
+ bdo2 = e.dataTransfer.dropEffect;
+ };
+ var fuchsia = document.getElementsByTagName('div')[2];
+ fuchsia.ondragenter = function (e) {
+ e.preventDefault();
+ if( !fde ) { fde = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ if( !fdo ) { fdo = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ fdr = e.dataTransfer.dropEffect;
+ };
+ orange.ondragend = function (e) {
+ var ode = e.dataTransfer.dropEffect, temparray;
+ if( bde == bdo && bdo2 == fdr && fde == fdr && fdo == fdr && ode == fdr ) {
+ if( bde == fdr ) {
+ tmparray = [fdr];
+ } else {
+ tmparray = [bde,fdr];
+ }
+ } else if( bde == bdo && bdo2 == fdo && fde == fdo && !fdr ) {
+ tmparray = [bde,fdo,ode];
+ } else {
+ tmparray = [bde,bdo,bdo2,fde,fdo,fdr,ode];
+ }
+ tmparray[ tmparray.length - 1 ] = '<strong>' + tmparray[ tmparray.length - 1 ] + '<\/strong>';
+ document.getElementsByTagName('div')[3].innerHTML = (++countedDrops) + '. ' + tmparray.join('=&gt;');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <div></div>
+ <div><strong>&nbsp;</strong></div>
+ <ol>
+ <li>Drag the orange square over the blue square</li>
+ <li>Press the relevant modifier keys for your platform</li>
+ <li>Continue dragging over the pink square</li>
+ <li>Release the drag, then the keys</li>
+ <li>Check that the correct drop effect is produced in each case. If the mouse cursor can change to indicate the final type of drop effect that will take place, it should change to the relevant type (the one in bold) once the modifier keys are pressed.</li>
+ </ol>
+ <!-- Windows Explorer uses Ctrl for copy, Shift for move, Alt or Ctrl+Shift for link. -->
+ <!-- Anything else invalidates the modifiers, and reverts to default. -->
+ <table>
+ <caption>Windows</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td>None</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift</td><td>copy=&gt;<strong>move</strong></td></tr>
+ <tr><td>Alt</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Alt+Shift</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td><strong>copy</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- KDE Konqueror uses Ctrl for copy, Shift for move, Ctrl+Shift for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <!-- Gnome Nautilus uses Ctrl for copy, Shift for move, Ctrl+Shift for link (and Alt to open a context menu). -->
+ <!-- Anything else (including Alt when combined with other modifiers) is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Unix/Linux</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td><strong>none</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift</td><td>copy=&gt;<strong>move</strong></td></tr>
+ <tr><td>Alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Alt+Shift</td><td>copy=&gt;<strong>move</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- Mac Finder uses Option for copy, Command for move, Command+Option for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Mac</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td><strong>none</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift</td><td><strong>copy</strong></td></tr>
+ <tr><td>Option/alt</td><td><strong>copy</strong></td></tr>
+ <tr><td>Command</td><td>copy=&gt;<strong>move</strong></td></tr>
+
+ <tr><td>Ctrl+Shift</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Option</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Command</td><td>copy=&gt;<strong>move</strong></td></tr>
+ <tr><td>Shift+Option</td><td><strong>copy</strong></td></tr>
+ <tr><td>Shift+Command</td><td>copy=&gt;<strong>move</strong></td></tr>
+ <tr><td>Command+Option</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Option</td><td><strong>copy</strong></td></tr>
+ <tr><td>Ctrl+Shift+Command</td><td>copy=&gt;<strong>move</strong></td></tr>
+ <tr><td>Ctrl+Command+Option</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift+Command+Option</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Command+Option</td><td>copy=&gt;link=&gt;<strong>none</strong></td></tr>
+ </tbody>
+ </table>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/modifiers/link.html b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/link.html
new file mode 100644
index 000000000..d5281a4b4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/link.html
@@ -0,0 +1,175 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Modifier keys selecting dropEffect with 'link'</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+div:first-child + div + div {
+ height: 100px;
+ width: 100px;
+ background: fuchsia;
+ display: inline-block;
+}
+table {
+ display: inline-table;
+ margin-right: 1em;
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px solid black;
+}
+thead th {
+ background: silver;
+ color: black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var countedDrops = 0, bde, bdo, bdo2, fde, fdo, fdr;
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','http://example.com/');
+ e.dataTransfer.effectAllowed = 'link';
+ bde = bdo = bdo2 = fde = fdo = fdr = '';
+ };
+ var blue = document.getElementsByTagName('div')[1];
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ if( !bde ) { bde = e.dataTransfer.dropEffect; }
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ if( !bdo ) {
+ bdo = e.dataTransfer.dropEffect;
+ }
+ //bdo2 always collects dropEffect, since it can change multiple times in rapid succession when pressing multiple modifiers
+ //test cares about the last dropEffect that was seen before leaving the blue square, and that will be stored in bdo2
+ bdo2 = e.dataTransfer.dropEffect;
+ };
+ var fuchsia = document.getElementsByTagName('div')[2];
+ fuchsia.ondragenter = function (e) {
+ e.preventDefault();
+ if( !fde ) { fde = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ if( !fdo ) { fdo = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ fdr = e.dataTransfer.dropEffect;
+ };
+ orange.ondragend = function (e) {
+ var ode = e.dataTransfer.dropEffect, temparray;
+ if( bde == bdo && bdo2 == fdr && fde == fdr && fdo == fdr && ode == fdr ) {
+ if( bde == fdr ) {
+ tmparray = [fdr];
+ } else {
+ tmparray = [bde,fdr];
+ }
+ } else if( bde == bdo && bdo2 == fdo && fde == fdo && !fdr ) {
+ tmparray = [bde,fdo,ode];
+ } else {
+ tmparray = [bde,bdo,bdo2,fde,fdo,fdr,ode];
+ }
+ tmparray[ tmparray.length - 1 ] = '<strong>' + tmparray[ tmparray.length - 1 ] + '<\/strong>';
+ document.getElementsByTagName('div')[3].innerHTML = (++countedDrops) + '. ' + tmparray.join('=&gt;');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <div></div>
+ <div><strong>&nbsp;</strong></div>
+ <ol>
+ <li>Drag the orange square over the blue square</li>
+ <li>Press the relevant modifier keys for your platform</li>
+ <li>Continue dragging over the pink square</li>
+ <li>Release the drag, then the keys</li>
+ <li>Check that the correct drop effect is produced in each case. If the mouse cursor can change to indicate the final type of drop effect that will take place, it should change to the relevant type (the one in bold) once the modifier keys are pressed.</li>
+ </ol>
+ <!-- Windows Explorer uses Ctrl for copy, Shift for move, Alt or Ctrl+Shift for link. -->
+ <!-- Anything else invalidates the modifiers, and reverts to default. -->
+ <table>
+ <caption>Windows</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td>None</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift</td><td>link=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Alt</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td><strong>link</strong></td></tr>
+ <tr><td>Alt+Shift</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td><strong>link</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- KDE Konqueror uses Ctrl for copy, Shift for move, Ctrl+Shift for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <!-- Gnome Nautilus uses Ctrl for copy, Shift for move, Ctrl+Shift for link (and Alt to open a context menu). -->
+ <!-- Anything else (including Alt when combined with other modifiers) is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Unix/Linux</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td><strong>none</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift</td><td>link=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Alt</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Alt+Shift</td><td>link=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td><strong>link</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- Mac Finder uses Option for copy, Command for move, Command+Option for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Mac</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td><strong>none</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>link</strong></td></tr>
+ <tr><td>Shift</td><td><strong>link</strong></td></tr>
+ <tr><td>Option/alt</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Command</td><td>link=&gt;move=&gt;<strong>none</strong></td></tr>
+
+ <tr><td>Ctrl+Shift</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl+Option</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Command</td><td>link=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift+Option</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift+Command</td><td>link=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Command+Option</td><td><strong>link</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Option</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Shift+Command</td><td>link=&gt;move=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Command+Option</td><td><strong>link</strong></td></tr>
+ <tr><td>Shift+Command+Option</td><td><strong>link</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Command+Option</td><td><strong>link</strong></td></tr>
+ </tbody>
+ </table>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/modifiers/linkmove.html b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/linkmove.html
new file mode 100644
index 000000000..3e19f10de
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/linkmove.html
@@ -0,0 +1,175 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Modifier keys selecting dropEffect with 'linkMove'</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+div:first-child + div + div {
+ height: 100px;
+ width: 100px;
+ background: fuchsia;
+ display: inline-block;
+}
+table {
+ display: inline-table;
+ margin-right: 1em;
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px solid black;
+}
+thead th {
+ background: silver;
+ color: black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var countedDrops = 0, bde, bdo, bdo2, fde, fdo, fdr;
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','http://example.com/');
+ e.dataTransfer.effectAllowed = 'linkMove';
+ bde = bdo = bdo2 = fde = fdo = fdr = '';
+ };
+ var blue = document.getElementsByTagName('div')[1];
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ if( !bde ) { bde = e.dataTransfer.dropEffect; }
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ if( !bdo ) {
+ bdo = e.dataTransfer.dropEffect;
+ }
+ //bdo2 always collects dropEffect, since it can change multiple times in rapid succession when pressing multiple modifiers
+ //test cares about the last dropEffect that was seen before leaving the blue square, and that will be stored in bdo2
+ bdo2 = e.dataTransfer.dropEffect;
+ };
+ var fuchsia = document.getElementsByTagName('div')[2];
+ fuchsia.ondragenter = function (e) {
+ e.preventDefault();
+ if( !fde ) { fde = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ if( !fdo ) { fdo = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ fdr = e.dataTransfer.dropEffect;
+ };
+ orange.ondragend = function (e) {
+ var ode = e.dataTransfer.dropEffect, temparray;
+ if( bde == bdo && bdo2 == fdr && fde == fdr && fdo == fdr && ode == fdr ) {
+ if( bde == fdr ) {
+ tmparray = [fdr];
+ } else {
+ tmparray = [bde,fdr];
+ }
+ } else if( bde == bdo && bdo2 == fdo && fde == fdo && !fdr ) {
+ tmparray = [bde,fdo,ode];
+ } else {
+ tmparray = [bde,bdo,bdo2,fde,fdo,fdr,ode];
+ }
+ tmparray[ tmparray.length - 1 ] = '<strong>' + tmparray[ tmparray.length - 1 ] + '<\/strong>';
+ document.getElementsByTagName('div')[3].innerHTML = (++countedDrops) + '. ' + tmparray.join('=&gt;');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <div></div>
+ <div><strong>&nbsp;</strong></div>
+ <ol>
+ <li>Drag the orange square over the blue square</li>
+ <li>Press the relevant modifier keys for your platform</li>
+ <li>Continue dragging over the pink square</li>
+ <li>Release the drag, then the keys</li>
+ <li>Check that the correct drop effect is produced in each case. If the mouse cursor can change to indicate the final type of drop effect that will take place, it should change to the relevant type (the one in bold) once the modifier keys are pressed.</li>
+ </ol>
+ <!-- Windows Explorer uses Ctrl for copy, Shift for move, Alt or Ctrl+Shift for link. -->
+ <!-- Anything else invalidates the modifiers, and reverts to default. -->
+ <table>
+ <caption>Windows</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td>None</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift</td><td>link=&gt;<strong>move</strong></td></tr>
+ <tr><td>Alt</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td><strong>link</strong></td></tr>
+ <tr><td>Alt+Shift</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td><strong>link</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- KDE Konqueror uses Ctrl for copy, Shift for move, Ctrl+Shift for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <!-- Gnome Nautilus uses Ctrl for copy, Shift for move, Ctrl+Shift for link (and Alt to open a context menu). -->
+ <!-- Anything else (including Alt when combined with other modifiers) is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Unix/Linux</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td><strong>none</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift</td><td>link=&gt;<strong>move</strong></td></tr>
+ <tr><td>Alt</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Alt+Shift</td><td>link=&gt;<strong>move</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td><strong>link</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- Mac Finder uses Option for copy, Command for move, Command+Option for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Mac</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td><strong>none</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>link</strong></td></tr>
+ <tr><td>Shift</td><td><strong>link</strong></td></tr>
+ <tr><td>Option/alt</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Command</td><td>link=&gt;<strong>move</strong></td></tr>
+
+ <tr><td>Ctrl+Shift</td><td><strong>link</strong></td></tr>
+ <tr><td>Ctrl+Option</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Command</td><td>link=&gt;<strong>move</strong></td></tr>
+ <tr><td>Shift+Option</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift+Command</td><td>link=&gt;<strong>move</strong></td></tr>
+ <tr><td>Command+Option</td><td><strong>link</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Option</td><td>link=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Shift+Command</td><td>link=&gt;<strong>move</strong></td></tr>
+ <tr><td>Ctrl+Command+Option</td><td><strong>link</strong></td></tr>
+ <tr><td>Shift+Command+Option</td><td><strong>link</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Command+Option</td><td><strong>link</strong></td></tr>
+ </tbody>
+ </table>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/modifiers/move.html b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/move.html
new file mode 100644
index 000000000..ca3e83c24
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/move.html
@@ -0,0 +1,175 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Modifier keys selecting dropEffect with 'move'</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+div:first-child + div + div {
+ height: 100px;
+ width: 100px;
+ background: fuchsia;
+ display: inline-block;
+}
+table {
+ display: inline-table;
+ margin-right: 1em;
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px solid black;
+}
+thead th {
+ background: silver;
+ color: black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var countedDrops = 0, bde, bdo, bdo2, fde, fdo, fdr;
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','http://example.com/');
+ e.dataTransfer.effectAllowed = 'move';
+ bde = bdo = bdo2 = fde = fdo = fdr = '';
+ };
+ var blue = document.getElementsByTagName('div')[1];
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ if( !bde ) { bde = e.dataTransfer.dropEffect; }
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ if( !bdo ) {
+ bdo = e.dataTransfer.dropEffect;
+ }
+ //bdo2 always collects dropEffect, since it can change multiple times in rapid succession when pressing multiple modifiers
+ //test cares about the last dropEffect that was seen before leaving the blue square, and that will be stored in bdo2
+ bdo2 = e.dataTransfer.dropEffect;
+ };
+ var fuchsia = document.getElementsByTagName('div')[2];
+ fuchsia.ondragenter = function (e) {
+ e.preventDefault();
+ if( !fde ) { fde = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ if( !fdo ) { fdo = e.dataTransfer.dropEffect; }
+ };
+ fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ fdr = e.dataTransfer.dropEffect;
+ };
+ orange.ondragend = function (e) {
+ var ode = e.dataTransfer.dropEffect, temparray;
+ if( bde == bdo && bdo2 == fdr && fde == fdr && fdo == fdr && ode == fdr ) {
+ if( bde == fdr ) {
+ tmparray = [fdr];
+ } else {
+ tmparray = [bde,fdr];
+ }
+ } else if( bde == bdo && bdo2 == fdo && fde == fdo && !fdr ) {
+ tmparray = [bde,fdo,ode];
+ } else {
+ tmparray = [bde,bdo,bdo2,fde,fdo,fdr,ode];
+ }
+ tmparray[ tmparray.length - 1 ] = '<strong>' + tmparray[ tmparray.length - 1 ] + '<\/strong>';
+ document.getElementsByTagName('div')[3].innerHTML = (++countedDrops) + '. ' + tmparray.join('=&gt;');
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <div></div>
+ <div><strong>&nbsp;</strong></div>
+ <ol>
+ <li>Drag the orange square over the blue square</li>
+ <li>Press the relevant modifier keys for your platform</li>
+ <li>Continue dragging over the pink square</li>
+ <li>Release the drag, then the keys</li>
+ <li>Check that the correct drop effect is produced in each case. If the mouse cursor can change to indicate the final type of drop effect that will take place, it should change to the relevant type (the one in bold) once the modifier keys are pressed.</li>
+ </ol>
+ <!-- Windows Explorer uses Ctrl for copy, Shift for move, Alt or Ctrl+Shift for link. -->
+ <!-- Anything else invalidates the modifiers, and reverts to default. -->
+ <table>
+ <caption>Windows</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td>None</td><td><strong>move</strong></td></tr>
+ <tr><td>Ctrl</td><td>move=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift</td><td><strong>move</strong></td></tr>
+ <tr><td>Alt</td><td>move=&gt;link=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td>move=&gt;link=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td><strong>move</strong></td></tr>
+ <tr><td>Alt+Shift</td><td><strong>move</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td><strong>move</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- KDE Konqueror uses Ctrl for copy, Shift for move, Ctrl+Shift for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <!-- Gnome Nautilus uses Ctrl for copy, Shift for move, Ctrl+Shift for link (and Alt to open a context menu). -->
+ <!-- Anything else (including Alt when combined with other modifiers) is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Unix/Linux</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td><strong>none</td><td><strong>move</strong></td></tr>
+ <tr><td>Ctrl</td><td>move=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift</td><td><strong>move</strong></td></tr>
+ <tr><td>Alt</td><td><strong>move</strong></td></tr>
+ <tr><td>Ctrl+Shift</td><td>move=&gt;link=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Alt</td><td>move=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Alt+Shift</td><td><strong>move</strong></td></tr>
+ <tr><td>Ctrl+Alt+Shift</td><td>move=&gt;link=&gt;<strong>none</strong></td></tr>
+ </tbody>
+ </table>
+ <!-- Mac Finder uses Option for copy, Command for move, Command+Option for link. -->
+ <!-- Anything else is ignored completely, and has no effect on the modifier sequence. -->
+ <table>
+ <caption>Mac</caption>
+ <thead>
+ <tr><th>Modifier</th><th>Drop effect</th></tr>
+ </thead>
+ <tbody>
+ <tr><td><strong>none</td><td><strong>move</strong></td></tr>
+ <tr><td>Ctrl</td><td><strong>move</strong></td></tr>
+ <tr><td>Shift</td><td><strong>move</strong></td></tr>
+ <tr><td>Option/alt</td><td>move=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Command</td><td><strong>move</strong></td></tr>
+
+ <tr><td>Ctrl+Shift</td><td><strong>move</strong></td></tr>
+ <tr><td>Ctrl+Option</td><td>move=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Command</td><td><strong>move</strong></td></tr>
+ <tr><td>Shift+Option</td><td>move=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift+Command</td><td><strong>move</strong></td></tr>
+ <tr><td>Command+Option</td><td>move=&gt;link=&gt;<strong>none</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Option</td><td>move=&gt;copy=&gt;<strong>none</strong></td></tr>
+ <tr><td>Ctrl+Shift+Command</td><td><strong>move</strong></td></tr>
+ <tr><td>Ctrl+Command+Option</td><td>move=&gt;link=&gt;<strong>none</strong></td></tr>
+ <tr><td>Shift+Command+Option</td><td>move=&gt;link=&gt;<strong>none</strong></td></tr>
+
+ <tr><td>Ctrl+Shift+Command+Option</td><td>move=&gt;link=&gt;<strong>none</strong></td></tr>
+ </tbody>
+ </table>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/modifiers/onlydropzone.html b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/onlydropzone.html
new file mode 100644
index 000000000..f5c7bab06
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/onlydropzone.html
@@ -0,0 +1,70 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Modifier keys being used with a dropzone attribute</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+div:first-child + div + div {
+ height: 100px;
+ width: 100px;
+ background: fuchsia;
+ display: inline-block;
+}
+table {
+ display: inline-table;
+ margin-right: 1em;
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px solid black;
+}
+thead th {
+ background: silver;
+ color: black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text/plain','http://example.com/');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+ var fuchsia = document.getElementsByTagName('div')[2];
+ fuchsia.ondrop = function (e) {
+ //dropzone overrides the modifier, always, and ignores effectAllowed
+ e.preventDefault();
+ document.getElementsByTagName('div')[3].innerHTML = ( e.dataTransfer.dropEffect == 'link' ) ? 'PASS' : 'FAIL';
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <div dropzone="link string:text/plain"></div>
+ <div>&nbsp;</div>
+ <ol>
+ <li>Drag the orange square over the blue square</li>
+ <li>Press the relevant modifier keys for your platform to request a &quot;move&quot; drop effect (eg. Shift on Windows/Unix/Linux, Command on Mac)</li>
+ <li>Continue dragging over the pink square</li>
+ <li>If supported by the platform, the mouse cursor should show that a &quot;link&quot; drop effect will be used</li>
+ <li>Release the drag, then the keys</li>
+ <li>Fail if no new text appears above this list</li>
+ </ol>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/modifiers/onlydropzoneevents.html b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/onlydropzoneevents.html
new file mode 100644
index 000000000..a80336032
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/onlydropzoneevents.html
@@ -0,0 +1,82 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Modifier keys being used with a dropzone attribute and dragenter/dragover events</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+div:first-child + div + div {
+ height: 100px;
+ width: 100px;
+ background: fuchsia;
+ display: inline-block;
+}
+table {
+ display: inline-table;
+ margin-right: 1em;
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px solid black;
+}
+thead th {
+ background: silver;
+ color: black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text/plain','http://example.com/');
+ e.dataTransfer.effectAllowed = 'copy';
+ };
+ var fuchsia = document.getElementsByTagName('div')[2], fde, fdo;
+ fuchsia.ondragenter = function (e) {
+ fde = e.dataTransfer.dropEffect;
+ };
+ fuchsia.ondragover = function (e) {
+ fdo = e.dataTransfer.dropEffect;
+ };
+ fuchsia.ondrop = function (e) {
+ //dropzone overrides the modifier, always, and ignores effectAllowed
+ e.preventDefault();
+ var sequence = ([fde,fdo,e.dataTransfer.dropEffect]).join('=&gt;')
+ var desiredsequence = (['move','move','link']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[3].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[3].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <div dropzone="link string:text/plain"></div>
+ <div>&nbsp;</div>
+ <ol>
+ <li>Drag the orange square over the blue square</li>
+ <li>Press the relevant modifier keys for your platform to request a &quot;move&quot; drop effect (eg. Shift on Windows/Unix/Linux, Command on Mac)</li>
+ <li>Continue dragging over the pink square</li>
+ <li>If supported by the platform, the mouse cursor should show that a &quot;link&quot; drop effect will be used</li>
+ <li>Release the drag, then the keys</li>
+ <li>Fail if no new text appears above this list</li>
+ </ol>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/modifiers/releasemodifiersdrag.html b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/releasemodifiersdrag.html
new file mode 100644
index 000000000..3468d0a53
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/releasemodifiersdrag.html
@@ -0,0 +1,125 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Modifier keys being released before end of drag</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+div:first-child + div + div {
+ height: 100px;
+ width: 100px;
+ background: fuchsia;
+ display: inline-block;
+}
+div:first-child + div + div + div {
+ height: 100px;
+ width: 100px;
+ background: yellow;
+ display: inline-block;
+}
+div {
+ font-family: monospace;
+}
+table {
+ display: inline-table;
+ margin-right: 1em;
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px solid black;
+}
+thead th {
+ background: silver;
+ color: black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var bde, bdo, bdo2, fde, fdo, fdo2, yde, ydo, ydr;
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','http://example.com/');
+ e.dataTransfer.effectAllowed = 'linkMove';
+ bde = bdo = bdo2 = fde = fdo = fdo2 = yde = ydo = ydr = '';
+ };
+ var blue = document.getElementsByTagName('div')[1];
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ bde = e.dataTransfer.dropEffect;
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ if( !bdo ) {
+ bdo = e.dataTransfer.dropEffect;
+ }
+ //bdo2 always collects dropEffect, since it can change multiple times in rapid succession when pressing multiple modifiers
+ //test cares about the last dropEffect that was seen before leaving the blue square, and that will be stored in bdo2
+ bdo2 = e.dataTransfer.dropEffect;
+ };
+ var fuchsia = document.getElementsByTagName('div')[2];
+ fuchsia.ondragenter = function (e) {
+ e.preventDefault();
+ fde = e.dataTransfer.dropEffect;
+ };
+ fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ if( !fdo ) { fdo = e.dataTransfer.dropEffect; }
+ fdo2 = e.dataTransfer.dropEffect;
+ };
+ var yellow = document.getElementsByTagName('div')[3];
+ yellow.ondragenter = function (e) {
+ e.preventDefault();
+ yde = e.dataTransfer.dropEffect;
+ };
+ yellow.ondragover = function (e) {
+ e.preventDefault();
+ if( !ydo ) { ydo = e.dataTransfer.dropEffect; }
+ };
+ yellow.ondrop = function (e) {
+ e.preventDefault();
+ ydr = e.dataTransfer.dropEffect;
+ };
+ orange.ondragend = function (e) {
+ var sequence = ([bde,bdo,bdo2,fde,fdo,fdo2,yde,ydo,ydr,e.dataTransfer.dropEffect]).join('=&gt;')
+ var desiredsequence = (['link','link','move','move','move','link','link','link','link','link']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[4].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[4].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div><strong>&nbsp;</strong></div>
+ <ol>
+ <li>Drag the orange square over the blue square</li>
+ <li>Press the relevant modifier keys for your platform to request a &quot;move&quot; drop effect (eg. Shift on Windows/Unix/Linux, Command on Mac)</li>
+ <li>If supported by the platform, the mouse cursor should show that a &quot;move&quot; drop effect will be used</li>
+ <li>Continue dragging over the pink square</li>
+ <li>Release the modifier keys</li>
+ <li>If supported by the platform, the mouse cursor should show that a &quot;link&quot; drop effect will be used</li>
+ <li>Continue dragging over the yellow square</li>
+ <li>Release the drag</li>
+ <li>Fail if no new text appears above this list</li>
+ </ol>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/modifiers/releasemodifiersdrop.html b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/releasemodifiersdrop.html
new file mode 100644
index 000000000..678a2139a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/releasemodifiersdrop.html
@@ -0,0 +1,108 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Modifier keys being released before drop</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+div:first-child + div + div {
+ height: 100px;
+ width: 100px;
+ background: fuchsia;
+ display: inline-block;
+}
+div {
+ font-family: monospace;
+}
+table {
+ display: inline-table;
+ margin-right: 1em;
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px solid black;
+}
+thead th {
+ background: silver;
+ color: black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var bde, bdo, bdo2, fde, fdo, fdo2, fdr;
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','http://example.com/');
+ e.dataTransfer.effectAllowed = 'linkMove';
+ bde = bdo = bdo2 = fde = fdo = fdo2 = fdr = '';
+ };
+ var blue = document.getElementsByTagName('div')[1];
+ blue.ondragenter = function (e) {
+ e.preventDefault();
+ bde = e.dataTransfer.dropEffect;
+ };
+ blue.ondragover = function (e) {
+ e.preventDefault();
+ if( !bdo ) {
+ bdo = e.dataTransfer.dropEffect;
+ }
+ //bdo2 always collects dropEffect, since it can change multiple times in rapid succession when pressing multiple modifiers
+ //test cares about the last dropEffect that was seen before leaving the blue square, and that will be stored in bdo2
+ bdo2 = e.dataTransfer.dropEffect;
+ };
+ var fuchsia = document.getElementsByTagName('div')[2];
+ fuchsia.ondragenter = function (e) {
+ e.preventDefault();
+ fde = e.dataTransfer.dropEffect;
+ };
+ fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ if( !fdo ) { fdo = e.dataTransfer.dropEffect; }
+ fdo2 = e.dataTransfer.dropEffect;
+ };
+ fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ fdr = e.dataTransfer.dropEffect;
+ };
+ orange.ondragend = function (e) {
+ var sequence = ([bde,bdo,bdo2,fde,fdo,fdo2,fdr,e.dataTransfer.dropEffect]).join('=&gt;')
+ var desiredsequence = (['link','link','move','move','move','link','link','link']).join('=&gt;')
+ if( sequence == desiredsequence ) {
+ document.getElementsByTagName('div')[3].innerHTML = 'PASS';
+ } else {
+ document.getElementsByTagName('div')[3].innerHTML = 'FAIL, got:<br>'+sequence+'<br>instead of:<br>'+desiredsequence;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <div></div>
+ <div><strong>&nbsp;</strong></div>
+ <ol>
+ <li>Drag the orange square over the blue square</li>
+ <li>Press the relevant modifier keys for your platform to request a &quot;move&quot; drop effect (eg. Shift on Windows/Unix/Linux, Command on Mac)</li>
+ <li>If supported by the platform, the mouse cursor should show that a &quot;move&quot; drop effect will be used</li>
+ <li>Continue dragging over the pink square</li>
+ <li>Release the modifier keys, and wait for at least half a second</li>
+ <li>If supported by the platform, the mouse cursor should show that a &quot;link&quot; drop effect will be used</li>
+ <li>Release the drag, then the keys</li>
+ <li>Fail if no new text appears above this list</li>
+ </ol>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/modifiers/scriptmodified.html b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/scriptmodified.html
new file mode 100644
index 000000000..7053fc9aa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/modifiers/scriptmodified.html
@@ -0,0 +1,99 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Modifier keys selecting dropEffect with script overriding it</title>
+ <style type="text/css">
+div:first-child {
+ height: 100px;
+ width: 100px;
+ background: orange;
+ display: inline-block;
+}
+div:first-child + div {
+ height: 100px;
+ width: 100px;
+ background: blue;
+ display: inline-block;
+}
+div:first-child + div + div {
+ height: 100px;
+ width: 100px;
+ background: fuchsia;
+ display: inline-block;
+}
+table {
+ display: inline-table;
+ margin-right: 1em;
+ border-collapse: collapse;
+}
+table, th, td {
+ border: 1px solid black;
+}
+thead th {
+ background: silver;
+ color: black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var dragenterbefore = '', dragenterafter = '', dragoverbefore = '', dragoverafter = '';
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','http://example.com/');
+ e.dataTransfer.effectAllowed = 'all';
+ };
+ var fuchsia = document.getElementsByTagName('div')[2];
+ fuchsia.ondragenter = function (e) {
+ e.preventDefault();
+ if( e.dataTransfer.dropEffect != 'link' ) {
+ dragenterbefore = e.dataTransfer.dropEffect;
+ }
+ try {
+ e.dataTransfer.dropEffect = 'move';
+ } catch(e) {}
+ if( e.dataTransfer.dropEffect != 'move' ) {
+ dragenterafter = e.dataTransfer.dropEffect;
+ }
+ };
+ fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ if( e.dataTransfer.dropEffect != 'link' ) {
+ dragoverbefore = e.dataTransfer.dropEffect;
+ }
+ try {
+ e.dataTransfer.dropEffect = 'move';
+ } catch(e) {}
+ if( e.dataTransfer.dropEffect != 'move' ) {
+ dragoverafter = e.dataTransfer.dropEffect;
+ }
+ };
+ fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ document.getElementsByTagName('div')[3].innerHTML = ( dragenterbefore || dragenterafter || dragoverbefore || dragoverafter || e.dataTransfer.dropEffect != 'move' ) ? ( 'FAIL' +
+ ( dragenterbefore ? ( '<br>dragenter.dropEffect was '+dragenterbefore+' instead of link' ) : '' ) +
+ ( dragenterafter ? ( '<br>dragenter.dropEffect after writing was '+dragenterafter+' instead of move' ) : '' ) +
+ ( dragoverbefore ? ( '<br>dragover.dropEffect was '+dragoverbefore+' instead of link' ) : '' ) +
+ ( dragoverafter ? ( '<br>dragover.dropEffect after writing was '+dragoverafter+' instead of move' ) : '' ) +
+ ( ( e.dataTransfer.dropEffect != 'move' ) ? ( '<br>drop.dropEffect was '+e.dataTransfer.dropEffect+' instead of move' ) : '' )
+ ) : 'PASS';
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+ <div></div>
+ <div></div>
+ <div>&nbsp;</div>
+ <ol>
+ <li>Drag the orange square over the blue square</li>
+ <li>Press the relevant modifier keys for your platform to request a &quot;link&quot; drop effect (eg. Alt on Windows, Ctrl+Shift on Unix/Linux, Command+Option on Mac)</li>
+ <li>Continue dragging over the pink square</li>
+ <li>If supported by the platform, the mouse cursor should show that a &quot;move&quot; drop effect will be used</li>
+ <li>Release the drag, then the keys</li>
+ <li>Fail if no new text appears above this list</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/moving-window.html b/testing/web-platform/tests/html/editing/dnd/platform/moving-window.html
new file mode 100644
index 000000000..810ade95f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/moving-window.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<title>drag &amp; drop - moving windows must not start a drag</title>
+<script type="text/javascript">
+
+window.onload = function() {
+ var li1 = document.getElementsByTagName('li')[3], li2 = document.getElementsByTagName('li')[4];
+ li1.ondragstart = li2.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ this.innerHTML = 'FAIL';
+ };
+ li1.onmousedown = function () { window.moveBy(0,10); };
+ li2.onmousedown = function () { setTimeout(function () {
+ window.moveBy(0,10);
+ },10); };
+};
+
+</script>
+<p></p>
+<ol>
+ <li onclick="window.open(location.href,'_blank','width=500,height=300');">Click here to open this page in a popup window.</li>
+ <li>Ensure that this popup window is not maximised (or tab, in the case of tabs being rendered as an MDI).</li>
+ <li>Ensure that your browser settings allow browser windows to be moved by scripts.</li>
+ <li draggable='true'>Press your mouse down on this text but do not move it afterwards. Fail if a drag operation has started (eg. if the mouse cursor shows that you are dragging something, or if some drag placeholder text appears, or if this text changes).</li>
+ <li draggable='true'>Press your mouse down on this text but do not move it afterwards. Fail if a drag operation has started (eg. if the mouse cursor shows that you are dragging something, or if some drag placeholder text appears, or if this text changes).</li>
+</ol>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/overlappingwindows.html b/testing/web-platform/tests/html/editing/dnd/platform/overlappingwindows.html
new file mode 100644
index 000000000..cac76acf4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/overlappingwindows.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<title>Dropping on always-on-top application windows that overlay the browser</title>
+<style>
+ html, body, ol {
+ margin: 0;
+ padding: 0;
+ height: 100%;
+ width: 100%;
+ background: blue;
+ color: black;
+ list-style-position: inside;
+ }
+ div {
+ height: 100px;
+ width: 100px;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ margin-top: -50px;
+ margin-left: -50px;
+ background: orange;
+ }
+</style>
+
+<script type="text/javascript">
+
+window.onload = function() {
+ var orange = document.getElementsByTagName('div')[0];
+ orange.ondragstart = function(e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'dummy text');
+ };
+ var blue = document.getElementsByTagName('ol')[0];
+ blue.ondragenter = blue.ondragover = function(e) {
+ e.preventDefault();
+ };
+ blue.ondrop = function(e) {
+ e.preventDefault();
+ this.innerHTML = 'FAIL';
+ };
+};
+
+</script>
+
+<ol>
+ <li>Position the browser window so that the blue part of this page extends behind the system taskbar.</li>
+ <li>Use your mouse to drag the orange box over a part of the taskbar that overlays the blue part of this page.</li>
+ <li>If supported by the platform, the mouse cursor should <em>not</em> show the browser's custom &quot;copy&quot; cursor, and should instead show the system's expected cursor for dropping on that part of the taskbar.</li>
+ <li>Release the drag. Fail if the text on this page changes.</li>
+ <li>Reload and repeat this test for:<ul>
+ <li>Where the blue part of this page extends under an always-on-top window (eg. the Windows Task Manager).</li>
+ <li>Where the blue part of this page extends under an always-on-top notification (eg. a system tray info balloon).</li>
+ </ul></li>
+</ol>
+<div draggable='true'></div>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/placeholderposition1.html b/testing/web-platform/tests/html/editing/dnd/platform/placeholderposition1.html
new file mode 100644
index 000000000..ff61224a3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/placeholderposition1.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - position of the placeholder for a dragged element</title>
+ <style type="text/css">
+div { background: orange; color: black; width: 200px; padding: 10px; border: 10px solid orange; margin: 10px; }
+ </style>
+ </head>
+ <body>
+
+ <div draggable="true">Drag the orange block around the page (and only over the page), using the pixel in its top-left corner. When dragging, the top-left corner of the dragged placeholder should exactly match the position of the mouse cursor.</div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/placeholderposition2.html b/testing/web-platform/tests/html/editing/dnd/platform/placeholderposition2.html
new file mode 100644
index 000000000..5899f7266
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/placeholderposition2.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - position of the placeholder for a dragged selection</title>
+ <style type="text/css">
+p { cursor: default; }
+ </style>
+ </head>
+ <body>
+
+ <p>Select the first word in this sentence. Drag the selection downwards, using the pixel in the top-left corner of the selection highlight. When dragging, the top-left corner of the dragged placeholder should exactly match the position of the mouse cursor.</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/click-to-activate.js b/testing/web-platform/tests/html/editing/dnd/platform/plugin/click-to-activate.js
new file mode 100644
index 000000000..2ea2f19c2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/click-to-activate.js
@@ -0,0 +1 @@
+document.write(plugincode); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/dragndrop.swf b/testing/web-platform/tests/html/editing/dnd/platform/plugin/dragndrop.swf
new file mode 100644
index 000000000..6b49d46c5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/dragndrop.swf
Binary files differ
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/dragndropleavedeactivate.swf b/testing/web-platform/tests/html/editing/dnd/platform/plugin/dragndropleavedeactivate.swf
new file mode 100644
index 000000000..be486248d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/dragndropleavedeactivate.swf
Binary files differ
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-001.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-001.html
new file mode 100644
index 000000000..62dc5847a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-001.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop in Flash</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square onto the blue square and release it. The orange square should disappear, and the blue square should turn yellow.</p>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-002.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-002.html
new file mode 100644
index 000000000..caa5f1a9d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-002.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop alternating between Flash and page</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the pink square onto the blue square and release it. The drag placeholder should disappear (either when releasing, or when passing the black square), and the mouse cursor should return to normal.</li>
+ <li>Without moving your mouse outside the black square, drag the orange square onto the blue square and release it. The orange square should disappear, and the blue square should turn yellow. Fail if the orange square does not immediately respond to the drag attempt.</li>
+ <li>Drag the pink square onto the yellow square and release it. The drag placeholder should disappear, and the mouse cursor should return to normal. Fail if the pink square does not immediately respond to the drag attempt.</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-003.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-003.html
new file mode 100644
index 000000000..15c672e62
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-003.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Incomplete drag and drop in Flash</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <!-- Test is based on expected behaviour where the mouseup is sent to the plugin because a drag was in operation. -->
+ <p>Drag the orange square until the mouse is outside the black square, then release it. Move the mouse over the blue square. Fail if the orange square continues to follow the mouse.</p>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-004.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-004.html
new file mode 100644
index 000000000..430eae42b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-004.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop alternating between incompleted Flash drag and page</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the orange square until the mouse is outside the right side of the black square but the edge of the orange square can still be seen, then release it.</li>
+ <li>Without passing over the black square again, move the mouse to the pink square.</li>
+ <li>Drag the pink square onto the blue square and release it. The drag placeholder should disappear (either when releasing, or when passing the black square), and the mouse cursor should return to normal. Fail if the pink square does not immediately respond to the drag attempt.</li>
+ <li>Without passing over the black square again, move the mouse to the orange square. Fail if the orange square moves.</li>
+ <li>Drag the orange square onto the blue square and release it. The orange square should disappear, and the blue square should turn yellow. Fail if the orange square does not immediately respond to the drag attempt.</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-005.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-005.html
new file mode 100644
index 000000000..cf5343f2a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-005.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop in Flash with Alt+Tab</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Ensure at least one other program is running, with its window maximised.</li>
+ <li>Drag the orange square over the blue square.</li>
+ <li>Without releasing the mouse button, use Alt+Tab (or your system's equivalent) to switch to the other program, then back to this one.</li>
+ <li>Move the mouse around inside the black square. The orange square should continue to follow the mouse.</li>
+ </ol>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-006.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-006.html
new file mode 100644
index 000000000..b77539fa2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-006.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop in Flash with Alt+Tab over page</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Ensure at least one other program is running, with its window maximised.</li>
+ <li>Drag the orange square around until the mouse is outside the black square.</li>
+ <li>Without releasing the mouse button, use Alt+Tab (or your system's equivalent) to switch to the other program, then back to this one.</li>
+ <li>Move the mouse inside the black square. The orange square should continue to follow the mouse.</li>
+ </ol>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-007.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-007.html
new file mode 100644
index 000000000..44a69a4ce
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-007.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with Alt+Tab over Flash</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Ensure at least one other program is running, with its window maximised.</li>
+ <li>Drag the pink square over the blue square. The mouse cursor should be the no-drop cursor, or the platform's drop-allowed cursor.</li>
+ <li>Without releasing the mouse button, use Alt+Tab (or your system's equivalent) to switch to the other program, then back to this one.</li>
+ <li>The mouse cursor should be the same cursor as in step 2.</li>
+ <li>Move the mouse outside the black square. The drag placeholder should follow the mouse (reappearing if it disappeared in step 2).</li>
+ <li>Release the drag. The drag placeholder should disappear, and the cursor should revert to the default mouse cursor.</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-008.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-008.html
new file mode 100644
index 000000000..31d3b8d51
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-008.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with right click over Flash</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the pink square over the blue square.</li>
+ <li>Without releasing the drag, click the right mouse button.</li>
+ <li>If the platform's normal behaviour is to cancel a drag (eg. Windows and Unix+KDE), then the drag should be cancelled; moving the mouse outside the black square should not cause the drag placeholder to continue following the mouse, and the mouse cursor should revert to default.</li>
+ <li>If the platform's normal behaviour is not to cancel a drag (eg. Mac and Unix+Gnome), then the drag should not be cancelled; moving the mouse outside the black square should cause the drag placeholder to continue following the mouse, and the mouse cursor should show as no-drop or drop-allowed.</li>
+ <li>Fail in either case if the drag placeholder gets stuck temporarily or permanently over the blue square. Fail if an inappropriate right click function begins (eg. context menu opens).</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-009.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-009.html
new file mode 100644
index 000000000..4c9cb2cab
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-009.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with right click and release over Flash</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the pink square over the blue square.</li>
+ <li>Without releasing the drag, click the right mouse button, then release the drag.</li>
+ <li>Fail if the drag placeholder gets stuck over the blue square.</li>
+ <li>Move the mouse outside the black square. The mouse cursor should be the default mouse cursor.</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-010.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-010.html
new file mode 100644
index 000000000..f1f893393
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-010.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with middle click over Flash</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the pink square over the blue square.</li>
+ <li>Without releasing the drag, click the middle mouse button.</li>
+ <li>If the platform's normal behaviour is to cancel a drag (eg. Windows and Unix+KDE), then the drag should be cancelled; moving the mouse outside the black square should not cause the drag placeholder to continue following the mouse, and the mouse cursor should revert to default.</li>
+ <li>If the platform's normal behaviour is not to cancel a drag (eg. Mac and Unix+Gnome), then the drag should not be cancelled; moving the mouse outside the black square should cause the drag placeholder to continue following the mouse, and the mouse cursor should show as no-drop or drop-allowed.</li>
+ <li>Fail in either case if the drag placeholder gets stuck temporarily or permanently over the blue square. Fail if an inappropriate middle click function begins (eg. paste-and-go).</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-011.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-011.html
new file mode 100644
index 000000000..8a5753b0c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-011.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with middle click and release over Flash</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the pink square over the blue square.</li>
+ <li>Without releasing the drag, click the middle mouse button, then release the drag.</li>
+ <li>Fail if the drag placeholder gets stuck over the blue square.</li>
+ <li>Move the mouse outside the black square. The mouse cursor should be the default mouse cursor.</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-101.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-101.html
new file mode 100644
index 000000000..58d03fde8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-101.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop in windowless Flash</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square onto the blue square and release it. The orange square should disappear, and the blue square should turn yellow.</p>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-102.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-102.html
new file mode 100644
index 000000000..428c191fb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-102.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop alternating between windowless Flash and page</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the pink square onto the blue square and release it. The drag placeholder should disappear (either when releasing, or when passing the black square), and the mouse cursor should return to normal.</li>
+ <li>Without moving your mouse outside the black square, drag the orange square onto the blue square and release it. The orange square should disappear, and the blue square should turn yellow. Fail if the orange square does not immediately respond to the drag attempt.</li>
+ <li>Drag the pink square onto the yellow square and release it. The drag placeholder should disappear, and the mouse cursor should return to normal. Fail if the pink square does not immediately respond to the drag attempt.</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-103.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-103.html
new file mode 100644
index 000000000..2ac8f1df6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-103.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Incomplete drag and drop in windowless Flash</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <!-- Test is based on expected behaviour of windowless plugin where the mouseup is not sent to the plugin even though a drag was in operation. -->
+ <p>Drag the orange square until the mouse is outside the black square, then release it. Move the mouse over the blue square. Pass if the orange square follows the mouse.</p>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-104.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-104.html
new file mode 100644
index 000000000..9f4a3ec1c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-104.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop alternating between incompleted windowless Flash drag and page</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the orange square until the mouse is outside the right side of the black square but the edge of the orange square can still be seen, then release it.</li>
+ <li>Without passing over the black square again, move the mouse to the pink square.</li>
+ <li>Drag the pink square onto the white area inside the black square and release it. The drag placeholder should disappear (either when releasing, or when passing the black square), and the mouse cursor should return to normal. The orange square should jump to the mouse position. Fail if the pink square does not immediately respond to the drag attempt.</li>
+ <li>The orange square may optionally continue to follow the mouse.</li>
+ <!-- There are no rules here. Browsers may mask the mouseup event from the plugin (since a dnd operation was in progress), or they may pass the mouseup to the plugin (since the dnd operation has completed). -->
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-105.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-105.html
new file mode 100644
index 000000000..3b072a423
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-105.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop in windowless Flash with Alt+Tab</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Ensure at least one other program is running, with its window maximised.</li>
+ <li>Drag the orange square over the blue square.</li>
+ <li>Without releasing the mouse button, use Alt+Tab (or your system's equivalent) to switch to the other program, then back to this one.</li>
+ <li>Move the mouse around inside the black square. The orange square should continue to follow the mouse.</li>
+ </ol>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-106.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-106.html
new file mode 100644
index 000000000..f38fd302f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-106.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop in windowless Flash with Alt+Tab over page</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Ensure at least one other program is running, with its window maximised.</li>
+ <li>Drag the orange square around until the mouse is outside the black square.</li>
+ <li>Without releasing the mouse button, use Alt+Tab (or your system's equivalent) to switch to the other program, then back to this one.</li>
+ <li>Move the mouse inside the black square. The orange square should continue to follow the mouse.</li>
+ </ol>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-107.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-107.html
new file mode 100644
index 000000000..972df6884
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-107.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with Alt+Tab over windowless Flash</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <p><strong>Note:</strong> Mac has no no-drop cursor.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Ensure at least one other program is running, with its window maximised.</li>
+ <li>Drag the pink square over the blue square. The mouse cursor should be the no-drop cursor, or the platform's drop-allowed cursor.</li>
+ <li>Without releasing the mouse button, use Alt+Tab (or your system's equivalent) to switch to the other program, then back to this one.</li>
+ <li>The mouse cursor should be the same cursor as in step 2.</li>
+ <li>Move the mouse outside the black square. The drag placeholder should follow the mouse (reappearing if it disappeared in step 2).</li>
+ <li>Release the drag. The drag placeholder should disappear, and the cursor should revert to the default mouse cursor.</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-108.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-108.html
new file mode 100644
index 000000000..7a145d060
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-108.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with right click over windowless Flash</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the pink square over the blue square.</li>
+ <li>Without releasing the drag, click the right mouse button.</li>
+ <li>If the platform's normal behaviour is to cancel a drag (eg. Windows and Unix+KDE), then the drag should be cancelled; moving the mouse outside the black square should not cause the drag placeholder to continue following the mouse, and the mouse cursor should revert to default.</li>
+ <li>If the platform's normal behaviour is not to cancel a drag (eg. Mac and Unix+Gnome), then the drag should not be cancelled; moving the mouse outside the black square should cause the drag placeholder to continue following the mouse, and the mouse cursor should show as no-drop or drop-allowed.</li>
+ <li>Fail in either case if the drag placeholder gets stuck temporarily or permanently over the blue square. Fail if an inappropriate right click function begins (eg. context menu opens).</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-109.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-109.html
new file mode 100644
index 000000000..e28e166d5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-109.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with right click and release over windowless Flash</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the pink square over the blue square.</li>
+ <li>Without releasing the drag, click the right mouse button, then release the drag.</li>
+ <li>Fail if the drag placeholder gets stuck over the blue square.</li>
+ <li>Move the mouse outside the black square. The mouse cursor should be the default mouse cursor.</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-110.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-110.html
new file mode 100644
index 000000000..07e6241cf
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-110.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with middle click over windowless Flash</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the pink square over the blue square.</li>
+ <li>Without releasing the drag, click the middle mouse button.</li>
+ <li>If the platform's normal behaviour is to cancel a drag (eg. Windows and Unix+KDE), then the drag should be cancelled; moving the mouse outside the black square should not cause the drag placeholder to continue following the mouse, and the mouse cursor should revert to default.</li>
+ <li>If the platform's normal behaviour is not to cancel a drag (eg. Mac and Unix+Gnome), then the drag should not be cancelled; moving the mouse outside the black square should cause the drag placeholder to continue following the mouse, and the mouse cursor should show as no-drop or drop-allowed.</li>
+ <li>Fail in either case if the drag placeholder gets stuck temporarily or permanently over the blue square. Fail if an inappropriate middle click function begins (eg. paste-and-go).</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-111.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-111.html
new file mode 100644
index 000000000..587c70f24
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-111.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with middle click and release over windowless Flash</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the pink square over the blue square.</li>
+ <li>Without releasing the drag, click the middle mouse button, then release the drag.</li>
+ <li>Fail if the drag placeholder gets stuck over the blue square.</li>
+ <li>Move the mouse outside the black square. The mouse cursor should be the default mouse cursor.</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndrop.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-203.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-203.html
new file mode 100644
index 000000000..a4d08ecd4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-203.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Incomplete drag and drop with deactivate in Flash</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <!-- Test is based on expected behaviour where the mouseup is sent to the plugin because a drag was in operation. -->
+ <p>Drag the orange square until the mouse is outside the black square, then release it. Move the mouse over the blue square. Fail if the orange square continues to follow the mouse.</p>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndropleavedeactivate.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-204.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-204.html
new file mode 100644
index 000000000..4ba76e652
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-204.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with deactivate alternating between incompleted Flash drag and page</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the orange square until the mouse is outside the right side of the black square but the edge of the orange square can still be seen, then release it.</li>
+ <li>Without passing over the black square again, move the mouse to the pink square.</li>
+ <li>Drag the pink square onto the blue square and release it. The drag placeholder should disappear (either when releasing, or when passing the black square), and the mouse cursor should return to normal. Fail if the pink square does not immediately respond to the drag attempt.</li>
+ <li>Without passing over the black square again, move the mouse to the orange square. Fail if the orange square moves.</li>
+ <li>Drag the orange square onto the blue square and release it. The orange square should disappear, and the blue square should turn yellow. Fail if the orange square does not immediately respond to the drag attempt.</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndropleavedeactivate.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-205.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-205.html
new file mode 100644
index 000000000..e49add304
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-205.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with deactivate in Flash with Alt+Tab</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Ensure at least one other program is running, with its window maximised.</li>
+ <li>Drag the orange square over the blue square.</li>
+ <li>Without releasing the mouse button, use Alt+Tab (or your system's equivalent) to switch to the other program, then back to this one.</li>
+ <li>Move the mouse around inside the black square. The orange square should not follow the mouse.</li>
+ <li>Release the mouse button over the white area inside the black square. The orange square should disappear, and the blue square should turn yellow.</li>
+ </ol>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndropleavedeactivate.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-206.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-206.html
new file mode 100644
index 000000000..b3bae6e48
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-206.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with deactivate in Flash with Alt+Tab over page</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Ensure at least one other program is running, with its window maximised.</li>
+ <li>Drag the orange square around until the mouse is outside the black square.</li>
+ <li>Without releasing the mouse button, use Alt+Tab (or your system's equivalent) to switch to the other program, then back to this one.</li>
+ <li>Move the mouse over the blue square. The orange square should not continue to follow the mouse.</li>
+ </ol>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndropleavedeactivate.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-207.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-207.html
new file mode 100644
index 000000000..bfb4c4d10
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-207.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with deactivate with Alt+Tab over Flash</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <p><strong>Note:</strong> Mac has no no-drop cursor.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Ensure at least one other program is running, with its window maximised.</li>
+ <li>Drag the pink square over the blue square. The mouse cursor should be the no-drop cursor, or the platform's drop-allowed cursor.</li>
+ <li>Without releasing the mouse button, use Alt+Tab (or your system's equivalent) to switch to the other program, then back to this one.</li>
+ <li>The mouse cursor should be the same cursor as in step 2.</li>
+ <li>Move the mouse outside the black square. The drag placeholder should follow the mouse (reappearing if it disappeared in step 2).</li>
+ <li>Release the drag. The drag placeholder should disappear, and the cursor should revert to the default mouse cursor.</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndropleavedeactivate.swf" type="application/x-shockwave-flash">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-303.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-303.html
new file mode 100644
index 000000000..275e207df
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-303.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Incomplete drag and drop with deactivate in windowless Flash</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <!-- Test is based on expected behaviour of windowless plugin where the mouseup is not sent to the plugin even though a drag was in operation. -->
+ <p>Drag the orange square until the mouse is outside the black square, then release it. Move the mouse over the blue square. Pass if the orange square follows the mouse.</p>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndropleavedeactivate.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-304.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-304.html
new file mode 100644
index 000000000..a68a8c3fa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-304.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with deactivate alternating between incompleted windowless Flash drag and page</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Drag the orange square until the mouse is outside the right side of the black square but the edge of the orange square can still be seen, then release it.</li>
+ <li>Without passing over the black square again, move the mouse to the pink square.</li>
+ <li>Drag the pink square onto the white area inside the black square and release it. The drag placeholder should disappear (either when releasing, or when passing the black square), and the mouse cursor should return to normal. The orange square should jump to the mouse position. Fail if the pink square does not immediately respond to the drag attempt.</li>
+ <li>The orange square may optionally continue to follow the mouse.</li>
+ <!-- There are no rules here. Browsers may mask the mouseup event from the plugin (since a dnd operation was in progress), or they may pass the mouseup to the plugin (since the dnd operation has completed). -->
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndropleavedeactivate.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-305.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-305.html
new file mode 100644
index 000000000..3a702789a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-305.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with deactivate in windowless Flash with Alt+Tab</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Ensure at least one other program is running, with its window maximised.</li>
+ <li>Drag the orange square over the blue square.</li>
+ <li>Without releasing the mouse button, use Alt+Tab (or your system's equivalent) to switch to the other program, then back to this one.</li>
+ <li>Move the mouse around inside the black square. The orange square should continue to follow the mouse.</li>
+ </ol>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndropleavedeactivate.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-306.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-306.html
new file mode 100644
index 000000000..a8248bd69
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-306.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with deactivate in windowless Flash with Alt+Tab over page</title>
+ <style type="text/css">
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Ensure at least one other program is running, with its window maximised.</li>
+ <li>Drag the orange square around until the mouse is outside the black square.</li>
+ <li>Without releasing the mouse button, use Alt+Tab (or your system's equivalent) to switch to the other program, then back to this one.</li>
+ <li>Move the mouse inside the black square. The orange square should continue to follow the mouse.</li>
+ </ol>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndropleavedeactivate.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-307.html b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-307.html
new file mode 100644
index 000000000..1def298cc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/plugin-dnd-307.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Drag and drop with deactivate with Alt+Tab over windowless Flash</title>
+ <style type="text/css">
+div {
+ width: 100px;
+ height: 100px;
+ background: fuchsia;
+}
+object {
+ width: 400px;
+ height: 400px;
+ border: 5px solid black;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <ol>
+ <li>Ensure at least one other program is running, with its window maximised.</li>
+ <li>Drag the pink square over the blue square. The mouse cursor should be the no-drop cursor, or the platform's drop-allowed cursor.</li>
+ <li>Without releasing the mouse button, use Alt+Tab (or your system's equivalent) to switch to the other program, then back to this one.</li>
+ <li>The mouse cursor should be the same cursor as in step 2.</li>
+ <li>Move the mouse outside the black square. The drag placeholder should follow the mouse (reappearing if it disappeared in step 2).</li>
+ <li>Release the drag. The drag placeholder should disappear, and the cursor should revert to the default mouse cursor.</li>
+ </ol>
+ <div draggable="true"></div>
+ <script type="text/javascript">
+var plugincode = '<object data="dragndropleavedeactivate.swf" type="application/x-shockwave-flash"><param name="wmode" value="opaque">Flash plugin is required for this test.</object>';
+ </script>
+ <script type="text/javascript" src="click-to-activate.js"></script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hx b/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hx
new file mode 100644
index 000000000..25fc51ef0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hx
@@ -0,0 +1,133 @@
+import Std;
+import flash.Lib;
+import flash.events.MouseEvent;
+
+class DragNDrop
+{
+ static var s_box_draggable:Box;
+ static var s_box_target:Box;
+ static var s_dragging:Bool = false;
+
+ private static function main()
+ {
+ /* Blue box (target). */
+ s_box_target = new Box(0x0000ff, 100, 100, 150, 150);
+ /* Orange box (draggable). */
+ s_box_draggable = new Box(0xffa500, 25, 25, 50, 50);
+
+ flash.Lib.current.stage.addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
+ flash.Lib.current.stage.addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMove);
+ flash.Lib.current.stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
+ }
+
+ static function OnMouseDown(event:MouseEvent):Void
+ {
+ if (s_box_draggable.IsHit(event.stageX, event.stageY))
+ s_dragging = true;
+ }
+
+ static function OnMouseUp(event:MouseEvent):Void
+ {
+ s_dragging = false;
+
+ /* Check if passed. */
+ if (s_box_draggable.IsWithin(s_box_target))
+ {
+ s_box_draggable.Hide();
+ s_box_target.SetColor(0xffee00);
+ }
+ }
+
+ static function OnMouseMove(event:MouseEvent):Void
+ {
+ if (s_dragging)
+ {
+ ClearCanvas();
+ s_box_target.Redraw();
+ s_box_draggable.Move(event.stageX, event.stageY);
+ }
+ }
+
+ static function ClearCanvas():Void
+ {
+ var mc:flash.display.MovieClip = flash.Lib.current;
+ mc.graphics.beginFill(0xffffff);
+ mc.graphics.drawRect(0, 0, flash.Lib.current.stage.width, flash.Lib.current.stage.height);
+ mc.graphics.endFill();
+ }
+}
+
+class Box
+{
+ var m_mc:flash.display.MovieClip;
+ var m_color:Int;
+ var m_rel_x:Float;
+ var m_rel_y:Float;
+ var m_x:Float;
+ var m_y:Float;
+ var m_width:Int;
+ var m_height:Int;
+
+ public function new(color:Int, x:Int, y:Int, width:Int, height:Int)
+ {
+ m_mc = flash.Lib.current;
+ m_color = color;
+ m_x = x;
+ m_y = y;
+ m_width = width;
+ m_height = height;
+
+ Redraw();
+ }
+
+ public function IsHit(x:Float, y:Float):Bool
+ {
+ if ((x >= m_x && x <= m_x + m_width) && (y >= m_y && y <= m_y + m_height))
+ {
+ m_rel_x = x - m_x;
+ m_rel_y = y - m_y;
+ return true;
+ }
+
+ return false;
+ }
+
+ public function IsWithin(other:Box):Bool
+ {
+ return m_x >= other.m_x && m_x + m_width <= other.m_x + other.m_width
+ && m_y >= other.m_y && m_y + m_height <= other.m_y + other.m_height;
+ }
+
+ public function Hide():Void
+ {
+ m_width = 0;
+ m_height = 0;
+ }
+
+ public function SetColor(color:Int):Void
+ {
+ m_color = color;
+ Redraw();
+ }
+
+ public function Move(x:Float, y:Float):Void
+ {
+ /* Accounting for click offset. */
+ m_x = x - m_rel_x;
+ m_y = y - m_rel_y;
+ Draw(Std.int(m_x), Std.int(m_y), m_width, m_height);
+ }
+
+ public function Redraw():Void
+ {
+ Draw(Std.int(m_x), Std.int(m_y), m_width, m_height);
+ }
+
+ private function Draw(x:Int, y:Int, width:Int, height:Int)
+ {
+ /* Draw moved rect. */
+ m_mc.graphics.beginFill(m_color);
+ m_mc.graphics.drawRect(x, y, width, height);
+ m_mc.graphics.endFill();
+ }
+}
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hxml b/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hxml
new file mode 100644
index 000000000..71f2eb5b9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/dragndrop.hxml
@@ -0,0 +1 @@
+-swf dragndrop.swf -swf-version 10 -main DragNDrop -swf-header 300:300:25:FFFFFF \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/mouseup.hx b/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/mouseup.hx
new file mode 100644
index 000000000..13a8757bd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/mouseup.hx
@@ -0,0 +1,34 @@
+import flash.Lib;
+import flash.display.Sprite;
+import flash.events.MouseEvent;
+
+class MouseUp extends Sprite
+{
+ var s:Sprite;
+
+ static function main()
+ {
+ new MouseUp();
+ }
+
+ public function new()
+ {
+ super();
+ flash.Lib.current.addChild(this);
+
+ s = new Sprite();
+ s.graphics.beginFill(0xffa500);
+ s.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
+ s.graphics.endFill();
+ stage.addChild(s);
+
+ stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
+ }
+
+ function OnMouseUp(event:MouseEvent):Void
+ {
+ s.graphics.beginFill(0xffee00);
+ s.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
+ s.graphics.endFill();
+ }
+}
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/mouseup.hxml b/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/mouseup.hxml
new file mode 100644
index 000000000..d58859034
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/mouseup.hxml
@@ -0,0 +1 @@
+-swf mouseup.swf -swf-version 10 -main MouseUp -swf-header 300:300:25:FFFFFF \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/plugindrop.html b/testing/web-platform/tests/html/editing/dnd/platform/plugindrop.html
new file mode 100644
index 000000000..548e4da8c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/plugindrop.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop sequence should end when dropping over a plugin</title>
+ <style type="text/css">
+div {
+ background: orange;
+ height: 100px;
+ width: 100px;
+}
+object {
+ height: 100px;
+ width: 100px;
+}
+ </style>
+ </head>
+ <body>
+
+ <p>Use your pointing device to drag the orange square onto the blue square, and release it. The drag placeholder should disappear after releasing (or as the pointer moves over the blue square). Try dragging the orange square again. Fail if it does not respond when trying to drag it.</p>
+ <div draggable="true" ondragstart="event.dataTransfer.setData('Text','dummy text');"></div>
+ <p><object data="../resources/boxnavy.swf"></object></p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/selection-between-ui.html b/testing/web-platform/tests/html/editing/dnd/platform/selection-between-ui.html
new file mode 100644
index 000000000..a0e94f65b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/selection-between-ui.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dragging text from UI widgets to each other</title>
+ </head>
+ <body>
+
+ <ol>
+ <li>Select some text in the address bar.</li>
+ <li>Drag the selection to another text input in the UI, and release it.</li>
+ <li>Pass if:<ol>
+ <li>A visible representation of the selected text appears to be dragged.</li>
+ <li>The mouse cursor shows that the drop will be allowed over the input.</li>
+ <li>The selected text appears in the input.</li>
+ </ol></li>
+ <li>Repeat the test with other UI text inputs as drag source/destination.</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/selection-from-os.html b/testing/web-platform/tests/html/editing/dnd/platform/selection-from-os.html
new file mode 100644
index 000000000..14f3db335
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/selection-from-os.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - dragging a selection from the OS</title>
+ </head>
+ <body>
+
+ <p>This test is only relevant on platforms where it is possible to switch applications in mid-drag (eg. alt+tab, dragging over taskbar buttons, dragging between restored windows).</p>
+ <p>This testcase requires an external application that allows dragging of selections into other applications - eg. Wordpad (write.exe) on Windows. Ensure that the external application is open.</p>
+ <p>Move the browser window so it sits about 200 pixels down from the top of the screen.</p>
+ <p>Subtest 1. Write some text into the external application (if needed), containing both unicode and Latin characters. Select the text in the external application, and drag the selection into the following input:<br><textarea rows="3" cols="50"></textarea><br>Pass if the text you selected appears in the input.</p>
+ <p>Subtest 2. Select the text in the external application, and drag the selection into the following block:
+ <span style="background:orange;display:block;min-height:100px;width:300px;" ondragenter="return false;" ondragover="return false;" ondrop="this.innerHTML = arguments[0].dataTransfer.getData('text/plain');return false;"></span>
+ Pass if the text you selected appears in the block.</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/selection-from-ui.html b/testing/web-platform/tests/html/editing/dnd/platform/selection-from-ui.html
new file mode 100644
index 000000000..1fc552ec6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/selection-from-ui.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dragging text from UI widgets</title>
+ </head>
+ <body>
+
+ <ol>
+ <li>Select some text in the address bar.</li>
+ <li>Drag the selection to the following textarea, and release it: <br><textarea rows="3" cols="50"></textarea></li>
+ <li>Pass if:<ol>
+ <li>A visible representation of the selected text appears to be dragged.</li>
+ <li>The mouse cursor shows that the drop will be allowed over the textarea.</li>
+ <li>The selected text appears in the textarea.</li>
+ </ol></li>
+ <li>Repeat the test with other UI text inputs, including ones that allow linebreaks (if any).</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/selection-to-os.html b/testing/web-platform/tests/html/editing/dnd/platform/selection-to-os.html
new file mode 100644
index 000000000..c4c729547
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/selection-to-os.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - dragging a selection onto the OS</title>
+ </head>
+ <body>
+
+ <p>This test is only relevant on platforms where it is possible to switch applications in mid-drag (eg. alt+tab, dragging over taskbar buttons, dragging between restored windows).</p>
+ <p>This testcase requires an external application that accepts dropping of text from other applications - eg. Wordpad (write.exe) on Windows. Ensure that the external application is open.</p>
+ <p>Select this text. Drag the selection to the other application and release it. Pass if the text you selected appears in the other application, and the drag placeholder disappears when the drag is released.</p>
+ <p>Disable JavaScript and repeat the test. It should still pass.</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/selection-to-ui-via.html b/testing/web-platform/tests/html/editing/dnd/platform/selection-to-ui-via.html
new file mode 100644
index 000000000..f4f1cf159
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/selection-to-ui-via.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dragging text to UI widgets via window decoration</title>
+ </head>
+ <body>
+
+ <p>This test assumes that the address bar is positioned below the window's title bar, and above the page. If your browser uses an alternative layout, adjust your testing accordingly to ensure that the testing interacts with the edges of the window decoration.</p>
+ <ol>
+ <li>Select some text on this page.</li>
+ <li>Drag the selection to your browser's title bar.</li>
+ <li>Drag the selection back to your browser's address field. Fail if the mouse cursor shows that the text cannot be dropped.</li>
+ <li>Fail if the cursor and/or input focus caret respond in the wrong position (ie. if the drag operation seems to think the address field is offset from its actual location).</li>
+ <li>Release it. Pass if the selected text appears in the address field.</li>
+ <li>Repeat the test with other UI text inputs.</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/selection-to-ui.html b/testing/web-platform/tests/html/editing/dnd/platform/selection-to-ui.html
new file mode 100644
index 000000000..9c3a60387
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/selection-to-ui.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dragging text to UI widgets</title>
+ </head>
+ <body>
+
+ <ol>
+ <li>Select some text on this page.</li>
+ <li>Drag the selection to your browser's address field. Fail if the mouse cursor shows that the text cannot be dropped.</li>
+ <li>Release it. Pass if the selected text appears in the address field.</li>
+ <li>Repeat the test with other UI text inputs.</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/selection-ui-to-self.html b/testing/web-platform/tests/html/editing/dnd/platform/selection-ui-to-self.html
new file mode 100644
index 000000000..363416de8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/selection-ui-to-self.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dragging text from UI widgets to themselves</title>
+ </head>
+ <body>
+
+ <ol>
+ <li>Select all text in the address bar.</li>
+ <li>Drag the selection around a little, and release it over the address bar again.</li>
+ <li>Try to select the text in this sentence.</li>
+ <li>Pass if:<ol>
+ <li>A visible representation of the selected text appears to be dragged.</li>
+ <li>The mouse cursor shows that the drop will be allowed over the address bar.</li>
+ <li>The text on this page can be selected afterwards.</li>
+ </ol></li>
+ <li>Repeat the test with other UI text inputs as drag source/destination.</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/selection-unicode-to-os.html b/testing/web-platform/tests/html/editing/dnd/platform/selection-unicode-to-os.html
new file mode 100644
index 000000000..ed093f6fa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/selection-unicode-to-os.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - dragging a selection containing unicode onto the OS</title>
+ </head>
+ <body>
+
+ <p>This test is only relevant on platforms where it is possible to switch applications in mid-drag (eg. alt+tab, dragging over taskbar buttons, dragging between restored windows).</p>
+ <p>This testcase requires an external application that accepts dropping of text from other applications, and supports unicode - eg. Wordpad (write.exe) on Windows. Ensure that the external application is open.</p>
+ <p>Select the following non-English text --> 中文אידישрусский &lt;-- Drag the selection to the other application and release it. Pass if the text you selected appears in the other application, and the drag placeholder disappears when the drag is released.</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/taskbardrop.html b/testing/web-platform/tests/html/editing/dnd/platform/taskbardrop.html
new file mode 100644
index 000000000..4b4e6c468
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/taskbardrop.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - dropping on the taskbar</title>
+ </head>
+ <body>
+
+ <p>This test is only relevant on platforms where dragging over taskbar buttons will switch between applications.</p>
+ <p>Ensure that at least one other application is open and visible on the taskbar. Maximise this browser window. Select this text. Drag the selection downwards, over a blank part of the system taskbar, and release the drag. Drag the selection again, over the taskbar button for the other application (without passing over any other buttons on the taskbar). Fail if the drag placeholder does not appear when dragging the selection. Pass if the other application becomes focused.</p>
+ <p>Repeat this test while dropping on other parts of the taskbar, such as:</p>
+ <ul>
+ <li>The Start menu button (or your system's equivalent)</li>
+ <li>The Quick Launch bar (or your system's equivalent)</li>
+ <li>The System Tray (or your system's equivalent)</li>
+ <li>The expander button for the System Tray (or your system's equivalent)</li>
+ <li>The button for another application</li>
+ <li>The label for a folder toolbar - drop a folder onto the Windows taskbar to create one (or your system's equivalent)</li>
+ <li>The menu button for a folder toolbar (or your system's equivalent)</li>
+ </ul>
+ <p><strong>WARNING: different operating system versions handle this differently - Windows XP Taskbar in particular can cause several more problems than the Windows 7 Taskbar</strong></p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/taskbarminimise.html b/testing/web-platform/tests/html/editing/dnd/platform/taskbarminimise.html
new file mode 100644
index 000000000..8531ad935
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/taskbarminimise.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - minimising using the taskbar</title>
+ </head>
+ <body>
+
+ <p>This test is only relevant on platforms where dragging over the taskbar (or a specific button on it) will minimise all applications.</p>
+ <p>Select this text. Drag the selection downwards, over a blank part of the system taskbar (or a minimise-all button if provided by the system). Hold the drag until all applications have minimised, then drag upwards over the desktop. Pass if the drag placeholder is still visible.</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/text-os-to-os.html b/testing/web-platform/tests/html/editing/dnd/platform/text-os-to-os.html
new file mode 100644
index 000000000..030972b70
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/text-os-to-os.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - dragging items from the OS to the OS, via the browser window</title>
+ </head>
+ <body>
+
+ <p>This test is only relevant on platforms where it is possible to switch applications in mid-drag (eg. alt+tab, dragging over taskbar buttons, dragging between restored windows).</p>
+ <p>This testcase requires an external application that accepts dropping of text from other applications - eg. Wordpad (write.exe) on Windows. Ensure that the external application is open.</p>
+ <p>Select some text in the external application. Drag the selection over the browser window, then back to the other application and release it. Pass if the text you selected appears in the other application.</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/text-to-os.html b/testing/web-platform/tests/html/editing/dnd/platform/text-to-os.html
new file mode 100644
index 000000000..ce57c43eb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/platform/text-to-os.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<html>
+ <head>
+ <title>drag and drop - dragging plain text onto the OS</title>
+ </head>
+ <body>
+
+ <p>This test is only relevant on platforms where it is possible to switch applications in mid-drag (eg. alt+tab, dragging over taskbar buttons, dragging between restored windows).</p>
+ <p>This testcase requires an external application that accepts dropping of text from other applications - eg. Wordpad (write.exe) on Windows. Ensure that the external application is open.</p>
+ <p draggable="true">Drag this paragraph to the other application and release it. Pass if &quot;PASS&quot; appears in the other application, and the drag placeholder disappears when the drag is released.</p>
+ <script type="text/javascript">
+document.getElementsByTagName('p')[2].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('Text', 'PASS');
+};
+ </script>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/001.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/001.xhtml
new file mode 100644
index 000000000..87b97d415
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/001.xhtml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during canvas drag and drop roundtrip</title>
+<style type="text/css">
+img
+ {margin:0 2px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('p').appendChild(c);}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/uri-list', document.querySelector('canvas').toDataURL('image/png'));
+ window.location.reload();}
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)" ondragenter="event.preventDefault()" ondragover="return false" ondrop="addImage(event)">Canvas</canvas>
+</p>
+<p>Drag canvas pattern around page and then drag it back and drop on itself. It should be duplicated once you drop it.</p>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/002.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/002.xhtml
new file mode 100644
index 000000000..47d14528a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/002.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during PNG image drag and drop roundtrip</title>
+<style type="text/css">
+img
+ {margin:0 2px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('p').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location.reload()" ondragenter="event.preventDefault()" ondrop="addImage(event)" ondragover="return false" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag circle around page and then drag it back and drop on itself. It should be duplicated once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/003.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/003.xhtml
new file mode 100644
index 000000000..9fadf3926
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/003.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during SVG image drag and drop roundtrip</title>
+<style type="text/css">
+img
+ {margin:0 2px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('p').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location.reload()" ondragenter="event.preventDefault()" ondrop="addImage(event)" ondragover="return false" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle"/></p>
+<p>Drag circle around page and then drag it back and drop on itself. It should be duplicated once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/004.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/004.xhtml
new file mode 100644
index 000000000..26489b562
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/004.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during text input selection drag and drop roundtrip</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragstart="window.location.reload()" ondragenter="event.preventDefault();" ondragover="return false" ondrop="event.preventDefault();this.value = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'"/></p>
+<p>Drag selected text around page and then drag it back and drop on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/005.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/005.xhtml
new file mode 100644
index 000000000..1e0e1bb82
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/005.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during selection drag and drop roundtrip</title>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('span'))">
+<p><span ondragstart="window.location.reload()" ondragenter="event.preventDefault()" ondragover="return false" ondrop="document.querySelector('span').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">Drag me</span></p>
+<p>Drag selected text around page and then drag it back and drop on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/006.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/006.xhtml
new file mode 100644
index 000000000..953dc47ad
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/006.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during link drag and drop roundtrip</title>
+<script type="application/ecmascript">
+function checkLink(event)
+ {document.querySelector('a').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="event.dataTransfer.effectAllowed = 'copy';window.location.reload()" ondragenter="event.preventDefault()" ondrop="checkLink(event)" ondragover="return false">Drag me</a></p>
+<p>Drag link around page and then drag it back and drop on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/007.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/007.xhtml
new file mode 100644
index 000000000..0a4160e9a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/007.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during drag and drop roundtrip with text/plain data</title>
+<style type="text/css">
+div[ondragenter]
+ {width:40px;
+ min-height:40px;
+ margin-top:20px;
+ padding:40px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div
+ draggable="true"
+ ondragstart="event.dataTransfer.effectAllowed = 'copy';event.dataTransfer.setData('text/plain',' PASS ');window.location.reload();"
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+<p>Drag blue box around page and then drag it back and drop on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/008.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/008.xhtml
new file mode 100644
index 000000000..a0c49e6ea
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/008.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during drag and drop roundtrip with text/uri-list data</title>
+<style type="text/css">
+div[ondragenter]
+ {width:40px;
+ min-height:40px;
+ margin-top:20px;
+ padding:40px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div
+ draggable="true"
+ ondragstart="event.dataTransfer.effectAllowed = 'copy';event.dataTransfer.setData('text/uri-list','data:text/plain,PASS');window.location.reload()"
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/uri-list').substr(16,4) + ' '))"
+/>
+<p>Drag blue box around page and then drag it back and drop on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/009-1.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/009-1.xhtml
new file mode 100644
index 000000000..9e98b9320
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/009-1.xhtml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during drag and drop: helper file</title>
+</head>
+<body ondragleave="window.location.reload()">
+<p><a href="data:text/plain,1" ondragstart="event.dataTransfer.effectAllowed = 'copy'">Drag me</a></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/009.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/009.xhtml
new file mode 100644
index 000000000..5cb61fb8d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/009.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during link drag and drop from object</title>
+<style type="text/css">
+object
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body dropzone="copy string:text/uri-list" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'">
+<object type="application/xhtml+xml" data="009-1.xhtml">XHTML document</object>
+<p>Drag link above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/010-1.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/010-1.xhtml
new file mode 100644
index 000000000..51d2012f7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/010-1.xhtml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during drag and drop: helper file</title>
+</head>
+<body onload="document.querySelector('input').select()" ondragleave="window.location.reload()">
+<p><input value="Drag me"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/010.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/010.xhtml
new file mode 100644
index 000000000..86663f722
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/010.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during text input selection drag and drop from object</title>
+<style type="text/css">
+object
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body dropzone="copy string:text/plain" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
+<object type="application/xhtml+xml" data="010-1.xhtml">XHTML document</object>
+<p>Drag selection above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/011-1.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/011-1.xhtml
new file mode 100644
index 000000000..61c46c57f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/011-1.xhtml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during drag and drop: helper file</title>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))" ondragleave="window.location.reload()">
+<p>Drag me</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/011.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/011.xhtml
new file mode 100644
index 000000000..837b08536
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/011.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during selection drag and drop from object</title>
+<style type="text/css">
+object
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body dropzone="copy string:text/plain" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
+<object type="application/xhtml+xml" data="011-1.xhtml">XHTML document</object>
+<p>Drag selection above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/012-1.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/012-1.xhtml
new file mode 100644
index 000000000..b7f0ab11a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/012-1.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during drag and drop: helper file</title>
+</head>
+<body ondragleave="window.location.reload()">
+<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/012-2.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/012-2.xhtml
new file mode 100644
index 000000000..ae8560b14
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/012-2.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during drag and drop: helper file</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/reload/012.xhtml b/testing/web-platform/tests/html/editing/dnd/reload/012.xhtml
new file mode 100644
index 000000000..d4028cc72
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/reload/012.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reload during drag and drop of image between frames</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="012-1.xhtml"/>
+<frame src="012-2.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/001.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/001.xhtml
new file mode 100644
index 000000000..1ab5013cc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/001.xhtml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing canvas element during drag and drop</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/uri-list', document.querySelector('canvas').toDataURL('image/png'));
+ document.querySelector('p').removeChild(canvas);}
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)">Canvas</canvas>
+</p>
+<p>Drag canvas pattern to the silver box below and drop it. It should be copied to the box once you drop it there.</p>
+<div ondragover="return false" ondrop="addImage(event)"/>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/002.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/002.xhtml
new file mode 100644
index 000000000..02a9dc748
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/002.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing image element during drag and drop of PNG image</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy';document.querySelector('p').removeChild(document.querySelector('img'))" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag green circle to the silver box below and drop it. It should be copied to the box once you drop it there.</p>
+<div ondragover="return false" ondrop="addImage(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/003.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/003.xhtml
new file mode 100644
index 000000000..33eeb6a57
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/003.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing image element during drag and drop of SVG image</title>
+<style type="text/css">
+div
+ {height:100px;
+ width:100px;
+ padding:20px;
+ background-color:silver;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy';document.querySelector('p').removeChild(document.querySelector('img'))" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle"/></p>
+<p>Drag green circle to the silver box below and drop it. It should be copied to the box once you drop it there.</p>
+<div ondragover="return false" ondrop="addImage(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/004.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/004.xhtml
new file mode 100644
index 000000000..44db01933
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/004.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing input element during drag and drop of selection</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragstart="document.querySelector('p').removeChild(document.querySelector('input'))"/></p>
+<p>Drag selection above to the navy box below and drop it. You should see word PASS once you drop it in the box.</p>
+<div ondragover="return false" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'))"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/005.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/005.xhtml
new file mode 100644
index 000000000..23faac7cd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/005.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing span element during drag and drop of selection</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('span'))">
+<p><span ondragstart="document.querySelector('p').removeChild(document.querySelector('span'))">Drag me</span></p>
+<p>Drag selection above to the navy box below and drop it. You should see word PASS once you drop it in the box.</p>
+<div ondragover="return false" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'))"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/006.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/006.xhtml
new file mode 100644
index 000000000..0b3b92c60
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/006.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing a element during drag and drop of link</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="event.dataTransfer.effectAllowed = 'copy';document.querySelector('p').removeChild(document.querySelector('a'))">Drag me</a></p>
+<p>Drag link above to the navy box below and drop it. You should see word PASS once you drop it in the box.</p>
+<div ondragover="return false" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'))"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/007.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/007.xhtml
new file mode 100644
index 000000000..fbda18623
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/007.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing div element during drag and drop with text/plain data</title>
+<style type="text/css">
+div
+ {width:40px;
+ height:40px;
+ margin-top:20px;
+ padding:40px;
+ color:white;
+ background-color:gray;}
+p + div
+ {background-color:navy;}
+</style>
+</head>
+<body>
+<div
+ draggable="true"
+ ondragstart="event.dataTransfer.effectAllowed = 'copy';event.dataTransfer.setData('text/plain','PASS');document.querySelector('body').removeChild(document.querySelector('div'))"
+/>
+<p>Drag gray box above to the navy box below and drop it. You should see word PASS once you drop it.</p>
+<div
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/008.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/008.xhtml
new file mode 100644
index 000000000..24aff7ea9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/008.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing div element during drag and drop with text/uri-list data</title>
+<style type="text/css">
+div
+ {width:40px;
+ height:40px;
+ margin-top:20px;
+ padding:40px;
+ color:white;
+ background-color:gray;}
+p + div
+ {background-color:navy;}
+</style>
+</head>
+<body>
+<div
+ draggable="true"
+ ondragstart="event.dataTransfer.effectAllowed = 'copy';event.dataTransfer.setData('text/uri-list','data:text/plain,PASS');document.querySelector('body').removeChild(document.querySelector('div'))"
+/>
+<p>Drag gray box above to the navy box below and drop it. You should see word PASS once you drop it.</p>
+<div
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/uri-list').substr(16,4)))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/009.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/009.xhtml
new file mode 100644
index 000000000..5d1aa6989
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/009.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Changing iframe content during drag and drop of link</title>
+<style type="text/css">
+iframe
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body ondragenter="event.preventDefault();document.querySelector('iframe').src = 'data:text/plain,Drop%20link%20outside%20this%20frame'" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'">
+<iframe src="helper-drag-me-link.xhtml">XHTML document</iframe>
+<p>Drag link above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/010.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/010.xhtml
new file mode 100644
index 000000000..f0e609277
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/010.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Changing object content during drag and drop of link</title>
+<style type="text/css">
+object
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body ondragenter="event.preventDefault();document.querySelector('object').setAttribute('data','data:text/plain,Drop%20link%20outside%20this%20frame')" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'">
+<object type="application/xhtml+xml" data="helper-drag-me-link.xhtml">XHTML document</object>
+<p>Drag link above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/011.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/011.xhtml
new file mode 100644
index 000000000..3fc9f0a07
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/011.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Changing iframe content during drag and drop of text input selection</title>
+<style type="text/css">
+iframe
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body ondragenter="event.preventDefault();document.querySelector('iframe').src = 'data:text/plain,Drop%20selection%20outside%20this%20frame'" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
+<iframe src="helper-drag-me-input.xhtml">XHTML document</iframe>
+<p>Drag selection above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/012.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/012.xhtml
new file mode 100644
index 000000000..ab6e2db37
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/012.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Changing object content during drag and drop of text input selection</title>
+<style type="text/css">
+object
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body ondragenter="event.preventDefault();document.querySelector('object').setAttribute('data','data:text/plain,Drop%20selection%20outside%20this%20frame')" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
+<object type="application/xhtml+xml" data="helper-drag-me-input.xhtml">XHTML document</object>
+<p>Drag selection above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/013.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/013.xhtml
new file mode 100644
index 000000000..0bacf9e56
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/013.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Changing iframe content during drag and drop of selection</title>
+<style type="text/css">
+iframe
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body ondragenter="event.preventDefault();document.querySelector('iframe').src = 'data:text/plain,Drop%20selection%20outside%20this%20frame'" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
+<iframe src="helper-drag-me-p.xhtml">XHTML document</iframe>
+<p>Drag selection above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/014.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/014.xhtml
new file mode 100644
index 000000000..93fae6f31
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/014.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Changing object content during drag and drop of selection</title>
+<style type="text/css">
+object
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body ondragenter="event.preventDefault();document.querySelector('object').setAttribute('data','data:text/plain,Drop%20selection%20outside%20this%20frame')" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
+<object type="application/xhtml+xml" data="helper-drag-me-p.xhtml">XHTML document</object>
+<p>Drag selection above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/015.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/015.xhtml
new file mode 100644
index 000000000..dcba8d490
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/015.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing iframe during drag and drop of link</title>
+<style type="text/css">
+iframe
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body ondragenter="event.preventDefault();document.querySelector('body').removeChild(document.querySelector('iframe'))" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'">
+<iframe src="helper-drag-me-link.xhtml">XHTML document</iframe>
+<p>Drag link above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/016.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/016.xhtml
new file mode 100644
index 000000000..3e2881eb0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/016.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing object during drag and drop of link</title>
+<style type="text/css">
+object
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body ondragenter="event.preventDefault();document.querySelector('body').removeChild(document.querySelector('object'))" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'">
+<object type="application/xhtml+xml" data="helper-drag-me-link.xhtml">XHTML document</object>
+<p>Drag link above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/017.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/017.xhtml
new file mode 100644
index 000000000..d7c331017
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/017.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing iframe during drag and drop of text input selection</title>
+<style type="text/css">
+iframe
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body ondragenter="event.preventDefault();document.querySelector('body').removeChild(document.querySelector('iframe'))" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
+<iframe src="helper-drag-me-input.xhtml">XHTML document</iframe>
+<p>Drag selection above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/018.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/018.xhtml
new file mode 100644
index 000000000..2dda93fe9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/018.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing object during drag and drop of text input selection</title>
+<style type="text/css">
+object
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body ondragenter="event.preventDefault();document.querySelector('body').removeChild(document.querySelector('object'))" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
+<object type="application/xhtml+xml" data="helper-drag-me-input.xhtml">XHTML document</object>
+<p>Drag selection above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/019.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/019.xhtml
new file mode 100644
index 000000000..86969550f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/019.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing iframe during drag and drop of selection</title>
+<style type="text/css">
+iframe
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body ondragenter="event.preventDefault();document.querySelector('body').removeChild(document.querySelector('iframe'))" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
+<iframe src="helper-drag-me-p.xhtml">XHTML document</iframe>
+<p>Drag selection above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/020.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/020.xhtml
new file mode 100644
index 000000000..f5bc7d464
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/020.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing object during drag and drop of selection</title>
+<style type="text/css">
+object
+ {height:100px;
+ width:300px;
+ border:solid medium navy;}
+</style>
+</head>
+<body ondragenter="event.preventDefault();document.querySelector('body').removeChild(document.querySelector('object'))" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
+<object type="application/xhtml+xml" data="helper-drag-me-p.xhtml">XHTML document</object>
+<p>Drag selection above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/021.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/021.xhtml
new file mode 100644
index 000000000..fe67ded93
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/021.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Removing a element during drag and drop of url</title>
+<style type="text/css">
+div
+ {min-height:100px;
+ width:100px;
+ padding:20px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="event.dataTransfer.effectAllowed = 'copy';document.querySelector('p').removeChild(document.querySelector('a'))">Drag me</a></p>
+<p>Drag selection above to the navy box below and drop it. You should see word PASS once you drop it in the box.</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="document.querySelector('div').appendChild(document.createTextNode((event.dataTransfer.getData('url') == 'data:text/plain,1')?'PASS':'FAIL'))"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/022-1.html b/testing/web-platform/tests/html/editing/dnd/remove/022-1.html
new file mode 100644
index 000000000..fe65c6045
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/022-1.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>Removing drop targetted document before the queue is processed</title>
+<style>
+ html, body, div {
+ height: 100%;
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ background-color: blue;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var blue = document.getElementsByTagName('div')[0];
+ blue.ondragenter = blue.ondragover = blue.ondrop = function (e) {
+ e.preventDefault();
+ };
+ window.addEventListener('message',function (){
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET','/common/blank.html?pipe=trickle(d5)',false);
+ xhr.send(null); //should not end within the lifetime of this document
+ },false);
+};
+</script>
+<div></div>
+<noscript><p>Enable JavaScript and reload</p></noscript>
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/022.html b/testing/web-platform/tests/html/editing/dnd/remove/022.html
new file mode 100644
index 000000000..6bb8e6ade
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/022.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>Removing drop targetted document before the queue is processed</title>
+<style>
+ span, iframe {
+ height: 200px;
+ width: 200px;
+ background-color: orange;
+ display: inline-block;
+ border: none;
+ }
+</style>
+<script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('span')[0];
+ orange.ondragstart = function (e) {
+ e.dataTransfer.setData('text','dummy text');
+ e.dataTransfer.effectAllowed = 'all';
+ document.getElementsByTagName('iframe')[0].contentWindow.postMessage('dummy message','*');
+ setTimeout(function () {
+ document.getElementsByTagName('p')[0].removeChild(document.getElementsByTagName('iframe')[0]);
+ },4000);
+ };
+};
+</script>
+<p><span draggable="true"></span> <iframe height="200" width="200" src="022-1.html"></iframe></p>
+
+<p>Drag the orange square over the blue square, then release it. Wait 5 seconds for the blue square to disappear. Pass if you can select this text.</li>
+<noscript><p>Enable JavaScript and reload</p></noscript> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/helper-drag-me-input.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/helper-drag-me-input.xhtml
new file mode 100644
index 000000000..ca87466cd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/helper-drag-me-input.xhtml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/helper-drag-me-link.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/helper-drag-me-link.xhtml
new file mode 100644
index 000000000..9062014b4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/helper-drag-me-link.xhtml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop: helper file</title>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="event.dataTransfer.effectAllowed = 'copy'">Drag me</a></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/remove/helper-drag-me-p.xhtml b/testing/web-platform/tests/html/editing/dnd/remove/helper-drag-me-p.xhtml
new file mode 100644
index 000000000..5e11544c4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/remove/helper-drag-me-p.xhtml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/resources/100x100-navy.png b/testing/web-platform/tests/html/editing/dnd/resources/100x100-navy.png
new file mode 100644
index 000000000..ee8f953c0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/resources/100x100-navy.png
Binary files differ
diff --git a/testing/web-platform/tests/html/editing/dnd/resources/1x1-transparent.gif b/testing/web-platform/tests/html/editing/dnd/resources/1x1-transparent.gif
new file mode 100644
index 000000000..e565824aa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/resources/1x1-transparent.gif
Binary files differ
diff --git a/testing/web-platform/tests/html/editing/dnd/resources/boxnavy.swf b/testing/web-platform/tests/html/editing/dnd/resources/boxnavy.swf
new file mode 100644
index 000000000..c4ef5889a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/resources/boxnavy.swf
Binary files differ
diff --git a/testing/web-platform/tests/html/editing/dnd/resources/circle.png b/testing/web-platform/tests/html/editing/dnd/resources/circle.png
new file mode 100644
index 000000000..8bb141cb8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/resources/circle.png
Binary files differ
diff --git a/testing/web-platform/tests/html/editing/dnd/resources/crossorigin.sub.js b/testing/web-platform/tests/html/editing/dnd/resources/crossorigin.sub.js
new file mode 100644
index 000000000..d6aaa18ad
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/resources/crossorigin.sub.js
@@ -0,0 +1,13 @@
+var httpHostMain = '{{domains[]}}'; //name of the server that this page must accessed over port 80
+var httpHostAlias = '{{domains[www]}}'; //another hostname (must be a subdomain so document.domain can be set to a higher domain) that accesses the same content, over HTTP
+var httpsHostAlias = httpHostAlias; //another hostname (can be same as httpHostAlias) that accesses the same content, over HTTPS port
+var httpPortAlias = {{ports[http][0]}}; //another port that accesses the same content on the current hostname, over HTTP
+//XXX HTTPS
+//var httpsPortAlias = ports[https][0]; //another port that accesses the same content on the httpsHostAlias, over HTTPS
+var httpsPortAlias = 8443;
+
+function crossOriginUrl(subdomain, relative_url) {
+ var a = document.createElement("a");
+ a.href = relative_url;
+ return a.href.replace(location.href.replace("://", "://" + subdomain + "."));
+}
diff --git a/testing/web-platform/tests/html/editing/dnd/resources/fail.png b/testing/web-platform/tests/html/editing/dnd/resources/fail.png
new file mode 100644
index 000000000..b59338033
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/resources/fail.png
Binary files differ
diff --git a/testing/web-platform/tests/html/editing/dnd/resources/filler.html b/testing/web-platform/tests/html/editing/dnd/resources/filler.html
new file mode 100644
index 000000000..6ca9868ac
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/resources/filler.html
@@ -0,0 +1,109 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <title>Filler text</title>
+</head>
+<body>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text</p>
+ <p>Filler text (end)</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/resources/pass.png b/testing/web-platform/tests/html/editing/dnd/resources/pass.png
new file mode 100644
index 000000000..2fa1e0ac0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/resources/pass.png
Binary files differ
diff --git a/testing/web-platform/tests/html/editing/dnd/roundtrip/001.xhtml b/testing/web-platform/tests/html/editing/dnd/roundtrip/001.xhtml
new file mode 100644
index 000000000..671f143f5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/roundtrip/001.xhtml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Canvas drag and drop roundtrip</title>
+<style type="text/css">
+img
+ {margin:0 2px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('p').appendChild(c);}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/uri-list', document.querySelector('canvas').toDataURL('image/png'));}
+</script>
+</head>
+<body>
+<p>
+ <canvas width="100" height="100" draggable="true" ondragstart="start(event)" ondragenter="event.preventDefault()" ondragover="return false" ondrop="addImage(event)">Canvas</canvas>
+</p>
+<p>Drag canvas pattern outside browser window and then drag it back and drop on itself. It should be duplicated once you drop it.</p>
+<script type="application/ecmascript">
+var canvas = document.querySelector('canvas'),
+c = canvas.getContext('2d');
+for(var x = 0; x != 50; x++)
+ {c.fillStyle = (x%2 == 0)?'navy':'white';
+ c.beginPath();
+ c.moveTo(x,x);
+ c.lineTo(100-x,x);
+ c.lineTo(100-x,100-x);
+ c.lineTo(x,100-x);
+ c.closePath();
+ c.fill();}
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/roundtrip/002.xhtml b/testing/web-platform/tests/html/editing/dnd/roundtrip/002.xhtml
new file mode 100644
index 000000000..c7106fdd9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/roundtrip/002.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>PNG image drag and drop roundtrip</title>
+<style type="text/css">
+img
+ {margin:0 2px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('p').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy'" ondragenter="event.preventDefault()" ondrop="addImage(event)" ondragover="return false" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAEq0lEQVR42u1dvU4bQRAeR0RCCilSp0peIoKGB4DSXYRDlcZlFClKBI4bB/kV/AymIDwCTahiicaioEOxhCsjWVTJziyKMfYZn+9ud3bvG2mEZB13u9+nndmf2Rki7fKFXtEBbVKD9o22jB4bPaND6hm9Mjo0enevw/vfevKMfbYl/8vv4HdBUkvFALhltG2A7dN3+pur8jv53fwN/hZkjjRo3eiuAatjdJA7CcnkDOSb/G1uQ6mFzUeDagaQrvl764yEJOU22LbUymXaGrRhOt40OvJOQvLIGUkbP9GLeIn4SM9NJ+tOTVI+Jq0ubY9sVFRNxy6DIWKWmEvpQ/ByQNumI+fBEjHrZ86lT8HJV3ptGn8aDRGzxJxKHwMZFe9Mg6+jJWNCyrX0VbUc0nuj4+jJmPiWsfRZodN+ZvSoNETMjpYjwUCFfKaXpjEnpSVjQsqJYOF5ZLw1elF6MiakXAgmnpw378DegIgZUm4EGw8jA2QsIuUbvXHpM2CmljFfhfsUO5uCA0/j6AudfZV5arv6WuVHcYs+ALwqKTkvHnmLoEwr8CJW9Llts9iNwvj3plzsfeWyIRnzrq37kfIzq6naBpA5a6bzlJgOl/SMkl+rklEFgIX5k5THwTYgIdwzcP2jhM/o19KsOeoArnBS6suaqo2gQnXCJWSwXNwXB4gBMFekNBeTwSGUmiMK4yNktDhsleNaAZRrUvYWmasuQHJOSDdpdKyriEIvo9maexWC70gAIF/bKTvzzFUH4HgbJZ3HdFSw9vC6lfKHpq7X8X07AOOblK2HhLQBindC2g/9Rx+gePcj/cnqHIDoUFm1c9gjwNAy/d0kyXIAMLSYrQ8kqScAhhbH3iLJBwIwtBByTJKkBWBoIeSMJHMOwNBCyG+SdEYAQ4tTvyLJMQUwtBAyJEn8BTC0EHIHQhQSApOlzGTBqaty6jzVAhhaCOlhYahuYYitE02EHGNzURchLZItX4ChhZB9HFBpUjmgwhGuHv0feI0gBw1T3j7CgHT5jzYC5XQRsjUdSsrhjADGl7ka0EylBgRb+ySkMy9rww7A8Waududf2MH9Qh9k3CbXLsGVNh/mqrvojuEeQHI+Qmq4Fq1ndIyeruaDxAEuCWk+ncmB0z3gepubtQenMUHyGTWELJl8xk6B15CeqVAyLtPXtUICsyJnVivWs+J0dAAwbzLOkQRTk2YuKsapTQFkXqPjlDILEinnRcZ1fpXdkGo866xqnH9FNyTjz0JIQZXcuPQCAE5rqo6oMEFBl7RknBRfTg8lj5Yl48JdGT0ueIWiYIvIuHFfPg9l85LJcF42b+JTUFjysZnyVlhy2qfA0asovTo9+0JxYnWC8t0KBQXuFYrdkIy3mBj3LbeNQrejZTuqOlbcl8znGTqcfjXoM3pboqgaPhEPxda1qgcVYsRt5TanDkgISWzcV1N1hCS3jdu4dNxUDMIhlBzXysHGGspkcBtsW2pPh3fGLrZ2ya5cXHFp0qxJ6si3E68EQCpy344vQRZxO5jfye+2d/oqgHsV02Z3lvcl9QTnA+EkLZw5h9MZcY4pTvxldXj/W0+esc+25H/5HQGYon+Q5f+MwFz+8QAAAABJRU5ErkJggg==" alt="PNG circle"/></p>
+<p>Drag circle outside browser window and then drag it back and drop on itself. It should be duplicated once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/roundtrip/003.xhtml b/testing/web-platform/tests/html/editing/dnd/roundtrip/003.xhtml
new file mode 100644
index 000000000..0f89a367c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/roundtrip/003.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>SVG image drag and drop roundtrip</title>
+<style type="text/css">
+img
+ {margin:0 2px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,''));
+ document.querySelector('p').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img ondragstart="event.dataTransfer.effectAllowed = 'copy'" ondragenter="event.preventDefault()" ondrop="addImage(event)" ondragover="return false" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle"/></p>
+<p>Drag circle outside browser window and then drag it back and drop on itself. It should be duplicated once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/roundtrip/004.xhtml b/testing/web-platform/tests/html/editing/dnd/roundtrip/004.xhtml
new file mode 100644
index 000000000..0b31a5989
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/roundtrip/004.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Text input selection drag and drop roundtrip</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragenter="event.preventDefault()" ondragover="return false" ondrop="event.preventDefault();this.value = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'"/></p>
+<p>Drag selected text outside browser window and then drag it back and drop on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/roundtrip/005.xhtml b/testing/web-platform/tests/html/editing/dnd/roundtrip/005.xhtml
new file mode 100644
index 000000000..e482fb2a0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/roundtrip/005.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop roundtrip</title>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('span'))">
+<p><span ondragenter="event.preventDefault()" ondragover="return false" ondrop="document.querySelector('span').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">Drag me</span></p>
+<p>Drag selected text outside browser window and then drag it back and drop on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/roundtrip/006.xhtml b/testing/web-platform/tests/html/editing/dnd/roundtrip/006.xhtml
new file mode 100644
index 000000000..d609a72b8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/roundtrip/006.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Link drag and drop roundtrip</title>
+<script type="application/ecmascript">
+function checkLink(event)
+ {document.querySelector('a').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL'}
+</script>
+</head>
+<body>
+<p><a href="data:text/plain,1" ondragstart="event.dataTransfer.effectAllowed = 'copy'" ondragenter="event.preventDefault()" ondrop="checkLink(event)" ondragover="return false">Drag me</a></p>
+<p>Drag link outside browser window and then drag it back and drop on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/roundtrip/007.xhtml b/testing/web-platform/tests/html/editing/dnd/roundtrip/007.xhtml
new file mode 100644
index 000000000..cfe4cb26f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/roundtrip/007.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop roundtrip with text/plain data</title>
+<style type="text/css">
+div[ondragenter]
+ {width:40px;
+ min-height:40px;
+ margin-top:20px;
+ padding:40px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div
+ draggable="true"
+ ondragstart="event.dataTransfer.effectAllowed = 'copy';event.dataTransfer.setData('text/plain',' PASS ')"
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+<p>Drag blue box outside browser window and then drag it back and drop on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/roundtrip/008.xhtml b/testing/web-platform/tests/html/editing/dnd/roundtrip/008.xhtml
new file mode 100644
index 000000000..21adfb50a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/roundtrip/008.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop roundtrip with text/uri-list data</title>
+<style type="text/css">
+div[ondragenter]
+ {width:40px;
+ min-height:40px;
+ margin-top:20px;
+ padding:40px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div
+ draggable="true"
+ ondragstart="event.dataTransfer.effectAllowed = 'copy';event.dataTransfer.setData('text/uri-list','data:text/plain,PASS')"
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/uri-list').substr(16,4) + ' '))"
+/>
+<p>Drag blue box outside browser window and then drag it back and drop on itself. You should see word PASS once you drop it.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/001.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/001.xhtml
new file mode 100644
index 000000000..e1806f8e2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/001.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/002.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/002.xhtml
new file mode 100644
index 000000000..55c457e53
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/002.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from search input to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input type="search" value="Selection"/></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/003.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/003.xhtml
new file mode 100644
index 000000000..6430d603d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/003.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from tel input to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input type="tel" value="123456789"/></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/004.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/004.xhtml
new file mode 100644
index 000000000..1c6904853
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/004.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from url input to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected url to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input type="url" value="http://example.org"/></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/005.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/005.xhtml
new file mode 100644
index 000000000..a8d7056e4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/005.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from email input to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected email to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input type="email" value="mail@example.org"/></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/006.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/006.xhtml
new file mode 100644
index 000000000..9a2b41e82
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/006.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from number input to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input type="number" value="123456789"/></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/007.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/007.xhtml
new file mode 100644
index 000000000..2b5d05a50
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/007.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from short text input to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected date to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input size="5" value="Drag me"/></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/008.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/008.xhtml
new file mode 100644
index 000000000..6abfe2c31
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/008.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from password input to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>You should not be able to drag and drop selection from password field to the blue box.</p>
+<p><input type="password" value="FAIL"/></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/009.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/009.xhtml
new file mode 100644
index 000000000..07509f6bc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/009.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from readonly text input to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input readonly="readonly" value="Drag me"/></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/010.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/010.xhtml
new file mode 100644
index 000000000..d26770ee6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/010.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from texarea to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+textarea
+ {height:1.5em;
+ width:7em;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/011.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/011.xhtml
new file mode 100644
index 000000000..1ea8cd592
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/011.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the textarea. Selected text should be moved to the textarea once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/012.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/012.xhtml
new file mode 100644
index 000000000..8013e28c3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/012.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from search input to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the textarea. Selected text should be moved to the textarea once you drop it there.</p>
+<p><input type="search" value="Selection"/></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/013.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/013.xhtml
new file mode 100644
index 000000000..0f1defc89
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/013.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from tel input to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the textarea. Selected text should be moved to the textarea once you drop it there.</p>
+<p><input type="tel" value="123456789"/></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/014.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/014.xhtml
new file mode 100644
index 000000000..6ed64a608
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/014.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from url input to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected url to the textarea. Selected text should be moved to the textarea once you drop it there.</p>
+<p><input type="url" value="http://opera.com"/></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/015.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/015.xhtml
new file mode 100644
index 000000000..ecd3f8870
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/015.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from email input to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected email to the textarea. Selected text should be moved to the textarea once you drop it there.</p>
+<p><input type="email" value="mail@example.org"/></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/016.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/016.xhtml
new file mode 100644
index 000000000..64784d71f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/016.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from number input to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><input type="number" value="123456789"/></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/017.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/017.xhtml
new file mode 100644
index 000000000..b8b64d1c5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/017.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from short text input to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected date to the textarea. Selected text should be moved to the textarea once you drop it there.</p>
+<p><input size="5" value="Drag me"/></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/018.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/018.xhtml
new file mode 100644
index 000000000..338bdd73a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/018.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from password input to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>You should not be able to drag and drop selection from password field to the textarea.</p>
+<p><input type="password" value="FAIL"/></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/019.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/019.xhtml
new file mode 100644
index 000000000..d8f7d304d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/019.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from readonly input to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the textarea. Selected text should be moved to the textarea once you drop it there.</p>
+<p><input readonly="readonly" value="Drag me"/></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/020.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/020.xhtml
new file mode 100644
index 000000000..f6b860140
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/020.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop between textareas</title>
+<style type="text/css">
+p:last-child > textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+p:first-child + p > textarea
+ {height:1.5em;
+ width:7em;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the textarea. Selected text should be moved to the textarea once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/021.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/021.xhtml
new file mode 100644
index 000000000..4526c1aaa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/021.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Selected text should be moved to the blue box once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/022.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/022.xhtml
new file mode 100644
index 000000000..e69d2419a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/022.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from search input to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Selected text should be moved to the blue box once you drop it there.</p>
+<p><input type="search" value="Selection"/></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/023.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/023.xhtml
new file mode 100644
index 000000000..0d1183d8c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/023.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from tel input to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the blue box. Selected text should be moved to the blue box once you drop it there.</p>
+<p><input type="tel" value="123456789"/></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/024.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/024.xhtml
new file mode 100644
index 000000000..dc275e366
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/024.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from url input to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected url to the blue box. Selected text should be moved to the blue box once you drop it there.</p>
+<p><input type="url" value="http://example.org"/></p>
+<div contenteditable="true"/>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/025.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/025.xhtml
new file mode 100644
index 000000000..25f123b14
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/025.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from email input to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected email to the blue box. Selected text should be moved to the blue box once you drop it there.</p>
+<p><input type="email" value="mail@example.org"/></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/026.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/026.xhtml
new file mode 100644
index 000000000..a4ee2a18f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/026.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from number input to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input type="number" value="123456789"/></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/027.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/027.xhtml
new file mode 100644
index 000000000..593f62dc0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/027.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from short input to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected date to the blue box. Selected text should be moved to the blue box once you drop it there.</p>
+<p><input size="5" value="Drag me"/></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/028.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/028.xhtml
new file mode 100644
index 000000000..6444e3c92
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/028.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from password input to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>You should not be able to drag and drop selection from password field to the blue box.</p>
+<p><input type="password" value="FAIL"/></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/029.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/029.xhtml
new file mode 100644
index 000000000..3ffecf0ec
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/029.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from readonly input to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Selected text should be moved to the blue box once you drop it there.</p>
+<p><input readonly="readonly" value="Drag me"/></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/030.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/030.xhtml
new file mode 100644
index 000000000..25536ec27
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/030.xhtml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+textarea
+ {height:1.5em;
+ width:7em;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the blue box. Selected text should be moved to the blue box once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/031.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/031.xhtml
new file mode 100644
index 000000000..ecdd466f7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/031.xhtml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging two lines of text selection from textarea to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+textarea
+ {width:300px;
+ height:100px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(25,56)">
+<p>
+<textarea>
+Here is textarea
+with selection that
+spans two lines.
+Drag selected text to the blue box.
+Selected text should be moved to the blue box once you drop it there.
+</textarea>
+</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/032.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/032.xhtml
new file mode 100644
index 000000000..59070062e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/032.xhtml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging multiline text selection from textarea to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+textarea
+ {width:300px;
+ height:100px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(24,58)">
+<p>
+<textarea>
+Here is textarea with selection
+that spans
+three lines. Drag selected text to the blue box.
+Copy of selection should end up in the blue box once you drop it there.
+</textarea>
+</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/033.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/033.xhtml
new file mode 100644
index 000000000..edd532776
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/033.xhtml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging two lines of text selection between textareas</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(25,56)">
+<p>
+<textarea>
+Here is textarea
+with selection that
+spans two lines.
+Drag selected text to the textarea below.
+Selected text should be moved to second textarea once you drop it there.
+</textarea>
+</p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/034.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/034.xhtml
new file mode 100644
index 000000000..4643156fe
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/034.xhtml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging multiline text selection between textareas</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(24,58)">
+<p>
+<textarea>
+Here is textarea with selection
+that spans
+three lines. Drag selected text to the textarea below.
+Selected text should be moved to second textarea once you drop it there.
+</textarea>
+</p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/035.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/035.xhtml
new file mode 100644
index 000000000..1bc133431
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/035.xhtml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging two lines of text selection from textarea to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+textarea
+ {width:300px;
+ height:100px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(25,56)">
+<p>
+<textarea>
+Here is textarea
+with selection that
+spans two lines.
+Drag selected text to the blue box.
+Selected text should be moved to the blue box once you drop it there.
+</textarea>
+</p>
+<div contenteditable="true"/>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/036.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/036.xhtml
new file mode 100644
index 000000000..e81971984
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/036.xhtml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging multiline text selection from textarea to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+textarea
+ {width:300px;
+ height:100px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(24,58)">
+<p>
+<textarea>
+Here is textarea with selection
+that spans
+three lines. Drag selected text to the blue box.
+Selected text should be moved to the blue box once you drop it there.
+</textarea>
+</p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/037.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/037.xhtml
new file mode 100644
index 000000000..fc06f3a06
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/037.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame selection drag and drop from text input to block element</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="helper-drag-me-input.xhtml"/>
+<frame src="helper-drop-here-blue-box.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/038.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/038.xhtml
new file mode 100644
index 000000000..5843f5830
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/038.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame selection drag and drop from textarea input to block element</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="helper-drag-me-textarea-to-other-blue-box.xhtml"/>
+<frame src="helper-drop-here-blue-box.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/039.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/039.xhtml
new file mode 100644
index 000000000..f5f823b95
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/039.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame selection drag and drop from text input to textarea</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="helper-drag-me-input-to-other-textarea.xhtml"/>
+<frame src="helper-drop-here-textarea.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/040.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/040.xhtml
new file mode 100644
index 000000000..91605aff7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/040.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame selection drag and drop between textareas</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="helper-drag-me-textarea-to-other-textarea.xhtml"/>
+<frame src="helper-drop-here-textarea.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/041.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/041.xhtml
new file mode 100644
index 000000000..73a883472
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/041.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame selection drag and drop from text input to contenteditable element</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="helper-drag-me-input.xhtml"/>
+<frame src="helper-drop-here-blue-box-contenteditable.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/042.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/042.xhtml
new file mode 100644
index 000000000..686accb24
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/042.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame selection drag and drop from textarea to contenteditable element</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="helper-drag-me-textarea-to-other-blue-box.xhtml"/>
+<frame src="helper-drop-here-blue-box-contenteditable.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/043.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/043.xhtml
new file mode 100644
index 000000000..bc296d5bc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/043.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame selection drag and drop between text inputs</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="helper-drag-me-input-to-other-input.xhtml"/>
+<frame src="helper-drop-here-input.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/044.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/044.xhtml
new file mode 100644
index 000000000..0dd958edc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/044.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross frame selection drag and drop from textarea to text input</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="helper-drag-me-textarea-to-other-input.xhtml"/>
+<frame src="helper-drop-here-input.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/045.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/045.xhtml
new file mode 100644
index 000000000..1b44ad3e3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/045.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input to iframe</title>
+<style type="text/css">
+iframe
+ {width:350px;
+ height:150px;
+ border-style:none;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<p><iframe src="helper-drop-here-blue-box.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/046.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/046.xhtml
new file mode 100644
index 000000000..b5a8f9510
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/046.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea to iframe</title>
+<style type="text/css">
+iframe
+ {width:350px;
+ height:150px;
+ border-style:none;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+<p><iframe src="helper-drop-here-blue-box.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/047.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/047.xhtml
new file mode 100644
index 000000000..61d4afca4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/047.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input to textarea in iframe</title>
+<style type="text/css">
+iframe
+ {width:500px;
+ height:400px;
+ border-style:none;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<p><iframe src="helper-drop-here-textarea.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/048.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/048.xhtml
new file mode 100644
index 000000000..73483036c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/048.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea to another textarea in iframe</title>
+<style type="text/css">
+iframe
+ {width:500px;
+ height:400px;
+ border-style:none;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+<p><iframe src="helper-drop-here-textarea.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/049.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/049.xhtml
new file mode 100644
index 000000000..5bed43563
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/049.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input to contenteditable element in iframe</title>
+<style type="text/css">
+iframe
+ {width:350px;
+ height:150px;
+ border-style:none;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<p><iframe src="helper-drop-here-blue-box-contenteditable.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/050.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/050.xhtml
new file mode 100644
index 000000000..7a1545ec5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/050.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea to contenteditable element in iframe</title>
+<style type="text/css">
+iframe
+ {width:350px;
+ height:150px;
+ border-style:none;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+<p><iframe src="helper-drop-here-blue-box-contenteditable.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/051.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/051.xhtml
new file mode 100644
index 000000000..41a94dd8c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/051.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input in iframe to block element</title>
+<style type="text/css">
+iframe
+ {width:500px;
+ height:200px;
+ border-style:none;}
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-input.xhtml">XHTML document</iframe></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/052.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/052.xhtml
new file mode 100644
index 000000000..32d713ff5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/052.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea in iframe to block element</title>
+<style type="text/css">
+iframe
+ {width:500px;
+ height:200px;
+ border-style:none;}
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-textarea-to-other-blue-box.xhtml">XHTML document</iframe></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/053.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/053.xhtml
new file mode 100644
index 000000000..52a3c148b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/053.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input in iframe to textarea</title>
+<style type="text/css">
+iframe
+ {width:500px;
+ height:200px;
+ border-style:none;}
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-input-to-other-textarea.xhtml">XHTML document</iframe></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/054.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/054.xhtml
new file mode 100644
index 000000000..22be41071
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/054.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea in iframe to another textarea</title>
+<style type="text/css">
+iframe
+ {width:500px;
+ height:200px;
+ border-style:none;}
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-textarea-to-other-textarea.xhtml">XHTML document</iframe></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/055.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/055.xhtml
new file mode 100644
index 000000000..9465b1beb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/055.xhtml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input in iframe to contenteditable element</title>
+<style type="text/css">
+iframe
+ {width:500px;
+ height:200px;
+ border-style:none;}
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-input.xhtml">XHTML document</iframe></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/056.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/056.xhtml
new file mode 100644
index 000000000..94a99a791
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/056.xhtml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea in iframe to contenteditable element</title>
+<style type="text/css">
+iframe
+ {width:500px;
+ height:200px;
+ border-style:none;}
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-textarea-to-other-blue-box.xhtml">XHTML document</iframe></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/057.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/057.xhtml
new file mode 100644
index 000000000..4fca493a7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/057.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input in iframe to another input element</title>
+<style type="text/css">
+iframe
+ {width:500px;
+ height:200px;
+ border-style:none;}
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-input-to-other-input.xhtml">XHTML document</iframe></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/058.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/058.xhtml
new file mode 100644
index 000000000..7f3c51a97
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/058.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea in iframe to input element</title>
+<style type="text/css">
+iframe
+ {width:500px;
+ height:200px;
+ border-style:none;}
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-textarea-to-other-input.xhtml">XHTML document</iframe></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/059.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/059.xhtml
new file mode 100644
index 000000000..89a778b3e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/059.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross iframe selection drag and drop from text input to block element</title>
+<style type="text/css">
+iframe
+ {width:100%;
+ height:200px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-input.xhtml">XHTML document</iframe></p>
+<p><iframe src="helper-drop-here-blue-box.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/060.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/060.xhtml
new file mode 100644
index 000000000..73d49810a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/060.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross iframe selection drag and drop from textarea to block element</title>
+<style type="text/css">
+iframe
+ {width:100%;
+ height:200px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-textarea-to-other-blue-box.xhtml">XHTML document</iframe></p>
+<p><iframe src="helper-drop-here-blue-box.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/061.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/061.xhtml
new file mode 100644
index 000000000..c30c031e2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/061.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross iframe selection drag and drop from text input to textarea</title>
+<style type="text/css">
+iframe
+ {width:100%;
+ height:200px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-input-to-other-textarea.xhtml">XHTML document</iframe></p>
+<p><iframe src="helper-drop-here-textarea.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/062.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/062.xhtml
new file mode 100644
index 000000000..df64cfd8e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/062.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross iframe selection drag and drop between textareas</title>
+<style type="text/css">
+iframe
+ {width:100%;
+ height:200px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-textarea-to-other-textarea.xhtml">XHTML document</iframe></p>
+<p><iframe src="helper-drop-here-textarea.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/063.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/063.xhtml
new file mode 100644
index 000000000..c07ab932a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/063.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross iframe selection drag and drop from text input to contenteditable element</title>
+<style type="text/css">
+iframe
+ {width:100%;
+ height:200px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-input.xhtml">XHTML document</iframe></p>
+<p><iframe src="helper-drop-here-blue-box-contenteditable.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/064-1.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/064-1.xhtml
new file mode 100644
index 000000000..8f164a601
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/064-1.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+<style type="text/css">
+textarea
+ {height:1.5em;
+ width:7em;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the blue box. Selection should be moved to the blue box once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/064.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/064.xhtml
new file mode 100644
index 000000000..cf585c6d5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/064.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross iframe selection drag and drop from textarea to contenteditable element</title>
+<style type="text/css">
+iframe
+ {width:100%;
+ height:200px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="064-1.xhtml">XHTML document</iframe></p>
+<p><iframe src="helper-drop-here-blue-box-contenteditable.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/065.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/065.xhtml
new file mode 100644
index 000000000..d4bd8f325
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/065.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross iframe selection drag and drop between text inputs</title>
+<style type="text/css">
+iframe
+ {width:100%;
+ height:200px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-input-to-other-input.xhtml">XHTML document</iframe></p>
+<p><iframe src="helper-drop-here-input.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/066.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/066.xhtml
new file mode 100644
index 000000000..8f65061a1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/066.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross iframe selection drag and drop from textarea to text input</title>
+<style type="text/css">
+iframe
+ {width:100%;
+ height:200px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-textarea-to-other-input.xhtml">XHTML document</iframe></p>
+<p><iframe src="helper-drop-here-input.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/067-1.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/067-1.xhtml
new file mode 100644
index 000000000..206c59675
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/067-1.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+<style type="text/css">
+iframe
+ {width:100%;
+ height:200px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drag-me-input.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/067-2.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/067-2.xhtml
new file mode 100644
index 000000000..3362fba6c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/067-2.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+<style type="text/css">
+iframe
+ {width:100%;
+ height:200px;
+ border-style:none;}
+</style>
+</head>
+<body>
+<p><iframe src="helper-drop-here-blue-box.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/067.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/067.xhtml
new file mode 100644
index 000000000..2d33465fd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/067.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Nested cross frame selection drag and drop from text input to block element</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="067-1.xhtml"/>
+<frame src="067-2.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/068-1.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/068-1.xhtml
new file mode 100644
index 000000000..c9fc41b47
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/068-1.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+</head>
+<frameset rows="100%, 0%">
+<frame src="helper-drag-me-textarea-to-other-textarea.xhtml"/>
+<frame src="data:text/plain,1"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/068-2.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/068-2.xhtml
new file mode 100644
index 000000000..b639b16fc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/068-2.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+</head>
+<frameset rows="100%, 0%">
+<frame src="helper-drop-here-textarea.xhtml"/>
+<frame src="data:text/plain,2"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/068.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/068.xhtml
new file mode 100644
index 000000000..5f051697c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/068.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Nested cross frame selection drag and drop between textareas</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="068-1.xhtml"/>
+<frame src="068-2.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/069.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/069.xhtml
new file mode 100644
index 000000000..02c12bd72
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/069.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop to textarea in iframe</title>
+<style type="text/css">
+iframe
+ {width:500px;
+ height:400px;
+ border-style:none;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<p>Drag selected text to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><iframe src="helper-drop-here-textarea.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/070.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/070.xhtml
new file mode 100644
index 000000000..73511debd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/070.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop to contenteditable element in iframe</title>
+<style type="text/css">
+iframe
+ {width:500px;
+ height:400px;
+ border-style:none;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><iframe src="helper-drop-here-blue-box-contenteditable.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/071.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/071.xhtml
new file mode 100644
index 000000000..e3dcd57de
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/071.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop between text inputs of different size</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the input below. Selected text should be moved to the input once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/072.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/072.xhtml
new file mode 100644
index 000000000..c44e2bd8d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/072.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from search to text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the input below. Selected text should be moved to the input once you drop it there.</p>
+<p><input type="search" value="Selection"/></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/073.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/073.xhtml
new file mode 100644
index 000000000..ade164797
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/073.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from tel to text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the input below. Selected text should be moved to the input once you drop it there.</p>
+<p><input type="tel" value="123456789"/></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/074.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/074.xhtml
new file mode 100644
index 000000000..f441ad101
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/074.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from url to text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected url to the input below. Selected text should be moved to the input once you drop it there.</p>
+<p><input type="url" value="http://example.org"/></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/075.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/075.xhtml
new file mode 100644
index 000000000..8b5304f0e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/075.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from email to text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected email to the input below. Selected text should be moved to the input once you drop it there.</p>
+<p><input type="email" value="mail@example.org"/></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/076.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/076.xhtml
new file mode 100644
index 000000000..bb5db839a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/076.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from number to text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the input below. Copy of selection should end up in the input once you drop it there.</p>
+<p><input type="number" value="123456789"/></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/077.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/077.xhtml
new file mode 100644
index 000000000..42cee3e22
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/077.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from short text input to another text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected date to the input below. Selected text should be moved to the input once you drop it there.</p>
+<p><input size="5" value="Drag me"/></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/078.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/078.xhtml
new file mode 100644
index 000000000..1261a6a13
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/078.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from password to text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>You should not be able to drag and drop selection from password field to the input below.</p>
+<p><input type="password" value="FAIL"/></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/079.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/079.xhtml
new file mode 100644
index 000000000..d114cc68d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/079.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from readonly text input to another text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the input below. Selected text should be moved to the input once you drop it there.</p>
+<p><input readonly="readonly" value="Drag me"/></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/080.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/080.xhtml
new file mode 100644
index 000000000..35fac3928
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/080.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea to text input</title>
+<style type="text/css">
+input
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+textarea
+ {height:1.5em;
+ width:7em;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the input below. Selected text should be moved to the input once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/081.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/081.xhtml
new file mode 100644
index 000000000..eb8c4124f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/081.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Events during selection drag and drop to text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:50px;
+ margin-top:20px;}
+.hidden
+ {visibility:hidden;}
+</style>
+<script type="application/ecmascript">
+function evtChange()
+ {document.querySelectorAll('tt')[0].firstChild.nodeValue = 'PASS'}
+function evtInput()
+ {document.querySelectorAll('tt')[1].firstChild.nodeValue = 'PASS'}
+function evtDrop()
+ {document.querySelectorAll('tt')[2].firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL (selection is not properly added to data store)'}
+function evtKeypress()
+ {document.querySelectorAll('tt')[3].firstChild.nodeValue = 'FAIL (even is not supposed to fire)'}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<p>Drag selected text to the input below. Follow check results link once you drop selection in the input.</p>
+<p><input placeholder="Drop selection here" onchange="evtChange()" oninput="evtInput()" onkeypress="evtKeypress()" ondrop="evtDrop()"/></p>
+<p><a href="javascript:document.querySelector('ul').removeAttribute('class')">Check results</a></p>
+<ul class="hidden">
+<li>Change event: <tt>FAIL (even did not fire)</tt></li>
+<li>Input event: <tt>FAIL (even did not fire)</tt></li>
+<li>Drop event: <tt>FAIL (even did not fire)</tt></li>
+<li>Keypress event: <tt>PASS</tt></li>
+</ul>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/082.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/082.xhtml
new file mode 100644
index 000000000..449ce932a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/082.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Events during selection drag and drop to search input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:50px;
+ margin-top:20px;}
+.hidden
+ {visibility:hidden;}
+</style>
+<script type="application/ecmascript">
+function evtChange()
+ {document.querySelectorAll('tt')[0].firstChild.nodeValue = 'PASS'}
+function evtInput()
+ {document.querySelectorAll('tt')[1].firstChild.nodeValue = 'PASS'}
+function evtDrop()
+ {document.querySelectorAll('tt')[2].firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL (selection is not properly added to data store)'}
+function evtKeypress()
+ {document.querySelectorAll('tt')[3].firstChild.nodeValue = 'FAIL (even is not supposed to fire)'}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<p>Drag selected text to the input below. Follow check results link once you drop selection in the input.</p>
+<p><input type="search" placeholder="Drop selection here" onchange="evtChange()" oninput="evtInput()" onkeypress="evtKeypress()" ondrop="evtDrop()"/></p>
+<p><a href="javascript:document.querySelector('ul').removeAttribute('class')">Check results</a></p>
+<ul class="hidden">
+<li>Change event: <tt>FAIL (even did not fire)</tt></li>
+<li>Input event: <tt>FAIL (even did not fire)</tt></li>
+<li>Drop event: <tt>FAIL (even did not fire)</tt></li>
+<li>Keypress event: <tt>PASS</tt></li>
+</ul>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/083.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/083.xhtml
new file mode 100644
index 000000000..9ca21e9e3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/083.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Events during selection drag and drop to tel input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:50px;
+ margin-top:20px;}
+.hidden
+ {visibility:hidden;}
+</style>
+<script type="application/ecmascript">
+function evtChange()
+ {document.querySelectorAll('tt')[0].firstChild.nodeValue = 'PASS'}
+function evtInput()
+ {document.querySelectorAll('tt')[1].firstChild.nodeValue = 'PASS'}
+function evtDrop()
+ {document.querySelectorAll('tt')[2].firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == '123456789')?'PASS':'FAIL (selection is not properly added to data store)'}
+function evtKeypress()
+ {document.querySelectorAll('tt')[3].firstChild.nodeValue = 'FAIL (even is not supposed to fire)'}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>123456789</p>
+<p>Drag selected number to the input below. Follow check results link once you drop selection in the input.</p>
+<p><input type="tel" placeholder="Drop selection here" onchange="evtChange()" oninput="evtInput()" onkeypress="evtKeypress()" ondrop="evtDrop()"/></p>
+<p><a href="javascript:document.querySelector('ul').removeAttribute('class')">Check results</a></p>
+<ul class="hidden">
+<li>Change event: <tt>FAIL (even did not fire)</tt></li>
+<li>Input event: <tt>FAIL (even did not fire)</tt></li>
+<li>Drop event: <tt>FAIL (even did not fire)</tt></li>
+<li>Keypress event: <tt>PASS</tt></li>
+</ul>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/084.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/084.xhtml
new file mode 100644
index 000000000..baaae70d2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/084.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Events during selection drag and drop to url input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:50px;
+ margin-top:20px;}
+.hidden
+ {visibility:hidden;}
+</style>
+<script type="application/ecmascript">
+function evtChange()
+ {document.querySelectorAll('tt')[0].firstChild.nodeValue = 'PASS'}
+function evtInput()
+ {document.querySelectorAll('tt')[1].firstChild.nodeValue = 'PASS'}
+function evtDrop()
+ {document.querySelectorAll('tt')[2].firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'http://example.org')?'PASS':'FAIL (selection is not properly added to data store)'}
+function evtKeypress()
+ {document.querySelectorAll('tt')[3].firstChild.nodeValue = 'FAIL (even is not supposed to fire)'}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>http://example.org</p>
+<p>Drag selected url to the input below. Follow check results link once you drop selection in the input.</p>
+<p><input type="url" placeholder="Drop selection here" onchange="evtChange()" oninput="evtInput()" onkeypress="evtKeypress()" ondrop="evtDrop()"/></p>
+<p><a href="javascript:document.querySelector('ul').removeAttribute('class')">Check results</a></p>
+<ul class="hidden">
+<li>Change event: <tt>FAIL (even did not fire)</tt></li>
+<li>Input event: <tt>FAIL (even did not fire)</tt></li>
+<li>Drop event: <tt>FAIL (even did not fire)</tt></li>
+<li>Keypress event: <tt>PASS</tt></li>
+</ul>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/085.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/085.xhtml
new file mode 100644
index 000000000..23f49f720
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/085.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Events during selection drag and drop to email input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:50px;
+ margin-top:20px;}
+.hidden
+ {visibility:hidden;}
+</style>
+<script type="application/ecmascript">
+function evtChange()
+ {document.querySelectorAll('tt')[0].firstChild.nodeValue = 'PASS'}
+function evtInput()
+ {document.querySelectorAll('tt')[1].firstChild.nodeValue = 'PASS'}
+function evtDrop()
+ {document.querySelectorAll('tt')[2].firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'mail@example.org')?'PASS':'FAIL (selection is not properly added to data store)'}
+function evtKeypress()
+ {document.querySelectorAll('tt')[3].firstChild.nodeValue = 'FAIL (even is not supposed to fire)'}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>mail@example.org</p>
+<p>Drag selected address to the input below. Follow check results link once you drop selection in the input.</p>
+<p><input type="email" placeholder="Drop selection here" onchange="evtChange()" oninput="evtInput()" onkeypress="evtKeypress()" ondrop="evtDrop()"/></p>
+<p><a href="javascript:document.querySelector('ul').removeAttribute('class')">Check results</a></p>
+<ul class="hidden">
+<li>Change event: <tt>FAIL (even did not fire)</tt></li>
+<li>Input event: <tt>FAIL (even did not fire)</tt></li>
+<li>Drop event: <tt>FAIL (even did not fire)</tt></li>
+<li>Keypress event: <tt>PASS</tt></li>
+</ul>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/086.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/086.xhtml
new file mode 100644
index 000000000..adb2fc768
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/086.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Events during selection drag and drop to number input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:50px;
+ margin-top:20px;}
+.hidden
+ {visibility:hidden;}
+</style>
+<script type="application/ecmascript">
+function evtChange()
+ {document.querySelectorAll('tt')[0].firstChild.nodeValue = 'PASS'}
+function evtInput()
+ {document.querySelectorAll('tt')[1].firstChild.nodeValue = 'PASS'}
+function evtDrop()
+ {document.querySelectorAll('tt')[2].firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == '123456789')?'PASS':'FAIL (selection is not properly added to data store)'}
+function evtKeypress()
+ {document.querySelectorAll('tt')[3].firstChild.nodeValue = 'FAIL (even is not supposed to fire)'}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>123456789</p>
+<p>Drag selected address to the input below. Follow check results link once you drop selection in the input.</p>
+<p><input type="number" placeholder="Drop selection here" onchange="evtChange()" oninput="evtInput()" onkeypress="evtKeypress()" ondrop="evtDrop()"/></p>
+<p><a href="javascript:document.querySelector('ul').removeAttribute('class')">Check results</a></p>
+<ul class="hidden">
+<li>Change event: <tt>FAIL (even did not fire)</tt></li>
+<li>Input event: <tt>FAIL (even did not fire)</tt></li>
+<li>Drop event: <tt>FAIL (even did not fire)</tt></li>
+<li>Keypress event: <tt>PASS</tt></li>
+</ul>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/087.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/087.xhtml
new file mode 100644
index 000000000..6cb5b0f10
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/087.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Scrolling during selection drag and drop to text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:50px;
+ margin-top:200px;}
+div
+ {height:150px;
+ width:500px;
+ overflow-y:scroll;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<div>
+<p>You should be able to drag selected text to the input at the bottom of scrollable container (dragging towards the bottom edge triggers scrolling).</p>
+<input placeholder="Drop selection here"/>
+<p>Copy of selection should end up in the input once you drop it there.</p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/088.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/088.xhtml
new file mode 100644
index 000000000..54d0ca088
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/088.xhtml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Vertical scrolling during selection drag and drop to text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:50px;}
+div > p:first-child
+ {margin-bottom:200px;}
+body > div
+ {height:150px;
+ width:500px;
+ overflow-y:scroll;}
+div > div
+ {height:400px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<div>
+ <div>
+ <p>You should be able to drag selected text to the input at the bottom of scrollable container (dragging towards the bottom edge triggers scrolling).</p>
+ <input placeholder="Drop selection here"/>
+ <p>Copy of selection should end up in the input once you drop it there.</p>
+ </div>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/089.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/089.xhtml
new file mode 100644
index 000000000..da0f5e2f1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/089.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Scrolling during selection drag and drop to iframe</title>
+<style type="text/css">
+iframe
+ {width:350px;
+ height:150px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<p><iframe src="helper-scroll-then-drop-input.xhtml">XHTML document</iframe></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/090.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/090.xhtml
new file mode 100644
index 000000000..5759be186
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/090.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Scrolling during selection drag and drop to object</title>
+<style type="text/css">
+object
+ {width:350px;
+ height:150px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<p><object type="application/xhtml+xml" data="helper-scroll-then-drop-input.xhtml">XHTML document</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/091-1.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/091-1.xhtml
new file mode 100644
index 000000000..5e11544c4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/091-1.xhtml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/091-2.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/091-2.xhtml
new file mode 100644
index 000000000..205eff771
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/091-2.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:50px;}
+p:first-child
+ {margin-bottom:1000px;}
+</style>
+</head>
+<body>
+<p>You should be able to drag selected text to the input at the bottom of scrollable container (dragging towards the bottom edge triggers scrolling).</p>
+<input placeholder="Drop selection here"/>
+<p>Copy of selection should end up in the input once you drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/091.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/091.xhtml
new file mode 100644
index 000000000..bc85f2231
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/091.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Scrolling during selection drag and drop to frame</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="091-1.xhtml"/>
+<frame src="091-2.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/092.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/092.xhtml
new file mode 100644
index 000000000..dfd454a10
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/092.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input to element in object</title>
+<style type="text/css">
+object
+ {width:350px;
+ height:150px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<p><object type="application/xhtml+xml" data="helper-drop-here-blue-box.xhtml">XHTML document</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/093.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/093.xhtml
new file mode 100644
index 000000000..88e8ecd81
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/093.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea to element in object</title>
+<style type="text/css">
+object
+ {width:350px;
+ height:150px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+<p><object type="application/xhtml+xml" data="helper-drop-here-blue-box.xhtml">XHTML document</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/094.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/094.xhtml
new file mode 100644
index 000000000..114fa0fee
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/094.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input to textarea in object</title>
+<style type="text/css">
+object
+ {width:500px;
+ height:400px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<p><object type="application/xhtml+xml" data="helper-drop-here-textarea.xhtml">XHTML document</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/095.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/095.xhtml
new file mode 100644
index 000000000..9f2c761d6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/095.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea to another textarea in object</title>
+<style type="text/css">
+object
+ {width:500px;
+ height:400px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+<p><object type="application/xhtml+xml" data="helper-drop-here-textarea.xhtml">XHTML document</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/096.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/096.xhtml
new file mode 100644
index 000000000..0589ede6c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/096.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input to contenteditable element in object</title>
+<style type="text/css">
+object
+ {width:350px;
+ height:150px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<p><object type="application/xhtml+xml" data="helper-drop-here-blue-box-contenteditable.xhtml">XHTML document</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/097.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/097.xhtml
new file mode 100644
index 000000000..7ee94f86a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/097.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea to contenteditable element in object</title>
+<style type="text/css">
+object
+ {width:350px;
+ height:150px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+<p><object type="application/xhtml+xml" data="helper-drop-here-blue-box-contenteditable.xhtml">XHTML document</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/098.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/098.xhtml
new file mode 100644
index 000000000..c1595d9bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/098.xhtml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input in object to block element</title>
+<style type="text/css">
+object
+ {width:500px;
+ height:200px;}
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<p><object type="application/xhtml+xml" data="helper-drag-me-input.xhtml">XHTML document</object></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/099.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/099.xhtml
new file mode 100644
index 000000000..8eaa0562a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/099.xhtml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea in object to block element</title>
+<style type="text/css">
+object
+ {width:500px;
+ height:200px;}
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<p><object type="application/xhtml+xml" data="helper-drag-me-textarea-to-other-blue-box.xhtml">XHTML document</object></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/100.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/100.xhtml
new file mode 100644
index 000000000..c6d5b52c7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/100.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input in object to textarea</title>
+<style type="text/css">
+object
+ {width:500px;
+ height:200px;}
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body>
+<p><object type="application/xhtml+xml" data="helper-drag-me-input-to-other-textarea.xhtml">XHTML document</object></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/101.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/101.xhtml
new file mode 100644
index 000000000..d1316c1af
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/101.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea in object to another textarea</title>
+<style type="text/css">
+object
+ {width:500px;
+ height:200px;}
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body>
+<p><object type="application/xhtml+xml" data="helper-drag-me-textarea-to-other-textarea.xhtml">XHTML document</object></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/102.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/102.xhtml
new file mode 100644
index 000000000..ca9244830
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/102.xhtml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input in object to contenteditable element</title>
+<style type="text/css">
+object
+ {width:500px;
+ height:200px;}
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<p><object type="application/xhtml+xml" data="helper-drag-me-input.xhtml">XHTML document</object></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/103.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/103.xhtml
new file mode 100644
index 000000000..4f91db699
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/103.xhtml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea in object to contenteditable element</title>
+<style type="text/css">
+object
+ {width:500px;
+ height:200px;}
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<p><object type="application/xhtml+xml" data="helper-drag-me-textarea-to-other-blue-box.xhtml">XHTML document</object></p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/104.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/104.xhtml
new file mode 100644
index 000000000..9b23cc9ef
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/104.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input in object to another text input</title>
+<style type="text/css">
+object
+ {width:500px;
+ height:200px;}
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body>
+<p><object type="application/xhtml+xml" data="helper-drag-me-input-to-other-input.xhtml">XHTML document</object></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/105.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/105.xhtml
new file mode 100644
index 000000000..432664793
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/105.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea in object to text input</title>
+<style type="text/css">
+object
+ {width:500px;
+ height:200px;}
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body>
+<p><object type="application/xhtml+xml" data="helper-drag-me-textarea-to-other-input.xhtml">XHTML document</object></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/106.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/106.xhtml
new file mode 100644
index 000000000..9accdc075
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/106.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from textarea input in dataURL frame to block element</title>
+</head>
+<frameset rows="50%, 50%">
+<frame src="data:application/xhtml+xml,%3Chtml%20xmlns%3D%22http%3A//www.w3.org/1999/xhtml%22%3E%3Chead%3E%3Ctitle%3EDragging%20selection%3C/title%3E%3C/head%3E%3Cbody%20onload%3D%22document.querySelector%28%27input%27%29.select%28%29%22%3E%3Cp%3EDrag%20selected%20text%20to%20the%20blue%20box.%20Copy%20of%20selection%20should%20end%20up%20in%20the%20blue%20box%20once%20you%20drop%20it%20there.%3C/p%3E%3Cp%3E%3Cinput%20value%3D%22Drag%20me%22/%3E%3C/p%3E%3C/body%3E%3C/html%3E"/>
+<frame src="helper-drop-here-blue-box.xhtml"/>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/107-1.html b/testing/web-platform/tests/html/editing/dnd/selection/107-1.html
new file mode 100644
index 000000000..5dc99143f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/107-1.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<title>Dragging selection breaks layout</title>
+<p>Select all text in the input below, drag it downwards a little, and release it. Pass if you can still edit the contents of the input.</p>
+<p><input value="SelectAndDrag"/></p>
+<script type="text/javascript">
+document.getElementsByTagName('input')[0].select();
+</script>
+<noscript><p>Enable JavaScript and reload</p></noscript> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/107.html b/testing/web-platform/tests/html/editing/dnd/selection/107.html
new file mode 100644
index 000000000..0d7f75f32
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/107.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<title>Dragging selection breaks layout</title>
+<frameset rows="100%">
+ <frame src="107-1.html">
+</frameset> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/108-1.html b/testing/web-platform/tests/html/editing/dnd/selection/108-1.html
new file mode 100644
index 000000000..9359fed43
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/108-1.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<title>Dragging custom selection breaks layout</title>
+<p>Select this sentence, drag it downwards a little, and release it. Pass if you can now select this sentence instead.</p> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/108.html b/testing/web-platform/tests/html/editing/dnd/selection/108.html
new file mode 100644
index 000000000..967e99e0f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/108.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<title>Dragging custom selection breaks layout</title>
+<frameset rows="100%">
+ <frame src="108-1.html">
+</frameset> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/109.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/109.xhtml
new file mode 100644
index 000000000..7e4dc25c6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/109.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from text input to RTL textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the textarea. Selected text should be moved to the textarea once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p><input dir="rtl" value="&#x202E;FAIL|SSAP&#x202C;"/></p>
+<p><textarea dir="rtl" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/110.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/110.xhtml
new file mode 100644
index 000000000..fce336fb7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/110.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from text input to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the textarea. Selected text should be moved to the textarea once you drop it there. Text direction should be preserved during drag and drop.</p>
+<div dir="rtl">
+<p><input value="&#x202E;FAIL|SSAP&#x202C;"/></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/111.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/111.xhtml
new file mode 100644
index 000000000..4c3aa4094
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/111.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from RTL element to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p dir="rtl">&#x202E;FAIL|SSAP&#x202C;</p>
+<p>Drag selected text to the textarea. Copy of selection should end up in the textarea once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p dir="rtl"><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/112.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/112.xhtml
new file mode 100644
index 000000000..693d0301d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/112.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>&#x202E;FAIL|SSAP&#x202C;</p>
+<p>Drag selected text to the textarea. Copy of selection should end up in the textarea once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p dir="rtl"><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/113.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/113.xhtml
new file mode 100644
index 000000000..d8c92cb70
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/113.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop between textareas</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,11)">
+<p>Drag selected text to the textarea. Selected text should be moved to the textarea once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p><textarea>&#x202E;FAIL|SSAP&#x202C;</textarea></p>
+<p><textarea dir="rtl" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/114.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/114.xhtml
new file mode 100644
index 000000000..4884ff2fe
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/114.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop between RTL textareas</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,11)">
+<p>Drag selected text to the textarea. Selected text should be moved to the textarea once you drop it there. Text direction should be preserved during drag and drop.</p>
+<div dir="rtl">
+<p><textarea>&#x202E;FAIL|SSAP&#x202C;</textarea></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/115.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/115.xhtml
new file mode 100644
index 000000000..a99d14f75
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/115.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop between RTL inputs</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the input below. Selected text should be moved to the input once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p><input dir="rtl" value="&#x202E;FAIL|SSAP&#x202C;"/></p>
+<p><input dir="rtl" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/116.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/116.xhtml
new file mode 100644
index 000000000..c4ea9930d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/116.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop between text inputs</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the input below. Selected text should be moved to the input once you drop it there. Text direction should be preserved during drag and drop.</p>
+<div dir="rtl">
+<p><input value="&#x202E;FAIL|SSAP&#x202C;"/></p>
+<p><input placeholder="Drop selection here"/></p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/117.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/117.xhtml
new file mode 100644
index 000000000..daa30ca42
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/117.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from RTL element to text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p dir="rtl">&#x202E;FAIL|SSAP&#x202C;</p>
+<p>Drag selected text to the input below. Copy of selection should end up in the input once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p dir="rtl"><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/118.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/118.xhtml
new file mode 100644
index 000000000..0ea40e299
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/118.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop to text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>&#x202E;FAIL|SSAP&#x202C;</p>
+<p>Drag selected text to the input below. Copy of selection should end up in the input once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p dir="rtl"><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/119.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/119.xhtml
new file mode 100644
index 000000000..344679fad
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/119.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from textarea to RTL text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,11)">
+<p>Drag selected text to the input below. Selected text should be moved to the input once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p><textarea>&#x202E;FAIL|SSAP&#x202C;</textarea></p>
+<p><input dir="rtl" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/120.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/120.xhtml
new file mode 100644
index 000000000..eb7b7472d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/120.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from textarea to text input</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,11)">
+<p>Drag selected text to the input below. Selected text should be moved to the input once you drop it there. Text direction should be preserved during drag and drop.</p>
+<div dir="rtl">
+<p><textarea>&#x202E;FAIL|SSAP&#x202C;</textarea></p>
+<p><input placeholder="Drop selection here"/></p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/121.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/121.xhtml
new file mode 100644
index 000000000..58de2b2d0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/121.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from RTL text input to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Selected text should be moved to the box once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p><input dir="rtl" value="&#x202E;FAIL|SSAP&#x202C;"/></p>
+<p><div dir="rtl" contenteditable="true"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/122.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/122.xhtml
new file mode 100644
index 000000000..cb2ade8a8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/122.xhtml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from text input to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Selected text should be moved to the box once you drop it there. Text direction should be preserved during drag and drop.</p>
+<div dir="rtl">
+<p><input value="&#x202E;FAIL|SSAP&#x202C;"/></p>
+<p><div contenteditable="true"/></p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/123.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/123.xhtml
new file mode 100644
index 000000000..597667a0e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/123.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from RTL element to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p dir="rtl">&#x202E;FAIL|SSAP&#x202C;</p>
+<p>Drag selected text to the blue box. Copy of selection should end up in the box once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p dir="rtl"><div contenteditable="true"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/124.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/124.xhtml
new file mode 100644
index 000000000..b60da71a6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/124.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>&#x202E;FAIL|SSAP&#x202C;</p>
+<p>Drag selected text to the blue box. Copy of selection should end up in the box once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p dir="rtl"><div contenteditable="true"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/125.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/125.xhtml
new file mode 100644
index 000000000..65c074ca1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/125.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from textarea to RTL contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,11)">
+<p>Drag selected text to the blue box. Selected text should be moved to the blue box once you drop it there.</p>
+<p><textarea>&#x202E;FAIL|SSAP&#x202C;</textarea></p>
+<p><div dir="rtl" contenteditable="true"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/126.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/126.xhtml
new file mode 100644
index 000000000..03d92ae7b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/126.xhtml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from textarea to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,11)">
+<p>Drag selected text to the blue box. Selected text should be moved to the blue box once you drop it there.</p>
+<div dir="rtl">
+<p><textarea>&#x202E;FAIL|SSAP&#x202C;</textarea></p>
+<p><div contenteditable="true"/></p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/127.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/127.xhtml
new file mode 100644
index 000000000..161ab64db
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/127.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from text input to RTL element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Copy of selection should end up in the box once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p><input dir="rtl" value="&#x202E;FAIL|SSAP&#x202C;"/></p>
+<div
+ dir="rtl"
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/128.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/128.xhtml
new file mode 100644
index 000000000..504250686
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/128.xhtml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from text input to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Copy of selection should end up in the box once you drop it there. Text direction should be preserved during drag and drop.</p>
+<div dir="rtl">
+<p><input value="&#x202E;FAIL|SSAP&#x202C;"/></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div > div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/129.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/129.xhtml
new file mode 100644
index 000000000..e9aea1866
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/129.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from RTL element to another RTL element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p dir="rtl">&#x202E;FAIL|SSAP&#x202C;</p>
+<p>Drag selected text to the blue box. Copy of selection should end up in the box once you drop it there. Text direction should be preserved during drag and drop.</p>
+<div
+ dir="rtl"
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/130.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/130.xhtml
new file mode 100644
index 000000000..073432526
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/130.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>&#x202E;FAIL|SSAP&#x202C;</p>
+<p>Drag selected text to the blue box. Copy of selection should end up in the box once you drop it there. Text direction should be preserved during drag and drop.</p>
+<div
+ dir="rtl"
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/131.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/131.xhtml
new file mode 100644
index 000000000..04e617731
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/131.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from textarea to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,11)">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><textarea>&#x202E;FAIL|SSAP&#x202C;</textarea></p>
+<div
+ dir="rtl"
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/132.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/132.xhtml
new file mode 100644
index 000000000..d662b206f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/132.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>RTL text selection drag and drop from RTL textarea to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,11)">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><textarea dir="rtl">&#x202E;FAIL|SSAP&#x202C;</textarea></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/133.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/133.xhtml
new file mode 100644
index 000000000..bf03eee91
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/133.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Multielement selection drag and drop</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('div'))">
+<div>
+ <p>Drag selected text to the textarea.</p>
+ <p>Copy of selection should end up in the textarea once you drop it there.</p>
+</div>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/134.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/134.xhtml
new file mode 100644
index 000000000..0b61026da
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/134.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop after selecting whole page content</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('body'))">
+<p>Drag selected text to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/135.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/135.xhtml
new file mode 100644
index 000000000..34d63e720
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/135.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop after manually selecting whole page content</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body>
+<p>Select whole page (Ctrl+A) and try to drag selection to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/136.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/136.xhtml
new file mode 100644
index 000000000..c4ffc7d00
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/136.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>BiDi text selection drag and drop to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>PASS|LIAF &#x202E;FAIL|SSAP&#x202C; PASS|LIAF</p>
+<p>Drag selected text to the textarea. Copy of selection should end up in the textarea once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/137.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/137.xhtml
new file mode 100644
index 000000000..a1841b367
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/137.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Multielement BiDi text selection drag and drop to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>PASS|LIAF <span dir="rtl">&#x202E;FAIL|SSAP&#x202C;</span> PASS|LIAF</p>
+<p>Drag selected text to the textarea. Copy of selection should end up in the textarea once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/138.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/138.xhtml
new file mode 100644
index 000000000..4a9080a82
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/138.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>BiDi text selection drag and drop from text input to textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the textarea. Selected text should be moved to the textarea once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p><input value="PASS|LIAF &#x202E;FAIL|SSAP&#x202C; PASS|LIAF"/></p>
+<p><textarea dir="rtl" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/139.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/139.xhtml
new file mode 100644
index 000000000..f9b1f61b6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/139.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>BiDi text selection drag and drop between textareas</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,32)">
+<p>Drag selected text to the textarea. Selected text should be moved to the textarea once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p><textarea>PASS|LIAF &#x202E;FAIL|SSAP&#x202C; PASS|LIAF</textarea></p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/140.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/140.xhtml
new file mode 100644
index 000000000..c97468bfe
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/140.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>BiDi text selection drag and drop between text inputs</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the input below. Selected text should be moved to the input once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p><input value="PASS|LIAF &#x202E;FAIL|SSAP&#x202C; PASS|LIAF"/></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/141.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/141.xhtml
new file mode 100644
index 000000000..820556cb9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/141.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>BiDi text selection drag and drop to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>PASS|LIAF &#x202E;FAIL|SSAP&#x202C; PASS|LIAF</p>
+<p>Drag selected text to the blue box. Copy of selection should end up in the box once you drop it there. Text direction should be preserved during drag and drop.</p>
+<p><div contenteditable="true"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/142.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/142.xhtml
new file mode 100644
index 000000000..428ce10c8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/142.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>BiDi text selection drag and drop to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>PASS|LIAF &#x202E;FAIL|SSAP&#x202C; PASS|LIAF</p>
+<p>Drag selected text to the blue box. Copy of selection should end up in the box once you drop it there. Text direction should be preserved during drag and drop.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/143.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/143.xhtml
new file mode 100644
index 000000000..39e73d41b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/143.xhtml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Large text selection drag and drop</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {var p = document.querySelector('p:last-child'), s = p.firstChild.nodeValue;
+ for(var i = 0; i != 12; i++)
+ {s = s + ' ' + s;}
+ p.firstChild.nodeValue = 'Start of selection. ' + s + ' End of selection';
+ window.getSelection().selectAllChildren(p);}
+</script>
+</head>
+<body onload="start()">
+<p>Try to drag selection below to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><textarea placeholder="Drop selection here"/></p>
+<p>Large selection.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/144.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/144.xhtml
new file mode 100644
index 000000000..6dd04bd4b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/144.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from text input and text/plain aliases</title>
+<style type="text/css">
+div
+ {min-height:40px;
+ width:40px;
+ padding:40px;
+ text-align:center;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain','PASS');}
+function checkText(event)
+ {var a = event.dataTransfer.getData('text/plain'),
+ b = event.dataTransfer.getData('text'),
+ c = event.dataTransfer.getData('TEXT'),
+ d = event.dataTransfer.getData('TexT');
+ document.querySelector('div').appendChild(document.createTextNode((a == b &amp;&amp; b == c &amp;&amp; c == d &amp;&amp; d == 'PASS')?' PASS ':' FAIL '))}
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me" ondragstart="start(event)"/></p>
+<p>Drag selection above to the navy box below and drop it. You should see word PASS once you drop it.</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="checkText(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/145.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/145.xhtml
new file mode 100644
index 000000000..9ab73d43e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/145.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from inline element and text/plain aliases</title>
+<style type="text/css">
+div
+ {min-height:40px;
+ width:40px;
+ padding:40px;
+ text-align:center;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('Text','PASS');}
+function checkText(event)
+ {var a = event.dataTransfer.getData('text/plain'),
+ b = event.dataTransfer.getData('text'),
+ c = event.dataTransfer.getData('TEXT'),
+ d = event.dataTransfer.getData('TexT');
+ document.querySelector('div').appendChild(document.createTextNode((a == b &amp;&amp; b == c &amp;&amp; c == d &amp;&amp; d == 'PASS')?'PASS':'FAIL'))}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('span'))">
+<p><span ondragstart="start(event)">Drag me</span></p>
+<p>Drag selection above to the navy box below and drop it. You should see word PASS once you drop it.</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="checkText(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/146.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/146.xhtml
new file mode 100644
index 000000000..574345cd1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/146.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop and text/plain aliases</title>
+<style type="text/css">
+div
+ {min-height:40px;
+ width:40px;
+ padding:40px;
+ text-align:center;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+function checkText(event)
+ {var a = event.dataTransfer.getData('text/plain'),
+ b = event.dataTransfer.getData('text'),
+ c = event.dataTransfer.getData('TEXT'),
+ d = event.dataTransfer.getData('TexT');
+ document.querySelector('div').appendChild(document.createTextNode((a == b &amp;&amp; b == c &amp;&amp; c == d &amp;&amp; d == 'Drag me')?'PASS':'FAIL'))}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<p>Drag selection above to the navy box below and drop it. You should see word PASS once you drop it.</p>
+<div ondragenter="event.preventDefault()" ondragover="return false" ondrop="checkText(event)"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/147.html b/testing/web-platform/tests/html/editing/dnd/selection/147.html
new file mode 100644
index 000000000..da64ecd73
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/147.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Selection should not be cleared on failed drop</title>
+ </head>
+ <body>
+
+ <ol>
+ <li>Select some text in this sentence and begin dragging it.</li>
+ <li>Drop it on this text.</li>
+ <li>Pass if the text in step 1 is still selected.</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/148.html b/testing/web-platform/tests/html/editing/dnd/selection/148.html
new file mode 100644
index 000000000..93219c594
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/148.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Selection in input should not be cleared on failed drop</title>
+ </head>
+ <body>
+
+ <ol>
+ <li><textarea rows="3" cols="60">Select some text in this sentence and begin dragging it.</textarea></li>
+ <li>Drop it on this text.</li>
+ <li>Pass if the text in step 1 is still selected.</li>
+ </ol>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/149.html b/testing/web-platform/tests/html/editing/dnd/selection/149.html
new file mode 100644
index 000000000..66475937d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/149.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dragging selections from multiline inputs should show editing caret</title>
+ </head>
+ <body>
+
+ <p>Select one word in the first input. Drag the selection around over the same input, and over the other inputs. It should show the input editing caret at the relevant insertion point within the target input's text.</p>
+ <p><textarea rows="3" cols="60">Dummy text, dummy text, dummy text, dummy text, dummy text,
+dummy text, dummy text, dummy text, dummy text, dummy text</textarea></p>
+ <p><textarea rows="3" cols="60">Dummy text, dummy text, dummy text, dummy text, dummy text,
+dummy text, dummy text, dummy text, dummy text, dummy text</textarea></p>
+ <p><input value="Dummy text, dummy text"></p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/150.html b/testing/web-platform/tests/html/editing/dnd/selection/150.html
new file mode 100644
index 000000000..ceecd35cd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/150.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Dragging selections from single-line inputs should show editing caret</title>
+ </head>
+ <body>
+
+ <p>Select one word in the first input. Drag the selection around over the same input, and over the other inputs. It should show the input editing caret at the relevant insertion point within the target input's text.</p>
+ <p><input value="Dummy text, dummy text"></p>
+ <p><textarea rows="3" cols="60">Dummy text, dummy text, dummy text, dummy text, dummy text,
+dummy text, dummy text, dummy text, dummy text, dummy text</textarea></p>
+ <p><input value="Dummy text, dummy text"></p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/151.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/151.xhtml
new file mode 100644
index 000000000..c9b2bf9f3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/151.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropping selection in readonly text input</title>
+<style type="text/css">
+input
+ {padding:1em;
+ width:300px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<p>Try to drag selected text into the input below. You should not be able to drop it here.</p>
+<p><input readonly="readonly" placeholder="Try to drop selected text here" onchange="document.querySelector('p+p').firstChild.nodeValue = 'FAIL'"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/152.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/152.xhtml
new file mode 100644
index 000000000..a9e24f305
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/152.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropping selection in readonly textarea</title>
+<style type="text/css">
+textarea
+ {padding:1em;
+ width:300px;
+ height:100px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<p>Try to drag selected text into the input below. You should not be able to drop it here.</p>
+<p><textarea readonly="readonly" placeholder="Try to drop selected text here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/153.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/153.xhtml
new file mode 100644
index 000000000..cb122364b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/153.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropping selection from text input into readonly text input</title>
+<style type="text/css">
+input
+ {padding:1em;
+ width:300px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me"/></p>
+<p>Try to drag selected text into the input below. You should not be able to drop it here.</p>
+<p><input readonly="readonly" placeholder="Try to drop selected text here" onchange="document.querySelector('p+p').firstChild.nodeValue = 'FAIL'"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/154.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/154.xhtml
new file mode 100644
index 000000000..96937b641
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/154.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dropping selection from text input into readonly textarea</title>
+<style type="text/css">
+textarea
+ {padding:1em;
+ width:300px;
+ height:100px;}
+</style>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me"/></p>
+<p>Try to drag selected text into the input below. You should not be able to drop it here.</p>
+<p><textarea readonly="readonly" placeholder="Try to drop selected text here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/155.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/155.xhtml
new file mode 100644
index 000000000..f58562b00
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/155.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop from readonly textarea to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><textarea readonly="readonly">Drag me</textarea></p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/156.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/156.xhtml
new file mode 100644
index 000000000..cbdcdd826
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/156.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop between text inputs</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Selected text should be moved to the blue box once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/157.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/157.xhtml
new file mode 100644
index 000000000..e754b67d4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/157.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop between search inputs</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the second input box. Copy of selection should end up in the second input once you drop it there.</p>
+<p><input type="search" value="Selection"/></p>
+<p><input type="search" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/158.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/158.xhtml
new file mode 100644
index 000000000..a17ac4cf1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/158.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop between tel inputs</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the second input box. Copy of selection should end up in the second input once you drop it there.</p>
+<p><input type="tel" value="123456789"/></p>
+<p><input type="tel" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/159.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/159.xhtml
new file mode 100644
index 000000000..b8987acc5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/159.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop between url inputs</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the second input box. Copy of selection should end up in the second input once you drop it there.</p>
+<p><input type="url" value="http://example.org"/></p>
+<p><input type="url" placeholder="Drop selection here"/></p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/160.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/160.xhtml
new file mode 100644
index 000000000..8bb0297e4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/160.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop between email inputs</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the second input box. Copy of selection should end up in the second input once you drop it there.</p>
+<p><input type="email" value="mail@example.org"/></p>
+<p><input type="email" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/161.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/161.xhtml
new file mode 100644
index 000000000..f292bff1d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/161.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop between number inputs</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the second input box. Copy of selection should end up in the second input once you drop it there.</p>
+<p><input type="number" value="123456789"/></p>
+<p><input type="number" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/162.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/162.xhtml
new file mode 100644
index 000000000..49d4ba916
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/162.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop between contenteditable elements</title>
+<style type="text/css">
+div + div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('div'))">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<div contenteditable="true">Drag me</div>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/163.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/163.xhtml
new file mode 100644
index 000000000..f94049a25
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/163.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Moving text between text inputs</title>
+<script type="application/ecmascript">
+function check()
+ {var input = document.querySelectorAll('input');
+ document.querySelector('p').firstChild.nodeValue = (input[0].value == '' &amp;&amp; input[1].value == 'Drag me')?'PASS':'FAIL';}
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. You should see word PASS once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<p><input ondragenter="event.preventDefault()" ondragover="event.preventDefault();event.dataTransfer.effectAllowed = 'move'" ondrop="window.setTimeout('check()',100)" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/164.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/164.xhtml
new file mode 100644
index 000000000..28d4d4864
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/164.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Moving text between search inputs</title>
+<script type="application/ecmascript">
+function check()
+ {var input = document.querySelectorAll('input');
+ document.querySelector('p').firstChild.nodeValue = (input[0].value == '' &amp;&amp; input[1].value == 'Selection')?'PASS':'FAIL';}
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input type="search" value="Selection"/></p>
+<p><input ondragenter="event.preventDefault()" ondragover="event.preventDefault();event.dataTransfer.effectAllowed = 'move'" ondrop="window.setTimeout('check()',100)" type="search" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/165.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/165.xhtml
new file mode 100644
index 000000000..81ee12366
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/165.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Moving text between tel inputs</title>
+<script type="application/ecmascript">
+function check()
+ {var input = document.querySelectorAll('input');
+ document.querySelector('p').firstChild.nodeValue = (input[0].value == '' &amp;&amp; input[1].value == '123456789')?'PASS':'FAIL';}
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected number to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input type="tel" value="123456789"/></p>
+<p><input ondragenter="event.preventDefault()" ondragover="event.preventDefault();event.dataTransfer.effectAllowed = 'move'" ondrop="window.setTimeout('check()',100)" type="tel" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/166.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/166.xhtml
new file mode 100644
index 000000000..de23321dd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/166.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Moving text between url inputs</title>
+<script type="application/ecmascript">
+function check()
+ {var input = document.querySelectorAll('input');
+ document.querySelector('p').firstChild.nodeValue = (input[0].value == '' &amp;&amp; input[1].value == 'http://example.org')?'PASS':'FAIL';}
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected url to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input type="url" value="http://example.org"/></p>
+<p><input ondragenter="event.preventDefault()" ondragover="event.preventDefault();event.dataTransfer.effectAllowed = 'move'" ondrop="window.setTimeout('check()',100)" type="url" placeholder="Drop selection here"/></p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/167.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/167.xhtml
new file mode 100644
index 000000000..cc0a58008
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/167.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Moving text between email inputs</title>
+<script type="application/ecmascript">
+function check()
+ {var input = document.querySelectorAll('input');
+ document.querySelector('p').firstChild.nodeValue = (input[0].value == '' &amp;&amp; input[1].value == 'mail@example.org')?'PASS':'FAIL';}
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected email to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input type="email" value="mail@example.org"/></p>
+<p><input ondragenter="event.preventDefault()" ondragover="event.preventDefault();event.dataTransfer.effectAllowed = 'move'" ondrop="window.setTimeout('check()',100)" type="email" placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/168.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/168.xhtml
new file mode 100644
index 000000000..5b89314a8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/168.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Moving text between contenteditable elements</title>
+<style type="text/css">
+div + div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+function check()
+ {var div = document.querySelectorAll('div');
+ document.querySelector('p').firstChild.nodeValue = (!div[0].firstChild.nodeValue &amp;&amp; div[1].firstChild.nodeValue == 'Drag me')?'PASS':('FAIL(' + div[0].firstChild.nodeValue + ')');}
+</script>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('div'))">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<div contenteditable="true" ondragstart="event.dataTransfer.effectAllowed = 'move'">Drag me</div>
+<div ondragenter="event.preventDefault()" ondragover="event.preventDefault();" ondrop="window.setTimeout('check()',100)" contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/169.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/169.xhtml
new file mode 100644
index 000000000..d1f56734f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/169.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Moving text from text input to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+<script type="application/ecmascript">
+function check()
+ {document.querySelector('p').firstChild.nodeValue = (document.querySelector('input').value == '' &amp;&amp; document.querySelector('div').firstChild.nodeValue == 'Drag me')?'PASS':('FAIL(' + div[0].firstChild.nodeValue + ')');}
+</script>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input value="Drag me"/></p>
+<div ondragenter="event.preventDefault()" ondragover="event.preventDefault();event.dataTransfer.effectAllowed = 'move'" ondrop="window.setTimeout('check()',100)" contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/170.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/170.xhtml
new file mode 100644
index 000000000..ccc8e8bdb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/170.xhtml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging multiline text selection from scrolled textarea to block element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+textarea
+ {width:300px;
+ height:100px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(163,185)">
+<p>
+<textarea>
+Here is textarea with selection at the end of it.
+Drag selected text to the blue box.
+Copy of selection should end up in the blue box once you drop it there.
+Try to drag this text.
+</textarea>
+</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/171.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/171.xhtml
new file mode 100644
index 000000000..ce00dd71b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/171.xhtml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging text selection from scrollable container to block element</title>
+<style type="text/css">
+div
+ {width:300px;
+ height:100px;}
+div:first-child
+ {overflow-y:scroll;}
+div[ondragenter]
+ {margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+textarea
+ {width:300px;
+ height:100px;}
+p+p
+ {margin-top:200px;
+ padding-bottom:50px;}
+</style>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p + p'))">
+<div>
+<p>
+Here is scrollable container with text selection at the end of it.
+Drag selected text to the blue box.
+Copy of selection should end up in the blue box once you drop it there.
+</p>
+<p>Try to drag this text.</p>
+</div>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div + div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/172.html b/testing/web-platform/tests/html/editing/dnd/selection/172.html
new file mode 100644
index 000000000..a92733701
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/172.html
@@ -0,0 +1,45 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Selection dragging should drag minimal HTML context</title>
+ <style type="text/css">
+p + div {
+ background: orange;
+ width: 4em;
+}
+div + div {
+ border: 1px solid black;
+ min-height: 5em;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var output = document.getElementsByTagName('div')[1];
+ output.ondragenter = output.ondragover = function (e) { e.preventDefault(); };
+ output.ondrop = function (e) {
+ e.preventDefault();
+ var drophtml = e.dataTransfer.getData('text/html').toUpperCase().replace(/\sSTYLE="[^"]*"/g,'').replace(/[\r\n]+/g,'\\n');
+ var droptext = e.dataTransfer.getData('text/plain').replace(/[\r\n]+/g,'\\n');
+ var expectedhtml = '<P><SPAN>C</SPAN>D</P><P>E<SPAN>F</SPAN></P>';
+ var expectedtext = 'CD\\nEF';
+ if( drophtml != expectedhtml ) {
+ output.innerHTML = 'FAIL - normalised dropped HTML was:<br>'+drophtml.replace(/</g,'&lt;');
+ } else if( droptext != expectedtext ) {
+ output.innerHTML = 'FAIL - normalised dropped text was:<br>'+droptext.replace(/</g,'&lt;');
+ } else {
+ output.innerHTML = 'PASS';
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Select the text from &quot;C&quot; to &quot;F&quot; (including both of those characters) in the text below.</p>
+ <div>
+ <p><span>A</span><span>BC</span>D</p><p>E<span>FG</span><span>H</span></p>
+ </div>
+ <div>Drag the selection and drop it here.</div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/173.html b/testing/web-platform/tests/html/editing/dnd/selection/173.html
new file mode 100644
index 000000000..5ff15a219
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/173.html
@@ -0,0 +1,45 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Selection dragging should drag no HTML when inside a single element</title>
+ <style type="text/css">
+p + div {
+ background: orange;
+ width: 4em;
+}
+div + div {
+ border: 1px solid black;
+ min-height: 5em;
+}
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var output = document.getElementsByTagName('div')[1];
+ output.ondragenter = output.ondragover = function (e) { e.preventDefault(); };
+ output.ondrop = function (e) {
+ e.preventDefault();
+ var drophtml = e.dataTransfer.getData('text/html').toUpperCase().replace(/\sSTYLE="[^"]*"/g,'').replace(/[\r\n]+/g,'\\n');
+ var droptext = e.dataTransfer.getData('text/plain').replace(/[\r\n]+/g,'\\n');
+ var expectedhtml = 'B';
+ var expectedtext = 'B';
+ if( drophtml != expectedhtml ) {
+ output.innerHTML = 'FAIL - normalised dropped HTML was:<br>'+drophtml.replace(/</g,'&lt;');
+ } else if( droptext != expectedtext ) {
+ output.innerHTML = 'FAIL - normalised dropped text was:<br>'+droptext.replace(/</g,'&lt;');
+ } else {
+ output.innerHTML = 'PASS';
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <p>Select &quot;B&quot; in the text below.</p>
+ <div>
+ <p>ABC</p>
+ </div>
+ <div>Drag the selection and drop it here.</div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-input-to-other-input.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-input-to-other-input.xhtml
new file mode 100644
index 000000000..f005092f6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-input-to-other-input.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the input field below. Copy of selection should end up in the input once you drop it there.</p>
+<p><input value="Drag me"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-input-to-other-textarea.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-input-to-other-textarea.xhtml
new file mode 100644
index 000000000..767e5a43e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-input-to-other-textarea.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><input value="Drag me"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-input.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-input.xhtml
new file mode 100644
index 000000000..9d12a89dd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-input.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><input value="Drag me"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-textarea-to-other-blue-box.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-textarea-to-other-blue-box.xhtml
new file mode 100644
index 000000000..6c76fbdbb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-textarea-to-other-blue-box.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+<style type="text/css">
+textarea
+ {height:1.5em;
+ width:7em;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-textarea-to-other-input.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-textarea-to-other-input.xhtml
new file mode 100644
index 000000000..287e3bb5e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-textarea-to-other-input.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+<style type="text/css">
+textarea
+ {height:1.5em;
+ width:7em;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the input field below. Copy of selection should end up in the input once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-textarea-to-other-textarea.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-textarea-to-other-textarea.xhtml
new file mode 100644
index 000000000..c7eb54478
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/helper-drag-me-textarea-to-other-textarea.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+<style type="text/css">
+textarea
+ {height:1.5em;
+ width:7em;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p>Drag selected text to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><textarea>Drag me</textarea></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-blue-box-contenteditable.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-blue-box-contenteditable.xhtml
new file mode 100644
index 000000000..20f3820a1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-blue-box-contenteditable.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-blue-box.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-blue-box.xhtml
new file mode 100644
index 000000000..ccd32c227
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-blue-box.xhtml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-input.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-input.xhtml
new file mode 100644
index 000000000..8be631888
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-input.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;}
+</style>
+</head>
+<body>
+<p><input placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-textarea.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-textarea.xhtml
new file mode 100644
index 000000000..cbe268374
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/helper-drop-here-textarea.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/selection/helper-scroll-then-drop-input.xhtml b/testing/web-platform/tests/html/editing/dnd/selection/helper-scroll-then-drop-input.xhtml
new file mode 100644
index 000000000..14c01ccac
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/selection/helper-scroll-then-drop-input.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selection drag and drop: helper file</title>
+<style type="text/css">
+input[placeholder]
+ {width:300px;
+ height:50px;}
+p:first-child
+ {margin-bottom:200px;}
+</style>
+</head>
+<body>
+<p>You should be able to drag selected text to the input at the bottom of scrollable container (dragging towards the bottom edge triggers scrolling).</p>
+<input placeholder="Drop selection here"/>
+<p>Copy of selection should end up in the input once you drop it there.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/001.svg b/testing/web-platform/tests/html/editing/dnd/svg/001.svg
new file mode 100644
index 000000000..055a7b278
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/001.svg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from text element to textArea</title>
+<text x="10" y="30" font-size="20">Select part of this text and drag selection to</text>
+<text x="10" y="60" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="90" font-size="20">copies once it's dropped in the box.</text>
+<textArea x="10" y="110" width="480" height="380" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="110" width="480" height="380" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/002.svg b/testing/web-platform/tests/html/editing/dnd/svg/002.svg
new file mode 100644
index 000000000..45ab566e6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/002.svg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from editable text element to textArea</title>
+<text x="10" y="30" editable="simple" font-size="20">Select part of this text and drag selection to</text>
+<text x="10" y="60" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="90" font-size="20">copies once it's dropped in the box.</text>
+<textArea x="10" y="110" width="480" height="380" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="110" width="480" height="380" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/003.svg b/testing/web-platform/tests/html/editing/dnd/svg/003.svg
new file mode 100644
index 000000000..c1f30cfbc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/003.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from tspan elements to textArea</title>
+<text x="10" y="30" font-size="20">
+ <tspan>Select part</tspan>
+ <tspan>of this text</tspan>
+ <tspan>and drag selection to</tspan>
+</text>
+<text x="10" y="60" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="90" font-size="20">copies once it's dropped in the box.</text>
+<textArea x="10" y="110" width="480" height="380" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="110" width="480" height="380" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/004.svg b/testing/web-platform/tests/html/editing/dnd/svg/004.svg
new file mode 100644
index 000000000..e3c4828a8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/004.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from tref element to textArea</title>
+<defs>
+ <text id="text">Select me</text>
+ </defs>
+<text x="10" y="30" font-size="20" fill="navy"><tref xlink:href="#text"/></text>
+<text x="10" y="60" font-size="20">Select text above and drag selection to</text>
+<text x="10" y="90" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="120" font-size="20">copies once it's dropped in the box.</text>
+<textArea x="10" y="130" width="480" height="360" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="130" width="480" height="360" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/005.svg b/testing/web-platform/tests/html/editing/dnd/svg/005.svg
new file mode 100644
index 000000000..9bb3bd68b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/005.svg
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from textArea to textArea</title>
+<textArea x="10" y="10" width="480" height="90" font-size="20">Select part of this text and drag selection to the box below.
+Content of selection should be copied once it's dropped in the box.</textArea>
+<textArea x="10" y="110" width="480" height="380" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="110" width="480" height="380" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/006.svg b/testing/web-platform/tests/html/editing/dnd/svg/006.svg
new file mode 100644
index 000000000..5edeba697
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/006.svg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from text element to editable text element</title>
+<text x="10" y="30" font-size="20">Select part of this text and drag selection to</text>
+<text x="10" y="60" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="90" font-size="20">copies once it's dropped in the box.</text>
+<text x="10" y="200" font-size="50" editable="simple">                             </text>
+<rect x="10" y="160" width="480" height="50" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/007.svg b/testing/web-platform/tests/html/editing/dnd/svg/007.svg
new file mode 100644
index 000000000..7d8bcf8d4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/007.svg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection between editable text elements</title>
+<text x="10" y="30" font-size="20" editable="simple">Select part of this text and drag selection to</text>
+<text x="10" y="60" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="90" font-size="20">copies once it's dropped in the box.</text>
+<text x="10" y="200" font-size="50" editable="simple">                             </text>
+<rect x="10" y="160" width="480" height="50" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/008.svg b/testing/web-platform/tests/html/editing/dnd/svg/008.svg
new file mode 100644
index 000000000..167f73feb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/008.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from tspan element to editable text element</title>
+<text x="10" y="30" font-size="20">
+ <tspan>Select part</tspan>
+ <tspan>of this text</tspan>
+ <tspan>and drag selection to</tspan>
+</text>
+<text x="10" y="60" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="90" font-size="20">copies once it's dropped in the box.</text>
+<text x="10" y="200" font-size="50" editable="simple">                             </text>
+<rect x="10" y="160" width="480" height="50" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/009.svg b/testing/web-platform/tests/html/editing/dnd/svg/009.svg
new file mode 100644
index 000000000..e7bd622a0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/009.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from tref element to editable text element</title>
+<defs>
+ <text id="text">Select me</text>
+ </defs>
+<text x="10" y="30" font-size="20" fill="navy"><tref xlink:href="#text"/></text>
+<text x="10" y="60" font-size="20">Select text above and drag selection to</text>
+<text x="10" y="90" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="120" font-size="20">copies once it's dropped in the box.</text>
+<text x="10" y="200" font-size="50" editable="simple">                             </text>
+<rect x="10" y="160" width="480" height="50" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/010.svg b/testing/web-platform/tests/html/editing/dnd/svg/010.svg
new file mode 100644
index 000000000..c5cce1867
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/010.svg
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from textArea to editable text element</title>
+<textArea x="10" y="10" width="480" height="90" font-size="20">Select part of this text and drag selection to the box below.
+Content of selection should be copied once it's dropped in the box.</textArea>
+<text x="10" y="200" font-size="50" editable="simple">                             </text>
+<rect x="10" y="160" width="480" height="50" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/011.svg b/testing/web-platform/tests/html/editing/dnd/svg/011.svg
new file mode 100644
index 000000000..8f07c3c82
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/011.svg
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from textpath to textArea</title>
+<defs>
+ <path id="path" d="M 10 40 C 10 20 480 20 480 40"/>
+</defs>
+<text fill="navy">
+ <textPath xlink:href="#path">Some selectable text rendered along curved text path</textPath>
+</text>
+<text x="10" y="60" font-size="20">Select part of text above and drag selection to</text>
+<text x="10" y="90" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="120" font-size="20">copies once it's dropped in the box.</text>
+<textArea x="10" y="130" width="480" height="360" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="130" width="480" height="360" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/012.svg b/testing/web-platform/tests/html/editing/dnd/svg/012.svg
new file mode 100644
index 000000000..18c027655
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/012.svg
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from editable textpath to textArea</title>
+<defs>
+ <path id="path" d="M 10 40 C 10 20 480 20 480 40"/>
+</defs>
+<text fill="navy" editable="simple">
+ <textPath xlink:href="#path">Some selectable text rendered along curved text path</textPath>
+</text>
+<text x="10" y="60" font-size="20">Select part of text above and drag selection to</text>
+<text x="10" y="90" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="120" font-size="20">copies once it's dropped in the box.</text>
+<textArea x="10" y="130" width="480" height="360" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="130" width="480" height="360" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/013-1.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/013-1.xhtml
new file mode 100644
index 000000000..a97dce1f2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/013-1.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop from SVG: helper file</title>
+<style type="text/css">
+textarea
+ {width:400px;
+ height:300px;
+ padding:10px;}
+</style>
+</head>
+<body>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/013.svg b/testing/web-platform/tests/html/editing/dnd/svg/013.svg
new file mode 100644
index 000000000..d312135be
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/013.svg
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from text element to XHTML textarea in foreignObject</title>
+<text x="10" y="30" font-size="20">Select part of this text and drag selection to</text>
+<text x="10" y="60" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="90" font-size="20">copies once it's dropped in the box.</text>
+<switch>
+ <foreignObject x="10" y="120" width="480" height="380" requiredExtensions="http://www.w3.org/1999/xhtml" xlink:href="013-1.xhtml"/>
+ <text x="10" y="150" font-size="20">Skip the test (foreignObject is not supported).</text>
+</switch>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/014-1.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/014-1.xhtml
new file mode 100644
index 000000000..674870d05
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/014-1.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop from SVG: helper file</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/014.svg b/testing/web-platform/tests/html/editing/dnd/svg/014.svg
new file mode 100644
index 000000000..772a9fdef
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/014.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from textArea to contenteditable element in foreignObject</title>
+<textArea x="10" y="10" width="480" height="90" font-size="20">Select part of this text and drag selection to the box below.
+Content of selection should be copied once it's dropped in the box.</textArea>
+<switch>
+ <foreignObject x="10" y="120" width="480" height="380" requiredExtensions="http://www.w3.org/1999/xhtml" xlink:href="014-1.xhtml"/>
+ <text x="10" y="150" font-size="20">Skip the test (foreignObject is not supported).</text>
+</switch>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/015-1.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/015-1.xhtml
new file mode 100644
index 000000000..f5217a91e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/015-1.xhtml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop from SVG: helper file</title>
+</head>
+<body>
+<input placeholder="Drop selection here"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/015.svg b/testing/web-platform/tests/html/editing/dnd/svg/015.svg
new file mode 100644
index 000000000..3f97727c5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/015.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from textArea to XHTML input in foreignObject</title>
+<textArea x="10" y="10" width="480" height="90" font-size="20">Select part of this text and drag selection to the box below.
+Content of selection should be copied once it's dropped in the box.</textArea>
+<switch>
+ <foreignObject x="10" y="120" width="480" height="380" requiredExtensions="http://www.w3.org/1999/xhtml" xlink:href="015-1.xhtml"/>
+ <text x="10" y="150" font-size="20">Skip the test (foreignObject is not supported).</text>
+</switch>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/016-1.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/016-1.xhtml
new file mode 100644
index 000000000..484d4b4eb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/016-1.xhtml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop from SVG: helper file</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<div
+ ondragenter="event.preventDefault();event.dataTransfer.effectAllowed = 'copy'"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/016.svg b/testing/web-platform/tests/html/editing/dnd/svg/016.svg
new file mode 100644
index 000000000..60d9e40c7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/016.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG text selection from textArea to foreignObject</title>
+<textArea x="10" y="10" width="480" height="90" font-size="20">Select part of this text and drag selection to the box below.
+Content of selection should be copied once it's dropped in the box.</textArea>
+<switch>
+ <foreignObject x="10" y="120" width="480" height="380" requiredExtensions="http://www.w3.org/1999/xhtml" xlink:href="016-1.xhtml"/>
+ <text x="10" y="150" font-size="20">Skip the test (foreignObject is not supported).</text>
+</switch>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/017.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/017.xhtml
new file mode 100644
index 000000000..598a2c6f3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/017.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging selection to SVG textArea</title>
+</head>
+<body onload="window.getSelection().selectAllChildren(document.querySelector('p'))">
+<p>Drag me</p>
+<p>Drag selection above to the box below. Copy of selection should end up in the box once you drop it there.</p>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="300px" viewBox="0 0 500 300">
+<textArea x="10" y="10" width="480" height="280" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="10" width="480" height="280" stroke="black" stroke-width="1" fill="none"/>
+</svg>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/018.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/018.xhtml
new file mode 100644
index 000000000..03ac442a3
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/018.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging selection from XHTML text input to SVG textArea</title>
+</head>
+<body onload="document.querySelector('input').select()">
+<p><input value="Drag me"/></p>
+<p>Drag selection above to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="300px" viewBox="0 0 500 300">
+<textArea x="10" y="10" width="480" height="280" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="10" width="480" height="280" stroke="black" stroke-width="1" fill="none"/>
+</svg>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/019.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/019.xhtml
new file mode 100644
index 000000000..6c16875a1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/019.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging selection from XHTML textarea to SVG textArea</title>
+<style type="text/css">
+textarea
+ {height:1.5em;
+ width:7em;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(0,7)">
+<p><textarea>Drag me</textarea></p>
+<p>Drag selection above to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="300px" viewBox="0 0 500 300">
+<textArea x="10" y="10" width="480" height="280" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="10" width="480" height="280" stroke="black" stroke-width="1" fill="none"/>
+</svg>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/020.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/020.xhtml
new file mode 100644
index 000000000..c3c50fd9e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/020.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging multiline selection from XHTML textarea to SVG textArea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;}
+</style>
+</head>
+<body onload="var t = document.querySelector('textarea');t.select();t.setSelectionRange(25,56)">
+<p>
+<textarea>
+Here is textarea
+with selection that
+spans two lines.
+Drag selected text to the blue box.
+Copy of selection should end up in the blue box once you drop it there.
+</textarea>
+</p>
+<p>Drag selection above to the textarea below. Copy of selection should end up in the textarea once you drop it there.</p>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="300px" viewBox="0 0 500 300">
+<textArea x="10" y="10" width="480" height="280" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="10" width="480" height="280" stroke="black" stroke-width="1" fill="none"/>
+</svg>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/021.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/021.xhtml
new file mode 100644
index 000000000..3cc07af28
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/021.xhtml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging selection from SVG text element to XHTML element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200px" height="50px" viewBox="0 0 200 50">
+<text x="10" y="45" font-size="30" fill="navy">Select me</text>
+</svg>
+<p>Select the text above and drag selection to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/022.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/022.xhtml
new file mode 100644
index 000000000..bd619ca00
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/022.xhtml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging selection from SVG editable text element to XHTML element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200px" height="50px" viewBox="0 0 200 50">
+<text x="10" y="45" font-size="30" fill="navy" editable="simple">Select me</text>
+</svg>
+<p>Select the text above and drag selection to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/023.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/023.xhtml
new file mode 100644
index 000000000..3ada55cef
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/023.xhtml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging selection from SVG textArea to XHTML element</title>
+<style type="text/css">
+div[ondragenter]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="500px" height="100px" viewBox="0 0 500 100">
+<textArea x="10" y="10" width="480" height="90" font-size="20">Select part of this text and drag selection to the box below.
+Content of selection should be copied once it's dropped in the box.</textArea>
+</svg>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/plain')))"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/024.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/024.xhtml
new file mode 100644
index 000000000..58349cdcf
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/024.xhtml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging selection from SVG text element to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200px" height="50px" viewBox="0 0 200 50">
+<text x="10" y="45" font-size="30" fill="navy">Select me</text>
+</svg>
+<p>Select the text above and drag selection to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/025.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/025.xhtml
new file mode 100644
index 000000000..236e1655e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/025.xhtml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging selection from SVG editable text element to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="200px" height="50px" viewBox="0 0 200 50">
+<text x="10" y="45" font-size="30" fill="navy" editable="simple">Select me</text>
+</svg>
+<p>Select the text above and drag selection to the blue box. Copy of selection should end up in the blue box once you drop it there.</p>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/026.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/026.xhtml
new file mode 100644
index 000000000..b387f0a00
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/026.xhtml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging selection from SVG textArea to contenteditable element</title>
+<style type="text/css">
+div[contenteditable]
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="500px" height="100px" viewBox="0 0 500 100">
+<textArea x="10" y="10" width="480" height="90" font-size="20">Select part of this text and drag selection to the box below.
+Content of selection should be copied once it's dropped in the box.</textArea>
+</svg>
+<div contenteditable="true"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/027.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/027.xhtml
new file mode 100644
index 000000000..d122bae19
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/027.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging selection from SVG text element to XHTML textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200px" height="50px" viewBox="0 0 200 50">
+<text x="10" y="45" font-size="30" fill="navy">Select me</text>
+</svg>
+<p>Select the text above and drag selection to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/028.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/028.xhtml
new file mode 100644
index 000000000..1d5437117
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/028.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging selection from SVG editable text element to XHTML textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="200px" height="50px" viewBox="0 0 200 50">
+<text x="10" y="45" font-size="30" fill="navy" editable="simple">Select me</text>
+</svg>
+<p>Select the text above and drag selection to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/029.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/029.xhtml
new file mode 100644
index 000000000..02e258e85
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/029.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging selection from SVG textArea to XHTML textarea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="500px" height="100px" viewBox="0 0 500 100">
+<textArea x="10" y="10" width="480" height="90" font-size="20">Select part of this text and drag selection to the box below.
+Content of selection should be copied once it's dropped in the box.</textArea>
+</svg>
+<p>Select the text above and drag selection to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/030-1.svg b/testing/web-platform/tests/html/editing/dnd/svg/030-1.svg
new file mode 100644
index 000000000..62798a7e1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/030-1.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="100px" viewBox="0 0 100 100">
+<circle cx="50" cy="50" r="50" fill="green"/>
+</svg>
+
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/030.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/030.xhtml
new file mode 100644
index 000000000..dd6f7fa22
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/030.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>SVG image drag and drop</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list'));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img src="030-1.svg" alt="SVG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/031.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/031.xhtml
new file mode 100644
index 000000000..a21fdc0f6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/031.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>SVG dataURL image drag and drop</title>
+<style type="text/css">
+div[ondragenter]
+ {width:105px;
+ min-height:105px;
+ text-align:center;
+ margin-top:20px;
+ padding:10px;
+ border:solid thin navy;}
+p:first-child
+ {padding-left:12px;}
+</style>
+<script type="application/ecmascript">
+function addImage(event)
+ {var c = document.createElement('img');
+ c.setAttribute('src',event.dataTransfer.getData('text/uri-list'));
+ document.querySelector('div').appendChild(c);}
+</script>
+</head>
+<body>
+<p><img src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22green%22/%3E%3C/svg%3E" alt="SVG circle" ondragstart="event.dataTransfer.effectAllowed = 'copy'"/></p>
+<p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
+<div
+ ondragenter="event.preventDefault()"
+ ondragover="return false"
+ ondrop="addImage(event)"
+/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/032.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/032.xhtml
new file mode 100644
index 000000000..bdc6c9904
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/032.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross fragment drag and drop of SVG text selection from text element to textArea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200px" height="50px" viewBox="0 0 200 50">
+<text x="10" y="45" font-size="30" fill="navy">Select me</text>
+</svg>
+<p>Drag selection above to the textarea below. Copy of selection should end up in the textarea once you drop it there.</p>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="300px" viewBox="0 0 500 300">
+<textArea x="10" y="10" width="480" height="280" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="10" width="480" height="280" stroke="black" stroke-width="1" fill="none"/>
+</svg>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/033.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/033.xhtml
new file mode 100644
index 000000000..1888875ab
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/033.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross fragment drag and drop of SVG text selection from editable text element to textArea</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200px" height="50px" viewBox="0 0 200 50">
+<text x="10" y="45" font-size="30" fill="navy" editable="simple">Select me</text>
+</svg>
+<p>Drag selection above to the textarea below. Copy of selection should end up in the textarea once you drop it there.</p>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="300px" viewBox="0 0 500 300">
+<textArea x="10" y="10" width="480" height="280" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="10" width="480" height="280" stroke="black" stroke-width="1" fill="none"/>
+</svg>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/034.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/034.xhtml
new file mode 100644
index 000000000..0e9e4ea44
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/034.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross fragment drag and drop of SVG text selection from textArea to editable text element</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="500px" height="100px" viewBox="0 0 500 100">
+<textArea x="10" y="10" width="480" height="90" font-size="20">Select me.</textArea>
+</svg>
+<p>Drag selection above to the textarea below. Copy of selection should end up in the textarea once you drop it there.</p>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="300px" viewBox="0 0 500 300">
+<textArea x="10" y="10" width="480" height="280" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="10" width="480" height="280" stroke="black" stroke-width="1" fill="none"/>
+</svg>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/035.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/035.xhtml
new file mode 100644
index 000000000..a0dd437bd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/035.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Cross fragment drag and drop between SVG textAreas</title>
+<style type="text/css">
+textarea
+ {width:300px;
+ height:100px;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="500px" height="100px" viewBox="0 0 500 100">
+<textArea x="10" y="10" width="480" height="90" font-size="20">Select me.</textArea>
+</svg>
+<p>Drag selection above to the textarea below. Copy of selection should end up in the textarea once you drop it there.</p>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400px" height="50px" viewBox="0 0 400 50">
+<text x="10" y="40" font-size="50" editable="simple">                        </text>
+<rect x="10" y="0" width="380" height="50" stroke="black" stroke-width="1" fill="none"/>
+</svg>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/036-1.svg b/testing/web-platform/tests/html/editing/dnd/svg/036-1.svg
new file mode 100644
index 000000000..d16862da6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/036-1.svg
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200px" height="50px" viewBox="0 0 200 50">
+<text x="10" y="45" font-size="30" fill="navy">Select me</text>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/036.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/036.xhtml
new file mode 100644
index 000000000..cb774b3eb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/036.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging text selection between different SVG images</title>
+</head>
+<body>
+<p><object type="image/svg+xml" data="036-1.svg">SVG Image</object></p>
+<p>Drag selection above to the box below. Copy of selection should end up in the box once you drop it there.</p>
+<p><object type="image/svg+xml" data="helper-drop-selection-here-textArea.svg">SVG Image</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/037.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/037.xhtml
new file mode 100644
index 000000000..b97f99cc4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/037.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging text selection from dataURL image to another SVG image</title>
+</head>
+<body>
+<object type="image/svg+xml" data="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22200px%22%20height%3D%2250px%22%20viewBox%3D%220%200%20200%2050%22%3E%3Ctext%20x%3D%2210%22%20y%3D%2245%22%20font-size%3D%2230%22%20fill%3D%22navy%22%3ESelect%20me%3C/text%3E%3C/svg%3E">SVG Image</object>
+<p>Drag selection above to the box below. Copy of selection should end up in the box once you drop it there.</p>
+<p><object type="image/svg+xml" data="helper-drop-selection-here-textArea.svg">SVG Image</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/038.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/038.xhtml
new file mode 100644
index 000000000..c74b1db9c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/038.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging text selection between different SVG dataURL images</title>
+</head>
+<body>
+<p><object type="image/svg+xml" data="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22200px%22%20height%3D%2250px%22%20viewBox%3D%220%200%20200%2050%22%3E%3Ctext%20x%3D%2210%22%20y%3D%2245%22%20font-size%3D%2230%22%20fill%3D%22navy%22%3ESelect%20me%3C/text%3E%3C/svg%3E">SVG Image</object></p>
+<p>Drag selection above to the box below. Copy of selection should end up in the box once you drop it there.</p>
+<p><object type="image/svg+xml" data="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.2%22%20width%3D%22500px%22%20height%3D%22300px%22%20viewBox%3D%220%200%20500%20300%22%3E%3CtextArea%20x%3D%2210%22%20y%3D%2210%22%20width%3D%22480%22%20height%3D%22280%22%20font-size%3D%2220%22%20editable%3D%22simple%22%20pointer-events%3D%22boundingBox%22%3EDrop%20selection%20here%3C/textArea%3E%3Crect%20x%3D%2210%22%20y%3D%2210%22%20width%3D%22480%22%20height%3D%22280%22%20stroke%3D%22black%22%20stroke-width%3D%221%22%20fill%3D%22none%22/%3E%3C/svg%3E">SVG Image</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/039-1.svg b/testing/web-platform/tests/html/editing/dnd/svg/039-1.svg
new file mode 100644
index 000000000..7023ddd93
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/039-1.svg
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="250px" height="50px" viewBox="0 0 250 50">
+<textArea x="10" y="10" width="200" height="50" font-size="20">Select me.</textArea>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/039.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/039.xhtml
new file mode 100644
index 000000000..77bc7e9c9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/039.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging textArea selection between different SVG images</title>
+</head>
+<body>
+<p><object type="image/svg+xml" data="039-1.svg">SVG Image</object></p>
+<p>Drag selection above to the box below. Copy of selection should end up in the box once you drop it there.</p>
+<p><object type="image/svg+xml" data="helper-drop-selection-here-textArea.svg">SVG Image</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/040.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/040.xhtml
new file mode 100644
index 000000000..6069563a9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/040.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging textArea selection from dataURL image to another SVG image</title>
+</head>
+<body>
+<p><object type="image/svg+xml" data="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22250px%22%20height%3D%2250px%22%20viewBox%3D%220%200%20250%2050%22%3E%3CtextArea%20x%3D%2210%22%20y%3D%2210%22%20width%3D%22200%22%20height%3D%2250%22%20font-size%3D%2220%22%3ESelect%20me.%3C/textArea%3E%3C/svg%3E">SVG Image</object></p>
+<p>Drag selection above to the box below. Copy of selection should end up in the box once you drop it there.</p>
+<p><object type="image/svg+xml" data="helper-drop-selection-here-textArea.svg">SVG Image</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/041.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/041.xhtml
new file mode 100644
index 000000000..326bafe63
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/041.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Dragging textArea selection between different SVG dataURL images</title>
+</head>
+<body>
+<p><object type="image/svg+xml" data="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22250px%22%20height%3D%2250px%22%20viewBox%3D%220%200%20250%2050%22%3E%3CtextArea%20x%3D%2210%22%20y%3D%2210%22%20width%3D%22200%22%20height%3D%2250%22%20font-size%3D%2220%22%3ESelect%20me.%3C/textArea%3E%3C/svg%3E">SVG Image</object></p>
+<p>Drag selection above to the box below. Copy of selection should end up in the box once you drop it there.</p>
+<p><object type="image/svg+xml" data="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.2%22%20width%3D%22500px%22%20height%3D%22300px%22%20viewBox%3D%220%200%20500%20300%22%3E%3CtextArea%20x%3D%2210%22%20y%3D%2210%22%20width%3D%22480%22%20height%3D%22280%22%20font-size%3D%2220%22%20editable%3D%22simple%22%20pointer-events%3D%22boundingBox%22%3EDrop%20selection%20here%3C/textArea%3E%3Crect%20x%3D%2210%22%20y%3D%2210%22%20width%3D%22480%22%20height%3D%22280%22%20stroke%3D%22black%22%20stroke-width%3D%221%22%20fill%3D%22none%22/%3E%3C/svg%3E">SVG Image</object></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/042.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/042.xhtml
new file mode 100644
index 000000000..25d360fcb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/042.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop from downsized SVG image</title>
+<style type="text/css">
+object
+ {width:100px;
+ height:30px;}
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body>
+<p><object type="image/svg+xml" data="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22200px%22%20height%3D%2250px%22%20viewBox%3D%220%200%20200%2050%22%3E%3Ctext%20x%3D%2210%22%20y%3D%2245%22%20font-size%3D%2230%22%20fill%3D%22navy%22%3ESelect%20me%3C/text%3E%3C/svg%3E">SVG Image</object></p>
+<p>Select the text above and drag selection to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/043.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/043.xhtml
new file mode 100644
index 000000000..7144e0f7e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/043.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop from enlarged SVG image</title>
+<style type="text/css">
+object
+ {width:300px;
+ height:75px;}
+textarea
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;}
+</style>
+</head>
+<body>
+<p><object type="image/svg+xml" data="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20version%3D%221.1%22%20width%3D%22200px%22%20height%3D%2250px%22%20viewBox%3D%220%200%20200%2050%22%3E%3Ctext%20x%3D%2210%22%20y%3D%2245%22%20font-size%3D%2230%22%20fill%3D%22navy%22%3ESelect%20me%3C/text%3E%3C/svg%3E">SVG Image</object></p>
+<p>Select the text above and drag selection to the textarea. Copy of selection should end up in the textarea once you drop it there.</p>
+<p><textarea placeholder="Drop selection here"/></p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/044.svg b/testing/web-platform/tests/html/editing/dnd/svg/044.svg
new file mode 100644
index 000000000..6dfcb4d66
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/044.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of RTL SVG text selection from text element to textArea</title>
+<text x="10" y="30" font-size="20" fill="navy">&#x202E;FAIL|SSAP&#x202C;</text>
+<text x="10" y="60" font-size="20">Select text above and drag selection to</text>
+<text x="10" y="90" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="120" font-size="20">copies once it's dropped in the box.</text>
+<textArea x="10" y="130" width="480" height="360" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="130" width="480" height="360" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/045.svg b/testing/web-platform/tests/html/editing/dnd/svg/045.svg
new file mode 100644
index 000000000..00dee4564
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/045.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of BiDi SVG text selection from text element to textArea</title>
+<text x="10" y="30" font-size="20" fill="navy">PASS|LIAF &#x202E;FAIL|SSAP&#x202C; PASS|LIAF</text>
+<text x="10" y="60" font-size="20">Select text above and drag selection to</text>
+<text x="10" y="90" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="120" font-size="20">copies once it's dropped in the box.</text>
+<textArea x="10" y="130" width="480" height="360" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="130" width="480" height="360" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/046.svg b/testing/web-platform/tests/html/editing/dnd/svg/046.svg
new file mode 100644
index 000000000..da9b03718
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/046.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of BiDi SVG text selection from tspan elements to textArea</title>
+<text x="10" y="30" font-size="20" fill="navy">
+ <tspan>PASS|LIAF</tspan>
+ <tspan>&#x202E;FAIL|SSAP&#x202C;</tspan>
+ <tspan>PASS|LIAF</tspan>
+</text>
+<text x="10" y="60" font-size="20">Select text above and drag selection to</text>
+<text x="10" y="90" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="120" font-size="20">copies once it's dropped in the box.</text>
+<textArea x="10" y="130" width="480" height="360" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="130" width="480" height="360" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/047.svg b/testing/web-platform/tests/html/editing/dnd/svg/047.svg
new file mode 100644
index 000000000..f8f737c6d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/047.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of RTL SVG text selection from tref element to textArea</title>
+<defs>
+ <text id="text">&#x202E;FAIL|SSAP&#x202C;</text>
+ </defs>
+<text x="10" y="30" font-size="20" fill="navy"><tref xlink:href="#text"/></text>
+<text x="10" y="60" font-size="20">Select text above and drag selection to</text>
+<text x="10" y="90" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="120" font-size="20">copies once it's dropped in the box.</text>
+<textArea x="10" y="130" width="480" height="360" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="130" width="480" height="360" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/048.svg b/testing/web-platform/tests/html/editing/dnd/svg/048.svg
new file mode 100644
index 000000000..fb41bc991
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/048.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of BiDi SVG text selection from tref element to textArea</title>
+<defs>
+ <text id="text">PASS|LIAF &#x202E;FAIL|SSAP&#x202C; PASS|LIAF</text>
+ </defs>
+<text x="10" y="30" font-size="20" fill="navy"><tref xlink:href="#text"/></text>
+<text x="10" y="60" font-size="20">Select text above and drag selection to</text>
+<text x="10" y="90" font-size="20">the box below. Content of selection should be</text>
+<text x="10" y="120" font-size="20">copies once it's dropped in the box.</text>
+<textArea x="10" y="130" width="480" height="360" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="130" width="480" height="360" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/049.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/049.xhtml
new file mode 100644
index 000000000..155f75533
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/049.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selecting text in SVG text element inside draggable container</title>
+</head>
+<body>
+<div draggable="true">
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="200px" height="50px" viewBox="0 0 200 50">
+ <text x="10" y="45" font-size="30" fill="navy" editable="simple">Select me</text>
+ </svg>
+</div>
+<p>You should be able to select text above</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/050.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/050.xhtml
new file mode 100644
index 000000000..56fef670f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/050.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Selecting text in SVG textArea element inside draggable container</title>
+</head>
+<body>
+<div draggable="true">
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="100px" viewBox="0 0 500 100">
+ <textArea x="10" y="10" width="480" height="90" font-size="20" editable="simple">You should be able to select this text</textArea>
+ </svg>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/051.xhtml b/testing/web-platform/tests/html/editing/dnd/svg/051.xhtml
new file mode 100644
index 000000000..2cb656361
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/051.xhtml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop of link from SVG fragment to XHTML</title>
+<style type="text/css">
+div
+ {width:300px;
+ height:100px;
+ margin-top:20px;
+ padding:10px;
+ color:white;
+ background-color:navy;}
+</style>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="200px" height="50px" viewBox="0 0 200 50">
+ <a xlink:href="data:text/plain,PASS">
+ <text x="10" y="45" font-size="30" fill="navy">Drag me</text>
+ </a>
+</svg>
+<p>Drag link to the blue box. You should see word PASS once you drop it there.</p>
+<div dropzone="copy string:text/uri-list" ondrop="document.querySelector('div').appendChild(document.createTextNode(event.dataTransfer.getData('text/uri-list').substring(16)))"/>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/052.svg b/testing/web-platform/tests/html/editing/dnd/svg/052.svg
new file mode 100644
index 000000000..f559b234a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/052.svg
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of text link inside SVG</title>
+<a xlink:href="data:text/plain,PASS">
+ <text x="10" y="50" font-size="30" fill="navy">Drag me</text>
+</a>
+<textArea x="10" y="70" width="480" height="170" font-size="30">Drag link above and drop it in the gray box below. You should see word PASS once you drop it.</textArea>
+<rect x="10" y="300" width="480" height="190" fill="gray"/>
+<script type="application/ecmascript">
+var a = document.querySelector('a'), rect = document.querySelector('rect'), text = document.querySelector('textArea');
+a.addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy'}
+,false);
+rect.addEventListener('dragenter',
+function (event)
+ {event.preventDefault()}
+,false);
+rect.addEventListener('dragover',
+function (event)
+ {event.preventDefault()}
+,false);
+rect.addEventListener('drop',
+function (event)
+ {text.firstChild.nodeValue = event.dataTransfer.getData('text/uri-list').substring(16,20)}
+,false);
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/053.svg b/testing/web-platform/tests/html/editing/dnd/svg/053.svg
new file mode 100644
index 000000000..a116f63a1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/053.svg
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of circle link inside SVG</title>
+<a xlink:href="data:text/plain,PASS">
+ <circle cx="50" cy="50" r="50" fill="green"/>
+</a>
+<textArea x="10" y="100" width="480" height="200" font-size="30">Drag green circle above and drop it in the gray box below. Gray box should turn green once you drop it.</textArea>
+<rect x="10" y="300" width="480" height="190" fill="gray"/>
+<script type="application/ecmascript">
+var a = document.querySelector('a'), rect = document.querySelector('rect');
+a.addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy'}
+,false);
+rect.addEventListener('dragenter',
+function (event)
+ {event.preventDefault()}
+,false);
+rect.addEventListener('dragover',
+function (event)
+ {event.preventDefault()}
+,false);
+rect.addEventListener('drop',
+function (event)
+ {if(event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,PASS')
+ {rect.setAttribute('fill','green');}
+ }
+,false);
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/054.svg b/testing/web-platform/tests/html/editing/dnd/svg/054.svg
new file mode 100644
index 000000000..8029734cd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/054.svg
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of animated circle link inside SVG</title>
+<a xlink:href="data:text/plain,PASS">
+ <circle cx="50" cy="50" r="10" fill="green">
+ <animate attributeName="r" to="50" dur="10s" begin="0s" fill="freeze"/>
+ </circle>
+</a>
+<textArea x="10" y="100" width="480" height="200" font-size="30">
+Drag green circle above and drop it in the gray box below.
+Size of feedback image should match size of circle
+and gray box should turn green.</textArea>
+<rect x="10" y="300" width="480" height="190" fill="gray"/>
+<script type="application/ecmascript">
+var a = document.querySelector('a'), rect = document.querySelector('rect');
+a.addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy'}
+,false);
+rect.addEventListener('dragenter',
+function (event)
+ {event.preventDefault()}
+,false);
+rect.addEventListener('dragover',
+function (event)
+ {event.preventDefault()}
+,false);
+rect.addEventListener('drop',
+function (event)
+ {if(event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,PASS')
+ {rect.setAttribute('fill','green');}
+ }
+,false);
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/055.svg b/testing/web-platform/tests/html/editing/dnd/svg/055.svg
new file mode 100644
index 000000000..d23ca5f90
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/055.svg
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Selection and drag and drop of link inside SVG</title>
+<a xlink:href="data:text/plain,PASS">
+ <rect x="10" y="10" width="80" height="80" fill="green"/>
+</a>
+<textArea x="10" y="100" width="480" height="200" font-size="30">Select part of this text. Once text is selected drag green square above and drop it in the gray box below. Gray box should turn green.</textArea>
+<rect x="10" y="300" width="480" height="190" fill="gray"/>
+<script type="application/ecmascript">
+var a = document.querySelector('a'), rect = document.querySelector('svg > rect');
+a.addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy'}
+,false);
+rect.addEventListener('dragenter',
+function (event)
+ {event.preventDefault()}
+,false);
+rect.addEventListener('dragover',
+function (event)
+ {event.preventDefault()}
+,false);
+rect.addEventListener('drop',
+function (event)
+ {if(event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,PASS')
+ {rect.setAttribute('fill','green');}
+ }
+,false);
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/056.svg b/testing/web-platform/tests/html/editing/dnd/svg/056.svg
new file mode 100644
index 000000000..ff2bab82d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/056.svg
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>dataTransfer.setData/getData during SVG link drag and drop</title>
+<a xlink:href="data:text/plain,PASS">
+ <polygon points="0,0 100,0 0,100" fill="green"/>
+</a>
+<textArea x="10" y="100" width="480" height="200" font-size="15">Drag green triangle above and drop it in the gray box below. Gray box should turn green.</textArea>
+<rect x="10" y="300" width="480" height="190" fill="gray"/>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:text/plain,PASS', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+a = document.querySelector('a'), rect = document.querySelector('rect'), text = document.querySelector('textArea'), result = true;
+a.addEventListener('dragstart',
+ function (event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragstart) : FAIL');}
+ },false);
+a.addEventListener('drag',
+ function (event)
+ {for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during drag)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL')}
+ },false);
+rect.addEventListener('dragenter',
+ function (event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragenter)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragenter) : FAIL')}
+ },false);
+rect.addEventListener('dragover',
+ function (event)
+ {event.preventDefault();
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], 'FAIL');
+ if(event.dataTransfer.getData(dataTypes[i]))
+ {say('getData(' + dataTypes[i] + ') : FAIL (data store should not be readable during dragover)')}
+ }
+ if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (dragover) : FAIL');}
+ },false);
+rect.addEventListener('drop',
+ function (event)
+ {if(event.dataTransfer.items.length < dataTypes.length)
+ {say('items.length (drop) : FAIL');}
+ for(var i = 0; i != dataTypes.length; i++)
+ {if(event.dataTransfer.getData(dataTypes[i]) != data[i])
+ {say('getData(' + dataTypes[i] + ') : FAIL');}
+ }
+ rect.setAttribute('fill',result?'green':'red');
+ },false);
+function say(it)
+ {text.appendChild(document.createTextNode(it + '.'));
+ result = false;}
+]]>
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/057.svg b/testing/web-platform/tests/html/editing/dnd/svg/057.svg
new file mode 100644
index 000000000..709521bea
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/057.svg
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>dataTransfer.items during SVG link drag and drop</title>
+<a xlink:href="data:text/plain,PASS">
+ <polygon points="0,0 100,0 100,100" fill="green"/>
+</a>
+<textArea x="10" y="100" width="480" height="200" font-size="15">Drag green triangle above and drop it in the gray box below. Gray box should turn green.</textArea>
+<rect x="10" y="300" width="480" height="190" fill="gray"/>
+<script type="application/ecmascript">
+<![CDATA[
+var dataTypes = ['text/uri-list', 'text/plain', 'application/xml', 'application/xhtml+xml', 'application/mathml+xml', 'image/svg+xml', 'text/html', 'text/x-example'],
+data = ['data:text/plain,PASS', 'PASS', '<result>PASS</result>', '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Data store item</title></head><body><p>PASS</p></body></html>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>', '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100px" height="50px" viewBox="0 0 100 50"><text x="0" y="40" font-size="40" fill="green">PASS</text></svg>', '<!DOCTYPE html><html><head><title>Data store item</title></head><body><p>PASS</p></body></html>', 'PASS'],
+a = document.querySelector('a'), rect = document.querySelector('rect'), text = document.querySelector('textArea'), e = 0, result = true;
+a.addEventListener('dragstart',
+ function (event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ for(var i = 0; i != dataTypes.length; i++)
+ {event.dataTransfer.setData(dataTypes[i], data[i]);}
+ for(var i = event.dataTransfer.items.length; i != 0; i--)
+ {if(dataTypes.indexOf(event.dataTransfer.items[i-1].type) == -1)
+ {delete event.dataTransfer.items[i-1]}
+ }
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragstart) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragstart): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragstart): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ },false);
+a.addEventListener('drag',
+ function (event)
+ {event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrag) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrag): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrag): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ },false);
+rect.addEventListener('dragenter',
+ function (event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragenter) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragenter): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragenter): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to drag event handler)')}
+ }
+ );
+ }
+ },false);
+rect.addEventListener('dragover',
+ function (event)
+ {event.preventDefault();
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondragover) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondragover): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondragover): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should not reveal data to dragover event handler)')}
+ }
+ );
+ }
+ },false);
+rect.addEventListener('drop',
+ function (event)
+ {e = 0;
+ event.dataTransfer.items.clear();
+ if(event.dataTransfer.items.length != dataTypes.length)
+ {say('items.length (ondrop) : FAIL (items.length should be' + dataTypes.length + ')')}
+ for(var i = 0; i != event.dataTransfer.items.length; i++)
+ {delete event.dataTransfer.items[i];
+ if(event.dataTransfer.items[i].kind != 'string')
+ {say('Item kind (ondrop): FAIL (items[' + i + '].kind should be string)')}
+ if(event.dataTransfer.items[i].type != dataTypes[i])
+ {say('Item type (ondrop): FAIL (items[' + i + '].type should be' + dataTypes[i] + ')')}
+ event.dataTransfer.items[i].getAsString(
+ function ()
+ {if(arguments[0] != data[e++])
+ {say('getAsString : FAIL (items[' + i + '].getAsString should pass' + data[e] + ')')}
+ }
+ );
+ }
+ rect.setAttribute('fill',result?'green':'red');
+ },false);
+function say(it)
+ {text.appendChild(document.createTextNode(it + '.'));
+ result = false;}
+]]>
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/058.svg b/testing/web-platform/tests/html/editing/dnd/svg/058.svg
new file mode 100644
index 000000000..f27626f66
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/058.svg
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>SVG link drag and drop: allowed effects 'copy','move','link' and 'none'</title>
+<a xlink:href="data:text/plain,1">
+ <circle cx="50" cy="50" r="40" fill="green"/>
+</a>
+<textArea x="10" y="100" width="480" height="200" font-size="30">You should be able to drag green circle and drop it onto any of the boxes below. Choosen box should turn green once circle is dropped on it.</textArea>
+<rect x="10" y="300" width="100" height="100" fill="silver"/>
+<rect x="120" y="300" width="100" height="100" fill="gray"/>
+<rect x="230" y="300" width="100" height="100" fill="gray"/>
+<rect x="340" y="300" width="100" height="100" fill="black"/>
+<script type="application/ecmascript">
+var a = document.querySelector('a'), rect = document.querySelectorAll('rect'),
+effects = ['copy','move','link','all'], e = 0;
+a.addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = effects[e]}
+,false);
+for(var i = 0; i != rect.length; i++)
+ {rect[i].addEventListener('dragenter',
+ function (event)
+ {event.preventDefault();
+ event.dataTransfer.effectAllowed = effects[e];}
+ ,false);
+ rect[i].addEventListener('dragover',
+ function (event)
+ {event.preventDefault()}
+ ,false);
+ rect[i].addEventListener('drop',
+ function (event)
+ {if(event.dataTransfer.dropEffect == effects[e] &amp;&amp; event.dataTransfer.effectAllowed == effects[e] &amp;&amp; i != 3)
+ {event.target.setAttribute('fill','green');}
+ e = (e+1)%3;}
+ ,false);}
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/059-1.svg b/testing/web-platform/tests/html/editing/dnd/svg/059-1.svg
new file mode 100644
index 000000000..634620a2f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/059-1.svg
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>SVG link drag and drop: helper file</title>
+<textArea x="10" y="10" width="480" height="200" font-size="30">Drop circle onto gray box below. Box should turn green once circle is dropped.</textArea>
+<rect x="10" y="220" width="480" height="270" fill="gray"/>
+<script type="application/ecmascript">
+var rect = document.querySelector('rect');
+rect.addEventListener('dragenter',
+function (event)
+ {event.preventDefault();}
+,false);
+rect.addEventListener('dragover',
+function (event)
+ {event.preventDefault();}
+,false);
+rect.addEventListener('drop',
+function (event)
+ {rect.setAttribute('fill',(event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'green':'red');}
+,false);
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/059.svg b/testing/web-platform/tests/html/editing/dnd/svg/059.svg
new file mode 100644
index 000000000..a289804e6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/059.svg
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>SVG link cross page drag and drop</title>
+<a xlink:href="data:text/plain,1">
+ <circle cx="50" cy="50" r="40" fill="green"/>
+</a>
+<textArea x="10" y="100" width="480" height="200" font-size="30">Drag circle above. You should be redirected to the new page and be able to drop it there.</textArea>
+<script type="application/ecmascript">
+document.querySelector('a').addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ window.location = '059-1.svg'}
+,false);
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/060-1.svg b/testing/web-platform/tests/html/editing/dnd/svg/060-1.svg
new file mode 100644
index 000000000..b78e04b21
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/060-1.svg
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>SVG link drag and drop: helper file</title>
+<textArea x="10" y="10" width="480" height="200" font-size="30">Drag circle over arrow below but don't drop it yet. You should be returned back to start page.</textArea>
+<polygon points="10,400 100,300 100,350 480,350 480,450 100,450 100,500 10,400" fill="navy"/>
+<script type="application/ecmascript">
+document.querySelector('polygon').addEventListener('dragenter',
+function (event)
+ {window.location = '060.svg'}
+,false);
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/060.svg b/testing/web-platform/tests/html/editing/dnd/svg/060.svg
new file mode 100644
index 000000000..da3efcc49
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/060.svg
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>SVG link drag and drop and history navigation roundtrip</title>
+<a xlink:href="data:text/plain,1">
+ <circle cx="50" cy="50" r="40" fill="green"/>
+</a>
+<textArea x="10" y="100" width="480" height="200" font-size="30">Drag circle above. You will be redirected to new page. When you return back drop circle on itself. You should see word PASS once you drop it.</textArea>
+<script type="application/ecmascript">
+var a = document.querySelector('a');
+a.addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ window.location = '060-1.svg'}
+,false);
+a.addEventListener('dragenter',
+function (event)
+ {event.preventDefault();}
+,false);
+a.addEventListener('dragover',
+function (event)
+ {event.preventDefault();}
+,false);
+a.addEventListener('drop',
+function (event)
+ {document.querySelector('textArea').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL';}
+,false);
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/061.svg b/testing/web-platform/tests/html/editing/dnd/svg/061.svg
new file mode 100644
index 000000000..17f873435
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/061.svg
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>SVG link drag and drop roundtrip</title>
+<a xlink:href="data:text/plain,1">
+ <circle cx="50" cy="50" r="40" fill="green"/>
+</a>
+<textArea x="10" y="100" width="480" height="200" font-size="30">Drag circle outside browser window and then drag it back and drop on itself. You should see word PASS once you drop it.</textArea>
+<script type="application/ecmascript">
+var a = document.querySelector('a');
+a.addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy';}
+,false);
+a.addEventListener('dragenter',
+function (event)
+ {event.preventDefault();}
+,false);
+a.addEventListener('dragover',
+function (event)
+ {event.preventDefault();}
+,false);
+a.addEventListener('drop',
+function (event)
+ {document.querySelector('textArea').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL';}
+,false);
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/062.svg b/testing/web-platform/tests/html/editing/dnd/svg/062.svg
new file mode 100644
index 000000000..0bc8477e5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/062.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Setting drag image during drag and drop of SVG link</title>
+<a xlink:href="data:text/plain,1">
+ <circle cx="60" cy="60" r="50" fill="gray"/>
+</a>
+<textArea x="10" y="200" width="480" height="200" font-size="30">Try to drag circle. Drag feedback should look like green rectangle.</textArea>
+<rect x="300" y="10" width="100" height="100" fill="green"/>
+<script type="application/ecmascript">
+var a = document.querySelector('a'), rect = document.querySelector('rect');
+a.addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelector('rect'), 50, 50);}
+,false);
+</script>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/063.svg b/testing/web-platform/tests/html/editing/dnd/svg/063.svg
new file mode 100644
index 000000000..eda15495f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/063.svg
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Adding element to datastore while dragging SVG links</title>
+<a xlink:href="data:text/plain,1">
+ <rect x="10" y="10" width="100" height="100" fill="green"/>
+</a>
+<a xlink:href="data:text/plain,2">
+ <rect x="300" y="10" width="100" height="100" fill="teal"/>
+</a>
+<textArea x="10" y="200" width="480" height="200" font-size="30">Try to drag one of boxes above. Drag feedback should include both boxes.</textArea>
+<script type="application/ecmascript">
+var a = document.querySelectorAll('a');
+a[0].addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelectorAll('rect')[1]);}
+,false);
+a[1].addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.addElement(document.querySelectorAll('rect')[0]);}
+,false);
+</script>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/064.svg b/testing/web-platform/tests/html/editing/dnd/svg/064.svg
new file mode 100644
index 000000000..913732360
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/064.svg
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of overlapping SVG links</title>
+<a xlink:href="data:text/plain,1">
+ <rect x="10" y="10" width="100" height="100" fill="silver"/>
+</a>
+<a xlink:href="data:text/plain,2">
+ <rect x="10" y="10" width="100" height="100" fill="gray"/>
+</a>
+ <rect x="160" y="10" width="100" height="100" fill="green"/>
+ <rect x="310" y="10" width="100" height="100" fill="maroon"/>
+<textArea x="10" y="200" width="480" height="200" font-size="30">Try to drag gray boxe above. Drag feedback should be green, not red.</textArea>
+<script type="application/ecmascript">
+var a = document.querySelectorAll('a');
+a[0].addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelectorAll('rect')[3], 50, 50);}
+,false);
+a[1].addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setDragImage(document.querySelectorAll('rect')[2], 50, 50);}
+,false);
+</script>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/065.svg b/testing/web-platform/tests/html/editing/dnd/svg/065.svg
new file mode 100644
index 000000000..38cb9560d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/065.svg
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Reload during SVG link drag and drop roundtrip</title>
+<a xlink:href="data:text/plain,1">
+ <circle cx="50" cy="50" r="40" fill="green"/>
+</a>
+<textArea x="10" y="100" width="480" height="200" font-size="30">Drag circle around page and then drag it back and drop on itself. You should see word PASS once you drop it.</textArea>
+<script type="application/ecmascript">
+var a = document.querySelector('a');
+a.addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ window.location.reload()}
+,false);
+a.addEventListener('dragenter',
+function (event)
+ {event.preventDefault();}
+,false);
+a.addEventListener('dragover',
+function (event)
+ {event.preventDefault();}
+,false);
+a.addEventListener('drop',
+function (event)
+ {document.querySelector('textArea').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL';}
+,false);
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/066.svg b/testing/web-platform/tests/html/editing/dnd/svg/066.svg
new file mode 100644
index 000000000..1020ec82c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/066.svg
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Removing dragged element during drag and drop of SVG link</title>
+<a xlink:href="data:text/plain,1">
+ <circle cx="50" cy="50" r="50" fill="green"/>
+</a>
+<textArea x="10" y="100" width="480" height="200" font-size="30">Drag green circle above and drop it in the gray box below. Gray box should turn green once you drop it.</textArea>
+<rect x="10" y="300" width="480" height="190" fill="gray"/>
+<script type="application/ecmascript">
+var a = document.querySelector('a'), rect = document.querySelector('rect');
+a.addEventListener('dragstart',
+function (event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ document.documentElement.removeChild(a);}
+,false);
+rect.addEventListener('dragenter',
+function (event)
+ {event.preventDefault()}
+,false);
+rect.addEventListener('dragover',
+function (event)
+ {event.preventDefault()}
+,false);
+rect.addEventListener('drop',
+function (event)
+ {if(event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')
+ {rect.setAttribute('fill','green');}
+ }
+,false);
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/067.svg b/testing/web-platform/tests/html/editing/dnd/svg/067.svg
new file mode 100644
index 000000000..ba1e5011f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/067.svg
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
+<title>Drag and drop of SVG links</title>
+<a xlink:href="data:text/plain,olive">
+ <circle cx="50" cy="50" r="50" fill="olive"/>
+</a>
+<a xlink:href="data:text/plain,green">
+ <circle cx="200" cy="50" r="50" fill="green"/>
+</a>
+<a xlink:href="data:text/plain,teal">
+ <circle cx="350" cy="50" r="50" fill="teal"/>
+</a>
+<textArea x="10" y="120" width="480" height="200" font-size="30">Drag one of green circles above and drop it in the gray box below. Gray box should turn green.</textArea>
+<rect x="10" y="300" width="480" height="190" fill="gray"/>
+<script type="application/ecmascript">
+var a = document.querySelectorAll('a'), rect = document.querySelector('rect');
+for(var i = 0; i != a.length; i++)
+ {a[i].addEventListener('dragstart',
+ function (event)
+ {event.dataTransfer.effectAllowed = 'copy';}
+ ,false);}
+rect.addEventListener('dragenter',
+function (event)
+ {event.preventDefault()}
+,false);
+rect.addEventListener('dragover',
+function (event)
+ {event.preventDefault()}
+,false);
+rect.addEventListener('drop',
+function (event)
+ {rect.setAttribute('fill',event.dataTransfer.getData('text/uri-list').substr(16).replace(/\r\n$/,''));}
+,false);
+</script>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/dnd/svg/helper-drop-selection-here-textArea.svg b/testing/web-platform/tests/html/editing/dnd/svg/helper-drop-selection-here-textArea.svg
new file mode 100644
index 000000000..783c164eb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/svg/helper-drop-selection-here-textArea.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" width="500px" height="300px" viewBox="0 0 500 300">
+<textArea x="10" y="10" width="480" height="280" font-size="20" editable="simple" pointer-events="boundingBox">Drop selection here</textArea>
+<rect x="10" y="10" width="480" height="280" stroke="black" stroke-width="1" fill="none"/>
+</svg> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/synthetic/001.html b/testing/web-platform/tests/html/editing/dnd/synthetic/001.html
new file mode 100644
index 000000000..bcc38e0e7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/synthetic/001.html
@@ -0,0 +1,120 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Synthetic drag events</title>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript" src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script type="text/javascript">
+test(function() {
+ assert_own_property(window,'DragEvent');
+}, 'window.DragEvent should be exposed' );
+test(function() {
+ assert_throws('NOT_SUPPORTED_ERR', function() {
+ var evt = document.createEvent('DragEvent');
+ });
+}, 'createEvent should not be able to create a DragEvent' );
+test(function() {
+ var evt = new DragEvent('dragstart');
+ assert_false( !!evt.initDragEvent, 'initDragEvent' );
+ assert_true( !!evt.initMouseEvent, 'initMouseEvent' );
+ assert_true( !!evt.initUIEvent, 'initUIEvent' );
+ assert_true( !!evt.initEvent, 'initEvent' );
+}, 'DragEvent should have all of the inherited init*Event methods' );
+
+//cannot test non-synthetic dataTransfer objects as the param here because that needs a real DragEvent to create a proper one with global storage
+//will be tested in another file
+test(function() {
+ var evt = new DragEvent('dragstart');
+ evt.initMouseEvent('dragstart', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 1, document.body);
+}, 'initMouseEvent should not throw' );
+test(function() {
+ var evt = new DragEvent('dragstart');
+ evt.initUIEvent('dragstart', true, true, window, 1);
+}, 'initUIEvent should not throw' );
+test(function() {
+ var evt = new DragEvent('dragstart');
+ evt.initEvent('dragstart', true, true);
+}, 'initEvent should not throw' );
+
+test(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:null}), div = document.createElement('div'), ranlistener = false;
+ div.ondragstart = function () { ranlistener = true; };
+ div.dispatchEvent(evt);
+ assert_true(ranlistener);
+}, 'DragEvent constructor with null as the dataTransfer parameter should be able to fire the event' );
+test(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:undefined}), div = document.createElement('div'), ranlistener = false;
+ div.ondragstart = function () { ranlistener = true; };
+ div.dispatchEvent(evt);
+ assert_true(ranlistener);
+}, 'DragEvent constructor with undefined as the dataTransfer parameter should be able to fire the event' );
+test(function() {
+ assert_throws(new TypeError(), function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:{}});
+ });
+}, 'DragEvent constructor with custom object as the dataTransfer parameter should throw TypeError' );
+test(function() {
+ var evt = new DragEvent('dragstart'), div = document.createElement('div'), ranlistener = false;
+ div.ondragstart = function () { ranlistener = true; };
+ evt.initMouseEvent('dragstart', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 1, document.body);
+ div.dispatchEvent(evt);
+ assert_true(ranlistener);
+}, 'initMouseEvent should be able to fire the event' );
+test(function() {
+ var evt = new DragEvent('dragstart'), div = document.createElement('div'), ranlistener = false;
+ div.ondragstart = function () { ranlistener = true; };
+ evt.initUIEvent('dragstart', true, true, window, 1);
+ div.dispatchEvent(evt);
+ assert_true(ranlistener);
+}, 'initUIEvent should be able to fire the event' );
+test(function() {
+ var evt = new DragEvent('dragstart'), div = document.createElement('div'), ranlistener = false;
+ div.ondragstart = function () { ranlistener = true; };
+ evt.initEvent('dragstart', true, true);
+ div.dispatchEvent(evt);
+ assert_true(ranlistener);
+}, 'initEvent should be able to fire the event' );
+
+test(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:null}), div = document.createElement('div'), dTrans = 'fail';
+ div.ondragstart = function (e) { dTrans = e.dataTransfer };
+ div.dispatchEvent(evt);
+ assert_equals(dTrans,null);
+}, 'DragEvent constructor with null as the dataTransfer parameter should give null as the dataTransfer' );
+test(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:undefined}), div = document.createElement('div'), dTrans = 'fail';
+ div.ondragstart = function (e) { dTrans = e.dataTransfer };
+ div.dispatchEvent(evt);
+ assert_equals(dTrans,null);
+}, 'DragEvent constructor with undefined as the dataTransfer parameter should give null as the dataTransfer' );
+test(function() {
+ var evt = new DragEvent('dragstart'), div = document.createElement('div'), dTrans = 'fail';
+ div.ondragstart = function (e) { dTrans = e.dataTransfer };
+ evt.initMouseEvent('dragstart', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 1, document.body);
+ div.dispatchEvent(evt);
+ assert_equals(dTrans,null);
+}, 'initMouseEvent should give null as the dataTransfer' );
+test(function() {
+ var evt = new DragEvent('dragstart'), div = document.createElement('div'), dTrans = 'fail';
+ div.ondragstart = function (e) { dTrans = e.dataTransfer };
+ evt.initUIEvent('dragstart', true, true, window, 1);
+ div.dispatchEvent(evt);
+ assert_equals(dTrans,null);
+}, 'initUIEvent should give null as the dataTransfer' );
+test(function() {
+ var evt = new DragEvent('dragstart'), div = document.createElement('div'), dTrans = 'fail';
+ div.ondragstart = function (e) { dTrans = e.dataTransfer };
+ evt.initEvent('dragstart', true, true);
+ div.dispatchEvent(evt);
+ assert_equals(dTrans,null);
+}, 'initEvent should give null as the dataTransfer' );
+
+//cannot test that synthetic event does not use the same data store as non-synthetic event because that needs a real DragEvent to create a proper one with global storage
+//will be tested in another file
+ </script>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/synthetic/005-manual.html b/testing/web-platform/tests/html/editing/dnd/synthetic/005-manual.html
new file mode 100644
index 000000000..0089b784b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/synthetic/005-manual.html
@@ -0,0 +1,339 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Synthetic events with real data store must inherit protection status from real events</title>
+ <style type="text/css">
+blockquote { height: 100px; width: 100px; background: orange; margin: 0; padding: 0; float: left; }
+blockquote + blockquote { background: blue; }
+blockquote + blockquote + blockquote { background: fuchsia; }
+blockquote + div { clear: left; }
+ </style>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript">
+setup(function () {},{explicit_done:true,explicit_timeout:true});
+window.onload = function () {
+
+ var orange = document.getElementsByTagName('blockquote')[0],
+ blue = document.getElementsByTagName('blockquote')[1],
+ fuchsia = document.getElementsByTagName('blockquote')[2],
+ evtdone = {};
+
+ orange.ondragstart = function (e) {
+ evtdone[e.type] = true;
+ e.dataTransfer.effectAllowed = 'copy';
+
+ var t = async_test(e.type+' should share its data with the synthetic event');
+ blue.ondragstart = function (e) {
+ t.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart real data', 'step 1' );
+ e.dataTransfer.setData('text','dragstart-dragstart synthetic data');
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart-dragstart synthetic data', 'step 2' );
+ });
+ };
+ t.step(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:e.dataTransfer});
+ e.dataTransfer.setData('text','dragstart real data'); //changing in between steps, just to make sure it uses the underlying data store, not a temporary clone
+ blue.dispatchEvent(evt);
+ });
+ t.done();
+
+ test(function() {
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart-dragstart synthetic data' );
+ }, e.type+' should see the data from the synthetic event' );
+
+ var t2 = async_test(e.type+' should share its protection status with the synthetic event');
+ blue.ondrag = function (e) {
+ t2.step(function() {
+ e.dataTransfer.setData('text','dragstart-drag synthetic data');
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart-drag synthetic data' );
+ });
+ };
+ t2.step(function() {
+ var evt = new DragEvent('drag', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t2.done();
+
+ var t3 = async_test(e.type+' should share its protection status with the nested synthetic event');
+ blue.ondrag = function (e) {
+ blue.ondragend = function (e) {
+ t3.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart-drag synthetic data', 'step1' );
+ e.dataTransfer.setData('text','dragstart-drag-dragend synthetic data');
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart-drag-dragend synthetic data', 'step2' );
+ });
+ };
+ t3.step(function() {
+ var evt = new DragEvent('dragend', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ };
+ t3.step(function() {
+ var evt = new DragEvent('drag', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t3.done();
+
+ test(function() {
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart-drag-dragend synthetic data' );
+ }, e.type+' should see the data from the nested synthetic event' );
+ };
+
+ blue.ondragenter = blue.ondragover = function (e) {
+ e.preventDefault();
+ };
+ orange.ondrag = blue.ondragleave = function (e) {
+ if( evtdone[e.type] ) { return; }
+ evtdone[e.type] = true;
+ var evtype = e.type;
+
+ var t = async_test(e.type+' should share its data with the synthetic event');
+ blue.ondragstart = function (e) {
+ t.step(function() {
+ assert_true( e.dataTransfer.items.length > 0, 'items.length' );
+ });
+ };
+ t.step(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t.done();
+
+ var t2 = async_test(e.type+' should share its protection status with the synthetic event');
+ blue.ondragstart = function (e) {
+ t2.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), '', 'step 1' );
+ e.dataTransfer.setData('text',evtype+'-dragstart synthetic data');
+ assert_equals( e.dataTransfer.getData('text'), '', 'step 2' );
+ });
+ };
+ t2.step(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t2.done();
+
+ test(function() {
+ assert_equals( e.dataTransfer.getData('text'), '' );
+ }, e.type+' protection status should not be modified by the synthetic event' );
+
+ var t3 = async_test(e.type+' should share its protection status with the nested synthetic event');
+ blue.ondragstart = function (e) {
+ var div = document.createElement('div');
+ div.ondragstart = function (e) {
+ t3.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), '', 'step1' );
+ e.dataTransfer.setData('text',evtype+'dragstart-dragstart synthetic data');
+ assert_equals( e.dataTransfer.getData('text'), '', 'step2' );
+ });
+ };
+ t3.step(function() {
+ var evt = new DragEvent('dragend', {dataTransfer:e.dataTransfer});
+ div.dispatchEvent(evt);
+ });
+ };
+ t3.step(function() {
+ var evt = new DragEvent('drag', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t3.done();
+ };
+
+ fuchsia.ondragenter = fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ if( evtdone[e.type] ) { return; }
+ evtdone[e.type] = true;
+ var evtype = e.type;
+
+ var t = async_test(e.type+' should share its data with the synthetic event');
+ blue.ondragstart = function (e) {
+ t.step(function() {
+ assert_true( e.dataTransfer.items.length > 0, 'items.length' );
+ });
+ };
+ t.step(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t.done();
+
+ var t2 = async_test(e.type+' should share its protection status with the synthetic event');
+ blue.ondragstart = function (e) {
+ t2.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), '', 'step 1' );
+ e.dataTransfer.setData('text',evtype+'-dragstart synthetic data');
+ assert_equals( e.dataTransfer.getData('text'), '', 'step 2' );
+ });
+ };
+ t2.step(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t2.done();
+
+ test(function() {
+ assert_equals( e.dataTransfer.getData('text'), '' );
+ }, e.type+' protection status should not be modified by the synthetic event' );
+
+ var t3 = async_test(e.type+' should share its protection status with the nested synthetic event');
+ blue.ondragstart = function (e) {
+ var div = document.createElement('div');
+ div.ondragstart = function (e) {
+ t3.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), '', 'step1' );
+ e.dataTransfer.setData('text',evtype+'dragstart-dragstart synthetic data');
+ assert_equals( e.dataTransfer.getData('text'), '', 'step2' );
+ });
+ };
+ t3.step(function() {
+ var evt = new DragEvent('dragend', {dataTransfer:e.dataTransfer});
+ div.dispatchEvent(evt);
+ });
+ };
+ t3.step(function() {
+ var evt = new DragEvent('drag', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t3.done();
+ };
+
+ fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ if( evtdone[e.type] ) { return; }
+ evtdone[e.type] = true;
+ var evtype = e.type;
+
+ var t = async_test(e.type+' should share its data with the synthetic event');
+ blue.ondragstart = function (e) {
+ t.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart-drag-dragend synthetic data' );
+ });
+ };
+ t.step(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t.done();
+
+ var t2 = async_test(e.type+' should share its protection status with the synthetic event');
+ blue.ondragstart = function (e) {
+ t2.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart-drag-dragend synthetic data', 'step 1' );
+ e.dataTransfer.setData('text',evtype+'-dragstart synthetic data');
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart-drag-dragend synthetic data', 'step 2' );
+ });
+ };
+ t2.step(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t2.done();
+
+ test(function() {
+ e.dataTransfer.setData('text','drop synthetic data');
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart-drag-dragend synthetic data' );
+ }, e.type+' protection status should not be modified by the synthetic event' );
+
+ var t3 = async_test(e.type+' should share its protection status with the nested synthetic event');
+ blue.ondragstart = function (e) {
+ var div = document.createElement('div');
+ div.ondragstart = function (e) {
+ t3.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart-drag-dragend synthetic data', 'step 1' );
+ e.dataTransfer.setData('text',evtype+'dragstart-dragstart synthetic data');
+ assert_equals( e.dataTransfer.getData('text'), 'dragstart-drag-dragend synthetic data', 'step 2' );
+ });
+ };
+ t3.step(function() {
+ var evt = new DragEvent('dragend', {dataTransfer:e.dataTransfer});
+ div.dispatchEvent(evt);
+ });
+ };
+ t3.step(function() {
+ var evt = new DragEvent('drag', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t3.done();
+ };
+
+ orange.ondragend = function (e) {
+ if( evtdone[e.type] ) { return; }
+ evtdone[e.type] = true;
+ var evtype = e.type;
+
+ var t = async_test(e.type+' should share its data with the synthetic event');
+ blue.ondragstart = function (e) {
+ t.step(function() {
+ assert_true( e.dataTransfer.items.length > 0, 'items.length' );
+ });
+ };
+ t.step(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t.done();
+
+ var t2 = async_test(e.type+' should share its protection status with the synthetic event');
+ blue.ondragstart = function (e) {
+ t2.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), '', 'step 1' );
+ e.dataTransfer.setData('text',evtype+'-dragstart synthetic data');
+ assert_equals( e.dataTransfer.getData('text'), '', 'step 2' );
+ });
+ };
+ t2.step(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t2.done();
+
+ test(function() {
+ assert_equals( e.dataTransfer.getData('text'), '' );
+ }, e.type+' protection status should not be modified by the synthetic event' );
+
+ var t3 = async_test(e.type+' should share its protection status with the nested synthetic event');
+ blue.ondragstart = function (e) {
+ var div = document.createElement('div');
+ div.ondragstart = function (e) {
+ t3.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), '', 'step1' );
+ e.dataTransfer.setData('text',evtype+'dragstart-dragstart synthetic data');
+ assert_equals( e.dataTransfer.getData('text'), '', 'step2' );
+ });
+ };
+ t3.step(function() {
+ var evt = new DragEvent('dragend', {dataTransfer:e.dataTransfer});
+ div.dispatchEvent(evt);
+ });
+ };
+ t3.step(function() {
+ var evt = new DragEvent('drag', {dataTransfer:e.dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t3.done();
+
+ test(function() {
+ var failtxt = '- Reload and try again';
+ assert_true( evtdone.dragstart, 'dragstart event was not tested'+failtxt );
+ assert_true( evtdone.drag, 'drag event was not tested'+failtxt );
+ assert_true( evtdone.dragenter, 'dragenter event was not tested'+failtxt );
+ assert_true( evtdone.dragleave, 'dragleave event was not tested'+failtxt );
+ assert_true( evtdone.dragover, 'dragover event was not tested'+failtxt );
+ assert_true( evtdone.drop, 'drop event was not tested'+failtxt );
+ assert_true( evtdone.dragend, 'dragend event was not tested'+failtxt );
+ }, 'all event types must now have been tested' );
+ done();
+ };
+
+};
+ </script>
+ </head>
+ <body>
+ <p>Drag the orange square over the blue square then the fuchsia square, then release it.</p>
+ <blockquote draggable="true"></blockquote>
+ <blockquote></blockquote>
+ <blockquote></blockquote>
+ <div id="log"></div>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/synthetic/006-manual.html b/testing/web-platform/tests/html/editing/dnd/synthetic/006-manual.html
new file mode 100644
index 000000000..b03ec431b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/synthetic/006-manual.html
@@ -0,0 +1,78 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Synthetic events using real dataTransfer in new thread</title>
+ <style type="text/css">
+blockquote { height: 100px; width: 100px; background: orange; margin: 0; padding: 0; float: left; }
+blockquote + blockquote { background: blue; }
+blockquote + blockquote + blockquote { background: fuchsia; }
+blockquote + div { clear: left; }
+ </style>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript">
+setup(function () {},{explicit_done:true,explicit_timeout:true});
+window.onload = function () {
+
+ var orange = document.getElementsByTagName('blockquote')[0],
+ blue = document.getElementsByTagName('blockquote')[1],
+ fuchsia = document.getElementsByTagName('blockquote')[2],
+ evtdone = {};
+
+ orange.ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dragstart real data');
+ var dataTransfer = e.dataTransfer;
+ setTimeout(function () {
+ var t = async_test('new thread should see data store in protected mode after dragstart');
+ blue.ondragstart = function (e) {
+ t.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), '', 'step 1' );
+ e.dataTransfer.setData('text','new thread after dragstart');
+ assert_equals( e.dataTransfer.getData('text'), '', 'step 2' );
+ });
+ };
+ t.step(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t.done();
+ },0);
+ };
+
+ fuchsia.ondragenter = fuchsia.ondragover = function (e) {
+ e.preventDefault();
+ };
+
+ fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ var dataTransfer = e.dataTransfer;
+ setTimeout(function () {
+ var t = async_test('new thread should see data store in protected mode after drop');
+ blue.ondragstart = function (e) {
+ t.step(function() {
+ assert_equals( e.dataTransfer.getData('text'), '', 'step 1' );
+ e.dataTransfer.setData('text','new thread after dragstart');
+ assert_equals( e.dataTransfer.getData('text'), '', 'step 2' );
+ });
+ };
+ t.step(function() {
+ var evt = new DragEvent('dragstart', {dataTransfer:dataTransfer});
+ blue.dispatchEvent(evt);
+ });
+ t.done();
+ done();
+ },0);
+ };
+
+};
+ </script>
+ </head>
+ <body>
+ <p>Drag the orange square over the blue square then the fuchsia square, then release it.</p>
+ <blockquote draggable="true"></blockquote>
+ <blockquote></blockquote>
+ <blockquote></blockquote>
+ <div id="log"></div>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/001-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/001-manual.html
new file mode 100644
index 000000000..f64e1c4e0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/001-manual.html
@@ -0,0 +1,110 @@
+<!doctype html>
+<html>
+ <head>
+ <title>allowTargetOrigin syntax</title>
+ <style type="text/css">
+blockquote { height: 100px; width: 100px; background: orange; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript">
+setup(function () {},{explicit_done:true});
+window.onload = function () {
+ document.getElementsByTagName('blockquote')[0].ondragstart = function (e) {
+ test(function() {
+ assert_true( !!e.dataTransfer.allowTargetOrigin );
+ }, 'allowTargetOrigin should be supported' );
+ test(function() {
+ assert_throws( new TypeError(), function () { e.dataTransfer.allowTargetOrigin(); } );
+ }, 'no parameter should throw TypeError' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin(''); } );
+ }, 'empty string should be an invalid URL' );
+ test(function() {
+ e.dataTransfer.allowTargetOrigin('*');
+ }, '* should be a valid URL' );
+ test(function() {
+ e.dataTransfer.allowTargetOrigin('/');
+ }, '/ should be a valid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('/foo'); } );
+ }, '/foo should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('foo'); } );
+ }, 'foo should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('//foo'); } );
+ }, '//foo should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('http://'); } );
+ }, 'http:// should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('http://*'); } );
+ }, 'http://* should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('http://foo*'); } );
+ }, 'http://foo* should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('http://foo.*'); } );
+ }, 'http://foo.* should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('http://*.foo'); } );
+ }, 'http://*.foo should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('http://foo:bar'); } );
+ }, 'http://foo:bar should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('http://foo:bar@'); } );
+ }, 'http://foo:bar@ should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('file:'); } );
+ }, 'file: should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('file://'); } );
+ }, 'file:// should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('data:'); } );
+ }, 'data: should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('data:text/html'); } );
+ }, 'data:text/html should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('file://localhost/'); } );
+ }, 'file://localhost/ should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('file:///'); } );
+ }, 'file:/// should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('data:text/html,'); } );
+ }, 'data:text/html, should be an invalid URL' );
+ test(function() {
+ assert_throws( 'SYNTAX_ERR', function () { e.dataTransfer.allowTargetOrigin('javascript:'); } );
+ }, 'javascript: should be an invalid URL' );
+ test(function() {
+ e.dataTransfer.allowTargetOrigin('http://foo');
+ }, 'http://foo should be a valid URL' );
+ test(function() {
+ e.dataTransfer.allowTargetOrigin('http://foo.bar');
+ }, 'http://foo.bar should be a valid URL' );
+ test(function() {
+ e.dataTransfer.allowTargetOrigin('http://foo/bar');
+ }, 'http://foo/bar should be a valid URL' );
+ test(function() {
+ e.dataTransfer.allowTargetOrigin('http://foo:123');
+ }, 'http://foo:123 should be a valid URL' );
+ test(function() {
+ e.dataTransfer.allowTargetOrigin('http://foo:bar@baz');
+ }, 'http://foo:bar@baz should be a valid URL' );
+ test(function() {
+ e.dataTransfer.allowTargetOrigin('http://foo:bar@baz:123/qux');
+ }, 'http://foo:bar@baz:123/qux should be a valid URL' );
+ done();
+ };
+};
+ </script>
+ </head>
+ <body>
+ <blockquote draggable="true"></blockquote>
+ <div id="log">Drag the orange square above until the drag placeholder appears, then release it.</div>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/002-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/002-manual.html
new file mode 100644
index 000000000..db46c6797
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/002-manual.html
@@ -0,0 +1,86 @@
+<!doctype html>
+<html>
+ <head>
+ <title>allowTargetOrigin events</title>
+ <style type="text/css">
+blockquote { height: 100px; width: 100px; background: orange; margin: 0; padding: 0; float: left; }
+blockquote + blockquote { background: blue; }
+blockquote + blockquote + blockquote { background: fuchsia; }
+blockquote + div { clear: left; }
+ </style>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript">
+setup(function () {},{explicit_done:true});
+window.onload = function () {
+ var orange = document.getElementsByTagName('blockquote')[0],
+ blue = document.getElementsByTagName('blockquote')[1],
+ fuchsia = document.getElementsByTagName('blockquote')[2],
+ evtdone = {};
+ orange.ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ if( evtdone[e.type] ) { return; }
+ evtdone[e.type] = true;
+ test(function() {
+ assert_true( !!e.dataTransfer.allowTargetOrigin );
+ }, 'allowTargetOrigin should exist in '+e.type );
+ test(function() {
+ e.dataTransfer.allowTargetOrigin('*');
+ }, 'allowTargetOrigin should work in '+e.type );
+ };
+ blue.ondragenter = blue.ondragover = function (e) {
+ e.preventDefault();
+ };
+ orange.ondrag = blue.ondragleave = function (e) {
+ if( evtdone[e.type] ) { return; }
+ evtdone[e.type] = true;
+ test(function() {
+ assert_true( !!e.dataTransfer.allowTargetOrigin );
+ }, 'allowTargetOrigin should exist in '+e.type );
+ test(function() {
+ assert_throws( 'SECURITY_ERR', function () { e.dataTransfer.allowTargetOrigin('*'); } );
+ }, 'allowTargetOrigin should throw a SECURITY_ERR in '+e.type );
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ if( evtdone[e.type] ) { return; }
+ evtdone[e.type] = true;
+ test(function() {
+ assert_true( !!e.dataTransfer.allowTargetOrigin );
+ }, 'allowTargetOrigin should exist in '+e.type );
+ test(function() {
+ assert_throws( 'SECURITY_ERR', function () { e.dataTransfer.allowTargetOrigin('*'); } );
+ }, 'allowTargetOrigin should throw a SECURITY_ERR in '+e.type );
+ };
+ orange.ondragend = function (e) {
+ if( evtdone[e.type] ) { return; }
+ evtdone[e.type] = true;
+ test(function() {
+ assert_true( !!e.dataTransfer.allowTargetOrigin );
+ }, 'allowTargetOrigin should exist in '+e.type );
+ test(function() {
+ assert_throws( 'SECURITY_ERR', function () { e.dataTransfer.allowTargetOrigin('*'); } );
+ }, 'allowTargetOrigin should throw a SECURITY_ERR in '+e.type );
+ test(function() {
+ var failtxt = '- Reload and try again';
+ assert_true( evtdone.dragstart, 'dragstart event was not tested'+failtxt );
+ assert_true( evtdone.drag, 'drag event was not tested'+failtxt );
+ assert_true( evtdone.dragenter, 'dragenter event was not tested'+failtxt );
+ assert_true( evtdone.dragleave, 'dragleave event was not tested'+failtxt );
+ assert_true( evtdone.dragover, 'dragover event was not tested'+failtxt );
+ assert_true( evtdone.drop, 'drop event was not tested'+failtxt );
+ assert_true( evtdone.dragend, 'dragend event was not tested'+failtxt );
+ }, 'all event types must now have been tested' );
+ done();
+ };
+};
+ </script>
+ </head>
+ <body>
+ <blockquote draggable="true"></blockquote>
+ <blockquote></blockquote>
+ <blockquote></blockquote>
+ <div id="log">Drag the orange square over the blue square then the fuchsia square, then release it.</div>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/003-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/003-manual.html
new file mode 100644
index 000000000..5e0adbdd8
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/003-manual.html
@@ -0,0 +1,95 @@
+<!doctype html>
+<html>
+ <head>
+ <title>allowTargetOrigin valid syntax</title>
+ <style type="text/css">
+div { float: left; height: 100px; width: 100px; margin-right: 10px; background: orange; }
+iframe { height: 100px; width: 100px; border: none; }
+.note { float: right; color: silver; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+function addNote(el,str) {
+ var par = document.createElement(el);
+ par.textContent = str;
+ document.body.appendChild(par);
+}
+function testFrame(text,frameorigin,framepath) {
+ var persist = arguments;
+ addNote('p',(done++)+'. '+text);
+ var div = document.createElement('div');
+ var frame = document.createElement('iframe');
+ frame.src = frameorigin+framepath;
+ div.draggable = true;
+ div.ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ for( var i = 3; i < persist.length; i++ ) {
+ e.dataTransfer.allowTargetOrigin(persist[i]);
+ }
+ };
+ var par = document.createElement('p');
+ par.className = 'note';
+ par.appendChild(document.createTextNode('Target: '+frameorigin));
+ par.appendChild(document.createElement('br'));
+ par.appendChild(document.createTextNode('Allowing: '+([]).slice.call(persist,3).join(' and ')));
+ if( framepath.match(/\?domain\b/) ) {
+ par.appendChild(document.createElement('br'));
+ par.appendChild(document.createTextNode('document.domain set to parent domain'));
+ }
+ document.body.appendChild(par);
+ document.body.appendChild(div);
+ document.body.appendChild(frame);
+}
+var done = 1;
+window.onload = function () {
+ var allowText = 'Drag the orange box below over the blue box the right, and release it. Fail if nothing happens in the blue box.';
+ var blockText = 'Drag the orange box below over the pink box the right, and release it. Pass if nothing happens in the pink box.';
+ var allowHelper = location.pathname.replace(/[^\/]*$/,'HELPER-mustallow.html');
+ var blockHelper = location.pathname.replace(/[^\/]*$/,'HELPER-mustblock.html');
+ if( location.hostname != httpHostMain || location.host != httpHostMain ) {
+ addNote('p','This test must be loaded over http:\/\/'+httpHostMain+'\/');
+ } else {
+ /* 01 */ testFrame(allowText,'http://'+httpHostMain,allowHelper);
+ /* 02 */ testFrame(allowText,'http://'+httpHostAlias,allowHelper);
+ /* 03 */ testFrame(allowText,'http://'+httpHostMain,allowHelper,'*');
+ /* 04 */ testFrame(allowText,'http://'+httpHostAlias,allowHelper,'*');
+ /* 05 */ testFrame(allowText,'http://'+httpHostMain,allowHelper,'/');
+ /* 06 */ testFrame(blockText,'http://'+httpHostAlias,blockHelper,'/');
+ /* 07 */ testFrame(allowText,'http://'+httpHostMain,allowHelper,'http://'+httpHostMain);
+ /* 08 */ testFrame(blockText,'http://'+httpHostMain+':'+httpPortAlias,blockHelper,'http://'+httpHostMain);
+ /* 09 */ testFrame(blockText,'http://'+httpHostAlias,blockHelper,'http://'+httpHostMain);
+ /* 10 */ testFrame(blockText,'http://'+httpHostAlias,blockHelper,'http://'+httpHostMain);
+ /* 11 */ testFrame(allowText,'http://'+httpHostMain,allowHelper,'http://'+httpHostMain+':80');
+ /* 12 */ testFrame(blockText,'http://'+httpHostMain+':'+httpPortAlias,blockHelper,'http://'+httpHostMain+':80');
+ /* 13 */ testFrame(allowText,'http://'+httpHostMain+':'+httpPortAlias,allowHelper,'http://'+httpHostMain+':'+httpPortAlias);
+ /* 14 */ testFrame(blockText,'http://'+httpHostMain,blockHelper,'http://'+httpHostMain+':'+httpPortAlias);
+ /* 15 */ testFrame(blockText,'https://'+httpsHostAlias,blockHelper,'http://'+httpsHostAlias);
+ /* 16 */ testFrame(allowText,'https://'+httpsHostAlias,allowHelper,'https://'+httpsHostAlias);
+ /* 17 */ testFrame(allowText,'http://'+httpHostMain,allowHelper,'http://foo:bar@'+httpHostMain+'/baz');
+ /* 18 */ testFrame(allowText,'http://foo:bar@'+httpHostMain,allowHelper,'http://'+httpHostMain);
+ /* 19 */ testFrame(allowText,'http://'+httpHostMain,allowHelper,'http://'+httpHostAlias,'/');
+ /* 20 */ testFrame(allowText,'http://'+httpHostMain,allowHelper,'/','http://'+httpHostAlias);
+ /* 21 */ testFrame(allowText,'http://'+httpHostMain,allowHelper,'http://'+httpHostAlias,'*');
+ /* 22 */ testFrame(allowText,'http://'+httpHostMain,allowHelper,'http://'+httpHostAlias,'http://'+httpHostMain);
+ /* 23 */ testFrame(allowText,'http://'+httpHostAlias,allowHelper,'http://'+httpHostAlias,'http://'+httpHostMain);
+ /* 24 */ testFrame(blockText,'http://'+httpHostAlias,blockHelper,'http://dummy','http://'+httpHostMain);
+ /* 25 */ testFrame(blockText,'https://'+httpsHostAlias,blockHelper,'https://'+httpsHostAlias+':'+httpsPortAlias);
+ /* 26 */ testFrame(blockText,'https://'+httpsHostAlias+':'+httpsPortAlias,blockHelper,'https://'+httpsHostAlias);
+ /* 27 */ testFrame(allowText,'https://'+httpsHostAlias+':'+httpsPortAlias,allowHelper,'https://'+httpsHostAlias+':'+httpsPortAlias);
+ window.xhr = new XMLHttpRequest();
+ xhr.open('GET',allowHelper,false);
+ xhr.send(null);
+ /* 28 */ testFrame(allowText,'data:text/html,',escape(xhr.responseText),'http://'+httpHostMain);
+ /* 29 */ testFrame(allowText,'javascript:','parent.xhr.responseText','http://'+httpHostMain);
+ /* 30 */ testFrame(blockText,'http://'+httpHostAlias,blockHelper,'http://'+httpHostAlias.replace(/^[^.]+\./,''));
+ /* 31 */ testFrame(allowText,'http://'+httpHostAlias,allowHelper+'?domain','http://'+httpHostAlias);
+ /* 32 */ testFrame(blockText,'http://'+httpHostAlias,blockHelper+'?domain','http://'+httpHostAlias.replace(/^[^.]+\./,''));
+ }
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/004-1.html b/testing/web-platform/tests/html/editing/dnd/target-origin/004-1.html
new file mode 100644
index 000000000..f8a4e8e55
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/004-1.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Data URI does not match absolute HTTP URL</title>
+ <style type="text/css">
+html, body { margin: 0; padding: 0; }
+div { height: 100px; width: 100px; background: orange; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ e.dataTransfer.allowTargetOrigin('http://'+httpHostMain);
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/004-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/004-manual.html
new file mode 100644
index 000000000..2a3d3bbe4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/004-manual.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Data URI does not match absolute HTTP URL</title>
+ </head>
+ <body>
+ <p>Load the following URL in a new tab (copy &amp; paste it into the address bar):</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ <script type="text/javascript">
+document.write('data:text/html,'+escape(
+'<!doctype html>\
+<html>\
+ <head>\
+ <title>Data URI does not match absolute HTTP URL<\/title>\
+ <style type="text/css">\
+iframe { border: none; height: 150px; width: 150px; }\
+ <\/style>\
+ <script type="text/javascript">\
+window.onload = function () {\
+ document.body.ondragenter = document.body.ondragleave = document.body.ondragover = document.body.ondrop = function (e) {\
+ e.preventDefault();\
+ document.body.innerHTML = "FAIL";\
+ };\
+};\
+ <\/script>\
+ <\/head>\
+ <body>\
+ <p>Drag the orange square below over this text, and release it. Pass if this text does not change.<\/p>\
+ <p><iframe src="'+location.href.replace(/\.html$/,'-1.html')+'"><\/iframe><\/p>\
+ <\/body>\
+<\/html>'));
+
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/005-1.html b/testing/web-platform/tests/html/editing/dnd/target-origin/005-1.html
new file mode 100644
index 000000000..15f6a8c23
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/005-1.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>JavaScript URI does not match absolute HTTP URL</title>
+ <style type="text/css">
+html, body { margin: 0; padding: 0; }
+div { height: 100px; width: 100px; background: orange; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ e.dataTransfer.allowTargetOrigin('http://'+httpHostMain);
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/005-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/005-manual.html
new file mode 100644
index 000000000..90a002cf0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/005-manual.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>JavaScript URI does not match absolute HTTP URL</title>
+ </head>
+ <body>
+ <p>Load the following URL in a new tab (copy &amp; paste it into the address bar):</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ <script type="text/javascript">
+document.write('javascript:unescape("'+escape(
+'<!doctype html>\
+<html>\
+ <head>\
+ <title>JavaScript does not match absolute HTTP URL<\/title>\
+ <style type=\'text/css\'>\
+iframe { border: none; height: 150px; width: 150px; }\
+ <\/style>\
+ <script type=\'text/javascript\'>\
+window.onload = function () {\
+ document.body.ondragenter = document.body.ondragleave = document.body.ondragover = document.body.ondrop = function (e) {\
+ e.preventDefault();\
+ document.body.innerHTML = \'FAIL\';\
+ };\
+};\
+ <\/script>\
+ <\/head>\
+ <body>\
+ <p>Drag the orange square below over this text, and release it. Pass if this text does not change.<\/p>\
+ <p><iframe src=\''+location.href.replace(/\.html$/,'-1.html')+'\'><\/iframe><\/p>\
+ <\/body>\
+<\/html>')+'")');
+
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/006-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/006-manual.html
new file mode 100644
index 000000000..e1674390c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/006-manual.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Data URI does not match /</title>
+ </head>
+ <body>
+ <!--
+/ sets an absolute URL pointing to the document's unique identifier - used as the script origin.
+The script origin will in fact be inherited from the parent page, which is actually the same data URI.
+That part works.
+However, when it comes to matching against it, it will not match, as the global identifier does not
+match because the origin does not match the scheme/host/port tuple required.
+ -->
+ <p>Load the following URL in a new tab (copy &amp; paste it into the address bar):</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ <script type="text/javascript">
+document.write('data:text/html,'+escape(
+'<!doctype html>\
+<html>\
+ <head>\
+ <title>Data URI does not match /<\/title>\
+ <style type="text/css">\
+html, body { margin: 0; padding: 0; }\
+div { height: 100px; width: 100px; background: orange; }\
+iframe { border: none; height: 150px; width: 150px; }\
+ <\/style>\
+ <\/head>\
+ <body>\
+ <script type="text/javascript">\
+if( self == top ) {\
+ document.body.ondragenter = document.body.ondragleave = document.body.ondragover = document.body.ondrop = function (e) {\
+ e.preventDefault();\
+ document.body.innerHTML = "FAIL";\
+ };\
+ document.write("<p>Drag the orange square below over this text, and release it. Pass if this text does not change.<\\\/p>");\
+ document.write("<p><iframe src=\\""+location.href+"\\"><\\\/iframe><\\\/p>");\
+} else {\
+ document.write("<div draggable=\\"true\\"><\\\/div>");\
+ document.getElementsByTagName("div")[0].ondragstart = function (e) {\
+ e.dataTransfer.effectAllowed = "copy";\
+ e.dataTransfer.setData("text","dummy text");\
+ e.dataTransfer.allowTargetOrigin("/");\
+ };\
+}\
+ <\/script>\
+ <\/body>\
+<\/html>'));
+
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/007-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/007-manual.html
new file mode 100644
index 000000000..4f35ed17e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/007-manual.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Data URI does not match its own URL</title>
+ </head>
+ <body>
+ <!--
+Sets an absolute URL pointing to the data URI.
+The script origin will in fact be inherited from the parent page, which is actually the same data URI.
+That part works.
+However, when it comes to matching against it, it will not match, as the global identifier used as the
+script origin does not match because the origin does not match the scheme/host/port tuple required.
+ -->
+ <p>Load the following URL in a new tab (copy &amp; paste it into the address bar):</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ <script type="text/javascript">
+document.write('data:text/html,'+escape(
+'<!doctype html>\
+<html>\
+ <head>\
+ <title>Data URI does not match its own URL<\/title>\
+ <style type="text/css">\
+html, body { margin: 0; padding: 0; }\
+div { height: 100px; width: 100px; background: orange; }\
+iframe { border: none; height: 150px; width: 150px; }\
+ <\/style>\
+ <\/head>\
+ <body>\
+ <script type="text/javascript">\
+if( self == top ) {\
+ document.body.ondragenter = document.body.ondragleave = document.body.ondragover = document.body.ondrop = function (e) {\
+ e.preventDefault();\
+ document.body.innerHTML = "FAIL";\
+ };\
+ document.write("<p>Drag the orange square below over this text, and release it. Pass if this text does not change.<\\\/p>");\
+ document.write("<p><iframe src=\\""+location.href+"\\"><\\\/iframe><\\\/p>");\
+} else {\
+ document.write("<div draggable=\\"true\\"><\\\/div>");\
+ document.getElementsByTagName("div")[0].ondragstart = function (e) {\
+ e.dataTransfer.effectAllowed = "copy";\
+ e.dataTransfer.setData("text","dummy text");\
+ e.dataTransfer.allowTargetOrigin(location.href);\
+ };\
+}\
+ <\/script>\
+ <\/body>\
+<\/html>'));
+
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/008-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/008-manual.html
new file mode 100644
index 000000000..71e915c9c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/008-manual.html
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Data URI does match *</title>
+ </head>
+ <body>
+ <!--
+* allows any URL at all, so it should work
+ -->
+ <p>Load the following URL in a new tab (copy &amp; paste it into the address bar):</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ <script type="text/javascript">
+document.write('data:text/html,'+escape(
+'<!doctype html>\
+<html>\
+ <head>\
+ <title>Data URI does match *<\/title>\
+ <style type="text/css">\
+html, body { margin: 0; padding: 0; }\
+div { height: 100px; width: 100px; background: orange; }\
+iframe { border: none; height: 150px; width: 150px; }\
+ <\/style>\
+ <\/head>\
+ <body>\
+ <script type="text/javascript">\
+var seentypes = {};\
+if( self == top ) {\
+ document.body.ondragenter = document.body.ondragover = document.body.ondrop = function (e) {\
+ e.preventDefault();\
+ if( e.type == "drop" ) {\
+ document.body.innerHTML = ( seentypes.dragenter && seentypes.dragover ) ? "PASS" : "FAIL";\
+ } else {\
+ seentypes[e.type] = true;\
+ }\
+ };\
+ document.write("<p>Drag the orange square below over this text, and release it. Fail if this text does not change.<\\\/p>");\
+ document.write("<p><iframe src=\\""+location.href+"\\"><\\\/iframe><\\\/p>");\
+} else {\
+ document.write("<div draggable=\\"true\\"><\\\/div>");\
+ document.getElementsByTagName("div")[0].ondragstart = function (e) {\
+ e.dataTransfer.effectAllowed = "copy";\
+ e.dataTransfer.setData("text","dummy text");\
+ e.dataTransfer.allowTargetOrigin("*");\
+ };\
+}\
+ <\/script>\
+ <\/body>\
+<\/html>'));
+
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/009-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/009-manual.html
new file mode 100644
index 000000000..2fc7ef43e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/009-manual.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>* should not prevent dropping on external applications</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName("div")[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = "copy";
+ e.dataTransfer.setData("text","PASS");
+ e.dataTransfer.allowTargetOrigin("*");
+ };
+};
+ </script>
+ </head>
+ <body>
+ <p>This test is only relevant on platforms where it is possible to switch applications in mid-drag (eg. alt+tab, dragging over taskbar buttons, dragging between restored windows).</p>
+ <p>This testcase requires an external application that accepts dropping of text from other applications - eg. Wordpad (write.exe) on Windows. Ensure that the external application is open.</p>
+ <p>Drag the orange block to the other application and release it. Pass if the word &quot;PASS&quot; appears in the other application.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div draggable="true"></div>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/010-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/010-manual.html
new file mode 100644
index 000000000..74a20d7e0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/010-manual.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>A URL should prevent dropping on external applications</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName("div")[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = "copy";
+ e.dataTransfer.setData("text","FAIL");
+ e.dataTransfer.allowTargetOrigin("http://foo");
+ };
+};
+ </script>
+ </head>
+ <body>
+ <p>This test is only relevant on platforms where it is possible to switch applications in mid-drag (eg. alt+tab, dragging over taskbar buttons, dragging between restored windows).</p>
+ <p>This testcase requires an external application that accepts dropping of text from other applications - eg. Wordpad (write.exe) on Windows. Ensure that the external application is open.</p>
+ <p>Drag the orange block to the other application and release it. Fail if the word &quot;FAIL&quot; appears in the other application.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div draggable="true"></div>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/011-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/011-manual.html
new file mode 100644
index 000000000..e0302712e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/011-manual.html
@@ -0,0 +1,63 @@
+<!doctype html>
+<html>
+ <head>
+ <title>allowTargetOrigin should only block dragenter, dragover, dragleave and drop events</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; margin: 0; padding: 0; float: left; }
+div + div { background: blue; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], evtdone = {}, fails = [];
+ orange.ondragstart = function (e) {
+ evtdone[e.type] = true;
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ try {
+ e.dataTransfer.allowTargetOrigin('http://example.com');
+ } catch(e) {
+ fails[fails.length] = 'allowTargetOrigin threw an error: '+e;
+ }
+ };
+ orange.ondragenter = orange.ondragover = orange.ondrop = function (e) {
+ e.preventDefault();
+ evtdone[e.type] = true;
+ };
+ orange.ondrag = orange.ondragleave = function (e) {
+ evtdone[e.type] = true;
+ };
+ orange.ondragend = function (e) {
+ evtdone[e.type] = true;
+ if( !evtdone.dragstart ) {
+ fails[fails.length] = 'dragstart did not fire - how did that happen?';
+ }
+ if( !evtdone.drag ) {
+ fails[fails.length] = 'drag did not fire';
+ }
+ if( !evtdone.dragend ) {
+ fails[fails.length] = 'dragend did not fire - OK, who broke the testcase?';
+ }
+ if( evtdone.dragenter ) {
+ fails[fails.length] = 'dragenter fired';
+ }
+ if( evtdone.dragover ) {
+ fails[fails.length] = 'dragover fired';
+ }
+ if( evtdone.dragleave ) {
+ fails[fails.length] = 'dragleave fired';
+ }
+ if( evtdone.drop ) {
+ fails[fails.length] = 'drop fired';
+ }
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL:<br>' + fails.join('<br>') ) : 'PASS';
+ };
+};
+ </script>
+ </head>
+ <body>
+ <p>Drag the orange square over the blue square then back to the orange square, then release it. Fail if this text does not change.</p>
+ <div draggable="true"></div>
+ <div></div>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/012-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/012-manual.html
new file mode 100644
index 000000000..164e613ed
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/012-manual.html
@@ -0,0 +1,62 @@
+<!doctype html>
+<html>
+ <head>
+ <title>allowTargetOrigin after leaving browser window</title>
+ <style type="text/css">
+div { float: left; height: 100px; width: 100px; margin-right: 10px; background: orange; }
+iframe { height: 100px; width: 100px; border: none; }
+.note { float: right; color: silver; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+function addNote(el,str) {
+ var par = document.createElement(el);
+ par.textContent = str;
+ document.body.appendChild(par);
+}
+function testFrame(text,frameorigin,framepath) {
+ var persist = arguments;
+ addNote('p',(done++)+'. '+text);
+ var div = document.createElement('div');
+ var frame = document.createElement('iframe');
+ frame.src = frameorigin+framepath;
+ div.draggable = true;
+ div.ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ for( var i = 3; i < persist.length; i++ ) {
+ e.dataTransfer.allowTargetOrigin(persist[i]);
+ }
+ };
+ var par = document.createElement('p');
+ par.className = 'note';
+ par.appendChild(document.createTextNode('Target: '+frameorigin));
+ par.appendChild(document.createElement('br'));
+ par.appendChild(document.createTextNode('Allowing: '+([]).slice.call(persist,3).join(' and ')));
+ if( framepath.match(/\?domain\b/) ) {
+ par.appendChild(document.createElement('br'));
+ par.appendChild(document.createTextNode('document.domain set to parent domain'));
+ }
+ document.body.appendChild(par);
+ document.body.appendChild(div);
+ document.body.appendChild(frame);
+}
+var done = 1;
+window.onload = function () {
+ var allowText = 'Drag the orange box below outside the browser window (not onto the system taskbar) then back over the blue box the right, and release it. Fail if nothing happens in the blue box.';
+ var blockText = 'Drag the orange box below outside the browser window (not onto the system taskbar) then back over the pink box the right, and release it. Pass if nothing happens in the pink box.';
+ var allowHelper = location.pathname.replace(/[^\/]*$/,'HELPER-mustallow.html');
+ var blockHelper = location.pathname.replace(/[^\/]*$/,'HELPER-mustblock.html');
+ if( location.hostname != httpHostMain || location.host != httpHostMain ) {
+ addNote('p','This test must be loaded over http:\/\/'+httpHostMain+'\/');
+ } else {
+ /* 07 */ testFrame(allowText,'http://'+httpHostMain,allowHelper,'http://'+httpHostMain);
+ /* 09 */ testFrame(blockText,'http://'+httpHostAlias,blockHelper,'http://'+httpHostMain);
+ }
+};
+ </script>
+ </head>
+ <body>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/013-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/013-manual.html
new file mode 100644
index 000000000..39ee70cf5
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/013-manual.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<html>
+ <head>
+ <title>A URL should prevent dropping on UI</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ document.getElementsByTagName("div")[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = "copy";
+ e.dataTransfer.setData("text","FAIL");
+ e.dataTransfer.allowTargetOrigin("http://foo");
+ };
+};
+ </script>
+ </head>
+ <body>
+ <p>This test is only relevant on platforms where it is possible to drop data onto the browser UI (eg. the address field).</p>
+ <p>Drag the orange block to the address field and release it. Fail if the word &quot;FAIL&quot; appears in the address field. Repeat for other UI fields.</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div draggable="true"></div>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/101-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/101-manual.html
new file mode 100644
index 000000000..24ef03957
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/101-manual.html
@@ -0,0 +1,123 @@
+<!doctype html>
+<html>
+ <head>
+ <title>.origin for all events</title>
+ <style type="text/css">
+blockquote { height: 100px; width: 100px; background: orange; margin: 0; padding: 0; float: left; }
+blockquote + blockquote { background: blue; }
+blockquote + blockquote + blockquote { background: fuchsia; }
+blockquote + div { clear: left; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript" src="/resources/testharness.js"></script>
+ <script type="text/javascript">
+setup(function () {},{explicit_done:true});
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ done();
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var orange = document.getElementsByTagName('blockquote')[0],
+ blue = document.getElementsByTagName('blockquote')[1],
+ fuchsia = document.getElementsByTagName('blockquote')[2],
+ evtdone = {};
+ orange.ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ if( evtdone[e.type] ) { return; }
+ evtdone[e.type] = true;
+ test(function() {
+ assert_equals( e.dataTransfer.origin, origin );
+ }, '.origin should exist in '+e.type );
+ test(function () {
+ //WebIDL and ECMAScript 5 - a readonly property has a getter but not a setter
+ //ES5 makes [[Put]] fail but not throw
+ var failed = false, oldorigin = e.dataTransfer.origin;
+ try {
+ e.dataTransfer.origin = 'http://example.com';
+ } catch(e) {
+ failed = e;
+ }
+ assert_equals(e.dataTransfer.origin,oldorigin);
+ assert_false(failed,'an error was thrown');
+ }, '.origin must be read-only in '+e.type);
+ };
+ blue.ondragenter = blue.ondragover = function (e) {
+ e.preventDefault();
+ };
+ orange.ondrag = blue.ondragleave = function (e) {
+ if( evtdone[e.type] ) { return; }
+ evtdone[e.type] = true;
+ test(function() {
+ assert_equals( e.dataTransfer.origin, origin );
+ }, '.origin should exist in '+e.type );
+ test(function () {
+ var failed = false, oldorigin = e.dataTransfer.origin;
+ try {
+ e.dataTransfer.origin = 'http://example.com';
+ } catch(e) {
+ failed = e;
+ }
+ assert_equals(e.dataTransfer.origin,oldorigin);
+ assert_false(failed,'an error was thrown');
+ }, '.origin must be read-only in '+e.type);
+ };
+ fuchsia.ondragenter = fuchsia.ondragover = fuchsia.ondrop = function (e) {
+ e.preventDefault();
+ if( evtdone[e.type] ) { return; }
+ evtdone[e.type] = true;
+ test(function() {
+ assert_equals( e.dataTransfer.origin, origin );
+ }, '.origin should exist in '+e.type );
+ test(function () {
+ var failed = false, oldorigin = e.dataTransfer.origin;
+ try {
+ e.dataTransfer.origin = 'http://example.com';
+ } catch(e) {
+ failed = e;
+ }
+ assert_equals(e.dataTransfer.origin,oldorigin);
+ assert_false(failed,'an error was thrown');
+ }, '.origin must be read-only in '+e.type);
+ };
+ orange.ondragend = function (e) {
+ if( evtdone[e.type] ) { return; }
+ evtdone[e.type] = true;
+ test(function() {
+ assert_equals( e.dataTransfer.origin, origin );
+ }, '.origin should exist in '+e.type );
+ test(function () {
+ var failed = false, oldorigin = e.dataTransfer.origin;
+ try {
+ e.dataTransfer.origin = 'http://example.com';
+ } catch(e) {
+ failed = e;
+ }
+ assert_equals(e.dataTransfer.origin,oldorigin);
+ assert_false(failed,'an error was thrown');
+ }, '.origin must be read-only in '+e.type);
+ test(function() {
+ var failtxt = '- Reload and try again';
+ assert_true( evtdone.dragstart, 'dragstart event was not tested'+failtxt );
+ assert_true( evtdone.drag, 'drag event was not tested'+failtxt );
+ assert_true( evtdone.dragenter, 'dragenter event was not tested'+failtxt );
+ assert_true( evtdone.dragleave, 'dragleave event was not tested'+failtxt );
+ assert_true( evtdone.dragover, 'dragover event was not tested'+failtxt );
+ assert_true( evtdone.drop, 'drop event was not tested'+failtxt );
+ assert_true( evtdone.dragend, 'dragend event was not tested'+failtxt );
+ }, 'all event types must now have been tested' );
+ done();
+ };
+};
+ </script>
+ </head>
+ <body>
+ <blockquote draggable="true"></blockquote>
+ <blockquote></blockquote>
+ <blockquote></blockquote>
+ <div id="log">Drag the orange square over the blue square then the fuchsia square, then release it.</div>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/102-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/102-manual.html
new file mode 100644
index 000000000..ebb3090ba
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/102-manual.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for http site to itself</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+iframe { width: 500px; height: 120px; border: none; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+ document.getElementsByTagName('span')[0].textContent = origin;
+ var iframe = document.createElement('iframe');
+ iframe.src = origin+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html');
+ document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>
+ <span></span></p>
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/103-1.html b/testing/web-platform/tests/html/editing/dnd/target-origin/103-1.html
new file mode 100644
index 000000000..9904ceaa0
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/103-1.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for http site with user/pass/port to itself</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+iframe { width: 500px; height: 120px; border: none; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+ document.getElementsByTagName('span')[0].textContent = origin;
+ var iframe = document.createElement('iframe');
+ iframe.src = origin+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html');
+ document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>
+ <span></span></p>
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/103-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/103-manual.html
new file mode 100644
index 000000000..7bedf0958
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/103-manual.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for http site with user/pass/port to itself</title>
+ <style type="text/css">
+html, body, iframe { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var iframe = document.createElement('iframe');
+ iframe.src = 'http://foo:bar@'+httpHostMain+':80'+location.pathname.replace(/.html$/,'-1.html');
+ document.body.appendChild(iframe);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/104-1.html b/testing/web-platform/tests/html/editing/dnd/target-origin/104-1.html
new file mode 100644
index 000000000..ada4a6f99
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/104-1.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for http site with non-default port to itself</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+iframe { width: 500px; height: 120px; border: none; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain+':'+httpPortAlias;
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+ document.getElementsByTagName('span')[0].textContent = origin;
+ var iframe = document.createElement('iframe');
+ iframe.src = origin+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html');
+ document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>
+ <span></span></p>
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/104-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/104-manual.html
new file mode 100644
index 000000000..126242462
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/104-manual.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for http site with non-default port to itself</title>
+ <style type="text/css">
+html, body, iframe { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var iframe = document.createElement('iframe');
+ iframe.src = 'http://'+httpHostMain+':'+httpPortAlias+location.pathname.replace(/.html$/,'-1.html');
+ document.body.appendChild(iframe);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/105-1.html b/testing/web-platform/tests/html/editing/dnd/target-origin/105-1.html
new file mode 100644
index 000000000..ccfe4f4c4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/105-1.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for http site to site with non-default port</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+iframe { width: 500px; height: 120px; border: none; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+ document.getElementsByTagName('span')[0].textContent = origin;
+ var iframe = document.createElement('iframe');
+ iframe.src = origin+':'+httpPortAlias+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html');
+ document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>
+ <span></span></p>
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/105-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/105-manual.html
new file mode 100644
index 000000000..4695888a6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/105-manual.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for http site to site with non-default port</title>
+ <style type="text/css">
+html, body, iframe { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var iframe = document.createElement('iframe');
+ iframe.src = 'http://'+httpHostMain+location.pathname.replace(/.html$/,'-1.html');
+ document.body.appendChild(iframe);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/106-1.html b/testing/web-platform/tests/html/editing/dnd/target-origin/106-1.html
new file mode 100644
index 000000000..d8ff88efc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/106-1.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for http site with non-default port to site</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+iframe { width: 500px; height: 120px; border: none; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain+':'+httpPortAlias;
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+ document.getElementsByTagName('span')[0].textContent = origin;
+ var iframe = document.createElement('iframe');
+ iframe.src = 'http://'+httpHostMain+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html');
+ document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>
+ <span></span></p>
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/106-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/106-manual.html
new file mode 100644
index 000000000..18017511b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/106-manual.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for http site with non-default port to site</title>
+ <style type="text/css">
+html, body, iframe { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var iframe = document.createElement('iframe');
+ iframe.src = 'http://'+httpHostMain+':'+httpPortAlias+location.pathname.replace(/.html$/,'-1.html');
+ document.body.appendChild(iframe);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/107-1.html b/testing/web-platform/tests/html/editing/dnd/target-origin/107-1.html
new file mode 100644
index 000000000..2392b19ea
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/107-1.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for https site to itself</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+iframe { width: 500px; height: 120px; border: none; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'https://'+httpsHostAlias;
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+ document.getElementsByTagName('span')[0].textContent = origin;
+ var iframe = document.createElement('iframe');
+ iframe.src = origin+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html');
+ document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>
+ <span></span></p>
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/107-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/107-manual.html
new file mode 100644
index 000000000..ecd9e9b7b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/107-manual.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for https site to itself</title>
+ <style type="text/css">
+html, body, iframe { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var iframe = document.createElement('iframe');
+ iframe.src = 'https://'+httpsHostAlias+location.pathname.replace(/.html$/,'-1.html');
+ document.body.appendChild(iframe);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/108-1.html b/testing/web-platform/tests/html/editing/dnd/target-origin/108-1.html
new file mode 100644
index 000000000..b3027dbe2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/108-1.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for https site with non-default port to itself</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+iframe { width: 500px; height: 120px; border: none; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'https://'+httpsHostAlias+':'+httpsPortAlias;
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+ document.getElementsByTagName('span')[0].textContent = origin;
+ var iframe = document.createElement('iframe');
+ iframe.src = origin+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html');
+ document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>
+ <span></span></p>
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/108-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/108-manual.html
new file mode 100644
index 000000000..eb77db366
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/108-manual.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for https site with non-default port to itself</title>
+ <style type="text/css">
+html, body, iframe { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var iframe = document.createElement('iframe');
+ iframe.src = 'https://'+httpsHostAlias+':'+httpsPortAlias+location.pathname.replace(/.html$/,'-1.html');
+ document.body.appendChild(iframe);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/109-1.html b/testing/web-platform/tests/html/editing/dnd/target-origin/109-1.html
new file mode 100644
index 000000000..6b4e1d80c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/109-1.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for https site to site with non-default port</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+iframe { width: 500px; height: 120px; border: none; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'https://'+httpsHostAlias;
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+ document.getElementsByTagName('span')[0].textContent = origin;
+ var iframe = document.createElement('iframe');
+ iframe.src = origin+':'+httpsPortAlias+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html');
+ document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>
+ <span></span></p>
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/109-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/109-manual.html
new file mode 100644
index 000000000..7817a8550
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/109-manual.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for https site to site with non-default port</title>
+ <style type="text/css">
+html, body, iframe { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var iframe = document.createElement('iframe');
+ iframe.src = 'https://'+httpsHostAlias+location.pathname.replace(/.html$/,'-1.html');
+ document.body.appendChild(iframe);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/110-1.html b/testing/web-platform/tests/html/editing/dnd/target-origin/110-1.html
new file mode 100644
index 000000000..ee584003a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/110-1.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for https site with non-default port to site</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+iframe { width: 500px; height: 120px; border: none; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'https://'+httpsHostAlias+':'+httpsPortAlias;
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+ document.getElementsByTagName('span')[0].textContent = origin;
+ var iframe = document.createElement('iframe');
+ iframe.src = 'https://'+httpsHostAlias+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html');
+ document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>
+ <span></span></p>
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/110-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/110-manual.html
new file mode 100644
index 000000000..663e162bd
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/110-manual.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for https site with non-default port to site</title>
+ <style type="text/css">
+html, body, iframe { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var iframe = document.createElement('iframe');
+ iframe.src = 'https://'+httpsHostAlias+':'+httpsPortAlias+location.pathname.replace(/.html$/,'-1.html');
+ document.body.appendChild(iframe);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/111-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/111-manual.html
new file mode 100644
index 000000000..c81efa01d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/111-manual.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for file: to http:</title>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var datastr =
+'<!doctype html>\
+<html>\
+ <head>\
+ <title>Origin for file: to http:<\/title>\
+ <style type="text/css">\
+div { height: 100px; width: 100px; background: orange; }\
+iframe { width: 500px; height: 120px; border: none; }\
+ <\/style>\
+ <script type="text/javascript">\
+window.onload = function () {\
+ var origin = "null (string)";\
+ document.getElementsByTagName("div")[0].ondragstart = function (e) {\
+ e.dataTransfer.effectAllowed = "copy";\
+ e.dataTransfer.setData("text","dummy text");\
+ };\
+ document.getElementsByTagName("span")[0].textContent = origin;\
+ var iframe = document.createElement("iframe");\
+ iframe.src = "'+location.href.replace(/[^\/]*$/,'HELPER-showorigin.html')+'";\
+ document.body.insertBefore(iframe,document.getElementsByTagName("div")[0]);\
+};\
+ <\/script>\
+ <\/head>\
+ <body>\
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>\
+ <span><\/span><\/p>\
+ <div draggable="true"></div>\
+ <\/body>\
+<\/html>';
+ document.getElementsByTagName('a')[0].href = 'data:text/html,'+escape(datastr);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p><a href="">Download the linked file to your disk</a>, and open it locally. Follow further instructions in that file.</p>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/112-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/112-manual.html
new file mode 100644
index 000000000..858e51d9c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/112-manual.html
@@ -0,0 +1,56 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for data: with inherited http origin to http:</title>
+ <style type="text/css">
+html, body, iframe { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var datastr =
+'<!doctype html>\
+<html>\
+ <head>\
+ <title>Origin for data: with inherited http origin to http:<\/title>\
+ <style type="text/css">\
+div { height: 100px; width: 100px; background: orange; }\
+iframe { width: 500px; height: 120px; border: none; }\
+ <\/style>\
+ <script type="text/javascript">\
+window.onload = function () {\
+ var origin = "http://'+httpHostMain+'";\
+ document.getElementsByTagName("div")[0].ondragstart = function (e) {\
+ e.dataTransfer.effectAllowed = "copy";\
+ e.dataTransfer.setData("text","dummy text");\
+ };\
+ document.getElementsByTagName("span")[0].textContent = origin;\
+ var iframe = document.createElement("iframe");\
+ iframe.src = "'+location.href.replace(/[^\/]*$/,'HELPER-showorigin.html')+'";\
+ document.body.insertBefore(iframe,document.getElementsByTagName("div")[0]);\
+};\
+ <\/script>\
+ <\/head>\
+ <body>\
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>\
+ <span><\/span><\/p>\
+ <div draggable="true"></div>\
+ <\/body>\
+<\/html>';
+ var iframe = document.createElement('iframe');
+ iframe.src = 'data:text/html,'+escape(datastr);
+ document.body.appendChild(iframe);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/113-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/113-manual.html
new file mode 100644
index 000000000..d3f889a9d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/113-manual.html
@@ -0,0 +1,50 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for data: with no inherited origin to http:</title>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ </head>
+ <body>
+
+ <p>Load the following URL in a new tab (copy &amp; paste it into the address bar):</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ <script type="text/javascript">
+var origin = 'http://'+httpHostMain;
+if( location.href.indexOf(origin+'/') ) {
+ document.write('This must be tested on '+origin+'/');
+} else {
+ document.write("data:text/html,"+escape(
+'<!doctype html>\
+<html>\
+ <head>\
+ <title>Origin for data: with no inherited origin to http:<\/title>\
+ <style type="text/css">\
+div { height: 100px; width: 100px; background: orange; }\
+iframe { width: 500px; height: 120px; border: none; }\
+ <\/style>\
+ <script type="text/javascript">\
+window.onload = function () {\
+ var origin = "null (string)";\
+ document.getElementsByTagName("div")[0].ondragstart = function (e) {\
+ e.dataTransfer.effectAllowed = "copy";\
+ e.dataTransfer.setData("text","dummy text");\
+ };\
+ document.getElementsByTagName("span")[0].textContent = origin;\
+ var iframe = document.createElement("iframe");\
+ iframe.src = "'+location.href.replace(/[^\/]*$/,'HELPER-showorigin.html')+'";\
+ document.body.insertBefore(iframe,document.getElementsByTagName("div")[0]);\
+};\
+ <\/script>\
+ <\/head>\
+ <body>\
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>\
+ <span><\/span><\/p>\
+ <div draggable="true"></div>\
+ <\/body>\
+<\/html>'));
+}
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/114-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/114-manual.html
new file mode 100644
index 000000000..b2532178a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/114-manual.html
@@ -0,0 +1,56 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for javascript: with inherited http origin to http:</title>
+ <style type="text/css">
+html, body, iframe { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var datastr =
+'<!doctype html>\
+<html>\
+ <head>\
+ <title>Origin for javascript: with inherited http origin to http:<\/title>\
+ <style type="text/css">\
+div { height: 100px; width: 100px; background: orange; }\
+iframe { width: 500px; height: 120px; border: none; }\
+ <\/style>\
+ <script type="text/javascript">\
+window.onload = function () {\
+ var origin = "http://'+httpHostMain+'";\
+ document.getElementsByTagName("div")[0].ondragstart = function (e) {\
+ e.dataTransfer.effectAllowed = "copy";\
+ e.dataTransfer.setData("text","dummy text");\
+ };\
+ document.getElementsByTagName("span")[0].textContent = origin;\
+ var iframe = document.createElement("iframe");\
+ iframe.src = "'+location.href.replace(/[^\/]*$/,'HELPER-showorigin.html')+'";\
+ document.body.insertBefore(iframe,document.getElementsByTagName("div")[0]);\
+};\
+ <\/script>\
+ <\/head>\
+ <body>\
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>\
+ <span><\/span><\/p>\
+ <div draggable="true"></div>\
+ <\/body>\
+<\/html>';
+ var iframe = document.createElement('iframe');
+ iframe.src = "javascript:'"+escape(datastr)+"'";
+ document.body.appendChild(iframe);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/115-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/115-manual.html
new file mode 100644
index 000000000..751757e14
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/115-manual.html
@@ -0,0 +1,50 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for javascript: with no inherited origin to http:</title>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ </head>
+ <body>
+
+ <p>Load the following URL in a new tab (copy &amp; paste it into the address bar):</p>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ <script type="text/javascript">
+var origin = 'http://'+httpHostMain;
+if( location.href.indexOf(origin+'/') ) {
+ document.write('This must be tested on '+origin+'/');
+} else {
+ document.write("javascript:'"+escape(
+'<!doctype html>\
+<html>\
+ <head>\
+ <title>Origin for javascript: with no inherited origin to http:<\/title>\
+ <style type="text/css">\
+div { height: 100px; width: 100px; background: orange; }\
+iframe { width: 500px; height: 120px; border: none; }\
+ <\/style>\
+ <script type="text/javascript">\
+window.onload = function () {\
+ var origin = "null (string)";\
+ document.getElementsByTagName("div")[0].ondragstart = function (e) {\
+ e.dataTransfer.effectAllowed = "copy";\
+ e.dataTransfer.setData("text","dummy text");\
+ };\
+ document.getElementsByTagName("span")[0].textContent = origin;\
+ var iframe = document.createElement("iframe");\
+ iframe.src = "'+location.href.replace(/[^\/]*$/,'HELPER-showorigin.html')+'";\
+ document.body.insertBefore(iframe,document.getElementsByTagName("div")[0]);\
+};\
+ <\/script>\
+ <\/head>\
+ <body>\
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>\
+ <span><\/span><\/p>\
+ <div draggable="true"></div>\
+ <\/body>\
+<\/html>')+"'");
+}
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/116-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/116-manual.html
new file mode 100644
index 000000000..fdeeeb373
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/116-manual.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for dropped files</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+iframe { width: 500px; height: 120px; border: none; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ document.getElementsByTagName('span')[0].textContent = 'null (string)';
+ var iframe = document.createElement('iframe');
+ iframe.src = origin+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html');
+ document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag a small file from your computer onto the blue square and release it. If a prompt appears, accept it. The blue square should be replaced with the text:<br>
+ <span></span></p>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/117-1.html b/testing/web-platform/tests/html/editing/dnd/target-origin/117-1.html
new file mode 100644
index 000000000..c49b18ac9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/117-1.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for site with document.domain set to a parent domain</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+iframe { width: 500px; height: 120px; border: none; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostAlias;
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+ document.getElementsByTagName('span')[0].textContent = origin;
+ document.domain = httpsHostAlias.replace(/^[^.]+\./,'');
+ var iframe = document.createElement('iframe');
+ iframe.src = origin+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html');
+ document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>
+ <span></span></p>
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/117-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/117-manual.html
new file mode 100644
index 000000000..d126fdaac
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/117-manual.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin for site with document.domain set to a parent domain</title>
+ <style type="text/css">
+html, body, iframe { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var iframe = document.createElement('iframe');
+ iframe.src = 'http://'+httpHostAlias+location.pathname.replace(/.html$/,'-1.html');
+ document.body.appendChild(iframe);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/118-1.html b/testing/web-platform/tests/html/editing/dnd/target-origin/118-1.html
new file mode 100644
index 000000000..d0212bd2a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/118-1.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin after leaving browser window</title>
+ <style type="text/css">
+div { height: 100px; width: 100px; background: orange; }
+iframe { width: 500px; height: 120px; border: none; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain+':'+httpPortAlias;
+ document.getElementsByTagName('div')[0].ondragstart = function (e) {
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ };
+ document.getElementsByTagName('span')[0].textContent = origin;
+ var iframe = document.createElement('iframe');
+ iframe.src = 'http://'+httpHostMain+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html');
+ document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <p>Drag the orange square out of the browser window (not onto the system taskbar) then back onto the blue square and release it. The blue square should be replaced with the text:<br>
+ <span></span></p>
+ <div draggable="true"></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/118-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/118-manual.html
new file mode 100644
index 000000000..6b931692d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/118-manual.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Origin after leaving browser window</title>
+ <style type="text/css">
+html, body, iframe { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
+ </style>
+ <script type="text/javascript" src="../resources/crossorigin.sub.js"></script>
+ <script type="text/javascript">
+window.onload = function () {
+ var origin = 'http://'+httpHostMain;
+ if( location.href.indexOf(origin+'/') ) {
+ document.body.innerHTML = 'This must be tested on '+origin+'/';
+ return;
+ }
+ var iframe = document.createElement('iframe');
+ iframe.src = 'http://'+httpHostMain+':'+httpPortAlias+location.pathname.replace(/.html$/,'-1.html');
+ document.body.appendChild(iframe);
+};
+ </script>
+ </head>
+ <body>
+
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/201-manual.html b/testing/web-platform/tests/html/editing/dnd/target-origin/201-manual.html
new file mode 100644
index 000000000..a687147c7
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/201-manual.html
@@ -0,0 +1,83 @@
+<!doctype html>
+<html>
+ <head>
+ <title>allowTargetOrigin with real dataTransfer should block dragenter, dragover, dragleave and drop synthetic events</title>
+ <style type="text/css">
+p + div { height: 100px; width: 100px; background: orange; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var orange = document.getElementsByTagName('div')[0], targ = document.getElementsByTagName('div')[1], evtdone = {}, fails = [];
+ orange.ondragstart = function (e) {
+ var evt;
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ try {
+ e.dataTransfer.allowTargetOrigin('http://example.com');
+ } catch(e) {
+ fails[fails.length] = 'allowTargetOrigin threw an error: '+e;
+ }
+ try {
+ evt = new DragEvent('dragstart', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ evt = new DragEvent('drag', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ evt = new DragEvent('dragenter', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ evt = new DragEvent('dragover', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ evt = new DragEvent('dragleave', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ evt = new DragEvent('drop', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ evt = new DragEvent('dragend', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ } catch(e) {
+ fails[fails.length] = 'Synthetic event threw an error: '+e;
+ }
+ if( !evtdone.dragstart ) {
+ fails[fails.length] = 'dragstart did not fire';
+ }
+ if( !evtdone.drag ) {
+ fails[fails.length] = 'drag did not fire';
+ }
+ if( !evtdone.dragend ) {
+ fails[fails.length] = 'dragend did not fire';
+ }
+ if( evtdone.dragenter ) {
+ fails[fails.length] = 'dragenter fired';
+ }
+ if( evtdone.dragover ) {
+ fails[fails.length] = 'dragover fired';
+ }
+ if( evtdone.dragleave ) {
+ fails[fails.length] = 'dragleave fired';
+ }
+ if( evtdone.drop ) {
+ fails[fails.length] = 'drop fired';
+ }
+ document.getElementsByTagName('p')[0].innerHTML = fails.length ? ( 'FAIL:<br>' + fails.join('<br>') ) : 'PASS';
+ };
+ targ.ondragstart = function (e) {
+ evtdone[e.type] = true;
+ };
+ targ.ondragenter = targ.ondragover = targ.ondrop = function (e) {
+ e.preventDefault();
+ evtdone[e.type] = true;
+ };
+ targ.ondrag = targ.ondragleave = function (e) {
+ evtdone[e.type] = true;
+ };
+ targ.ondragend = function (e) {
+ evtdone[e.type] = true;
+ };
+};
+ </script>
+ </head>
+ <body>
+ <p>Drag the orange square to the right until the drag placeholder appears, then release it. Fail if this text does not change.</p>
+ <div draggable="true"></div>
+ <div></div>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/202.html b/testing/web-platform/tests/html/editing/dnd/target-origin/202.html
new file mode 100644
index 000000000..0e6b43c06
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/202.html
@@ -0,0 +1,64 @@
+<!doctype html>
+<html>
+ <head>
+ <title>allowTargetOrigin with fake dataTransfer should block dragenter, dragover, dragleave and drop synthetic events</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div draggable="true"></div>
+ <div></div>
+ <noscript><p>Enable JavaScript and reload</p></noscript>
+ <div id="log"></div>
+
+ <script type="text/javascript">
+test(function () {
+ var dragsource = document.getElementsByTagName('div')[0], targ = document.getElementsByTagName('div')[1], evtdone = {};
+ dragsource.ondragstart = function (e) {
+ var evt;
+ evtdone.initial = true;
+ e.dataTransfer.effectAllowed = 'copy';
+ e.dataTransfer.setData('text','dummy text');
+ e.dataTransfer.allowTargetOrigin('http://example.com');
+ evt = new DragEvent('dragstart', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ evt = new DragEvent('drag', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ evt = new DragEvent('dragenter', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ evt = new DragEvent('dragover', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ evt = new DragEvent('dragleave', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ evt = new DragEvent('drop', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ evt = new DragEvent('dragend', {dataTransfer:e.dataTransfer});
+ targ.dispatchEvent(evt);
+ };
+ targ.ondragstart = function (e) {
+ evtdone[e.type] = true;
+ };
+ targ.ondragenter = targ.ondragover = targ.ondrop = function (e) {
+ e.preventDefault();
+ evtdone[e.type] = true;
+ };
+ targ.ondrag = targ.ondragleave = function (e) {
+ evtdone[e.type] = true;
+ };
+ targ.ondragend = function (e) {
+ evtdone[e.type] = true;
+ };
+ var creatorevent = document.createEvent('DragEvent');
+ creatorevent.initDragEvent('dragstart', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 1, document.body, {});
+ dragsource.dispatchEvent(creatorevent);
+ assert_true(evtdone.dragstart, 'dragstart must fire');
+ assert_true(evtdone.drag, 'drag must fire');
+ assert_true(evtdone.dragend, 'dragend must fire');
+ assert_false(evtdone.dragenter, 'dragenter must not fire');
+ assert_false(evtdone.dragover, 'dragover must not fire');
+ assert_false(evtdone.dragleave, 'dragleave must not fire');
+ assert_false(evtdone.drop, 'drop must not fire');
+}, "allowTargetOrigin with fake dataTransfer should block events");
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-mustallow.html b/testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-mustallow.html
new file mode 100644
index 000000000..0a68b7448
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-mustallow.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Must be allowed</title>
+ <style type="text/css">
+html { background: blue; }
+html, body { margin: 0; padding: 0; height: 100%; width: 100%; }
+ </style>
+ </head>
+ <body>
+ <script type="text/javascript">
+if( location.search && location.search.indexOf('domain') != -1 ) {
+ document.domain = location.hostname.replace(/^[^.]+\./,'');
+}
+var seentypes = {};
+document.body.ondragenter = document.body.ondragover = document.body.ondrop = function (e) {
+ e.preventDefault();
+ if( e.type == 'drop' ) {
+ document.body.innerHTML = ( seentypes.dragenter && seentypes.dragover && e.dataTransfer.getData('text') == 'dummy text' ) ? 'PASS' : 'FAIL';
+ } else {
+ seentypes[e.type] = true;
+ }
+}
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-mustblock.html b/testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-mustblock.html
new file mode 100644
index 000000000..dd467f55f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-mustblock.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Must be blocked</title>
+ <style type="text/css">
+html { background: fuchsia; }
+html, body { margin: 0; padding: 0; height: 100%; width: 100%; }
+ </style>
+ </head>
+ <body>
+ <script type="text/javascript">
+if( location.search && location.search.indexOf('domain') != -1 ) {
+ document.domain = location.hostname.replace(/^[^.]+\./,'');
+}
+document.body.ondragenter = document.body.ondragleave = document.body.ondragover = document.body.ondrop = function (e) {
+ e.preventDefault();
+ document.body.innerHTML = 'FAIL';
+}
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-showorigin.html b/testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-showorigin.html
new file mode 100644
index 000000000..ea071e811
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/target-origin/HELPER-showorigin.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Readout of .origin</title>
+ <style type="text/css">
+html, body { margin: 0; padding: 0; }
+div { height: 100px; width: 100px; background: blue; }
+ </style>
+ <script type="text/javascript">
+window.onload = function () {
+ var blue = document.getElementsByTagName('div')[0];
+ blue.ondragenter = blue.ondragover = function (e) {
+ e.preventDefault();
+ };
+ blue.ondrop = function (e) {
+ e.preventDefault();
+ if( e.dataTransfer.origin === 'null' ) {
+ document.body.innerHTML = 'null (string)';
+ } else {
+ document.body.innerHTML = e.dataTransfer.origin;
+ }
+ };
+};
+ </script>
+ </head>
+ <body>
+
+ <div></div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/the-datatransfer-interface/dndTransferCases-manual.html b/testing/web-platform/tests/html/editing/dnd/the-datatransfer-interface/dndTransferCases-manual.html
new file mode 100755
index 000000000..6081b5d42
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-datatransfer-interface/dndTransferCases-manual.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_data_item_kind_string</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='author' title='Domenic Denicola' href='mailto:d@domenic.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-datatransfer-interface'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #drag {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='drag' draggable>blue text</div>
+ <div id='drop' dropzone='copy string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drag;
+ setup(function() {
+ drag = document.querySelector('#drag');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drag, 'dragstart', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.effectAllowed, 'uninitialized');
+ }, 'effectAllowed should be "uninitialized"');
+
+ test(function() {
+ assert_equals(event.dataTransfer.types.constructor, Array, 'should be an array');
+ assert_true(Object.isFrozen(event.dataTransfer.types), 'should be frozen');
+ }, 'types should be a frozen array');
+
+ test(function() {
+ assert_false('contains' in event.dataTransfer.types);
+ assert_false('item' in event.dataTransfer.types);
+ }, 'types should not have any of the historical methods');
+
+ test(function() {
+ assert_equals(event.dataTransfer.types, event.dataTransfer.types);
+ }, 'types should return the same object from multiple reads (assuming no changes)');
+
+ test(function() {
+ var before = event.dataTransfer.types;
+ event.dataTransfer.clearData();
+ assert_not_equals(event.dataTransfer.types, before);
+ }, 'types should return a different object after changes');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dragevent-interface/dragevent-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dragevent-interface/dragevent-manual.html
new file mode 100644
index 000000000..aafe83205
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dragevent-interface/dragevent-manual.html
@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: DragEvent</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#dndevents'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #drag {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='drag' draggable>blue text</div>
+ <div id='drop' dropzone='copy string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drag, element;
+ var Events = ['ondragstart', 'ondrag', 'ondragover', 'ondragenter', 'ondragexit', 'ondragleave', 'ondrop', 'ondragend'];
+
+ setup(function() {
+ drag = document.querySelector('#drag');
+ element = document.createElement('div');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ for(var i=0; i< Events.length; i++) {
+ test(function() {
+ assert_true(Events[i] in document, 'Check ' + Events[i] + ' in document');
+ }, 'Check ' + Events[i] + ' in document');
+ }
+
+ test(function() {
+ assert_inherits(element, 'ondragstart', 'Check if have ondragstart attribute');
+ }, 'Check if have ondragstart attribute');
+
+ test(function() {
+ assert_inherits(element, 'ondrag', 'Check if have ondrag attribute');
+ }, 'Check if have ondrag attribute');
+
+ test(function() {
+ assert_inherits(element, 'ondragenter', 'Check if have ondragenter attribute');
+ }, 'Check if have ondragenter attribute');
+
+ test(function() {
+ assert_inherits(element, 'ondragexit', 'Check if have ondragexit attribute');
+ }, 'Check if have ondragexit attribute');
+
+ test(function() {
+ assert_inherits(element, 'ondragleave', 'Check if have dragleave attribute');
+ }, 'Check if have dragleave attribute');
+
+ test(function() {
+ assert_inherits(element, 'ondragover', 'Check if have dragover attribute');
+ }, 'Check if have dragover attribute');
+
+ test(function() {
+ assert_inherits(element, 'ondrop', 'Check if have ondrop attribute');
+ }, 'Check if have ondrop attribute');
+
+ test(function() {
+ assert_inherits(element, 'ondragend', 'Check if have ondragend attribute');
+ }, 'Check if have ondragend attribute');
+
+ on_event(drag, 'dragstart', function(event) {
+ test(function() {
+ assert_equals(event.type, 'dragstart', 'Check if the dragstart event captured');
+ }, 'Check if the dragstart event captured');
+ });
+
+ on_event(drag, 'dragenter', function(event) {
+ test(function() {
+ assert_equals(event.type, 'dragenter', 'Check if the dragenter event captured');
+ }, 'Check if the dragenter event captured');
+ });
+
+ on_event(drag, 'dragend', function(event) {
+ test(function() {
+ assert_equals(event.type, 'dragend', 'Check if the dragend event captured');
+ }, 'Check if the dragend event captured');
+ done();
+ });
+
+
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/dnd/the-draggable-attribute/draggable_attribute.html b/testing/web-platform/tests/html/editing/dnd/the-draggable-attribute/draggable_attribute.html
new file mode 100644
index 000000000..cd9073e10
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-draggable-attribute/draggable_attribute.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: draggable_attribute</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-draggable-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <script src='/html/semantics/interfaces.js'></script>
+ </head>
+
+ <body>
+ <div id='log'> </div>
+
+ <script>
+ elements.forEach(function(a) {
+ test(function() {
+ var eElement = document.createElement(a[0]);
+ assert_inherits(eElement, 'draggable', 'Element ' + a[0] +' should have draggable property');
+ }, 'Element ' + a[0] +' should have draggable property');
+ });
+
+ function run_test(element, element_name, exp) {
+ if (exp) {
+ assert_true(element.draggable, 'Element ' + element_name +' should be draggable');
+ } else {
+ assert_false(element.draggable, 'Element ' + element_name +' should not be draggable');
+ }
+ }
+
+ function run_idl_test(element, element_name, exp) {
+ if (exp) {
+ assert_equals(element.getAttribute('draggable'), 'true', 'Element ' + element_name +' should be draggable');
+ } else {
+ assert_equals(element.getAttribute('draggable'), 'false', 'Element ' + element_name +' should not be draggable');
+ }
+ }
+
+ elements.forEach(function(a) {
+
+ test(function() {
+ //Default values for elements
+ //If the element is an img element, or, if the element is an a element with an href content attribute,
+ //the draggable IDL attribute must return true.
+ var eElement = document.createElement(a[0]);
+ switch (a[0]) {
+ case 'a':
+ eElement.setAttribute('href', 'http://w3.org');
+ run_test(eElement, 'a', true);
+ break;
+ case 'img':
+ run_test(eElement, 'img', true);
+ break;
+ default:
+ run_test(eElement, a[0], false);
+ }
+
+ //If an element's draggable content attribute has the state true,
+ //the draggable IDL attribute must return true.
+ eElement.setAttribute('draggable', 'true');
+ run_test(eElement, a[0] + ' draggable=\'true\'', true);
+
+ //If an element's draggable content attribute has the state false,
+ //the draggable IDL attribute must return false.
+ eElement.setAttribute('draggable', 'false');
+ run_test(eElement, a[0] + ' draggable=\'false\'', false);
+
+ //auto values for elements
+ //The element's draggable content attribute has the state auto.
+ //If the element is an img element, or, if the element is an a element with an href content attribute,
+ //the draggable IDL attribute must return true.
+ switch (a[0]) {
+ case 'a':
+ eElement.setAttribute('href', 'http://w3.org');
+ eElement.setAttribute('draggable', 'auto');
+ run_test(eElement, 'Element ' + 'a' + ' draggable=\'auto\'', true);
+ break;
+ case 'img':
+ eElement.setAttribute('draggable', 'auto');
+ run_test(eElement, 'Element ' + 'img' + ' draggable=\'auto\'', true);
+ break;
+ default:
+ run_test(eElement, 'Element ' + a[0] + ' draggable=\'auto\'', false);
+ }
+
+ //Foo values for elements
+ //The element's draggable content attribute value is not enumerated (true, false, auto) but unexpected.
+ //Fallback to defaults
+ switch (a[0]) {
+ case 'a':
+ eElement.setAttribute('href', 'http://w3.org');
+ eElement.setAttribute('draggable', 'foo');
+ run_test(eElement, 'Element ' + 'a' + ' draggable=\'foo\'', true);
+ break;
+ case 'img':
+ eElement.setAttribute('draggable', 'foo');
+ run_test(eElement, 'Element ' + 'img' + ' draggable=\'foo\'', true);
+ break;
+ default:
+ run_test(eElement, 'Element ' + a[0] + ' draggable=\'foo\'', false);
+ }
+
+ //An element with a draggable attribute should also have a title attribute
+ //that names the element for the purpose of non-visual interactions.
+ eElement.setAttribute('title', 'foo as title value');
+ assert_equals(typeof eElement.title, 'string', '<' + a[0] + '> draggable block has title attribute');
+
+ //If the draggable IDL attribute is set to the value false,
+ //the draggable content attribute must be set to the literal value false.
+ eElement.draggable = false;
+ run_idl_test(eElement, a[0] + '.getAttribute(\'draggable\') is \'false\'', false);
+
+ //If the draggable IDL attribute is set to the value true,
+ //the draggable content attribute must be set to the literal value true.
+ eElement.draggable = true;
+ run_idl_test(eElement, a[0] + '.getAttribute(\'draggable\') is \'true\'', true);
+ }, 'Element ' + a[0] +' draggable attribute test');
+
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute.html
new file mode 100644
index 000000000..feb73eccf
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <meta name="flags" content="may">
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ </head>
+
+ <body>
+ <div id='log'> </div>
+
+ <script>
+ var drop_element;
+
+ setup(function() { drop_element = document.createElement('div'); });
+
+ test(function() {
+ //Empty values for elements
+ drop_element.dropzone = '';
+ assert_not_equals(drop_element.dropzone, undefined, 'div.dropzone should not be undefined if it\'s been set');
+ }, 'div.dropzone should not be undefined if it\'s been set');
+
+ test(function() {
+ drop_element.dropzone = null;
+ assert_not_equals(drop_element.dropzone, null, 'div.dropzone should not be null');
+ }, 'div.dropzone should not be null');
+
+ test(function() {
+ //The dropzone IDL attribute must reflect the content attribute of the same name.
+ drop_element.setAttribute('dropzone', 'copy file:image/png file:image/gif file:image/jpeg');
+ assert_equals(drop_element.dropzone, 'copy file:image/png file:image/gif file:image/jpeg', 'div dropzone idl attribute must reflect the content attribute of the same name');
+ }, 'div dropzone idl attribute must reflect the content attribute of the same name');
+
+ test(function() {
+ //The dropzone content attribute is set to the literal value when the idl attribute value is set.
+ drop_element.dropzone = 'copy file:image/png file:image/gif file:image/jpeg';
+ assert_equals(drop_element.getAttribute('dropzone'), 'copy file:image/png file:image/gif file:image/jpeg', 'div dropzone content attribute is set to the literal value');
+ }, 'div dropzone content attribute is set to the literal value');
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_file_type-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_file_type-manual.html
new file mode 100644
index 000000000..9027559dc
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_file_type-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_data_item_file_type</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 160px;
+ height: 160px;
+ padding: 20px;
+ color: white;
+ }
+ img {
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <img src='/images/blue.png' alt='blue image' />
+ <div>Save the blue image (image/png) above to your desktop, drag the image from desktop to the blue text to rectangular box in browser.</div>
+ <div id='drop' dropzone='copy file:image/png'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ var item = event.dataTransfer.items[0];
+ test(function() {
+ assert_equals(item.type, 'image/png', 'data item type is "image/png"');
+ }, 'data item type is "image/png"');
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_kind_file-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_kind_file-manual.html
new file mode 100644
index 000000000..7a77c1241
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_kind_file-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_data_item_kind_file</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 160px;
+ height: 160px;
+ padding: 20px;
+ color: white;
+ }
+ img {
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <img src='/images/blue.png' alt='blue image' />
+ <div>Save the blue image (image/png) above to your desktop, drag the image from desktop to the blue text to rectangular box in browser.</div>
+ <div id='drop' dropzone='copy file:image/png'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ var item = event.dataTransfer.items[0];
+ test(function() {
+ assert_equals(item.kind, 'file', 'data item kind is file');
+ }, 'data item kind is file');
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_kind_string-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_kind_string-manual.html
new file mode 100644
index 000000000..b8a22e613
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_kind_string-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_data_item_kind_string</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='copy string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ var item = event.dataTransfer.items[0];
+ test(function() {
+ assert_equals(item.kind, 'string', 'data item kind is string');
+ }, 'data item kind is string');
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_string_type-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_string_type-manual.html
new file mode 100644
index 000000000..7a5dccf4e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_string_type-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_data_item_string_type</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='copy string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ var item = event.dataTransfer.items[0];
+ test(function() {
+ assert_equals(item.type, 'text/plain', 'data item type is "text/plain"');
+ }, 'data item type is "text/plain"');
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_inputbox_element-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_inputbox_element-manual.html
new file mode 100644
index 000000000..f80604afa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_inputbox_element-manual.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_inputbox_element</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ input {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select all the inputbox text then drag to rectangular box.</div>
+ <input draggable='true' type='text' value='hello world'></input>
+ <div id='drop' dropzone='move string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'move', 'dropzone content attribute value is "move"');
+ }, 'dropzone content attribute value is "move"');
+
+ test(function() {
+ var item = event.dataTransfer.items[0];
+ assert_equals(event.dataTransfer.getData(item.type), 'hello world', 'The dropped string value is the inputbox text you selected.');
+ }, 'The dropped string value is the inputbox text you selected.');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_inputbox_element_dbcs-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_inputbox_element_dbcs-manual.html
new file mode 100644
index 000000000..a7f8ad1aa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_inputbox_element_dbcs-manual.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_inputbox_element_dbcs</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ input {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select all the inputbox DBCS (Double Byte Character Set) text then drag to rectangular box.</div>
+ <input draggable='true' type='text' value='您好,互联网。'></input>
+ <div id='drop' dropzone='move string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ var item = item = event.dataTransfer.items[0];
+ assert_equals(event.dataTransfer.getData(item.type), '您好,互联网。', 'The dropped string value is the inputbox text you selected.');
+ }, 'The dropped string value is the inputbox text you selected.');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_link_element-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_link_element-manual.html
new file mode 100644
index 000000000..c6e5756ad
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_link_element-manual.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_element_link</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ div { margin: 20px 0px;}
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the all the text of link below to rectangular box.</div>
+ <a href="http://w3.org" title="World Wide Web Consortium">w3.org</a>
+ <div id='drop' dropzone='link string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'link', 'dropzone content attribute value is "link"');
+ }, 'dropzone content attribute value is "link"');
+
+ test(function() {
+ var item = item = event.dataTransfer.items[0];
+ assert_equals(event.dataTransfer.getData(item.type), 'w3.org', 'The dropped link value is "w3.org"');
+ }, 'The dropped link value is "w3.org"');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_COpy-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_COpy-manual.html
new file mode 100644
index 000000000..17ec7a36a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_COpy-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_case_insensitive_COpy</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='COpy string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'copy', 'dropzone content attribute value is case insensitive_COpy');
+ }, 'dropzone content attribute value is case insensitive_COpy');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_STRING-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_STRING-manual.html
new file mode 100644
index 000000000..f118ba00b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_STRING-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_case_insensitive_STRING</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='copy STRING:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'copy', 'dropzone content attribute value is case insensitive_STRING');
+ }, 'dropzone content attribute value is case insensitive_STRING');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_String_-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_String_-manual.html
new file mode 100644
index 000000000..9b8480380
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_String_-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_case_insensitive_String</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='link String:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'link', 'dropzone content attribute value is case insensitive_String');
+ }, 'dropzone content attribute value is case insensitive_String');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_linK-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_linK-manual.html
new file mode 100644
index 000000000..e4364db73
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_case_insensitive_linK-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_case_insensitive_linK</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='liNK string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'link', 'dropzone content attribute value is case insensitive_linK');
+ }, 'dropzone content attribute value is case insensitive_linK');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_copy-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_copy-manual.html
new file mode 100644
index 000000000..dcc7c97ac
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_copy-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_copy</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='copy string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'copy', 'dropzone content attribute value is "copy"');
+ }, 'dropzone content attribute value is "copy"');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_foo-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_foo-manual.html
new file mode 100644
index 000000000..f9606f1b9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_foo-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_foo</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='foo string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'copy', 'dropzone content attribute value is "copy" if it\'s not one of three feedback values (copy, move, and link) specified');
+ }, 'dropzone content attribute value is "copy" if it\'s not one of three feedback values (copy, move, and link) specified');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_link-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_link-manual.html
new file mode 100644
index 000000000..a4ba81965
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_link-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_link</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='link string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'link', 'dropzone content attribute value is "link"');
+ }, 'dropzone content attribute value is "link"');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_move-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_move-manual.html
new file mode 100644
index 000000000..dfad88ba6
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_move-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_move</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='move string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'move', 'dropzone content attribute value is "move"');
+ }, 'dropzone content attribute value is "move"');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_multiple_values_foo_bar_move-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_multiple_values_foo_bar_move-manual.html
new file mode 100644
index 000000000..3243774c9
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_multiple_values_foo_bar_move-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_multiple_values_foo_bar_move</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='foo bar move string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'move', 'dropzone content attribute value is the first matched value of "foo bar move"');
+ }, 'dropzone content attribute value is the first matched value of "foo bar move"');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_multiple_values_foo_link-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_multiple_values_foo_link-manual.html
new file mode 100644
index 000000000..fd9e23d03
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_multiple_values_foo_link-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_multiple_values_foo_link</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='foo link string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'link', 'dropzone content attribute value is the first matched value of "foo link"');
+ }, 'dropzone content attribute value is the first matched value of "foo link"');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_multiple_values_move_copy-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_multiple_values_move_copy-manual.html
new file mode 100644
index 000000000..50ea9369f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_multiple_values_move_copy-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_multiple_values_move_copy</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='move copy string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'move', 'dropzone content attribute value is the first matched value of "move copy"');
+ }, 'dropzone content attribute value is the first matched value of "move copy"');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_not_specified-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_not_specified-manual.html
new file mode 100644
index 000000000..152c30022
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_not_specified-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_not_specified</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='string:text/plain'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'copy', 'dropzone content attribute value is "copy" if it\'s not specified');
+ }, 'dropzone content attribute value is "copy" if it\'s not specified');
+
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_unordered_unique_space_separated-manual.html b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_unordered_unique_space_separated-manual.html
new file mode 100644
index 000000000..24c5b032a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_value_unordered_unique_space_separated-manual.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <title>HTML Test: dropzone_attribute_value_unordered_unique_space_separated</title>
+ <link rel='author' title='Intel' href='http://www.intel.com'>
+ <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <style>
+ #drop {
+ border: 2px solid black;
+ width: 100px;
+ height: 100px;
+ padding: 20px;
+ }
+ #select {
+ color: blue;
+ margin: 20px auto;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div>Select and drag the blue text to rectangular box.</div>
+ <div id='select' draggable>blue text</div>
+ <div id='drop' dropzone='string:text/plain copy'></div>
+ <div id='log'> </div>
+
+ <script>
+ var drop;
+ setup(function() {
+ drop = document.querySelector('#drop');
+ }, {explicit_done: true, explicit_timeout: true});
+
+ on_event(drop, 'drop', function(event) {
+
+ test(function() {
+ assert_equals(event.dataTransfer.dropEffect, 'copy', 'unordered_unique_space_separated "string:text/plain copy", drop effect is copy');
+ }, 'dropzone content attribute value is unordered_unique_space_separated "string:text/plain copy", drop effect is copy');
+ test(function() {
+ item = event.dataTransfer.items[0];
+ assert_equals(item.kind, 'string', 'unordered_unique_space_separated "string:text/plain copy", data item kind is string');
+ }, 'dropzone content attribute value is unordered_unique_space_separated "string:text/plain copy", data item kind is string');
+ test(function() {
+ item = event.dataTransfer.items[0];
+ assert_equals(item.type, 'text/plain', 'dropzone content attribute value is unordered_unique_space_separated "string:text/plain copy", data item type is "text/plain"');
+ }, 'dropzone content attribute value is unordered_unique_space_separated "string:text/plain copy", data item type is "text/plain"');
+ done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/editing-0/.gitkeep b/testing/web-platform/tests/html/editing/editing-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/editing-0/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/editing-0/best-practices-for-in-page-editors/.gitkeep b/testing/web-platform/tests/html/editing/editing-0/best-practices-for-in-page-editors/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/editing-0/best-practices-for-in-page-editors/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/editing-0/contenteditable/.gitkeep b/testing/web-platform/tests/html/editing/editing-0/contenteditable/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/editing-0/contenteditable/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/editing-0/contenteditable/contentEditable-invalidvalue.html b/testing/web-platform/tests/html/editing/editing-0/contenteditable/contentEditable-invalidvalue.html
new file mode 100644
index 000000000..85b71043e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/editing-0/contenteditable/contentEditable-invalidvalue.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>contentEditable setter: invalid value</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#contenteditable">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var el = document.createElement("div");
+ test(function(){
+ assert_throws("SyntaxError", function() {
+ el.contentEditable = "foobar";
+ });
+ }, "setting contentEditable to an invalid value throws a SyntaxError Exception");
+</script>
diff --git a/testing/web-platform/tests/html/editing/editing-0/contenteditable/user-interaction-editing-contenteditable.html b/testing/web-platform/tests/html/editing/editing-0/contenteditable/user-interaction-editing-contenteditable.html
new file mode 100644
index 000000000..9ef867b2d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/editing-0/contenteditable/user-interaction-editing-contenteditable.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Editing: contentEditable attribute test</title>
+ <link rel="author" title="Baidu" href="mailto: guopengcheng@baidu.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#contenteditable"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <div id="log"></div>
+ </head>
+ <body>
+ <script type="text/javascript">
+ var testElement = document.createElement("testElement");
+ test(function() {
+ assert_equals(testElement.contentEditable,"inherit", "check for testElement.contentEditable value");
+ }, "no contentEditable attribute");
+ testElement.setAttribute("contentEditable", "");
+ test(function() {
+ assert_true(testElement.isContentEditable, "check for testElement.isContentEditable value");
+ assert_equals(testElement.contentEditable,"true", "check for testElement.contentEditable value");
+ }, "empty contentEditable attribute");
+ testElement.contentEditable="true";
+ test(function() {
+ assert_true(testElement.isContentEditable, "check for testElement.isContentEditable value");
+ assert_equals(testElement.contentEditable,"true", "check for testElement.contentEditable value");
+ }, "set contentEditable = \"true\"");
+ testElement.contentEditable="false";
+ test(function() {
+ assert_false(testElement.isContentEditable, "check for testElement.isContentEditable value");
+ assert_equals(testElement.contentEditable,"false", "check for testElement.contentEditable value");
+ }, "set contentEditable = \"false\"");
+ testElement.contentEditable="inherit";
+ test(function() {
+ assert_equals(testElement.contentEditable,"inherit", "check for testElement.contentEditable value");
+ }, "set contentEditable = \"inherit\"");
+ var childElement = document.createElement("childElement");
+ testElement.appendChild(childElement);
+ testElement.contentEditable="true";
+ test(function() {
+ assert_true(testElement.isContentEditable, "check for testElement.isContentEditable value");
+ assert_equals(testElement.contentEditable,"true", "check for testElement.contentEditable value");
+ assert_true(childElement.isContentEditable, "check for childElement.isContentEditable value");
+ assert_equals(childElement.contentEditable,"inherit", "check for childElement.contentEditable value");
+ }, "set parent element contentEditable = \"true\"");
+ testElement.contentEditable="false";
+ test(function() {
+ assert_false(testElement.isContentEditable, "check for testElement.isContentEditable value");
+ assert_equals(testElement.contentEditable,"false", "check for testElement.contentEditable value");
+ assert_false(childElement.isContentEditable, "check for childElement.isContentEditable value");
+ assert_equals(childElement.contentEditable,"inherit", "check for childElement.contentEditable value");
+ }, "set parent element contentEditable = \"false\"");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/editing-0/editing-apis/.gitkeep b/testing/web-platform/tests/html/editing/editing-0/editing-apis/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/editing-0/editing-apis/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/.gitkeep b/testing/web-platform/tests/html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/original-id.json b/testing/web-platform/tests/html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/original-id.json
new file mode 100644
index 000000000..8b7c4b838
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/original-id.json
@@ -0,0 +1 @@
+{"original_id":"making-entire-documents-editable:-the-designmode-idl-attribute"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/user-interaction-editing-designMode.html b/testing/web-platform/tests/html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/user-interaction-editing-designMode.html
new file mode 100644
index 000000000..f73ea7326
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/editing-0/making-entire-documents-editable-the-designmode-idl-attribute/user-interaction-editing-designMode.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Editing: designMode attribute test</title>
+ <link rel="author" title="Baidu" href="mailto: guopengcheng@baidu.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#making-entire-documents-editable:-the-designmode-idl-attribute"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <div id="log"></div>
+ </head>
+ <body>
+ <script type="text/javascript">
+ test(function() {
+ assert_equals(document.designMode, "off", "check for designMode value");
+ }, "initial designMode attribute");
+ document.designMode="on";
+ test(function() {
+ assert_equals(document.designMode, "on", "check for designMode value");
+ }, "set designMode = \"on\"");
+ document.designMode="off";
+ test(function() {
+ assert_equals(document.designMode,"off", "check for designMode value");
+ }, "set designMode = \"off\"");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/editing-0/spelling-and-grammar-checking/.gitkeep b/testing/web-platform/tests/html/editing/editing-0/spelling-and-grammar-checking/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/editing-0/spelling-and-grammar-checking/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/editing-0/spelling-and-grammar-checking/user-interaction-editing-spellcheck.html b/testing/web-platform/tests/html/editing/editing-0/spelling-and-grammar-checking/user-interaction-editing-spellcheck.html
new file mode 100644
index 000000000..c8bdaafdb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/editing-0/spelling-and-grammar-checking/user-interaction-editing-spellcheck.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Editing: spellcheck attribute test</title>
+ <link rel="author" title="Baidu" href="mailto: guopengcheng@baidu.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#spelling-and-grammar-checking"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <textarea id="testText1" spellcheck="true">Test textarea with spellcheck is true</textarea>
+ <textarea id="testText2" spellcheck="false">Test textarea with spellcheck is false</textarea>
+ <script type="text/javascript">
+ test(function() {
+ assert_true(document.getElementById("testText1").spellcheck, "check for testText1 spellcheck value");
+ assert_false(document.getElementById("testText2").spellcheck, "check for testText2 spellcheck value");
+ }, "Getting spellcheck IDL attribute");
+ test(function() {
+ var testElement = document.createElement("testElement");
+ testElement.contentEditable = true;
+ testElement.spellcheck = true;
+ assert_true(testElement.spellcheck, "check for testElement.spellcheck value");
+ assert_equals(testElement.getAttribute("spellcheck"), "true");
+ }, "Setting spellcheck IDL attribute to true");
+ test(function() {
+ var testElement = document.createElement("testElement");
+ testElement.contentEditable = true;
+ testElement.spellcheck = false;
+ assert_false(testElement.spellcheck, "check for testText2 spellcheck value");
+ assert_equals(testElement.getAttribute("spellcheck"), "false");
+ }, "Setting spellcheck IDL attribute to false");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/focus/.gitkeep b/testing/web-platform/tests/html/editing/focus/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/focus/document-level-focus-apis/.gitkeep b/testing/web-platform/tests/html/editing/focus/document-level-focus-apis/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/document-level-focus-apis/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/focus/document-level-focus-apis/document-level-apis.html b/testing/web-platform/tests/html/editing/focus/document-level-focus-apis/document-level-apis.html
new file mode 100644
index 000000000..2d8c49c7f
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/document-level-focus-apis/document-level-apis.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: focus - document-level APIs</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#document-level-focus-apis">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<input id="test">
+<script>
+
+test(function () {
+ assert_equals(document.activeElement, document.body, "The active element should be the body element.");
+}, "The body element must be the active element if no element is focused");
+
+test(function () {
+ document.getElementById("test").focus();
+ assert_equals(document.activeElement, document.getElementById("test"), "The active element should be the input element.");
+}, "The element must be the active element if it is focused");
+
+function frame_load () {
+ test(function () {
+ document.getElementById("fr").contentDocument.getElementById("ipt").focus();
+ assert_equals(document.activeElement, document.getElementById("fr"), "The active element should be the iframe element.");
+ }, "When a child browsing context is focused, its browsing context container is also focused");
+}
+
+test(function () {
+ var doc = document.implementation.createHTMLDocument("test");
+ assert_false(doc.hasFocus(), "The hasFocus() method should return false.");
+}, "The hasFocus() method must return false if the Document has no browsing context");
+
+</script>
+<iframe id="fr" src="test.html" onload="frame_load()"></iframe>
diff --git a/testing/web-platform/tests/html/editing/focus/document-level-focus-apis/test.html b/testing/web-platform/tests/html/editing/focus/document-level-focus-apis/test.html
new file mode 100644
index 000000000..90d63e51e
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/document-level-focus-apis/test.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: focus - document-level APIs</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<input id="ipt">
diff --git a/testing/web-platform/tests/html/editing/focus/element-level-focus-apis/.gitkeep b/testing/web-platform/tests/html/editing/focus/element-level-focus-apis/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/element-level-focus-apis/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/focus/focus-01-manual.html b/testing/web-platform/tests/html/editing/focus/focus-01-manual.html
new file mode 100644
index 000000000..16e0b0f6c
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/focus-01-manual.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: focus - key events</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#focus">
+<meta assert="flag" content="interact">
+<meta assert="assert" content="Check if the key events received by document are targeted at the element when it is focused">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<h2>Steps:</h2>
+<ol>
+ <li>Input any character into the textbox by keyboard in 10 seconds.</li>
+</ol>
+<h2>Expect results:</h2>
+<p>PASS</p>
+<div id="log"></div>
+<input id="test">
+<script>
+
+//These tests can be automated once we have an uniform way to use webdriver.
+var t1 = async_test("The keydown event must be targeted at the input element"),
+ t2 = async_test("The keypress event must be targeted at the input element"),
+ t3 = async_test("The keyup event must be targeted at the input element"),
+ testEle;
+
+setup(function () {
+ testEle = document.getElementById("test");
+ testEle.focus();
+}, {timeout: 10000});
+
+document.onkeydown = t1.step_func_done(function(evt){
+ assert_equals(evt.target, testEle, "The keydown events must be targeted at the input element.");
+});
+
+document.onkeypress = t2.step_func_done(function(evt){
+ assert_equals(evt.target, testEle, "The keypress events must be targeted at the input element.");
+});
+
+document.onkeyup = t3.step_func_done(function(evt){
+ assert_equals(evt.target, testEle, "The keyup events must be targeted at the input element.");
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/editing/focus/focus-02-manual.html b/testing/web-platform/tests/html/editing/focus/focus-02-manual.html
new file mode 100644
index 000000000..16dcfcf2a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/focus-02-manual.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: focus - key events</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#focus">
+<meta assert="flag" content="interact">
+<meta assert="assert" content="Check if the key events received by document are targeted at the element when no element is focused">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<h2>Steps:</h2>
+<ol>
+ <li>Press any key in [0-9a-zA-Z].</li>
+</ol>
+<h2>Expect results:</h2>
+<p>PASS</p>
+<div id="log"></div>
+<script>
+
+//These tests can be automated once we have an uniform way to use webdriver.
+var t1 = async_test("The keydown event must be targeted at the body element"),
+ t2 = async_test("The keypress event must be targeted at the body element"),
+ t3 = async_test("The keyup event must be targeted at the body element");
+
+setup({timeout: 10000});
+
+document.onkeydown = t1.step_func_done(function(evt){
+ assert_equals(evt.target, document.body, "The keydown events must be targeted at the document's body.");
+});
+
+document.onkeypress = t2.step_func_done(function(evt){
+ assert_equals(evt.target, document.body, "The keypress events must be targeted at the document's body.");
+});
+
+document.onkeyup = t3.step_func_done(function(evt){
+ assert_equals(evt.target, document.body, "The keyup events must be targeted at the document's body.");
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/editing/focus/focus-management/.gitkeep b/testing/web-platform/tests/html/editing/focus/focus-management/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/focus-management/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/focus/focus-management/focus-event-targets-simple.html b/testing/web-platform/tests/html/editing/focus/focus-management/focus-event-targets-simple.html
new file mode 100644
index 000000000..ab7bcfe6d
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/focus-management/focus-event-targets-simple.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Focus events fire at correct targets in correct order in simple case</title>
+ <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+ <link rel="help" href="https://html.spec.whatwg.org/#focus-update-steps">
+ <link rel="help" href="https://html.spec.whatwg.org/#focus-chain">
+ <meta name="flags" content="dom">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <input type="text" id="a">
+ <script>
+// Record all the focus event targets in an array.
+// Modulo special cases in the "focus update steps" algorithm,
+// this should be the same as the new focus chain, except in reverse order.
+var newFocusChainReversedNotQuite = [];
+var pushTarget = function (e) {
+ newFocusChainReversedNotQuite.push(e.target);
+};
+// Window is the root node for event dispatch per https://html.spec.whatwg.org/multipage/webappapis.html#events-and-the-window-object
+window.addEventListener('focus', pushTarget, true);// Use event capturing since focus event doesn't bubble
+var input = document.getElementById('a');
+input.focus();
+window.removeEventListener('focus', pushTarget, true);
+test(function() {
+ assert_array_equals(newFocusChainReversedNotQuite, [input], "Exactly 1 focus event should fire and its target should be the input");
+}, "Focus events fire at correct targets in correct order in simple case");
+ </script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/editing/focus/focus-management/focus-events.html b/testing/web-platform/tests/html/editing/focus/focus-management/focus-events.html
new file mode 100644
index 000000000..d63362aaa
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/focus-management/focus-events.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Focus management</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#focus-management">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<input type=text id=i1>
+<input type=text id=i2>
+<script>
+ var i1 = document.getElementById('i1'),
+ i2 = document.getElementById('i2'),
+ t1 = async_test("focusing on a focusable element fires a focus event at the element"),
+ t2 = async_test("focusing on a focusable element fires a blur event at the previous focussed element");
+
+ i2.onfocus = t1.step_func_done(function(e){
+ assert_true(e.isTrusted, "focus event is trusted");
+ assert_false(e.bubbles, "focus event doesn't bubble");
+ assert_false(e.cancelable, "focus event is not cancelable");
+ assert_equals(document.activeElement, i2);
+ });
+
+ i1.onblur = t2.step_func_done(function(e){
+ assert_true(e.isTrusted, "blur event is trusted");
+ assert_false(e.bubbles, "blur event doesn't bubble");
+ assert_false(e.cancelable, "blur event is not cancelable");
+ });
+
+ i1.focus();
+ i2.focus();
+</script>
diff --git a/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/.gitkeep b/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-default-value.html b/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-default-value.html
new file mode 100644
index 000000000..25e359c2a
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-default-value.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: focus - default value of tabindex</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#sequential-focus-navigation-and-the-tabindex-attribute">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<button id="test1">TEST1</button>
+<div id="test2">TEST2</div>
+<script>
+
+test(function() {
+ assert_equals(document.getElementById("test1").tabIndex, 0, "The value of tabIndex attribute should be 0.");
+}, "The default value of tabIndex attribute must be 0 for elements that are focusable");
+
+test(function() {
+ assert_equals(document.getElementById("test2").tabIndex, -1, "The value of tabIndex attribute should be -1.");
+}, "The default value of tabIndex attribute must be -1 for elements that are not focusable");
+
+</script>
diff --git a/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-negative-manual.html b/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-negative-manual.html
new file mode 100644
index 000000000..506435074
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-negative-manual.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: focus - negative tabindex</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#sequential-focus-navigation-and-the-tabindex-attribute">
+<meta assert="flag" content="interact">
+<meta assert="assert" content="Check if the tabindex attribute controls whether an element is supposed to be focusable">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<h2>Steps:</h2>
+<ol>
+ <li>Press 'Tab' key in 10 seconds.</li>
+</ol>
+<h2>Expect results:</h2>
+<p>PASS</p>
+<div id="log"></div>
+<form id="fm">
+ <input id="test1" tabindex="-1">
+ <input id="test2" tabindex="0">
+</form>
+<script>
+
+//This test can be automated once we have an uniform way to use webdriver.
+var t = async_test("The element with a negative tabindex must not be focused by press 'Tab' key");
+
+setup({timeout: 10000});
+
+document.forms.fm.addEventListener("focus", function (evt) {
+ t.step(function () {
+ var testEle = document.getElementById("test1");
+ assert_equals(testEle.tabIndex, -1, "The tabIndex attribute of the first input element should be -1.");
+ assert_not_equals(evt.target, testEle, "The second input element must be focused.");
+ assert_equals(document.activeElement, document.getElementById("test2"), "The second input element must be activated.");
+ });
+ t.done();
+}, true);
+
+document.addEventListener("keydown", function (evt) {
+ t.step(function () {
+ assert_equals(evt.keyCode, 9, "Please press 'Tab' key.");
+ });
+}, true);
+
+</script>
diff --git a/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-order-manual.html b/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-order-manual.html
new file mode 100644
index 000000000..c83762629
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-order-manual.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: focus - the sequential focus navigation order</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#sequential-focus-navigation-and-the-tabindex-attribute">
+<meta assert="flag" content="interact">
+<meta assert="assert" content="Check the sequential focus navigation order">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<h2>Steps:</h2>
+<ol>
+ <li>Press 'Tab' key at least 10 times in 20 seconds.(Long press the 'Tab' key will be better.)</li>
+</ol>
+<h2>Expect results:</h2>
+<p>PASS</p>
+<div id="log"></div>
+<form id="fm">
+ <button id="btn0">tabindex(omitted)</button>
+ <button id="btn1" tabindex="">tabindex(empty)</button>
+ <button id="btn2" tabindex="a">tabindex(a)</button>
+ <button id="btn3" tabindex="-1">tabindex(-1)</button>
+ <button id="btn4" tabindex="0">tabindex(0)</button>
+ <button id="btn5" tabindex="3">tabindex(3)</button>
+ <button id="btn6" tabindex="2">tabindex(2)</button>
+ <button id="btn7" tabindex="2">tabindex(2)</button>
+ <button id="btn8" tabindex="2">tabindex(2)</button>
+ <button id="btn9" tabindex="1">tabindex(1)</button>
+</form>
+<script>
+
+//This test can be automated once we have an uniform way to use webdriver.
+var i = 0,
+ expectation = ["btn9", "btn6", "btn7", "btn8", "btn5", "btn0", "btn1", "btn2", "btn4"],
+ results = [],
+ t = async_test("The element with a zero tabindex must be focused by press 'Tab' key");
+
+setup(function () {
+ document.body.focus();
+}, {timeout: 20000});
+
+document.forms.fm.addEventListener("focus", function (evt) {
+ results.push(evt.target.id);
+ if (i >= 9) {
+ t.step(function () {
+ assert_array_equals(results, expectation);
+ });
+ }
+}, true);
+
+document.addEventListener("keydown", function (evt) {
+ if (evt.keyCode === 9) {
+ i += 1;
+ if (i === 10) {
+ t.done();
+ }
+ }
+}, true);
+
+</script>
diff --git a/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-positive-manual.html b/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-positive-manual.html
new file mode 100644
index 000000000..012a3e7ee
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-positive-manual.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: focus - positive tabindex</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#sequential-focus-navigation-and-the-tabindex-attribute">
+<meta assert="flag" content="interact">
+<meta assert="assert" content="Check if the tabindex attribute controls whether an element is supposed to be focusable">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<h2>Steps:</h2>
+<ol>
+ <li>Press 'Tab' key in 10 seconds.</li>
+</ol>
+<h2>Expect results:</h2>
+<p>PASS</p>
+<div id="log"></div>
+<form id="fm">
+ <input id="test" tabindex="1">
+</form>
+<script>
+
+//This test can be automated once we have an uniform way to use webdriver.
+var t = async_test("The element with a positive tabindex must be focused by press 'Tab' key");
+
+setup({timeout: 10000});
+
+document.forms.fm.addEventListener("focus", function (evt) {
+ t.step(function () {
+ var testEle = document.getElementById("test");
+ assert_equals(testEle.tabIndex, 1, "The tabIndex attribute of the input element should be 1.");
+ assert_equals(evt.target, testEle, "The input element must be focused.");
+ assert_equals(document.activeElement, testEle, "The input element must be activated.");
+ });
+ t.done();
+}, true);
+
+document.addEventListener("keydown", function (evt) {
+ t.step(function () {
+ assert_equals(evt.keyCode, 9, "Please press 'Tab' key.");
+ });
+}, true);
+
+</script>
diff --git a/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-zero-manual.html b/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-zero-manual.html
new file mode 100644
index 000000000..108b818b1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-zero-manual.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<head>
+<meta charset="utf-8">
+<title>HTML Test: focus - zero tabindex</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#sequential-focus-navigation-and-the-tabindex-attribute">
+<meta assert="flag" content="interact">
+<meta assert="assert" content="Check if the tabindex attribute controls whether an element is supposed to be focusable">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<h2>Steps:</h2>
+<ol>
+ <li>Press 'Tab' key in 10 seconds.</li>
+</ol>
+<h2>Expect results:</h2>
+<p>PASS</p>
+<div id="log"></div>
+<form id="fm">
+ <input id="test" tabindex="0">
+</form>
+<script>
+
+//This test can be automated once we have an uniform way to use webdriver.
+var t = async_test("The element with a zero tabindex must be focused by press 'Tab' key");
+
+setup({timeout: 10000});
+
+document.forms.fm.addEventListener("focus", function (evt) {
+ t.step(function () {
+ var testEle = document.getElementById("test");
+ assert_equals(testEle.tabIndex, 0, "The tabIndex attribute of the input element should be 0.");
+ assert_equals(evt.target, testEle, "The input element must be focused.");
+ assert_equals(document.activeElement, testEle, "The input element must be activated.");
+ });
+ t.done();
+}, true);
+
+document.addEventListener("keydown", function (evt) {
+ t.step(function () {
+ assert_equals(evt.keyCode, 9, "Please press 'Tab' key.");
+ });
+}, true);
+
+</script>
diff --git a/testing/web-platform/tests/html/editing/inert-subtrees/.gitkeep b/testing/web-platform/tests/html/editing/inert-subtrees/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/inert-subtrees/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/inert-subtrees/the-inert-attribute/.gitkeep b/testing/web-platform/tests/html/editing/inert-subtrees/the-inert-attribute/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/inert-subtrees/the-inert-attribute/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/the-hidden-attribute/.gitkeep b/testing/web-platform/tests/html/editing/the-hidden-attribute/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/the-hidden-attribute/.gitkeep
diff --git a/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1-ref.html b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1-ref.html
new file mode 100644
index 000000000..7346ce919
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1-ref.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<title>The hidden attribute</title>
+<link rel=author title=Ms2ger href=mailto:Ms2ger@gmail.com>
+<p>This line should be visible.
diff --git a/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1a.html b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1a.html
new file mode 100644
index 000000000..036bfc88b
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1a.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<title>The hidden attribute</title>
+<link rel=match href=hidden-1-ref.html>
+<link rel=author title=Ms2ger href=mailto:Ms2ger@gmail.com>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#the-hidden-attribute>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#hidden-elements>
+<p>This line should be visible.
+<p hidden>This line should not be visible.
diff --git a/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1b.html b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1b.html
new file mode 100644
index 000000000..3d8b05d34
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1b.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<title>The hidden attribute</title>
+<link rel=match href=hidden-1-ref.html>
+<link rel=author title=Ms2ger href=mailto:Ms2ger@gmail.com>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#the-hidden-attribute>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#hidden-elements>
+<style>
+p { display: none; }
+[hidden] { display: block; }
+</style>
+<p hidden>This line should be visible.
diff --git a/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1c.html b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1c.html
new file mode 100644
index 000000000..8a8cc63c4
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1c.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<title>The hidden attribute</title>
+<link rel=match href=hidden-1-ref.html>
+<link rel=author title=Ms2ger href=mailto:Ms2ger@gmail.com>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#the-hidden-attribute>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#hidden-elements>
+<p hidden>This line should be visible.
+<p>This line should not be visible.
+<script>
+document.getElementsByTagName("p")[0].hidden = false;
+document.getElementsByTagName("p")[1].hidden = true;
+</script>
diff --git a/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1d.html b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1d.html
new file mode 100644
index 000000000..e759148f2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1d.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<title>The hidden attribute</title>
+<link rel=match href=hidden-1-ref.html>
+<link rel=author title=Ms2ger href=mailto:Ms2ger@gmail.com>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#the-hidden-attribute>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#hidden-elements>
+<p hidden>This line should be visible.
+<p>This line should not be visible.
+<script>
+document.getElementsByTagName("p")[0].removeAttribute("hidden");
+document.getElementsByTagName("p")[1].setAttribute("hidden", "");
+</script>
diff --git a/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1e.html b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1e.html
new file mode 100644
index 000000000..2f3f3c617
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1e.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>The hidden attribute</title>
+<link rel=match href=hidden-1-ref.html>
+<link rel=author title=Ms2ger href=mailto:Ms2ger@gmail.com>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#the-hidden-attribute>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#hidden-elements>
+<style>
+p { display: block; }
+</style>
+<p hidden>This line should be visible.
diff --git a/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1f.html b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1f.html
new file mode 100644
index 000000000..6df30a614
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1f.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>The hidden attribute</title>
+<link rel=match href=hidden-1-ref.html>
+<link rel=author title=Ms2ger href=mailto:Ms2ger@gmail.com>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#the-hidden-attribute>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#hidden-elements>
+<style>
+p { display: block !important; }
+</style>
+<p hidden>This line should be visible.
diff --git a/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1g.html b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1g.html
new file mode 100644
index 000000000..849d61fe1
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-1g.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<title>The hidden attribute</title>
+<link rel=match href=hidden-1-ref.html>
+<link rel=author title=Ms2ger href=mailto:Ms2ger@gmail.com>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#the-hidden-attribute>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#hidden-elements>
+<p>This line should be visible.
+<p hidden=hidden>This line should not be visible.
+<p hidden=blue>This line should not be visible.
+<p hidden=true>This line should not be visible.
+<p hidden=false>This line should not be visible.
diff --git a/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-2-ref.svg b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-2-ref.svg
new file mode 100644
index 000000000..10931bfca
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-2-ref.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20">
+<metadata>
+ <link xmlns="http://www.w3.org/1999/xhtml" rel="author" title="Ms2ger"
+ href="mailto:Ms2ger@gmail.com"/>
+</metadata>
+<rect height="20" width="20"/>
+</svg>
diff --git a/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-2.svg b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-2.svg
new file mode 100644
index 000000000..a5f08f6b2
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/the-hidden-attribute/hidden-2.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20">
+<metadata>
+ <link xmlns="http://www.w3.org/1999/xhtml" rel="match" href="hidden-2-ref.svg" />
+ <link xmlns="http://www.w3.org/1999/xhtml" rel="author" title="Ms2ger"
+ href="mailto:Ms2ger@gmail.com"/>
+ <link xmlns="http://www.w3.org/1999/xhtml" rel="help"
+ href="https://html.spec.whatwg.org/multipage/#the-hidden-attribute"/>
+ <link xmlns="http://www.w3.org/1999/xhtml" rel="help"
+ href="https://html.spec.whatwg.org/multipage/#hidden-elements"/>
+</metadata>
+<rect hidden="" height="20" width="20"/>
+</svg>
diff --git a/testing/web-platform/tests/html/iana/.gitkeep b/testing/web-platform/tests/html/iana/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/.gitkeep
diff --git a/testing/web-platform/tests/html/iana/application-x-www-form-urlencoded/.gitkeep b/testing/web-platform/tests/html/iana/application-x-www-form-urlencoded/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/application-x-www-form-urlencoded/.gitkeep
diff --git a/testing/web-platform/tests/html/iana/application-x-www-form-urlencoded/original-id.json b/testing/web-platform/tests/html/iana/application-x-www-form-urlencoded/original-id.json
new file mode 100644
index 000000000..6a52a7a5f
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/application-x-www-form-urlencoded/original-id.json
@@ -0,0 +1 @@
+{"original_id":"application/x-www-form-urlencoded"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/iana/application-xhtml-xml/.gitkeep b/testing/web-platform/tests/html/iana/application-xhtml-xml/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/application-xhtml-xml/.gitkeep
diff --git a/testing/web-platform/tests/html/iana/application-xhtml-xml/original-id.json b/testing/web-platform/tests/html/iana/application-xhtml-xml/original-id.json
new file mode 100644
index 000000000..b376ccb40
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/application-xhtml-xml/original-id.json
@@ -0,0 +1 @@
+{"original_id":"application/xhtml+xml"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/iana/multipart-x-mixed-replace/.gitkeep b/testing/web-platform/tests/html/iana/multipart-x-mixed-replace/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/multipart-x-mixed-replace/.gitkeep
diff --git a/testing/web-platform/tests/html/iana/multipart-x-mixed-replace/original-id.json b/testing/web-platform/tests/html/iana/multipart-x-mixed-replace/original-id.json
new file mode 100644
index 000000000..2cf8d7770
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/multipart-x-mixed-replace/original-id.json
@@ -0,0 +1 @@
+{"original_id":"multipart/x-mixed-replace"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/iana/ping-to/.gitkeep b/testing/web-platform/tests/html/iana/ping-to/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/ping-to/.gitkeep
diff --git a/testing/web-platform/tests/html/iana/text-cache-manifest/.gitkeep b/testing/web-platform/tests/html/iana/text-cache-manifest/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/text-cache-manifest/.gitkeep
diff --git a/testing/web-platform/tests/html/iana/text-cache-manifest/original-id.json b/testing/web-platform/tests/html/iana/text-cache-manifest/original-id.json
new file mode 100644
index 000000000..b9055c2cd
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/text-cache-manifest/original-id.json
@@ -0,0 +1 @@
+{"original_id":"text/cache-manifest"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/iana/text-html/.gitkeep b/testing/web-platform/tests/html/iana/text-html/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/text-html/.gitkeep
diff --git a/testing/web-platform/tests/html/iana/text-html/original-id.json b/testing/web-platform/tests/html/iana/text-html/original-id.json
new file mode 100644
index 000000000..ff0ed4fbe
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/text-html/original-id.json
@@ -0,0 +1 @@
+{"original_id":"text/html"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/iana/web-scheme-prefix/.gitkeep b/testing/web-platform/tests/html/iana/web-scheme-prefix/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/web-scheme-prefix/.gitkeep
diff --git a/testing/web-platform/tests/html/iana/web-scheme-prefix/original-id.json b/testing/web-platform/tests/html/iana/web-scheme-prefix/original-id.json
new file mode 100644
index 000000000..9db9bc7bf
--- /dev/null
+++ b/testing/web-platform/tests/html/iana/web-scheme-prefix/original-id.json
@@ -0,0 +1 @@
+{"original_id":"web+-scheme-prefix"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/infrastructure/.gitkeep b/testing/web-platform/tests/html/infrastructure/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/case-sensitivity-and-string-comparison/.gitkeep b/testing/web-platform/tests/html/infrastructure/case-sensitivity-and-string-comparison/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/case-sensitivity-and-string-comparison/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/contains.json b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/contains.json
new file mode 100644
index 000000000..b30f1d0d5
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/contains.json
@@ -0,0 +1,14 @@
+[
+ {
+ "id": "htmlallcollection",
+ "original_id": "htmlallcollection"
+ },
+ {
+ "id": "htmlformcontrolscollection",
+ "original_id": "htmlformcontrolscollection"
+ },
+ {
+ "id": "htmloptionscollection",
+ "original_id": "htmloptionscollection"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html
new file mode 100644
index 000000000..9ce8ec350
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML>
+<html id="root">
+<head>
+<title>HTMLAllCollection Tests</title>
+<link rel="author" title="Dan Druta" href="mailto:dan.druta@att.com"/>
+<link rel="help" href="2.7.2.1 - Common Infrastructure/Common DOM Interfaces/Collections/HTMLAllCollection"/>
+<meta name="flags" content="TOKENS" />
+<meta name="assert" content="TEST ASSERTION"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body id="tags">
+<img src="../../../../images/green.png" name="picture">
+<a name="foo"></a>
+<a name="foo"></a>
+<script>
+test(function(){ assert_equals(document.all.length,14)}, "Test for HTMLAllCollection size");
+
+test(function(){ assert_equals(document.all.item(0).tagName,"HTML")}, "Test lookup by index using ()");
+
+test(function(){ assert_equals(document.all[0].tagName,"HTML")}, "Test lookup by index using []");
+
+test(function(){ assert_equals(document.all.item("picture").nodeName,"IMG")}, "Test lookup IMG by name");
+
+test(function(){ assert_equals(document.all.namedItem("picture").nodeName,"IMG")}, "Test lookup IMG by namedItem ");
+
+test(function(){ assert_equals(document.all("picture").nodeName,"IMG")}, "Test lookup IMG in collection using ()");
+
+test(function(){ assert_equals(document.all["picture"].nodeName,"IMG")}, "Test lookup IMG in collection using []");
+
+test(function(){ assert_equals(document.all.picture.nodeName,"IMG")}, "Test lookup IMG in collection using .");
+
+test(function(){ assert_equals(document.all.tags.id,"tags")}, "Test lookup tags in collection using .");
+
+test(function() {
+ assert_equals(document.all["root"], document.documentElement);
+}, "Should find root element too");
+
+test(function() {
+ assert_equals(document.all["foo"].length, 2);
+}, "Should find both anchors and produce a list");
+
+test
+</script>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html
new file mode 100644
index 000000000..8c8e1dbc1
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html
@@ -0,0 +1,116 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: the HTMLFormControlsCollection interface</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/common-dom-interfaces.html#htmlformcontrolscollection">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form id="f1">
+ <input type="radio" id="r1">
+ <keygen id="kg" name="key"></keygen>
+</form>
+<form id="f2">
+ <table>
+ <tr>
+ <td>
+ <input type="checkbox" id="cb">
+ <input type="checkbox" name="cb">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <button id="btn"></button>
+ <button name="btn"></button>
+ </td>
+ </tr>
+ </table>
+</form>
+
+<script>
+
+var coll1, coll2, rdo;
+
+setup(function () {
+ rdo = document.getElementById("r1");
+ coll1 = document.forms[0].elements;
+ coll2 = document.forms[1].elements;
+});
+
+//length
+test(function () {
+ assert_equals(coll1.length, 2, "The length attribute is incorrect.");
+ assert_equals(coll2.length, 4, "The length attribute is incorrect.");
+}, "The length attribute must return the number of elements in the form");
+
+//getter - index
+test(function () {
+ assert_equals(coll1.item(0), rdo, "HTMLFormControlsCollection.item(index) should return the 'input' element in radio status.");
+}, "HTMLFormControlsCollection.item(index) must return the indexed item");
+
+test(function () {
+ assert_equals(coll1[0], rdo, "HTMLFormControlsCollection[index] should return the 'input' element in radio status.");
+}, "HTMLFormControlsCollection[index] must return the indexed item");
+
+//getter - name
+test(function () {
+ assert_throws(TypeError(), function() { coll1("r1") });
+}, "HTMLFormControlsCollection is not callable");
+
+test(function () {
+ assert_equals(coll1["r1"], rdo, "HTMLFormControlsCollection[name] should return the 'input' element in radio status.");
+}, "HTMLFormControlsCollection[name] must return the named item");
+
+//getter - namedItem
+test(function () {
+ assert_equals(coll1.namedItem("r1"), rdo, "HTMLFormControlsCollection.namedItem(name) should return the 'input' element in radio status.");
+}, "HTMLFormControlsCollection.namedItem(name) must return the named item");
+
+test(function () {
+ assert_true(coll1.namedItem("r1") instanceof Element, "Can not return 'Element' object.");
+}, "The namedItem(name) must return an Element");
+
+test(function () {
+ assert_true(coll2.namedItem("cb") instanceof RadioNodeList, "Can not return 'RadioNodeList' object.");
+}, "The namedItem(name) must return RadioNodeList");
+
+test(function () {
+ assert_equals(coll1.namedItem(""), null, "The return value of namedItem() should be null.");
+}, "The namedItem(name) must return null if the name is empty");
+
+test(function () {
+ assert_equals(coll1.namedItem("test"), null, "The return value of namedItem() should be null.");
+}, "The namedItem(name) must return null if there is no matched element");
+
+test(function () {
+ assert_equals(coll1.namedItem("kg"), document.getElementById("kg"), "Controls can be named by 'id' attribute.");
+ assert_equals(coll1.namedItem("key"), document.getElementById("kg"), "Controls can be named by 'name' attribute.");
+}, "Controls can be indexed by id or name attribute");
+
+test(function () {
+ assert_equals(coll2.namedItem("btn").length, 2, "The length attribute should be 2.");
+}, "The namedItem(name) must return the items with id or name attribute");
+
+//various controls in fieldset and form
+var containers = ["form", "fieldset"],
+ controls = ["button", "fieldset", "input", "keygen", "object", "output", "select", "textarea"];
+for (var m = 0; m < containers.length; m++) {
+ test(function () {
+ var container = document.createElement(containers[m]);
+ var len = controls.length;
+ for (var n = 0; n < len; n++)
+ container.appendChild(document.createElement(controls[n]));
+ document.body.appendChild(container);
+ assert_equals(container.elements.length, len, "The length should be " + len + ".");
+ }, "The HTMLFormControlsCollection interface is used for collections of listed elements in " + containers[m] + " element");
+}
+
+//Check the controls' order
+test(function () {
+ var opt = document.forms[1].insertBefore(document.createElement("output"), document.forms[1].firstChild);
+ assert_array_equals(document.forms[1].elements,
+ [opt, document.getElementsByTagName("input")[1], document.getElementsByTagName("input")[2],
+ document.getElementsByTagName("button")[0], document.getElementsByTagName("button")[1]]);
+}, "The controls in the form element must be sorted in tree order");
+
+</script>
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html
new file mode 100644
index 000000000..d39cc460e
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html
@@ -0,0 +1,216 @@
+<!doctype html>
+<title>HTMLOptionsCollection</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#htmloptionscollection-0">
+<select id=a>
+ <option>1</option>
+ <option>2</option>
+ <option>3</option>
+<!--Note whitespace is important-->
+ <option>4</option>
+ <option>5</option>
+</select>
+
+<select id=b>
+ <option id=b1>1</option>
+ <option name=b2>2</option>
+ <option id=b3>3</option>
+ <option id=b3>4</option>
+ <option name=b4>5</option>
+ <option name=b4>6</option>
+ <option id=b5>7</option>
+ <option name=b5>8</option>
+ <option id=b6 name=b7>9</option>
+ <option id=b6 name=b6>10</option>
+ <option id=b8 name=b9>11</option>
+</select>
+
+<script>
+var a;
+var a_opts;
+var a_original_innerHTML;
+var b;
+var b_opts;
+
+setup(function() {
+ a = document.getElementById("a");
+ a_opts = a.options;
+ a_original_innerHTML = a.innerHTML;
+ a.innerHTML = a_original_innerHTML;
+ b = document.getElementById("b");
+ b_opts = b.options;
+ b_original_innerHTML = b.innerHTML;
+ b.innerHTML = b_original_innerHTML;
+})
+
+function assert_values_equals(coll, expected_values, message) {
+ actual = [];
+ for (var i=0; i<coll.length; i++) {
+ actual.push(coll[i].value);
+ }
+ assert_array_equals(actual, expected_values, message);
+}
+
+test(function() {
+ assert_equals(5, a_opts.length);
+}, "Original length");
+
+test(function() {
+ a.innerHTML = a_original_innerHTML;
+ a_opts.value = "3";
+ a_opts.length = 5;
+ assert_equals(a_opts.length, 5);
+ assert_equals(a_opts.value, "3");
+}, "Setting length to original value has no effect");
+
+test(function() {
+ a.innerHTML = a_original_innerHTML;
+ a.value = 3;
+ a_opts.length = 3;
+ assert_equals(3, a_opts.length, "Correct length");
+ assert_values_equals(a_opts, ["1","2","3"], "Correct elements remain")
+ assert_equals(a_opts.value, "3", "Correct value set");
+ assert_equals(a.childNodes.length, 11, "Correct number of child nodes")
+}, "Setting length to shorter value");
+
+test(function() {
+ a.innerHTML = a_original_innerHTML;
+ a.value = 3;
+ a_opts.length = 7;
+ assert_equals(a_opts.length, 7, "Correct length");
+ assert_values_equals(a_opts, ["1","2","3","4","5","",""], "Correct elements inserted")
+ assert_equals(a.value, "3", "Correct value set");
+ assert_equals(a.childNodes.length, 15, "Correct number of child nodes")
+}, "Setting length to longer value");
+
+test(function() {
+ a.innerHTML = a_original_innerHTML;
+ var newChild = document.createElement("p");
+ var newOption = document.createElement("option");
+ newOption.textContent = "6";
+ newChild.appendChild(newOption);
+ a.appendChild(newChild);
+ a.value = 3;
+ assert_equals(a_opts.length, 5, "Correct length");
+ assert_values_equals(a_opts, ["1","2","3","4","5"], "Correct elements inserted")
+ assert_equals(a.value, "3", "Correct value set");
+}, "Insert <p><option>6</option></p> into <select>");
+
+test(function() {
+ a.innerHTML = a_original_innerHTML;
+ var newChild = document.createElement("select");
+ var newOption = document.createElement("option");
+ newOption.textContent = "6";
+ newChild.appendChild(newOption);
+ a.appendChild(newChild);
+ a.value = 3;
+ assert_equals(a_opts.length, 5, "Correct length");
+ assert_values_equals(a_opts, ["1","2","3","4","5"], "Correct elements inserted")
+ assert_equals(a.value, "3", "Correct value set");
+}, "Insert <select><option>6</option></select> into <select>");
+
+test(function() {
+ //This tests the spec but it is probably wrong here; see bug 12665
+ a.innerHTML = a_original_innerHTML;
+ var newChild = document.createElement("optgroup");
+ var newOption = document.createElement("option");
+ newOption.textContent = "6";
+ newChild.appendChild(newOption);
+ a.appendChild(newChild);
+ a.value = 3;
+ assert_equals(a_opts.length, 6, "Correct length");
+ assert_values_equals(a_opts, ["1","2","3","4","5", "6"], "Correct elements inserted")
+ assert_equals(a.value, "3", "Correct value set");
+}, "Insert <optgroup><option>6</option></optgroup> into <select>");
+
+test(function() {
+ a.innerHTML = a_original_innerHTML;
+ var newChild = document.createElement("optgroup");
+ var newChild1 = document.createElement("optgroup");
+ var newOption = document.createElement("option");
+ newOption.textContent = "6";
+ newChild.appendChild(newChild1);
+ newChild1.appendChild(newOption);
+ a.appendChild(newChild);
+ a.value = 3;
+ assert_equals(a_opts.length, 5, "Correct length");
+ assert_values_equals(a_opts, ["1","2","3","4","5"], "Correct elements inserted")
+ assert_equals(a.value, "3", "Correct value set");
+}, "Insert <optgroup><optgroup><option>6</option></optgroup></optgroup> into <select>");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b1").value, "1");
+}, "namedItem id attribute");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b2").value, "2");
+}, "namedItem name attribute");
+
+test(function() {
+ assert_equals(b_opts.namedItem("c"), null);
+}, "namedItem doesn't match anything");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b3").value, "3");
+}, "namedItem multiple IDs");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b4").value, "5");
+}, "namedItem multiple names");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b5").value, "7");
+}, "namedItem multiple name and ID");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b6").value, "9");
+}, "namedItem multiple name and ID with multiple attributes");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b8").value, "11");
+}, "namedItem id attribute multiple attributes one element");
+
+test(function() {
+ assert_equals(b_opts.namedItem("b9").value, "11");
+}, "namedItem name attribute multiple attributes one element");
+
+test(function() {
+ assert_true(b_opts[0] instanceof HTMLOptionElement);
+ assert_equals(b_opts[0].innerHTML, "1");
+}, "HTMLOptionsCollection [index] method return the item with index");
+
+test(function() {
+ assert_true(b_opts["b2"] instanceof HTMLOptionElement);
+ assert_equals(b_opts["b2"].innerHTML, "2");
+}, "HTMLOptionsCollection [name] method return the item with name");
+
+test(function() {
+ assert_true(b_opts.item(0) instanceof HTMLOptionElement);
+ assert_equals(b_opts.item(0).innerHTML, "1");
+}, "HTMLOptionsCollection.item(index) method return the item with index");
+
+test(function() {
+ assert_true(b_opts.item("b2") instanceof HTMLOptionElement);
+ assert_equals(b_opts.item("b2").innerHTML, "1");
+}, "HTMLOptionsCollection.item(name) method return the item with index 0");
+
+test(function() {
+ var b_opts_length = b_opts.length;
+ b_opts.add(new Option("2", "2"));
+ assert_equals(b_opts[b_opts_length].value, "2");
+}, "HTMLOptionsCollection.add method insert HTMLOptionElement Option element");
+
+test(function() {
+ var b_opts_length = b_opts.length;
+ b_opts.remove(0);
+ assert_equals(b_opts.length, b_opts_length - 1);
+}, "HTMLOptionsCollection.remove method remove Option element by index");
+
+test(function() {
+ var add = document.createElement("p");
+ assert_throws(new TypeError(), function() {b_opts.add(add);});
+}, "Add non-option to collection");
+
+</script>
+<div id=log></div>
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html
new file mode 100644
index 000000000..fc70d7172
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: the RadioNodeList interface</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/common-dom-interfaces.html#radionodelist">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form >
+ <input type="checkbox" name="rdo" value="0" id="r0" checked>
+ <input type="radio" name="rdo" id="r1">
+ <input type="radio" name="rdo" id="r2" value="2">
+</form>
+<script>
+
+var rdoList;
+
+setup(function () {
+ rdoList = document.forms[0].elements.namedItem("rdo");
+});
+
+//on getting
+test(function () {
+ assert_equals(rdoList.value, "", "The value attribute should be empty.");
+}, "The value attribute should be empty if no element is checked");
+
+test(function () {
+ document.getElementById("r2").checked = true;
+ assert_equals(rdoList.value, "2", "The value attribute should be 2.");
+}, "The RadioNodeList.value must be the first checked radio button's value");
+
+test(function () {
+ document.getElementById("r1").checked = true;
+ assert_equals(rdoList.value, "on", "The value attribute should be on.");
+
+ document.getElementById("r1").value = 1;
+ assert_equals(rdoList.value, "1", "The value attribute should be 1.");
+}, "Check the RadioNodeList.value on getting");
+
+//on setting
+test(function () {
+ assert_equals(rdoList.value, document.getElementById("r1").value,
+ "The value attribute should be equal to the first checked radio input element's value.");
+ assert_false(document.getElementById("r2").checked,
+ "The second radio input element should not be checked.");
+
+ rdoList.value = "2";
+ assert_equals(rdoList.value, document.getElementById("r2").value,
+ "The value attribute should be equal to the second radio input element's value.");
+ assert_true(document.getElementById("r2").checked,
+ "The second radio input element should be checked.");
+
+ //Do nothing if no element's value is equal to new value.
+ rdoList.value = "3";
+ assert_equals(rdoList.value, document.getElementById("r2").value,
+ "The value attribute should be the second radio input element's value.");
+ assert_true(document.getElementById("r2").checked,
+ "The second radio input element should be checked.");
+}, "Check the RadioNodeList.value on setting");
+
+//setting to on, specific case
+test(function () {
+ rdoList.value = "on";
+ assert_equals(rdoList.value, document.getElementById("r2").value,
+ "The value attribute should be the second radio input element's value.");
+ assert_true(document.getElementById("r2").checked,
+ "The second radio input element should be checked.");
+
+ document.getElementById("r1").removeAttribute("value");
+ rdoList.value = "on";
+ assert_equals(rdoList.value, document.getElementById("r1").value,
+ "The value attribute should be the first radio input element's value.");
+ assert_true(document.getElementById("r1").checked,
+ "The first radio input element should be checked.");
+}, "Check the RadioNodeList.value on setting to 'on'");
+
+
+</script>
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/domstringmap/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/domstringmap/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/domstringmap/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/garbage-collection/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/garbage-collection/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/garbage-collection/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/reflecting-content-attributes-in-idl-attributes/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/reflecting-content-attributes-in-idl-attributes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/reflecting-content-attributes-in-idl-attributes/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/safe-passing-of-structured-data/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/safe-passing-of-structured-data/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/safe-passing-of-structured-data/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/transferable-objects/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/transferable-objects/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/transferable-objects/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/boolean-attributes/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/boolean-attributes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/boolean-attributes/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/colors/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/colors/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/colors/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/comma-separated-tokens/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/comma-separated-tokens/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/comma-separated-tokens/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/common-parser-idioms/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/common-parser-idioms/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/common-parser-idioms/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/dates-and-times/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/dates-and-times/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/dates-and-times/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/dates-and-times/contains.json b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/dates-and-times/contains.json
new file mode 100644
index 000000000..5be31eb48
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/dates-and-times/contains.json
@@ -0,0 +1,42 @@
+[
+ {
+ "id": "months",
+ "original_id": "months"
+ },
+ {
+ "id": "dates",
+ "original_id": "dates"
+ },
+ {
+ "id": "yearless-dates",
+ "original_id": "yearless-dates"
+ },
+ {
+ "id": "times",
+ "original_id": "times"
+ },
+ {
+ "id": "local-dates-and-times",
+ "original_id": "local-dates-and-times"
+ },
+ {
+ "id": "time-zones",
+ "original_id": "time-zones"
+ },
+ {
+ "id": "global-dates-and-times",
+ "original_id": "global-dates-and-times"
+ },
+ {
+ "id": "weeks",
+ "original_id": "weeks"
+ },
+ {
+ "id": "durations",
+ "original_id": "durations"
+ },
+ {
+ "id": "vaguer-moments-in-time",
+ "original_id": "vaguer-moments-in-time"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/keywords-and-enumerated-attributes/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/keywords-and-enumerated-attributes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/keywords-and-enumerated-attributes/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/mq/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/mq/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/mq/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/numbers/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/numbers/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/numbers/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/numbers/contains.json b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/numbers/contains.json
new file mode 100644
index 000000000..39a6ea005
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/numbers/contains.json
@@ -0,0 +1,26 @@
+[
+ {
+ "id": "signed-integers",
+ "original_id": "signed-integers"
+ },
+ {
+ "id": "non-negative-integers",
+ "original_id": "non-negative-integers"
+ },
+ {
+ "id": "floating-point-numbers",
+ "original_id": "floating-point-numbers"
+ },
+ {
+ "id": "percentages-and-dimensions",
+ "original_id": "percentages-and-dimensions"
+ },
+ {
+ "id": "lists-of-integers",
+ "original_id": "lists-of-integers"
+ },
+ {
+ "id": "lists-of-dimensions",
+ "original_id": "lists-of-dimensions"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/space-separated-tokens/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/space-separated-tokens/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/space-separated-tokens/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/syntax-references/.gitkeep b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/syntax-references/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/syntax-references/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/conformance-requirements/.gitkeep b/testing/web-platform/tests/html/infrastructure/conformance-requirements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/conformance-requirements/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/conformance-requirements/conformance-classes/.gitkeep b/testing/web-platform/tests/html/infrastructure/conformance-requirements/conformance-classes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/conformance-requirements/conformance-classes/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/conformance-requirements/dependencies/.gitkeep b/testing/web-platform/tests/html/infrastructure/conformance-requirements/dependencies/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/conformance-requirements/dependencies/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/conformance-requirements/extensibility/.gitkeep b/testing/web-platform/tests/html/infrastructure/conformance-requirements/extensibility/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/conformance-requirements/extensibility/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/conformance-requirements/extensibility/foreign.html b/testing/web-platform/tests/html/infrastructure/conformance-requirements/extensibility/foreign.html
new file mode 100644
index 000000000..eaa133bad
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/conformance-requirements/extensibility/foreign.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html lang="en" foo='bar'>
+ <head foo='bar'>
+ <meta charset="utf-8" foo='bar'>
+ <title id='title' foo='bar'>Foreign content</title>
+ <link rel="author" title="Philippe Le Hegaret" href="mailto:plh@w3.org" foo='bar'>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#extensibility" foo='bar'>
+ <script src="/resources/testharness.js" foo='bar'></script>
+ <script src="/resources/testharnessreport.js" foo='bar'></script>
+ </head>
+
+ <body foo='bar'>
+
+ <p class='assert' foo='bar'>User agents must treat elements and attributes that they do not understand as semantically neutral; leaving them in the DOM (for DOM processors), and styling them according to CSS (for CSS processors), but not inferring any meaning from them.</p>
+
+ <foo foo='bar' echo>Foobar</foo>
+
+ <div id="log">Running test...</div>
+
+ <script>
+ var t = async_test("foreign content");
+
+ on_event(window, "load",
+ t.step_func(function() {
+ var nodes = document.getElementsByTagName("*");
+ var cont = true;
+ var last = null;
+ for(var i=0;i<nodes.length && cont; i++) {
+ var as = nodes.item(i).getAttribute("foo");
+ if (!(as === "bar") && (nodes.item(i).getAttribute("id") === "log")) {
+ cont = false;
+ } else {
+ last = nodes.item(i);
+ assert_equals(as, "bar");
+ }
+ }
+
+ assert_equals(last.nodeName, "FOO");
+ assert_equals(last.getAttribute("echo"), "");
+ assert_equals(last.getAttribute("charly"), null);
+ t.done();
+ }));
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/infrastructure/fetching-resources/.gitkeep b/testing/web-platform/tests/html/infrastructure/fetching-resources/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/fetching-resources/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/fetching-resources/content-type-sniffing/.gitkeep b/testing/web-platform/tests/html/infrastructure/fetching-resources/content-type-sniffing/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/fetching-resources/content-type-sniffing/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/fetching-resources/cors-enabled-fetch/.gitkeep b/testing/web-platform/tests/html/infrastructure/fetching-resources/cors-enabled-fetch/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/fetching-resources/cors-enabled-fetch/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/fetching-resources/cors-settings-attributes/.gitkeep b/testing/web-platform/tests/html/infrastructure/fetching-resources/cors-settings-attributes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/fetching-resources/cors-settings-attributes/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/fetching-resources/encrypted-http-and-related-security-concerns/.gitkeep b/testing/web-platform/tests/html/infrastructure/fetching-resources/encrypted-http-and-related-security-concerns/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/fetching-resources/encrypted-http-and-related-security-concerns/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/fetching-resources/extracting-character-encodings-from-meta-elements/.gitkeep b/testing/web-platform/tests/html/infrastructure/fetching-resources/extracting-character-encodings-from-meta-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/fetching-resources/extracting-character-encodings-from-meta-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/fetching-resources/processing-model/.gitkeep b/testing/web-platform/tests/html/infrastructure/fetching-resources/processing-model/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/fetching-resources/processing-model/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/fetching-resources/terminology-1/.gitkeep b/testing/web-platform/tests/html/infrastructure/fetching-resources/terminology-1/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/fetching-resources/terminology-1/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/namespaces/.gitkeep b/testing/web-platform/tests/html/infrastructure/namespaces/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/namespaces/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/terminology/.gitkeep b/testing/web-platform/tests/html/infrastructure/terminology/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/terminology/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/terminology/character-encodings/.gitkeep b/testing/web-platform/tests/html/infrastructure/terminology/character-encodings/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/terminology/character-encodings/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/terminology/dom-trees/.gitkeep b/testing/web-platform/tests/html/infrastructure/terminology/dom-trees/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/terminology/dom-trees/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/terminology/plugins/.gitkeep b/testing/web-platform/tests/html/infrastructure/terminology/plugins/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/terminology/plugins/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/terminology/plugins/sample.txt b/testing/web-platform/tests/html/infrastructure/terminology/plugins/sample.txt
new file mode 100644
index 000000000..cedecd6d8
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/terminology/plugins/sample.txt
@@ -0,0 +1,3 @@
+This is a sample text/plain document.
+
+This is not an HTML document.
diff --git a/testing/web-platform/tests/html/infrastructure/terminology/plugins/text-plain.html b/testing/web-platform/tests/html/infrastructure/terminology/plugins/text-plain.html
new file mode 100644
index 000000000..0ed0ce23b
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/terminology/plugins/text-plain.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title id='title'>Media Types</title>
+ <link rel="author" title="Philippe Le Hegaret" href="mailto:plh@w3.org"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#plugins"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+
+ <body>
+ <script>
+ var t = async_test("A user agent must not consider the type text/plain as having a registered plugin.");
+
+ window.onload =
+ t.step_func(function() {
+ assert_equals(document.getElementById("frameContext").contentDocument.body.firstChild.nodeName, "PRE");
+ t.done();
+ });
+ </script>
+
+ <h1>Test of plugin support</h1>
+ <p class='assert'>A user agent must not consider the types text/plain and application/octet-stream as having a registered plugin.</p>
+
+ <iframe id="frameContext" src="sample.txt"></iframe>
+
+
+ <div id="log">Running test...</div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/infrastructure/terminology/resources/.gitkeep b/testing/web-platform/tests/html/infrastructure/terminology/resources/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/terminology/resources/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/terminology/scripting-0/.gitkeep b/testing/web-platform/tests/html/infrastructure/terminology/scripting-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/terminology/scripting-0/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/terminology/xml/.gitkeep b/testing/web-platform/tests/html/infrastructure/terminology/xml/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/terminology/xml/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/urls/.gitkeep b/testing/web-platform/tests/html/infrastructure/urls/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/urls/base-urls/.gitkeep b/testing/web-platform/tests/html/infrastructure/urls/base-urls/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/base-urls/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/.gitkeep b/testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.xhtml b/testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.xhtml
new file mode 100644
index 000000000..7302ed6e2
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.xhtml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html id="h" xmlns="http://www.w3.org/1999/xhtml" xml:base="">
+ <head>
+ <title>HTML Test: Dynamic changes to base URLs</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dynamic-changes-to-base-urls" />
+ <script src="/resources/testharness.js" id="s1"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="div" style="display:none" xml:base=""></div>
+ <script>
+ <![CDATA[
+ var div = document.getElementById("div"),
+ html = document.getElementById("h"),
+ url = document.location.href;
+
+ var testData = [
+ {elements: ["a", "link", "area"], set: "href", get: "href"},
+ {elements: ["q", "blockquote", "ins", "del"], set: "cite", get: "cite"},
+ {elements: ["img", "embed", "video", "iframe", "script", "source", "track"], set: "src", get: "src"},
+ {elements: ["form"], set: "action", get: "action"},
+ {elements: ["object"], set: "data", get: "data"},
+ {elements: ["button"], set: "formaction", get: "formAction"}
+ ];
+
+ for (var i in testData) {
+ var item = testData[i];
+ for (var j in item.elements) {
+ test(function () {
+ var ele = document.createElement(item.elements[j]);
+
+ ele.setAttribute(item.set, "test.txt");
+ div.appendChild(ele);
+
+ html.setAttribute("xml:base", "");
+ assert_equals(ele[item.get], url.substr(0, url.lastIndexOf("/")) +"/test.txt", "The '" + item.get + "' attribute is incorrect.");
+ html.setAttribute("xml:base", "http://{{domains[www]}}:{{ports[http][0]}}");
+ assert_equals(ele[item.get], "http://{{domains[www]}}:{{ports[http][0]}}/test.txt", "The '" + item.get + "' attribute is incorrect.");
+ }, "The '" + item.set + "' attribute of the '" + item.elements[j] + "' element");
+ }
+ }
+
+ test(function () {
+ var s1 = document.getElementById("s1");
+ var val1 = s1.src;
+ var val2 = div.firstChild.href;
+
+ div.setAttribute("xml:base", "http://{{domains[www2]}}:{{ports[http][0]}}");
+ assert_equals(s1.src, val1, "The outer element must not be effected.");
+ assert_not_equals(div.firstChild.href, val2, "The inner element must be effected.");
+ assert_equals(div.firstChild.href, "http://{{domains[www2]}}:{{ports[http][0]}}/test.txt");
+ }, "Change the base URL must effect the descendant elements only");
+ ]]>
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/infrastructure/urls/interfaces-for-url-manipulation/.gitkeep b/testing/web-platform/tests/html/infrastructure/urls/interfaces-for-url-manipulation/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/interfaces-for-url-manipulation/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/urls/parsing-urls/.gitkeep b/testing/web-platform/tests/html/infrastructure/urls/parsing-urls/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/parsing-urls/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/.gitkeep b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/blank.py b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/blank.py
new file mode 100644
index 000000000..6274a4e3c
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/blank.py
@@ -0,0 +1,2 @@
+def main(request, response):
+ return [("Content-Type", "text/html; charset=%s" % (request.GET['encoding']))], ""
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/css-tmpl.py b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/css-tmpl.py
new file mode 100644
index 000000000..d7c9bce27
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/css-tmpl.py
@@ -0,0 +1,5 @@
+def main(request, response):
+ encoding = request.GET['encoding']
+ tmpl = request.GET['tmpl']
+ sheet = tmpl % u'\\0000E5'
+ return [("Content-Type", "text/css; charset=%s" % encoding)], sheet.encode(encoding)
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/manifest.py b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/manifest.py
new file mode 100644
index 000000000..05b47f816
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/manifest.py
@@ -0,0 +1,12 @@
+def main(request, response):
+ id = request.GET['id']
+ mode = request.GET['mode']
+ fallback_url = ""
+ if mode == "FALLBACK":
+ fallback_url = "fallback-namespace/"
+ manifest = u"""CACHE MANIFEST
+
+%s:
+%s stash.py?q=\u00E5&id=%s&action=put
+""" % (mode, fallback_url, id)
+ return [("Content-Type", "text/cache-manifest; charset=%s" % request.GET['encoding'])], manifest.encode('utf-8') # charset should be ignored for cache manifests
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/page-using-manifest.py b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/page-using-manifest.py
new file mode 100644
index 000000000..401d741a4
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/page-using-manifest.py
@@ -0,0 +1,12 @@
+def main(request, response):
+ id = request.GET['id']
+ encoding = request.GET['encoding']
+ mode = request.GET['mode']
+ iframe = ""
+ if mode == 'NETWORK':
+ iframe = "<iframe src='stash.py?q=%%C3%%A5&id=%s&action=put'></iframe>" % id
+ doc = """<!doctype html>
+<html manifest="manifest.py?id=%s&encoding=%s&mode=%s">
+%s
+""" % (id, encoding, mode, iframe)
+ return [("Content-Type", "text/html; charset=%s" % encoding)], doc.encode(encoding)
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js
new file mode 100644
index 000000000..b1b78e7f4
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js
@@ -0,0 +1,932 @@
+setup({explicit_done:true});
+onload = function() {
+ var encoding = '{{GET[encoding]}}';
+ var input_url = 'resources/resource.py?q=\u00E5&encoding=' + encoding + '&type=';
+ ('html css js worker sharedworker worker_importScripts sharedworker_importScripts worker_worker worker_sharedworker sharedworker_worker '+
+ 'sharedworker_sharedworker eventstream png svg xmlstylesheet_css video webvtt').split(' ').forEach(function(str) {
+ window['input_url_'+str] = input_url + str;
+ });
+ var blank = 'resources/blank.py?encoding=' + encoding;
+ var stash_put = 'resources/stash.py?q=\u00E5&action=put&id=';
+ var stash_take = 'resources/stash.py?action=take&id=';
+ var expected_obj = {
+ 'utf-8':'%C3%A5',
+ 'utf-16be':'%C3%A5',
+ 'utf-16le':'%C3%A5',
+ 'windows-1252':'%E5',
+ 'windows-1251':'%3F'
+ };
+ var expected_current = expected_obj[encoding];
+ var expected_utf8 = expected_obj['utf-8'];
+
+ function msg(expected, got) {
+ return 'expected substring '+expected+' got '+got;
+ }
+
+ function poll_for_stash(test_obj, uuid, expected) {
+ var start = new Date();
+ var poll = test_obj.step_func(function () {
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', stash_take + uuid);
+ xhr.onload = test_obj.step_func(function(e) {
+ if (xhr.response == "") {
+ if (new Date() - start > 10000) {
+ // If we set the status to TIMEOUT here we avoid a race between the
+ // page and the test timing out
+ test_obj.force_timeout();
+ }
+ setTimeout(poll, 200);
+ } else {
+ assert_equals(xhr.response, expected);
+ test_obj.done();
+ }
+ });
+ xhr.send();
+ })
+ setTimeout(poll, 200);
+ }
+
+ // background attribute, check with getComputedStyle
+ function test_background(tag) {
+ var spec_url = 'https://html.spec.whatwg.org/multipage/multipage/rendering.html';
+ spec_url += tag == 'body' ? '#the-page' : '#tables';
+ test(function() {
+ var elm = document.createElement(tag);
+ document.body.appendChild(elm);
+ this.add_cleanup(function() {
+ document.body.removeChild(elm);
+ });
+ elm.setAttribute('background', input_url_png);
+ var got = getComputedStyle(elm).backgroundImage;
+ assert_true(got.indexOf(expected_current) > -1, msg(expected_current, got));
+ }, 'getComputedStyle <'+tag+' background>',
+ {help:spec_url});
+ }
+
+ 'body, table, thead, tbody, tfoot, tr, td, th'.split(', ').forEach(function(str) {
+ test_background(str);
+ });
+
+ // get a reflecting IDL attributes whose content attribute takes a URL or a list of space-separated URLs
+ function test_reflecting(tag, attr, idlAttr, multiple) {
+ idlAttr = idlAttr || attr;
+ var input = input_url_html;
+ if (multiple) {
+ input += ' ' + input;
+ }
+ test(function() {
+ var elm = document.createElement(tag);
+ assert_true(idlAttr in elm, idlAttr + ' is not supported');
+ elm.setAttribute(attr, input);
+ var got = elm[idlAttr];
+ assert_true(got.indexOf(expected_current) > -1, msg(expected_current, got));
+ }, 'Getting <'+tag+'>.'+idlAttr + (multiple ? ' (multiple URLs)' : ''),
+ {help:'https://html.spec.whatwg.org/multipage/multipage/common-dom-interfaces.html#reflecting-content-attributes-in-idl-attributes'});
+ }
+
+ ('iframe src, a href, base href, link href, img src, embed src, object data, track src, video src, audio src, input src, form action, ' +
+ 'input formaction formAction, button formaction formAction, menuitem icon, script src').split(', ').forEach(function(str) {
+ var arr = str.split(' ');
+ test_reflecting(arr[0], arr[1], arr[2]);
+ });
+
+ 'a ping'.split(', ').forEach(function(str) {
+ var arr = str.split(' ');
+ test_reflecting(arr[0], arr[1], arr[2], true);
+ });
+
+ function setup_navigation(elm, iframe, id, test_obj) {
+ iframe.name = id;
+ elm.target = id;
+ elm.setAttribute('href', input_url_html);
+ document.body.appendChild(iframe);
+ document.body.appendChild(elm);
+ test_obj.add_cleanup(function() {
+ document.body.removeChild(iframe);
+ document.body.removeChild(elm);
+ });
+ }
+
+ // follow hyperlink
+ function test_follow_link(tag) {
+ async_test(function() {
+ var elm = document.createElement(tag);
+ var iframe = document.createElement('iframe');
+ setup_navigation(elm, iframe, 'test_follow_link_'+tag, this);
+ iframe.onload = this.step_func_done(function() { // when the page navigated to has loaded
+ assert_equals(iframe.contentDocument.body.textContent, expected_current);
+ });
+ // follow the hyperlink
+ elm.click();
+ // check that navigation succeeded by ...??? XXX
+ }, 'follow hyperlink <'+tag+' href>',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/links.html#following-hyperlinks'});
+ }
+
+ 'a, area, link'.split(', ').forEach(function(str) {
+ test_follow_link(str);
+ });
+
+ // follow hyperlink with ping attribute
+ function test_follow_link_ping(tag) {
+ async_test(function() {
+ var uuid = token();
+ var elm = document.createElement(tag);
+ // check if ping is supported
+ assert_true('ping' in elm, 'ping not supported');
+ elm.setAttribute('ping', stash_put + uuid);
+ var iframe = document.createElement('iframe');
+ setup_navigation(elm, iframe, 'test_follow_link_ping_'+tag, this);
+ // follow the hyperlink
+ elm.click();
+ // check that navigation succeeded by ...??? XXX
+ // check that the right URL was requested for the ping
+ poll_for_stash(this, uuid, expected_current);
+ }, 'hyperlink auditing <'+tag+' ping>',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/links.html#hyperlink-auditing'});
+ }
+
+ 'a, area'.split(', ').forEach(function(str) {
+ test_follow_link_ping(str);
+ });
+
+ // navigating with meta refresh
+ async_test(function() {
+ var iframe = document.createElement('iframe');
+ iframe.src = blank;
+ document.body.appendChild(iframe);
+ this.add_cleanup(function() {
+ document.body.removeChild(iframe);
+ });
+ iframe.onload = this.step_func_done(function() {
+ var doc = iframe.contentDocument;
+ var got = doc.body.textContent;
+ if (got == '') {
+ doc.write('<meta http-equiv=refresh content="0; URL='+input_url_html+'">REFRESH');
+ doc.close();
+ return;
+ }
+ assert_equals(got, expected_current);
+ });
+ }, 'meta refresh',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/semantics.html#attr-meta-http-equiv-refresh'});
+
+ // loading html (or actually svg to support <embed>)
+ function test_load_nested_browsing_context(tag, attr, spec_url) {
+ async_test(function() {
+ var id = 'test_load_nested_browsing_context_'+tag;
+ var elm = document.createElement(tag);
+ elm.setAttribute(attr, input_url_svg);
+ elm.name = id;
+ document.body.appendChild(elm);
+ this.add_cleanup(function() {
+ document.body.removeChild(elm);
+ });
+ elm.onload = this.step_func_done(function() {
+ assert_equals(window[id].document.documentElement.textContent, expected_current);
+ });
+
+ }, 'load nested browsing context <'+tag+' '+attr+'>',
+ {help:spec_url});
+ }
+
+ spec_url_load_nested_browsing_context = {
+ frame:'https://html.spec.whatwg.org/multipage/multipage/obsolete.html#process-the-frame-attributes',
+ iframe:'https://html.spec.whatwg.org/multipage/multipage/the-iframe-element.html#process-the-iframe-attributes',
+ object:'https://html.spec.whatwg.org/multipage/multipage/the-iframe-element.html#the-object-element',
+ embed:'https://html.spec.whatwg.org/multipage/multipage/the-iframe-element.html#the-embed-element-setup-steps'
+ };
+
+ 'frame src, iframe src, object data, embed src'.split(', ').forEach(function(str) {
+ var arr = str.split(' ');
+ test_load_nested_browsing_context(arr[0], arr[1], spec_url_load_nested_browsing_context[arr[0]]);
+ });
+
+ // loading css with <link>
+ async_test(function() {
+ var elm = document.createElement('link');
+ elm.href = input_url_css;
+ elm.rel = 'stylesheet';
+ document.head.appendChild(elm);
+ this.add_cleanup(function() {
+ document.head.removeChild(elm);
+ });
+ elm.onload = this.step_func_done(function() {
+ var got = elm.sheet.href;
+ assert_true(elm.sheet.href.indexOf(expected_current) > -1, 'sheet.href ' + msg(expected_current, got));
+ assert_equals(elm.sheet.cssRules[0].style.content, '"'+expected_current+'"', 'sheet.cssRules[0].style.content');
+ });
+ }, 'loading css <link>',
+ {help:['https://html.spec.whatwg.org/multipage/multipage/semantics.html#the-link-element',
+ 'https://html.spec.whatwg.org/multipage/multipage/semantics.html#styling']});
+
+ // loading js
+ async_test(function() {
+ var elm = document.createElement('script');
+ elm.src = input_url_js + '&var=test_load_js_got';
+ document.head.appendChild(elm); // no cleanup
+ elm.onload = this.step_func_done(function() {
+ assert_equals(window.test_load_js_got, expected_current);
+ });
+ }, 'loading js <script>',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/scripting-1.html#prepare-a-script'});
+
+ // loading image
+ function test_load_image(tag, attr, spec_url) {
+ async_test(function() {
+ var elm = document.createElement(tag);
+ if (tag == 'input') {
+ elm.type = 'image';
+ }
+ elm.setAttribute(attr, input_url_png);
+ document.body.appendChild(elm);
+ this.add_cleanup(function() {
+ document.body.removeChild(elm);
+ });
+ elm.onload = this.step_func_done(function() {
+ var got = elm.offsetWidth;
+ assert_equals(got, query_to_image_width[expected_current], msg(expected_current, image_width_to_query[got]));
+ });
+ // <video poster> doesn't notify when the image is loaded so we need to poll :-(
+ var interval;
+ var check_video_width = function() {
+ var width = elm.offsetWidth;
+ if (width != 300 && width != 0) {
+ clearInterval(interval);
+ elm.onload();
+ }
+ }
+ if (tag == 'video') {
+ interval = setInterval(check_video_width, 10);
+ }
+ }, 'loading image <'+tag+' '+attr+'>',
+ {help:spec_url});
+ }
+
+ var query_to_image_width = {
+ '%E5':1,
+ '%C3%A5':2,
+ '%3F':16,
+ 'unknown query':256,
+ 'default intrinsic width':300
+ };
+
+ var image_width_to_query = {};
+ (function() {
+ for (var x in query_to_image_width) {
+ image_width_to_query[query_to_image_width[x]] = x;
+ }
+ })();
+
+ var spec_url_load_image = {
+ img:'https://html.spec.whatwg.org/multipage/multipage/embedded-content-1.html#update-the-image-data',
+ embed:'https://html.spec.whatwg.org/multipage/multipage/the-iframe-element.html#the-embed-element-setup-steps',
+ object:'https://html.spec.whatwg.org/multipage/multipage/the-iframe-element.html#the-object-element',
+ input:'https://html.spec.whatwg.org/multipage/multipage/states-of-the-type-attribute.html#image-button-state-(type=image)',
+ video:'https://html.spec.whatwg.org/multipage/multipage/the-video-element.html#poster-frame'
+ };
+
+ 'img src, embed src, object data, input src, video poster'.split(', ').forEach(function(str) {
+ var arr = str.split(' ');
+ test_load_image(arr[0], arr[1], spec_url_load_image[arr[0]]);
+ });
+
+ // XXX test <img srcset> or its successor
+ // <menuitem icon> could also be tested but the spec doesn't require it to be loaded...
+
+ // loading video
+ function test_load_video(tag, use_source_element) {
+ async_test(function() {
+ var elm = document.createElement(tag);
+ var video_ext = '';
+ if (elm.canPlayType('video/ogg; codecs="theora,flac"')) {
+ video_ext = 'ogv';
+ } else if (elm.canPlayType('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')) {
+ video_ext = 'mp4';
+ }
+ assert_not_equals(video_ext, '', 'no supported video format');
+ var source;
+ if (use_source_element) {
+ source = document.createElement('source');
+ elm.appendChild(source);
+ } else {
+ source = elm;
+ }
+ source.src = input_url_video + '&ext=' + video_ext;
+ elm.preload = 'auto';
+ elm.load();
+ this.add_cleanup(function() {
+ elm.removeAttribute('src');
+ if (elm.firstChild) {
+ elm.removeChild(elm.firstChild);
+ }
+ elm.load();
+ });
+ elm.onloadedmetadata = this.step_func_done(function() {
+ var got = Math.round(elm.duration);
+ assert_equals(got, query_to_video_duration[expected_current], msg(expected_current, video_duration_to_query[got]));
+ });
+ }, 'loading video <'+tag+'>' + (use_source_element ? '<source>' : ''),
+ {help:'https://html.spec.whatwg.org/multipage/multipage/the-video-element.html#concept-media-load-algorithm'});
+ }
+
+ var query_to_video_duration = {
+ '%E5':3,
+ '%C3%A5':5,
+ '%3F':30,
+ 'unknown query':300,
+ 'Infinity':Infinity,
+ 'NaN':NaN
+ };
+
+ var video_duration_to_query = {};
+ (function() {
+ for (var x in query_to_video_duration) {
+ video_duration_to_query[query_to_video_duration[x]] = x;
+ }
+ })();
+
+ 'video, audio'.split(', ').forEach(function(str) {
+ test_load_video(str);
+ test_load_video(str, true);
+ });
+
+ // loading webvtt
+ async_test(function() {
+ var video = document.createElement('video');
+ var track = document.createElement('track');
+ video.appendChild(track);
+ track.src = input_url_webvtt;
+ track.track.mode = 'showing';
+ track.onload = this.step_func_done(function() {
+ var got = track.track.cues[0].text;
+ assert_equals(got, expected_current);
+ });
+ }, 'loading webvtt <track>',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/the-video-element.html#track-url'});
+
+ // XXX downloading seems hard to automate
+ // <a href download>
+ // <area href download>
+
+ // submit forms
+ function test_submit_form(tag, attr) {
+ async_test(function(){
+ var elm = document.createElement(tag);
+ elm.setAttribute(attr, input_url_html);
+ var form;
+ var button;
+ if (tag == 'form') {
+ form = elm;
+ button = document.createElement('button');
+ } else {
+ form = document.createElement('form');
+ button = elm;
+ }
+ form.method = 'post';
+ form.appendChild(button);
+ var iframe = document.createElement('iframe');
+ var id = 'test_submit_form_' + tag;
+ iframe.name = id;
+ form.target = id;
+ button.type = 'submit';
+ document.body.appendChild(form);
+ document.body.appendChild(iframe);
+ this.add_cleanup(function() {
+ document.body.removeChild(form);
+ document.body.removeChild(iframe);
+ });
+ button.click();
+ iframe.onload = this.step_func_done(function() {
+ var got = iframe.contentDocument.body.textContent;
+ if (got == '') {
+ return;
+ }
+ assert_equals(got, expected_current);
+ });
+ }, 'submit form <'+tag+' '+attr+'>',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/association-of-controls-and-forms.html#concept-form-submit'});
+ }
+
+ 'form action, input formaction, button formaction'.split(', ').forEach(function(str) {
+ var arr = str.split(' ');
+ test_submit_form(arr[0], arr[1]);
+ });
+
+ // <base href>
+ async_test(function() {
+ var iframe = document.createElement('iframe');
+ iframe.src = blank;
+ document.body.appendChild(iframe);
+ this.add_cleanup(function() {
+ document.body.removeChild(iframe);
+ });
+ iframe.onload = this.step_func_done(function() {
+ var doc = iframe.contentDocument;
+ doc.write('<!doctype html><base href="'+input_url+'"><a href></a>');
+ doc.close();
+ var got_baseURI = doc.baseURI;
+ assert_true(got_baseURI.indexOf(expected_current) > -1, msg(expected_current, got_baseURI), 'doc.baseURI');
+ var got_a_href = doc.links[0].href;
+ assert_true(got_a_href.indexOf(expected_current) > -1, msg(expected_current, got_a_href), 'a.href');
+ });
+ }, '<base href>',
+ {help:['https://html.spec.whatwg.org/multipage/multipage/semantics.html#set-the-frozen-base-url',
+ 'https://dom.spec.whatwg.org/#dom-node-baseuri',
+ 'https://html.spec.whatwg.org/multipage/multipage/text-level-semantics.html#the-a-element']});
+
+ // XXX drag and drop (<a href> or <img src>) seems hard to automate
+
+ // Worker()
+ async_test(function() {
+ var worker = new Worker(input_url_worker);
+ worker.onmessage = this.step_func_done(function(e) {
+ assert_equals(e.data, expected_current);
+ });
+ }, 'Worker constructor',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/workers.html#dom-worker'});
+
+ // SharedWorker()
+ async_test(function() {
+ var worker = new SharedWorker(input_url_sharedworker);
+ worker.port.onmessage = this.step_func_done(function(e) {
+ assert_equals(e.data, expected_current);
+ });
+ }, 'SharedWorker constructor',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/workers.html#dom-sharedworker'});
+
+ // EventSource()
+ async_test(function() {
+ var source = new EventSource(input_url_eventstream);
+ this.add_cleanup(function() {
+ source.close();
+ });
+ source.onmessage = this.step_func_done(function(e) {
+ assert_equals(e.data, expected_current);
+ });
+ }, 'EventSource constructor',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/comms.html#dom-eventsource'});
+
+ // EventSource#url
+ test(function() {
+ var source = new EventSource(input_url_eventstream);
+ source.close();
+ var got = source.url;
+ assert_true(source.url.indexOf(expected_current) > -1, msg(expected_current, got));
+ }, 'EventSource#url',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/comms.html#dom-eventsource'});
+
+ // XMLDocument#load()
+ async_test(function() {
+ var doc = document.implementation.createDocument(null, "x");
+ doc.load(input_url_svg);
+ doc.onload = this.step_func_done(function() {
+ assert_equals(doc.documentElement.textContent, expected_current);
+ });
+ }, 'XMLDocument#load()',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/dom.html#dom-xmldocument-load'});
+
+ // window.open
+ async_test(function() {
+ var id = 'test_window_open';
+ var iframe = document.createElement('iframe');
+ iframe.name = id;
+ document.body.appendChild(iframe);
+ this.add_cleanup(function() {
+ document.body.removeChild(iframe);
+ });
+ window.open(input_url_html, id);
+ iframe.onload = this.step_func(function() {
+ var got = iframe.contentDocument.body.textContent;
+ if (got != "") {
+ assert_equals(got, expected_current);
+ this.done();
+ }
+ });
+ }, 'window.open()',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/browsers.html#dom-open'});
+
+ // location
+ function test_location(func, desc) {
+ async_test(function() {
+ var iframe = document.createElement('iframe');
+ document.body.appendChild(iframe);
+ this.add_cleanup(function() {
+ document.body.removeChild(iframe);
+ });
+ func(iframe.contentWindow, input_url_html);
+ iframe.onload = this.step_func(function() {
+ var got = iframe.contentDocument.body.textContent;
+ if (got != '') {
+ assert_equals(got, expected_current);
+ this.done();
+ }
+ });
+ }, desc,
+ {help:'https://html.spec.whatwg.org/multipage/multipage/history.html#the-location-interface'});
+ }
+ [[function(win, input) { win.location = input; }, "location [PutForwards]"],
+ [function(win, input) { win.location.assign(input); }, "location.assign()"],
+ [function(win, input) { win.location.replace(input); }, "location.replace()"],
+ [function(win, input) { win.location.href = input; }, "location.href"]].forEach(function(arr) {
+ test_location(arr[0], arr[1]);
+ });
+
+ // location.search
+ async_test(function() {
+ var iframe = document.createElement('iframe');
+ iframe.src = input_url_html;
+ document.body.appendChild(iframe);
+ this.add_cleanup(function() {
+ document.body.removeChild(iframe);
+ });
+ var i = 0;
+ iframe.onload = this.step_func(function() {
+ i++;
+ if (i == 1) {
+ iframe.contentWindow.location.search = '?' + input_url_html.split('?')[1] + '&other=foobar';
+ } else {
+ var got = iframe.contentDocument.body.textContent;
+ assert_equals(got, expected_current);
+ this.done();
+ }
+ });
+ }, 'location.search',
+ {help:['https://html.spec.whatwg.org/multipage/multipage/history.html#the-location-interface',
+ 'http://url.spec.whatwg.org/#dom-url-search']});
+
+ // a.search, area.search
+ function test_hyperlink_search(tag) {
+ test(function() {
+ var elm = document.createElement(tag);
+ var input_arr = input_url_html.split('?');
+ elm.href = input_arr[0];
+ elm.search = '?' + input_arr[1];
+ var got_href = elm.getAttribute('href');
+ assert_true(got_href.indexOf(expected_current) > -1, 'href content attribute ' + msg(expected_current, got_href));
+ var got_search = elm.search;
+ assert_true(got_search.indexOf(expected_current) > -1, 'getting .search '+msg(expected_current, got_search));
+ }, '<'+tag+'>.search',
+ {help:['https://html.spec.whatwg.org/multipage/multipage/text-level-semantics.html#the-'+tag+'-element',
+ 'http://url.spec.whatwg.org/#dom-url-search']});
+ }
+ 'a, area'.split(', ').forEach(function(str) {
+ test_hyperlink_search(str);
+ });
+
+ // history.pushState
+ // history.replaceState
+ function test_history(prop) {
+ async_test(function() {
+ var iframe = document.createElement('iframe');
+ iframe.src = blank;
+ document.body.appendChild(iframe);
+ this.add_cleanup(function() {
+ document.body.removeChild(iframe);
+ });
+ iframe.onload = this.step_func_done(function() {
+ iframe.contentWindow.history[prop](null, null, input_url_html); // this should resolve against the test's URL, not the iframe's URL
+ var got = iframe.contentWindow.location.href;
+ assert_true(got.indexOf(expected_current) > -1, msg(expected_current, got));
+ assert_equals(got.indexOf('/resources/resources/'), -1, 'url was resolved against the iframe\'s URL instead of the settings object\'s API base URL');
+ });
+ }, 'history.'+prop,
+ {help:'https://html.spec.whatwg.org/multipage/multipage/history.html#dom-history-'+prop.toLowerCase()});
+ }
+
+ 'pushState, replaceState'.split(', ').forEach(function(str) {
+ test_history(str);
+ });
+
+ // SVG
+ var ns = {svg:'http://www.w3.org/2000/svg', xlink:'http://www.w3.org/1999/xlink'};
+ // a
+ async_test(function() {
+ SVGAElement; // check support
+ var iframe = document.createElement('iframe');
+ var id = 'test_svg_a';
+ iframe.name = id;
+ var svg = document.createElementNS(ns.svg, 'svg');
+ var a = document.createElementNS(ns.svg, 'a');
+ a.setAttributeNS(ns.xlink, 'xlink:href', input_url_html);
+ a.setAttribute('target', id);
+ var span = document.createElement('span');
+ a.appendChild(span);
+ svg.appendChild(a);
+ document.body.appendChild(iframe);
+ document.body.appendChild(svg);
+ this.add_cleanup(function() {
+ document.body.removeChild(iframe);
+ document.body.removeChild(svg);
+ });
+ span.click();
+ iframe.onload = this.step_func_done(function() {
+ var got = iframe.contentDocument.body.textContent;
+ if (got != '') {
+ assert_equals(got, expected_current);
+ }
+ });
+ }, 'SVG <a>');
+
+ // feImage, image, use
+ function test_svg(func, tag) {
+ async_test(function() {
+ var uuid = token();
+ var id = 'test_svg_'+tag;
+ var svg = document.createElementNS(ns.svg, 'svg');
+ var parent = func(svg, id);
+ var elm = document.createElementNS(ns.svg, tag);
+ elm.setAttributeNS(ns.xlink, 'xlink:href', stash_put + uuid + '#foo');
+ parent.appendChild(elm);
+ document.body.appendChild(svg);
+ this.add_cleanup(function() {
+ document.body.removeChild(svg);
+ });
+ poll_for_stash(this, uuid, expected_current);
+ }, 'SVG <' + tag + '>',
+ {help:'https://www.w3.org/Bugs/Public/show_bug.cgi?id=24148'});
+ }
+
+ [[function(svg, id) {
+ SVGFEImageElement; // check support
+ var filter = document.createElementNS(ns.svg, 'filter');
+ filter.setAttribute('id', id);
+ svg.appendChild(filter);
+ var rect = document.createElementNS(ns.svg, 'rect');
+ rect.setAttribute('filter', 'url(#'+id+')');
+ svg.appendChild(rect);
+ return filter;
+ }, 'feImage'],
+ [function(svg, id) { SVGImageElement; return svg; }, 'image'],
+ [function(svg, id) { SVGUseElement; return svg; }, 'use']].forEach(function(arr) {
+ test_svg(arr[0], arr[1]);
+ });
+
+ // UTF-8:
+ // XHR
+ async_test(function() {
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', input_url_html);
+ xhr.onload = this.step_func_done(function() {
+ assert_equals(xhr.response, expected_utf8);
+ });
+ xhr.send();
+ }, 'XMLHttpRequest#open()',
+ {help:'https://xhr.spec.whatwg.org/#the-open()-method'});
+
+ // in a worker
+ async_test(function() {
+ var worker = new Worker(input_url_worker_importScripts);
+ worker.onmessage = this.step_func_done(function(e) {
+ assert_equals(e.data, expected_utf8);
+ });
+ }, 'importScripts() in a dedicated worker',
+ {help:['https://html.spec.whatwg.org/multipage/multipage/workers.html#set-up-a-worker-script-settings-object',
+ 'https://html.spec.whatwg.org/multipage/multipage/workers.html#dom-workerglobalscope-importscripts']});
+
+ async_test(function() {
+ var worker = new Worker(input_url_worker_worker);
+ worker.onmessage = this.step_func_done(function(e) {
+ assert_equals(e.data, expected_utf8);
+ });
+ }, 'Worker() in a dedicated worker',
+ {help:['https://html.spec.whatwg.org/multipage/multipage/workers.html#set-up-a-worker-script-settings-object',
+ 'https://html.spec.whatwg.org/multipage/multipage/workers.html#dom-worker']});
+
+ async_test(function() {
+ var worker = new Worker(input_url_worker_sharedworker);
+ worker.onmessage = this.step_func_done(function(e) {
+ assert_equals(e.data, expected_utf8);
+ });
+ }, 'SharedWorker() in a dedicated worker',
+ {help:['https://html.spec.whatwg.org/multipage/multipage/workers.html#set-up-a-worker-script-settings-object',
+ 'https://html.spec.whatwg.org/multipage/multipage/workers.html#dom-sharedworker']});
+
+ async_test(function() {
+ var worker = new SharedWorker(input_url_sharedworker_importScripts);
+ worker.port.onmessage = this.step_func_done(function(e) {
+ assert_equals(e.data, expected_utf8);
+ });
+ }, 'importScripts() in a shared worker',
+ {help:['https://html.spec.whatwg.org/multipage/multipage/workers.html#set-up-a-worker-script-settings-object',
+ 'https://html.spec.whatwg.org/multipage/multipage/workers.html#dom-workerglobalscope-importscripts']});
+
+ async_test(function() {
+ var worker = new SharedWorker(input_url_sharedworker_worker);
+ worker.port.onmessage = this.step_func_done(function(e) {
+ assert_equals(e.data, expected_utf8);
+ });
+ }, 'Worker() in a shared worker',
+ {help:['https://html.spec.whatwg.org/multipage/multipage/workers.html#set-up-a-worker-script-settings-object',
+ 'https://html.spec.whatwg.org/multipage/multipage/workers.html#dom-worker']});
+
+ async_test(function() {
+ var worker = new SharedWorker(input_url_sharedworker_sharedworker);
+ worker.port.onmessage = this.step_func_done(function(e) {
+ assert_equals(e.data, expected_utf8);
+ });
+ }, 'SharedWorker() in a shared worker',
+ {help:['https://html.spec.whatwg.org/multipage/multipage/workers.html#set-up-a-worker-script-settings-object',
+ 'https://html.spec.whatwg.org/multipage/multipage/workers.html#dom-sharedworker']});
+
+ // WebSocket()
+ async_test(function(){
+ var ws = new WebSocket('ws://{{host}}:{{ports[ws][0]}}/echo-query?\u00E5');
+ this.add_cleanup(function() {
+ ws.close();
+ });
+ ws.onmessage = this.step_func_done(function(e) {
+ assert_equals(e.data, expected_utf8);
+ });
+ }, 'WebSocket constructor',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/network.html#parse-a-websocket-url\'s-components'});
+
+ // WebSocket#url
+ test(function(){
+ var ws = new WebSocket('ws://{{host}}:{{ports[ws][0]}}/echo-query?\u00E5');
+ ws.close();
+ var got = ws.url;
+ assert_true(ws.url.indexOf(expected_utf8) > -1, msg(expected_utf8, got));
+ }, 'WebSocket#url',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/network.html#dom-websocket-url'});
+
+ // Parsing cache manifest
+ function test_cache_manifest(mode) {
+ async_test(function() {
+ var iframe = document.createElement('iframe');
+ var uuid = token();
+ iframe.src = 'resources/page-using-manifest.py?id='+uuid+'&encoding='+encoding+'&mode='+mode;
+ document.body.appendChild(iframe);
+ this.add_cleanup(function() {
+ document.body.removeChild(iframe);
+ });
+ poll_for_stash(this, uuid, expected_utf8);
+ }, 'Parsing cache manifest (' + mode + ')',
+ {help:'https://html.spec.whatwg.org/multipage/multipage/offline.html#parse-a-manifest'});
+ }
+
+ 'CACHE, FALLBACK, NETWORK'.split(', ').forEach(function(str) {
+ test_cache_manifest(str);
+ });
+
+ // CSS
+ function test_css(tmpl, expected_cssom, encoding, use_style_element) {
+ var desc = ['CSS', (use_style_element ? '<style>' : '<link> (' + encoding + ')'), tmpl].join(' ');
+ async_test(function(){
+ css_is_supported(tmpl, expected_cssom, this);
+ var uuid = token();
+ var id = 'test_css_' + uuid;
+ var url = 'url(stash.py?q=%s&action=put&id=' + uuid + ')';
+ tmpl = tmpl.replace(/<id>/g, id).replace(/<url>/g, url);
+ var link;
+ if (use_style_element) {
+ link = document.createElement('style');
+ link.textContent = tmpl.replace(/%s/g, '\u00E5').replace(/stash\.py/g, 'resources/stash.py');
+ } else {
+ link = document.createElement('link');
+ link.rel = 'stylesheet';
+ link.href = 'resources/css-tmpl.py?encoding='+encoding+'&tmpl='+encodeURIComponent(tmpl);
+ }
+ var div = document.createElement('div');
+ div.id = id;
+ div.textContent='x';
+ document.head.appendChild(link);
+ document.body.appendChild(div);
+ this.add_cleanup(function() {
+ document.head.removeChild(link);
+ document.body.removeChild(div);
+ });
+ poll_for_stash(this, uuid, expected_utf8);
+ }, desc,
+ {help:'https://www.w3.org/Bugs/Public/show_bug.cgi?id=23968'});
+ }
+
+ // fail fast if the input doesn't parse into the expected cssom
+ function css_is_supported(tmpl, expected_cssom, test_obj) {
+ if (expected_cssom === null) {
+ return;
+ }
+ var style = document.createElement('style');
+ style.textContent = tmpl.replace(/<id>/g, 'x').replace(/<url>/g, 'url(data:,)');
+ document.head.appendChild(style);
+ test_obj.add_cleanup(function() {
+ document.head.removeChild(style);
+ });
+ assert_equals(style.sheet.cssRules.length, expected_cssom.length, 'number of style rules');
+ for (var i = 0; i < expected_cssom.length; ++i) {
+ if (expected_cssom[i] === null) {
+ continue;
+ }
+ assert_equals(style.sheet.cssRules[i].style.length, expected_cssom[i], 'number of declarations in style rule #'+i);
+ }
+ }
+
+ [['#<id> { background-image:<url> }', [1] ],
+ ['#<id> { border-image-source:<url> }', [1] ],
+ ['#<id>::before { content:<url> }', [1] ],
+ ['@font-face { font-family:<id>; src:<url> } #<id> { font-family:<id> }', [null, 1] ],
+ ['#<id> { display:list-item; list-style-image:<url> }', [2] ],
+ ['@import <url>;', null ],
+ // XXX maybe cursor isn't suitable for automation here if browsers delay fetching it
+ ['#<id> { cursor:<url>, pointer }', [1] ]].forEach(function(arr) {
+ var input = arr[0];
+ var expected_cssom = arr[1];
+ var other_encoding = encoding == 'utf-8' ? 'windows-1252' : 'utf-8';
+ test_css(input, expected_cssom, encoding);
+ test_css(input, expected_cssom, other_encoding);
+ test_css(input, expected_cssom, null, true);
+ });
+
+ // XXX maybe test if they become relevant:
+ // binding (obsolete?)
+ // aural: cue-after, cue-before, play-during (not implemented?)
+ // hyphenate-resource (not implemented?)
+ // image() (not implemented?)
+
+ // <?xml-stylesheet?>
+ async_test(function() {
+ var iframe = document.createElement('iframe');
+ iframe.src = input_url_xmlstylesheet_css;
+ document.body.appendChild(iframe);
+ this.add_cleanup(function() {
+ document.body.removeChild(iframe);
+ });
+ iframe.onload = this.step_func_done(function() {
+ assert_equals(iframe.contentDocument.firstChild.sheet.cssRules[0].style.content, '"' + expected_utf8 + '"');
+ });
+ }, '<?xml-stylesheet?> (CSS)',
+ {help:'http://dev.w3.org/csswg/cssom/#requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction'});
+
+ // new URL()
+ test(function() {
+ var url = new URL('http://example.org/'+input_url);
+ var expected = expected_utf8;
+ assert_true(url.href.indexOf(expected) > -1, 'url.href '+msg(expected, url.href));
+ assert_true(url.search.indexOf(expected) > -1, 'url.search '+msg(expected, url.search));
+ }, 'URL constructor, url',
+ {help:'http://url.spec.whatwg.org/#dom-url'});
+
+ test(function() {
+ var url = new URL('', 'http://example.org/'+input_url);
+ var expected = expected_utf8;
+ assert_true(url.href.indexOf(expected) > -1, 'url.href '+msg(expected, url.href));
+ assert_true(url.search.indexOf(expected) > -1, 'url.search '+msg(expected, url.search));
+ }, 'URL constructor, base',
+ {help:'http://url.spec.whatwg.org/#dom-url'});
+
+ // Test different schemes
+ function test_scheme(url, utf8) {
+ test(function() {
+ var a = document.createElement('a');
+ a.setAttribute('href', url);
+ var got = a.href;
+ var expected = utf8 ? expected_utf8 : expected_current;
+ assert_true(got.indexOf(expected) != -1, msg(expected, got));
+ }, 'Scheme ' + url.split(':')[0] + ' (getting <a>.href)');
+ }
+
+ var test_scheme_urls = ['ftp://example.invalid/?x=\u00E5',
+ 'file:///?x=\u00E5',
+ 'gopher://example.invalid/?x=\u00E5',
+ 'http://example.invalid/?x=\u00E5',
+ 'https://example.invalid/?x=\u00E5',
+ ];
+
+ var test_scheme_urls_utf8 = ['ws://example.invalid/?x=\u00E5',
+ 'wss://example.invalid/?x=\u00E5',
+ 'mailto:example@invalid?x=\u00E5',
+ 'data:text/plain;charset='+encoding+',?x=\u00E5',
+ 'javascript:"?x=\u00E5"',
+ 'ftps://example.invalid/?x=\u00E5',
+ 'httpbogus://example.invalid/?x=\u00E5',
+ 'bitcoin:foo?x=\u00E5',
+ 'geo:foo?x=\u00E5',
+ 'im:foo?x=\u00E5',
+ 'irc:foo?x=\u00E5',
+ 'ircs:foo?x=\u00E5',
+ 'magnet:foo?x=\u00E5',
+ 'mms:foo?x=\u00E5',
+ 'news:foo?x=\u00E5',
+ 'nntp:foo?x=\u00E5',
+ 'sip:foo?x=\u00E5',
+ 'sms:foo?x=\u00E5',
+ 'smsto:foo?x=\u00E5',
+ 'ssh:foo?x=\u00E5',
+ 'tel:foo?x=\u00E5',
+ 'urn:foo?x=\u00E5',
+ 'webcal:foo?x=\u00E5',
+ 'wtai:foo?x=\u00E5',
+ 'xmpp:foo?x=\u00E5',
+ 'web+http:foo?x=\u00E5',
+ ];
+
+ test_scheme_urls.forEach(function(url) {
+ test_scheme(url);
+ });
+
+ test_scheme_urls_utf8.forEach(function(url) {
+ test_scheme(url, true);
+ });
+
+ done();
+};
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py
new file mode 100644
index 000000000..a1736f0d7
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py
@@ -0,0 +1,131 @@
+import os
+import re
+
+def main(request, response):
+ type = request.GET['type']
+ encoding = request.GET['encoding']
+ # We want the raw input for 'q'
+ q = re.search(r'q=([^&]+)', request.url_parts.query).groups()[0]
+ if type == 'html':
+ return [("Content-Type", "text/html; charset=utf-8")], q
+ elif type == 'css':
+ return [("Content-Type", "text/css; charset=utf-8")], "#test::before { content:'%s' }" % q
+ elif type == 'js':
+ return [("Content-Type", "text/javascript; charset=utf-8")], "%s = '%s';" % (request.GET['var'], q)
+ elif type == 'worker':
+ return [("Content-Type", "text/javascript")], "postMessage('%s'); close();" % q
+ elif type == 'sharedworker':
+ return [("Content-Type", "text/javascript")], "onconnect = function(e) { e.source.postMessage('%s'); close(); };" % q
+ elif type == 'worker_importScripts':
+ return ([("Content-Type", "text/javascript; charset=%s" % encoding)], # charset should be ignored for workers
+ """try {
+ var x = 'importScripts failed to run';
+ importScripts('?q=\\u00E5&type=js&var=x&encoding=%s');
+ postMessage(x);
+ close();
+ } catch(ex) {
+ postMessage(String(ex));
+ }""" % encoding)
+ elif type == 'worker_worker':
+ return ([("Content-Type", "text/javascript; charset=%s" % encoding)], # charset should be ignored for workers
+ """try {
+ var worker = new Worker('?q=\\u00E5&type=worker&encoding=%s');
+ worker.onmessage = function(e) {
+ postMessage(e.data);
+ close();
+ };
+ } catch(ex) {
+ postMessage(String(ex));
+ }""" % encoding)
+ elif type =='worker_sharedworker':
+ return ([("Content-Type", "text/javascript; charset=%s" % encoding)], # charset should be ignored for workers
+ """try {
+ var worker = new SharedWorker('?q=\\u00E5&type=sharedworker&encoding=%s');
+ worker.port.onmessage = function(e) {
+ postMessage(e.data);
+ close();
+ };
+ } catch(ex) {
+ postMessage(String(ex));
+ }""" % encoding)
+ elif type == 'sharedworker_importScripts':
+ return ([("Content-Type", "text/javascript; charset=%s" % request.GET['encoding'])], # charset should be ignored for workers
+ """onconnect = function(e) {
+ var connect_port = e.source;
+ try {
+ var x = 'importScripts failed to run';
+ importScripts('?q=\\u00E5&type=js&var=x&encoding=%s');
+ connect_port.postMessage(x);
+ close();
+ } catch(ex) {
+ connect_port.postMessage(String(ex));
+ }
+ };""" % encoding)
+ elif type == 'sharedworker_worker':
+ return ([("Content-Type", "text/javascript; charset=%s" % encoding)], # charset should be ignored for workers
+ """onconnect = function(e) {
+ var connect_port = e.source;
+ try {
+ var worker = new Worker('?q=\\u00E5&type=worker&encoding=%s');
+ worker.onmessage = function(e) {
+ connect_port.postMessage(e.data);
+ close();
+ };
+ } catch(ex) {
+ connect_port.postMessage(String(ex));
+ }
+ };""" % encoding)
+ elif type == 'sharedworker_sharedworker':
+ return ([("Content-Type", "text/javascript; charset=%s" % encoding)], # charset should be ignored for workers
+ """onconnect = function(e) {
+ var connect_port = e.source;
+ try {
+ onerror = function(msg) {
+ connect_port.postMessage(msg);
+ close();
+ return false;
+ };
+ var worker = new SharedWorker('?q=\\u00E5&type=sharedworker&encoding=%s');
+ worker.port.onmessage = function(e) {
+ connect_port.postMessage(e.data);
+ close();
+ };
+ } catch(ex) {
+ connect_port.postMessage(String(ex));
+ }
+ };""" % encoding)
+ elif type == 'eventstream':
+ return [("Content-Type", "text/event-stream")], "data: %s\n\n" % q
+ elif type == 'svg':
+ return [("Content-Type", "image/svg+xml")], "<svg xmlns='http://www.w3.org/2000/svg'>%s</svg>" % q
+ elif type == 'xmlstylesheet_css':
+ return ([("Content-Type", "application/xhtml+xml; charset=%s" % encoding)],
+ (u"""<?xml-stylesheet href="?q=&#x00E5;&amp;type=css&amp;encoding=%s"?><html xmlns="http://www.w3.org/1999/xhtml"/>""" % encoding)
+ .encode(encoding))
+ elif type == 'png':
+ if q == '%E5':
+ image = 'green-1x1.png'
+ elif q == '%C3%A5':
+ image = 'green-2x2.png'
+ elif q == '%3F':
+ image = 'green-16x16.png'
+ else:
+ image = 'green-256x256.png'
+ rv = open(os.path.join(request.doc_root, "images", image), "rb").read()
+ return [("Content-Type", "image/png")], rv
+ elif type == 'video':
+ ext = request.GET['ext']
+ if q == '%E5':
+ video = 'A4' # duration: 3
+ elif q == '%C3%A5':
+ video = 'movie_5' # duration: 5
+ elif q == '%3F':
+ video = 'green-at-15' # duration: 30
+ else:
+ video = 'movie_300' # duration: 300
+ rv = open(os.path.join(request.doc_root, "media", "%s.%s" % (video, ext)), "rb").read()
+ if ext == 'ogv':
+ ext = 'ogg'
+ return [("Content-Type", "video/%s" % ext)], rv
+ elif type == 'webvtt':
+ return [("Content-Type", "text/vtt")], "WEBVTT\n\n00:00:00.000 --> 00:00:01.000\n%s" % q
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py
new file mode 100644
index 000000000..d6e3dd5ea
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py
@@ -0,0 +1,16 @@
+import time
+import re
+
+def main(request, response):
+ key = request.GET['id']
+ action = request.GET['action']
+ if action == 'put':
+ # We want the raw input for 'q'
+ q = re.search(r'q=([^&]+)', request.url_parts.query).groups()[0]
+ request.server.stash.put(key, q)
+ return [("Content-Type", "text/html")], 'Put %s' % q
+ else:
+ q = request.server.stash.take(key)
+ if q != None:
+ return [("Content-Type", "text/html")], q
+ return [], ""
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html
new file mode 100644
index 000000000..06558fe38
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html
Binary files differ
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16le.html b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16le.html
new file mode 100644
index 000000000..86510b685
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16le.html
Binary files differ
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-8.html b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-8.html
new file mode 100644
index 000000000..fcf43e0a9
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-8.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Resolving URLs, URL character encoding, utf-8</title>
+<meta name="timeout" content="long">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/utils.js"></script>
+<div id=log></div>
+<script src="resources/resolve-url.js?encoding=utf-8&pipe=sub"></script>
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html
new file mode 100644
index 000000000..23d33f9f7
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<meta charset=windows-1251>
+<title>Resolving URLs, URL character encoding, windows-1251</title>
+<meta name="timeout" content="long">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/utils.js"></script>
+<div id=log></div>
+<script src="resources/resolve-url.js?encoding=windows-1251&pipe=sub"></script>
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html
new file mode 100644
index 000000000..642c82ab4
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<meta charset=windows-1252>
+<title>Resolving URLs, URL character encoding, windows-1252</title>
+<meta name="timeout" content="long">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/utils.js"></script>
+<div id=log></div>
+<script src="resources/resolve-url.js?encoding=windows-1252&pipe=sub"></script>
diff --git a/testing/web-platform/tests/html/infrastructure/urls/terminology-0/.gitkeep b/testing/web-platform/tests/html/infrastructure/urls/terminology-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/terminology-0/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url.html b/testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url.html
new file mode 100644
index 000000000..ee9d72648
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url.html
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: document base URL</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+ iframe { display: none }
+</style>
+<body onload="on_load()">
+ <div id="log"></div>
+ <script>
+ function assert_resolve_url(doc, base) {
+ var img = doc.createElement("img");
+ img.src = "foo";
+ var actual = img.src;
+ var expected = base + "/foo";
+ assert_equals(actual, expected, "img src should resolve correctly");
+ }
+
+ var t1 = async_test("The document base URL of a document containing one or more base elements with href attributes is the frozen base URL of the first base element in the document that has an href attribute, in tree order.");
+
+ function on_load() {
+ t1.step(function () {
+ var base = document.createElement("base");
+ base.setAttribute("href", "/foo/bar");
+ document.head.appendChild(base);
+ t1.add_cleanup(function () {
+ document.head.removeChild(base);
+ });
+
+ assert_resolve_url(document, location.href.replace(location.pathname, "/foo"));
+ assert_equals(document.baseURI, base.href, "The document base URL should be URL of the first base element that has an href attribute.");
+ });
+ t1.done();
+ }
+
+ async_test(function() {
+ var iframe = document.createElement("iframe");
+ iframe.onload = this.step_func_done(function () {
+ assert_resolve_url(iframe.contentDocument, location.href.replace(location.pathname, "/common"));
+ assert_equals(iframe.contentDocument.baseURI, iframe.contentDocument.location.href, "The document base URL should be the document's address.");
+ });
+ iframe.setAttribute("src", "/common/blank.html");
+ document.body.appendChild(iframe);
+ }, "The fallback base URL of a document containing no base element is the document's address.");
+
+ async_test(function () {
+ var iframe = document.createElement("iframe");
+ iframe.onload = this.step_func_done(function () {
+ assert_resolve_url(iframe.contentDocument, location.href.replace("/document-base-url.html", ""));
+ assert_equals(iframe.contentDocument.baseURI, document.baseURI, "The document base URL should be the creator document's base URL.");
+ });
+ iframe.setAttribute("src", "about:blank");
+ document.body.appendChild(iframe);
+ }, "The fallback base URL of a document whose address is about:blank is the document base URL of the creator document.");
+
+ async_test(function () {
+ var iframe = document.createElement("iframe");
+ iframe.onload = this.step_func_done(function () {
+ var doc = iframe.contentDocument;
+ var base = doc.body.appendChild(doc.createElement("base"));
+ base.href = "sub/";
+ assert_resolve_url(doc, location.href.replace("/document-base-url.html", "/sub"));
+ assert_equals(doc.baseURI, document.baseURI.replace("/document-base-url.html", "/sub/"));
+ });
+ iframe.setAttribute("src", "about:blank");
+ document.body.appendChild(iframe);
+ }, "about:blank with a base element.");
+
+ async_test(function () {
+ var iframe = document.createElement("iframe");
+ iframe.onload = this.step_func_done(function () {
+ assert_resolve_url(iframe.contentDocument, location.href.replace("/document-base-url.html", ""));
+ assert_equals(iframe.contentDocument.baseURI, document.baseURI, "The document base URL should be the containing document's base URL.");
+ });
+ iframe.setAttribute("srcdoc", "<p>foobar</p>");
+ document.body.appendChild(iframe);
+ }, "The fallback base URL of an iframe srcdoc document is the document base URL of the document's browsing context's browsing context container's document.");
+
+ async_test(function () {
+ var iframe = document.createElement("iframe");
+ iframe.onload = this.step_func_done(function () {
+ var doc = iframe.contentDocument;
+ assert_resolve_url(doc, location.href.replace("/document-base-url.html", "/sub"));
+ assert_equals(doc.baseURI, document.baseURI.replace("/document-base-url.html", "/sub/"),
+ "The srcdoc document's base URL should be set by the <base> tag.");
+ });
+ iframe.setAttribute("srcdoc", "<base href='sub/'><p>foobar</p>");
+ document.body.appendChild(iframe);
+ }, "The base URL of an iframe srcdoc document with a <base> tag should be set by that tag.");
+ </script>
+</body>
diff --git a/testing/web-platform/tests/html/infrastructure/urls/terminology-0/multiple-base.sub.html b/testing/web-platform/tests/html/infrastructure/urls/terminology-0/multiple-base.sub.html
new file mode 100644
index 000000000..49c428c5b
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/terminology-0/multiple-base.sub.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>document base URL: multiple base elements</title>
+<base target="_blank" >
+<base href="http://{{domains[www]}}:{{ports[http][0]}}/">
+<base href="http://{{domains[www1]}}:{{ports[http][0]}}/">
+<base href="http://{{domains[www2]}}:{{ports[http][0]}}/">
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ test(function(){
+ var base = document.querySelectorAll("base");
+ assert_equals(document.baseURI, document.querySelectorAll("base[href]")[0].href);
+ }, "If there are multiple <base> elements, the document base URL is the frozen base URL of the first one that has an href attribute");
+</script>
diff --git a/testing/web-platform/tests/html/infrastructure/urls/url-manipulation-and-creation/.gitkeep b/testing/web-platform/tests/html/infrastructure/urls/url-manipulation-and-creation/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/urls/url-manipulation-and-creation/.gitkeep
diff --git a/testing/web-platform/tests/html/infrastructure/utf-8/.gitkeep b/testing/web-platform/tests/html/infrastructure/utf-8/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/infrastructure/utf-8/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/.gitkeep b/testing/web-platform/tests/html/introduction/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/a-quick-introduction-to-html/.gitkeep b/testing/web-platform/tests/html/introduction/a-quick-introduction-to-html/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/a-quick-introduction-to-html/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/a-quick-introduction-to-html/common-pitfalls-to-avoid-when-using-the-scripting-apis/.gitkeep b/testing/web-platform/tests/html/introduction/a-quick-introduction-to-html/common-pitfalls-to-avoid-when-using-the-scripting-apis/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/a-quick-introduction-to-html/common-pitfalls-to-avoid-when-using-the-scripting-apis/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/a-quick-introduction-to-html/writing-secure-applications-with-html/.gitkeep b/testing/web-platform/tests/html/introduction/a-quick-introduction-to-html/writing-secure-applications-with-html/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/a-quick-introduction-to-html/writing-secure-applications-with-html/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/audience/.gitkeep b/testing/web-platform/tests/html/introduction/audience/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/audience/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/background/.gitkeep b/testing/web-platform/tests/html/introduction/background/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/background/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/.gitkeep b/testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/presentational-markup/.gitkeep b/testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/presentational-markup/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/presentational-markup/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/restrictions-on-content-models-and-on-attribute-values/.gitkeep b/testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/restrictions-on-content-models-and-on-attribute-values/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/restrictions-on-content-models-and-on-attribute-values/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/syntax-errors/.gitkeep b/testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/syntax-errors/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/conformance-requirements-for-authors/syntax-errors/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/design-notes/.gitkeep b/testing/web-platform/tests/html/introduction/design-notes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/design-notes/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/design-notes/compliance-with-other-specifications/.gitkeep b/testing/web-platform/tests/html/introduction/design-notes/compliance-with-other-specifications/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/design-notes/compliance-with-other-specifications/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/design-notes/serializability-of-script-execution/.gitkeep b/testing/web-platform/tests/html/introduction/design-notes/serializability-of-script-execution/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/design-notes/serializability-of-script-execution/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/fingerprint/.gitkeep b/testing/web-platform/tests/html/introduction/fingerprint/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/fingerprint/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/history-0/.gitkeep b/testing/web-platform/tests/html/introduction/history-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/history-0/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/html-vs-xhtml/.gitkeep b/testing/web-platform/tests/html/introduction/html-vs-xhtml/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/html-vs-xhtml/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/scope/.gitkeep b/testing/web-platform/tests/html/introduction/scope/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/scope/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/structure-of-this-specification/.gitkeep b/testing/web-platform/tests/html/introduction/structure-of-this-specification/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/structure-of-this-specification/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/structure-of-this-specification/how-to-read-this-specification/.gitkeep b/testing/web-platform/tests/html/introduction/structure-of-this-specification/how-to-read-this-specification/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/structure-of-this-specification/how-to-read-this-specification/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/structure-of-this-specification/typographic-conventions/.gitkeep b/testing/web-platform/tests/html/introduction/structure-of-this-specification/typographic-conventions/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/structure-of-this-specification/typographic-conventions/.gitkeep
diff --git a/testing/web-platform/tests/html/introduction/suggested-reading/.gitkeep b/testing/web-platform/tests/html/introduction/suggested-reading/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/introduction/suggested-reading/.gitkeep
diff --git a/testing/web-platform/tests/html/obsolete/.gitkeep b/testing/web-platform/tests/html/obsolete/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/.gitkeep
diff --git a/testing/web-platform/tests/html/obsolete/non-conforming-features/.gitkeep b/testing/web-platform/tests/html/obsolete/non-conforming-features/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/non-conforming-features/.gitkeep
diff --git a/testing/web-platform/tests/html/obsolete/obsolete-but-conforming-features/.gitkeep b/testing/web-platform/tests/html/obsolete/obsolete-but-conforming-features/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/obsolete-but-conforming-features/.gitkeep
diff --git a/testing/web-platform/tests/html/obsolete/obsolete-but-conforming-features/warnings-for-obsolete-but-conforming-features/.gitkeep b/testing/web-platform/tests/html/obsolete/obsolete-but-conforming-features/warnings-for-obsolete-but-conforming-features/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/obsolete-but-conforming-features/warnings-for-obsolete-but-conforming-features/.gitkeep
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/.gitkeep b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/.gitkeep
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/frames/.gitkeep b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/frames/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/frames/.gitkeep
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/.gitkeep b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/.gitkeep
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-all.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-all.html
new file mode 100644
index 000000000..37a92bb09
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-all.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>document.all</title>
+<link rel="author" title="Corey Farwell" href="mailto:coreyf@rwell.org">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-all">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function () {
+ assert_false(Boolean(document.all));
+
+ assert_true(document.all == undefined);
+ assert_true(document.all == null);
+ assert_false(document.all != undefined);
+ assert_false(document.all != null);
+
+ assert_true(document.all !== undefined);
+ assert_true(document.all !== null);
+ assert_false(document.all === undefined);
+ assert_false(document.all === null);
+
+ assert_equals(typeof document.all, "undefined");
+
+ if (document.all) { assert_true(false); }
+
+ if (!document.all) {}
+ else { assert_true(false); }
+}, "'unusual behaviors' of document.all")
+
+test(function() {
+ var all = document.all;
+
+ assert_false(Boolean(all));
+
+ assert_true(all == undefined);
+ assert_true(all == null);
+ assert_false(all != undefined);
+ assert_false(all != null);
+
+ assert_true(all !== undefined);
+ assert_true(all !== null);
+ assert_false(all === undefined);
+ assert_false(all === null);
+
+ assert_equals(typeof all, "undefined");
+
+ if (all) { assert_true(false); }
+
+ if (!all) {}
+ else { assert_true(false); }
+}, "'unusual behaviors' of document.all with assignment")
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html
new file mode 100644
index 000000000..38364cd3e
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>document: fg/bg/link/vlink/alink-color</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-fgcolor">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-body-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ document.fgColor = "green";
+ document.bgColor = "green";
+ document.linkColor = "green";
+ document.vlinkColor = "green";
+ document.alinkColor = "green";
+
+ var body = document.documentElement.removeChild(document.body);
+
+ // When there is no body element, the color attributes return an
+ // empty string upon getting.
+ assert_equals(document.fgColor, "");
+ assert_equals(document.bgColor, "");
+ assert_equals(document.linkColor, "");
+ assert_equals(document.vlinkColor, "");
+ assert_equals(document.alinkColor, "");
+
+ // Re-add body and reset color attributes.
+ document.body = body;
+ document.fgColor = "";
+ document.bgColor = "";
+ document.linkColor = "";
+ document.vlinkColor = "";
+ document.alinkColor = "";
+}, "getting document color attributes with no body");
+
+test(function() {
+ var body = document.documentElement.removeChild(document.body);
+
+ // When there is no body element, setting the color attributes has no effect.
+ document.fgColor = "red";
+ document.bgColor = "red";
+ document.linkColor = "red";
+ document.vlinkColor = "red";
+ document.alinkColor = "red";
+ assert_equals(document.fgColor, "");
+ assert_equals(document.bgColor, "");
+ assert_equals(document.linkColor, "");
+ assert_equals(document.vlinkColor, "");
+ assert_equals(document.alinkColor, "");
+
+ document.body = body;
+}, "setting document color attributes with no body");
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-02.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-02.html
new file mode 100644
index 000000000..ebf15e79c
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-02.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>document: fg/bg/link/vlink/alink-color</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-fgcolor">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-body-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.fgColor, document.body.text);
+ assert_equals(document.bgColor, document.body.bgColor);
+ assert_equals(document.linkColor, document.body.link);
+ assert_equals(document.vlinkColor, document.body.vLink);
+ assert_equals(document.alinkColor, document.body.aLink);
+})
+test(function() {
+ document.fgColor = null;
+ assert_equals(document.fgColor, "");
+ assert_equals(document.body.text, "");
+ assert_equals(document.body.getAttribute("text"), "");
+})
+test(function() {
+ document.fgColor = "blue";
+ assert_equals(document.fgColor, "blue");
+ assert_equals(document.body.text, "blue");
+ assert_equals(document.body.getAttribute("text"), "blue");
+})
+test(function() {
+ document.bgColor = "green";
+ assert_equals(document.bgColor, "green");
+ assert_equals(document.body.bgColor, "green");
+ assert_equals(document.body.getAttribute("bgcolor"), "green");
+})
+test(function() {
+ document.linkColor = "red";
+ assert_equals(document.linkColor, "red");
+ assert_equals(document.body.link, "red");
+ assert_equals(document.body.getAttribute("link"), "red");
+})
+test(function() {
+ document.vlinkColor = "yellow";
+ assert_equals(document.vlinkColor, "yellow");
+ assert_equals(document.body.vLink, "yellow");
+ assert_equals(document.body.getAttribute("vlink"), "yellow");
+})
+test(function() {
+ document.alinkColor = "silver";
+ assert_equals(document.alinkColor, "silver");
+ assert_equals(document.body.aLink, "silver");
+ assert_equals(document.body.getAttribute("alink"), "silver");
+})
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-03.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-03.html
new file mode 100644
index 000000000..629c24627
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-03.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>document: fg/bg/link/vlink/alink-color</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-fgcolor">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-body-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.fgColor, document.body.text);
+ assert_equals(document.bgColor, document.body.bgColor);
+ assert_equals(document.linkColor, document.body.link);
+ assert_equals(document.vlinkColor, document.body.vLink);
+ assert_equals(document.alinkColor, document.body.aLink);
+})
+test(function() {
+ document.body.text = null;
+ assert_equals(document.fgColor, "");
+ assert_equals(document.body.text, "");
+ assert_equals(document.body.getAttribute("text"), "");
+})
+test(function() {
+ document.body.text = "blue";
+ assert_equals(document.fgColor, "blue");
+ assert_equals(document.body.text, "blue");
+ assert_equals(document.body.getAttribute("text"), "blue");
+})
+test(function() {
+ document.body.bgColor = "green";
+ assert_equals(document.bgColor, "green");
+ assert_equals(document.body.bgColor, "green");
+ assert_equals(document.body.getAttribute("bgcolor"), "green");
+})
+test(function() {
+ document.body.link = "red";
+ assert_equals(document.linkColor, "red");
+ assert_equals(document.body.link, "red");
+ assert_equals(document.body.getAttribute("link"), "red");
+})
+test(function() {
+ document.body.vLink = "yellow";
+ assert_equals(document.vlinkColor, "yellow");
+ assert_equals(document.body.vLink, "yellow");
+ assert_equals(document.body.getAttribute("vlink"), "yellow");
+})
+test(function() {
+ document.body.aLink = "silver";
+ assert_equals(document.alinkColor, "silver");
+ assert_equals(document.body.aLink, "silver");
+ assert_equals(document.body.getAttribute("alink"), "silver");
+})
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-04.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-04.html
new file mode 100644
index 000000000..ca9fc21d8
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-04.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>document: fg/bg/link/vlink/alink-color</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-fgcolor">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-body-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.fgColor, document.body.text);
+ assert_equals(document.bgColor, document.body.bgColor);
+ assert_equals(document.linkColor, document.body.link);
+ assert_equals(document.vlinkColor, document.body.vLink);
+ assert_equals(document.alinkColor, document.body.aLink);
+})
+test(function() {
+ document.body.setAttribute("text", "blue");
+ assert_equals(document.fgColor, "blue");
+ assert_equals(document.body.text, "blue");
+ assert_equals(document.body.getAttribute("text"), "blue");
+})
+test(function() {
+ document.body.setAttribute("bgcolor", "green");
+ assert_equals(document.bgColor, "green");
+ assert_equals(document.body.bgColor, "green");
+ assert_equals(document.body.getAttribute("bgcolor"), "green");
+})
+test(function() {
+ document.body.setAttribute("link", "red");
+ assert_equals(document.linkColor, "red");
+ assert_equals(document.body.link, "red");
+ assert_equals(document.body.getAttribute("link"), "red");
+})
+test(function() {
+ document.body.setAttribute("vlink", "yellow");
+ assert_equals(document.vlinkColor, "yellow");
+ assert_equals(document.body.vLink, "yellow");
+ assert_equals(document.body.getAttribute("vlink"), "yellow");
+})
+test(function() {
+ document.body.setAttribute("alink", "silver");
+ assert_equals(document.alinkColor, "silver");
+ assert_equals(document.body.aLink, "silver");
+ assert_equals(document.body.getAttribute("alink"), "silver");
+})
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/heading-obsolete-attributes-01.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/heading-obsolete-attributes-01.html
new file mode 100644
index 000000000..84c66b4c5
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/heading-obsolete-attributes-01.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<title>HTMLHeadingElement: obsolete attribute reflecting</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-hx-align">
+<link rel="help" href="https://heycam.github.io/webidl/#es-DOMString">
+<link rel="help" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf#page=57">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var el = document.createElement("h7");
+ el.align = "left";
+ assert_equals(el.align, "left");
+ assert_false(el.hasAttribute("align"));
+ assert_equals(el.getAttribute("align"), null);
+}, "IDL attributes for HTMLHeadingElement should not apply to h7.")
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/nothing.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/nothing.html
new file mode 100644
index 000000000..039495d78
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/nothing.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Methods that must do nothing: clear(), captureEvents(), and releaseEvents()</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function() {
+ assert_equals(document.clear(), undefined);
+}, "document.clear");
+
+test(function() {
+ assert_equals(document.captureEvents(), undefined);
+}, "document.captureEvents");
+
+test(function() {
+ assert_equals(document.releaseEvents(), undefined);
+}, "document.releaseEvents");
+
+test(function() {
+ assert_equals(window.captureEvents(), undefined);
+}, "window.captureEvents");
+
+test(function() {
+ assert_equals(window.releaseEvents(), undefined);
+}, "window.releaseEvents");
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/original-id.json b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/original-id.json
new file mode 100644
index 000000000..601a7c08d
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/original-id.json
@@ -0,0 +1 @@
+{"original_id":"other-elements,-attributes-and-apis"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/script-IDL-event-htmlfor.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/script-IDL-event-htmlfor.html
new file mode 100644
index 000000000..1a8c4a2f8
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/script-IDL-event-htmlfor.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<title>event and htmlFor IDL attributes of HTMLScriptElement</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-event">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-htmlfor">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var script = document.createElement("script");
+ assert_equals(script.event, "");
+ assert_equals(script.htmlFor, "");
+})
+test(function() {
+ var script = document.createElement("script");
+ script.setAttribute("event", "blah");
+ script.setAttribute("for", "blah");
+ assert_equals(script.event, "blah");
+ assert_equals(script.htmlFor, "blah");
+ assert_equals(script.getAttribute("event"), "blah");
+ assert_equals(script.getAttribute("for"), "blah");
+})
+test(function() {
+ var script = document.createElement("script");
+ script.setAttribute("event", "blah");
+ script.setAttribute("for", "blah");
+ script.event = "foo";
+ script.htmlFor = "foo";
+ assert_equals(script.event, "foo");
+ assert_equals(script.htmlFor, "foo");
+ assert_equals(script.getAttribute("event"), "foo");
+ assert_equals(script.getAttribute("for"), "foo");
+})
+test(function() {
+ var script = document.createElement("script");
+ script.setAttribute("event", "blah");
+ script.setAttribute("for", "blah");
+ script.event = null;
+ script.htmlFor = null;
+ assert_equals(script.event, "null");
+ assert_equals(script.htmlFor, "null");
+ assert_equals(script.getAttribute("event"), "null");
+ assert_equals(script.getAttribute("for"), "null");
+})
+test(function() {
+ var script = document.createElement("script");
+ script.setAttribute("event", "blah");
+ script.setAttribute("for", "blah");
+ script.event = undefined;
+ script.htmlFor = undefined;
+ assert_equals(script.event, "undefined");
+ assert_equals(script.htmlFor, "undefined");
+ assert_equals(script.getAttribute("event"), "undefined");
+ assert_equals(script.getAttribute("for"), "undefined");
+})
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-applet-element/.gitkeep b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-applet-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-applet-element/.gitkeep
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/.gitkeep b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/.gitkeep
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-down-manual.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-down-manual.html
new file mode 100644
index 000000000..a9d4a7f6b
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-down-manual.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: marquee-direction-down</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/obsolete.html#the-marquee-element">
+<meta name="assert" content="Check if the marquee direction is from top to bottom">
+<p>Test passes if the text "Test Marquee" moves from top to bottom.</p>
+<marquee direction="down">Test Marquee</marquee>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-left-manual.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-left-manual.html
new file mode 100644
index 000000000..cf08cca4b
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-left-manual.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: marquee-direction-left</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/obsolete.html#the-marquee-element">
+<meta name="assert" content="Check if the marquee direction is from right to left">
+<p>Test passes if the text "Test Marquee" moves from right to left.</p>
+<marquee direction="left">Test Marquee</marquee>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-right-manual.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-right-manual.html
new file mode 100644
index 000000000..b42c9454f
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-right-manual.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: marquee-direction-right</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/obsolete.html#the-marquee-element">
+<meta name="assert" content="Check if the marquee direction is from left to right">
+<p>Test passes if the text "Test Marquee" moves from left to right.</p>
+<marquee direction="right">Test Marquee</marquee>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-up-manual.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-up-manual.html
new file mode 100644
index 000000000..040609fb6
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-direction-up-manual.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: marquee-direction-up</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/obsolete.html#the-marquee-element">
+<meta name="assert" content="Check if the marquee direction is from bottom to top">
+<p>Test passes if the text "Test Marquee" moves from bottom to top.</p>
+<marquee direction="up">Test Marquee</marquee>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-events.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-events.html
new file mode 100644
index 000000000..0d20c5102
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-events.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: marquee-events</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/obsolete.html#the-marquee-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<marquee id="test1" loop="2" width="1" behavior="alternate">&nbsp;</marquee>
+<marquee id="test2" loop="2" width="1">&nbsp;</marquee>
+<script>
+ var mq;
+ var t_start = async_test("marquee_events_start");
+ var t_finish = async_test("marquee_events_finish");
+ var t_bounce = async_test("marquee_events_bounce");
+ var t_bounce2 = async_test("marquee_events_bounce2");
+ var timeStamp = [];
+ var bounced = false;
+
+ setup(function() {
+ mq = document.getElementById("test1");
+ mq2 = document.getElementById("test2");
+ });
+
+ mq.addEventListener("start", function(evt) {
+ t_start.step(function() {
+ timeStamp.push(evt.timeStamp);
+ assert_true(evt.isTrusted, "The onstart event is created by UA, it must be trusted.");
+ assert_equals(timeStamp.length, 1, "The onstart event should be fired firstly.");
+ assert_false(evt.bubbles, "The bubbles property of onstart event should be false.");
+ assert_false(evt.cancelable, "The cancelable property of onstart event should be false.");
+ assert_true(evt instanceof Event, "The onstart event must be the instance of Event interface.");
+ });
+ t_start.done();
+ });
+
+ mq.addEventListener("finish", function(evt) {
+ t_finish.step(function() {
+ timeStamp.push(evt.timeStamp);
+ assert_true(evt.isTrusted, "The onfinish event is created by UA, it must be trusted.");
+ assert_equals(timeStamp.length, 3, "The onfinish event should be fired lastly.");
+ assert_false(evt.bubbles, "The bubbles property of onfinish event should be false.");
+ assert_false(evt.cancelable, "The cancelable property of onfinish event should be false.");
+ assert_true(evt instanceof Event, "The onfinish event must be the instance of Event interface.");
+ });
+ t_finish.done();
+ });
+
+ mq.addEventListener("bounce", function(evt) {
+ t_bounce.step(function() {
+ timeStamp.push(evt.timeStamp);
+ assert_true(evt.isTrusted, "The onbounce event is created by UA, it must be trusted.");
+ assert_equals(timeStamp.length, 2, "The onbounce event should be fired secondly.");
+ assert_false(evt.bubbles, "The bubbles property of onbounce event should be false.");
+ assert_false(evt.cancelable, "The cancelable property of onbounce event should be false.");
+ assert_true(evt instanceof Event, "The onbounce event must be the instance of Event interface.");
+ });
+ t_bounce.done();
+ });
+
+ mq2.addEventListener("bounce", function(evt) {
+ bounced = true;
+ });
+
+ mq2.addEventListener("finish", function(evt) {
+ t_bounce2.step(function () {
+ assert_false(bounced, "The onbounce event should not be fired.");
+ });
+ t_bounce2.done();
+ });
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-loop.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-loop.html
new file mode 100644
index 000000000..d150a5473
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-loop.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: marquee-loop</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/obsolete.html#the-marquee-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<marquee id="test1" loop="a">Test1</marquee>
+<marquee id="test2" loop="-2">Test2</marquee>
+<marquee id="test3" loop="2">Test3</marquee>
+<script>
+ test(function() {
+ var mq = document.getElementById("test1");
+ assert_equals(mq.loop, -1, "The value of loop should be -1.");
+ }, "marquee_loop_string");
+
+ test(function() {
+ var mq = document.getElementById("test2");
+ assert_equals(mq.loop, -1, "The value of loop should be -1.");
+ }, "marquee_loop_less_than_1");
+
+ test(function() {
+ var mq = document.getElementById("test3");
+ assert_equals(mq.loop, 2, "The value of loop should be 2.");
+ }, "marquee_loop_normal");
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-scrollamount-effect-manual.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-scrollamount-effect-manual.html
new file mode 100644
index 000000000..ad7ff0f3b
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-scrollamount-effect-manual.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: marquee-scrollamount-effect</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/obsolete.html#the-marquee-element">
+<meta name="assert" content="Check the effect of scrollamount attribute">
+<p>Test passes if the text "Test2" moves faster than the text "Test1".</p>
+<marquee id="test1">Test1</marquee>
+<marquee scrollamount="10" id="test2">Test2</marquee>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-scrollamount.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-scrollamount.html
new file mode 100644
index 000000000..808361a99
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-scrollamount.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: marquee-scrollamount</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/obsolete.html#the-marquee-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<marquee id="test1" scrollamount="aa">Test1</marquee>
+<marquee id="test2" scrollamount="-1">Test2</marquee>
+<marquee id="test3" scrollamount="10">Test3</marquee>
+<script>
+ test(function() {
+ var mq = document.getElementById("test1");
+ assert_equals(mq.scrollAmount, 6, "The value of scrollamount should be 6.");
+ }, "The scrollamount is a string");
+
+ test(function() {
+ var mq = document.getElementById("test2");
+ assert_equals(mq.scrollAmount, 6, "The value of scrollamount should be 6.");
+ }, "The scrollamount is a negative");
+
+ test(function() {
+ var mq = document.getElementById("test3");
+ assert_equals(mq.scrollAmount, 10, "The value of scrollamount should be 10.");
+ }, "The scrollamount is a normal value");
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-scrolldelay.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-scrolldelay.html
new file mode 100644
index 000000000..9bc769fec
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-scrolldelay.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: marquee-scrolldelay</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/obsolete.html#the-marquee-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<marquee id="test1" scrolldelay="aa">Test1</marquee>
+<marquee id="test2" scrolldelay="-1">Test2</marquee>
+<marquee id="test3" scrolldelay="1">Test3</marquee>
+<marquee id="test4" scrolldelay="100">Test4</marquee>
+<script>
+ test(function() {
+ var mq = document.getElementById("test1");
+ assert_equals(mq.scrollDelay, 85, "The delay time should be 85ms.");
+ }, "The scrolldelay attribute is a string");
+
+ test(function() {
+ var mq = document.getElementById("test2");
+ assert_equals(mq.scrollDelay, 85, "The delay time should be 85ms.");
+ }, "The scrolldelay attribute is a negative");
+
+ test(function() {
+ var mq = document.getElementById("test3");
+ assert_equals(mq.scrollDelay, 60, "The delay time should be 60ms.");
+ }, "The scrolldelay attribute is less than 60");
+
+ test(function() {
+ var mq = document.getElementById("test4");
+ assert_equals(mq.scrollDelay, 100, "The delay time should be 100ms.");
+ }, "The scrolldelay attribute is greater than 60");
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-start.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-start.html
new file mode 100644
index 000000000..51b4289b2
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-start.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: marquee-start</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/obsolete.html#the-marquee-element">
+<meta name="flags" content="interact">
+<meta name="assert" content="Check the start operation of HTMLMarqueeElement interface">
+<h2>Steps:</h2>
+<ol>
+ <li>Click the 'Start' button to start the marquee element.</li>
+</ol>
+<h2>Expected result:</h2>
+<ul>
+ <li>The text "Test Marquee" start to move when the 'Start' button is clicked.</li>
+</ul>
+<input type="button" id="start" value="Start" />
+<marquee id="test">Test Marquee</marquee>
+<script>
+ document.getElementById("test").stop();
+ document.getElementById("start").addEventListener("click", function(evt) {
+ document.getElementById("test").start();
+ }, false);
+</script>
diff --git a/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-stop.html b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-stop.html
new file mode 100644
index 000000000..57a4e73e4
--- /dev/null
+++ b/testing/web-platform/tests/html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-stop.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: marquee-stop</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/obsolete.html#the-marquee-element">
+<meta name="flags" content="interact">
+<meta name="assert" content="Check the stop operation of HTMLMarqueeElement interface">
+<h2>Steps:</h2>
+<ol>
+ <li>Click the 'Start' button to start the marquee element.</li>
+</ol>
+<h2>Expected result:</h2>
+<ul>
+ <li>The text "Test Marquee" stop moving when the 'Stop' button is clicked.</li>
+</ul>
+<input type="button" id="stop" value="Stop" />
+<marquee id="test">Test Marquee</marquee>
+<script>
+ document.getElementById("stop").addEventListener("click", function(evt) {
+ document.getElementById("test").stop();
+ }, false);
+</script>
diff --git a/testing/web-platform/tests/html/rendering/.gitkeep b/testing/web-platform/tests/html/rendering/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/introduction-9/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/introduction-9/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/introduction-9/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-button-element-0/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-button-element-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-button-element-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-details-element-0/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-details-element-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-details-element-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-button/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-button/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-button/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-checkbox-and-radio-button-widgets/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-checkbox-and-radio-button-widgets/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-checkbox-and-radio-button-widgets/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-color-well/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-color-well/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-color-well/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-file-upload-control/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-file-upload-control/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-file-upload-control/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-range-control/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-range-control/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-range-control/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-text-entry-widget/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-text-entry-widget/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-text-entry-widget/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-text-entry-widget/unrecognized-type-should-fallback-as-text-type-ref.html b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-text-entry-widget/unrecognized-type-should-fallback-as-text-type-ref.html
new file mode 100644
index 000000000..902c1724a
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-text-entry-widget/unrecognized-type-should-fallback-as-text-type-ref.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Unrecognized type should fallback as text type</title>
+<body>
+ <input type="text">
+ <input type="text">
+</body>
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-text-entry-widget/unrecognized-type-should-fallback-as-text-type.html b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-text-entry-widget/unrecognized-type-should-fallback-as-text-type.html
new file mode 100644
index 000000000..1ff38cd14
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-a-text-entry-widget/unrecognized-type-should-fallback-as-text-type.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Unrecognized type should fallback as text type</title>
+<link rel="match" href="unrecognized-type-should-fallback-as-text-type-ref.html">
+<body>
+ <input>
+ <input type="unknown">
+</body>
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-domain-specific-widgets/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-domain-specific-widgets/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-input-element-as-domain-specific-widgets/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-keygen-element-0/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-keygen-element-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-keygen-element-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-marquee-element/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-marquee-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-marquee-element/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-meter-element-0/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-meter-element-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-meter-element-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-progress-element-0/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-progress-element-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-progress-element-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-select-element-0/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-select-element-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-select-element-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-select-element-0/option-label-ref.html b/testing/web-platform/tests/html/rendering/bindings/the-select-element-0/option-label-ref.html
new file mode 100644
index 000000000..e3f73cb3e
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-select-element-0/option-label-ref.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>Option labels</title>
+<select size=12>
+ <option><!-- No children, no label-->
+ <option><!-- No children, empty label-->
+ <option>label<!-- No children, label-->
+ <option><!-- No children, namespaced label-->
+
+ <option>child<!-- Single child, no label-->
+ <option>child<!-- Single child, empty label-->
+ <option>label<!-- Single child, label-->
+ <option>child<!-- Single child, namespaced label-->
+
+ <option>child node<!-- Two children, no label-->
+ <option>child node<!-- Two children, empty label-->
+ <option>label<!-- Two children, label-->
+ <option>child node<!-- Two children, namespaced label-->
+</select>
+
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-select-element-0/option-label.html b/testing/web-platform/tests/html/rendering/bindings/the-select-element-0/option-label.html
new file mode 100644
index 000000000..f98595ed0
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-select-element-0/option-label.html
@@ -0,0 +1,66 @@
+<!doctype html>
+<title>Option labels</title>
+<link rel="match" href="option-label-ref.html">
+<select size=12></select>
+<script>
+var select = document.getElementsByTagName("select")[0], option;
+
+option = document.createElement("option");
+select.appendChild(option);
+
+option = document.createElement("option");
+option.setAttribute("label", "")
+select.appendChild(option);
+
+option = document.createElement("option");
+option.setAttribute("label", "label")
+select.appendChild(option);
+
+option = document.createElement("option");
+option.setAttributeNS("http://www.example.com/", "label", "label")
+select.appendChild(option);
+
+option = document.createElement("option");
+option.appendChild(document.createTextNode(" child "));
+select.appendChild(option);
+
+option = document.createElement("option");
+option.appendChild(document.createTextNode(" child "));
+option.setAttribute("label", "")
+select.appendChild(option);
+
+option = document.createElement("option");
+option.appendChild(document.createTextNode(" child "));
+option.setAttribute("label", "label")
+select.appendChild(option);
+
+option = document.createElement("option");
+option.appendChild(document.createTextNode(" child "));
+option.setAttributeNS("http://www.example.com/", "label", "label")
+select.appendChild(option);
+
+
+option = document.createElement("option");
+option.appendChild(document.createTextNode(" child "));
+option.appendChild(document.createTextNode(" node "));
+select.appendChild(option);
+
+option = document.createElement("option");
+option.appendChild(document.createTextNode(" child "));
+option.appendChild(document.createTextNode(" node "));
+option.setAttribute("label", "")
+select.appendChild(option);
+
+
+option = document.createElement("option");
+option.appendChild(document.createTextNode(" child "));
+option.appendChild(document.createTextNode(" node "));
+option.setAttribute("label", "label")
+select.appendChild(option);
+
+option = document.createElement("option");
+option.appendChild(document.createTextNode(" child "));
+option.appendChild(document.createTextNode(" node "));
+option.setAttributeNS("http://www.example.com/", "label", "label")
+select.appendChild(option);
+</script>
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/.gitkeep b/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/cols-default.html b/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/cols-default.html
new file mode 100644
index 000000000..067d658dd
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/cols-default.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Textarea cols</title>
+<link rel=match href=textarea-ref.html>
+<textarea cols=20></textarea>
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/cols-zero.html b/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/cols-zero.html
new file mode 100644
index 000000000..8ecac6bf5
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/cols-zero.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Textarea cols</title>
+<link rel=match href=textarea-ref.html>
+<textarea cols=0></textarea>
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/rows-default.html b/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/rows-default.html
new file mode 100644
index 000000000..5bb9f61ee
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/rows-default.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Textarea rows</title>
+<link rel=match href=textarea-ref.html>
+<textarea rows=2></textarea>
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/rows-zero.html b/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/rows-zero.html
new file mode 100644
index 000000000..79c8d0ff5
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/rows-zero.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Textarea rows</title>
+<link rel=match href=textarea-ref.html>
+<textarea rows=0></textarea>
diff --git a/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/textarea-ref.html b/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/textarea-ref.html
new file mode 100644
index 000000000..f2982808f
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/bindings/the-textarea-element-0/textarea-ref.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Default textarea</title>
+<textarea></textarea>
diff --git a/testing/web-platform/tests/html/rendering/frames-and-framesets/.gitkeep b/testing/web-platform/tests/html/rendering/frames-and-framesets/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/frames-and-framesets/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/interactive-media/.gitkeep b/testing/web-platform/tests/html/rendering/interactive-media/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/interactive-media/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/interactive-media/editing-hosts/.gitkeep b/testing/web-platform/tests/html/rendering/interactive-media/editing-hosts/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/interactive-media/editing-hosts/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/interactive-media/links-forms-and-navigation/.gitkeep b/testing/web-platform/tests/html/rendering/interactive-media/links-forms-and-navigation/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/interactive-media/links-forms-and-navigation/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/interactive-media/links-forms-and-navigation/original-id.json b/testing/web-platform/tests/html/rendering/interactive-media/links-forms-and-navigation/original-id.json
new file mode 100644
index 000000000..07a108785
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/interactive-media/links-forms-and-navigation/original-id.json
@@ -0,0 +1 @@
+{"original_id":"links,-forms,-and-navigation"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/rendering/interactive-media/text-rendered-in-native-user-interfaces/.gitkeep b/testing/web-platform/tests/html/rendering/interactive-media/text-rendered-in-native-user-interfaces/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/interactive-media/text-rendered-in-native-user-interfaces/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/interactive-media/the-title-attribute-0/.gitkeep b/testing/web-platform/tests/html/rendering/interactive-media/the-title-attribute-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/interactive-media/the-title-attribute-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/introduction-8/.gitkeep b/testing/web-platform/tests/html/rendering/introduction-8/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/introduction-8/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/bidirectional-text/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/bidirectional-text/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/bidirectional-text/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/div-align-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/div-align-ref.html
new file mode 100644
index 000000000..da8e4d0dc
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/div-align-ref.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<style>
+.test { width: 50px; background-color: yellow; }
+.center { text-align: center; }
+.center .test { margin: 0 auto; }
+.left { text-align: left; }
+.left .test { margin-right: auto; }
+.right { text-align: right; }
+.right .test { margin-left: auto; }
+.rtl { direction: rtl; }
+.ltr { direction: ltr; }
+.left .margin { margin-left: 1em; }
+.right .margin { margin-right: 1em; }
+</style>
+</head>
+<body>
+<!-- Centered tests -->
+<div class=center>
+<div class=test>t א</div>
+<div class="test rtl">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class=center>
+<div class="test left">t א</div>
+<div class="test right">t א</div>
+</div>
+
+<div class=left>
+<div class=center>
+<div class=test>t א</div>
+</div>
+</div>
+
+<!-- Left-aligned tests -->
+<div class=left>
+<div class=test>t א</div>
+<div class="test rtl">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class="left rtl">
+<div class=test>t א</div>
+<div class="test ltr">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class=left>
+<div class="test center">t א</div>
+<div class="test right">t א</div>
+</div>
+
+<!-- Right-aligned tests -->
+<div class=right>
+<div class=test>t א</div>
+<div class="test rtl">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class="right rtl">
+<div class=test>t א</div>
+<div class="test ltr">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class=right>
+<div class="test left">t א</div>
+<div class="test center">t א</div>
+</div>
+
+</body>
+</html>
+
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/div-align.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/div-align.html
new file mode 100644
index 000000000..b96fbaeda
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/div-align.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<link rel="match" href="div-align-ref.html">
+<style>
+.test { width: 50px; background-color: yellow; }
+.rtl { direction: rtl; }
+.ltr { direction: ltr; }
+[align=left] .margin { margin-left: 1em }
+[align=right] .margin { margin-right: 1em }
+</style>
+</head>
+<body>
+<!-- Centered tests -->
+<div align=center>
+<div class=test>t א</div>
+<div class="test rtl">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div align=center>
+<div class=test align=left>t א</div>
+<div class=test align=right>t א</div>
+</div>
+
+<div align=left>
+<div align=center>
+<div class=test>t א</div>
+</div>
+</div>
+
+<!-- Left-aligned tests -->
+<div align=left>
+<div class=test>t א</div>
+<div class="test rtl">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div align=left class=rtl>
+<div class=test>t א</div>
+<div class="test ltr">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div align=left>
+<div class=test align=center>t א</div>
+<div class=test align=right>t א</div>
+</div>
+
+<!-- Right-aligned tests -->
+<div align=right>
+<div class=test>t א</div>
+<div class="test rtl">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div align=right class=rtl>
+<div class=test>t א</div>
+<div class="test ltr">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div align=right>
+<div class=test align=left>t א</div>
+<div class=test align=center>t א</div>
+</div>
+
+</body>
+</html>
+
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/figure-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/figure-ref.html
new file mode 100644
index 000000000..a87141be1
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/figure-ref.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<title>The figure element</title>
+<link rel=author title=Ms2ger href=ms2ger@gmail.com>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#the-figure-element>
+<style>
+body > div { margin: 1em 40px; }
+</style>
+<div>
+<div>Caption</div>
+Figure
+</div>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/figure.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/figure.html
new file mode 100644
index 000000000..943f38c3e
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/flow-content-0/figure.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<title>The figure element</title>
+<link rel="match" href="figure-ref.html">
+<link rel=author title=Ms2ger href=ms2ger@gmail.com>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#the-figure-element>
+<figure>
+<figcaption>Caption</figcaption>
+Figure
+</figure>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/form-controls/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/form-controls/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/form-controls/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/hidden-elements/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/hidden-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/hidden-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/TODO-lists.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/TODO-lists.html
new file mode 100644
index 000000000..6d79efc38
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/TODO-lists.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<ol><div><li>A</div></ol>
+<ol><div><li>A</div> <li>B</ol>
+<ol><div><li>A</div><div><li>B</div></ol>
+<ol reversed><div><li>A</div> <li>B</ol>
+<ol><div style=display:list-item>A</div><li>B</ol>
+<ol reversed><div style=display:list-item>A</div><li>B</ol>
+<ol reversed>
+ <div><li>Two</li></div>
+ <li>One</li>
+ <li>Zero</li>
+</ol>
+<ol reversed>
+ <li>Three</li>
+ <li style="display: none"></li>
+ <li>Two</li>
+</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-supported-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-supported-ref.html
new file mode 100644
index 000000000..0de7ff329
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-supported-ref.html
@@ -0,0 +1,45 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>li@type: supported types</title>
+<style>
+ .decimal { list-style-type: decimal; }
+ .lower-alpha { list-style-type: lower-alpha; }
+ .upper-alpha { list-style-type: upper-alpha; }
+ .lower-roman { list-style-type: lower-roman; }
+ .upper-roman { list-style-type: upper-roman; }
+ .disc { list-style-type: disc; }
+ .circle { list-style-type: circle; }
+ .square { list-style-type: square; }
+ .none { list-style-type: none; }
+</style>
+<li class="decimal">first item</li>
+<li class="lower-alpha">second item</li>
+<li class="upper-alpha">third item</li>
+<li class="lower-roman">fourth item</li>
+<li class="upper-roman">fifth item</li>
+<li class="disc">sixth item</li>
+<li class="circle">seventh item</li>
+<li class="square">eighth item</li>
+<li class="none">ninth item</li>
+<ol>
+ <li class="decimal">first ordered item</li>
+ <li class="lower-alpha">second ordered item</li>
+ <li class="upper-alpha">third ordered item</li>
+ <li class="lower-roman">fourth ordered item</li>
+ <li class="upper-roman">fifth ordered item</li>
+ <li class="disc">sixth ordered item</li>
+ <li class="circle">seventh ordered item</li>
+ <li class="square">eighth ordered item</li>
+ <li class="none">ninth ordered item</li>
+</ol>
+<ul>
+ <li class="decimal">first unordered item</li>
+ <li class="lower-alpha">second unordered item</li>
+ <li class="upper-alpha">third unordered item</li>
+ <li class="lower-roman">fourth unordered item</li>
+ <li class="upper-roman">fifth unordered item</li>
+ <li class="disc">sixth unordered item</li>
+ <li class="circle">seventh unordered item</li>
+ <li class="square">eighth unordered item</li>
+ <li class="none">ninth unordered item</li>
+</ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-supported-xhtml.xhtml b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-supported-xhtml.xhtml
new file mode 100644
index 000000000..7a7640e03
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-supported-xhtml.xhtml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>li@type: supported types</title>
+<link rel="match" href="li-type-supported-ref.html"/>
+</head>
+<body>
+<li type="1">first item</li>
+<li type="a">second item</li>
+<li type="A">third item</li>
+<li type="i">fourth item</li>
+<li type="I">fifth item</li>
+<li type="disc">sixth item</li>
+<li type="circle">seventh item</li>
+<li type="square">eighth item</li>
+<li type="none">ninth item</li>
+<ol>
+ <li type="1">first ordered item</li>
+ <li type="a">second ordered item</li>
+ <li type="A">third ordered item</li>
+ <li type="i">fourth ordered item</li>
+ <li type="I">fifth ordered item</li>
+ <li type="disc">sixth ordered item</li>
+ <li type="circle">seventh ordered item</li>
+ <li type="square">eighth ordered item</li>
+ <li type="none">ninth ordered item</li>
+</ol>
+<ul>
+ <li type="1">first unordered item</li>
+ <li type="a">second unordered item</li>
+ <li type="A">third unordered item</li>
+ <li type="i">fourth unordered item</li>
+ <li type="I">fifth unordered item</li>
+ <li type="disc">sixth unordered item</li>
+ <li type="circle">seventh unordered item</li>
+ <li type="square">eighth unordered item</li>
+ <li type="none">ninth unordered item</li>
+</ul>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-supported.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-supported.html
new file mode 100644
index 000000000..ddd9024c1
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-supported.html
@@ -0,0 +1,35 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>li@type: supported types</title>
+<link rel=match href=li-type-supported-ref.html>
+<li type=1>first item</li>
+<li type=a>second item</li>
+<li type=A>third item</li>
+<li type=i>fourth item</li>
+<li type=I>fifth item</li>
+<li type=disc>sixth item</li>
+<li type=circle>seventh item</li>
+<li type=square>eighth item</li>
+<li type=none>ninth item</li>
+<ol>
+ <li type=1>first ordered item</li>
+ <li type=a>second ordered item</li>
+ <li type=A>third ordered item</li>
+ <li type=i>fourth ordered item</li>
+ <li type=I>fifth ordered item</li>
+ <li type=disc>sixth ordered item</li>
+ <li type=circle>seventh ordered item</li>
+ <li type=square>eighth ordered item</li>
+ <li type=none>ninth ordered item</li>
+</ol>
+<ul>
+ <li type=1>first unordered item</li>
+ <li type=a>second unordered item</li>
+ <li type=A>third unordered item</li>
+ <li type=i>fourth unordered item</li>
+ <li type=I>fifth unordered item</li>
+ <li type=disc>sixth unordered item</li>
+ <li type=circle>seventh unordered item</li>
+ <li type=square>eighth unordered item</li>
+ <li type=none>ninth unordered item</li>
+</ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-lower-alpha.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-lower-alpha.html
new file mode 100644
index 000000000..81babe788
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-lower-alpha.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>li@type: unsupported type: lower-alpha</title>
+<link rel=match href=li-type-unsupported-ref.html>
+<li type=lower-alpha>first item</li>
+<li type=LOWER-ALPHA>second item</li>
+<ol>
+ <li type=lower-alpha>first ordered item</li>
+ <li type=LOWER-ALPHA>second ordered item</li>
+</ol>
+<ul>
+ <li type=lower-alpha>first unordered item</li>
+ <li type=LOWER-ALPHA>second unordered item</li>
+</ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-lower-roman.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-lower-roman.html
new file mode 100644
index 000000000..e01cfdb72
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-lower-roman.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>li@type: unsupported type: lower-roman</title>
+<link rel=match href=li-type-unsupported-ref.html>
+<li type=lower-roman>first item</li>
+<li type=LOWER-ROMAN>second item</li>
+<ol>
+ <li type=lower-roman>first ordered item</li>
+ <li type=LOWER-ROMAN>second ordered item</li>
+</ol>
+<ul>
+ <li type=lower-roman>first unordered item</li>
+ <li type=LOWER-ROMAN>second unordered item</li>
+</ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-ref.html
new file mode 100644
index 000000000..4fbc5aca9
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-ref.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>li@type: unsupported types</title>
+<li>first item</li>
+<li>second item</li>
+<ol>
+ <li>first ordered item</li>
+ <li>second ordered item</li>
+</ol>
+<ul>
+ <li>first unordered item</li>
+ <li>second unordered item</li>
+</ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-upper-alpha.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-upper-alpha.html
new file mode 100644
index 000000000..2efb65dbd
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-upper-alpha.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>li@type: unsupported type: upper-alpha</title>
+<link rel=match href=li-type-unsupported-ref.html>
+<li type=upper-alpha>first item</li>
+<li type=UPPER-ALPHA>second item</li>
+<ol>
+ <li type=upper-alpha>first ordered item</li>
+ <li type=UPPER-ALPHA>second ordered item</li>
+</ol>
+<ul>
+ <li type=upper-alpha>first unordered item</li>
+ <li type=UPPER-ALPHA>second unordered item</li>
+</ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-upper-roman.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-upper-roman.html
new file mode 100644
index 000000000..bd8dafc9c
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/li-type-unsupported-upper-roman.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>li@type: unsupported type: upper-roman</title>
+<link rel=match href=li-type-unsupported-ref.html>
+<li type=upper-roman>first item</li>
+<li type=UPPER-ROMAN>second item</li>
+<ol>
+ <li type=upper-roman>first ordered item</li>
+ <li type=UPPER-ROMAN>second ordered item</li>
+</ol>
+<ul>
+ <li type=upper-roman>first unordered item</li>
+ <li type=UPPER-ROMAN>second unordered item</li>
+</ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-supported-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-supported-ref.html
new file mode 100644
index 000000000..fb61db326
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-supported-ref.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: supported types</title>
+<style>
+.decimal {
+ list-style-type: decimal;
+}
+.lower-alpha {
+ list-style-type: lower-alpha;
+}
+.upper-alpha {
+ list-style-type: upper-alpha;
+}
+.lower-roman {
+ list-style-type: lower-roman;
+}
+.upper-roman {
+ list-style-type: upper-roman;
+}
+</style>
+<ol class=decimal><li>1<li>2</ol>
+<ol class=lower-alpha><li>a<li>b</ol>
+<ol class=upper-alpha><li>A<li>B</ol>
+<ol class=lower-roman><li>i<li>ii</ol>
+<ol class=upper-roman><li>I<li>II</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-supported-xhtml.xhtml b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-supported-xhtml.xhtml
new file mode 100644
index 000000000..d7b949dab
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-supported-xhtml.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>ol@type: supported types</title>
+<link rel="match" href="ol-type-supported-ref.html"/>
+</head>
+<body>
+<ol type="1"><li>1</li><li>2</li></ol>
+<ol type="a"><li>a</li><li>b</li></ol>
+<ol type="A"><li>A</li><li>B</li></ol>
+<ol type="i"><li>i</li><li>ii</li></ol>
+<ol type="I"><li>I</li><li>II</li></ol>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-supported.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-supported.html
new file mode 100644
index 000000000..86ed3be38
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-supported.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: supported types</title>
+<link rel=match href=ol-type-supported-ref.html>
+<ol type=1><li>1<li>2</ol>
+<ol type=a><li>a<li>b</ol>
+<ol type=A><li>A<li>B</ol>
+<ol type=i><li>i<li>ii</ol>
+<ol type=I><li>I<li>II</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-circle.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-circle.html
new file mode 100644
index 000000000..f3c52e43b
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-circle.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: unsupported type: circle</title>
+<link rel=match href=ol-type-unsupported-ref.html>
+<ol type=circle><li>1<li>2</ol>
+<ol type=CIRCLE><li>1<li>2</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-disc.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-disc.html
new file mode 100644
index 000000000..a0f41f3b1
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-disc.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: unsupported type: disc</title>
+<link rel=match href=ol-type-unsupported-ref.html>
+<ol type=disc><li>1<li>2</ol>
+<ol type=DISC><li>1<li>2</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-invalid.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-invalid.html
new file mode 100644
index 000000000..6c1198ef5
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-invalid.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: unsupported type: invalid</title>
+<link rel=match href=ol-type-unsupported-ref.html>
+<ol type=disk><li>1<li>2</ol>
+<ol type=DISK><li>1<li>2</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-lower-alpha.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-lower-alpha.html
new file mode 100644
index 000000000..2fd656100
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-lower-alpha.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: unsupported type: lower-alpha</title>
+<link rel=match href=ol-type-unsupported-ref.html>
+<ol type=lower-alpha><li>1<li>2</ol>
+<ol type=LOWER-ALPHA><li>1<li>2</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-lower-roman.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-lower-roman.html
new file mode 100644
index 000000000..49f5b2888
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-lower-roman.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: unsupported type: lower-roman</title>
+<link rel=match href=ol-type-unsupported-ref.html>
+<ol type=lower-roman><li>1<li>2</ol>
+<ol type=LOWER-ROMAN><li>1<li>2</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-none.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-none.html
new file mode 100644
index 000000000..bf800e1b1
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-none.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: unsupported type: none</title>
+<link rel=match href=ol-type-unsupported-ref.html>
+<ol type=none><li>1<li>2</ol>
+<ol type=NONE><li>1<li>2</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-ref.html
new file mode 100644
index 000000000..530f8ef6c
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-ref.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: unsupported types</title>
+<ol><li>1<li>2</ol>
+<ol><li>1<li>2</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-round.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-round.html
new file mode 100644
index 000000000..10a573687
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-round.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: unsupported type: round</title>
+<link rel=match href=ol-type-unsupported-ref.html>
+<ol type=round><li>1<li>2</ol>
+<ol type=ROUND><li>1<li>2</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-square.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-square.html
new file mode 100644
index 000000000..b3e8937fb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-square.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: unsupported type: square</title>
+<link rel=match href=ol-type-unsupported-ref.html>
+<ol type=square><li>1<li>2</ol>
+<ol type=SQUARE><li>1<li>2</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-upper-alpha.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-upper-alpha.html
new file mode 100644
index 000000000..6a1ff97db
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-upper-alpha.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: unsupported type: upper-latin</title>
+<link rel=match href=ol-type-unsupported-ref.html>
+<ol type=upper-alpha><li>1<li>2</ol>
+<ol type=UPPER-ALPHA><li>1<li>2</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-upper-roman.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-upper-roman.html
new file mode 100644
index 000000000..04cf451c6
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ol-type-unsupported-upper-roman.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ol@type: unsupported type: upper-roman</title>
+<link rel=match href=ol-type-unsupported-ref.html>
+<ol type=upper-roman><li>1<li>2</ol>
+<ol type=UPPER-ROMAN><li>1<li>2</ol>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-supported-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-supported-ref.html
new file mode 100644
index 000000000..59a0400cc
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-supported-ref.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ul@type: supported types</title>
+<style>
+.disc {
+ list-style-type: disc;
+}
+.circle {
+ list-style-type: circle;
+}
+.square {
+ list-style-type: square;
+}
+.none {
+ list-style-type: none;
+}
+</style>
+<ul class="disc"><li>first disc</li><li>second disc</li></ul>
+<ul class="circle"><li>first circle</li><li>second circle</li></ul>
+<ul class="square"><li>first square</li><li>second square</li></ul>
+<ul class="none"><li>first none</li><li>second none</li></ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-supported-xhtml.xhtml b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-supported-xhtml.xhtml
new file mode 100644
index 000000000..a2e5e0bbf
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-supported-xhtml.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>ul@type: supported types</title>
+<link rel="match" href="ul-type-supported-ref.html"/>
+</head>
+<body>
+<ul type="disc"><li>first disc</li><li>second disc</li></ul>
+<ul type="circle"><li>first circle</li><li>second circle</li></ul>
+<ul type="square"><li>first square</li><li>second square</li></ul>
+<ul type="none"><li>first none</li><li>second none</li></ul>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-supported.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-supported.html
new file mode 100644
index 000000000..c2449d7ac
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-supported.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ul@type: supported types</title>
+<link rel=match href=ul-type-supported-ref.html>
+<ul type=disc><li>first disc</li><li>second disc</li></ul>
+<ul type=circle><li>first circle</li><li>second circle</li></ul>
+<ul type=square><li>first square</li><li>second square</li></ul>
+<ul type=none><li>first none</li><li>second none</li></ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-decimal.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-decimal.html
new file mode 100644
index 000000000..0fb0e14ab
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-decimal.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ul@type: unsupported type: decimal</title>
+<link rel=match href=ul-type-unsupported-ref.html>
+<ul type=decimal><li>first item</li><li>second item</li></ul>
+<ul type=DECIMAL><li>first item</li><li>second item</li></ul>
+<ul type=1><li>first item</li><li>second item</li></ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-invalid.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-invalid.html
new file mode 100644
index 000000000..c6ee14eac
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-invalid.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ul@type: unsupported type: invalid</title>
+<link rel=match href=ul-type-unsupported-ref.html>
+<ul type=disk><li>first item</li><li>second item</li></ul>
+<ul type=DISK><li>first item</li><li>second item</li></ul>
+<ul type=x><li>first item</li><li>second item</li></ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-lower-alpha.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-lower-alpha.html
new file mode 100644
index 000000000..f31cc247c
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-lower-alpha.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ul@type: unsupported type: lower-alpha</title>
+<link rel=match href=ul-type-unsupported-ref.html>
+<ul type=lower-alpha><li>first item</li><li>second item</li></ul>
+<ul type=LOWER-ALPHA><li>first item</li><li>second item</li></ul>
+<ul type=a><li>first item</li><li>second item</li></ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-lower-roman.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-lower-roman.html
new file mode 100644
index 000000000..bd86861c9
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-lower-roman.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ul@type: unsupported type: lower-roman</title>
+<link rel=match href=ul-type-unsupported-ref.html>
+<ul type=lower-roman><li>first item</li><li>second item</li></ul>
+<ul type=LOWER-ROMAN><li>first item</li><li>second item</li></ul>
+<ul type=i><li>first item</li><li>second item</li></ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-ref.html
new file mode 100644
index 000000000..c53fe947f
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-ref.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ul@type: unsupported types</title>
+<ul><li>first item</li><li>second item</li></ul>
+<ul><li>first item</li><li>second item</li></ul>
+<ul><li>first item</li><li>second item</li></ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-upper-alpha.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-upper-alpha.html
new file mode 100644
index 000000000..3f880f1dc
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-upper-alpha.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ul@type: unsupported type: upper-alpha</title>
+<link rel=match href=ul-type-unsupported-ref.html>
+<ul type=upper-alpha><li>first item</li><li>second item</li></ul>
+<ul type=UPPER-ALPHA><li>first item</li><li>second item</li></ul>
+<ul type=A><li>first item</li><li>second item</li></ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-upper-roman.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-upper-roman.html
new file mode 100644
index 000000000..d7f1295d6
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/lists/ul-type-unsupported-upper-roman.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>ul@type: unsupported type: upper-roman</title>
+<link rel=match href=ul-type-unsupported-ref.html>
+<ul type=upper-roman><li>first item</li><li>second item</li></ul>
+<ul type=UPPER-ROMAN><li>first item</li><li>second item</li></ul>
+<ul type=I><li>first item</li><li>second item</li></ul>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-a.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-a.html
new file mode 100644
index 000000000..c8ed1903f
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-a.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<link rel=match href=001-ref.html>
+<title>The font element text decoration color quirk, 001, almost standards mode</title>
+<style>[id] > * { color:fuchsia }</style>
+<div>Quirk should apply:</div>
+<div><u>foo <font style="color:fuchsia">style</font> bar</u></div>
+<div><u>foo <font color="fuchsia">color</font> bar</u></div>
+<div><u>foo <font color="fuchsia" style="color:fuchsia">color and style</font> bar</u></div>
+<div><u>foo <font color="x" style="color:fuchsia">color=x and style</font> bar</u></div>
+<div><u>foo <font color="transparent" style="color:fuchsia">color=transparent and style</font> bar</u></div>
+<div><u>foo <font color="" style="color:fuchsia">color="" and style</font> bar</u></div>
+<div><u>foo <font style="display:block; color:fuchsia">block</font> bar</u></div>
+<div><s>foo <font color="fuchsia">line-through</font> bar</s></div>
+<div><u style="text-decoration:overline">foo <font color="fuchsia">overline</font> bar</u></div>
+<div>Quirks should not apply:</div>
+<div><u>foo <span style="color:fuchsia">span</span> bar</u></div>
+<div><u id="no-namespace">FAIL (script didn't run)</u></div>
+<script>
+var a = document.getElementById('no-namespace');
+a.textContent = 'foo ';
+var elm = document.createElementNS('', 'font');
+elm.textContent = 'no-namespace font element';
+a.appendChild(elm);
+a.appendChild(document.createTextNode(' bar'));
+</script>
+<div><u id="uppercase">FAIL (script didn't run)</u></div>
+<script>
+var a = document.getElementById('uppercase');
+a.textContent = 'foo ';
+var elm = document.createElementNS('http://www.w3.org/1999/xhtml', 'FONT');
+elm.textContent = 'uppercase FONT element';
+a.appendChild(elm);
+a.appendChild(document.createTextNode(' bar'));
+</script>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-q.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-q.html
new file mode 100644
index 000000000..9025e7289
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-q.html
@@ -0,0 +1,33 @@
+<link rel=match href=001-ref.html>
+<title>The font element text decoration color quirk, 001, quirks mode</title>
+<style>[id] > * { color:fuchsia }</style>
+<div>Quirk should apply:</div>
+<div><u>foo <font style="color:fuchsia">style</font> bar</u></div>
+<div><u>foo <font color="fuchsia">color</font> bar</u></div>
+<div><u>foo <font color="fuchsia" style="color:fuchsia">color and style</font> bar</u></div>
+<div><u>foo <font color="x" style="color:fuchsia">color=x and style</font> bar</u></div>
+<div><u>foo <font color="transparent" style="color:fuchsia">color=transparent and style</font> bar</u></div>
+<div><u>foo <font color="" style="color:fuchsia">color="" and style</font> bar</u></div>
+<div><u>foo <font style="display:block; color:fuchsia">block</font> bar</u></div>
+<div><s>foo <font color="fuchsia">line-through</font> bar</s></div>
+<div><u style="text-decoration:overline">foo <font color="fuchsia">overline</font> bar</u></div>
+<div>Quirks should not apply:</div>
+<div><u>foo <span style="color:fuchsia">span</span> bar</u></div>
+<div><u id="no-namespace">FAIL (script didn't run)</u></div>
+<script>
+var a = document.getElementById('no-namespace');
+a.textContent = 'foo ';
+var elm = document.createElementNS('', 'font');
+elm.textContent = 'no-namespace font element';
+a.appendChild(elm);
+a.appendChild(document.createTextNode(' bar'));
+</script>
+<div><u id="uppercase">FAIL (script didn't run)</u></div>
+<script>
+var a = document.getElementById('uppercase');
+a.textContent = 'foo ';
+var elm = document.createElementNS('http://www.w3.org/1999/xhtml', 'FONT');
+elm.textContent = 'uppercase FONT element';
+a.appendChild(elm);
+a.appendChild(document.createTextNode(' bar'));
+</script>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-ref.html
new file mode 100644
index 000000000..a6fec366d
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-ref.html
@@ -0,0 +1,21 @@
+<title>Reference for The font element text decoration color quirk, 001</title>
+<style>
+span, div > div { color:fuchsia }
+.under { text-decoration:underline }
+.over { text-decoration:overline }
+.strike { text-decoration:line-through }
+</style>
+<div>Quirk should apply:</div>
+<div><u>foo </u><span class="under">style</span><u> bar</u></div>
+<div><u>foo </u><span class="under">color</span><u> bar</u></div>
+<div><u>foo </u><span class="under">color and style</span><u> bar</u></div>
+<div><u>foo </u><span class="under">color=x and style</span><u> bar</u></div>
+<div><u>foo </u><span class="under">color=transparent and style</span><u> bar</u></div>
+<div><u>foo </u><span class="under">color="" and style</span><u> bar</u></div>
+<div><u>foo</u><div class="under">block</div><u>bar</u></div>
+<div><s>foo </s><span class="strike">line-through</span><s> bar</s></div>
+<div><u class="over">foo </u><span class="over">overline</span><u class="over"> bar</u></div>
+<div>Quirks should not apply:</div>
+<div><u>foo <span>span</span> bar</u></div>
+<div><u>foo <span>no-namespace font element</span> bar</u></div>
+<div><u>foo <span>uppercase FONT element</span> bar</u></div>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-s.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-s.html
new file mode 100644
index 000000000..bac80e53b
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-s.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<link rel=match href=001-ref.html>
+<title>The font element text decoration color quirk, 001, standards mode</title>
+<style>[id] > * { color:fuchsia }</style>
+<div>Quirk should apply:</div>
+<div><u>foo <font style="color:fuchsia">style</font> bar</u></div>
+<div><u>foo <font color="fuchsia">color</font> bar</u></div>
+<div><u>foo <font color="fuchsia" style="color:fuchsia">color and style</font> bar</u></div>
+<div><u>foo <font color="x" style="color:fuchsia">color=x and style</font> bar</u></div>
+<div><u>foo <font color="transparent" style="color:fuchsia">color=transparent and style</font> bar</u></div>
+<div><u>foo <font color="" style="color:fuchsia">color="" and style</font> bar</u></div>
+<div><u>foo <font style="display:block; color:fuchsia">block</font> bar</u></div>
+<div><s>foo <font color="fuchsia">line-through</font> bar</s></div>
+<div><u style="text-decoration:overline">foo <font color="fuchsia">overline</font> bar</u></div>
+<div>Quirks should not apply:</div>
+<div><u>foo <span style="color:fuchsia">span</span> bar</u></div>
+<div><u id="no-namespace">FAIL (script didn't run)</u></div>
+<script>
+var a = document.getElementById('no-namespace');
+a.textContent = 'foo ';
+var elm = document.createElementNS('', 'font');
+elm.textContent = 'no-namespace font element';
+a.appendChild(elm);
+a.appendChild(document.createTextNode(' bar'));
+</script>
+<div><u id="uppercase">FAIL (script didn't run)</u></div>
+<script>
+var a = document.getElementById('uppercase');
+a.textContent = 'foo ';
+var elm = document.createElementNS('http://www.w3.org/1999/xhtml', 'FONT');
+elm.textContent = 'uppercase FONT element';
+a.appendChild(elm);
+a.appendChild(document.createTextNode(' bar'));
+</script>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-x.xhtml b/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-x.xhtml
new file mode 100644
index 000000000..7a5090c36
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-x.xhtml
@@ -0,0 +1,23 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<link rel="match" href="001-ref.html"/>
+<title>The font element text decoration color quirk, 001, XHTML</title>
+<style>[id] > * { color:fuchsia }</style>
+</head>
+<body>
+<div>Quirk should apply:</div>
+<div><u>foo <font style="color:fuchsia">style</font> bar</u></div>
+<div><u>foo <font color="fuchsia">color</font> bar</u></div>
+<div><u>foo <font color="fuchsia" style="color:fuchsia">color and style</font> bar</u></div>
+<div><u>foo <font color="x" style="color:fuchsia">color=x and style</font> bar</u></div>
+<div><u>foo <font color="transparent" style="color:fuchsia">color=transparent and style</font> bar</u></div>
+<div><u>foo <font color="" style="color:fuchsia">color="" and style</font> bar</u></div>
+<div><u>foo <font style="display:block; color:fuchsia">block</font> bar</u></div>
+<div><s>foo <font color="fuchsia">line-through</font> bar</s></div>
+<div><u style="text-decoration:overline">foo <font color="fuchsia">overline</font> bar</u></div>
+<div>Quirks should not apply:</div>
+<div><u>foo <span style="color:fuchsia">span</span> bar</u></div>
+<div><u id="no-namespace">foo <font xmlns="">no-namespace font element</font> bar</u></div>
+<div><u id="uppercase">foo <FONT>uppercase FONT element</FONT> bar</u></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/quotes/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/quotes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/quotes/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/sections-and-headings/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/sections-and-headings/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/sections-and-headings/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-1-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-1-ref.html
new file mode 100644
index 000000000..ceac88e9a
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-1-ref.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Table borders</title>
+<style>
+table {
+ border-width: 1px;
+ border-style: outset;
+}
+td {
+ border-width: 1px;
+ border-style: inset;
+}
+</style>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-1.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-1.html
new file mode 100644
index 000000000..333881399
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<link rel="match" href="table-border-1-ref.html">
+<title>Table borders</title>
+<table border>
+<tr><td>Test
+</table>
+<table border="">
+<tr><td>Test
+</table>
+<table border=null>
+<tr><td>Test
+</table>
+<table border=undefined>
+<tr><td>Test
+</table>
+<table border=foo>
+<tr><td>Test
+</table>
+<table border=1>
+<tr><td>Test
+</table>
+<table border=1foo>
+<tr><td>Test
+</table>
+<table border=1%>
+<tr><td>Test
+</table>
+<table border=-1>
+<tr><td>Test
+</table>
+<table border=-1foo>
+<tr><td>Test
+</table>
+<table border=-1%>
+<tr><td>Test
+</table>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-2-notref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-2-notref.html
new file mode 100644
index 000000000..7558e5271
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-2-notref.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Table borders</title>
+<style>
+table {
+ border-width: 1px;
+ border-style: outset;
+}
+td {
+ border-width: 1px;
+ border-style: inset;
+}
+</style>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-2-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-2-ref.html
new file mode 100644
index 000000000..36d1e4510
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-2-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Table borders</title>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-2.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-2.html
new file mode 100644
index 000000000..6f4f39b11
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-border-2.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<link rel="match" href="table-border-2-ref.html">
+<title>Table borders</title>
+<table border=0>
+<tr><td>Test
+</table>
+<table border=0foo>
+<tr><td>Test
+</table>
+<table border=0%>
+<tr><td>Test
+</table>
+<table border=+0>
+<tr><td>Test
+</table>
+<table border=+0foo>
+<tr><td>Test
+</table>
+<table border=+0%>
+<tr><td>Test
+</table>
+<table border=-0>
+<tr><td>Test
+</table>
+<table border=-0foo>
+<tr><td>Test
+</table>
+<table border=-0%>
+<tr><td>Test
+</table>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-cell-width-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-cell-width-ref.html
new file mode 100644
index 000000000..b5ba0443f
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-cell-width-ref.html
@@ -0,0 +1,37 @@
+<style>
+body {
+ margin: 0;
+}
+
+.row {
+ clear: both;
+}
+
+.row div {
+ float: left;
+}
+
+.red {
+ background-color: red;
+}
+</style>
+
+<div class="row">
+ <div class="red" style="width: 200px">a</div>
+ <div style="width: 200px">a</div>
+</div>
+
+<div class="row">
+ <div class="red" style="width: 200px">a</div>
+ <div style="width: 200px">a</div>
+</div>
+
+<div class="row">
+ <div class="red" style="width: 100px">a</div>
+ <div style="width: 300px">a</div>
+</div>
+
+<div class="row">
+ <div class="red" style="width: 100px">a</div>
+ <div style="width: 300px">a</div>
+</div>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-cell-width-s.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-cell-width-s.html
new file mode 100644
index 000000000..0fe0e2c25
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-cell-width-s.html
@@ -0,0 +1,55 @@
+<!doctype html>
+<link rel="match" href="table-cell-width-ref.html">
+<style>
+body {
+ margin: 0;
+}
+
+table {
+ width: 400px;
+ border-collapse: collapse;
+}
+
+th {
+ font-weight: normal;
+ text-align: left;
+}
+
+td, th {
+ padding: 0;
+}
+
+td:first-child, th:first-child {
+ background-color: red;
+}
+</style>
+
+<!-- width=0 should be treated as 'auto' -->
+<table>
+ <tr>
+ <th width=0>a</th>
+ <th>a</th>
+ </tr>
+</table>
+
+<table>
+ <tr>
+ <td width=0>a</td>
+ <td>a</td>
+ </tr>
+</table>
+
+<!-- test valid width attribute value-->
+<table>
+ <tr>
+ <th width=100>a</th>
+ <th>a</th>
+ </tr>
+</table>
+
+<table>
+ <tr>
+ <td width=100>a</td>
+ <td>a</td>
+ </tr>
+</table>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-cell-width.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-cell-width.html
new file mode 100644
index 000000000..f66244ab1
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-cell-width.html
@@ -0,0 +1,54 @@
+<link rel="match" href="table-cell-width-ref.html">
+<style>
+body {
+ margin: 0;
+}
+
+table {
+ width: 400px;
+ border-collapse: collapse;
+}
+
+th {
+ font-weight: normal;
+ text-align: left;
+}
+
+td, th {
+ padding: 0;
+}
+
+td:first-child, th:first-child {
+ background-color: red;
+}
+</style>
+
+<!-- width=0 should be treated as 'auto' -->
+<table>
+ <tr>
+ <th width=0>a</th>
+ <th>a</th>
+ </tr>
+</table>
+
+<table>
+ <tr>
+ <td width=0>a</td>
+ <td>a</td>
+ </tr>
+</table>
+
+<!-- test valid width attribute value-->
+<table>
+ <tr>
+ <th width=100>a</th>
+ <th>a</th>
+ </tr>
+</table>
+
+<table>
+ <tr>
+ <td width=100>a</td>
+ <td>a</td>
+ </tr>
+</table>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-layout-notref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-layout-notref.html
new file mode 100644
index 000000000..ef1378185
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-layout-notref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Table layout attribute</title>
+<table border width=100% style=table-layout:fixed>
+<tr><td>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<td>aaa
+</table>
+<table border width=100% style=table-layout:fixed>
+<tr><td>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<td>aaa
+</table>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-layout-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-layout-ref.html
new file mode 100644
index 000000000..d76a48c4a
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-layout-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Table layout attribute</title>
+<table border width=100%>
+<tr><td>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<td>aaa
+</table>
+<table border width=100%>
+<tr><td>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<td>aaa
+</table>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-layout.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-layout.html
new file mode 100644
index 000000000..7dfacf227
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-layout.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Table layout attribute</title>
+<link rel="match" href="table-layout-ref.html">
+<meta name="assert"
+ content="The layout attribute on table elements should have no effect.">
+<table border width=100% layout=fixed>
+<tr><td>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<td>aaa
+</table>
+<table border width=100% layout=auto>
+<tr><td>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<td>aaa
+</table>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-150percent-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-150percent-ref.html
new file mode 100644
index 000000000..820c360e3
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-150percent-ref.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<title>Test for capping percentages</title>
+<style>
+div { width:300px; background:yellow; height:50px; }
+table { width:150%; }
+td { background:blue; }
+</style>
+<div>
+ <table cellspacing="0" cellpadding="0" border="0">
+ <tr><td>parent div float=left</td></tr>
+ </table>
+</div>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-150percent.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-150percent.html
new file mode 100644
index 000000000..9a5e10850
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-150percent.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<title>Test for capping percentages</title>
+<link rel="match" href="table-width-150percent-ref.html">
+<style>
+div { width:300px; background:yellow; height:50px; }
+td { background:blue; }
+</style>
+<div>
+ <table width="150%" cellspacing="0" cellpadding="0" border="0">
+ <tr><td>parent div float=left</td></tr>
+ </table>
+</div>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-ref.html
new file mode 100644
index 000000000..2b0f9e445
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-ref.html
@@ -0,0 +1,13 @@
+<style>
+p {
+ padding: 0;
+ margin: 0;
+}
+</style>
+
+<p>a b</p>
+
+<hr>
+
+<p>a</p>
+<p>b</p>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-s.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-s.html
new file mode 100644
index 000000000..5b987e791
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width-s.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<link rel="match" href="table-width-ref.html">
+
+<style>
+table {
+ border-collapse: collapse;
+}
+
+td {
+ padding: 0;
+}
+</style>
+
+<!-- width=0 should be treated as 'auto' -->
+<table width=0>
+ <tr>
+ <td>
+ a b
+ </td>
+ </tr>
+</table>
+
+<hr>
+
+<table width=1>
+ <tr>
+ <td>
+ a b
+ </td>
+ </tr>
+</table>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width.html
new file mode 100644
index 000000000..59c5ca70d
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/table-width.html
@@ -0,0 +1,30 @@
+<link rel="match" href="table-width-ref.html">
+
+<style>
+table {
+ border-collapse: collapse;
+}
+
+td {
+ padding: 0;
+}
+</style>
+
+<!-- width=0 should be treated as 'auto' -->
+<table width=0>
+ <tr>
+ <td>
+ a b
+ </td>
+ </tr>
+</table>
+
+<hr>
+
+<table width=1>
+ <tr>
+ <td>
+ a b
+ </td>
+ </tr>
+</table>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/min-width-not-important.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/min-width-not-important.html
new file mode 100644
index 000000000..cabbaf20e
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/min-width-not-important.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Rendering requirements test (suggested default rendering): fieldset min-width is overridable</title>
+ <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-fieldset-and-legend-elements">
+ <link rel="help" href="http://drafts.csswg.org/css2/visudet.html#min-max-widths">
+ <link rel="help" href="http://drafts.csswg.org/css-sizing/#width-height-keywords">
+ <link rel="match" href="ref.html">
+ <meta name="flags" content="">
+ <meta name="assert" content="fieldset's default min-width should be overridable since it's not !important and not spec'd to be non-overridable">
+ <style>
+body {
+ margin: 10px;
+}
+#cover {
+ background-color: green;
+ position: absolute;
+ left: 10px;
+ top: 10px;
+ height: 100px;
+ width: 100px;
+ z-index: 2;
+}
+fieldset {
+ min-width: 0;/* property under test */
+ /* zero these out so it renders more like a div element */
+ border: none;
+ margin: 0;
+ padding: 0;
+}
+.outer {
+ width: 100px;
+}
+.inner {
+ background-color: red;
+ color: red;
+ height: 100px;
+ overflow: scroll;
+ white-space: nowrap;
+}
+ </style>
+</head>
+<body>
+ <div class="outer">
+ <fieldset>
+ <div class="inner">a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a</div>
+ </fieldset>
+ </div>
+ <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+ <div id="cover"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/ref.html
new file mode 100644
index 000000000..d17268a78
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Rendering requirements Reftest Reference</title>
+ <style>
+body {
+ margin: 10px;
+}
+div {
+ background-color: green;
+ height: 100px;
+ width: 100px;
+}
+ </style>
+</head>
+<body>
+ <div></div>
+ <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/align-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/align-ref.html
new file mode 100644
index 000000000..9e4283e20
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/align-ref.html
@@ -0,0 +1,31 @@
+
+<!doctype html>
+<meta charset=utf-8>
+<style>
+.hr {
+ color: gray;
+ border-style: inset;
+ border-width: 1px;
+ margin: 0.5em auto;
+ width: 100px;
+}
+
+.left {
+ margin-left: 0;
+}
+
+.right {
+ margin-right: 0;
+}
+</style>
+<div class='hr'></div>
+<div class='hr left'></div>
+<div class='hr'></div>
+<div class='hr right'></div>
+<div class='hr'></div>
+
+<div class='hr'></div>
+<div class='hr left'></div>
+<div class='hr'></div>
+<div class='hr right'></div>
+<div class='hr'></div>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/align.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/align.html
new file mode 100644
index 000000000..1657f2458
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/align.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<meta charset="utf-8">
+<link rel="match" href="align-ref.html">
+<style>
+hr {
+ width: 100px;
+}
+</style>
+
+<hr align=>
+<hr align=left>
+<hr align=center>
+<hr align=right>
+<hr align=foobar>
+
+<script>
+// Test the IDL attribute
+const values = ['', 'left', 'center', 'right', 'foobar'];
+values.forEach(value => {
+ const hr = document.createElement('hr');
+ hr.align = value;
+ document.body.appendChild(hr);
+});
+</script>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/color-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/color-ref.html
new file mode 100644
index 000000000..5cd35c83a
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/color-ref.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<meta charset=utf-8>
+<style>
+.hr {
+ color: gray;
+ border-style: inset;
+ border-width: 1px;
+ margin: 0.5em auto;
+}
+
+.green {
+ color: green;
+}
+
+.no-inset {
+ border-style: solid;
+}
+</style>
+<div class='hr'></div>
+<div class='hr no-inset'></div>
+<div class='hr no-inset'></div>
+<div class='hr green no-inset'></div>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/color.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/color.html
new file mode 100644
index 000000000..750f77e5f
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/color.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<meta charset=utf-8>
+<link rel=match href="color-ref.html">
+<hr>
+<hr color="">
+<hr color=transparent>
+<hr color=green>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/width-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/width-ref.html
new file mode 100644
index 000000000..245fde996
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/width-ref.html
@@ -0,0 +1,19 @@
+<style>
+.hr {
+ color: gray;
+ border-style: inset;
+ border-width: 1px;
+ margin: 0.5em auto;
+}
+</style>
+<div class=hr></div>
+<div class=hr style="width: 50%"></div>
+<div class=hr style="width: 100px"></div>
+<div class=hr style="width: 100px"></div>
+<div class=hr style="width: 100px"></div>
+<div class=hr style="width: 100.99px"></div>
+<div class=hr style="width: 0%"></div>
+<div class=hr style="width: 0%"></div>
+<div class=hr style="width: 0%"></div>
+<div class=hr style="width: 0%"></div>
+<div class=hr></div>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/width.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/width.html
new file mode 100644
index 000000000..a436d2ae2
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-hr-element-0/width.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<meta charset="utf-8">
+<title></title>
+<link rel="match" href="width-ref.html">
+<hr>
+<hr width='50%'>
+<hr width='100'>
+<hr width='100foo'>
+<hr width=' 100 '>
+<hr width='100.99'>
+<hr width='0'>
+<hr width='00'>
+<hr width='+0'>
+<hr width='+00'>
+<hr width='++0'>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/.gitkeep b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_link.xhtml b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_link.xhtml
new file mode 100644
index 000000000..b93435de8
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_link.xhtml
@@ -0,0 +1,16 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>body - LINK=yellow</title>
+</head>
+<body link="yellow">
+<p> Test for <b> link="yellow" </b> on body </p>
+
+This <a href="test-body.xhtml">LINK</a> should be displayed in <b>yellow</b><i> if it has not been clicked before </i><br/>
+<p>Once clicked, the link will take default color of visited link.<br /></p>
+<p>To run this test again in browsers, delete your browsing history and navigate to this page.<br /></p>
+
+<p>
+<i>Note - This test checks for User Agent requirement as per HTML5 spec NOT the author requirement</i>
+</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_text_00ffff-ref.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_text_00ffff-ref.html
new file mode 100644
index 000000000..c907a119f
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_text_00ffff-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>[body - TEXT=00ffff] Reference file</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<style>
+ body {
+ color: blue;
+ }
+</style>
+<body>
+ <p>This document should have text color 'Blue' using the RGB Hexadecimal color value of "0000ff". </p>
+ <p>This test passes if the color of text above matches the image below.</p>
+ <p><img src="/images/blue.png"/></p>
+</body>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_text_00ffff.xhtml b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_text_00ffff.xhtml
new file mode 100644
index 000000000..42b8aa3b6
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/body_text_00ffff.xhtml
@@ -0,0 +1,12 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>body - TEXT=00ffff</title>
+<link rel="match" href="body_text_00ffff-ref.html"/>
+<meta name="assert" content="Test checks that User Agent requirement as per HTML5 spec NOT the author requirement."/>
+</head>
+<body text="0000ff">
+<p>This document should have text color 'Blue' using the RGB Hexadecimal color value of "0000ff". </p>
+<p>This test passes if the color of text above matches the image below.</p>
+<p><img src="/images/blue.png" /></p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/test-body.xhtml b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/test-body.xhtml
new file mode 100644
index 000000000..cd733b17b
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-page/test-body.xhtml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title> This is a test page</title>
+</head>
+<body>
+<p> To rerun this test, delete history and go <a href="body_link.xhtml">back </a> to previous test.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/rendering/print-media/.gitkeep b/testing/web-platform/tests/html/rendering/print-media/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/print-media/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/.gitkeep b/testing/web-platform/tests/html/rendering/replaced-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/.gitkeep b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim-ref.html b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim-ref.html
new file mode 100644
index 000000000..b1adb6830
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>img width/height - reference</title>
+<style>
+p { width: 50px; height: 50px; }
+</style>
+<p><img src=/images/green.png>
+<p><img src=/images/green.png style="width: 10px">
+<p><img src=/images/green.png style="height: 10px">
+<p><img src=/images/green.png style="width: 10%">
+<p><img src=/images/green.png style="height: 10%">
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim.html b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim.html
new file mode 100644
index 000000000..2d636c941
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>img width/height</title>
+<link rel=match href=img-dim-ref.html>
+<style>
+p { width: 50px; height: 50px; }
+</style>
+<p><img src=/images/green.png>
+<p><img src=/images/green.png width=10>
+<p><img src=/images/green.png height=10>
+<p><img src=/images/green.png width=10%>
+<p><img src=/images/green.png height=10%>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border-ref.xhtml b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border-ref.xhtml
new file mode 100644
index 000000000..0050c542c
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border-ref.xhtml
@@ -0,0 +1,9 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>IMG - Border in CSS</title>
+</head>
+<body>
+<p><img src="../../../../../images/blue.png"/></p>
+<p><img src="../../../../../images/blue.png" style="border-width:50px; border-style:solid;"/></p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border_percent.xhtml b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border_percent.xhtml
new file mode 100644
index 000000000..da74fb32b
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border_percent.xhtml
@@ -0,0 +1,10 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>IMG - Border= value in percent</title>
+<link rel="match" href="img_border-ref.xhtml"/>
+</head>
+<body>
+<p><img src="../../../../../images/blue.png" border="0%"/></p>
+<p><img src="../../../../../images/blue.png" border="50%"/></p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border-ref.xhtml b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border-ref.xhtml
new file mode 100644
index 000000000..6eaaa0ba1
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border-ref.xhtml
@@ -0,0 +1,8 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>OBJECT - border in CSS</title>
+</head>
+<body>
+<p><object data="../../../../images/blue.png" type="image/png" style="border-width:50px; border-style:solid;"></object></p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc.xhtml b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc.xhtml
new file mode 100644
index 000000000..3663e9ce6
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc.xhtml
@@ -0,0 +1,9 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>OBJECT - border=value in %</title>
+<link rel="match" href="object_border-ref.xhtml"/>
+</head>
+<body>
+<p><object data="../../../../images/blue.png" type="image/png" border="50%"></object></p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel.xhtml b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel.xhtml
new file mode 100644
index 000000000..55f7f0a3b
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel.xhtml
@@ -0,0 +1,9 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>OBJECT - border=pixel</title>
+<link rel="match" href="object_border-ref.xhtml"/>
+</head>
+<body>
+<p><object data="../../../../images/blue.png" type="image/png" border="50"></object></p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/.gitkeep b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback-ref.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback-ref.html
new file mode 100644
index 000000000..9077591f4
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback-ref.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Canvas fallback content</title>
+<p>The word "FAIL" should not be visible below this line.
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback.html
new file mode 100644
index 000000000..142024e67
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Canvas fallback content</title>
+<link rel=match href=canvas-fallback-ref.html>
+<style>
+#canvas2 {
+ display: inline;
+}
+
+#canvas3 {
+ display: block;
+}
+
+#canvas4 {
+ display: table;
+}
+</style>
+<p>The word "FAIL" should not be visible below this line.
+<p><canvas id=canvas1>FAIL</canvas>
+<p><canvas id=canvas2>FAIL</canvas>
+<p><canvas id=canvas3>FAIL</canvas>
+<p><canvas id=canvas4>FAIL</canvas>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html
new file mode 100644
index 000000000..cdc464753
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Verify that canvases are scaled up to their computed size</title>
+<link rel="match" href="canvas_scale_ref.html">
+<style>
+canvas {
+ width: 20px;
+ height: 20px;
+}
+div {
+ line-height: 0;
+}
+</style>
+<div><canvas width="16" height="16" data-color="#FF00FF"></canvas><canvas width="16" height="16" data-color="#00FF00"></canvas></div>
+<div><canvas width="16" height="16" data-color="#0000FF"></canvas><canvas width="16" height="16" data-color="#FF00FF"></canvas></div>
+<script>
+var canvases = document.getElementsByTagName('canvas');
+for (var i = 0; i < canvases.length; i++) {
+ var ctx = canvases[i].getContext('2d');
+ ctx.fillStyle = canvases[i].getAttribute('data-color');
+ ctx.fillRect(0, 0, 16, 16);
+}
+</script>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale_ref.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale_ref.html
new file mode 100644
index 000000000..2d1756f85
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale_ref.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<meta charset="utf-8">
+<style>
+span {
+ display: inline-block;
+ width: 20px;
+ height: 20px;
+}
+div {
+ line-height: 0;
+}
+</style>
+<div><span style="background-color: #FF00FF"></span><span style="background-color: #00FF00"></span></div>
+<div><span style="background-color: #0000FF"></span><span style="background-color: #FF00FF"></span></div>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_a.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_a.html
new file mode 100644
index 000000000..b7398f8d5
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_a.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<meta charset="utf-8">
+<link rel="match" href="canvas_without_context_ref.html">
+<style>
+ div {
+ background-color: green;
+ width: 20px;
+ height: 20px;
+ }
+</style>
+</head>
+<body>
+<div><canvas width="20" height="20"></canvas></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_ref.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_ref.html
new file mode 100644
index 000000000..ae0c9c8c8
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_ref.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+<style>
+ div {
+ background-color: green;
+ width: 20px;
+ height: 20px;
+ }
+</style>
+</head>
+<body>
+<div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/image-maps-0/.gitkeep b/testing/web-platform/tests/html/rendering/replaced-elements/image-maps-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/image-maps-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/images/.gitkeep b/testing/web-platform/tests/html/rendering/replaced-elements/images/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/images/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/images/space-ref.html b/testing/web-platform/tests/html/rendering/replaced-elements/images/space-ref.html
new file mode 100644
index 000000000..0cf272e16
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/images/space-ref.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>img hspace/vspace - reference</title>
+<style>
+span { background: blue; }
+</style>
+<div style=width:400px;>
+<p><span><img src=/images/green.png></span>
+<p><span><img src=/images/green.png style="margin: 0 10px"></span>
+<p><span><img src=/images/green.png style="margin: 10px 0"></span>
+<p><span><img src=/images/green.png style="margin: 0 10%"></span>
+<p><span><img src=/images/green.png style="margin: 10% 0"></span>
+</div>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/images/space.html b/testing/web-platform/tests/html/rendering/replaced-elements/images/space.html
new file mode 100644
index 000000000..fee115dfc
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/images/space.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>img hspace/vspace</title>
+<link rel=match href=space-ref.html>
+<style>
+span { background: blue; }
+</style>
+<div style=width:400px;>
+<p><span><img src=/images/green.png></span>
+<p><span><img src=/images/green.png hspace=10></span>
+<p><span><img src=/images/green.png vspace=10></span>
+<p><span><img src=/images/green.png hspace=10%></span>
+<p><span><img src=/images/green.png vspace=10%></span>
+</div>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/resources/svg-sizing.js b/testing/web-platform/tests/html/rendering/replaced-elements/resources/svg-sizing.js
new file mode 100644
index 000000000..f54541e9e
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/resources/svg-sizing.js
@@ -0,0 +1,418 @@
+// Simple implementation of SVG sizing
+
+setup({explicit_done: true});
+
+var SVGSizing = (function() {
+ function parseLength(l) {
+ var match = /^([-+]?[0-9]+|[-+]?[0-9]*\.[0-9]+)(px|%)?$/.exec(l);
+ if (!match)
+ return null;
+ return new Length(Number(match[1]), match[2] ? match[2] : "px");
+ }
+
+ function parseViewBox(input) {
+ if (!input)
+ return null;
+
+ var arr = input.split(' ');
+ return arr.map(function(a) { return parseInt(a); });
+ }
+
+ // Only px and % are used
+ function convertToPx(input, percentRef) {
+ if (input == null)
+ return null;
+ var length = parseLength(input);
+ if (length.amount == 0)
+ return 0;
+ if (!length.unit)
+ length.unit = "px";
+ if (length.unit == "%" && percentRef === undefined)
+ return null;
+ return length.amount * { px: 1,
+ "%": percentRef/100}[length.unit];
+ }
+
+ function Length(amount, unit) {
+ this.amount = amount;
+ this.unit = unit;
+ }
+
+ function describe(data) {
+ function dumpObject(obj) {
+ var r = "";
+ for (var property in obj) {
+ if (obj.hasOwnProperty(property)) {
+ var value = obj[property];
+ if (typeof value == 'string')
+ value = "'" + value + "'";
+ else if (value == null)
+ value = "null";
+ else if (typeof value == 'object')
+ {
+ if (value instanceof Array)
+ value = "[" + value + "]";
+ else
+ value = "{" + dumpObject(value) + "}";
+ }
+
+ if (value != "null")
+ r += property + ": " + value + ", ";
+ }
+ }
+ return r;
+ }
+ var result = dumpObject(data);
+ if (result == "")
+ return "(initial values)";
+ return result;
+ }
+
+ function mapPresentationalHintLength(testData, cssProperty, attr) {
+ if (attr) {
+ var l = parseLength(attr);
+ if (l)
+ testData.style[cssProperty] = l.amount + l.unit;
+ }
+ }
+
+ function computedWidthIsAuto(testData) {
+ return !testData.style["width"] || testData.style["width"] == 'auto';
+ }
+
+ function computedHeightIsAuto(testData) {
+ return !testData.style["height"] || testData.style["height"] == 'auto' ||
+ (parseLength(testData.style["height"]).unit == '%' &&
+ containerComputedHeightIsAuto(testData));
+ }
+
+ function containerComputedWidthIsAuto(testData) {
+ return !testData.config.containerWidthStyle ||
+ testData.config.containerWidthStyle == 'auto';
+ }
+
+ function containerComputedHeightIsAuto(testData) {
+ return !testData.config.containerHeightStyle ||
+ testData.config.containerHeightStyle == 'auto';
+ }
+
+ function intrinsicInformation(testData) {
+ if (testData.config.placeholder == 'iframe')
+ return {};
+
+ var w = convertToPx(testData.config.svgWidthAttr) || 0;
+ var h = convertToPx(testData.config.svgHeightAttr) || 0;
+ var r = 0;
+ if (w && h) {
+ r = w / h;
+ } else {
+ var vb = parseViewBox(testData.config.svgViewBoxAttr);
+ if (vb) {
+ r = vb[2] / vb[3];
+ }
+ if (r) {
+ if (!w && h)
+ w = h * r;
+ else if (!h && w)
+ h = w / r;
+ }
+ }
+ return { width: w, height: h, ratio: r };
+ };
+
+ function contentAttributeForPlaceholder(testData) {
+ if (testData.config.placeholder == 'object')
+ return "data";
+ else
+ return "src";
+ }
+
+ function TestData(config) {
+ this.config = config;
+ this.name = describe(config);
+ this.style = {};
+ if (config.placeholder) {
+ mapPresentationalHintLength(this, "width", config.placeholderWidthAttr);
+ mapPresentationalHintLength(this, "height", config.placeholderHeightAttr);
+ } else {
+ if (config.svgWidthStyle)
+ this.style["width"] = config.svgWidthStyle;
+ else
+ mapPresentationalHintLength(this, "width", config.svgWidthAttr);
+
+ if (config.svgHeightStyle)
+ this.style["height"] = config.svgHeightStyle;
+ else
+ mapPresentationalHintLength(this, "height", config.svgHeightAttr);
+ }
+ }
+
+ TestData.prototype.computeInlineReplacedSize = function(outerWidth, outerHeight) {
+ var intrinsic = intrinsicInformation(this);
+ var self = this;
+
+ // http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height
+ function calculateUsedHeight() {
+ if (computedHeightIsAuto(self)) {
+ if (computedWidthIsAuto(self) && intrinsic.height)
+ return intrinsic.height;
+ if (intrinsic.ratio)
+ return calculateUsedWidth() / intrinsic.ratio;
+ if (intrinsic.height)
+ return intrinsic.height;
+ return 150;
+ }
+
+ return convertToPx(self.style["height"],
+ convertToPx(self.config.containerHeightStyle,
+ outerHeight));
+ }
+
+ // http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width
+ function calculateUsedWidth() {
+ if (computedWidthIsAuto(self)) {
+ if (computedHeightIsAuto(self) && intrinsic.width)
+ return intrinsic.width;
+ if (!computedHeightIsAuto(self) && intrinsic.ratio)
+ return calculateUsedHeight() * intrinsic.ratio;
+ if (computedHeightIsAuto(self) && intrinsic.ratio) {
+ if (containerComputedWidthIsAuto(self)) {
+ // Note: While this is actually undefined in CSS
+ // 2.1, use the suggested value by examining the
+ // ancestor widths.
+ return outerWidth;
+ } else {
+ return convertToPx(self.config.containerWidthStyle,
+ outerWidth);
+ }
+ }
+ if (intrinsic.width)
+ return intrinsic.width;
+ return 300;
+ }
+
+ if (containerComputedWidthIsAuto(self))
+ return convertToPx(self.style["width"], outerWidth);
+ else
+ return convertToPx(self.style["width"],
+ convertToPx(self.config.containerWidthStyle,
+ outerWidth));
+ }
+ return { width: calculateUsedWidth(),
+ height: calculateUsedHeight() };
+ };
+
+ TestData.prototype.buildContainer = function (placeholder, options) {
+ options = options || {};
+
+ var container = document.createElement("div");
+
+ container.id = "container";
+ if (this.config.containerWidthStyle)
+ container.style.width = this.config.containerWidthStyle;
+
+ if (this.config.containerHeightStyle)
+ container.style.height = this.config.containerHeightStyle;
+
+ if (options.pretty)
+ container.appendChild(document.createTextNode("\n\t\t"));
+ container.appendChild(placeholder);
+ if (options.pretty)
+ container.appendChild(document.createTextNode("\n\t"));
+
+ return container;
+ };
+
+ TestData.prototype.buildSVGOrPlaceholder = function (options) {
+ options = options || {};
+ var self = this;
+
+ if (this.config.placeholder) {
+ var generateSVGURI = function(testData, encoder) {
+ var res = '<svg xmlns="http://www.w3.org/2000/svg"';
+ function addAttr(attr, prop) {
+ if (testData.config[prop])
+ res += ' ' + attr + '="' + testData.config[prop] + '"';
+ }
+ addAttr("width", "svgWidthAttr");
+ addAttr("height", "svgHeightAttr");
+ addAttr("viewBox", "svgViewBoxAttr");
+ res += '></svg>';
+ return 'data:image/svg+xml' + encoder(res);
+ };
+ var placeholder = document.createElement(this.config.placeholder);
+ if (options.pretty) {
+ placeholder.appendChild(document.createTextNode("\n\t\t\t"));
+ placeholder.appendChild(
+ document.createComment(
+ generateSVGURI(this, function(x) { return "," + x; })));
+ placeholder.appendChild(document.createTextNode("\n\t\t"));
+ }
+ placeholder.setAttribute("id", "test");
+ if (this.config.placeholderWidthAttr)
+ placeholder.setAttribute("width", this.config.placeholderWidthAttr);
+ if (this.config.placeholderHeightAttr)
+ placeholder.setAttribute("height", this.config.placeholderHeightAttr);
+ placeholder.setAttribute(contentAttributeForPlaceholder(this),
+ generateSVGURI(this, function(x) {
+ return ";base64," + btoa(x);
+ }));
+ return placeholder;
+ } else {
+ var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
+ svgElement.setAttribute("id", "test");
+ if (self.config.svgWidthStyle)
+ svgElement.style.width = self.config.svgWidthStyle;
+ if (self.config.svgHeightStyle)
+ svgElement.style.height = self.config.svgHeightStyle;
+ if (self.config.svgWidthAttr)
+ svgElement.setAttribute("width", self.config.svgWidthAttr);
+ if (self.config.svgHeightAttr)
+ svgElement.setAttribute("height", self.config.svgHeightAttr);
+ if (self.config.svgViewBoxAttr)
+ svgElement.setAttribute("viewBox", self.config.svgViewBoxAttr);
+ return svgElement;
+ }
+ };
+
+ TestData.prototype.buildDemo = function (expectedRect, id) {
+ // Non-essential debugging tool
+ var self = this;
+
+ function buildDemoSerialization() {
+ var outerWidth = 800;
+ var outerHeight = 600;
+
+ var options = { pretty: true };
+ var container =
+ self.buildContainer(self.buildSVGOrPlaceholder(options), options);
+
+ var root = document.createElement("html");
+ var style = document.createElement("style");
+
+ style.textContent = "\n" +
+ "\tbody { margin: 0; font-family: sans-serif }\n" +
+ "\tiframe { border: none }\n" +
+ "\t#expected {\n" +
+ "\t\twidth: " + (expectedRect.width) + "px; height: "
+ + (expectedRect.height) + "px;\n" +
+ "\t\tborder: 10px solid lime; position: absolute;\n" +
+ "\t\tbackground-color: red }\n" +
+ "\t#testContainer { position: absolute;\n" +
+ "\t\ttop: 10px; left: 10px; width: " + outerWidth + "px;\n" +
+ "\t\theight: " + outerHeight + "px }\n" +
+ "\t#test { background-color: green }\n" +
+ "\t.result { position: absolute; top: 0; right: 0;\n" +
+ "\t\tbackground-color: hsla(0,0%, 0%, 0.85); border-radius: 0.5em;\n" +
+ "\t\tpadding: 0.5em; border: 0.25em solid black }\n" +
+ "\t.pass { color: lime }\n" +
+ "\t.fail { color: red }\n";
+
+ root.appendChild(document.createTextNode("\n"));
+ root.appendChild(style);
+ root.appendChild(document.createTextNode("\n"));
+
+ var script = document.createElement("script");
+ script.textContent = "\n" +
+ "onload = function() {\n" +
+ "\tvar svgRect =\n" +
+ "\t\tdocument.querySelector('#test').getBoundingClientRect();\n" +
+ "\tpassed = (svgRect.width == " + expectedRect.width + " && " +
+ "svgRect.height == " + expectedRect.height + ");\n" +
+ "\tdocument.body.insertAdjacentHTML('beforeEnd',\n" +
+ "\t\t'<span class=\"result '+ (passed ? 'pass' : 'fail') " +
+ "+ '\">' + (passed ? 'Pass' : 'Fail') + '</span>');\n" +
+ "};\n";
+
+ root.appendChild(script);
+ root.appendChild(document.createTextNode("\n"));
+
+ var expectedElement = document.createElement("div");
+ expectedElement.id = "expected";
+ root.appendChild(expectedElement);
+ root.appendChild(document.createTextNode("\n"));
+
+ var testContainer = document.createElement("div");
+ testContainer.id = "testContainer";
+ testContainer.appendChild(document.createTextNode("\n\t"));
+ testContainer.appendChild(container);
+ testContainer.appendChild(document.createTextNode("\n"));
+ root.appendChild(testContainer);
+ root.appendChild(document.createTextNode("\n"));
+
+ return "<!DOCTYPE html>\n" + root.outerHTML;
+ }
+
+ function pad(n, width, z) {
+ z = z || '0';
+ n = n + '';
+ return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
+ }
+
+ function heightToDescription(height) {
+ if (!height || height == "auto")
+ return "auto";
+ if (parseLength(height).unit == '%')
+ return "percentage";
+ return "fixed";
+ }
+
+ var demoRoot = document.querySelector('#demo');
+ if (demoRoot) {
+ var demo = buildDemoSerialization();
+ var iframe = document.createElement('iframe');
+ iframe.style.width = (Math.max(900, expectedRect.width)) + "px";
+ iframe.style.height = (Math.max(400, expectedRect.height)) + "px";
+ iframe.src = "data:text/html;charset=utf-8," + encodeURIComponent(demo);
+ demoRoot.appendChild(iframe);
+ demoRoot.insertAdjacentHTML(
+ 'beforeEnd',
+ '<p><a href="data:application/octet-stream;charset=utf-8;base64,' +
+ btoa(demo) + '" download="svg-in-' + this.config.placeholder + "-" +
+ heightToDescription(this.config.placeholderHeightAttr) + "-" + pad(id, 3) +
+ '.html">Download</a></p>');
+ }
+ };
+
+ return {
+ TestData: TestData,
+ doCombinationTest: function(values, func, testSingleId) {
+ function computeConfig(id) {
+ id--;
+ var multiplier = 1;
+ var config = {};
+ for (var i=0; i<values.length; i++) {
+ // Compute offset into current array
+ var ii = (Math.floor(id / multiplier)) % values[i][1].length;
+ // Set corresponding value
+ config[values[i][0]] = values[i][1][ii];
+ // Compute new multiplier
+ multiplier *= values[i][1].length;
+ }
+ if (id >= multiplier)
+ return null;
+ return config;
+ }
+
+ function cont(id) {
+ var config = computeConfig(id);
+ if (config && (!testSingleId || testSingleId == id)) {
+ var next = function() {func(config, id, cont)};
+ // Make sure we don't blow the stack, without too much slowness
+ if (id % 20 === 0) {
+ setTimeout(next, 0);
+ } else {
+ next();
+ }
+ } else {
+ done();
+ }
+ };
+
+ if (testSingleId)
+ cont(testSingleId);
+ else
+ cont(1);
+ }
+ };
+})();
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-embedded-sizing.js b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-embedded-sizing.js
new file mode 100644
index 000000000..5dc5131c5
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-embedded-sizing.js
@@ -0,0 +1,96 @@
+// global async_test, assert_equals
+//
+// This test generates a couple of scenarios (each a
+// SVGSizing.TestData) for sizing inline <svg> and uses a simple
+// JavaScript sizing implementation for comparison.
+//
+// The tests loops through different combinations of:
+//
+// * width and height on <object>, <iframe> (input dependent)
+//
+// * width and height on <svg>
+//
+// * viewBox on <svg> (gives intrinsic ratio)
+//
+// * width and height on containing block of <object>
+//
+// All these contribute to the final size of the SVG in some way.
+//
+// The test focuses on the size of the CSS box generated by the SVG.
+// The SVG is always empty by itself so no actual SVG are tested.
+// Little focus is put on variations within an attribute that doesn't
+// affect the sizing behavior.
+//
+// To debug a specific test, append ?<test-id> to the URL. An <iframe>
+// is generated with equivalent test and the source code of the test
+// can be downloaded.
+
+var debugHint = function(id) { return "(append ?"+id+" to debug) "; };
+var testSingleId;
+if (window.location.search) {
+ testSingleId = parseInt(window.location.search.substring(1));
+ debugHint = function(id) { return ""; };
+}
+
+function testPlaceholderWithHeight(placeholder,
+ placeholderHeightAttr) {
+ var testContainer = document.querySelector('#testContainer');
+ var outerWidth = testContainer.getBoundingClientRect().width;
+ var outerHeight = testContainer.getBoundingClientRect().height;
+
+ SVGSizing.doCombinationTest(
+ [["placeholder", [ placeholder ]],
+ ["containerWidthStyle", [null, "400px"]],
+ ["containerHeightStyle", [null, "400px"]],
+ ["placeholderWidthAttr", [null, "100", "50%"]],
+ ["placeholderHeightAttr", [placeholderHeightAttr]],
+ ["svgViewBoxAttr", [ null, "0 0 100 200" ]],
+ ["svgWidthAttr", [ null, "200", "25%" ]],
+ ["svgHeightAttr", [ null, "200", "25%" ]]],
+ function (config, id, cont) {
+ var testData = new SVGSizing.TestData(config);
+ var t = async_test(testData.name);
+ var expectedRect =
+ testData.computeInlineReplacedSize(outerWidth, outerHeight);
+ var placeholder = testData.buildSVGOrPlaceholder();
+ var container =
+ testData.buildContainer(placeholder);
+
+ var checkSize = function() {
+ var placeholderRect =
+ placeholder.getBoundingClientRect();
+
+ try {
+ assert_equals(placeholderRect.width,
+ expectedRect.width,
+ debugHint(id) + "Wrong width");
+ assert_equals(placeholderRect.height,
+ expectedRect.height,
+ debugHint(id) + "Wrong height");
+ } finally {
+ testContainer.removeChild(container);
+ if (testSingleId)
+ document.body.removeChild(testContainer);
+ cont(id+1);
+ }
+ t.done();
+ };
+
+ if (!config.placeholder) {
+ testContainer.appendChild(container);
+ test(checkSize, testData.name);
+ } else {
+ t.step(function() {
+ placeholder.addEventListener('load', function() {
+ // setTimeout is a work-around to let engines
+ // finish layout of child browsing contexts even
+ // after the load event
+ setTimeout(t.step_func(checkSize), 0);
+ });
+ testContainer.appendChild(container);
+ });
+ }
+ if (testSingleId == id)
+ testData.buildDemo(expectedRect, id);
+ }, testSingleId);
+}
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-iframe-auto.html b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-iframe-auto.html
new file mode 100644
index 000000000..4c3fefe88
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-iframe-auto.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- This file is generated by gen-svgsizing-tests.py -->
+<html>
+ <head>
+ <title>SVG sizing: &lt;iframe></title>
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../resources/svg-sizing.js"></script>
+ <style>
+ #testContainer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 600px
+ }
+ iframe { border: 0 }
+ </style>
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elements">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-width">
+ <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace">
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="testContainer"></div>
+ <div id="demo"></div>
+ <script src="svg-embedded-sizing.js"></script>
+ <script>testPlaceholderWithHeight("iframe", null)</script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-iframe-fixed.html b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-iframe-fixed.html
new file mode 100644
index 000000000..ae3328c6a
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-iframe-fixed.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- This file is generated by gen-svgsizing-tests.py -->
+<html>
+ <head>
+ <title>SVG sizing: &lt;iframe></title>
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../resources/svg-sizing.js"></script>
+ <style>
+ #testContainer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 600px
+ }
+ iframe { border: 0 }
+ </style>
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elements">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-width">
+ <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace">
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="testContainer"></div>
+ <div id="demo"></div>
+ <script src="svg-embedded-sizing.js"></script>
+ <script>testPlaceholderWithHeight("iframe", '100px')</script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-iframe-percentage.html b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-iframe-percentage.html
new file mode 100644
index 000000000..da00c0680
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-iframe-percentage.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- This file is generated by gen-svgsizing-tests.py -->
+<html>
+ <head>
+ <title>SVG sizing: &lt;iframe></title>
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../resources/svg-sizing.js"></script>
+ <style>
+ #testContainer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 600px
+ }
+ iframe { border: 0 }
+ </style>
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elements">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-width">
+ <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace">
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="testContainer"></div>
+ <div id="demo"></div>
+ <script src="svg-embedded-sizing.js"></script>
+ <script>testPlaceholderWithHeight("iframe", '100%')</script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-auto.html b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-auto.html
new file mode 100644
index 000000000..cef353067
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-auto.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- This file is generated by gen-svgsizing-tests.py -->
+<html>
+ <head>
+ <title>SVG sizing: &lt;img></title>
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../resources/svg-sizing.js"></script>
+ <style>
+ #testContainer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 600px
+ }
+ iframe { border: 0 }
+ </style>
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elements">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-width">
+ <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace">
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="testContainer"></div>
+ <div id="demo"></div>
+ <script src="svg-embedded-sizing.js"></script>
+ <script>testPlaceholderWithHeight("img", null)</script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-fixed.html b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-fixed.html
new file mode 100644
index 000000000..e8ad0dc93
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-fixed.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- This file is generated by gen-svgsizing-tests.py -->
+<html>
+ <head>
+ <title>SVG sizing: &lt;img></title>
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../resources/svg-sizing.js"></script>
+ <style>
+ #testContainer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 600px
+ }
+ iframe { border: 0 }
+ </style>
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elements">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-width">
+ <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace">
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="testContainer"></div>
+ <div id="demo"></div>
+ <script src="svg-embedded-sizing.js"></script>
+ <script>testPlaceholderWithHeight("img", '100px')</script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-percentage.html b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-percentage.html
new file mode 100644
index 000000000..7bd5d9031
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-percentage.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- This file is generated by gen-svgsizing-tests.py -->
+<html>
+ <head>
+ <title>SVG sizing: &lt;img></title>
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../resources/svg-sizing.js"></script>
+ <style>
+ #testContainer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 600px
+ }
+ iframe { border: 0 }
+ </style>
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elements">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-width">
+ <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace">
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="testContainer"></div>
+ <div id="demo"></div>
+ <script src="svg-embedded-sizing.js"></script>
+ <script>testPlaceholderWithHeight("img", '100%')</script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-auto.html b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-auto.html
new file mode 100644
index 000000000..7d79d2a42
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-auto.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- This file is generated by gen-svgsizing-tests.py -->
+<html>
+ <head>
+ <title>SVG sizing: &lt;object></title>
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../resources/svg-sizing.js"></script>
+ <style>
+ #testContainer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 600px
+ }
+ iframe { border: 0 }
+ </style>
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elements">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-width">
+ <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace">
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="testContainer"></div>
+ <div id="demo"></div>
+ <script src="svg-embedded-sizing.js"></script>
+ <script>testPlaceholderWithHeight("object", null)</script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-fixed.html b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-fixed.html
new file mode 100644
index 000000000..75f763625
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-fixed.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- This file is generated by gen-svgsizing-tests.py -->
+<html>
+ <head>
+ <title>SVG sizing: &lt;object></title>
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../resources/svg-sizing.js"></script>
+ <style>
+ #testContainer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 600px
+ }
+ iframe { border: 0 }
+ </style>
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elements">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-width">
+ <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace">
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="testContainer"></div>
+ <div id="demo"></div>
+ <script src="svg-embedded-sizing.js"></script>
+ <script>testPlaceholderWithHeight("object", '100px')</script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-percentage.html b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-percentage.html
new file mode 100644
index 000000000..8f82836e1
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-percentage.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- This file is generated by gen-svgsizing-tests.py -->
+<html>
+ <head>
+ <title>SVG sizing: &lt;object></title>
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../resources/svg-sizing.js"></script>
+ <style>
+ #testContainer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 600px
+ }
+ iframe { border: 0 }
+ </style>
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elements">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-width">
+ <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace">
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="testContainer"></div>
+ <div id="demo"></div>
+ <script src="svg-embedded-sizing.js"></script>
+ <script>testPlaceholderWithHeight("object", '100%')</script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.html b/testing/web-platform/tests/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.html
new file mode 100644
index 000000000..2b3cf6536
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>SVG sizing: inline</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../resources/svg-sizing.js"></script>
+ <style>
+ #testContainer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 600px;
+ }
+ </style>
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elements">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-width">
+ <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace">
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="testContainer"></div>
+ <div id="demo"></div>
+ <script src="svg-inline.js"></script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.js b/testing/web-platform/tests/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.js
new file mode 100644
index 000000000..9b7fca050
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.js
@@ -0,0 +1,79 @@
+// global async_test, assert_equals
+//
+// This test generates a couple of scenarios (each a
+// SVGSizing.TestData) for sizing inline <svg> and uses a simple
+// JavaScript sizing implementation for comparison.
+//
+// The tests loops through different combinations of:
+//
+// * width and height attributes and style on <svg>
+//
+// * viewBox on <svg> (gives intrinsic ratio)
+//
+// * width and height on containing block of <svg>
+//
+// All these may contribute to the final size of the SVG. The test
+// focuses on the size of the CSS box generated by the SVG. Little
+// focus is put on variations within an attribute that doesn't affect
+// the final size.
+//
+// To debug a specific test append ?<test-id> to the URL. An <iframe>
+// is generated with equivalent test and the source of the test is
+// added to a <pre> element.
+
+var debugHint = function(id) { return "(append ?"+id+" to debug) "; };
+var testSingleId;
+if (window.location.search) {
+ testSingleId = window.location.search.substring(1);
+ debugHint = function(id) { return ""; };
+}
+
+var testContainer = document.querySelector('#testContainer');
+var testContainerWidth = testContainer.getBoundingClientRect().width;
+var testContainerHeight = testContainer.getBoundingClientRect().height;
+
+SVGSizing.doCombinationTest(
+ [["placeholder", [ null ]],
+ ["containerWidthStyle", [null, "400px"]],
+ ["containerHeightStyle", [null, "400px"]],
+ ["svgViewBoxAttr", [ null, "0 0 100 200" ]],
+ ["svgWidthStyle", [ null, "100px", "50%" ]],
+ ["svgHeightStyle", [ null, "100px", "50%" ]],
+ ["svgWidthAttr", [ null, "200", "25%" ]],
+ ["svgHeightAttr", [ null, "200", "25%" ]]],
+ function(config, id, cont) {
+ var testData = new SVGSizing.TestData(config);
+
+ var expectedRect =
+ testData.computeInlineReplacedSize(testContainerWidth,
+ testContainerHeight);
+ var svgElement = testData.buildSVGOrPlaceholder();
+ var container =
+ testData.buildContainer(svgElement);
+
+ var checkSize = function() {
+ var svgRect =
+ svgElement.getBoundingClientRect();
+
+ try {
+ assert_equals(svgRect.width,
+ expectedRect.width,
+ debugHint(id) + "Wrong width");
+ assert_equals(svgRect.height,
+ expectedRect.height,
+ debugHint(id) + "Wrong height");
+ } finally {
+ testContainer.removeChild(container);
+ if (testSingleId)
+ document.body.removeChild(testContainer);
+ cont(id+1);
+ }
+ };
+
+ testContainer.appendChild(container);
+ test(checkSize, testData.name);
+
+ if (testSingleId == id) {
+ testData.buildDemo(expectedRect, id);
+ }
+ }, testSingleId);
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/toolbars-0/.gitkeep b/testing/web-platform/tests/html/rendering/replaced-elements/toolbars-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/toolbars-0/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/tools/gen-svgsizing-tests.py b/testing/web-platform/tests/html/rendering/replaced-elements/tools/gen-svgsizing-tests.py
new file mode 100644
index 000000000..5ba69f8ab
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/tools/gen-svgsizing-tests.py
@@ -0,0 +1,55 @@
+from string import Template
+import os
+import sys
+
+template = Template("""<!DOCTYPE html>
+<!-- This file is generated by $generator -->
+<html>
+ <head>
+ <title>SVG sizing: &lt;$placeholder></title>
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../resources/svg-sizing.js"></script>
+ <style>
+ #testContainer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 600px
+ }
+ iframe { border: 0 }
+ </style>
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elements">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-width">
+ <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace">
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="testContainer"></div>
+ <div id="demo"></div>
+ <script src="svg-embedded-sizing.js"></script>
+ <script>testPlaceholderWithHeight("$placeholder", $placeholderHeightAttr)</script>
+ </body>
+</html>
+""")
+
+placeholders = [ "object", "iframe", "img" ]
+placeholderHeightAttrs = [ "null", "'100px'", "'100%'" ]
+placeholderHeightAttrsDescriptions = [ "auto", "fixed", "percentage" ]
+
+try:
+ os.makedirs("../svg-embedded-sizing")
+except OSError:
+ pass
+
+for placeholder in placeholders:
+ for i, placeholderHeightAttr in enumerate(placeholderHeightAttrs):
+ testContent = template.substitute(placeholder=placeholder, placeholderHeightAttr=placeholderHeightAttr, generator=sys.argv[0])
+ filename = "../svg-embedded-sizing/svg-in-%s-%s.html" % (placeholder, placeholderHeightAttrsDescriptions[i])
+ f = open(filename, "w")
+ f.write(testContent)
+ f.close()
diff --git a/testing/web-platform/tests/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/.gitkeep b/testing/web-platform/tests/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/.gitkeep
diff --git a/testing/web-platform/tests/html/rendering/unstyled-xml-documents/.gitkeep b/testing/web-platform/tests/html/rendering/unstyled-xml-documents/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/unstyled-xml-documents/.gitkeep
diff --git a/testing/web-platform/tests/html/resources/common.js b/testing/web-platform/tests/html/resources/common.js
new file mode 100644
index 000000000..12e0fe77b
--- /dev/null
+++ b/testing/web-platform/tests/html/resources/common.js
@@ -0,0 +1,187 @@
+/*
+Distributed under both the W3C Test Suite License [1] and the W3C
+3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
+policies and contribution forms [3].
+
+[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
+[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
+[3] http://www.w3.org/2004/10/27-testcases
+ */
+
+"use strict";
+
+var HTML5_ELEMENTS = [ 'a', 'abbr', 'address', 'area', 'article', 'aside',
+ 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'br',
+ 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup',
+ 'command', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div',
+ 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure',
+ 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header',
+ 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd',
+ 'keygen', 'label', 'legend', 'li', 'link', 'map', 'mark', 'menu',
+ 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup',
+ 'option', 'output', 'p', 'param', 'pre', 'progress', 'q', 'rp', 'rt',
+ 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source',
+ 'span', 'strong', 'style', 'sub', 'table', 'tbody', 'td', 'textarea',
+ 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul',
+ 'var', 'video', 'wbr' ];
+
+// only void (without end tag) HTML5 elements
+var HTML5_VOID_ELEMENTS = [ 'area', 'base', 'br', 'col', 'command', 'embed',
+ 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source',
+ 'track', 'wbr' ];
+
+// https://html.spec.whatwg.org/multipage/multipage/forms.html#form-associated-element
+var HTML5_FORM_ASSOCIATED_ELEMENTS = [ 'button', 'fieldset', 'input', 'keygen',
+ 'object', 'output', 'select', 'textarea' ];
+
+function newDocument() {
+ var d = document.implementation.createDocument();
+ return d;
+}
+
+function newHTMLDocument() {
+ var d = document.implementation.createHTMLDocument('Test Document');
+ return d;
+}
+
+function newXHTMLDocument() {
+ var doctype = document.implementation.createDocumentType('html',
+ '-//W3C//DTD XHTML 1.0 Transitional//EN',
+ 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd');
+
+ var d = document.implementation.createDocument(
+ 'http://www.w3.org/1999/xhtml', 'html', doctype);
+ return d;
+}
+
+function newIFrame(context, src) {
+ if (typeof (context) === 'undefined'
+ || typeof (context.iframes) !== 'object') {
+ assert_unreached('Illegal context object in newIFrame');
+ }
+
+ var iframe = document.createElement('iframe');
+ iframe.style.display = 'none';
+
+ if (typeof (src) != 'undefined') {
+ iframe.src = src;
+ }
+ document.body.appendChild(iframe);
+ context.iframes.push(iframe);
+
+ assert_true(typeof (iframe.contentWindow) != 'undefined'
+ && typeof (iframe.contentWindow.document) != 'undefined'
+ && iframe.contentWindow.document != document,
+ 'Failed to create new rendered document');
+ return iframe;
+}
+
+function newRenderedHTMLDocument(context) {
+ var frame = newIFrame(context);
+ var d = frame.contentWindow.document;
+ return d;
+}
+
+function newContext() {
+ return {
+ iframes : []
+ };
+}
+
+function cleanContext(context) {
+ context.iframes.forEach(function(e) {
+ e.parentNode.removeChild(e);
+ });
+}
+
+// run given test function in context
+// the context is cleaned up after test completes.
+function inContext(f) {
+ return function() {
+ var context = newContext();
+ try {
+ f(context);
+ } finally {
+ cleanContext(context);
+ }
+ };
+}
+
+// new context and iframe are created and url (if supplied) is asigned to
+// iframe.src
+// function f is bound to the iframe onload event or executed directly after
+// iframe creation
+// the context is passed to function as argument
+function testInIFrame(url, f, testName, testProps) {
+ if (url) {
+ var t = async_test(testName, testProps);
+ t.step(function() {
+ var context = newContext();
+ var iframe = newIFrame(context, url);
+ iframe.onload = t.step_func(function() {
+ try {
+ f(context);
+ t.done();
+ } finally {
+ cleanContext(context);
+ }
+ });
+ });
+ } else {
+ test(inContext(function(context) {
+ newRenderedHTMLDocument(context);
+ f(context);
+ }), testName, testProps);
+ }
+}
+
+function assert_nodelist_contents_equal_noorder(actual, expected, message) {
+ assert_equals(actual.length, expected.length, message);
+ var used = [];
+ for ( var i = 0; i < expected.length; i++) {
+ used.push(false);
+ }
+ for (i = 0; i < expected.length; i++) {
+ var found = false;
+ for ( var j = 0; j < actual.length; j++) {
+ if (used[j] == false && expected[i] == actual[j]) {
+ used[j] = true;
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ assert_unreached(message + ". Fail reason: element not found: "
+ + expected[i]);
+ }
+ }
+}
+
+function isVoidElement(elementName) {
+ return HTML5_VOID_ELEMENTS.indexOf(elementName) >= 0;
+}
+
+function checkTemplateContent(d, obj, html, id, nodeName) {
+
+ obj.innerHTML = '<template id="tmpl">' + html + '</template>';
+
+ var t = d.querySelector('#tmpl');
+
+ if (id != null) {
+ assert_equals(t.content.childNodes.length, 1, 'Element ' + nodeName
+ + ' should present among template nodes');
+ assert_equals(t.content.firstChild.id, id, 'Wrong element ID');
+ }
+ if (nodeName != null) {
+ assert_equals(t.content.firstChild.nodeName, nodeName.toUpperCase(),
+ 'Wrong node name');
+ }
+}
+
+function checkBodyTemplateContent(d, html, id, nodeName) {
+ checkTemplateContent(d, d.body, html, id, nodeName);
+}
+
+function checkHeadTemplateContent(d, html, id, nodeName) {
+ checkTemplateContent(d, d.head, html, id, nodeName);
+}
diff --git a/testing/web-platform/tests/html/semantics/.gitkeep b/testing/web-platform/tests/html/semantics/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/common-idioms/.gitkeep b/testing/web-platform/tests/html/semantics/common-idioms/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/common-idioms/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/common-idioms/conversations/.gitkeep b/testing/web-platform/tests/html/semantics/common-idioms/conversations/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/common-idioms/conversations/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/common-idioms/footnotes/.gitkeep b/testing/web-platform/tests/html/semantics/common-idioms/footnotes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/common-idioms/footnotes/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/common-idioms/rel-up/.gitkeep b/testing/web-platform/tests/html/semantics/common-idioms/rel-up/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/common-idioms/rel-up/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/common-idioms/tag-clouds/.gitkeep b/testing/web-platform/tests/html/semantics/common-idioms/tag-clouds/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/common-idioms/tag-clouds/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/common-idioms/the-main-part-of-the-content/.gitkeep b/testing/web-platform/tests/html/semantics/common-idioms/the-main-part-of-the-content/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/common-idioms/the-main-part-of-the-content/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/disabled-elements/.gitkeep b/testing/web-platform/tests/html/semantics/disabled-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/disabled-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/disabled-elements/disabledElement.html b/testing/web-platform/tests/html/semantics/disabled-elements/disabledElement.html
new file mode 100644
index 000000000..03f57424d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/disabled-elements/disabledElement.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Disabled elements</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#disabled-elements">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<button disabled>button</button>
+<input disabled>
+<select disabled>
+ <optgroup label="options" disabled>
+ <option value="option1" disabled>option1
+ <option value="option2">option2
+</select>
+<textarea disabled>textarea</textarea>
+<fieldset disabled>
+ <input type=radio name=c value=0 checked>
+ <input type=radio name=c value=1>
+</fieldset>
+<a href="http://www.w3.org/" disabled>w3</a>
+<span tabindex=0 disabled>foobar</span>
+
+<script>
+ test(function(){
+ assert_equals(document.activeElement, document.body);
+ }, "The body element must be the active element if no element is focused");
+
+ ["button", "input", "select", "optgroup", "option", "textarea", "input[type=radio]"].forEach(function(el) {
+ test(function() {
+ var element = document.querySelector(el);
+ element.focus();
+ assert_equals(document.activeElement, document.body, "activeElement after focus on a disabled <" + el + "> remains unchanged");
+ }, "A disabled <" + el + "> should not be focusable");
+ });
+
+ ["a", "span"].forEach(function(el) {
+ test(function() {
+ var element = document.querySelector(el);
+ element.focus();
+ assert_equals(document.activeElement, element, "focus on a <" + el + "> with a disabled attribute should make it the activeElement");
+ }, "A disabled <" + el + "> should be focusable");
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/.gitkeep b/testing/web-platform/tests/html/semantics/document-metadata/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/styling/.gitkeep b/testing/web-platform/tests/html/semantics/document-metadata/styling/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/styling/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/styling/LinkStyle.html b/testing/web-platform/tests/html/semantics/document-metadata/styling/LinkStyle.html
new file mode 100644
index 000000000..09278d202
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/styling/LinkStyle.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>HTML Test: Styling</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#styling">
+ <link id="style1" rel="text" title="Intel" href="./support/unmatch.css">
+ <link id="style2" rel="alternate stylesheet" type="text/css" title="" href="./support/emptytitle.css">
+ <link id="style3" rel="alternate stylesheet" type="text/css" href="./support/notitle.css">
+ <link id="style5" rel="stylesheet" type="text/css" href="./support/normal.css">
+ <link id="style6" rel="alternate stylesheet" type="text/css" href="./support/normal.css" title="./support/alternate.css">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <style id="style4" type="text/html">
+ #test {
+ height: 100px;
+ width: 100px;
+ }
+ </style>
+ <style id="style7" type="text/css" media="all" title="./support/alternate.css">
+ #test {
+ background-color: green;
+ }
+ </style>
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="test" style="display:none">STYLING TEST</div>
+
+ <script>
+ test(function() {
+ var style = null,
+ i;
+ for (i = 1; i < 5; i++) {
+ style = document.getElementById("style" + i);
+ assert_equals(style.sheet, null, "The sheet attribute of style" + i + " should be null.");
+ assert_false(style.disabled, "The disabled attribute of style" + i + " should be false.");
+ }
+ }, "The LinkStyle interface's sheet attribute must return null; the disabled attribute must be false");
+
+ test(function() {
+ var style = document.createElement("style"),
+ link = document.createElement("link");
+ assert_equals(style.sheet, null, "The sheet attribute of the style element not in a document should be null.");
+ assert_equals(link.sheet, null, "The sheet attribute of the link element not in a document should be null.");
+ }, "The LinkStyle interface's sheet attribute must return null if the corresponding element is not in a Document");
+
+ test(function() {
+ var style = null,
+ i;
+ for (i = 5; i < 8; i++) {
+ style = document.getElementById("style" + i);
+ assert_true(style.sheet instanceof StyleSheet, "The sheet attribute of style" + i + " should be a StyleSheet object.");
+ assert_equals(style.disabled, style.sheet.disabled, "The disabled attribute of style" + i + " should equal to the same attribute of StyleSheet.");
+ }
+ }, "The LinkStyle interface's sheet attribute must return StyleSheet object; the disabled attribute must be same as the StyleSheet's disabled attribute");
+
+ test(function() {
+ assert_equals(document.getElementById("style2").title, "", "The title attribute of style2 is incorrect.");
+ assert_equals(document.getElementById("style5").title, "", "The title attribute of style5 is incorrect.");
+ assert_equals(document.getElementById("style6").title, "./support/alternate.css", "The title attribute of style6 is incorrect.");
+ assert_equals(document.getElementById("style7").title, "./support/alternate.css", "The title attribute of style7 is incorrect.");
+ }, "The title must be the same as the value of the element's title content attribute");
+
+ test(function() {
+ assert_equals(document.getElementById("style5").media, "", "The media attribute of style5 is incorrect.");
+ assert_equals(document.getElementById("style7").media, "all", "The media attribute of style7 is incorrect.");
+ }, "The media must be the same as the value of the element's media content attribute, or the empty string if it is omitted");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/styling/support/alternate.css b/testing/web-platform/tests/html/semantics/document-metadata/styling/support/alternate.css
new file mode 100644
index 000000000..b8deb07b0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/styling/support/alternate.css
@@ -0,0 +1,7 @@
+#test {
+ color: yellow;
+ background-color: blue;
+ width: 100px;
+ height: 50px;
+ font-size: .5em;
+}
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/styling/support/emptytitle.css b/testing/web-platform/tests/html/semantics/document-metadata/styling/support/emptytitle.css
new file mode 100644
index 000000000..e62fe701b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/styling/support/emptytitle.css
@@ -0,0 +1,4 @@
+#test {
+ width: 100px;
+ height: 100px;
+}
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/styling/support/normal.css b/testing/web-platform/tests/html/semantics/document-metadata/styling/support/normal.css
new file mode 100644
index 000000000..a803c2211
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/styling/support/normal.css
@@ -0,0 +1,5 @@
+#test {
+ width: 100px;
+ height: 50px;
+ font-size: 10px;
+}
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/styling/support/notitle.css b/testing/web-platform/tests/html/semantics/document-metadata/styling/support/notitle.css
new file mode 100644
index 000000000..e62fe701b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/styling/support/notitle.css
@@ -0,0 +1,4 @@
+#test {
+ width: 100px;
+ height: 100px;
+}
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/styling/support/unmatch.css b/testing/web-platform/tests/html/semantics/document-metadata/styling/support/unmatch.css
new file mode 100644
index 000000000..e62fe701b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/styling/support/unmatch.css
@@ -0,0 +1,4 @@
+#test {
+ width: 100px;
+ height: 100px;
+}
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/.gitkeep b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_about_blank.html b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_about_blank.html
new file mode 100644
index 000000000..54c479454
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_empty.html b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_empty.html
new file mode 100644
index 000000000..7737556a1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_empty.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: base_href_empty</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
+<base id="base" href="" target="_blank">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<img id="test" src="/images/blue-100x100.png" style="display:none">
+
+<script>
+ var testElement,
+ baseElement;
+
+ setup(function() {
+ testElement = document.getElementById("test");
+ baseElement = document.getElementById("base");
+ });
+
+ test(function() {
+ assert_equals(baseElement.href, document.location.href, "The href of base element is incorrect.");
+ }, "The value of the href attribute must be the document's address if it is empty");
+
+ test(function() {
+ var exp = testElement.src.substring(0, testElement.src.lastIndexOf("/images/blue-100x100.png") + 1);
+ assert_true(baseElement.href.indexOf(exp) != -1, "The src of img element is incorrect.");
+ }, "The src attribute of the img element must relative to document's address");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_invalid.html b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_invalid.html
new file mode 100644
index 000000000..6d12d29e8
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_specified.sub.html b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_specified.sub.html
new file mode 100644
index 000000000..83e71387a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_specified.sub.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: base_href_specified</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<base id="base">
+<div id="log"></div>
+<img id="test" src="test.ico" style="display:none">
+
+<script>
+ var testElement;
+ var baseElement;
+
+ var otherOrigin = get_host_info().HTTP_REMOTE_ORIGIN;
+
+ setup(function() {
+ testElement = document.getElementById("test");
+ baseElement = document.getElementById("base");
+
+ baseElement.setAttribute("href", otherOrigin);
+ });
+
+ test(function() {
+ assert_equals(baseElement.href, otherOrigin + "/", "The href attribute of the base element is incorrect.");
+ }, "The href attribute of the base element is specified");
+
+ test(function() {
+ assert_equals(testElement.src, otherOrigin + "/test.ico", "The src attribute of the img element is incorrect.");
+ }, "The src attribute of the img element must relative to the href attribute of the base element");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_unspecified.html b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_unspecified.html
new file mode 100644
index 000000000..cf883f723
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_unspecified.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: base_href_unspecified</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
+<base id="base" target="_blank">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<div id="log"></div>
+<img id="test" src="/images/blue-100x100.png" style="display:none">
+
+<script>
+ var testElement,
+ baseElement;
+
+ setup(function () {
+ testElement = document.getElementById("test");
+ baseElement = document.getElementById("base");
+ });
+
+ test(function() {
+ assert_equals(baseElement.href, document.location.href, "Return the document base URL if the base element has no href content attribute.");
+ }, "The value of the href attribute must be the document's address if it is unspecified");
+
+ test(function() {
+ var exp = testElement.src.substring(0, testElement.src.lastIndexOf("/images/blue-100x100.png") + 1);
+ assert_true(baseElement.href.indexOf(exp) != -1, "The src attribute of the img element is incorrect.");
+ }, "The src attribute of the img element must relative to document's address");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_multiple.html b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_multiple.html
new file mode 100644
index 000000000..4b7c0d213
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_multiple.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: base_multiple</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+ <div id="log"></div>
+ <iframe id="test1" src="example.html" style="width:0;height:0" frameborder="0"></iframe>
+ <iframe id="test2" src="example.html" name="targetWin" style="width:0;height:0" frameborder="0"></iframe>
+ <script>
+ async_test(function() {
+ window.onload = this.step_func(function() {
+ var fr1 = document.getElementById("test1");
+ fr1.addEventListener("load", this.unreached_func("loaded in the wrong iframe"));
+
+ var fr2 = document.getElementById("test2");
+ fr2.addEventListener("load", this.step_func_done(function () {
+ var doc2 = fr2.contentDocument;
+ assert_not_equals(doc2.location.href.indexOf("example2.html"), -1, "The target attribute does not impact the a element.");
+ assert_equals(doc2.getElementById("d1").innerHTML, "PASS", "The opend page should be the example2.html.");
+ }), true);
+
+ fr1.contentDocument.getElementById("a1").click();
+ });
+ }, "The attributes of the a element must be affected by the first base element");
+ </script>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_srcdoc.html b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_srcdoc.html
new file mode 100644
index 000000000..eea1efe51
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/example.html b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/example.html
new file mode 100644
index 000000000..49dc772f9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/example.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Example</title>
+<base target="targetWin" href="">
+<base target="_self" href="http://www.example.com/">
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<a id="a1" href="example2.html" target="">click me</a>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/example2.html b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/example2.html
new file mode 100644
index 000000000..0e57cb9c5
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-base-element/example2.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Example</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<div id="d1">PASS</div>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-head-element/.gitkeep b/testing/web-platform/tests/html/semantics/document-metadata/the-head-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-head-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/.gitkeep b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context.html b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context.html
new file mode 100644
index 000000000..127b253f5
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-load-event.html b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-load-event.html
new file mode 100644
index 000000000..6f6172a2d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-load-event.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<link rel="author" title="Josh Matthews" href="mailto:josh@joshmatthews.net">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link href="style.css?pipe=trickle(d3)" rel="stylesheet" id="style_test"></link>
+<script>
+var saw_link_onload = false;
+var t = async_test("Check if the stylesheet's load event blocks the document load event");
+document.getElementById('style_test').onload = t.step_func(function() {
+ saw_link_onload = true;
+});
+window.addEventListener('load', t.step_func_done(function() {
+ assert_true(saw_link_onload);
+}));
+</script>
+</head>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-rellist.html b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-rellist.html
new file mode 100644
index 000000000..414965195
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-rellist.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<title>link.relList: non-string contains</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#domtokenlist">
+<link rel="help" href="https://heycam.github.io/webidl/#ecmascript-binding">
+<link rel="help" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf#page=57">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link id="link" rel="undefined null 0 NaN Infinity">
+<div id="log"></div>
+<script>
+test(function() {
+ var list = document.getElementById("link").relList;
+ assert_equals(list.contains(undefined), true); //"undefined"
+ assert_equals(list.contains(null), true); //"null"
+ assert_equals(list.contains(-0), true); //"0"
+ assert_equals(list.contains(+0), true); //"0"
+ assert_equals(list.contains(NaN), true); //"NaN"
+ assert_equals(list.contains(+Infinity), true); //"Infinity"
+ assert_equals(list.contains(-Infinity), false); //"-Infinity"
+ assert_equals(list.supports("stylesheet"), true);
+ assert_equals(list.supports("nosuchrelvalueever"), false);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-style-error-01.html b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-style-error-01.html
new file mode 100644
index 000000000..7a86a8638
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-style-error-01.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>link: error events</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<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.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");
+ elt.onerror = tText.step_func(function() {
+ assert_true(true, "Got error event for 404 error.")
+ tText.done()
+ })
+ elt.onload = tText.unreached_func("load event should not be fired");
+ elt.rel = "stylesheet";
+ elt.href = "../../../../../common/css-red.txt";
+ document.getElementsByTagName("head")[0].appendChild(elt);
+})
+</script>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/resources/stylesheet.css b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/resources/stylesheet.css
new file mode 100644
index 000000000..e1b2552ff
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/resources/stylesheet.css
@@ -0,0 +1,3 @@
+body {
+ background-color: green;
+}
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/style.css b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/style.css
new file mode 100644
index 000000000..d48115e56
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/style.css
@@ -0,0 +1,3 @@
+body {
+ background-color: white;
+} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet-with-base-ref.html b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet-with-base-ref.html
new file mode 100644
index 000000000..83f0d0677
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet-with-base-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Stylesheet Without Base Tag</title>
+ <style>
+ body { background-color: green; }
+ </style>
+</head>
+<body>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet-with-base.html b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet-with-base.html
new file mode 100644
index 000000000..a9f2a8bce
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet-with-base.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Stylesheet With Base Tag</title>
+ <link rel="match" href="stylesheet-with-base-ref.html">
+ <base href="resources/">
+ <link rel="stylesheet" href="stylesheet.css">
+</head>
+<body>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet.css b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet.css
new file mode 100644
index 000000000..e8f24f94a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet.css
@@ -0,0 +1,3 @@
+body {
+ background-color: red;
+}
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet.py b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/stylesheet.py
new file mode 100644
index 000000000..a312e9e87
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/.gitkeep b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/contains.json b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/contains.json
new file mode 100644
index 000000000..70a454691
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/contains.json
@@ -0,0 +1,22 @@
+[
+ {
+ "id": "standard-metadata-names",
+ "original_id": "standard-metadata-names"
+ },
+ {
+ "id": "other-metadata-names",
+ "original_id": "other-metadata-names"
+ },
+ {
+ "id": "pragma-directives",
+ "original_id": "pragma-directives"
+ },
+ {
+ "id": "other-pragma-directives",
+ "original_id": "other-pragma-directives"
+ },
+ {
+ "id": "charset",
+ "original_id": "charset"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html
new file mode 100644
index 000000000..cbfc18035
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html
@@ -0,0 +1,112 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Parsing of meta refresh</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<style>
+iframe { display:none }
+</style>
+<body>
+<script>
+
+// failure to parse is []
+// success to parse is [time, url] where url is unresolved
+
+var tests_arr = [
+ {input: '', expected: []},
+ {input: '1', expected: [1, 'refresh.sub.html']},
+ {input: '1 ', expected: [1, 'refresh.sub.html']},
+ {input: '1\t', expected: [1, 'refresh.sub.html']},
+ {input: '1\r', expected: [1, 'refresh.sub.html']},
+ {input: '1\n', expected: [1, 'refresh.sub.html']},
+ {input: '1\f', expected: [1, 'refresh.sub.html']},
+ {input: '1;', expected: [1, 'refresh.sub.html']},
+ {input: '1,', expected: [1, 'refresh.sub.html']},
+ {input: '1; url=foo', expected: [1, 'foo']},
+ {input: '1, url=foo', expected: [1, 'foo']},
+ {input: '1 url=foo', expected: [1, 'foo']},
+ {input: '1;\turl=foo', expected: [1, 'foo']},
+ {input: '1,\turl=foo', expected: [1, 'foo']},
+ {input: '1\turl=foo', expected: [1, 'foo']},
+ {input: '1;\rurl=foo', expected: [1, 'foo']},
+ {input: '1,\rurl=foo', expected: [1, 'foo']},
+ {input: '1\rurl=foo', expected: [1, 'foo']},
+ {input: '1;\nurl=foo', expected: [1, 'foo']},
+ {input: '1,\nurl=foo', expected: [1, 'foo']},
+ {input: '1\nurl=foo', expected: [1, 'foo']},
+ {input: '1;\furl=foo', expected: [1, 'foo']},
+ {input: '1,\furl=foo', expected: [1, 'foo']},
+ {input: '1\furl=foo', expected: [1, 'foo']},
+ {input: '1url=foo', expected: []},
+ {input: '1x;url=foo', expected: []},
+ {input: '1 x;url=foo', expected: [1, 'x;url=foo']},
+ {input: '1;;url=foo', expected: [1, ';url=foo']},
+ {input: ' 1 ; url = foo', expected: [1, 'foo']},
+ {input: ' 1 , url = foo', expected: [1, 'foo']},
+ {input: ' 1 ; foo', expected: [1, 'foo']},
+ {input: ' 1 , foo', expected: [1, 'foo']},
+ {input: ' 1 url = foo', expected: [1, 'foo']},
+ {input: '1; url=foo ', expected: [1, 'foo']},
+ {input: '1; url=f\to\no', expected: [1, 'foo']},
+ {input: '1; url="foo"bar', expected: [1, 'foo']},
+ {input: '1; url=\'foo\'bar', expected: [1, 'foo']},
+ {input: '1; url="foo\'bar', expected: [1, 'foo\'bar']},
+ {input: '1; url foo', expected: [1, 'url foo']},
+ {input: '1; urlfoo', expected: [1, 'urlfoo']},
+ {input: '1; urfoo', expected: [1, 'urfoo']},
+ {input: '1; ufoo', expected: [1, 'ufoo']},
+ {input: '1; "foo"bar', expected: [1, 'foo']},
+ {input: '; foo', expected: []},
+ {input: ', foo', expected: []},
+ {input: 'foo', expected: []},
+ {input: '+1; url=foo', expected: []},
+ {input: '-1; url=foo', expected: []},
+ {input: '+0; url=foo', expected: []},
+ {input: '-0; url=foo', expected: []},
+ {input: '0; url=foo', expected: [0, 'foo']},
+ {input: '+1; foo', expected: []},
+ {input: '-1; foo', expected: []},
+ {input: '+0; foo', expected: []},
+ {input: '-0; foo', expected: []},
+ {input: '0; foo', expected: [0, 'foo']},
+ {input: '+1', expected: []},
+ {input: '-1', expected: []},
+ {input: '+0', expected: []},
+ {input: '-0', expected: []},
+ {input: '0', expected: [0, 'refresh.sub.html']},
+ {input: '1.9; url=foo', expected: [1, 'foo']},
+ {input: '1.9..5.; url=foo', expected: [1, 'foo']},
+ {input: '.9; url=foo', expected: []},
+];
+
+tests_arr.forEach(function(test_obj) {
+ async_test(function(t) {
+ var iframe = document.createElement('iframe');
+ t.add_cleanup(function() {
+ document.body.removeChild(iframe);
+ });
+ iframe.src = 'support/refresh.sub.html?input=' + encodeURIComponent(test_obj.input);
+ document.body.appendChild(iframe);
+ var loadCount = 0;
+ iframe.onload = t.step_func(function() {
+ loadCount++;
+ var got = iframe.contentDocument.body.textContent.trim();
+ if (test_obj.expected.length === 0) {
+ assert_equals(got, 'refresh.sub.html');
+ if (loadCount === 1) {
+ setTimeout(function() {
+ t.done();
+ }, 3000); // want to make sure it doesn't redirect when it shouldn't
+ } else {
+ assert_unreached('Got > 1 load events');
+ }
+ } else {
+ if (loadCount === 2) {
+ assert_equals(got, test_obj.expected[1]);
+ t.done();
+ }
+ }
+ });
+ }, format_value(test_obj.input));
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/;url=foo b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/;url=foo
new file mode 100644
index 000000000..622ff110d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/;url=foo
@@ -0,0 +1 @@
+;url=foo
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/__dir__.headers b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/__dir__.headers
new file mode 100644
index 000000000..156209f9c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/__dir__.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/foo b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/foo
new file mode 100644
index 000000000..257cc5642
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/foo
@@ -0,0 +1 @@
+foo
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/foo'bar b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/foo'bar
new file mode 100644
index 000000000..80e741087
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/foo'bar
@@ -0,0 +1 @@
+foo'bar
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/refresh.sub.html b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/refresh.sub.html
new file mode 100644
index 000000000..bc97f29c6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/refresh.sub.html
@@ -0,0 +1 @@
+<!doctype html><meta http-equiv=refresh content="{{GET[input]}}">refresh.sub.html
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/ufoo b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/ufoo
new file mode 100644
index 000000000..8fff3cf4f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/ufoo
@@ -0,0 +1 @@
+ufoo
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/urfoo b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/urfoo
new file mode 100644
index 000000000..7d7373f4b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/urfoo
@@ -0,0 +1 @@
+urfoo
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/url foo b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/url foo
new file mode 100644
index 000000000..a1e6a9229
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/url foo
@@ -0,0 +1 @@
+url foo
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/urlfoo b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/urlfoo
new file mode 100644
index 000000000..3e67b2f7c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/urlfoo
@@ -0,0 +1 @@
+urlfoo
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/x;url=foo b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/x;url=foo
new file mode 100644
index 000000000..f10371aa7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/x;url=foo
@@ -0,0 +1 @@
+x;url=foo
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/the-lang-attribute-012.html b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/the-lang-attribute-012.html
new file mode 100644
index 000000000..af872d6e3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-meta-element/the-lang-attribute-012.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html >
+<head>
+<meta charset="utf-8"/>
+ <meta http-equiv="Content-Language" content="ko,zh,ja" >
+<title>Multiple languages in Content-Language meta element</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#pragma-directives'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='dom'>
+<style type='text/css'>
+ #colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
+ #colonlangcontroltest:lang(xx) { display:none; }
+.test div { width: 50px; }
+
+#box:lang(ko) { width: 100px; }
+#box:lang(zh) { width: 100px; }
+#box:lang(ja) { width: 100px; }
+
+ /* styling for debugging related notes */
+ .notes span:lang(ko) { background-color: #0000FF; color: white; padding: 0 5px; }
+ .notes span:lang(zh) { background-color: #0000FF; color: white; padding: 0 5px; }
+ .notes span:lang(ja) { background-color: #0000FF; color: white; padding: 0 5px; }
+
+</style>
+</head>
+<body>
+
+
+
+<div class="test"><div id="box">&#xA0;</div></div>
+<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
+
+
+<!--Notes:
+
+This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
+assert_equals(document.getElementById('box').offsetWidth, 50);
+}, "The UA will not recognize a language declaration in the Content-Language meta element when more than one language is declared.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/.gitkeep b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/historical.html b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/historical.html
new file mode 100644
index 000000000..d475f5b3c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/historical.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>Historical style element features should not be supported</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+function t(property) {
+ test(function() {
+ assert_false(property in document.createElement('style'));
+ }, 'style.' + property + ' should not be supported');
+}
+// added in https://github.com/whatwg/html/commit/29cf39d2163cfc85b67409f4e10390619ffb2b40
+// removed in https://github.com/whatwg/html/commit/c2a3b2a2e3db49c14b486a5e99acf7d10cfe8443
+t('scoped');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/html_style_in_comment-ref.html b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/html_style_in_comment-ref.html
new file mode 100644
index 000000000..999383c76
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/html_style_in_comment-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>[style] Reference file</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<style>
+ h4 {
+ color: green;
+ }
+</style>
+<body>
+ <p>
+ This page tests that Style written inside HTML comment is not applied
+ </p>
+ This test passes if the text below is <b>Green. NOT Red.</b>
+ <h4>
+ This is some text.
+ </h4>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/html_style_in_comment.xhtml b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/html_style_in_comment.xhtml
new file mode 100644
index 000000000..839548f01
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/html_style_in_comment.xhtml
@@ -0,0 +1,18 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<link rel="match" href="html_style_in_comment-ref.html"/>
+<style type="text/css">
+h4 {color: green}
+<!--
+h4 {color: red}
+-->
+</style>
+</head>
+<body>
+<p> This page tests that Style written inside HTML comment is not applied</p>
+This test passes if the text below is <b>Green. NOT Red.</b>
+<h4>
+This is some text.
+</h4>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style-error-01.html b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style-error-01.html
new file mode 100644
index 000000000..87cb9fafd
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style-error-01.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<title>style: error events</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<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("style");
+// elt.onerror = t404.step_func(function() {
+// assert_true(true, "Got error event for 404 error.")
+// t404.done()
+// })
+// elt.appendChild(
+// document.createTextNode('@import 404 error;'));
+// 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("style");
+ elt.onerror = tText.step_func(function() {
+ assert_true(true, "Got error event for 404 error.")
+ tText.done()
+ })
+ elt.appendChild(
+ document.createTextNode('@import "../../../../common/css-red.txt";'));
+ document.getElementsByTagName("head")[0].appendChild(elt);
+})
+</script>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style_disabled.html b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style_disabled.html
new file mode 100644
index 000000000..d26746a9c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style_disabled.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>HTML Test: The style should not be applied if it is disabled</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <style>
+ #test {
+ width: 100px;
+ }
+ </style>
+ <style id="style">
+ #test {
+ width: 50px;
+ }
+ </style>
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="test"></div>
+ <script>
+ test(function() {
+ var testElement = document.getElementById("test");
+ var style = document.getElementById("style");
+ var width1, width2;
+
+ width1 = window.getComputedStyle(testElement, false)["width"];
+ assert_equals(width1, "50px", "The style should be applied.");
+
+ style.disabled = true;
+ width2 = window.getComputedStyle(testElement, false)["width"];
+ assert_equals(width2, "100px", "The style should not be applied.");
+ }, "The style is not applied when it is disabled");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style_events.html b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style_events.html
new file mode 100644
index 000000000..5e07e5088
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style_events.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>HTML Test: The style events</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var tLoad = async_test("If the style is loaded successfully, the 'load' event must be fired");
+ var tError = async_test("If the style is loaded unsuccessfully, the 'error' event must be fired");
+
+ function onstyleload(e) {
+ tLoad.done();
+ }
+
+ function onstyleerror(e) {
+ tError.done();
+ }
+ </script>
+ <style onload="onstyleload()">
+ #test {
+ height: 100px;
+ width: 100px;
+ }
+ </style>
+ <style onerror="onstyleerror()">
+ @import url(nonexistent.css);
+ </style>
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="test"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style_media.html b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style_media.html
new file mode 100644
index 000000000..5bd189a26
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-style-element/style_media.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>HTML Test: The style information must be applied to the environment specified by the media attribute</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-style-media">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <style>
+ #test {
+ width: 100px;
+ }
+ </style>
+ <style id="style">
+ #test {
+ width: 50px;
+ }
+ </style>
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="test"></div>
+ <script>
+ test(function() {
+ var testElement = document.getElementById("test");
+ var style = document.getElementById("style");
+ var width1, width2;
+
+ width1 = window.getComputedStyle(testElement, false)["width"];
+ assert_equals(width1, "50px", "The style should be applied.");
+
+ style.media = "print";
+ width2 = window.getComputedStyle(testElement, false)["width"];
+ assert_equals(width2, "100px", "The style should not be applied.");
+ }, "The style information must be applied to the environment specified by the media attribute");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/.gitkeep b/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-01.html b/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-01.html
new file mode 100644
index 000000000..7f25400ea
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-01.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<title>title.text with comment and element children.</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-title-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+try {
+ var title = document.getElementsByTagName("title")[0];
+ while (title.childNodes.length)
+ title.removeChild(title.childNodes[0]);
+ title.appendChild(document.createComment("COMMENT"));
+ title.appendChild(document.createTextNode("TEXT"));
+ title.appendChild(document.createElement("a"))
+ .appendChild(document.createTextNode("ELEMENT"))
+} catch (e) {
+}
+</script>
+<script>
+test(function() {
+ assert_equals(title.text, "TEXT");
+ assert_equals(title.textContent, "TEXTELEMENT");
+})
+</script>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-02.xhtml b/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-02.xhtml
new file mode 100644
index 000000000..068b10504
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-02.xhtml
@@ -0,0 +1,30 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>title.text with comment and element children.</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-title-text"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+try {
+ var title = document.getElementsByTagName("title")[0];
+ while (title.childNodes.length)
+ title.removeChild(title.childNodes[0]);
+ title.appendChild(document.createComment("COMMENT"));
+ title.appendChild(document.createTextNode("TEXT"));
+ title.appendChild(document.createElement("a"))
+ .appendChild(document.createTextNode("ELEMENT"))
+} catch (e) {
+}
+</script>
+<script>
+test(function() {
+ assert_equals(title.text, "TEXT");
+ assert_equals(title.textContent, "TEXTELEMENT");
+})
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-03.html b/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-03.html
new file mode 100644
index 000000000..1c119a825
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-03.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<title> title.text and space normalization </title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-title-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.getElementsByTagName("title")[0].text,
+ " title.text and space normalization ");
+ assert_equals(document.getElementsByTagName("title")[0].textContent,
+ " title.text and space normalization ");
+ assert_equals(document.getElementsByTagName("title")[0].firstChild.nodeValue,
+ " title.text and space normalization ");
+}, "title.text and space normalization (markup)");
+[
+ "one space", "two spaces",
+ "one\ttab", "two\t\ttabs",
+ "one\nnewline", "two\n\nnewlines",
+ "one\fform feed", "two\f\fform feeds",
+ "one\rcarriage return", "two\r\rcarriage returns"
+].forEach(function(str) {
+ test(function() {
+ document.title = str;
+ var title = document.getElementsByTagName("title")[0];
+ assert_equals(title.text, str);
+ assert_equals(title.textContent, str);
+ assert_equals(title.firstChild.nodeValue, str);
+ }, "title.text and space normalization: " + format_value(str))
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-04.xhtml b/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-04.xhtml
new file mode 100644
index 000000000..de382ab4d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-title-element/title.text-04.xhtml
@@ -0,0 +1,37 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title> title.text and space normalization </title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-title-text"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_equals(document.getElementsByTagName("title")[0].text,
+ " title.text and space normalization ");
+ assert_equals(document.getElementsByTagName("title")[0].textContent,
+ " title.text and space normalization ");
+ assert_equals(document.getElementsByTagName("title")[0].firstChild.nodeValue,
+ " title.text and space normalization ");
+}, "title.text and space normalization (markup)");
+[
+ "one space", "two spaces",
+ "one\ttab", "two\t\ttabs",
+ "one\nnewline", "two\n\nnewlines",
+ "one\fform feed", "two\f\fform feeds",
+ "one\rcarriage return", "two\r\rcarriage returns"
+].forEach(function(str) {
+ test(function() {
+ document.title = str;
+ var title = document.getElementsByTagName("title")[0];
+ assert_equals(title.text, str);
+ assert_equals(title.textContent, str);
+ assert_equals(title.firstChild.nodeValue, str);
+ }, "title.text and space normalization: " + format_value(str))
+});
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/edits/.gitkeep b/testing/web-platform/tests/html/semantics/edits/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/edits/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/edits/attributes-common-to-ins-and-del-elements/.gitkeep b/testing/web-platform/tests/html/semantics/edits/attributes-common-to-ins-and-del-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/edits/attributes-common-to-ins-and-del-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/edits/edits-and-lists/.gitkeep b/testing/web-platform/tests/html/semantics/edits/edits-and-lists/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/edits/edits-and-lists/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/edits/edits-and-paragraphs/.gitkeep b/testing/web-platform/tests/html/semantics/edits/edits-and-paragraphs/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/edits/edits-and-paragraphs/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/edits/edits-and-tables/.gitkeep b/testing/web-platform/tests/html/semantics/edits/edits-and-tables/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/edits/edits-and-tables/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/edits/the-del-element/.gitkeep b/testing/web-platform/tests/html/semantics/edits/the-del-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/edits/the-del-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/edits/the-del-element/del_effect.html b/testing/web-platform/tests/html/semantics/edits/the-del-element/del_effect.html
new file mode 100644
index 000000000..14297e529
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/edits/the-del-element/del_effect.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<meta charset=UTF-8>
+<title>HTML Test: Text in the del element should be 'line-through'</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-del-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<p><del>crossed-off text</del></p>
+<div id="log"></div>
+
+<script>
+ test(function() {
+ var element = document.getElementsByTagName('del')[0],
+ textDecoration = getComputedStyle(element).textDecorationLine ||
+ getComputedStyle(element).textDecoration;
+ assert_equals(textDecoration, 'line-through');
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/edits/the-ins-element/.gitkeep b/testing/web-platform/tests/html/semantics/edits/the-ins-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/edits/the-ins-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/edits/the-ins-element/ins_effect.html b/testing/web-platform/tests/html/semantics/edits/the-ins-element/ins_effect.html
new file mode 100644
index 000000000..6e1b34459
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/edits/the-ins-element/ins_effect.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<meta charset=UTF-8>
+<title>HTML Test: Text in the ins element should be 'underline'</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ins-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<p><ins>underlined text</ins></p>
+<div id="log"></div>
+
+<script>
+ test(function() {
+ var element = document.getElementsByTagName('ins')[0],
+ textDecoration = getComputedStyle(element).textDecorationLine ||
+ getComputedStyle(element).textDecoration;
+ assert_equals(textDecoration, 'underline');
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/dimension-attributes/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/dimension-attributes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/dimension-attributes/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/image-maps/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/image-maps/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/image-maps/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/image-maps/contains.json b/testing/web-platform/tests/html/semantics/embedded-content/image-maps/contains.json
new file mode 100644
index 000000000..77e0d34fa
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/image-maps/contains.json
@@ -0,0 +1,10 @@
+[
+ {
+ "id": "authoring",
+ "original_id": "authoring"
+ },
+ {
+ "id": "processing-model-0",
+ "original_id": "processing-model-0"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/mathml/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/mathml/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/mathml/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_controls_present-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_controls_present-manual.html
new file mode 100644
index 000000000..38faa4d00
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_controls_present-manual.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Audio Test: audio_controls_present.html</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-controls" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the controls attribute is present in the audio element that expecting the user agent exposes a controller user interface" />
+ </head>
+ <body>
+ <p>Test passes if a controller user interface appears below and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
+ <audio id="m" controls>The user agent doesn't support media element.</audio>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_loop_base.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_loop_base.html
new file mode 100644
index 000000000..4917d9c39
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_loop_base.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Audio Test: audio_loop_base</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-loop" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if audio.loop is set to true that expecting the seeking event is fired more than once" />
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <audio id="m" controls>The user agent doesn't support media element.</audio>
+ <script type="text/javascript">
+ var media = document.getElementById("m");
+ var name = document.getElementsByName("assert")[0].content;
+ var t = async_test(name);
+
+ var looped = false;
+
+ function startTest() {
+ if (looped) {
+ t.step(function() {
+ assert_true(true, "looped");
+ });
+ t.done();
+ media.pause();
+ }
+
+ looped = true;
+ }
+
+ media.addEventListener("seeking", startTest, false);
+ media.loop = true;
+ media.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+ media.play();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_muted_overriding_volume-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_muted_overriding_volume-manual.html
new file mode 100644
index 000000000..cc1892ce8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_muted_overriding_volume-manual.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Audio Test: audio_muted_overriding_volume</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-muted" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the muted attribute is present in the audio element with volume is set to loudest that expecting the user hears no sound" />
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p>Test passes if the audio is playing without sound output and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
+ <audio id="m" controls muted>The user agent doesn't support media element.</audio>
+ <script type="text/javascript">
+ var media = document.getElementById("m");
+ media.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+ media.volume = 1.0;
+ media.play();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_muted_present-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_muted_present-manual.html
new file mode 100644
index 000000000..16d6f07ee
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_muted_present-manual.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Audio Test: audio_muted_present</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-muted" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the muted attribute is present in the audio element that expecting the user hears no sound" />
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p>Test passes if the audio is playing without sound output and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
+ <audio id="m" controls muted>The user agent doesn't support media element.</audio>
+ <script type="text/javascript">
+ var media = document.getElementById("m");
+ media.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+ media.play();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_volume_check.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_volume_check.html
new file mode 100644
index 000000000..b467c702a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_volume_check.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Audio Test: audio_volume_check</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-volume" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check that audio.volume returns the value of the muted content attribute" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <audio id="m">The user agent doesn't support media element.</audio>
+ <script type="text/javascript">
+ var media = document.getElementById("m");
+ var VOLUME = {
+ 'SILENT' : 0.0,
+ 'NORMAL' : 0.5,
+ 'LOUDEST' : 1.0,
+ 'LOWER' : -1.1,
+ 'UPPER' : 1.1,
+ };
+
+ test(function() {
+ assert_false(media.volume < VOLUME.SILENT || media.volume > VOLUME.LOUDEST, "media.volume outside the range 0.0 to 1.0 inclusive");
+ }, "Check if the intial value of the audio.volume is in the range 0.0 to 1.0 inclusive");
+
+ function volume_setting(vol, name)
+ {
+ if (vol < VOLUME.SILENT || vol > VOLUME.LOUDEST) {
+ try {
+ media.volume = vol;
+ test(function() {
+ assert_true(false, "media.volume setting exception");
+ }, name);
+ } catch(e) {
+ test(function() {
+ // 1 should be e.IndexSizeError or e.INDEX_SIZE_ERR in previous spec
+ assert_equals(e.code, 1, "media.volume setting exception");
+ }, name);
+ }
+ } else {
+ media.volume = vol;
+ test(function() {
+ assert_equals(media.volume, vol, "media.volume new value");
+ }, name);
+ }
+ }
+
+ volume_setting(VOLUME.NORMAL, "Check if audio.volume is able to set to new value in the range 0.0 to 1.0");
+ volume_setting(VOLUME.SILENT, "Check if media.volume is able to set to new value 0.0 as silent");
+ volume_setting(VOLUME.LOUDEST, "Check if media.volume is able to set to new value 1.0 as loudest");
+ volume_setting(VOLUME.LOWER, "Check if media.volume is set to new value less than 0.0 that expecting an IndexSizeError exception is to be thrown");
+ volume_setting(VOLUME.UPPER, "Check if audio.volume is set to new value greater than 1.0 that expecting an IndexSizeError exception is to be thrown");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_volume_loudest-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_volume_loudest-manual.html
new file mode 100644
index 000000000..a623e8f5c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_volume_loudest-manual.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Audio Test: audio_volume_loudest</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-volume" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the volume attribute is set to 1.0 as loudest in the audio element that expecting the user hears sound loudly" />
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p>Test passes if the audio is playing with sound heard and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
+ <audio id="m" controls>The user agent doesn't support media element.</audio>
+ <script type="text/javascript">
+ var media = document.getElementById("m");
+ media.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+ media.volume = 1.0;
+ media.play();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_volume_silent-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_volume_silent-manual.html
new file mode 100644
index 000000000..257bd4628
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/audio_volume_silent-manual.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Audio Test: audio_volume_silent</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-volume" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the volume attribute is set to 0.0 as silent in the audio element that expecting the user hears no sound" />
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p>Test passes if the audio is playing without sound heard and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
+ <audio id="m" controls volume=0.0>The user agent doesn't support media element.</audio>
+ <script type="text/javascript">
+ var media = document.getElementById("m");
+ media.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+ media.volume = 0.0;
+ media.play();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/contains.json b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/contains.json
new file mode 100644
index 000000000..9cf23296c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/contains.json
@@ -0,0 +1,132 @@
+[
+ {
+ "id": "error-codes",
+ "original_id": "error-codes"
+ },
+ {
+ "id": "location-of-the-media-resource",
+ "original_id": "location-of-the-media-resource"
+ },
+ {
+ "id": "mime-types",
+ "original_id": "mime-types"
+ },
+ {
+ "id": "network-states",
+ "original_id": "network-states"
+ },
+ {
+ "id": "loading-the-media-resource",
+ "original_id": "loading-the-media-resource"
+ },
+ {
+ "id": "offsets-into-the-media-resource",
+ "original_id": "offsets-into-the-media-resource"
+ },
+ {
+ "id": "ready-states",
+ "original_id": "ready-states"
+ },
+ {
+ "id": "playing-the-media-resource",
+ "original_id": "playing-the-media-resource"
+ },
+ {
+ "id": "seeking",
+ "original_id": "seeking"
+ },
+ {
+ "id": "media-resources-with-multiple-media-tracks",
+ "original_id": "media-resources-with-multiple-media-tracks",
+ "children": [
+ {
+ "id": "audiotracklist-and-videotracklist-objects",
+ "original_id": "audiotracklist-and-videotracklist-objects"
+ },
+ {
+ "id": "selecting-specific-audio-and-video-tracks-declaratively",
+ "original_id": "selecting-specific-audio-and-video-tracks-declaratively"
+ }
+ ]
+ },
+ {
+ "id": "synchronising-multiple-media-elements",
+ "original_id": "synchronising-multiple-media-elements",
+ "children": [
+ {
+ "id": "introduction-0",
+ "original_id": "introduction-0"
+ },
+ {
+ "id": "media-controllers",
+ "original_id": "media-controllers"
+ },
+ {
+ "id": "assigning-a-media-controller-declaratively",
+ "original_id": "assigning-a-media-controller-declaratively"
+ }
+ ]
+ },
+ {
+ "id": "timed-text-tracks",
+ "original_id": "timed-text-tracks",
+ "children": [
+ {
+ "id": "text-track-model",
+ "original_id": "text-track-model"
+ },
+ {
+ "id": "sourcing-in-band-text-tracks",
+ "original_id": "sourcing-in-band-text-tracks"
+ },
+ {
+ "id": "sourcing-out-of-band-text-tracks",
+ "original_id": "sourcing-out-of-band-text-tracks"
+ },
+ {
+ "id": "guidelines-for-exposing-cues-in-various-formats-as-text-track-cues",
+ "original_id": "guidelines-for-exposing-cues-in-various-formats-as-text-track-cues"
+ },
+ {
+ "id": "text-track-api",
+ "original_id": "text-track-api"
+ },
+ {
+ "id": "text-tracks-describing-chapters",
+ "original_id": "text-tracks-describing-chapters"
+ },
+ {
+ "id": "cue-events",
+ "original_id": "cue-events"
+ }
+ ]
+ },
+ {
+ "id": "user-interface",
+ "original_id": "user-interface"
+ },
+ {
+ "id": "time-ranges",
+ "original_id": "time-ranges"
+ },
+ {
+ "id": "event-definitions",
+ "original_id": "event-definitions"
+ },
+ {
+ "id": "mediaevents",
+ "original_id": "mediaevents"
+ },
+ {
+ "id": "security-and-privacy-considerations",
+ "original_id": "security-and-privacy-considerations"
+ },
+ {
+ "id": "best-practices-for-authors-using-media-elements",
+ "original_id": "best-practices-for-authors-using-media-elements"
+ },
+ {
+ "id": "best-practices-for-implementors-of-media-elements",
+ "original_id": "best-practices-for-implementors-of-media-elements"
+ }
+]
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/error-codes/error.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/error-codes/error.html
new file mode 100644
index 000000000..c97576041
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/error-codes/error.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<title>error</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<div id="log"></div>
+<script>
+function error_test(tagName, src) {
+ test(function() {
+ assert_equals(document.createElement(tagName).error, null);
+ }, tagName + '.error initial value');
+
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ e.src = src;
+ e.onloadeddata = t.step_func(function() {
+ assert_equals(e.error, null);
+ t.done();
+ });
+ }, tagName + '.error after successful load');
+
+ // TODO: MEDIA_ERR_ABORTED, MEDIA_ERR_NETWORK, MEDIA_ERR_DECODE
+
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ e.src = '';
+ e.onerror = t.step_func(function() {
+ assert_true(e.error instanceof MediaError);
+ assert_equals(e.error.code, 4);
+ assert_equals(e.error.code, e.error.MEDIA_ERR_SRC_NOT_SUPPORTED);
+ t.done();
+ });
+ }, tagName + '.error after setting src to the empty string');
+}
+
+error_test('audio', getAudioURI('/media/sound_5'));
+error_test('video', getVideoURI('/media/movie_5'));
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplay.html
new file mode 100644
index 000000000..8e1b32dcb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplay.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - canplay</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on autoplay audio should trigger canplay event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("canplay", function() {
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - canplay");
+
+test(function() {
+ var t = async_test("setting src attribute on autoplay video should trigger canplay event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("canplay", function() {
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - canplay");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplay_noautoplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplay_noautoplay.html
new file mode 100644
index 000000000..8f3372501
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplay_noautoplay.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - canplay</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" controls>
+ </audio>
+ <video id="v" controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function () {
+ var t = async_test("setting src attribute on non-autoplay audio should trigger canplay event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("canplay", function() {
+ t.done();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - canplay");
+
+test(function () {
+ var t = async_test("setting src attribute on non-autoplay video should trigger canplay event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("canplay", function() {
+ t.done();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - canplay");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplaythrough.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplaythrough.html
new file mode 100644
index 000000000..827e79607
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplaythrough.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - canplaythrough</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on autoplay audio should trigger canplaythrough event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("canplaythrough", function() {
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - canplaythrough");
+
+test(function() {
+ var t = async_test("setting src attribute on autoplay video should trigger canplaythrough event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("canplaythrough", function() {
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - canplaythrough");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplaythrough_noautoplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplaythrough_noautoplay.html
new file mode 100644
index 000000000..75a70985a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_canplaythrough_noautoplay.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - canplaythrough</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" controls>
+ </audio>
+ <video id="v" controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on non-autoplay audio should trigger canplaythrough event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("canplaythrough", function() {
+ t.done();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - canplaythrough");
+
+test(function() {
+ var t = async_test("setting src attribute on non-autoplay video should trigger canplaythrough event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("canplaythrough", function() {
+ t.done();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - canplaythrough");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadeddata.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadeddata.html
new file mode 100644
index 000000000..f0e89c3c1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadeddata.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - loadeddata</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on autoplay audio should trigger loadeddata event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("loadeddata", function() {
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - loadeddata");
+
+test(function() {
+ var t = async_test("setting src attribute on autoplay video should trigger loadeddata event", {timeout:5000});
+ var a = document.getElementById("v");
+ v.addEventListener("loadeddata", function() {
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - loadeddata");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadeddata_noautoplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadeddata_noautoplay.html
new file mode 100644
index 000000000..0c81f335b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadeddata_noautoplay.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - loadeddata</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" controls>
+ </audio>
+ <video id="v" controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on non-autoplay audio should trigger loadeddata event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("loadeddata", function() {
+ t.done();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - loadeddata");
+
+test(function() {
+ var t = async_test("setting src attribute on non-autoplay video should trigger loadeddata event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("loadeddata", function() {
+ t.done();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - loadeddata");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadedmetadata.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadedmetadata.html
new file mode 100644
index 000000000..234121e58
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadedmetadata.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - loadedmetadata</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on autoplay audio should trigger loadedmetadata event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("loadedmetadata", function() {
+ t.done();
+ a.pause();
+ });
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - loadedmetadata");
+
+test(function() {
+ var t = async_test("setting src attribute on autoplay video should trigger loadedmetadata event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("loadedmetadata", function() {
+ t.done();
+ v.pause();
+ });
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - loadedmetadata");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadedmetadata_noautoplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadedmetadata_noautoplay.html
new file mode 100644
index 000000000..382f3f6fb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadedmetadata_noautoplay.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - loadedmetadata</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" controls>
+ </audio>
+ <video id="v" controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on non-autoplay audio should trigger loadedmetadata event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("loadedmetadata", function() {
+ t.done();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - loadedmetadata");
+
+test(function() {
+ var t = async_test("setting src attribute on non-autoplay video should trigger loadedmetadata event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("loadedmetadata", function() {
+ t.done();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events, loadedmetadata");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadstart.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadstart.html
new file mode 100644
index 000000000..de4568212
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadstart.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - loadstart</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on autoplay audio should trigger loadstart event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("loadstart", function() {
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - loadstart");
+
+test(function() {
+ var t = async_test("setting src attribute on autoplay video should trigger loadstart event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("loadstart", function() {
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - loadstart");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadstart_noautoplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadstart_noautoplay.html
new file mode 100644
index 000000000..b575e7ac8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_loadstart_noautoplay.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - loadstart</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" controls>
+ </audio>
+ <video id="v" controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on non-autoplay audio should trigger loadstart event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("loadstart", function() {
+ t.done();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - loadstart");
+
+test(function() {
+ var t = async_test("setting src attribute on non-autoplay video should trigger loadstart event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("loadstart", function() {
+ t.done();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - loadstart");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_canplay_canplaythrough.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_canplay_canplaythrough.html
new file mode 100644
index 000000000..a1e7e4155
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_canplay_canplaythrough.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - canplay, then canplaythrough</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on autoplay audio should trigger canplay then canplaythrough event", {timeout:5000});
+ var a = document.getElementById("a");
+ var found_canplay = false;
+ a.addEventListener("canplay", function() {
+ found_canplay = true;
+ });
+ a.addEventListener("canplaythrough", function() {
+ t.step(function() {
+ assert_true(found_canplay);
+ });
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - canplay, then canplaythrough");
+
+test(function() {
+ var t = async_test("setting src attribute on autoplay video should trigger canplay then canplaythrough event", {timeout:5000});
+ var v = document.getElementById("v");
+ var found_canplay = false;
+ v.addEventListener("canplay", function() {
+ found_canplay = true;
+ });
+ v.addEventListener("canplaythrough", function() {
+ t.step(function() {
+ assert_true(found_canplay);
+ });
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - canplay, then canplaythrough");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_canplay_playing.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_canplay_playing.html
new file mode 100644
index 000000000..a5a67ddb2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_canplay_playing.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - canplay, then playing</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on autoplay audio should trigger canplay then playing event", {timeout:5000});
+ var a = document.getElementById("a");
+ var found_canplay = false;
+ a.addEventListener("canplay", function() {
+ found_canplay = true;
+ });
+ a.addEventListener("playing", function() {
+ t.step(function() {
+ assert_true(found_canplay);
+ });
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - canplay, then playing");
+
+test(function() {
+ var t = async_test("setting src attribute on autoplay video should trigger canplay then playing event", {timeout:5000});
+ var v = document.getElementById("v");
+ var found_canplay = false;
+ v.addEventListener("canplay", function() {
+ found_canplay = true;
+ });
+ v.addEventListener("playing", function() {
+ t.step(function() {
+ assert_true(found_canplay);
+ });
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - canplay, then playing");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_loadedmetadata_loadeddata.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_loadedmetadata_loadeddata.html
new file mode 100644
index 000000000..3aba3684f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_loadedmetadata_loadeddata.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - loadedmetadata, then loadeddata</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on autoplay audio should trigger loadedmetadata then loadeddata event", {timeout:5000});
+ var a = document.getElementById("a");
+ var found_loadedmetadata = false;
+ a.addEventListener("loadedmetadata", function() {
+ found_loadedmetadata = true;
+ });
+ a.addEventListener("loadeddata", function() {
+ t.step(function() {
+ assert_true(found_loadedmetadata);
+ });
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - loadedmetadata, then loadeddata");
+
+test(function() {
+ var t = async_test("setting src attribute on autoplay video should trigger loadedmetadata then loadeddata event", {timeout:5000});
+ var v = document.getElementById("v");
+ var found_loadedmetadata = false;
+ v.addEventListener("loadedmetadata", function() {
+ found_loadedmetadata = true;
+ });
+ v.addEventListener("loadeddata", function() {
+ t.step(function() {
+ assert_true(found_loadedmetadata);
+ });
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - loadedmetadata, then loadeddata");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_loadstart_progress.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_loadstart_progress.html
new file mode 100644
index 000000000..75e3ba772
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_order_loadstart_progress.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - loadstart, then progress</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on autoplay audio should trigger loadstart then progress event", {timeout:5000});
+ var a = document.getElementById("a");
+ var found_loadstart = false;
+ a.addEventListener("loadstart", function() {
+ found_loadstart = true;
+ });
+ a.addEventListener("progress", function() {
+ t.step(function() {
+ assert_true(found_loadstart);
+ });
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - loadstart, then progress");
+
+test(function() {
+ var t = async_test("setting src attribute on autoplay video should trigger loadstart then progress event", {timeout:5000});
+ var v = document.getElementById("v");
+ var found_loadstart = false;
+ v.addEventListener("loadstart", function() {
+ found_loadstart = true;
+ });
+ v.addEventListener("progress", function() {
+ t.step(function() {
+ assert_true(found_loadstart);
+ });
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - loadstart, then progress");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_pause.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_pause.html
new file mode 100644
index 000000000..1f7904c3b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_pause.html
@@ -0,0 +1,48 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - pause</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("calling pause() on autoplay audio should trigger pause event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("pause", function() {
+ t.step(function() {
+ assert_true(true);
+ });
+ t.done();
+ }, false);
+ a.addEventListener("play", function() {
+ a.pause(); // pause right after play
+ });
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - pause");
+
+test(function() {
+ var t = async_test("calling pause() on autoplay video should trigger pause event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("pause", function() {
+ t.step(function() {
+ assert_true(true);
+ });
+ t.done();
+ }, false);
+ v.addEventListener("play", function() {
+ v.pause(); // pause right after play
+ });
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - pause");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_pause_noautoplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_pause_noautoplay.html
new file mode 100644
index 000000000..554823483
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_pause_noautoplay.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - pause</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" controls>
+ </audio>
+ <video id="v" controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("calling play() then pause() on non-autoplay audio should trigger pause event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("pause", function() {
+ t.done();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+ a.play();
+ a.pause();
+}, "audio events - pause");
+
+test(function() {
+ var t = async_test("calling play() then pause() on non-autoplay video should trigger pause event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("pause", function() {
+ t.done();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ v.play();
+ v.pause();
+}, "video events - pause");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_play.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_play.html
new file mode 100644
index 000000000..82b2ca407
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_play.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - play</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on autoplay audio should trigger play event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("play", function() {
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - play");
+
+test(function() {
+ var t = async_test("setting src attribute on autoplay video should trigger play event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("play", function() {
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - play");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_play_noautoplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_play_noautoplay.html
new file mode 100644
index 000000000..67285a95a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_play_noautoplay.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - play</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" controls>
+ </audio>
+ <video id="v" controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("calling play() on audio should trigger play event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("play", function() {
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+ a.play();
+}, "audio events - play");
+
+test(function() {
+ var t = async_test("calling play() on video should trigger play event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("play", function() {
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ v.play();
+}, "video events - play");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_playing.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_playing.html
new file mode 100644
index 000000000..3741a1c98
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_playing.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - playing</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on autoplay audio should trigger playing event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("playing", function() {
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - playing");
+
+test(function() {
+ var t = async_test("setting src attribute on autoplay video should trigger playing event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("playing", function() {
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - playing");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_playing_noautoplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_playing_noautoplay.html
new file mode 100644
index 000000000..f750085ed
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_playing_noautoplay.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - playing</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" controls>
+ </audio>
+ <video id="v" controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("calling play() on audio should trigger playing event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("playing", function() {
+ t.done();
+ a.pause();
+ });
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+ a.play();
+}, "audio events - playing");
+
+test(function() {
+ var t = async_test("calling play() on video should trigger playing event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("playing", function() {
+ t.done();
+ v.pause();
+ });
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ v.play();
+}, "video events - playing");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_progress.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_progress.html
new file mode 100644
index 000000000..269f824f7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_progress.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - progress</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on autoplay audio should trigger progress event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("progress", function() {
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - progress");
+
+test(function() {
+ var t = async_test("setting src attribute on autoplay video should trigger progress event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("progress", function() {
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - progress");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_progress_noautoplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_progress_noautoplay.html
new file mode 100644
index 000000000..c594f3036
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_progress_noautoplay.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - progress</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" controls>
+ </audio>
+ <video id="v" controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("setting src attribute on non-autoplay audio should trigger progress event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("progress", function() {
+ t.done();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - progress");
+
+test(function() {
+ var t = async_test("setting src attribute on non-autoplay video should trigger progress event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("progress", function() {
+ t.done();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - progress");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_timeupdate.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_timeupdate.html
new file mode 100644
index 000000000..cc0a17fe2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_timeupdate.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - timeupdate</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+var ta = async_test("setting src attribute on a sufficiently long autoplay audio should trigger timeupdate event", {timeout:5000});
+var a = document.getElementById("a");
+a.addEventListener("timeupdate", function() {
+ ta.done();
+ a.pause();
+}, false);
+a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+
+var tv = async_test("setting src attribute on a sufficiently long autoplay video should trigger timeupdate event", {timeout:5000});
+var v = document.getElementById("v");
+v.addEventListener("timeupdate", function() {
+ tv.done();
+ v.pause();
+}, false);
+v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_timeupdate_noautoplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_timeupdate_noautoplay.html
new file mode 100644
index 000000000..feb4b8568
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_timeupdate_noautoplay.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - timeupdate</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" controls>
+ </audio>
+ <video id="v" controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("calling play() on a sufficiently long audio should trigger timeupdate event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("timeupdate", function() {
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+ a.play();
+}, "audio events - timeupdate");
+
+test(function() {
+ var t = async_test("calling play() on a sufficiently long video should trigger timeupdate event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("timeupdate", function() {
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ v.play();
+}, "video events - timeupdate");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_volumechange.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_volumechange.html
new file mode 100644
index 000000000..3481947e8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_volumechange.html
@@ -0,0 +1,72 @@
+<!doctype html>
+<title>volumechange event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+function volumechange_test(tagName) {
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ assert_equals(e.volume, 1);
+ e.volume = 0.5;
+ assert_equals(e.volume, 0.5);
+ e.onvolumechange = t.step_func(function() {
+ assert_equals(e.volume, 0.5);
+ e.volume = 1;
+ assert_equals(e.volume, 1);
+ e.onvolumechange = t.step_func(function() {
+ assert_equals(e.volume, 1);
+ t.done();
+ });
+ });
+ }, "setting " + tagName + ".volume fires volumechange");
+
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ assert_false(e.muted);
+ e.muted = true;
+ assert_true(e.muted);
+ e.onvolumechange = t.step_func(function() {
+ assert_true(e.muted);
+ e.muted = false;
+ assert_false(e.muted);
+ e.onvolumechange = t.step_func(function() {
+ assert_false(e.muted);
+ t.done();
+ });
+ });
+ }, "setting " + tagName + ".muted fires volumechange");
+
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ e.volume = e.volume;
+ e.muted = e.muted;
+ e.onvolumechange = t.step_func(function() {
+ assert_unreached();
+ });
+ var e2 = document.createElement(tagName);
+ e2.muted = !e2.muted;
+ e2.onvolumechange = t.step_func(function() {
+ t.done();
+ });
+ }, "setting " + tagName + ".volume/muted to the same value does not fire volumechange");
+
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ e.muted = !e.muted;
+ e.volume = 1 - e.volume;
+ e.muted = !e.muted;
+ e.volume = 1 - e.volume;
+ var volumechange_count = 0;
+ e.onvolumechange = t.step_func(function() {
+ volumechange_count++;
+ if (volumechange_count == 4) {
+ t.done();
+ }
+ });
+ }, "setting " + tagName + ".volume/muted repeatedly fires volumechange repeatedly");
+}
+
+volumechange_test("audio");
+volumechange_test("video");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/historical.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/historical.html
new file mode 100644
index 000000000..451923408
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/historical.html
@@ -0,0 +1,53 @@
+<!doctype html>
+<title>Historical media element features should not be supported</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+function t(property, tagName) {
+ var tagNames = tagName ? [tagName] : ['audio', 'video'];
+ tagNames.forEach(function(tagName) {
+ test(function() {
+ assert_false(property in document.createElement(tagName));
+ }, tagName + '.' + property + ' should not be supported');
+ });
+}
+
+t('bufferingRate'); // added in r678, removed in r2872.
+t('start'); // added in r692, removed in r2401.
+t('end'); // added in r692, removed in r2401.
+t('loopStart'); // added in r692, removed in r2401.
+t('loopEnd'); // added in r692, removed in r2401.
+t('loopCount'); // added in r692, replaced with playCount in r1105.
+t('currentLoop'); // added in r692, removed in r2401.
+t('addCuePoint'); // added in r721, replaced with addCueRange in r1106.
+t('removeCuePoint'); // added in r721, replaced with removeCueRanges in r1106.
+t('playCount'); // added in r1105, removed in r2401.
+t('addCueRange'); // added in r1106, removed in r5070.
+t('removeCueRanges'); // added in r1106, removed in r5070.
+t('pixelratio', 'source'); // added in r1629, removed in r2493.
+t('bufferedBytes'); // added in r1630, removed in r2405.
+t('totalBytes'); // added in r1630, removed in r2405.
+t('bufferingThrottled'); // added in r1632, removed in r2872.
+t('autobuffer'); // added in r2855, replaced with preload in r4811.
+t('startTime'); // added in r3035, replaced with initialTime in r5310.
+t('startOffsetTime'); // added in r5310, replaced with startDate in r7045.
+t('initialTime'); // added in r5310, removed in r7046.
+t('audio', 'video'); // added in r5636, replaced with muted in r5991.
+t('startDate'); // added in r7045, replaced with getStartDate() in r8113.
+
+// TextTrackCue constructor: added in r5723, removed in r7742.
+test(function() {
+ assert_throws(new TypeError(), function() {
+ new TextTrackCue(0, 0, '');
+ });
+}, 'TextTrackCue constructor should not be supported');
+
+// added in https://github.com/whatwg/html/commit/66c5b32240c202c74f475872e7ea2cd163777b4a
+// removed in https://github.com/whatwg/html/commit/634698e70ea4586d58c989fa7d2cbfcad20d33e6
+t('mediaGroup');
+t('controller');
+test(function() {
+ assert_false('MediaController' in window);
+}, 'MediaController constructor should not be supported');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/addTextTrack.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/addTextTrack.html
new file mode 100644
index 000000000..2a76b0a66
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/addTextTrack.html
@@ -0,0 +1,116 @@
+<!doctype html>
+<title>HTMLMediaElement.addTextTrack</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+var video = document.createElement('video');
+test(function(){
+ assert_throws(new TypeError(), function(){
+ video.addTextTrack('foo');
+ });
+ assert_throws(new TypeError(), function(){
+ video.addTextTrack(undefined);
+ });
+ assert_throws(new TypeError(), function(){
+ video.addTextTrack(null);
+ });
+}, document.title + ' bogus first arg');
+
+test(function(){
+ assert_throws(new TypeError(), function(){
+ video.addTextTrack('SUBTITLES');
+ });
+}, document.title + ' uppercase first arg');
+
+test(function(){
+ var t = video.addTextTrack('subtitles');
+ assert_equals(t.kind, 'subtitles');
+ assert_equals(t.label, '');
+ assert_equals(t.language, '');
+ assert_equals(t.mode, 'hidden');
+ assert_true(t.cues instanceof TextTrackCueList);
+ assert_equals(t.cues.length, 0);
+}, document.title + ' subtitles first arg');
+
+test(function(){
+ var t = video.addTextTrack('captions');
+ assert_equals(t.kind, 'captions');
+ assert_equals(t.label, '');
+ assert_equals(t.language, '');
+ assert_equals(t.mode, 'hidden');
+ assert_true(t.cues instanceof TextTrackCueList);
+ assert_equals(t.cues.length, 0);
+}, document.title + ' captions first arg');
+
+test(function(){
+ var t = video.addTextTrack('descriptions');
+ assert_equals(t.kind, 'descriptions');
+ assert_equals(t.label, '');
+ assert_equals(t.language, '');
+ assert_equals(t.mode, 'hidden');
+ assert_true(t.cues instanceof TextTrackCueList);
+ assert_equals(t.cues.length, 0);
+}, document.title + ' descriptions first arg');
+
+test(function(){
+ var t = video.addTextTrack('chapters');
+ assert_equals(t.kind, 'chapters');
+ assert_equals(t.label, '');
+ assert_equals(t.language, '');
+ assert_equals(t.mode, 'hidden');
+ assert_true(t.cues instanceof TextTrackCueList);
+ assert_equals(t.cues.length, 0);
+}, document.title + ' chapters first arg');
+
+test(function(){
+ var t = video.addTextTrack('metadata');
+ assert_equals(t.kind, 'metadata');
+ assert_equals(t.label, '');
+ assert_equals(t.language, '');
+ assert_equals(t.mode, 'hidden');
+ assert_true(t.cues instanceof TextTrackCueList);
+ assert_equals(t.cues.length, 0);
+}, document.title + ' metadata first arg');
+
+test(function(){
+ var t = video.addTextTrack('subtitles', undefined, undefined);
+ assert_equals(t.kind, 'subtitles');
+ assert_equals(t.label, '');
+ assert_equals(t.language, '');
+ assert_equals(t.mode, 'hidden');
+ assert_true(t.cues instanceof TextTrackCueList);
+ assert_equals(t.cues.length, 0);
+}, document.title + ' undefined second and third arg');
+
+test(function(){
+ var t = video.addTextTrack('subtitles', null, null);
+ assert_equals(t.kind, 'subtitles');
+ assert_equals(t.label, 'null');
+ assert_equals(t.language, 'null');
+ assert_equals(t.mode, 'hidden');
+ assert_true(t.cues instanceof TextTrackCueList);
+ assert_equals(t.cues.length, 0);
+}, document.title + ' null second and third arg');
+
+test(function(){
+ var t = video.addTextTrack('subtitles', 'foo', 'bar');
+ assert_equals(t.kind, 'subtitles');
+ assert_equals(t.label, 'foo');
+ assert_equals(t.language, 'bar');
+ assert_equals(t.mode, 'hidden');
+ assert_true(t.cues instanceof TextTrackCueList);
+ assert_equals(t.cues.length, 0);
+}, document.title + ' foo and bar second and third arg');
+
+test(function(){
+ var t = video.addTextTrack('subtitles', 'foo');
+ assert_equals(t.kind, 'subtitles');
+ assert_equals(t.label, 'foo');
+ assert_equals(t.language, '');
+ assert_equals(t.mode, 'hidden');
+ assert_true(t.cues instanceof TextTrackCueList);
+ assert_equals(t.cues.length, 0);
+}, document.title + ' foo second arg, third arg omitted');
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/textTracks.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/textTracks.html
new file mode 100644
index 000000000..0f183b7e1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/textTracks.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<title>HTMLMediaElement.textTracks</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+var video = document.createElement('video');
+test(function(){
+ assert_equals(video.textTracks, video.textTracks);
+ assert_equals(video.textTracks.length, 0);
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/default.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/default.html
new file mode 100644
index 000000000..05fd0f7f7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/default.html
@@ -0,0 +1,55 @@
+<!doctype html>
+<title>HTMLTrackElement.default</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var track = document.createElement('track');
+ assert_equals(track['default'], false);
+ assert_equals(track.getAttribute('default'), null);
+}, document.title + ' missing value');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('default', '');
+ assert_equals(track['default'], true);
+ assert_equals(track.getAttribute('default'), '');
+}, document.title + ' empty string content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track['default'] = '';
+ assert_equals(track['default'], false);
+ assert_equals(track.getAttribute('default'), null);
+}, document.title + ' empty string IDL attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('default', 'foo');
+ assert_equals(track['default'], true);
+ assert_equals(track.getAttribute('default'), 'foo');
+}, document.title + ' foo in content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track['default'] = 'foo';
+ assert_equals(track['default'], true);
+ assert_equals(track.getAttribute('default'), '');
+}, document.title + ' foo in IDL attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track['default'] = true;
+ assert_equals(track['default'], true);
+ assert_equals(track.getAttribute('default'), '');
+}, document.title + ' true in IDL attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('default', '');
+ track['default'] = false;
+ assert_equals(track['default'], false);
+ assert_equals(track.getAttribute('default'), null);
+}, document.title + ' false in IDL attribute');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/kind.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/kind.html
new file mode 100644
index 000000000..78c3bff51
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/kind.html
@@ -0,0 +1,146 @@
+<!doctype html>
+<title>HTMLTrackElement.kind</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var track = document.createElement('track');
+ assert_equals(track.kind, 'subtitles');
+ assert_equals(track.getAttribute('kind'), null);
+}, document.title + ' missing value');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('kind', 'invalid');
+ assert_equals(track.kind, 'metadata');
+ assert_equals(track.getAttribute('kind'), 'invalid');
+}, document.title + ' invalid value in content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('kind', 'CAPTIONS');
+ assert_equals(track.kind, 'captions');
+ assert_equals(track.getAttribute('kind'), 'CAPTIONS');
+}, document.title + ' content attribute uppercase');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('kind', 'CAPT\u0130ONS');
+ assert_equals(track.kind, 'metadata');
+ assert_equals(track.getAttribute('kind'), 'CAPT\u0130ONS');
+}, document.title + ' content attribute with uppercase turkish I (with dot)');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('kind', 'capt\u0131ons');
+ assert_equals(track.kind, 'metadata');
+ assert_equals(track.getAttribute('kind'), 'capt\u0131ons');
+}, document.title + ' content attribute with lowercase turkish i (dotless)');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('kind', 'subtitles');
+ assert_equals(track.kind, 'subtitles');
+ assert_equals(track.getAttribute('kind'), 'subtitles');
+}, document.title + ' content attribute "subtitles"');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('kind', 'captions');
+ assert_equals(track.kind, 'captions');
+ assert_equals(track.getAttribute('kind'), 'captions');
+}, document.title + ' content attribute "captions"');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('kind', 'descriptions');
+ assert_equals(track.kind, 'descriptions');
+ assert_equals(track.getAttribute('kind'), 'descriptions');
+}, document.title + ' content attribute "descriptions"');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('kind', 'chapters');
+ assert_equals(track.kind, 'chapters');
+ assert_equals(track.getAttribute('kind'), 'chapters');
+}, document.title + ' content attribute "chapters"');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('kind', 'metadata');
+ assert_equals(track.kind, 'metadata');
+ assert_equals(track.getAttribute('kind'), 'metadata');
+}, document.title + ' content attribute "metadata"');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('kind', 'captions\u0000');
+ assert_equals(track.kind, 'metadata');
+ assert_equals(track.getAttribute('kind'), 'captions\u0000');
+}, document.title + ' content attribute "captions\\u0000"');
+
+test(function(){
+ var track = document.createElement('track');
+ track.kind = 'subtitles';
+ assert_equals(track.getAttribute('kind'), 'subtitles');
+ assert_equals(track.kind, 'subtitles');
+}, document.title + ' setting IDL attribute to "subtitles"');
+
+test(function(){
+ var track = document.createElement('track');
+ track.kind = 'captions';
+ assert_equals(track.getAttribute('kind'), 'captions');
+ assert_equals(track.kind, 'captions');
+}, document.title + ' setting IDL attribute to "captions"');
+
+test(function(){
+ var track = document.createElement('track');
+ track.kind = 'descriptions';
+ assert_equals(track.getAttribute('kind'), 'descriptions');
+ assert_equals(track.kind, 'descriptions');
+}, document.title + ' setting IDL attribute to "descriptions"');
+
+test(function(){
+ var track = document.createElement('track');
+ track.kind = 'chapters';
+ assert_equals(track.getAttribute('kind'), 'chapters');
+ assert_equals(track.kind, 'chapters');
+}, document.title + ' setting IDL attribute to "chapters"');
+
+test(function(){
+ var track = document.createElement('track');
+ track.kind = 'metadata';
+ assert_equals(track.getAttribute('kind'), 'metadata');
+ assert_equals(track.kind, 'metadata');
+}, document.title + ' setting IDL attribute to "metadata"');
+
+test(function(){
+ var track = document.createElement('track');
+ track.kind = 'CAPTIONS';
+ assert_equals(track.getAttribute('kind'), 'CAPTIONS');
+ assert_equals(track.kind, 'captions');
+}, document.title + ' setting IDL attribute to "CAPTIONS"');
+
+test(function(){
+ var track = document.createElement('track');
+ track.kind = 'CAPT\u0130ONS';
+ assert_equals(track.getAttribute('kind'), 'CAPT\u0130ONS');
+ assert_equals(track.kind, 'metadata');
+}, document.title + ' setting IDL attribute with uppercase turkish I (with dot)');
+
+test(function(){
+ var track = document.createElement('track');
+ track.kind = 'capt\u0131ons';
+ assert_equals(track.getAttribute('kind'), 'capt\u0131ons');
+ assert_equals(track.kind, 'metadata');
+}, document.title + ' setting IDL attribute with lowercase turkish I (dotless)');
+
+test(function(){
+ var track = document.createElement('track');
+ track.kind = 'captions\u0000';
+ assert_equals(track.getAttribute('kind'), 'captions\u0000');
+ assert_equals(track.kind, 'metadata');
+}, document.title + ' setting IDL attribute with \\u0000');
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/label.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/label.html
new file mode 100644
index 000000000..b2360315c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/label.html
@@ -0,0 +1,83 @@
+<!doctype html>
+<title>HTMLTrackElement.label</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var track = document.createElement('track');
+ assert_equals(track.label, '');
+ assert_equals(track.getAttribute('label'), null);
+}, document.title + ' missing value');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('label', '');
+ assert_equals(track.label, '');
+ assert_equals(track.getAttribute('label'), '');
+}, document.title + ' empty string content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.label = '';
+ assert_equals(track.label, '');
+ assert_equals(track.getAttribute('label'), '');
+}, document.title + ' empty string IDL attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('label', 'foo');
+ assert_equals(track.label, 'foo');
+ assert_equals(track.getAttribute('label'), 'foo');
+}, document.title + ' lowercase content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('label', 'FOO');
+ assert_equals(track.label, 'FOO');
+ assert_equals(track.getAttribute('label'), 'FOO');
+}, document.title + ' uppercase content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('label', '\u0000');
+ assert_equals(track.label, '\u0000');
+ assert_equals(track.getAttribute('label'), '\u0000');
+}, document.title + '\\u0000 in content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.label = 'foo';
+ assert_equals(track.label, 'foo');
+ assert_equals(track.getAttribute('label'), 'foo');
+}, document.title + ' lowercase IDL attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.label = 'FOO';
+ assert_equals(track.label, 'FOO');
+ assert_equals(track.getAttribute('label'), 'FOO');
+}, document.title + ' uppercase IDL attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('label', ' foo \n');
+ assert_equals(track.label, ' foo \n');
+ assert_equals(track.getAttribute('label'), ' foo \n');
+}, document.title + ' whitespace in content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.label = ' foo \n';
+ assert_equals(track.label, ' foo \n');
+ assert_equals(track.getAttribute('label'), ' foo \n');
+}, document.title + ' whitespace in IDL attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.label = '\u0000';
+ assert_equals(track.label, '\u0000');
+ assert_equals(track.getAttribute('label'), '\u0000');
+}, document.title + ' \\u0000 in IDL attribute');
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/readyState.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/readyState.html
new file mode 100644
index 000000000..e18f21934
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/readyState.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<title>HTMLTrackElement.readyState</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var track = document.createElement('track');
+ assert_equals(track.readyState, 0);
+}, document.title + ' default value');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/src.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/src.html
new file mode 100644
index 000000000..4089913cb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/src.html
@@ -0,0 +1,43 @@
+<!doctype html>
+<title>HTMLTrackElement.src</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var track = document.createElement('track');
+ assert_equals(track.src, '');
+ assert_equals(track.getAttribute('src'), null);
+}, document.title + ' missing value');
+
+function resolve(url) {
+ var link = document.createElement('a');
+ link.setAttribute('href', url);
+ return link.href;
+}
+
+var tests = [
+ {input:'', expectedIDL:resolve(''), desc:'empty string'},
+ {input:'http://foo bar', expectedIDL:'http://foo bar', desc:'unresolvable value'},
+ {input:'test', expectedIDL:resolve('test'), desc:'resolvable value'},
+ // Leading and trailing C0 controls and space is stripped per url spec.
+ {input:'\u0000', expectedIDL:resolve(''), desc:'\\u0000'},
+ {input:'foo\u0000bar', expectedIDL:resolve('foo%00bar'), desc:'foo\\u0000bar'},
+];
+
+tests.forEach(function(t) {
+ test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('src', t.input);
+ assert_equals(track.src, t.expectedIDL);
+ assert_equals(track.getAttribute('src'), t.input);
+ }, [document.title, t.desc, 'in content attribute'].join(' '));
+
+ test(function(){
+ var track = document.createElement('track');
+ track.src = t.input;
+ assert_equals(track.src, t.expectedIDL);
+ assert_equals(track.getAttribute('src'), t.input);
+ }, [document.title, 'assigning', t.desc, 'to IDL attribute'].join(' '));
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/srclang.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/srclang.html
new file mode 100644
index 000000000..b5071e0c3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/srclang.html
@@ -0,0 +1,82 @@
+<!doctype html>
+<title>HTMLTrackElement.srclang</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var track = document.createElement('track');
+ assert_equals(track.srclang, '');
+ assert_equals(track.getAttribute('srclang'), null);
+}, document.title + ' missing value');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('srclang', '');
+ assert_equals(track.srclang, '');
+ assert_equals(track.getAttribute('srclang'), '');
+}, document.title + ' empty string content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.srclang = '';
+ assert_equals(track.srclang, '');
+ assert_equals(track.getAttribute('srclang'), '');
+}, document.title + ' empty string IDL attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('srclang', 'foo');
+ assert_equals(track.srclang, 'foo');
+ assert_equals(track.getAttribute('srclang'), 'foo');
+}, document.title + ' lowercase content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('srclang', 'FOO');
+ assert_equals(track.srclang, 'FOO');
+ assert_equals(track.getAttribute('srclang'), 'FOO');
+}, document.title + ' uppercase content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('srclang', '\u0000');
+ assert_equals(track.srclang, '\u0000');
+ assert_equals(track.getAttribute('srclang'), '\u0000');
+}, document.title + ' \\u0000 content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.srclang = 'foo';
+ assert_equals(track.srclang, 'foo');
+ assert_equals(track.getAttribute('srclang'), 'foo');
+}, document.title + ' lowercase IDL attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.srclang = 'FOO';
+ assert_equals(track.srclang, 'FOO');
+ assert_equals(track.getAttribute('srclang'), 'FOO');
+}, document.title + ' uppercase IDL attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('srclang', ' foo \n');
+ assert_equals(track.srclang, ' foo \n');
+ assert_equals(track.getAttribute('srclang'), ' foo \n');
+}, document.title + ' whitespace in content attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.srclang = ' foo \n';
+ assert_equals(track.srclang, ' foo \n');
+ assert_equals(track.getAttribute('srclang'), ' foo \n');
+}, document.title + ' whitespace in IDL attribute');
+
+test(function(){
+ var track = document.createElement('track');
+ track.srclang = '\u0000';
+ assert_equals(track.srclang, '\u0000');
+ assert_equals(track.getAttribute('srclang'), '\u0000');
+}, document.title + ' \\u0000 in IDL attribute');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/track.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/track.html
new file mode 100644
index 000000000..1de0a8804
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/track.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<title>HTMLTrackElement.track</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var track = document.createElement('track');
+ assert_equals(track.track, track.track, 'same object should be returned');
+ assert_true(track.track instanceof TextTrack, 'returned object should be a TextTrack');
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/activeCues.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/activeCues.html
new file mode 100644
index 000000000..689ec12be
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/activeCues.html
@@ -0,0 +1,104 @@
+<!doctype html>
+<title>TextTrack.activeCues</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=/common/media.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ window.t1 = video.addTextTrack('subtitles');
+ window.track = document.createElement('track');
+ track['default'] = true;
+ video.appendChild(track);
+ window.t2 = track.track;
+ t2.mode = 'showing';
+ window.t1_cues = t1.activeCues;
+ window.t2_cues = t2.activeCues;
+ document.body.appendChild(video);
+ if (!t1)
+ throw new Error('t1 was undefined')
+}, {timeout:25000});
+function smoke_test() {
+ assert_true('HTMLTrackElement' in window, 'track not supported');
+}
+
+test(function(){
+ smoke_test();
+ assert_equals(t1.activeCues, t1_cues, 't1.activeCues should return same object');
+ assert_equals(t2.activeCues, t2_cues, 't2.activeCues should return same object');
+ assert_not_equals(t1.activeCues, t2.activeCues, 't1.activeCues and t2.activeCues should be different objects');
+ assert_not_equals(t1.activeCues, null, 't1.activeCues should not be null');
+ assert_not_equals(t2.activeCues, null, 't2.activeCues should not be null');
+ assert_equals(t1.activeCues.length, 0, 't1.activeCues should have length 0');
+ assert_equals(t2.activeCues.length, 0, 't2.activeCues should have length 0');
+}, document.title+', empty list');
+test(function(){
+ smoke_test();
+ var c = new VTTCue(0, 1, "text");
+ t1.addCue(c);
+ assert_equals(t1.activeCues, t1_cues, "t1.activeCues should return same object");
+ assert_equals(t1.activeCues.length, 0, "t1.activeCues.length");
+ var c2 = new VTTCue(1, 2, "text2");
+ t1.addCue(c2);
+ assert_equals(t1.activeCues, t1_cues, "t1.activeCues should return the same object after adding a second cue");
+ assert_equals(t1.activeCues.length, 0, "t1.activeCues.length after adding a second cue");
+}, document.title+', after addCue()');
+test(function(){
+ smoke_test();
+ t1.mode = 'showing';
+ assert_equals(t1.activeCues, t1_cues, "t1.activeCues should return the same object after setting mode to showing");
+ t1.mode = 'hidden';
+ assert_equals(t1.activeCues, t1_cues, "t1.activeCues should return the same object after setting mode to hidden");
+ t1.mode = 'disabled';
+ assert_equals(t1.activeCues, null, "t1.activeCues should be null when mode is disabled");
+ assert_equals(t1_cues.length, 0, "t1_cues should still be intact after setting mode to disabled");
+}, document.title+', different modes');
+
+// ok now let's load in a video
+var test1 = async_test(document.title+', video loading', {timeout:20000});
+var test2 = async_test(document.title+', video playing', {timeout:20000});
+var test3 = async_test(document.title+', adding cue during playback', {timeout:20000});
+test1.step(smoke_test);
+test2.step(smoke_test);
+test3.step(smoke_test);
+test1.step(function(){
+ t1.mode = 'showing';
+ video.onloadeddata = test1.step_func(function(e) {
+ video.onplaying = test2.step_func(function(e) {
+ try {
+ assert_equals(t1.activeCues, t1_cues, "t1.activeCues should return the same object after playing a video");
+ assert_equals(t1.activeCues.length, 1, "t1.activeCues.length after the video has started playing");
+ } catch(ex) {
+ test2.step(function() { throw ex; });
+ test3.step(function() { assert_unreached(); });
+ return;
+ }
+ test3.step(function(){
+ var c3 = new VTTCue(0, 2, "text3");
+ t1.addCue(c3);
+ assert_equals(t1.activeCues.length, 1, "t1.activeCues.length after adding a cue in the same script");
+ setTimeout(test3.step_func(function(){
+ assert_equals(t1.activeCues.length, 2, "t1.activeCues.length after the event loop has spun");
+ test3.done();
+ }, 0));
+ });
+ test2.done();
+ });
+ try {
+ assert_equals(t1.activeCues, t1_cues, "t1.activeCues should return the same object after loading a video");
+ assert_equals(t2.activeCues, t2_cues, "t2.activeCues should return the same object after loading a video");
+ assert_equals(t1.activeCues.length, 0, "t1.activeCues.length before the video has started playing");
+ assert_equals(t2.activeCues.length, 0, "t1.activeCues.length before the video has started playing");
+ } catch(ex) {
+ test1.step(function() { throw ex; });
+ test2.step(function() { assert_unreached(); });
+ test3.step(function() { assert_unreached(); });
+ return;
+ }
+ video.play();
+ test1.done();
+ });
+ video.src = getVideoURI("/media/movie_5");
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/addCue.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/addCue.html
new file mode 100644
index 000000000..267941334
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/addCue.html
@@ -0,0 +1,68 @@
+<!doctype html>
+<title>TextTrack.addCue()</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ document.body.appendChild(video);
+}, {timeout:5000});
+test(function() {
+ var t1 = video.addTextTrack('subtitles');
+ var t2 = video.addTextTrack('subtitles');
+ var c1 = new VTTCue(0, 1, 'text1');
+ t1.addCue(c1);
+ t2.addCue(c1);
+ assert_equals(c1.track, t2);
+}, document.title+', adding a cue to two different tracks');
+test(function() {
+ var t1 = video.addTextTrack('subtitles');
+ var c1 = new VTTCue(0, 1, 'text1');
+ t1.addCue(c1);
+ assert_equals(c1.track, t1);
+ t1.addCue(c1);
+ assert_equals(c1.track, t1);
+}, document.title+', adding a cue to a track twice');
+test(function() {
+ var t1 = video.addTextTrack('subtitles');
+ var t2 = video.addTextTrack('subtitles');
+ var c1 = new VTTCue(0, 1, 'text1');
+ t1.addCue(c1);
+ assert_equals(c1.track, t1);
+ t1.removeCue(c1);
+ assert_equals(c1.track, null);
+ t2.addCue(c1);
+ assert_equals(c1.track, t2);
+}, document.title+', adding a removed cue to a different track');
+test(function() {
+ var t1 = video.addTextTrack('subtitles');
+ var c1 = new VTTCue(0, 1, 'text1');
+ t1.addCue(c1);
+ assert_equals(t1.cues.length, 1, 't1.cues.length after first addition');
+ t1.removeCue(c1);
+ assert_equals(t1.cues.length, 0, 't1.cues.length after removal');
+ t1.addCue(c1);
+ assert_equals(t1.cues.length, 1, 't1.cues.length after second addition');
+}, document.title+', adding an associated but removed cue to the same track');
+
+var t = async_test(document.title+', adding a cue associated with a track element to other track');
+t.step(function(){
+ var t1 = video.addTextTrack('subtitles');
+ var track = document.createElement('track');
+ track.onload = t.step_func(function(){
+ var cue = track.track.cues[0];
+ track.track.removeCue(cue);
+ t1.addCue(cue);
+ assert_equals(cue.track, t1);
+ t.done();
+ });
+ track.onerror = t.step_func(function() {
+ assert_unreached('got error event');
+ });
+ track.src= 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:01.000\ntest\n');
+ track.kind = 'subtitles';
+ track.track.mode = 'hidden';
+ video.appendChild(track);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/constants.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/constants.html
new file mode 100644
index 000000000..3c8046cdc
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/constants.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>TextTrack constants</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ window.t1 = video.addTextTrack('subtitles');
+});
+test(function(){
+ assert_equals(t1.DISABLED, undefined, "t1.DISABLED");
+ assert_equals(t1.HIDDEN, undefined, "t1.HIDDEN");
+ assert_equals(t1.SHOWING, undefined, "t1.SHOWING");
+ assert_equals(TextTrack.prototype.DISABLED, undefined, "TextTrack.prototype.DISABLED");
+ assert_equals(TextTrack.prototype.HIDDEN, undefined, "TextTrack.prototype.HIDDEN");
+ assert_equals(TextTrack.prototype.SHOWING, undefined, "TextTrack.prototype.SHOWING");
+ assert_equals(TextTrack.DISABLED, undefined, "TextTrack.DISABLED");
+ assert_equals(TextTrack.HIDDEN, undefined, "TextTrack.HIDDEN");
+ assert_equals(TextTrack.SHOWING, undefined, "TextTrack.SHOWING");
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html
new file mode 100644
index 000000000..4b7808c96
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html
@@ -0,0 +1,100 @@
+<!doctype html>
+<title>TextTrack.cues</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var video = document.createElement('video');
+ var t1 = video.addTextTrack('subtitles');
+ assert_equals(t1.cues, t1.cues, 't1.cues should return same object');
+ assert_not_equals(t1.cues, null, 't1.cues should not be null');
+ assert_true(t1.cues instanceof TextTrackCueList, 't1.cues instanceof TextTrackCueList');
+ assert_equals(t1.cues.length, 0, 't1.cues.length');
+}, document.title+', empty list');
+
+function addCue(texttrack, start, end, text, id) {
+ var c = new VTTCue(start, end, text);
+ c.id = id;
+ texttrack.addCue(c);
+ return c;
+}
+
+test(function(){
+ var video = document.createElement('video');
+ var t1 = video.addTextTrack('subtitles');
+ var t1_cues = t1.cues;
+ var c = addCue(t1, 0, 1, 'text', 'id');
+ assert_equals(t1.cues, t1_cues, "t1.cues should return same object");
+ assert_equals(t1.cues.length, 1, "t1.cues.length");
+ var c2 = addCue(t1, 1, 2, 'text2', 'id2');
+ assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after adding a second cue");
+ assert_equals(t1.cues.length, 2, "t1.cues.length after adding a second cue");
+ assert_equals(t1.cues[0].id, "id");
+ assert_equals(t1.cues[1].id, "id2");
+}, document.title+', after addCue()');
+
+test(function(){
+ var video = document.createElement('video');
+ var t1 = video.addTextTrack('subtitles');
+ var t1_cues = t1.cues;
+ var c = addCue(t1, 0, 1, 'text', 'id');
+ var c2 = addCue(t1, 1, 2, 'text2', 'id2');
+ t1.mode = 'showing';
+ assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after setting mode to 'showing'");
+ t1.mode = 'hidden';
+ assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after setting mode to 'hidden'");
+ t1.mode = 'disabled';
+ assert_equals(t1.cues, null, "t1.cues should be null when mode is 'disabled'");
+ assert_equals(t1_cues.length, 2, "t1_cues should still be intact after setting mode to 'disabled'");
+ assert_equals(t1_cues[0].id, "id", "t1_cues first cue should still be intact after setting mode to 'disabled'");
+ assert_equals(t1_cues[1].id, "id2", "t1_cues second cue should still be intact after setting mode to 'disabled'");
+ t1.mode = 'hidden';
+ assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after setting mode to 'disabled' and then 'hidden'");
+ t1.mode = 'disabled';
+ assert_equals(t1.cues, null, "t1.cues should be null when mode is set to 'disabled' again");
+ assert_equals(t1_cues.length, 2, "t1_cues should still be intact after setting mode to 'disabled' again");
+ assert_equals(t1_cues[0].id, "id", "t1_cues first cue should still be intact after setting mode to 'disabled' again");
+ assert_equals(t1_cues[1].id, "id2", "t1_cues second cue should still be intact after setting mode to 'disabled' again");
+ t1.mode = 'showing';
+ assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after setting mode to 'disabled' and then 'showing'");
+}, document.title+', different modes');
+
+test(function(){
+ var video = document.createElement('video');
+ var t1 = video.addTextTrack('subtitles');
+ var t1_cues = t1.cues;
+ var c = addCue(t1, 0, 1, 'text', 'id');
+ var c2 = addCue(t1, 1, 2, 'text2', 'id2');
+ t1.mode = 'showing';
+ t1.cues[1].startTime = 0; // this should change the text track cue order
+ assert_equals(t1.cues[0].id, 'id2');
+ assert_equals(t1.cues[1].id, 'id');
+ t1.cues[0].startTime = 0.5; // this should change it back
+ assert_equals(t1.cues[0].id, 'id');
+ assert_equals(t1.cues[1].id, 'id2');
+}, document.title+', changing order');
+
+async_test(function(){
+ var video = document.createElement('video');
+ var t1 = video.addTextTrack('subtitles');
+ var t1_cues = t1.cues;
+ t1.mode = 'hidden';
+ var track = document.createElement('track');
+ track['default'] = true;
+ video.appendChild(track); // queues a task to "honor user preferences...", media element event task source
+ var t2 = track.track;
+ assert_equals(t2.cues, null, 't2.cues should be null');
+ // We need to wait until the "honor user preferences..." steps have run so we invoke play()
+ // which queues an event with the same task source.
+ video.onplay = this.step_func(function(){
+ assert_equals(t2.cues, t2.cues, 't2.cues should return same object');
+ assert_not_equals(t1.cues, t2.cues, 't1.cues and t2.cues should be different objects');
+ assert_not_equals(t2.cues, null, 't2.cues should not be null');
+ assert_true(t2.cues instanceof TextTrackCueList, 't2.cues instanceof TextTrackCueList');
+ assert_equals(t2.cues.length, 0, 't2.cues should have length 0');
+ this.done();
+ });
+ video.play(); // queues a task to fire 'play', media element event task source
+}, document.title+', default attribute');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/kind.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/kind.html
new file mode 100644
index 000000000..d5dbc8342
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/kind.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<title>TextTrack.kind</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var video = document.createElement('video');
+ var t1 = video.addTextTrack('subtitles');
+ var t2 = video.addTextTrack('captions');
+ var t3 = video.addTextTrack('descriptions');
+ var t4 = video.addTextTrack('chapters');
+ var t5 = video.addTextTrack('metadata');
+ assert_equals(t1.kind, 'subtitles');
+ assert_equals(t2.kind, 'captions');
+ assert_equals(t3.kind, 'descriptions');
+ assert_equals(t4.kind, 'chapters');
+ assert_equals(t5.kind, 'metadata');
+}, document.title+', addTextTrack');
+test(function(){
+ var track = document.createElement('track');
+ track.setAttribute('kind', 'CAPTIONS');
+ var t = track.track;
+ assert_equals(t.kind, 'captions');
+}, document.title+', track element');
+test(function(){
+ var track = document.createElement('track');
+ track.kind = 'captions\u0000';
+ assert_equals(track.track.kind, 'metadata');
+}, document.title+', \\u0000');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/label.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/label.html
new file mode 100644
index 000000000..c60e85c21
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/label.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>TextTrack.label</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ window.t1 = video.addTextTrack('subtitles', 'foo');
+ window.track = document.createElement('track');
+ track.setAttribute('label', 'bar');
+ video.appendChild(track);
+ window.t2 = track.track;
+});
+test(function(){
+ assert_equals(t1.label, 'foo');
+ assert_equals(t2.label, 'bar');
+ track.label = 'baz';
+ assert_equals(t2.label, 'baz');
+ track.removeAttribute('label');
+ assert_equals(t2.label, '');
+});
+test(function(){
+ track.label = '\u0000a';
+ assert_equals(t2.label, '\u0000a');
+ track.setAttribute('label', '\u0000b', 'IDL attribute');
+ assert_equals(t2.label, '\u0000b', 'content attribute');
+}, document.title+', \\u0000');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/language.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/language.html
new file mode 100644
index 000000000..eda3653de
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/language.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>TextTrack.language</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ window.t1 = video.addTextTrack('subtitles', 'foo', 'foo');
+ window.track = document.createElement('track');
+ track.setAttribute('srclang', 'bar');
+ video.appendChild(track);
+ window.t2 = track.track;
+});
+test(function(){
+ assert_equals(t1.language, 'foo');
+ assert_equals(t2.language, 'bar');
+ track.srclang = 'baz';
+ assert_equals(t2.language, 'baz');
+ track.removeAttribute('srclang');
+ assert_equals(t2.language, '');
+});
+test(function(){
+ track.srclang = '\u0000a';
+ assert_equals(t2.language, '\u0000a', 'IDL attribute');
+ track.setAttribute('srclang', '\u0000b');
+ assert_equals(t2.language, '\u0000b', 'content attribute');
+}, document.title+', \\u0000');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/mode.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/mode.html
new file mode 100644
index 000000000..9f9415670
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/mode.html
@@ -0,0 +1,55 @@
+<!doctype html>
+<title>TextTrack.mode</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var track = document.createElement('track');
+ assert_equals(track.track.mode, 'disabled', 'initial');
+ track.track.mode = 1;
+ assert_equals(track.track.mode, 'disabled', '1');
+ track.track.mode = '';
+ assert_equals(track.track.mode, 'disabled', '""');
+ track.track.mode = null;
+ assert_equals(track.track.mode, 'disabled', 'null');
+ track.track.mode = undefined;
+ assert_equals(track.track.mode, 'disabled', 'undefined');
+ track.track.mode = 'showing';
+ assert_equals(track.track.mode, 'showing', 'showing (correct value)');
+ track.track.mode = 'DISABLED';
+ assert_equals(track.track.mode, 'showing', '"DISABLED"');
+ track.track.mode = 'd\u0130sabled'; // dotted uppercase i
+ assert_equals(track.track.mode, 'showing', '"d\u0130sabled" (dotted uppercase i)');
+ track.track.mode = 'd\u0131sabled'; // dotless lowercase i
+ assert_equals(track.track.mode, 'showing', '"d\u0131sabled" (dotless lowercase i)');
+ track.track.mode = 'disabled ';
+ assert_equals(track.track.mode, 'showing', '"disabled "');
+ track.track.mode = ' disabled';
+ assert_equals(track.track.mode, 'showing', '" disabled"');
+ track.track.mode = {};
+ assert_equals(track.track.mode, 'showing', '{}');
+ track.track.mode = 'HIDDEN';
+ assert_equals(track.track.mode, 'showing', '"HIDDEN"');
+ track.track.mode = 'h\u0130dden'; // dotted uppercase i
+ assert_equals(track.track.mode, 'showing', '"h\u0130dden" (dotted uppercase i)');
+ track.track.mode = 'h\u0131dden'; // dotless lowercase i
+ assert_equals(track.track.mode, 'showing', '"h\u0131dden" (dotless lowercase i)');
+}, document.title+', wrong value');
+test(function() {
+ var track = document.createElement('track');
+ assert_equals(track.track.mode, 'disabled', 'initial');
+ track.track.mode = 'disabled'; // no-op
+ assert_equals(track.track.mode, 'disabled', 'disabled (1)');
+ track.track.mode = 'hidden';
+ assert_equals(track.track.mode, 'hidden', 'hidden (1)');
+ track.track.mode = 'hidden'; // no-op
+ assert_equals(track.track.mode, 'hidden', 'hidden (2)');
+ track.track.mode = 'showing';
+ assert_equals(track.track.mode, 'showing', 'showing (1)');
+ track.track.mode = 'showing'; // no-op
+ assert_equals(track.track.mode, 'showing', 'showing (2)');
+ track.track.mode = {toString:function() { return 'disabled'; }};
+ assert_equals(track.track.mode, 'disabled', '{toString:...}');
+}, document.title+', correct value');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/oncuechange.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/oncuechange.html
new file mode 100644
index 000000000..16c76f948
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/oncuechange.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<title>TextTrack.oncuechange</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ window.t1 = video.addTextTrack('subtitles');
+ window.ev = new Event('cuechange');
+ window.ran = false;
+ window.cb = function() { ran = true; };
+});
+test(function(){
+ assert_equals(t1.oncuechange, null);
+ t1.oncuechange = cb;
+ t1.dispatchEvent(ev);
+ assert_true(ran);
+ t1.oncuechange = null;
+ ran = false;
+ t1.dispatchEvent(ev);
+ assert_false(ran);
+});
+test(function(){
+ t1.addEventListener('cuechange', cb, false);
+ t1.dispatchEvent(ev);
+ assert_true(ran);
+ t1.removeEventListener('cuechange', cb, false);
+ ran = false;
+ t1.dispatchEvent(ev);
+ assert_false(ran);
+}, 'TextTrack.addEventListener/removeEventListener');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/removeCue.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/removeCue.html
new file mode 100644
index 000000000..3623f44bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/removeCue.html
@@ -0,0 +1,50 @@
+<!doctype html>
+<title>TextTrack.removeCue()</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ document.body.appendChild(video);
+}, {timeout:5000});
+test(function() {
+ var t1 = video.addTextTrack('subtitles');
+ var t2 = video.addTextTrack('subtitles');
+ var c1 = new VTTCue(0, 1, 'text1');
+ assert_throws("NOT_FOUND_ERR", function() {
+ t1.removeCue(c1);
+ }, 'standalone');
+ t1.addCue(c1);
+ assert_throws("NOT_FOUND_ERR", function() {
+ t2.removeCue(c1);
+ }, 'listed in t1, remove from t2');
+ t1.removeCue(c1);
+ assert_throws("NOT_FOUND_ERR", function() {
+ t1.removeCue(c1);
+ }, 'standalone, remove from t1');
+ assert_throws("NOT_FOUND_ERR", function() {
+ t2.removeCue(c1);
+ }, 'standalone, remove from t2');
+}, document.title+', two elementless tracks');
+var t = async_test(document.title+', cue from track element');
+t.step(function(){
+ var t1 = video.addTextTrack('subtitles');
+ var track = document.createElement('track');
+ track.onload = t.step_func(function(){
+ var cue = track.track.cues[0];
+ assert_throws('NOT_FOUND_ERR', function() { t1.removeCue(cue); }, 'listed in track.track, remove from t1');
+ track.track.removeCue(cue);
+ assert_throws('NOT_FOUND_ERR', function() { track.track.removeCue(cue); }, 'standalone, remove from track.track');
+ assert_throws('NOT_FOUND_ERR', function() { t1.removeCue(cue); }, 'standalone, remove from t1');
+ t.done();
+ });
+ track.onerror = t.step_func(function() {
+ assert_unreached('got error event');
+ });
+ track.src= 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:01.000\ntest\n');
+ track.kind = 'subtitles';
+ track.track.mode = 'hidden';
+ video.appendChild(track);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/endTime.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/endTime.html
new file mode 100644
index 000000000..b99a12e05
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/endTime.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<title>TextTrackCue.endTime</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ window.t1 = video.addTextTrack('subtitles');
+ document.body.appendChild(video);
+});
+test(function(){
+ var c1 = new VTTCue(-2, -1, 'text1');
+ assert_equals(c1.endTime, -1);
+ c1.endTime = c1.endTime;
+ assert_equals(c1.endTime, -1);
+ assert_throws(new TypeError(), function(){ c1.endTime = NaN; });
+ assert_throws(new TypeError(), function(){ c1.endTime = +Infinity; });
+ assert_throws(new TypeError(), function(){ c1.endTime = -Infinity; });
+}, document.title+', script-created cue');
+
+var t_parsed = async_test(document.title+', parsed cue');
+t_parsed.step(function(){
+ var t = document.createElement('track');
+ t.onload = this.step_func(function(){
+ var c = t.track.cues;
+ assert_equals(c[0].endTime, 0.001);
+ assert_equals(c[1].endTime, 3600.001);
+ this.done();
+ });
+ t.onerror = this.step_func(function() {
+ assert_unreached('got error event');
+ });
+ t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest'+
+ '\n\nfoobar\n01:00:00.000 --> 01:00:00.001\ntest');
+ t.track.mode = 'showing';
+ video.appendChild(t);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/id.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/id.html
new file mode 100644
index 000000000..a88f94766
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/id.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<title>TextTrackCue.id</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ window.t1 = video.addTextTrack('subtitles');
+ document.body.appendChild(video);
+});
+test(function(){
+ var c1 = new VTTCue(0, 1, 'text1');
+ c1.id = 'id1\r\n\u0000';
+ assert_equals(c1.id, 'id1\r\n\u0000');
+ c1.id = c1.id;
+ assert_equals(c1.id, 'id1\r\n\u0000');
+ c1.id = null;
+ assert_equals(c1.id, 'null');
+}, document.title+', script-created cue');
+
+var t_parsed = async_test(document.title+', parsed cue');
+t_parsed.step(function(){
+ var t = document.createElement('track');
+ t.onload = this.step_func(function(){
+ var c = t.track.cues;
+ assert_equals(c[0].id, '');
+ assert_equals(c[1].id, 'foobar');
+ this.done();
+ });
+ t.onerror = this.step_func(function() {
+ assert_unreached('got error event');
+ });
+ t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest'+
+ '\n\nfoobar\n00:00:00.000 --> 00:00:00.001\ntest');
+ t.track.mode = 'showing';
+ video.appendChild(t);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/onenter.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/onenter.html
new file mode 100644
index 000000000..17deed053
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/onenter.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<title>TextTrackCue.onenter</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.c1 = new VTTCue(0, 1, 'text1');
+ window.ev = new Event('enter');
+ window.ran = false;
+ window.cb = function() { ran = true; };
+});
+test(function(){
+ assert_equals(c1.onenter, null, 'initial value');
+ c1.onenter = undefined;
+ assert_equals(c1.onenter, null, 'assigning undefined');
+ c1.onenter = cb;
+ assert_equals(c1.onenter, cb, 'assigning onenter');
+ c1.dispatchEvent(ev);
+ assert_true(ran, 'dispatching event');
+ c1.onenter = null;
+ assert_equals(c1.onenter, null, 'assigning null');
+ ran = false;
+ c1.dispatchEvent(ev);
+ assert_false(ran, 'dispatching event after nulling onenter');
+});
+test(function(){
+ c1.addEventListener('enter', cb, false);
+ c1.dispatchEvent(ev);
+ assert_true(ran);
+ c1.removeEventListener('enter', cb, false);
+ ran = false;
+ c1.dispatchEvent(ev);
+ assert_false(ran);
+}, 'TextTrackCue.addEventListener/removeEventListener');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/onexit.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/onexit.html
new file mode 100644
index 000000000..815377e4d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/onexit.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<title>TextTrackCue.onexit</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.c1 = new VTTCue(0, 1, 'text1');
+ window.ev = new Event('exit');
+ window.ran = false;
+ window.cb = function() { ran = true; };
+});
+test(function(){
+ assert_equals(c1.onexit, null, 'initial value');
+ c1.onexit = undefined;
+ assert_equals(c1.onexit, null, 'assigning undefined');
+ c1.onexit = cb;
+ assert_equals(c1.onexit, cb, 'assigning onexit');
+ c1.dispatchEvent(ev);
+ assert_true(ran, 'dispatching event');
+ c1.onexit = null;
+ assert_equals(c1.onexit, null, 'assigning null');
+ ran = false;
+ c1.dispatchEvent(ev);
+ assert_false(ran, 'dispatching event after nulling onexit');
+});
+test(function(){
+ c1.addEventListener('exit', cb, false);
+ c1.dispatchEvent(ev);
+ assert_true(ran);
+ c1.removeEventListener('exit', cb, false);
+ ran = false;
+ c1.dispatchEvent(ev);
+ assert_false(ran);
+}, 'TextTrackCue.addEventListener/removeEventListener');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/pauseOnExit.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/pauseOnExit.html
new file mode 100644
index 000000000..31ea4c63b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/pauseOnExit.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<title>TextTrackCue.pauseOnExit</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ window.t1 = video.addTextTrack('subtitles');
+ document.body.appendChild(video);
+});
+test(function(){
+ var c1 = new VTTCue(0, 1, 'text1');
+ assert_equals(c1.pauseOnExit, false);
+ c1.pauseOnExit = null;
+ assert_equals(c1.pauseOnExit, false);
+ c1.pauseOnExit = 'foo';
+ assert_equals(c1.pauseOnExit, true);
+}, document.title+', script-created cue');
+
+var t_parsed = async_test(document.title+', parsed cue');
+t_parsed.step(function(){
+ var t = document.createElement('track');
+ t.onload = this.step_func(function(){
+ var c1 = t.track.cues[0];
+ assert_equals(c1.pauseOnExit, false);
+ c1.pauseOnExit = null;
+ assert_equals(c1.pauseOnExit, false);
+ c1.pauseOnExit = 'foo';
+ assert_equals(c1.pauseOnExit, true);
+ this.done();
+ });
+ t.onerror = this.step_func(function() {
+ assert_unreached('got error event');
+ });
+ t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest');
+ t.track.mode = 'showing';
+ video.appendChild(t);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/startTime.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/startTime.html
new file mode 100644
index 000000000..232a7f23b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/startTime.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<title>TextTrackCue.startTime</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ window.t1 = video.addTextTrack('subtitles');
+ document.body.appendChild(video);
+});
+test(function(){
+ var c1 = new VTTCue(-1, 1, 'text1');
+ assert_equals(c1.startTime, -1);
+ c1.startTime = c1.startTime;
+ assert_equals(c1.startTime, -1);
+ assert_throws(new TypeError(), function(){ c1.startTime = NaN; });
+ assert_throws(new TypeError(), function(){ c1.startTime = +Infinity; });
+ assert_throws(new TypeError(), function(){ c1.startTime = -Infinity; });
+}, document.title+', script-created cue');
+
+var t_parsed = async_test(document.title+', parsed cue');
+t_parsed.step(function(){
+ var t = document.createElement('track');
+ t.onload = this.step_func(function(){
+ var c = t.track.cues;
+ assert_equals(c[0].startTime, 0);
+ assert_equals(c[1].startTime, 3600);
+ this.done();
+ });
+ t.onerror = this.step_func(function() {
+ assert_unreached('got error event');
+ });
+ t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest'+
+ '\n\nfoobar\n01:00:00.000 --> 01:00:00.001\ntest');
+ t.track.mode = 'showing';
+ video.appendChild(t);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/track.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/track.html
new file mode 100644
index 000000000..219e3e703
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/track.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<title>TextTrackCue.track</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ window.t1 = video.addTextTrack('subtitles');
+ document.body.appendChild(video);
+});
+test(function(){
+ var c1 = new VTTCue(0, 1, 'text1');
+ assert_equals(c1.track, null);
+ t1.addCue(c1);
+ assert_equals(c1.track, t1);
+ t1.removeCue(c1);
+ assert_equals(c1.track, null);
+}, document.title+', script-created cue');
+
+var t_parsed = async_test(document.title+', parsed cue');
+t_parsed.step(function(){
+ var t = document.createElement('track');
+ t.onload = this.step_func(function(){
+ var c = t.track.cues[0];
+ assert_equals(c.track, t.track);
+ t.track.removeCue(c);
+ assert_equals(c.track, null);
+ this.done();
+ });
+ t.onerror = this.step_func(function() {
+ assert_unreached('got error event');
+ });
+ t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest');
+ t.track.mode = 'showing';
+ video.appendChild(t);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/getCueById.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/getCueById.html
new file mode 100644
index 000000000..8184189b0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/getCueById.html
@@ -0,0 +1,53 @@
+<!doctype html>
+<title>TextTrackCueList.getCueById</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var video = document.createElement('video');
+ var t = video.addTextTrack('subtitles');
+ document.body.appendChild(video);
+ var cues = t.cues;
+ var c = new VTTCue(0, 1, 'text1');
+ t.addCue(c);
+ assert_equals(cues.getCueById(""), null, '""');
+ assert_equals(cues.getCueById(null), null, 'null');
+ assert_equals(cues.getCueById(undefined), null, 'undefined');
+}, document.title+ ', no id');
+test(function(){
+ var video = document.createElement('video');
+ var t = video.addTextTrack('subtitles');
+ document.body.appendChild(video);
+ var cues = t.cues;
+ var c = new VTTCue(0, 1, 'text1');
+ c.id = 'foo';
+ t.addCue(c);
+ assert_equals(cues.getCueById(""), null, '""');
+ assert_equals(cues.getCueById("foo"), c, '"foo"');
+ assert_equals(cues.getCueById({toString:function(){return "foo"}}), c, 'object');
+}, document.title+ ', id foo');
+test(function(){
+ var video = document.createElement('video');
+ var t = video.addTextTrack('subtitles');
+ document.body.appendChild(video);
+ var cues = t.cues;
+ var c = new VTTCue(0, 1, 'text1');
+ c.id = '1';
+ t.addCue(c);
+ assert_equals(cues.getCueById(""), null, '""');
+ assert_equals(cues.getCueById("1"), c, '"1"');
+ assert_equals(cues.getCueById(1), c, '1');
+}, document.title+ ', no 1');
+test(function(){
+ var video = document.createElement('video');
+ var t = video.addTextTrack('subtitles');
+ document.body.appendChild(video);
+ var cues = t.cues;
+ var c = new VTTCue(0, 1, 'text1');
+ c.id = 'a\u0000b';
+ t.addCue(c);
+ assert_equals(cues.getCueById("a\u0000b"), c, '"a\\u0000b"');
+ assert_equals(cues.getCueById("a"), null, '"a"');
+}, document.title+ ', id a\\u0000b');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/getter.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/getter.html
new file mode 100644
index 000000000..d9cd87172
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/getter.html
@@ -0,0 +1,49 @@
+<!doctype html>
+<title>TextTrackCueList getter</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ window.t1 = video.addTextTrack('subtitles');
+ document.body.appendChild(video);
+});
+test(function(){
+ var cues = t1.cues;
+ assert_equals(cues[0], undefined, 'cues[0] before');
+ var c1 = new VTTCue(0, 1, 'text1');
+ t1.addCue(c1);
+ assert_equals(cues[0], c1, 'cues[0]');
+ assert_equals(cues[1], undefined, 'cues[1]');
+ assert_equals(cues[-1], undefined, 'cues[-1]');
+ t1.removeCue(c1);
+ assert_equals(cues[0], undefined, 'cues[0] after');
+});
+test(function(){
+ var cues = t1.cues;
+ assert_equals(cues[0], undefined);
+ cues[0] = 'foo';
+ assert_equals(cues[0], undefined);
+ var c1 = new VTTCue(0, 1, 'text1');
+ t1.addCue(c1);
+ assert_equals(cues[0], c1);
+ cues[0] = 'foo';
+ assert_equals(cues[0], c1);
+ t1.removeCue(c1);
+}, document.title+', no indexed set/create');
+test(function(){
+ 'use strict';
+ var cues = t1.cues;
+ assert_equals(cues[0], undefined);
+ assert_throws(new TypeError(), function() { cues[0] = 'foo'; });
+ assert_equals(cues[0], undefined);
+ var c1 = new VTTCue(0, 1, 'text1');
+ t1.addCue(c1);
+ assert_equals(cues[0], c1);
+ assert_throws(new TypeError(), function() { cues[0] = 'foo'; });
+ assert_equals(cues[0], c1);
+ t1.removeCue(c1);
+}, document.title+', no indexed set/create (strict)');
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/length.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/length.html
new file mode 100644
index 000000000..91e6e7ff9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/length.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>TextTrackCueList.length</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ window.t1 = video.addTextTrack('subtitles');
+ document.body.appendChild(video);
+});
+test(function(){
+ var cues = t1.cues;
+ assert_equals(cues.length, 0);
+ var c1 = new VTTCue(0, 1, 'text1');
+ t1.addCue(c1);
+ assert_equals(cues.length, 1);
+ t1.removeCue(c1);
+ assert_equals(cues.length, 0);
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getTrackById.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getTrackById.html
new file mode 100644
index 000000000..b701dd5e7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getTrackById.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>TextTrackList.getTrackById</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var video = document.createElement('video');
+ var track1 = video.addTextTrack('subtitles');
+ var track2 = video.addTextTrack('subtitles');
+ assert_equals(track1.id, '');
+ assert_equals(track2.id, '');
+ assert_equals(video.textTracks.getTrackById(''), track1);
+ assert_equals(video.textTracks.getTrackById('fake-id'), null);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html
new file mode 100644
index 000000000..8c5fb3759
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<title>TextTrackList getter</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ video.addTextTrack('subtitles', 'b');
+ window.track = document.createElement('track');
+ track.label = 'a';
+ video.appendChild(track);
+ video.addTextTrack('subtitles', 'c');
+});
+test(function(){
+ assert_equals(video.textTracks[0].label, 'a');
+ assert_equals(video.textTracks[1].label, 'b');
+ assert_equals(video.textTracks[2].label, 'c');
+});
+test(function(){
+ var track_before = video.textTracks[0];
+ video.textTracks[0] = 'foo';
+ assert_equals(video.textTracks[0], track_before);
+}, document.title+', no indexed set/create');
+test(function(){
+ 'use strict';
+ var track_before = video.textTracks[0];
+ assert_throws(new TypeError(), function(){ video.textTracks[0] = 'foo'; });
+ assert_equals(video.textTracks[0], track_before);
+}, document.title+', no indexed set/create (strict)');
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/length.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/length.html
new file mode 100644
index 000000000..7a24130d1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/length.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>TextTrackList.length</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.video = document.createElement('video');
+ video.addTextTrack('subtitles');
+ window.track = document.createElement('track');
+ video.appendChild(track);
+ video.addTextTrack('subtitles');
+});
+test(function(){
+ assert_equals(video.textTracks.length, 3);
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/onaddtrack.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/onaddtrack.html
new file mode 100644
index 000000000..114ca8904
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/onaddtrack.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<title>TextTrackList.onaddtrack</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.tracks = document.createElement('video').textTracks;
+ window.ev = new Event('addtrack');
+ window.ran = false;
+ window.cb = function() { ran = true; };
+});
+test(function(){
+ assert_equals(tracks.onaddtrack, null);
+ tracks.onaddtrack = cb;
+ assert_equals(tracks.onaddtrack, cb);
+ tracks.dispatchEvent(ev);
+ assert_true(ran);
+ tracks.onaddtrack = null;
+ ran = false;
+ tracks.dispatchEvent(ev);
+ assert_false(ran);
+});
+test(function(){
+ tracks.addEventListener('addtrack', cb, false);
+ tracks.dispatchEvent(ev);
+ assert_true(ran);
+ tracks.removeEventListener('addtrack', cb, false);
+ ran = false;
+ tracks.dispatchEvent(ev);
+ assert_false(ran);
+}, 'TextTrackList.addEventListener/removeEventListener');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/onremovetrack.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/onremovetrack.html
new file mode 100644
index 000000000..b8da16ce2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackList/onremovetrack.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<title>TextTrackList.onremovetrack</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+setup(function(){
+ window.tracks = document.createElement('video').textTracks;
+ window.ev = new Event('removetrack');
+ window.ran = false;
+ window.cb = function() { ran = true; };
+});
+test(function(){
+ assert_equals(tracks.onremovetrack, null);
+ tracks.onremovetrack = cb;
+ assert_equals(tracks.onremovetrack, cb);
+ tracks.dispatchEvent(ev);
+ assert_true(ran);
+ tracks.onremovetrack = null;
+ ran = false;
+ tracks.dispatchEvent(ev);
+ assert_false(ran);
+});
+test(function(){
+ tracks.addEventListener('removetrack', cb, false);
+ tracks.dispatchEvent(ev);
+ assert_true(ran);
+ tracks.removeEventListener('removetrack', cb, false);
+ ran = false;
+ tracks.dispatchEvent(ev);
+ assert_false(ran);
+}, 'TextTrackList.addEventListener/removeEventListener');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TrackEvent/constructor.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TrackEvent/constructor.html
new file mode 100644
index 000000000..54567d14a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TrackEvent/constructor.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<title>TrackEvent constructor</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ var ev = new TrackEvent('foo');
+ assert_true(ev instanceof TrackEvent, 'ev instanceof TrackEvent');
+ assert_true(ev instanceof Event, 'ev instanceof Event');
+ assert_equals(ev.track, null, 'ev.track');
+ ev.track = {};
+ assert_equals(ev.track, null, 'ev.track after assignment');
+}, document.title+', one arg');
+test(function(){
+ var obj = {};
+ var ev = new TrackEvent('foo', {track:obj});
+ assert_true(ev instanceof TrackEvent, 'ev instanceof TrackEvent');
+ assert_true(ev instanceof Event, 'ev instanceof Event');
+ assert_equals(ev.track, obj, 'ev.track');
+ ev.track = {};
+ assert_equals(ev.track, obj, 'ev.track after assignment');
+}, document.title+', two args');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TrackEvent/createEvent.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TrackEvent/createEvent.html
new file mode 100644
index 000000000..9bf763f1f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TrackEvent/createEvent.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<title>TrackEvent created with createEvent</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function(){
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=17268
+ assert_throws('NOT_SUPPORTED_ERR', function() {
+ var ev = document.createEvent('TrackEvent');
+ });
+ var ev = new TrackEvent('foo');
+ assert_false('initTrackEvent' in ev, 'initTrackEvent');
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/autoplay-overrides-preload.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/autoplay-overrides-preload.html
new file mode 100644
index 000000000..91103c586
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/autoplay-overrides-preload.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<title>autoplay overrides preload</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<div id=log></div>
+<script>
+['none', 'metadata'].forEach(function(preload) {
+ ['first', 'last'].forEach(function(order) {
+ async_test(function(t) {
+ var a = document.createElement('audio');
+ a.src = getAudioURI('/media/sound_5');
+ if (order == 'first') {
+ a.autoplay = true;
+ a.preload = preload;
+ } else {
+ a.preload = preload;
+ a.autoplay = true;
+ }
+ a.addEventListener('playing', t.step_func(function() {
+ assert_equals(a.readyState, a.HAVE_ENOUGH_DATA);
+ assert_false(a.paused);
+ t.done();
+ }));
+ }, 'autoplay (set ' + order + ') overrides preload "' + preload + '"');
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/load-events-networkState.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/load-events-networkState.html
new file mode 100644
index 000000000..8c12011ef
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/load-events-networkState.html
@@ -0,0 +1,67 @@
+<!doctype html>
+<title>load() fires abort/emptied events when networkState is not NETWORK_EMPTY</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<div id=log></div>
+<script>
+function load_test(t, v) {
+ assert_not_equals(v.networkState, v.NETWORK_EMPTY);
+
+ var expected_events = [];
+ if (v.networkState == v.NETWORK_LOADING || v.networkState == v.NETWORK_IDLE) {
+ expected_events.push('abort');
+ }
+ if (v.networkState != v.NETWORK_EMPTY) {
+ expected_events.push('emptied');
+ }
+
+ var actual_events = [];
+ v.onabort = v.onemptied = t.step_func(function(e) {
+ actual_events.push(e.type);
+ });
+
+ v.onloadstart = t.step_func(function() {
+ assert_array_equals(actual_events, expected_events);
+ t.done();
+ });
+
+ v.load();
+
+ assert_array_equals(actual_events, [], 'events should be fired in queued tasks');
+}
+
+async_test(function(t) {
+ var v = document.createElement('video');
+ // suspend is fired optionally "if the user agent intends to not attempt to
+ // fetch the resource" or "once the entire media resource has been fetched"
+ v.preload = 'none';
+ v.src = getAudioURI('/media/sound_5');
+ v.onsuspend = t.step_func(function() {
+ v.onsuspend = null;
+ assert_equals(v.networkState, v.NETWORK_IDLE);
+ load_test(t, v);
+ });
+}, 'NETWORK_IDLE');
+
+async_test(function(t) {
+ var v = document.createElement('video');
+ v.src = 'resources/delayed-broken-video.py';
+ v.onloadstart = t.step_func(function() {
+ v.onloadstart = null;
+ assert_equals(v.networkState, v.NETWORK_LOADING);
+ load_test(t, v);
+ });
+}, 'NETWORK_LOADING');
+
+async_test(function(t) {
+ var v = document.createElement('video');
+ v.src = 'data:,';
+ v.onerror = t.step_func(function() {
+ v.onerror = null;
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE);
+ load_test(t, v);
+ });
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE);
+}, 'NETWORK_NO_SOURCE');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/load-removes-queued-error-event.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/load-removes-queued-error-event.html
new file mode 100644
index 000000000..54d5c28da
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/load-removes-queued-error-event.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<title>load() removes queued error event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+// The loadstart and error event firing tasks are queued in the synchronous
+// section of the resource selection algorithm, so no tasks can come between
+// them. Calling load() in the loadstart event handler removes the queued error
+// event task at very latest opportunity, failing any implementation that fires
+// the events in the same task.
+
+async_test(function(t) {
+ var v = document.createElement('video');
+ var events = [];
+ v.onloadstart = v.onerror = t.step_func(function(e) {
+ events.push(e.type);
+ if (events.length == 1) {
+ v.load();
+ } else if (events.length == 3) {
+ assert_array_equals(events, ['loadstart', 'loadstart', 'error']);
+ t.done();
+ }
+ });
+ v.src = '';
+}, 'video error event');
+
+async_test(function(t) {
+ var v = document.createElement('video');
+ var s = document.createElement('source');
+ var events = [];
+ v.onloadstart = s.onerror = t.step_func(function(e) {
+ events.push(e.type);
+ if (events.length == 1) {
+ v.load();
+ } else if (events.length == 3) {
+ assert_array_equals(events, ['loadstart', 'loadstart', 'error']);
+ t.done();
+ }
+ });
+ v.onerror = t.step_func(function() { assert_unreached(); });
+ v.appendChild(s);
+}, 'source error event');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-insert-before.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-insert-before.html
new file mode 100644
index 000000000..39c988750
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-insert-before.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>inserting another source before the candidate</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var v;
+function createSource(src) {
+ var source = document.createElement('source');
+ source.src = src;
+ return source;
+}
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ v.addEventListener('loadstart', t.step_func(function() {
+ assert_equals(v.currentSrc.substr(v.currentSrc.lastIndexOf('#')), '#a');
+ t.done();
+ }), false);
+ v.appendChild(createSource('#a')); // invokes resource selection
+});
+</script>
+<!-- now resource selection algorithm will continue its sync section (the </script> tag below provides a stable state) -->
+<!-- #a is candidate -->
+<!-- pointer is between #a and the end of the list -->
+<script>
+t.step(function() {
+ v.insertBefore(createSource('#b'), v.firstChild); // pointer is unchanged, #a is still candidate
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-moved.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-moved.html
new file mode 100644
index 000000000..f59452e0d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-moved.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>moving the candidate source</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var s;
+var t = async_test(function(t) {
+ var v = document.createElement('video');
+ s = document.createElement('source');
+ s.src = 'resources/delayed-broken-video.py';
+ s.onerror = t.step_func(function() { t.done(); });
+ v.appendChild(s); // invokes resource selection
+ onload = t.step_func(function() { assert_unreached(); });
+});
+</script>
+<script>
+t.step(function() {
+ document.body.appendChild(s);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-addEventListener.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-addEventListener.html
new file mode 100644
index 000000000..0c1e6f0ad
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-addEventListener.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>removing the candidate source, addEventListener</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var v;
+function createSource(src) {
+ var source = document.createElement('source');
+ source.src = src;
+ return source;
+}
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ v.appendChild(createSource('resources/delayed-broken-video.py')); // invokes resource selection
+ v.firstChild.addEventListener('error', t.step_func(function() { t.done(); }), false);
+});
+</script>
+<!-- now resource selection algorithm will continue its sync section (the </script> tag below provides a stable state) -->
+<!-- the <source> is candidate -->
+<!-- pointer is between the <source> and the end of the list -->
+<script>
+t.step(function() {
+ v.removeChild(v.firstChild); // tests that we fire 'error' on it despite being removed
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-no-listener.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-no-listener.html
new file mode 100644
index 000000000..f384eb312
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-no-listener.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>removing the candidate source, no listener</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var v;
+function createSource(src) {
+ var source = document.createElement('source');
+ source.src = src;
+ return source;
+}
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ v.appendChild(createSource('resources/delayed-broken-video.py')); // invokes resource selection
+});
+</script>
+<!-- now resource selection algorithm will continue its sync section (the </script> tag below provides a stable state) -->
+<!-- the <source> is candidate -->
+<!-- pointer is between the <source> and the end of the list -->
+<script>
+t.step(function() {
+ v.removeChild(v.firstChild); // just tests that we don't crash
+ onload = t.step_func(function() { t.done(); });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-onerror.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-onerror.html
new file mode 100644
index 000000000..c295c85bf
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-onerror.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>removing the candidate source, onerror</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var v;
+function createSource(src) {
+ var source = document.createElement('source');
+ source.src = src;
+ return source;
+}
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ v.appendChild(createSource('resources/delayed-broken-video.py')); // invokes resource selection
+ v.firstChild.onerror = t.step_func(function() { t.done(); });
+});
+</script>
+<!-- now resource selection algorithm will continue its sync section (the </script> tag below provides a stable state) -->
+<!-- the <source> is candidate -->
+<!-- pointer is between the <source> and the end of the list -->
+<script>
+t.step(function() {
+ v.removeChild(v.firstChild); // tests that we fire 'error' on it despite being removed
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-audio-constructor-no-src.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-audio-constructor-no-src.html
new file mode 100644
index 000000000..cb2a57959
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-audio-constructor-no-src.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<title>NOT invoking resource selection with new Audio() sans src</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+async_test(function(t) {
+ var a = new Audio();
+ assert_equals(a.networkState, a.NETWORK_EMPTY);
+ a.onloadstart = t.step_func(function() { assert_unreached(); });
+ window.onload = t.step_func(function() { t.done(); });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-audio-constructor.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-audio-constructor.html
new file mode 100644
index 000000000..662129756
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-audio-constructor.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<title>invoking resource selection with new Audio(src)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+async_test(function(t) {
+ var a = new Audio('');
+ a.onloadstart = t.step_func(function() { t.done(); });
+ window.onload = t.step_func(function() { assert_unreached(); });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-in-sync-event.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-in-sync-event.html
new file mode 100644
index 000000000..55fc7c20d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-in-sync-event.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<title>await a stable state and sync event handlers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<video></video>
+<script>
+var v;
+var t = async_test(function(t) {
+ v = document.querySelector('video');
+ var a = document.createElement('a');
+ a.onclick = t.step_func(function() {
+ v.setAttribute('src', '#'); // invokes media load which invokes resource selection
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState in onclick handler');
+ });
+ a.click(); // sync fires click, so sets src
+ // now we should still await a stable state because the script hasn't
+ // finished, the event handler has just returned
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after click()');
+ v.removeAttribute('src');
+});
+</script>
+<script>
+t.step(function() {
+ // now the sync section of resource selection should have run and should
+ // have found no src="" or <source> thus networkState being set to NETWORK_EMPTY.
+ // if the sync section was run when onclick returned, then networkState
+ // would be either NETWORK_LOADING or NETWORK_NO_SOURCE.
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState in separate script');
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-fragment-into-document.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-fragment-into-document.html
new file mode 100644
index 000000000..5d4c32f67
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-fragment-into-document.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>NOT invoking resource selection by inserting document fragment into a document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var v;
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ var fragment = document.createDocumentFragment();
+ fragment.appendChild(v);
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState after fragment.appendChild(v)');
+ document.body.appendChild(fragment);
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState after document.body.appendChild(fragment)');
+});
+</script>
+<script>
+t.step(function() {
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState in separate script');
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-into-document.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-into-document.html
new file mode 100644
index 000000000..2f9ec978a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-into-document.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<title>NOT invoking resource selection by inserting into a document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function(t) {
+ var v = document.createElement('video');
+ document.body.appendChild(v);
+ assert_equals(v.networkState, v.NETWORK_EMPTY);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-into-iframe.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-into-iframe.html
new file mode 100644
index 000000000..45d133d87
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-into-iframe.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>NOT invoking resource selection by inserting into other document with src set</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<iframe hidden></iframe>
+<script>
+async_test(function(t) {
+ var v = document.createElement('video');
+ v.src = 'data:,';
+ v.onerror = t.step_func(function() {
+ assert_equals(v.readyState, v.HAVE_NOTHING);
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE);
+ var iframe = document.querySelector('iframe');
+ iframe.contentDocument.body.appendChild(v);
+ v.onloadstart = t.step_func(function() { assert_unreached(); });
+ // wait for an event after the above
+ var v2 = document.createElement('video');
+ v2.src = 'data:,';
+ v2.onloadstart = t.step_func(function() { t.done(); });
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-parent-into-document.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-parent-into-document.html
new file mode 100644
index 000000000..6da34344f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-parent-into-document.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>NOT invoking resource selection by inserting parent into a document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+async_test(function(t) {
+ var v = document.createElement('video');
+ var div = document.createElement('div');
+ div.appendChild(v);
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState after div.appendChild(v)');
+ document.body.appendChild(div);
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState after document.body.appendChild(div)');
+ window.onload = t.step_func(function() {
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState in window.onload');
+ t.done();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-in-div.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-in-div.html
new file mode 100644
index 000000000..b79bea52f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-in-div.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>NOT invoking resource selection by inserting &lt;source> in &lt;div> in &lt;video></title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<video><div></div></video>
+<script>
+async_test(function(t) {
+ var v = document.querySelector('video');
+ v.onloadstart = t.step_func(function() { assert_unreached(); });
+ v.firstChild.appendChild(document.createElement('source'));
+ window.onload = t.step_func(function() { t.done(); });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-in-namespace.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-in-namespace.html
new file mode 100644
index 000000000..b73f229ec
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-in-namespace.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>NOT invoking resource selection by inserting &lt;source> in the wrong namespace</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<video></video>
+<script>
+async_test(function(t) {
+ var v = document.querySelector('video');
+ v.onloadstart = t.step_func(function() { assert_unreached(); });
+ v.appendChild(document.createElementNS('bogus','source'));
+ window.onload = t.step_func(function() { t.done(); });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-networkState.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-networkState.html
new file mode 100644
index 000000000..5ef6e4cb3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-networkState.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<title>NOT invoking resource selection by inserting &lt;source> when networkState is not NETWORK_EMPTY</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var loadstartCount = 0;
+var s1ErrorCount = 0;
+var s2ErrorCount = 0;
+var v;
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ v.onloadstart = function() { loadstartCount++; };
+ var s1 = document.createElement('source');
+ s1.src = 'resources/delayed-broken-video.py';
+ s1.onerror = function() { s1ErrorCount++; };
+ v.appendChild(s1); // invokes resource selection
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState in first script');
+});
+</script>
+<script>
+t.step(function() {
+ assert_equals(v.networkState, v.NETWORK_LOADING, 'networkState in second script');
+ assert_equals(s1ErrorCount, 0, 's1ErrorCount in second script');
+ var s2 = document.createElement('source');
+ s2.onerror = t.step_func(function() {
+ s2ErrorCount++;
+ assert_equals(s1ErrorCount, 1, 's1ErrorCount in s2.onerror');
+ });
+ v.appendChild(s2);
+ onload = t.step_func(function() {
+ assert_equals(s2ErrorCount, 1, 's2ErrorCount in window.onload');
+ assert_equals(loadstartCount, 1, 'loadstartCount in window.onload'); // reliable if https://www.w3.org/Bugs/Public/show_bug.cgi?id=24353 is fixed
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState in window.onload'); // See Waiting step
+ t.done();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-not-in-document.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-not-in-document.html
new file mode 100644
index 000000000..2007b2e8b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source-not-in-document.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<title>invoking resource selection by inserting &lt;source> in video not in a document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+async_test(function(t) {
+ var v = document.createElement('video');
+ v.onloadstart = t.step_func(function() { t.done(); });
+ v.appendChild(document.createElement('source'));
+ window.onload = t.step_func(function() { assert_unreached(); });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source.html
new file mode 100644
index 000000000..969daad62
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-insert-source.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>invoking resource selection by inserting &lt;source></title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<video></video>
+<script>
+async_test(function(t) {
+ var v = document.querySelector('video');
+ v.onloadstart = t.step_func(function() { t.done(); });
+ v.appendChild(document.createElement('source'));
+ window.onload = t.step_func(function() { assert_unreached(); });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-load.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-load.html
new file mode 100644
index 000000000..909c72cd1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-load.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>invoking resource selection with load()</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var v;
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState after creating v');
+ v.load();
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after v.load()');
+});
+</script>
+<script>
+t.step(function() {
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState in separate script');
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-pause-networkState.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-pause-networkState.html
new file mode 100644
index 000000000..18561a264
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-pause-networkState.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>NOT invoking resource selection with pause() when networkState is not NETWORK_EMPTY</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<video></video>
+<script>
+var v;
+var t = async_test(function(t) {
+ v = document.querySelector('video');
+ v.src = 'data:,';
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after setting src');
+ var errorCount = 0;
+ v.onerror = t.step_func(function() {
+ errorCount++;
+ if (errorCount == 1) {
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState in onerror');
+ v.pause(); // should not invoke RSA. if it does, error will be fired again.
+ } else {
+ assert_unreached();
+ }
+ });
+ onload = t.step_func(function() {
+ assert_equals(errorCount, 1, 'errorCount');
+ t.done();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-pause.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-pause.html
new file mode 100644
index 000000000..4f1bca74d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-pause.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>invoking resource selection with pause()</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var v;
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState after creating v');
+ v.pause();
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after v.pause()');
+});
+</script>
+<script>
+t.step(function() {
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState in separate script');
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-play.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-play.html
new file mode 100644
index 000000000..64a440080
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-play.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>invoking resource selection with play()</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var v;
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState after creating v');
+ v.play();
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after v.play()');
+});
+</script>
+<script>
+t.step(function() {
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState in separate script');
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-remove-from-document-networkState.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-remove-from-document-networkState.html
new file mode 100644
index 000000000..1eed276b2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-remove-from-document-networkState.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>NOT invoking resource selection with implicit pause() when networkState is not NETWORK_EMPTY</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<video></video>
+<script>
+var v;
+var t = async_test(function(t) {
+ v = document.querySelector('video');
+ v.src = 'data:,';
+ document.body.appendChild(v);
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after setting src');
+ var errorCount = 0;
+ v.onerror = t.step_func(function() {
+ errorCount++;
+ if (errorCount == 1) {
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState in onerror');
+ document.body.removeChild(v); // invokes pause() which should not invoke RSA. if it does, error will be fired again.
+ } else {
+ assert_unreached();
+ }
+ });
+ onload = t.step_func(function() {
+ assert_equals(errorCount, 1, 'errorCount');
+ t.done();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-remove-from-document.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-remove-from-document.html
new file mode 100644
index 000000000..23e7104ca
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-remove-from-document.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>NOT invoking resource selection by removing from document with NETWORK_EMPTY</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var v;
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ document.body.appendChild(v);
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState after appending v to document');
+ v.parentNode.removeChild(v); // search for "When a media element is removed from a Document,"
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState after removing v');
+});
+</script>
+<script>
+t.step(function() {
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState in separate script');
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-remove-src.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-remove-src.html
new file mode 100644
index 000000000..6302ffeac
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-remove-src.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>NOT invoking media load or resource selection when removing the src attribute</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var v;
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ v.setAttribute('src', ''); // invokes media load
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after setting src');
+ var s = document.createElement('source');
+ s.onerror = this.step_func(function() { assert_unreached(); });
+ v.appendChild(s); // src is present so nothing happens here
+ onload = this.step_func(function() { t.done(); });
+});
+</script>
+<script>
+t.step(function() {
+ v.removeAttribute('src'); // nothing should happen
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-in-namespace.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-in-namespace.html
new file mode 100644
index 000000000..438db124d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-in-namespace.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>NOT invoking load by setting src in the wrong namespace</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<video></video>
+<script>
+async_test(function(t) {
+ var v = document.querySelector('video');
+ v.onloadstart = t.step_func(function() { assert_unreached(); });
+ v.setAttributeNS('bogus','src', '');
+ window.onload = t.step_func(function() { t.done(); });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-networkState.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-networkState.html
new file mode 100644
index 000000000..e195dedb0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-networkState.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>invoking load by setting src when networkState is not NETWORK_EMPTY</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function(t) {
+ var v = document.createElement('video');
+ v.play(); // invokes resource selection and sets .paused to false
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState');
+ assert_false(v.paused, 'paused');
+ v.setAttribute('src', ''); // invokes media load which sets .paused to true
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after setting src');
+ assert_true(v.paused, 'paused after setting src');
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-not-in-document.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-not-in-document.html
new file mode 100644
index 000000000..f6c4f2406
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-not-in-document.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<title>invoking load by setting src on video not in a document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+async_test(function(t) {
+ var v = document.createElement('video');
+ v.onloadstart = t.step_func(function() { t.done(); });
+ v.setAttribute('src','');
+ window.onload = t.step_func(function() { assert_unreached(); });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src.html
new file mode 100644
index 000000000..e04b1b058
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>invoking load by setting src</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<video></video>
+<script>
+async_test(function(t) {
+ var v = document.querySelector('video');
+ v.onloadstart = t.step_func(function() { t.done(); });
+ v.setAttribute('src', '');
+ window.onload = t.step_func(function() { assert_unreached(); });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-control.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-control.html
new file mode 100644
index 000000000..dad5e5fd0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-control.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>pointer updates (control test)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var a = 0;
+var b = 0;
+var c = 0;
+</script>
+<video
+ ><source onerror=a++
+ ><source onerror=b++ src='resources/delayed-broken-video.py'
+ ><source onerror=c++
+ ></video
+>
+<script>
+async_test(function(t) {
+ window.onload = t.step_func(function() {
+ assert_equals(a, 1, 'error events on a');
+ assert_equals(b, 1, 'error events on b');
+ assert_equals(c, 1, 'error events on c');
+ t.done();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-insert-br.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-insert-br.html
new file mode 100644
index 000000000..3ee141e30
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-insert-br.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<title>pointer updates (adding br elements)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var a = 0;
+var b = 0;
+var c = 0;
+</script>
+<video
+ ><source onerror=a++
+ ><source onerror=b++ src='resources/delayed-broken-video.py'
+ ><source onerror=c++
+ ></video
+>
+<script>
+async_test(function(t) {
+ var video = document.querySelector('video');
+ // add br elements
+ var br = document.createElement('br');
+ video.insertBefore(br, video.querySelector('[onerror="a++"]'));
+ video.insertBefore(br.cloneNode(false), video.querySelector('[onerror="b++"]'));
+ video.insertBefore(br.cloneNode(false), video.querySelector('[onerror="c++"]'));
+ video.appendChild(br.cloneNode(false));
+ window.onload = t.step_func(function() {
+ assert_equals(a, 1, 'error events on a');
+ assert_equals(b, 1, 'error events on b');
+ assert_equals(c, 1, 'error events on c');
+ t.done();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-insert-source.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-insert-source.html
new file mode 100644
index 000000000..2d32e6fca
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-insert-source.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<title>pointer updates (adding source elements)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var a = 0;
+var b = 0;
+var c = 0;
+var x1 = 0;
+var x2 = 0;
+var x3 = 0;
+var x4 = 0;
+</script>
+<video
+ ><source onerror=a++
+ ><source onerror=b++ src='resources/delayed-broken-video.py'
+ ><source onerror=c++
+ ></video
+>
+<script>
+async_test(function(t) {
+ var video = document.querySelector('video');
+ // add source elements
+ var source1 = document.createElement('source'); source1.onerror = function() { x1++; };
+ var source2 = document.createElement('source'); source2.onerror = function() { x2++; };
+ var source3 = document.createElement('source'); source3.onerror = function() { x3++; };
+ var source4 = document.createElement('source'); source4.onerror = function() { x4++; };
+ video.insertBefore(source1, video.querySelector('[onerror="a++"]'));
+ video.insertBefore(source2, video.querySelector('[onerror="b++"]'));
+ video.insertBefore(source3, video.querySelector('[onerror="c++"]'));
+ video.appendChild(source4);
+ window.onload = t.step_func(function() {
+ assert_equals(a, 1, 'error events on a');
+ assert_equals(b, 1, 'error events on b');
+ assert_equals(c, 1, 'error events on c');
+ assert_equals(x1, 0, 'error events on x1');
+ assert_equals(x2, 0, 'error events on x2');
+ assert_equals(x3, 1, 'error events on x3');
+ assert_equals(x4, 1, 'error events on x4');
+ t.done();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-insert-text.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-insert-text.html
new file mode 100644
index 000000000..15a4e4be0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-insert-text.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<title>pointer updates (adding text nodes)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var a = 0;
+var b = 0;
+var c = 0;
+</script>
+<video
+ ><source onerror=a++
+ ><source onerror=b++ src='resources/delayed-broken-video.py'
+ ><source onerror=c++
+ ></video
+>
+<script>
+async_test(function(t) {
+ var video = document.querySelector('video');
+ // add text nodes
+ var text = document.createTextNode('x');
+ video.insertBefore(text, video.querySelector('[onerror="a++"]'));
+ video.insertBefore(text.cloneNode(false), video.querySelector('[onerror="b++"]'));
+ video.insertBefore(text.cloneNode(false), video.querySelector('[onerror="c++"]'));
+ video.appendChild(text.cloneNode(false));
+ window.onload = t.step_func(function() {
+ assert_equals(a, 1, 'error events on a');
+ assert_equals(b, 1, 'error events on b');
+ assert_equals(c, 1, 'error events on c');
+ t.done();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-remove-source-after.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-remove-source-after.html
new file mode 100644
index 000000000..0d1c94037
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-remove-source-after.html
@@ -0,0 +1,56 @@
+<!doctype html>
+<title>pointer updates (removing source element after pointer)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var a = 0;
+var b = 0;
+var c = 0;
+var x1 = 0;
+var x2 = 0;
+var x3 = 0;
+var x4 = 0;
+</script>
+<video
+ ><source onerror=a++
+ ><source onerror=b++ src='resources/delayed-broken-video.py'
+ ><source onerror=x1++
+ ><source onerror=x2++
+ ><source onerror=x3++
+ ><source onerror=x4++
+ ><source onerror=c++
+ ></video
+>
+<script>
+var v;
+var t = async_test(function(t) {
+ v = document.querySelector('video');
+ v.removeChild(document.querySelector('[onerror="x1++"]'));
+ window.onload = t.step_func(function() {
+ assert_equals(a, 1, 'error events on a');
+ assert_equals(b, 1, 'error events on b');
+ assert_equals(c, 1, 'error events on c');
+ assert_equals(x1, 0, 'error events on x1');
+ assert_equals(x2, 0, 'error events on x2');
+ assert_equals(x3, 0, 'error events on x3');
+ assert_equals(x4, 0, 'error events on x4');
+ t.done();
+ });
+});
+</script>
+<script>
+t.step(function() {
+ v.removeChild(document.querySelector('[onerror="x2++"]'));
+});
+</script>
+<script>
+t.step(function() {
+ v.removeChild(document.querySelector('[onerror="x3++"]'));
+});
+</script>
+<script>
+t.step(function() {
+ v.removeChild(document.querySelector('[onerror="x4++"]'));
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-remove-source.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-remove-source.html
new file mode 100644
index 000000000..191f9b5e2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-remove-source.html
@@ -0,0 +1,43 @@
+<!doctype html>
+<title>pointer updates (removing source elements)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var a = 0;
+var b = 0;
+var c = 0;
+var x1 = 0;
+var x2 = 0;
+var x3 = 0;
+var x4 = 0;
+</script>
+<video
+ ><source onerror=x1++
+ ><source onerror=a++
+ ><source onerror=x2++
+ ><source onerror=b++ src='resources/delayed-broken-video.py'
+ ><source onerror=x3++
+ ><source onerror=c++
+ ><source onerror=x4++
+ ></video
+>
+<script>
+async_test(function(t) {
+ var video = document.querySelector('video');
+ // remove the xn elements
+ [].forEach.call(document.querySelectorAll('[onerror^="x"]'), function(elm) {
+ video.removeChild(elm);
+ });
+ window.onload = t.step_func(function() {
+ assert_equals(a, 1, 'error events on a');
+ assert_equals(b, 1, 'error events on b');
+ assert_equals(c, 1, 'error events on c');
+ assert_equals(x1, 1, 'error events on x1');
+ assert_equals(x2, 1, 'error events on x2');
+ assert_equals(x3, 0, 'error events on x3');
+ assert_equals(x4, 0, 'error events on x4');
+ t.done();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-remove-text.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-remove-text.html
new file mode 100644
index 000000000..f0fe5da90
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-pointer-remove-text.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<title>pointer updates (removing text nodes)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var a = 0;
+var b = 0;
+var c = 0;
+</script>
+<video
+ >x<source onerror=a++
+ >x<source onerror=b++ src='resources/delayed-broken-video.py'
+ >x<source onerror=c++
+ >x</video
+>
+<script>
+async_test(function(t) {
+ var video = document.querySelector('video');
+ // remove the text nodes
+ [].forEach.call(video.childNodes, function(node) {
+ if (node.nodeType == node.TEXT_NODE) {
+ video.removeChild(node);
+ }
+ });
+ window.onload = t.step_func(function() {
+ assert_equals(a, 1, 'error events on a');
+ assert_equals(b, 1, 'error events on b');
+ assert_equals(c, 1, 'error events on c');
+ t.done();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-remove-source.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-remove-source.html
new file mode 100644
index 000000000..fbeead019
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-remove-source.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<title>Changes to networkState when inserting and removing a &lt;source></title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var v;
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState when creating the element');
+ v.appendChild(document.createElement('source')); // runs resource selection algorithm
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState when inserting a source element');
+ v.removeChild(v.firstChild);
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after removing the source element');
+});
+</script>
+<!-- now resource selection will continue its sync section (the </script> tag below provides a stable state) -->
+<!-- will find neither src nor source, so sets networkState to NETWORK_EMPTY -->
+<script>
+t.step(function() {
+ assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState after letting the sync section of resource selection run');
+ t.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-remove-src.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-remove-src.html
new file mode 100644
index 000000000..4d7887182
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-remove-src.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>invoking resource selection by setting src; await stable state</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var v;
+var t = async_test(function(t) {
+ v = document.createElement('video');
+ v.onloadstart = t.step_func(function() { assert_unreached(); });
+ v.setAttribute('src', ''); // runs resource selection algorithm, but it will wait running the sync section until this script has finished
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE);
+ v.removeAttribute('src'); // will make resource selection algorithm revert to NETWORK_EMPTY and abort (in the sync section)
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE);
+ window.onload = t.step_func(function() { t.done(); });
+});
+</script>
+<script>
+t.step(function() {
+ assert_equals(v.networkState, v.NETWORK_EMPTY);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-source-media.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-source-media.html
new file mode 100644
index 000000000..6332f0890
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-source-media.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>the &lt;source> media attribute has no effect</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<video><source src="resources/delayed-broken-video.py" media="none"></video>
+<script>
+test(function() {
+ var v = document.querySelector('video');
+ var s = document.querySelector('source');
+ assert_equals(v.networkState, v.NETWORK_LOADING);
+ assert_equals(v.currentSrc, s.src);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/delayed-broken-video.py b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/delayed-broken-video.py
new file mode 100644
index 000000000..88e502794
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/delayed-broken-video.py
@@ -0,0 +1,5 @@
+import time
+
+def main(request, response):
+ time.sleep(0.1)
+ return [("Content-Type", "text/plain")], "FAIL"
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/stable-state-beforeunload-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/stable-state-beforeunload-manual.html
new file mode 100644
index 000000000..61ed225fa
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/stable-state-beforeunload-manual.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<title>stable state in beforeunload</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<button>click this button and cancel navigation</button>
+<a href="data:text/plain,FAIL: did not cancel navigation"></a>
+<script>
+async_test(function(t) {
+ window.onbeforeunload = t.step_func(function(event) {
+ var message = "foo bar";
+ event.returnValue = message;
+ return message;
+ });
+ var button = document.querySelector('button');
+ var link = document.querySelector('a');
+ button.onclick = t.step_func(function() {
+ v = document.createElement('video');
+ v.src = 'data:,';
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState before dialog');
+ assert_equals(v.currentSrc, '', 'currentSrc before dialog');
+ link.click();
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after dialog');
+ assert_equals(v.currentSrc, '', 'currentSrc after dialog');
+ t.done();
+ window.onbeforeonload = null;
+ button.remove();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/stable-state-dialogs-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/stable-state-dialogs-manual.html
new file mode 100644
index 000000000..267dde913
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/stable-state-dialogs-manual.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<title>stable state in dialogs</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+['alert', 'confirm', 'prompt'].forEach(function(dialog) {
+ test(function() {
+ v = document.createElement('video');
+ v.src = 'data:,';
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState before dialog');
+ assert_equals(v.currentSrc, '', 'currentSrc before dialog');
+ window[dialog]('dismiss this dialog');
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after dialog');
+ assert_equals(v.currentSrc, '', 'currentSrc after dialog');
+ }, 'stable state in ' + dialog + '()');
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/stable-state-print-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/stable-state-print-manual.html
new file mode 100644
index 000000000..1261a0079
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/stable-state-print-manual.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<title>stable state in print()</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<button>click this button and dismiss the print dialog</button>
+<script>
+async_test(function(t) {
+ var button = document.querySelector('button');
+ button.onclick = t.step_func(function() {
+ v = document.createElement('video');
+ v.src = 'data:,';
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState before dialog');
+ assert_equals(v.currentSrc, '', 'currentSrc before dialog');
+ print();
+ assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after dialog');
+ assert_equals(v.currentSrc, '', 'currentSrc after dialog');
+ t.done();
+ button.remove();
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/location-of-the-media-resource/currentSrc.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/location-of-the-media-resource/currentSrc.html
new file mode 100644
index 000000000..2ca0a5180
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/location-of-the-media-resource/currentSrc.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<title>currentSrc</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+['audio', 'video'].forEach(function(tagName) {
+ test(function() {
+ assert_equals(document.createElement(tagName).currentSrc, '');
+ }, tagName + '.currentSrc initial value');
+
+ ['', '.', ' ', 'data:,'].forEach(function(src) {
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ e.src = src;
+ assert_equals(e.currentSrc, '');
+ setTimeout(t.step_func(function() {
+ if (src == '') {
+ assert_equals(e.currentSrc, '');
+ } else {
+ assert_equals(e.currentSrc, e.src);
+ }
+ t.done();
+ }), 0);
+ }, tagName + '.currentSrc after setting src attribute "' + src + '"');
+
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ var s = document.createElement('source');
+ s.src = src;
+ e.appendChild(s);
+ assert_equals(e.currentSrc, '');
+ setTimeout(t.step_func(function() {
+ if (src == '') {
+ assert_equals(e.currentSrc, '');
+ } else {
+ assert_equals(e.currentSrc, s.src);
+ }
+ t.done();
+ }), 0);
+ }, tagName + '.currentSrc after adding source element with src attribute "' + src + '"');
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/mime-types/canPlayType.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/mime-types/canPlayType.html
new file mode 100644
index 000000000..c5d37e752
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/mime-types/canPlayType.html
@@ -0,0 +1,110 @@
+<!doctype html>
+<title>canPlayType</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+function t(type, expected) {
+ assert_equals(canPlayType(type), expected, type);
+}
+
+function mime(type, codecs) {
+ if (codecs.length) {
+ return type + '; codecs="' + codecs.join(', ') + '"';
+ }
+ return type;
+}
+
+test(function() {
+ assert_equals(mime('video/webm', []), 'video/webm');
+ assert_equals(mime('video/webm', ['vp8']), 'video/webm; codecs="vp8"');
+ assert_equals(mime('video/webm', ['vp8', 'vorbis']), 'video/webm; codecs="vp8, vorbis"');
+}, 'utility code');
+
+function canPlayType(type) {
+ var canPlay = document.createElement('audio').canPlayType(type);
+ assert_equals(canPlay, document.createElement('video').canPlayType(type),
+ 'audio.canPlayType() and video.canPlayType() agree');
+ assert_in_array(canPlay, ['', 'maybe', 'probably'],
+ 'return value is one of "", "maybe" and "probably"');
+ return canPlay;
+}
+
+test(function() {
+ t('application/octet-stream', '');
+ t('application/octet-stream; codecs="vorbis"', '');
+ t('application/octet-stream; codecs="vp8, vorbis"', '');
+ t('application/octet-stream; codecs="mp4a.40.2"', '');
+ t('application/octet-stream; codecs="theora, vorbis"', '');
+ t('application/octet-stream; codecs="avc1.42E01E, mp4a.40.2"', '');
+}, 'application/octet-stream');
+
+test(function() {
+ t('video/x-new-fictional-format', '');
+ t('video/x-new-fictional-format;codecs="kittens,bunnies"', '');
+}, 'video/x-new-fictional-format');
+
+function type_codecs_test(type, audioCodecs, videoCodecs) {
+ var typeSupported = false;
+ var codecSupported = false;
+
+ test(function() {
+ // Spec: Generally, a user agent should never return "probably" for a type
+ // that allows the codecs parameter if that parameter is not present.
+ t(type, 'maybe');
+ typeSupported = true;
+ }, type + ' (optional)');
+
+ function test_codec(codec) {
+ var typeWithCodec = mime(type, [codec]);
+ test(function() {
+ t(typeWithCodec, 'probably');
+ codecSupported = true;
+ }, typeWithCodec + ' (optional)');
+ }
+
+ audioCodecs.forEach(test_codec);
+ videoCodecs.forEach(test_codec);
+
+ if (audioCodecs.length > 0 && videoCodecs.length > 0) {
+ test(function() {
+ audioCodecs.forEach(function(ac) {
+ videoCodecs.forEach(function(vc) {
+ var canPlayBoth = canPlayType(mime(type, [ac, vc]));
+ if (canPlayBoth) {
+ t(mime(type, [ac]), canPlayBoth);
+ t(mime(type, [vc]), canPlayBoth);
+ }
+ });
+ });
+ }, type + ' codecs subset');
+
+ test(function() {
+ audioCodecs.forEach(function(ac) {
+ videoCodecs.forEach(function(vc) {
+ assert_equals(canPlayType(mime(type, [ac, vc])),
+ canPlayType(mime(type, [vc, ac])));
+ });
+ });
+ }, type + ' codecs order');
+ }
+
+ test(function() {
+ t(mime(type, ['bogus']), '');
+ }, type + ' with bogus codec');
+
+ test(function() {
+ // At least one known codec must be supported if the container format is.
+ assert_equals(typeSupported, codecSupported);
+ }, type + ' with and without codecs');
+}
+
+type_codecs_test('audio/mp4', ['mp4a.40.2'], []);
+type_codecs_test('audio/ogg', ['opus', 'vorbis'], []);
+type_codecs_test('audio/wav', ['1'], []);
+type_codecs_test('audio/webm', ['opus', 'vorbis'], []);
+type_codecs_test('video/3gpp', ['samr'], ['mp4v.20.8']);
+type_codecs_test('video/mp4', ['mp4a.40.2'], ['avc1.42E01E', 'avc1.4D401E', 'avc1.58A01E', 'avc1.64001E', 'mp4v.20.8', 'mp4v.20.240']);
+type_codecs_test('video/ogg', ['opus', 'vorbis'], ['theora']);
+type_codecs_test('video/webm', ['opus', 'vorbis'], ['vp8', 'vp8.0', 'vp9', 'vp9.0']);
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/networkState_during_loadstart.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/networkState_during_loadstart.html
new file mode 100644
index 000000000..8f0fffc61
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/networkState_during_loadstart.html
@@ -0,0 +1,42 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video}.networkState - NETWORK_LOADING</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#dom-media-networkstate">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+var ta = async_test("audioElement.networkState should be NETWORK_LOADING during loadstart event", {timeout:5000});
+var a = document.getElementById("a");
+a.addEventListener("loadstart", function() {
+ ta.step(function() {
+ assert_equals(a.networkState,
+ a.NETWORK_LOADING);
+ });
+ ta.done();
+ a.pause();
+}, false);
+a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+
+var tv = async_test("videoElement.networkState should be NETWORK_LOADING during loadstart event", {timeout:5000});
+var v = document.getElementById("v");
+v.addEventListener("loadstart", function() {
+ tv.step(function() {
+ assert_equals(a.networkState,
+ v.NETWORK_LOADING);
+ });
+ tv.done();
+ v.pause();
+}, false);
+v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/networkState_during_progress.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/networkState_during_progress.html
new file mode 100644
index 000000000..cf23e822c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/networkState_during_progress.html
@@ -0,0 +1,42 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video}.networkState - NETWORK_LOADING</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#dom-media-networkstate">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+var ta = async_test("audioElement.networkState should be NETWORK_LOADING during progress event", {timeout:5000});
+var a = document.getElementById("a");
+a.addEventListener("progress", function() {
+ ta.step(function() {
+ assert_equals(a.networkState,
+ a.NETWORK_LOADING);
+ });
+ ta.done();
+ a.pause();
+}, false);
+a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+
+var tv = async_test("videoElement.networkState should be NETWORK_LOADING during progress event", {timeout:5000});
+var v = document.getElementById("v");
+v.addEventListener("progress", function() {
+ tv.step(function() {
+ assert_equals(v.networkState,
+ v.NETWORK_LOADING);
+ });
+ tv.done();
+ v.pause();
+}, false);
+v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/networkState_initial.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/networkState_initial.html
new file mode 100644
index 000000000..0a203e654
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/networkState_initial.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video}.networkState - default state</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#dom-media-networkstate">spec reference</a></p>
+ <audio id="a">
+ </audio>
+ <video id="v">
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var a = document.getElementById("a");
+ assert_equals(
+ a.networkState,
+ a.NETWORK_EMPTY,
+ "audioElement.networkState should be NETWORK_EMPTY to begin with");
+}, "audio.networkState - default state");
+
+test(function() {
+ var v = document.getElementById("v");
+ assert_equals(
+ v.networkState,
+ v.NETWORK_EMPTY,
+ "videoElement.networkState should be NETWORK_EMPTY to begin with");
+}, "video.networkState - default state");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/currentTime.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/currentTime.html
new file mode 100644
index 000000000..e9b658994
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/currentTime.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<title>currentTime</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ var v = document.createElement('video');
+ assert_equals(v.currentTime, 0);
+}, 'currentTime initial value');
+
+test(function() {
+ var v = document.createElement('video');
+ assert_equals(v.readyState, v.HAVE_NOTHING);
+ v.currentTime = Number.MAX_VALUE;
+ assert_equals(v.currentTime, Number.MAX_VALUE);
+ assert_false(v.seeking);
+}, 'setting currentTime when readyState is HAVE_NOTHING');
+
+async_test(function(t) {
+ var v = document.createElement('video');
+ v.src = getVideoURI('/media/movie_5');
+ v.onloadedmetadata = t.step_func(function() {
+ assert_greater_than(v.readyState, v.HAVE_NOTHING);
+ assert_false(v.seeking);
+ v.currentTime = 1;
+ assert_true(v.seeking);
+ t.done();
+ });
+}, 'setting currentTime when readyState is greater than HAVE_NOTHING');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/duration.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/duration.html
new file mode 100644
index 000000000..0ac26eddb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/duration.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<title>duration</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ var v = document.createElement('video');
+ assert_true(isNaN(v.duration));
+}, 'duration initial value');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/paused_false_during_play.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/paused_false_during_play.html
new file mode 100644
index 000000000..28c563333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/paused_false_during_play.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - paused property</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("audio.paused should be false during play event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("play", function() {
+ t.step(function() {
+ assert_false(a.paused);
+ });
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - paused property");
+
+test(function() {
+ var t = async_test("video.paused should be false during play event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("play", function() {
+ t.step(function() {
+ assert_false(v.paused);
+ });
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - paused property");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/paused_true_during_pause.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/paused_true_during_pause.html
new file mode 100644
index 000000000..6c4eb7c0c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/paused_true_during_pause.html
@@ -0,0 +1,46 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - paused property</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" controls>
+ </audio>
+ <video id="v" controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("audio.paused should be true during pause event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("pause", function() {
+ t.step(function() {
+ assert_true(a.paused);
+ });
+ t.done();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+ a.play();
+ a.pause();
+}, "audio events - paused property");
+
+test(function() {
+ var t = async_test("video.paused should be true during pause event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("pause", function() {
+ t.step(function() {
+ assert_true(v.paused);
+ });
+ t.done();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ v.play();
+ v.pause();
+}, "video events - paused property");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-move-to-other-document.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-move-to-other-document.html
new file mode 100644
index 000000000..342771dbd
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-move-to-other-document.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>paused state when moving to other document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<div id="log"></div>
+<video hidden></video>
+<iframe hidden></iframe>
+<script>
+async_test(function(t) {
+ var v = document.querySelector('video');
+ v.src = getVideoURI('/media/movie_300');
+ v.play();
+ v.onplaying = t.step_func(function() {
+ assert_false(v.paused, 'paused after playing');
+ document.querySelector('iframe').contentDocument.body.appendChild(v);
+ assert_false(v.paused, 'paused after moving');
+ setTimeout(t.step_func(function() {
+ assert_false(v.paused, 'paused after stable state')
+ t.done();
+ }), 0);
+ });
+ v.onpause = t.step_func(function() { assert_unreached(); });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-move-within-document.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-move-within-document.html
new file mode 100644
index 000000000..a28322d4d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-move-within-document.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>paused state when moving within a document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<div id="log"></div>
+<video hidden></video>
+<div id="elsewhere"></div>
+<script>
+async_test(function(t) {
+ var v = document.querySelector('video');
+ v.src = getVideoURI('/media/movie_300');
+ v.play();
+ v.onplaying = t.step_func(function() {
+ assert_false(v.paused, 'paused after playing');
+ document.getElementById('elsewhere').appendChild(v);
+ assert_false(v.paused, 'paused after moving');
+ setTimeout(t.step_func(function() {
+ assert_false(v.paused, 'paused after stable state')
+ t.done();
+ }), 0);
+ });
+ v.onpause = t.step_func(function() { assert_unreached(); });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-remove-from-document-networkState.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-remove-from-document-networkState.html
new file mode 100644
index 000000000..3b5849a35
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-remove-from-document-networkState.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>paused state when removing from a document when networkState is NETWORK_EMPTY</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<video hidden></video>
+<script>
+// Negative test for the specified behavior prior to HTML r8447.
+async_test(function(t) {
+ var v = document.querySelector('video');
+ v.play();
+ setTimeout(t.step_func(function() {
+ assert_equals(v.networkState, v.NETWORK_EMPTY,
+ 'networkState after stable state');
+ assert_false(v.paused, 'paused after stable state');
+ v.parentNode.removeChild(v);
+ assert_false(v.paused, 'paused after removing');
+ v.onpause = t.step_func(function() { t.done(); });
+ }), 0);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-remove-from-document.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-remove-from-document.html
new file mode 100644
index 000000000..7a4b0bc0d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-remove-from-document.html
@@ -0,0 +1,37 @@
+<!doctype html>
+<title>paused state when removing from a document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<div id="log"></div>
+<video hidden></video>
+<script>
+function afterStableState(func) {
+ var a = new Audio();
+ a.volume = 0;
+ a.addEventListener('volumechange', func);
+}
+
+async_test(function(t) {
+ var v = document.querySelector('video');
+ v.src = getVideoURI('/media/movie_300');
+ v.play();
+ v.onplaying = t.step_func(function() {
+ assert_false(v.paused, 'paused after playing');
+ v.parentNode.removeChild(v);
+ assert_false(v.paused, 'paused after removing');
+ afterStableState(t.step_func(function() {
+ assert_true(v.paused, 'paused after stable state');
+ v.onpause = t.step_func(function() {
+ assert_true(v.paused, 'paused in pause event');
+ // re-insert and verify that it stays paused
+ document.body.appendChild(v);
+ setTimeout(t.step_func(function() {
+ assert_true(v.paused, 'paused after re-inserting');
+ t.done();
+ }), 0);
+ });
+ }));
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/play-in-detached-document.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/play-in-detached-document.html
new file mode 100644
index 000000000..9c6fd5fab
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/play-in-detached-document.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>play() in detached document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<div id="log"></div>
+<script>
+// Negative test for failure to play in a detached document.
+async_test(function(t)
+{
+ var doc = document.implementation.createHTMLDocument("");
+ var v = doc.createElement("video");
+ doc.body.appendChild(v);
+ v.src = getVideoURI("/media/movie_5");
+ v.play();
+ v.addEventListener("timeupdate", t.step_func(function() {
+ assert_false(v.paused);
+ if (v.currentTime > 0) {
+ t.done();
+ }
+ }));
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/playbackRate.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/playbackRate.html
new file mode 100644
index 000000000..fa11d9944
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/playbackRate.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<title>playbackRate</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ var v = document.createElement('video');
+ assert_equals(v.playbackRate, 1);
+}, 'playbackRate initial value');
+
+async_test(function(t) {
+ var v = document.createElement('video');
+ v.playbackRate = 2;
+ v.addEventListener('ratechange', t.step_func(function() {
+ t.done();
+ }));
+}, 'setting playbackRate');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/preload_reflects_none_autoplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/preload_reflects_none_autoplay.html
new file mode 100644
index 000000000..2670b0dd8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/preload_reflects_none_autoplay.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video}.preload - reflection test</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#dom-media-preload">spec reference</a></p>
+ <audio id="audio" autoplay preload="none">
+ </audio>
+ <video id="video" autoplay preload="none">
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ assert_equals(
+ document.getElementById("audio").preload,
+ "none",
+ "audioElement.preload reflects 'none' value even if autoplay attribute is present");
+}, "audio.preload - reflection test");
+
+test(function() {
+ assert_equals(
+ document.getElementById("video").preload,
+ "none",
+ "videoElement.preload reflects 'none' value even if autoplay attribute is present");
+}, "video.preload - reflection test");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/ready-states/autoplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/ready-states/autoplay.html
new file mode 100644
index 000000000..76aef1dbc
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/ready-states/autoplay.html
@@ -0,0 +1,73 @@
+<!doctype html>
+<title>autoplay</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<div id="log"></div>
+<script>
+function autoplay_test(tagName, src) {
+ function expect_events(t, e, expected_events) {
+ var actual_events = [];
+ var callback = t.step_func(function(ev) {
+ actual_events.push(ev.type);
+ assert_array_equals(actual_events,
+ expected_events.slice(0, actual_events.length));
+ if (expected_events.length == actual_events.length) {
+ t.done();
+ }
+ });
+ ['canplay', 'canplaythrough',
+ 'pause', 'play', 'playing'].forEach(function(type) {
+ e.addEventListener(type, callback);
+ });
+ }
+
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ e.src = src;
+ e.autoplay = true;
+ expect_events(t, e, ['canplay', 'play', 'playing', 'canplaythrough']);
+ }, tagName + '.autoplay');
+
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ e.src = src;
+ e.autoplay = true;
+ e.pause(); // sets the autoplaying flag to false
+ e.load(); // sets the autoplaying flag to true
+ expect_events(t, e, ['canplay', 'play', 'playing', 'canplaythrough']);
+ }, tagName + '.autoplay and load()');
+
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ e.src = src;
+ e.autoplay = true;
+ e.play(); // sets the autoplaying flag to false
+ // play() also sets the paused attribute to false; there is no way for the
+ // autoplaying flag to be true when the paused attribute is false.
+ assert_equals(e.paused, false);
+ expect_events(t, e, ['play', 'canplay', 'playing', 'canplaythrough']);
+ }, tagName + '.autoplay and play()');
+
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ e.src = src;
+ e.autoplay = true;
+ e.pause(); // sets the autoplaying flag to false
+ expect_events(t, e, ['canplay', 'canplaythrough']);
+ }, tagName + '.autoplay and pause()');
+
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ e.src = src;
+ e.autoplay = true;
+ document.body.appendChild(e);
+ document.body.removeChild(e);
+ // in stable state, internal pause steps sets the autoplaying flag to false
+ expect_events(t, e, ['canplay', 'canplaythrough']);
+ }, tagName + '.autoplay and internal pause steps');
+}
+
+autoplay_test('audio', getAudioURI('/media/sound_5'));
+autoplay_test('video', getVideoURI('/media/movie_5'));
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_canplay.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_canplay.html
new file mode 100644
index 000000000..09ad89f8b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_canplay.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - readyState property during canplay</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("audio.readyState should be >= HAVE_FUTURE_DATA during canplay event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("canplay", function() {
+ t.step(function() {
+ assert_greater_than_equal(a.readyState, a.HAVE_FUTURE_DATA);
+ });
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - readyState property during canplay");
+
+test(function() {
+ var t = async_test("video.readyState should be >= HAVE_FUTURE_DATA during canplay event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("canplay", function() {
+ t.step(function() {
+ assert_greater_than_equal(v.readyState, v.HAVE_FUTURE_DATA);
+ });
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - readyState property during canplay");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_canplaythrough.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_canplaythrough.html
new file mode 100644
index 000000000..7ef7b5f74
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_canplaythrough.html
@@ -0,0 +1,46 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - readyState property during canplaythrough</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("audio.readyState should be HAVE_ENOUGH_DATA during canplaythrough event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("canplaythrough", function() {
+ t.step(function() {
+ assert_equals(a.readyState,
+ a.HAVE_ENOUGH_DATA);
+ });
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - readyState property during canplaythrough");
+
+test(function() {
+ var t = async_test("video.readyState should be HAVE_ENOUGH_DATA during canplaythrough event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("canplaythrough", function() {
+ t.step(function() {
+ assert_equals(v.readyState,
+ v.HAVE_ENOUGH_DATA);
+ });
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - readyState property during canplaythrough");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_loadeddata.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_loadeddata.html
new file mode 100644
index 000000000..1de85eb86
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_loadeddata.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - readyState property during loadeddata</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("audio.readyState should be >= HAVE_CURRENT_DATA during loadeddata event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("loadeddata", function() {
+ t.step(function() {
+ assert_greater_than_equal(a.readyState, a.HAVE_CURRENT_DATA);
+ });
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - readyState property during loadeddata");
+
+test(function() {
+ var t = async_test("video.readyState should be >= HAVE_CURRENT_DATA during loadeddata event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("loadeddata", function() {
+ t.step(function() {
+ assert_greater_than_equal(v.readyState, v.HAVE_CURRENT_DATA);
+ });
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - readyState property during loadeddata");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_loadedmetadata.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_loadedmetadata.html
new file mode 100644
index 000000000..85db8afb7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_loadedmetadata.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - readyState property during loadedmetadata</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("audio.readyState should be >= HAVE_METADATA during loadedmetadata event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("loadedmetadata", function() {
+ t.step(function() {
+ assert_greater_than_equal(a.readyState, a.HAVE_METADATA);
+ });
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - readyState property during loadedmetadata");
+
+test(function() {
+ var t = async_test("video.readyState should be >= HAVE_METADATA during loadedmetadata event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("loadedmetadata", function() {
+ t.step(function() {
+ assert_greater_than_equal(v.readyState, v.HAVE_METADATA);
+ });
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - readyState property during loadedmetadata");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_playing.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_playing.html
new file mode 100644
index 000000000..92a1b7f50
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_during_playing.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video} events - readyState property during playing</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
+ <audio id="a" autoplay controls>
+ </audio>
+ <video id="v" autoplay controls>
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var t = async_test("audio.readyState should be >= HAVE_FUTURE_DATA during playing event", {timeout:5000});
+ var a = document.getElementById("a");
+ a.addEventListener("playing", function() {
+ t.step(function() {
+ assert_greater_than_equal(a.readyState, a.HAVE_FUTURE_DATA);
+ });
+ t.done();
+ a.pause();
+ }, false);
+ a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
+}, "audio events - readyState property during playing");
+
+test(function() {
+ var t = async_test("video.readyState should be >= HAVE_FUTURE_DATA during playing event", {timeout:5000});
+ var v = document.getElementById("v");
+ v.addEventListener("playing", function() {
+ t.step(function() {
+ assert_greater_than_equal(v.readyState, v.HAVE_FUTURE_DATA);
+ });
+ t.done();
+ v.pause();
+ }, false);
+ v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+}, "video events - readyState property during playing");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_initial.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_initial.html
new file mode 100644
index 000000000..e9c112bd2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/readyState_initial.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video}.readyState - default state</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#dom-media-networkstate">spec reference</a></p>
+ <audio id="a">
+ </audio>
+ <video id="v">
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ var a = document.getElementById("a");
+ assert_equals(
+ a.readyState,
+ a.HAVE_NOTHING,
+ "audioElement.readyState should be HAVE_NOTHING to begin with");
+}, "audio.readyState - default state");
+
+test(function() {
+ var v = document.getElementById("v");
+ assert_equals(
+ v.readyState,
+ v.HAVE_NOTHING,
+ "videoElement.readyState should be HAVE_NOTHING to begin with");
+}, "video.readyState - default state");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/seeking/seek-to-currentTime.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/seeking/seek-to-currentTime.html
new file mode 100644
index 000000000..3d577dac9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/seeking/seek-to-currentTime.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<title>seek to currentTime</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<div id=log></div>
+<script>
+async_test(function(t) {
+ var v = document.createElement('video');
+ v.src = getVideoURI('/media/movie_5');
+ v.onloadedmetadata = t.step_func(function() {
+ assert_greater_than(v.readyState, v.HAVE_NOTHING, 'readyState');
+ assert_greater_than(v.seekable.length, 0, 'seekable ranges');
+ assert_false(v.seeking, 'seeking before setting currentTime');
+ v.currentTime = v.currentTime;
+ assert_true(v.seeking, 'seeking after setting currentTime');
+ var events = [];
+ v.onseeking = v.ontimeupdate = v.onseeked = t.step_func(function(e) {
+ events.push(e.type);
+ // v.seeking can be true or false in the seeking event, see
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=24774
+ if (e.type != 'seeking') {
+ assert_equals(v.seeking, false, 'seeking in ' + e.type + ' event');
+ }
+ if (e.type == 'seeked') {
+ assert_array_equals(events, ['seeking', 'timeupdate', 'seeked'],
+ 'fired events');
+ t.done();
+ }
+ });
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/seeking/seek-to-max-value.htm b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/seeking/seek-to-max-value.htm
new file mode 100644
index 000000000..a31f6c07a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/seeking/seek-to-max-value.htm
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>seek to Number.MAX_VALUE</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<div id=log></div>
+<script>
+async_test(function(t) {
+ var v = document.createElement('video');
+ v.src = getVideoURI('/media/movie_5');
+ v.onloadedmetadata = t.step_func(function() {
+ assert_equals(v.seekable.length, 1);
+ v.currentTime = Number.MAX_VALUE;
+ assert_true(v.seeking, 'seeking after setting');
+ assert_equals(v.currentTime, v.seekable.end(0), 'currentTime after setting');
+ v.onseeked = t.step_func(function(e) {
+ assert_false(v.seeking, 'seeking in seeked event');
+ assert_equals(v.currentTime, v.seekable.end(0), 'currentTime in seeked event');
+ t.done();
+ });
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/seeking/seek-to-negative-time.htm b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/seeking/seek-to-negative-time.htm
new file mode 100644
index 000000000..56a99028d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/seeking/seek-to-negative-time.htm
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>seek to negative time</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<div id=log></div>
+<script>
+async_test(function(t) {
+ var v = document.createElement('video');
+ v.src = getVideoURI('/media/movie_5');
+ v.onloadedmetadata = t.step_func(function() {
+ assert_equals(v.seekable.start(0), 0, 'earliest seekable time');
+ v.currentTime = -1;
+ assert_true(v.seeking, 'seeking after setting');
+ assert_equals(v.currentTime, 0, 'currentTime after setting');
+ v.onseeked = t.step_func(function(e) {
+ assert_false(v.seeking, 'seeking in seeked event');
+ assert_equals(v.currentTime, 0, 'currentTime in seeked event');
+ t.done();
+ });
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/src_reflects_attribute_not_source_elements.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/src_reflects_attribute_not_source_elements.html
new file mode 100644
index 000000000..3dd43cc3f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/src_reflects_attribute_not_source_elements.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<html>
+ <head>
+ <title>{audio,video}.src - reflection test</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p><a href="https://html.spec.whatwg.org/multipage/#dom-media-src">spec reference</a></p>
+ <audio id="audio" src="foo">
+ <source src="barbaz" />
+ </audio>
+ <video id="video" src="foo">
+ <source src="barbaz" />
+ </video>
+ <div id="log"></div>
+ <script>
+test(function() {
+ assert_equals(
+ document.getElementById("audio").src.indexOf("barbaz"),
+ -1,
+ "audioElement.src should reflect src attribute, not source child elements");
+}, "audio.src - reflection test");
+
+test(function() {
+ assert_equals(
+ document.getElementById("video").src.indexOf("barbaz"),
+ -1,
+ "videoElement.src should reflect src attribute, not source child elements");
+}, "video.src - reflection test");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cloneNode.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cloneNode.html
new file mode 100644
index 000000000..1159a52ff
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cloneNode.html
@@ -0,0 +1,86 @@
+<!doctype html>
+<title>track element cloneNode</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ var elm = document.createElement('track');
+ assert_equals(elm.readyState, elm.NONE, 'elm.readyState after element creation');
+ var clone = elm.cloneNode(true);
+ assert_equals(clone.readyState, clone.NONE, 'clone.readyState after element creation');
+ assert_not_equals(clone.track, elm.track, 'clone.track and elm.track');
+}, document.title+', not loaded');
+
+async_test(function(t) {
+ var elm = document.createElement('track');
+ var video = document.createElement('video');
+ video.appendChild(elm);
+ elm.track.mode = 'showing';
+ assert_equals(elm.readyState, elm.NONE, 'elm.readyState after appening to video setting mode');
+ elm.src = 'resources/track.vtt?pipe=trickle(d1)';
+ assert_equals(elm.readyState, elm.NONE, 'elm.readyState after setting src');
+ setTimeout(t.step_func_done(function() {
+ assert_equals(elm.readyState, elm.LOADING, 'elm.readyState in setTimeout');
+ var clone = elm.cloneNode(true);
+ assert_equals(clone.readyState, clone.NONE, 'clone.readyState after element creation');
+ video.appendChild(clone);
+ clone.track.mode = 'showing';
+ assert_equals(clone.readyState, clone.NONE, 'clone.readyState after appending to video and setting mode');
+ assert_not_equals(clone.track, elm.track, 'clone.track and elm.track');
+ }), 0);
+}, document.title+', loading');
+
+async_test(function(t) {
+ var elm = document.createElement('track');
+ var video = document.createElement('video');
+ video.appendChild(elm);
+ elm.track.mode = 'showing';
+ elm.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:01.000\nfoo');
+ assert_equals(elm.readyState, elm.NONE, 'elm.readyState after setting src');
+ elm.onload = this.step_func(function() {
+ assert_equals(elm.readyState, elm.LOADED, 'elm.readyState');
+ assert_equals(elm.track.cues.length, 1, 'elm.track.cues.length');
+ assert_equals(elm.track.cues[0].startTime, 0, 'elm.track.cues[0].startTime');
+ assert_equals(elm.track.cues[0].endTime, 1, 'elm.track.cues[0].endTime');
+ assert_equals(elm.track.cues[0].text, 'foo', 'elm.track.cues[0].text');
+ var clone = elm.cloneNode(true);
+ assert_equals(clone.readyState, clone.NONE, 'clone.readyState after element creation');
+ video.appendChild(clone);
+ clone.track.mode = 'showing';
+ assert_equals(clone.readyState, clone.NONE, 'clone.readyState after appending to video and setting mode');
+ assert_not_equals(clone.track, elm.track, 'clone.track and elm.track');
+ clone.onload = this.step_func(function(){
+ assert_equals(clone.readyState, clone.LOADED, 'clone.readyState');
+ assert_not_equals(clone.track, elm.track, 'clone.track and elm.track');
+ assert_not_equals(clone.track.cues, elm.track.cues, 'clone.track.cues and elm.track.cues');
+ assert_equals(clone.track.cues.length, 1, 'clone.track.cues.length');
+ assert_not_equals(clone.track.cues[0], elm.track.cues[0], 'cues[0]');
+ assert_equals(clone.track.cues[0].startTime, 0, 'clone.track.cues[0].startTime');
+ assert_equals(clone.track.cues[0].endTime, 1, 'clone.track.cues[0].endTime');
+ assert_equals(clone.track.cues[0].text, 'foo', 'clone.track.cues[0].text');
+ this.done();
+ });
+ clone.onerror = this.step_func(function() { assert_unreached('clone got error'); });
+ });
+ elm.onerror = this.step_func(function() { assert_unreached('elm got error'); });
+}, document.title+', loaded');
+
+async_test(function(t) {
+ var elm = document.createElement('track');
+ var video = document.createElement('video');
+ video.appendChild(elm);
+ elm.track.mode = 'showing';
+ elm.onerror = t.step_func(function() {
+ assert_equals(elm.readyState, elm.ERROR, 'elm.readyState in onerror');
+ var clone = elm.cloneNode(true);
+ assert_equals(clone.readyState, clone.NONE, 'clone.readyState after element creation');
+ video.appendChild(clone);
+ clone.track.mode = 'showing';
+ assert_equals(clone.readyState, clone.NONE, 'clone.readyState after appending to video and setting mode');
+ assert_not_equals(clone.track, elm.track, 'clone.track and elm.track');
+ clone.onerror = t.step_func_done();
+ });
+ elm.src = 'javascript:"network error"';
+}, document.title+', failed to load');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/003.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/003.html
new file mode 100644
index 000000000..4236df29b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/003.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: No CORS, same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/004.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/004.html
new file mode 100644
index 000000000..4f86d011a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/004.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: No CORS, same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/005.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/005.html
new file mode 100644
index 000000000..e6a693400
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/005.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/006.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/006.html
new file mode 100644
index 000000000..351b97d67
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/006.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/007.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/007.html
new file mode 100644
index 000000000..4ccc6b66a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/007.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/008.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/008.html
new file mode 100644
index 000000000..0444a8308
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/008.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/009.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/009.html
new file mode 100644
index 000000000..dd6223275
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/009.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: No CORS, not same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/010.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/010.html
new file mode 100644
index 000000000..d75d6f4d6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/010.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, not same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:origin, cookie:'no'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/011.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/011.html
new file mode 100644
index 000000000..6d0fae6de
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/011.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, not same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:origin, cookie:'no'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/012.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/012.html
new file mode 100644
index 000000000..110497b49
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/012.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, not same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:origin, cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/013.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/013.html
new file mode 100644
index 000000000..d2a9ddb19
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/013.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, not same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:origin, cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/014.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/014.html
new file mode 100644
index 000000000..a1d6a8b29
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/014.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: No CORS, same-origin, no headers, redirects to same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}, {cors:'no', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/015.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/015.html
new file mode 100644
index 000000000..2850a24e1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/015.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: No CORS, same-origin, with headers, redirects to same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}, {cors:'no', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/016.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/016.html
new file mode 100644
index 000000000..5cd5a85d4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/016.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, same-origin, no headers, redirects to same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}, {cors:'no', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/017.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/017.html
new file mode 100644
index 000000000..0ec5bc329
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/017.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, same-origin, no headers, redirects to same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}, {cors:'no', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/018.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/018.html
new file mode 100644
index 000000000..f639d043a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/018.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, same-origin, no headers, redirects to same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}, {cors:'no', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/019.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/019.html
new file mode 100644
index 000000000..45e1291c9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/019.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, same-origin, with headers, redirects to same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}, {cors:'no', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/020.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/020.html
new file mode 100644
index 000000000..e1153b681
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/020.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, not same-origin, no headers, redirects to same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:origin, cookie:'no'}]}; // redirect not followed
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/021.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/021.html
new file mode 100644
index 000000000..ec2e9d8bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/021.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, not same-origin, with headers, redirects to same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:origin, cookie:'no'}, {cors:'null', cookie:'no'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/022.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/022.html
new file mode 100644
index 000000000..e8fb0c3d4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/022.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, not same-origin, with headers, redirects to same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:origin, cookie:'no'}, {cors:'null', cookie:'no'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/023.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/023.html
new file mode 100644
index 000000000..ac9bb3546
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/023.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, not same-origin, no headers, redirects to same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:origin, cookie:'yes'}]}; // redirect not followed
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/024.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/024.html
new file mode 100644
index 000000000..302340022
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/024.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, not same-origin, with headers, redirects to same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:origin, cookie:'yes'}, {cors:'null', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/025.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/025.html
new file mode 100644
index 000000000..5cbe8528e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/025.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, not same-origin, with headers, redirects to same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:origin, cookie:'yes'}, {cors:'null', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/026.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/026.html
new file mode 100644
index 000000000..c8386ffff
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/026.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: No CORS, same-origin, with headers, redirects to not same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:'no', cookie:'yes'}]}; // redirect not followed
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/027.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/027.html
new file mode 100644
index 000000000..5fe4760e6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/027.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, same-origin, no headers, redirects to not same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:'no', cookie:'yes'}, {cors:origin, cookie:'no'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/028.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/028.html
new file mode 100644
index 000000000..6019d37b6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/028.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, same-origin, with headers, redirects to not same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}, {cors:origin, cookie:'no'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/029.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/029.html
new file mode 100644
index 000000000..7fa85456d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/029.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, same-origin, no headers, redirects to not same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:'no', cookie:'yes'}, {cors:origin, cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/030.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/030.html
new file mode 100644
index 000000000..f7abf3b1e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/030.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, same-origin, with headers, redirects to not same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}, {cors:origin, cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/031.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/031.html
new file mode 100644
index 000000000..d709d0bc4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/031.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, not same-origin, no headers, redirects to not same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:origin, cookie:'no'}]}; // redirect not followed
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/032.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/032.html
new file mode 100644
index 000000000..62b1008a4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/032.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, not same-origin, with headers, redirects to not same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:origin, cookie:'no'}, {cors:origin, cookie:'no'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/033.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/033.html
new file mode 100644
index 000000000..215cae241
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/033.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, not same-origin, with headers, redirects to not same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:origin, cookie:'no'}, {cors:origin, cookie:'no'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/034.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/034.html
new file mode 100644
index 000000000..bebb43ba8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/034.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, not same-origin, no headers, redirects to not same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:origin, cookie:'yes'}]}; // redirect not followed
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/035.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/035.html
new file mode 100644
index 000000000..a17fb7dfc
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/035.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, not same-origin, with headers, redirects to not same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:origin, cookie:'yes'}, {cors:origin, cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/036.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/036.html
new file mode 100644
index 000000000..52411177e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/036.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, not same-origin, with headers, redirects to not same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:origin, cookie:'yes'}, {cors:origin, cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/037.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/037.html
new file mode 100644
index 000000000..675b913a1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/037.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, same-origin, no headers, redirects to not same-origin, no headers, redirects to same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:'no', cookie:'yes'}, {cors:origin, cookie:'no'}]}; // second redirect not followed
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/038.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/038.html
new file mode 100644
index 000000000..a29b2bdea
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/038.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, same-origin, with headers, redirects to not same-origin, with headers, redirects to same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}, {cors:origin, cookie:'no'}, {cors:'null', cookie:'no'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/039.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/039.html
new file mode 100644
index 000000000..fcd4871dd
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/039.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, same-origin, no headers, redirects to not same-origin, with headers, redirects to same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:'no', cookie:'yes'}, {cors:origin, cookie:'no'}, {cors:'null', cookie:'no'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/040.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/040.html
new file mode 100644
index 000000000..3c819684c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/040.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, same-origin, no headers, redirects to not same-origin, no headers, redirects to same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:'no', cookie:'yes'}, {cors:origin, cookie:'yes'}]}; // second redirect not followed
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/041.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/041.html
new file mode 100644
index 000000000..f0f81953f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/041.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, same-origin, with headers, redirects to not same-origin, with headers, redirects to same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}, {cors:origin, cookie:'yes'}, {cors:'null', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/042.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/042.html
new file mode 100644
index 000000000..c1ffa5f1e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/042.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, same-origin, no headers, redirects to not same-origin, with headers, redirects to same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:'no', cookie:'yes'}, {cors:origin, cookie:'yes'}, {cors:'null', cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/043.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/043.html
new file mode 100644
index 000000000..09072a989
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/043.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, same-origin, no headers, redirects to same-origin, no headers, redirects to not same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:'no', cookie:'yes'}, {cors:'no', cookie:'yes'}, {cors:origin, cookie:'no'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/044.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/044.html
new file mode 100644
index 000000000..0d4a9fefb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/044.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Anonymous, same-origin, no headers, redirects to same-origin, no headers, redirects to not same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}, {cors:'no', cookie:'yes'}, {cors:origin, cookie:'no'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/045.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/045.html
new file mode 100644
index 000000000..7151364f9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/045.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, same-origin, no headers, redirects to same-origin, no headers, redirects to not same-origin, no headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'error', requests:[{cors:'no', cookie:'yes'}, {cors:'no', cookie:'yes'}, {cors:origin, cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/046.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/046.html
new file mode 100644
index 000000000..e28646281
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/046.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>track CORS: Use Credentials, same-origin, no headers, redirects to same-origin, no headers, redirects to not same-origin, with headers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script src=/common/utils.js></script>
+<script src=support/common.js?pipe=sub></script>
+<script>
+var expected = {event:'load', requests:[{cors:'no', cookie:'yes'}, {cors:'no', cookie:'yes'}, {cors:origin, cookie:'yes'}]};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/common.js b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/common.js
new file mode 100644
index 000000000..9d48abde0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/common.js
@@ -0,0 +1,144 @@
+setup(function(){
+ window.id = token();
+ var p = document.createElement('p');
+ p.innerHTML = 'Test id: <samp>'+id+'</samp>';
+ document.body.appendChild(p);
+ window.actual = {event:null, requests:[]};
+ window.errors = [];
+ window.origin = location.protocol+'//'+location.host;
+ window.escapedOrigin = encodeURIComponent(origin);
+ window.sameOriginURL = "http://{{domains[]}}:{{ports[http][0]}}" + location.pathname.replace(/\/[^\/]+$/, '/');
+ window.otherOriginURL = "http://{{domains[www1]}}:{{ports[http][0]}}" + location.pathname.replace(/\/[^\/]+$/, '/');
+}, {timeout:10000, explicit_done:true});
+
+onload = function() {
+ (async_test(document.title, {timeout:10000})).step(function() {
+ // fail early if track isn't supported
+ assert_true('HTMLTrackElement' in window, 'track not supported');
+ window.corsMode = document.title.match(/^track CORS: (No CORS|Anonymous|Use Credentials)/)[1];
+ var requests_tmp = document.title.substr(('track CORS: '+corsMode+', ').length).split(/, redirects to /g);
+ window.requests = [];
+ requests_tmp.forEach(function(r) {
+ var parts = r.split(', ');
+ requests.push({sameOrigin:parts[0] == 'same-origin', withHeaders:parts[1] == 'with headers'});
+ });
+ if (document.title.indexOf('not same-origin') > -1) {
+ window.hasCrossDomainCookie = true;
+ this.step(setCrossDomainCookie);
+ } else {
+ window.hasCrossDomainCookie = false;
+ this.step(loadTrack);
+ }
+ });
+ done();
+};
+
+function setCrossDomainCookie() {
+ var iframe = document.createElement('iframe');
+ iframe.onload = this.step_func(loadTrack);
+ iframe.src = otherOriginURL + 'support/set-cookie.html#'+id;
+ document.body.appendChild(iframe);
+}
+
+function loadTrack() {
+ var video = document.createElement('video');
+ window.track = document.createElement('track');
+ if (corsMode == 'Anonymous')
+ video.setAttribute('crossorigin', 'anonymous');
+ else if (corsMode == 'Use Credentials')
+ video.setAttribute('crossorigin', 'use-credentials');
+ // else No CORS, omit the crossorigin attribute
+ video.appendChild(track);
+ document.body.appendChild(video);
+ track.track.mode = 'showing';
+ document.cookie = id+'=yes;path=/;max-age=10';
+ var url = '';
+ var r;
+ while (r = requests.pop()) {
+ url = (r.sameOrigin ? sameOriginURL : otherOriginURL) +
+ 'support/cors-tester.py?id=' + id +
+ (r.withHeaders ? '&origin=' + escapedOrigin : '') +
+ (url === '' ? '' : '&redirect=' + encodeURIComponent(url));
+ }
+ track.src = url;
+ track.onerror = track.onload = this.step_func(function(e) {
+ actual.event = e.type;
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', 'support/cors-tester.py?read=true&id=' + id, true);
+ xhr.onload = this.step_func(function() {
+ if (xhr.status == 200) {
+ var lines = xhr.responseText.split('\n');
+ lines.forEach(function(line) {
+ var chunks = line.split(' | ');
+ var current = {};
+ actual.requests.push(current);
+ chunks.forEach(function(chunk) {
+ var nameval = chunk.split(' = ');
+ var name = nameval[0];
+ var value = nameval[1];
+ current[name] = value;
+ });
+ });
+ } else if (xhr.status == 404) {
+ //No stash was found
+ } else {
+ errors.push('got unexpected xhr status: '+xhr.status);
+ }
+ this.step(removeCookies);
+ });
+ xhr.onerror = this.step_func(function() {
+ errors.push('got xhr error');
+ this.step(removeCookies);
+ });
+ xhr.send();
+ });
+}
+
+function removeCookies() {
+ document.cookie = id+'=;path=/;max-age=0';
+ var nextStep = checkData;
+ if (hasCrossDomainCookie) {
+ var iframe = document.createElement('iframe');
+ iframe.onload = this.step_func(nextStep);
+ iframe.src = otherOriginURL + 'support/cors-tester.py?delete-cookie&id=' + id;
+ document.body.appendChild(iframe);
+ } else {
+ this.step(nextStep);
+ }
+}
+
+function removeLog() {
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', 'support/cors-tester.py?cleanup&id='+id, true);
+ xhr.onload = this.step_func(function() {
+ assert_equals(xhr.responseText, 'OK', 'failed to clean up log: '+id);
+ this.step(checkData);
+ });
+ xhr.onerror = this.step_func(function() {
+ assert_unreached('failed to clean up log: '+id);
+ });
+ xhr.send();
+}
+
+function checkData() {
+ assert_equals(errors.length, 0, errors);
+ try {
+ if (actual.event == 'load' && expected.event == 'error')
+ assert_unreached('Security problem: got load event but expected error event');
+ assert_object_equals(actual, expected);
+ } catch(ex) {
+ var style = document.createElement('style');
+ style.textContent = '.json-diffs td { vertical-align:top } .json-diffs pre { margin:0 }';
+ document.head.appendChild(style);
+ var table = document.createElement('table');
+ table.border = "";
+ table.className = 'json-diffs';
+ table.innerHTML = '<tr><th>Actual<th>Expected<tr><td><pre></pre><td><pre></pre>';
+ table.getElementsByTagName('pre')[0].textContent = JSON.stringify(actual, null, 2);
+ table.getElementsByTagName('pre')[1].textContent = JSON.stringify(expected, null, 2);
+ document.body.insertBefore(table, document.getElementById('log'));
+ throw ex;
+ }
+ assert_equals(track.track.cues.length, expected.event == 'load' ? 1 : 0, 'track.track.cues.length');
+ this.done();
+}
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py
new file mode 100644
index 000000000..1c27a0d14
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py
@@ -0,0 +1,51 @@
+from wptserve.handlers import HTTPException
+import urllib
+
+def main(request, response):
+ if request.method != "GET":
+ raise HTTPException(400, message="Method was not GET")
+
+ if not "id" in request.GET:
+ raise HTTPException(400, message="No id")
+
+ id = request.GET['id']
+
+ if "read" in request.GET:
+ data = request.server.stash.take(id)
+ if data is None:
+ response.set_error(404, "Tried to read data not yet set")
+ return
+ return [("Content-Type", "text/plain")], data
+
+ elif "cleanup" in request.GET:
+ request.server.stash.take(id)
+ return "OK"
+
+ elif "delete-cookie" in request.GET:
+ response.delete_cookie(id)
+ return [("Content-Type", "text/plain")], "OK"
+
+ if "origin" in request.GET:
+ response.headers.set('Access-Control-Allow-Origin', request.GET['origin'])
+ response.headers.set('Access-Control-Allow-Credentials', 'true')
+
+ cors = request.headers.get("origin", "no")
+
+ cookie = request.cookies.first(id, "no")
+
+ line = 'cors = ' + cors + ' | cookie = ' + cookie.value;
+
+ data = request.server.stash.take(id)
+ if data is not None:
+ line = data + "\n" + line
+
+ request.server.stash.put(id, line)
+
+ if "redirect" in request.GET:
+ response.status = 302
+ response.headers.set('Location', request.GET['redirect'])
+ else:
+ return """WEBVTT
+
+00:00:00.000 --> 00:00:10.000
+Test"""
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/remove-cookie.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/remove-cookie.html
new file mode 100644
index 000000000..00430e3f0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/remove-cookie.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<title>Remove cookie from location.hash</title>
+<script>
+if (location.hash)
+ document.cookie = decodeURIComponent(location.hash.substr(1))+'=yes;path=/;max-age=0';
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/set-cookie.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/set-cookie.html
new file mode 100644
index 000000000..cc1c92638
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/set-cookie.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<title>Set cookie from location.hash</title>
+<script>
+if (location.hash)
+ document.cookie = decodeURIComponent(location.hash.substr(1))+'=yes;path=/;max-age=15';
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.de.vtt b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.de.vtt
new file mode 100644
index 000000000..9eaf3d31e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.de.vtt
@@ -0,0 +1,4 @@
+WEBVTT
+
+00:00:00.000 --> 00:00:01.000
+German
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.en.vtt b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.en.vtt
new file mode 100644
index 000000000..4241f35b5
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.en.vtt
@@ -0,0 +1,4 @@
+WEBVTT
+
+00:00:00.000 --> 00:00:01.000
+English
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.fr.vtt b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.fr.vtt
new file mode 100644
index 000000000..5523224e0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.fr.vtt
@@ -0,0 +1,4 @@
+WEBVTT
+
+00:00:00.000 --> 00:00:01.000
+french
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.vtt b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.vtt
new file mode 100644
index 000000000..c916c0983
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/resources/track.vtt
@@ -0,0 +1,4 @@
+WEBVTT
+
+00:00:00.000 --> 00:00:01.000
+test
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/src-clear-cues.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/src-clear-cues.html
new file mode 100644
index 000000000..3ba8c9db8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/src-clear-cues.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<title>track element changing "track URL" and clearing cues</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+(async_test(document.title+', set mode, add cue, set src')).step(function(){
+ var track = document.createElement('track');
+ var c = new VTTCue(0, 1, 'foo');
+ c.id = 'id';
+ track.track.addCue(c);
+ assert_equals(track.track.cues, null, 'cues before setting src or mode');
+ track.track.mode = 'showing';
+ assert_equals(track.track.cues.length, 1, 'cues after setting mode');
+ var cues = track.track.cues;
+ track.src = 'data:,a';
+ assert_equals(track.track.cues.length, 0, 'cues.length after setting src');
+ assert_equals(track.track.cues, cues, 'track.track.cues sameness after setting src');
+ assert_equals(c.id, 'id', 'liveness of removed cue');
+ this.done();
+});
+
+(async_test(document.title+', set mode, set src, add cue, change src')).step(function(){
+ var track = document.createElement('track');
+ track.track.mode = 'showing';
+ track.src = 'data:,a';
+ var c = new VTTCue(0, 1, 'foo');
+ c.id = 'id';
+ track.track.addCue(c);
+ assert_equals(track.track.cues.length, 1, 'cues.length before changing src');
+ var cues = track.track.cues;
+ track.src = 'data:,b';
+ assert_equals(track.track.cues.length, 0, 'cues.length after changing src');
+ assert_equals(track.track.cues, cues, 'track.track.cues sameness after changing src');
+ assert_equals(c.id, 'id', 'liveness of removed cue');
+ this.done();
+});
+
+(async_test(document.title+', set mode, add cue, change mode to disabled, set src')).step(function(){
+ var track = document.createElement('track');
+ track.track.mode = 'showing';
+ var c = new VTTCue(0, 1, 'foo');
+ c.id = 'id';
+ track.track.addCue(c);
+ var cues = track.track.cues;
+ track.track.mode = 'disabled';
+ track.src = 'data:,a';
+ assert_equals(cues.length, 0, 'cues.length after changing src');
+ assert_equals(c.id, 'id', 'liveness of removed cue');
+ this.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-api-texttracks.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-api-texttracks.html
new file mode 100644
index 000000000..b2840d235
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-api-texttracks.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Track element - text tracks API test</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#text-track-api">
+<link rel="author" title="Hyunjin Cho">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<h1>Track element and API Test</h1>
+<div style="display:none;">
+ <video id="tracktest" src="/media/movie_300.mp4">
+ <track kind="subtitles" src="resources/track.en.vtt" srclang="en" label="English">
+ <track kind="captions" src="resources/track.en.vtt" srclang="en" label="English with Captions">
+ <track id="french" kind="subtitles" src="resources/track.fr.vtt" srclang="fr" label="Francais">
+ <track kind="subtitles" src="resources/track.de.vtt" srclang="de" label="Deutsch">
+ </video>
+</div>
+<div id="log"></div>
+<script>
+test(function() {
+ var t1 = document.getElementById('tracktest').textTracks;
+ assert_not_equals(t1, undefined, "textTracks member should not be undefined");
+}, "Check the track elements");
+test(function() {
+ var t2 = document.getElementById('tracktest').textTracks.getTrackById("french");
+ assert_not_equals(t2, undefined, "textTracks member should not be undefined");
+}, "Check getTrackById method");
+test(function() {
+ var t3 = document.getElementById('tracktest').textTracks.length;
+ assert_equals(t3, 4, "textTracks List should be 4");
+}, "Count track list");
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/user-interface/muted.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/user-interface/muted.html
new file mode 100644
index 000000000..906350d88
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/user-interface/muted.html
@@ -0,0 +1,152 @@
+<!doctype html>
+<title>muted</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/media.js"></script>
+<style>video { display: none; }</style>
+<div id=log></div>
+
+<script>
+function test_setting(e, muted, hasAttribute) {
+ assert_equals(e.muted, muted);
+ assert_equals(e.hasAttribute('muted'), hasAttribute);
+
+ e.muted = !e.muted;
+ assert_equals(e.muted, !muted);
+ assert_equals(e.hasAttribute('muted'), hasAttribute);
+
+ e.muted = !e.muted;
+ assert_equals(e.muted, muted);
+ assert_equals(e.hasAttribute('muted'), hasAttribute);
+}
+</script>
+
+<!-- These tests are inside <audio>/<video> so that the steps for updating the
+ muted IDL attribute cannot be delayed until the end tag is parsed. -->
+
+<audio id=a1>
+<script>
+var a1 = document.getElementById('a1');
+
+test(function() {
+ assert_false(a1.muted);
+}, 'getting audio.muted (parser-created)');
+
+test(function() {
+ test_setting(a1, false, false);
+}, 'setting audio.muted (parser-created)');
+</script>
+</audio>
+
+<audio id=a2 muted>
+<script>
+var a2 = document.getElementById('a2');
+
+test(function() {
+ assert_true(a2.muted);
+}, 'getting audio.muted with muted="" (parser-created)');
+
+test(function() {
+ test_setting(a2, true, true);
+}, 'setting audio.muted with muted="" (parser-created)');
+</script>
+</audio>
+
+<video id=v1>
+<script>
+var v1 = document.getElementById('v1');
+
+test(function() {
+ assert_false(v1.muted);
+}, 'getting video.muted (parser-created)');
+
+test(function() {
+ test_setting(v1, false, false);
+}, 'setting video.muted (parser-created)');
+</script>
+</video>
+
+<video id=v2 muted>
+<script>
+var v2 = document.getElementById('v2');
+
+test(function() {
+ assert_true(v2.muted);
+}, 'getting video.muted with muted="" (parser-created)');
+
+test(function() {
+ test_setting(v2, true, true);
+}, 'setting video.muted with muted="" (parser-created)');
+</script>
+</video>
+
+<!-- Negative test to ensure that the load algorithm does not update the
+ muted IDL attribute to match the content attribute. -->
+
+<video id=v3 muted></video>
+<script>
+async_test(function(t) {
+ var v = document.getElementById('v3');
+ assert_true(v.muted);
+ v.muted = false;
+ v.src = 'data:,'; // invokes load()
+ v.addEventListener('error', t.step_func(function() {
+ assert_false(v.muted);
+ t.done();
+ }));
+}, 'getting video.muted with muted="" after load (parser-created)');
+</script>
+
+<script>
+['audio', 'video'].forEach(function(tagName) {
+ test(function() {
+ var m = document.createElement(tagName);
+ assert_false(m.muted);
+ }, 'getting ' + tagName + '.muted (script-created)');
+
+ test(function() {
+ var m = document.createElement(tagName);
+ test_setting(m, false, false);
+ }, 'setting ' + tagName + '.muted (script-created)');
+
+ test(function() {
+ var m = document.createElement(tagName);
+ m.setAttribute('muted', '');
+ assert_false(m.muted);
+ }, 'getting ' + tagName + '.muted with muted="" (script-created)');
+
+ test(function() {
+ var m = document.createElement(tagName);
+ m.setAttribute('muted', '');
+ test_setting(m, false, true);
+ }, 'setting ' + tagName + '.muted with muted="" (script-created)');
+
+ // Spec bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=25153
+ /*
+ test(function() {
+ var m = document.createElement(tagName);
+ m.setAttribute('muted', '');
+ m = m.cloneNode(false);
+ assert_true(m.hasAttribute('muted'));
+ assert_false(m.muted);
+ }, 'getting ' + tagName + '.muted with muted="" (cloneNode-created)');
+ */
+
+ test(function() {
+ var div = document.createElement('div');
+ div.innerHTML = '<' + tagName + ' muted>';
+ m = div.firstChild;
+ assert_true(m.hasAttribute('muted'));
+ assert_true(m.muted);
+ }, 'getting ' + tagName + '.muted with muted="" (innerHTML-created)');
+
+ test(function() {
+ var id = tagName;
+ assert_equals(document.getElementById(id), null);
+ document.write('<' + tagName + ' id=' + id + ' muted>');
+ m = document.getElementById(id);
+ assert_true(m.hasAttribute('muted'));
+ assert_true(m.muted);
+ }, 'getting ' + tagName + '.muted with muted="" (document.write-created)');
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_008.htm b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_008.htm
new file mode 100644
index 000000000..dff49d824
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_controls_present-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_controls_present-manual.html
new file mode 100644
index 000000000..8e44951d7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_controls_present-manual.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Video Test: video_controls_present.html</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-controls" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the controls attribute is present in the video element that expecting the user agent exposes a controller user interface" />
+ </head>
+ <body>
+ <p>Test passes if a controller user interface appears below and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
+ <video id="m" controls>The user agent doesn't support media element.</video>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_loop_base.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_loop_base.html
new file mode 100644
index 000000000..348f1cdae
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_loop_base.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Video Test: video_loop_base</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-loop" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if video.loop is set to true that expecting the seeking event is fired more than once" />
+ <meta name=timeout content=long>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <video id="m" controls>The user agent doesn't support media element.</video>
+ <script type="text/javascript">
+ var media = document.getElementById("m");
+ var name = document.getElementsByName("assert")[0].content;
+ var t = async_test(name);
+ var looped = false;
+
+ function startTest() {
+ if (looped) {
+ t.step(function() {
+ assert_true(true, "looped");
+ });
+ t.done();
+ media.pause();
+ }
+
+ looped = true;
+ }
+
+ media.addEventListener("seeking", startTest, false);
+ media.loop = true;
+ media.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ media.play();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_muted_overriding_volume-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_muted_overriding_volume-manual.html
new file mode 100644
index 000000000..6d770666c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_muted_overriding_volume-manual.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Video Test: video_muted_overriding_volume</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-muted" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the muted attribute is present in the video element with volume is set to loudest that expecting the user hears no sound" />
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p>Test passes if the video is playing without sound output and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
+ <video id="m" controls muted>The user agent doesn't support media element.</video>
+ <script type="text/javascript">
+ var media = document.getElementById("m");
+ media.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ media.volume = 1.0;
+ media.play();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_muted_present-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_muted_present-manual.html
new file mode 100644
index 000000000..bc8082777
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_muted_present-manual.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Video Test: video_muted_present</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-muted" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the muted attribute is present in the video element that expecting the user hears no sound" />
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p>Test passes if the video is playing without sound output and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
+ <video id="m" controls muted>The user agent doesn't support media element.</video>
+ <script type="text/javascript">
+ var media = document.getElementById("m");
+ media.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ media.play();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_volume_check.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_volume_check.html
new file mode 100644
index 000000000..1a45358a7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_volume_check.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Video Test: video_volume_check</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-volume" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check that video.volume returns the value of the muted content attribute" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <video id="m">The user agent doesn't support media element.</video>
+ <script type="text/javascript">
+ var media = document.getElementById("m");
+ var VOLUME = {
+ 'SILENT' : 0.0,
+ 'NORMAL' : 0.5,
+ 'LOUDEST' : 1.0,
+ 'LOWER' : -1.1,
+ 'UPPER' : 1.1,
+ };
+
+ test(function() {
+ assert_false(media.volume < VOLUME.SILENT || media.volume > VOLUME.LOUDEST, "media.volume outside the range 0.0 to 1.0 inclusive");
+ }, "Check if the intial value of the video.volume is in the range 0.0 to 1.0 inclusive");
+
+ function volume_setting(vol, name)
+ {
+ if (vol < VOLUME.SILENT || vol > VOLUME.LOUDEST) {
+ try {
+ media.volume = vol;
+ test(function() {
+ assert_true(false, "media.volume setting exception");
+ }, name);
+ } catch(e) {
+ test(function() {
+ // 1 should be e.IndexSizeError or e.INDEX_SIZE_ERR in previous spec
+ assert_equals(e.code, 1, "media.volume setting exception");
+ }, name);
+ }
+ } else {
+ media.volume = vol;
+ test(function() {
+ assert_equals(media.volume, vol, "media.volume new value");
+ }, name);
+ }
+ }
+
+ volume_setting(VOLUME.NORMAL, "Check if video.volume is able to set to new value in the range 0.0 to 1.0");
+ volume_setting(VOLUME.SILENT, "Check if media.volume is able to set to new value 0.0 as silent");
+ volume_setting(VOLUME.LOUDEST, "Check if media.volume is able to set to new value 1.0 as loudest");
+ volume_setting(VOLUME.LOWER, "Check if media.volume is set to new value less than 0.0 that expecting an IndexSizeError exception is to be thrown");
+ volume_setting(VOLUME.UPPER, "Check if video.volume is set to new value greater than 1.0 that expecting an IndexSizeError exception is to be thrown");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_volume_loudest-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_volume_loudest-manual.html
new file mode 100644
index 000000000..747578120
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_volume_loudest-manual.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Video Test: video_volume_loudest</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-volume" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the volume attribute is set to 1.0 as loudest in the video element that expecting the user hears sound loudly" />
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p>Test passes if the video is playing with sound heard and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
+ <video id="m" controls>The user agent doesn't support media element.</video>
+ <script type="text/javascript">
+ var media = document.getElementById("m");
+ media.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ media.volume = 1.0;
+ media.play();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_volume_silent-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_volume_silent-manual.html
new file mode 100644
index 000000000..1768dd4d4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/video_volume_silent-manual.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Video Test: video_volume_silent</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-volume" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if the volume attribute is set to 0.0 as silent in the video element that expecting the user hears no sound" />
+ <script src="/common/media.js"></script>
+ </head>
+ <body>
+ <p>Test passes if the video is playing without sound heard and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
+ <video id="m" controls volume=0.0>The user agent doesn't support media element.</video>
+ <script type="text/javascript">
+ var media = document.getElementById("m");
+ media.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
+ media.volume = 0.0;
+ media.play();
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/volume_nonfinite.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/volume_nonfinite.html
new file mode 100644
index 000000000..6e90a2ebc
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/volume_nonfinite.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Setting HTMLMediaElement.volume to non-finite numbers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+["audio", "video"].forEach(function(aElement) {
+ [NaN, Infinity, -Infinity].forEach(function(aValue) {
+ test(function() {
+ var el = document.createElement(aElement);
+ assert_throws(new TypeError(), function() {
+ el.volume = aValue;
+ });
+ }, "Setting " + aElement + ".volume to " + String(aValue) + " should throw a TypeError");
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/svg/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/svg/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/svg/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-coords.html b/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-coords.html
new file mode 100644
index 000000000..9ec6f3e42
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-coords.html
@@ -0,0 +1,47 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLAreaElement coords parsing</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<style>
+ body { margin: 0 }
+</style>
+<img src=/images/threecolors.png usemap=#x id=img width=300 height=300>
+<map name=x><area id=area></map>
+<script src=support/hit-test.js></script>
+<script>
+tests = [
+ {desc: 'COMMA', shape: 'rect', coords: "2,2,10,10", hit: hitRect},
+ {desc: 'SEMICOLON', shape: 'rect', coords: "2;2;10;10", hit: hitRect},
+ {desc: 'SPACE', shape: 'rect', coords: "2 2 10 10", hit: hitRect},
+ {desc: 'TAB', shape: 'rect', coords: "2\t2\t10\t10", hit: hitRect},
+ {desc: 'FORM FEED', shape: 'rect', coords: "2\f2\f10\f10", hit: hitRect},
+ {desc: 'LINE FEED', shape: 'rect', coords: "2\n2\n10\n10", hit: hitRect},
+ {desc: 'CARRIGAGE RETURN', shape: 'rect', coords: "2\r2\r10\r10", hit: hitRect},
+ {desc: 'LINE TABULATION', shape: 'rect', coords: "2\u000b2\u000b10\u000b10", hit: hitNone},
+ {desc: 'LINE NEXT', shape: 'rect', coords: "2\u00852\u008510\u008510", hit: hitNone},
+ {desc: 'EN QUAD', shape: 'rect', coords: "2\u20002\u200010\u200010", hit: hitNone},
+ {desc: 'abc between numbers', shape: 'rect', coords: "2a2b20c20,2,10,10", hit: hitRect},
+ {desc: 'COLON between numbers', shape: 'rect', coords: "2:2:20:20,2,10,10", hit: hitRect},
+ {desc: 'U+0000 between numbers', shape: 'rect', coords: "2\u00002\u000020\u000020,2,10,10", hit: hitRect},
+ {desc: 'leading COMMA', shape: 'rect', coords: ",2,2,10,10", hit: hitRect},
+ {desc: 'leading SPACE', shape: 'rect', coords: " 2,2,10,10", hit: hitRect},
+ {desc: 'leading SEMICOLON', shape: 'rect', coords: ";2,2,10,10", hit: hitRect},
+ {desc: 'trailing COMMA', shape: 'rect', coords: "2,2,10,", hit: hitNone},
+ {desc: 'trailing SPACE', shape: 'rect', coords: "2,2,10 ", hit: hitNone},
+ {desc: 'trailing SEMICOLON', shape: 'rect', coords: "2,2,10;", hit: hitNone},
+ {desc: 'PERCENT', shape: 'rect', coords: "2%,2%,10%,10%", hit: hitRect},
+ {desc: 'CSS units', shape: 'rect', coords: "2in,2in,10cm,10cm", hit: hitRect},
+ {desc: 'float', shape: 'rect', coords: "1.4,1.4,10,10", hit: hitRect},
+ {desc: 'number starting with PERIOD', shape: 'rect', coords: ".4,.4,10,10", hit: [[area, 1, 1], [img, 0, 0]]},
+ {desc: 'sci-not', shape: 'rect', coords: "2,2,1e1,1e1", hit: hitRect},
+ {desc: 'leading/trailing garbage', shape: 'rect', coords: "='2,2,10,10' ", hit: hitRect},
+ {desc: 'non-ascii garbage', shape: 'rect', coords: "“2,2,10,10\"", hit: hitRect},
+ {desc: 'URL garbage with number', shape: 'rect', coords: "2,2,10ls/spain/holidays/regions/10/Canary+Islands/Canary+Islands.html", hit: hitNone},
+ {desc: 'consecutive COMMAs', shape: 'rect', coords: "2,,10,10", hit: hitNone},
+ {desc: 'consecutive SPACEs', shape: 'rect', coords: "2 10,10", hit: hitNone},
+ {desc: 'consecutive SEMICOLONs', shape: 'rect', coords: "2;;10,10", hit: hitNone},
+ {desc: 'several consecutive separators', shape: 'rect', coords: ",,2;,;2,;,10 \t\r\n10;;", hit: hitRect},
+ {desc: 'one too many numbers, trailing COMMA', shape: 'poly', coords: "100,100,120,100,100,120,300,", hit: hitPoly},
+];
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-processing.html b/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-processing.html
new file mode 100644
index 000000000..d1c3a83dd
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-processing.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLAreaElement processing</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<style>
+ body { margin: 0 }
+</style>
+<img src=/images/threecolors.png usemap=#x id=img width=300 height=300>
+<map name=x><area id=area></map>
+<script src=support/hit-test.js></script>
+<script>
+var tests = [
+ {desc: 'too few numbers', shape: 'rect', coords: "2,2,10", hit: hitNone},
+ {desc: 'negative', shape: 'rect', coords: "-10,-10,10,10", hit: [[area, 1, 1], [img, 299, 299]]},
+ {desc: 'empty string', shape: 'rect', coords: "", hit: hitNone},
+ {desc: 'omitted coords', shape: 'rect', coords: null, hit: hitNone},
+ {desc: 'first > third', shape: 'rect', coords: "10,2,2,10", hit: hitRect},
+ {desc: 'second > fourth', shape: 'rect', coords: "2,10,10,2", hit: hitRect},
+ {desc: 'first > third, second > fourth', shape: 'rect', coords: "10,10,2,2", hit: hitRect},
+
+ {desc: 'negative', shape: 'default', coords: "-10,-10,-10,-10", hit: hitAll},
+
+ {desc: 'too few numbers', shape: 'circle', coords: "20,40", hit: hitNone},
+ {desc: 'negative radius', shape: 'circle', coords: "20,40,-10", hit: hitNone},
+ {desc: 'zero radius', shape: 'circle', coords: "20,40,0", hit: hitNone},
+
+ {desc: 'too few numbers', shape: 'poly', coords: "100,100,120,100,100", hit: hitNone},
+ {desc: 'one too many numbers', shape: 'poly', coords: "100,100,120,100,100,120,300", hit: hitPoly},
+ {desc: 'even-odd rule', shape: 'poly', coords: "100,100,200,100,100,200,150,50,200,200", hit: hitStar},
+];
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-shape.html b/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-shape.html
new file mode 100644
index 000000000..1ad0690f9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-shape.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLAreaElement shape</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<style>
+ body { margin: 0 }
+</style>
+<img src=/images/threecolors.png usemap=#x id=img width=300 height=300>
+<map name=x><area id=area></map>
+<script src=support/hit-test.js></script>
+<script>
+var tests = [
+ {desc: 'missing value default', shape: null, coords: "2,2,10,10", hit: hitRect},
+ {desc: 'missing value default', shape: null, coords: "20,40,10", hit: hitNone},
+ {desc: 'missing value default', shape: null, coords: null, hit: hitNone},
+ {desc: 'invalid value default', shape: 'foobar invalid', coords: "2,2,10,10", hit: hitRect},
+ {desc: 'invalid value default', shape: '', coords: "2,2,10,10", hit: hitRect},
+
+ {desc: 'empty string', shape: 'default', coords: "", hit: hitAll},
+ {desc: 'omitted coords', shape: 'DEFAULT', coords: null, hit: hitAll},
+
+ {desc: 'simple', shape: 'rect', coords: "2,2,10,10", hit: hitRect},
+ {desc: 'simple', shape: 'rectangle', coords: "2,2,10,10", hit: hitRect},
+
+ {desc: 'simple', shape: 'circle', coords: "20,40,10", hit: hitCircle},
+ {desc: 'simple', shape: 'circ', coords: "20,40,10", hit: hitCircle},
+ {desc: 'simple', shape: 'CIRCLE', coords: "20,40,10", hit: hitCircle},
+ {desc: 'simple', shape: 'CIRC', coords: "20,40,10", hit: hitCircle},
+ {desc: 'LATIN CAPITAL LETTER I WITH DOT ABOVE', shape: 'C\u0130RCLE', coords: "20,40,10", hit: hitNone},
+ {desc: 'LATIN SMALL LETTER DOTLESS I', shape: 'c\u0131rcle', coords: "20,40,10", hit: hitNone},
+
+ {desc: 'simple', shape: 'poly', coords: "100,100,120,100,100,120", hit: hitPoly},
+ {desc: 'simple', shape: 'polygon', coords: "100,100,120,100,100,120", hit: hitPoly},
+];
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-stringifier.html b/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-stringifier.html
new file mode 100644
index 000000000..d06429630
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/area-stringifier.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<title>HTMLAreaElement stringifier</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://heycam.github.io/webidl/#es-stringifier">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=/common/stringifiers.js></script>
+<div id=log></div>
+<script>
+test(function() {
+ test_stringifier_attribute(document.createElement("area"), "href", false);
+ var area = document.createElement("area");
+ area.setAttribute("href", "foo");
+ test_stringifier_attribute(area, "href", false);
+})
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/support/hit-test.js b/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/support/hit-test.js
new file mode 100644
index 000000000..54cda3e5c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-area-element/support/hit-test.js
@@ -0,0 +1,42 @@
+setup({explicit_done: true});
+
+var img = document.getElementById('img');
+var area = document.getElementById('area');
+
+var hitRect = [[area, 3, 3], [area, 9, 9], [img, 1, 3], [img, 3, 1], [img, 11, 9], [img, 9, 11], [img, 21, 41], [img, 101, 101]];
+var hitNone = [[img, 3, 3], [img, 9, 9], [img, 1, 3], [img, 3, 1], [img, 11, 9], [img, 9, 11], [img, 21, 41], [img, 101, 101]];
+var hitAll = [[area, 1, 1], [area, 1, 299], [area, 299, 1], [area, 299, 299], [area, 21, 41], [area, 101, 101]];
+var hitCircle = [[area, 11, 40], [area, 29, 40], [area, 20, 31], [area, 20, 49], [img, 12, 32], [img, 28, 48], [img, 101, 101]];
+var hitPoly = [[area, 101, 101], [area, 119, 101], [area, 101, 119], [img, 118, 118], [img, 3, 3], [img, 21, 41]];
+var hitStar = [[area, 101, 101], [area, 199, 101], [area, 150, 51], [img, 150, 125], [img, 3, 3], [img, 21, 41]];
+
+var tests;
+// The test file should have `tests` defined as follows:
+// tests = [
+// {desc: string, shape: string?, coords: string?, hit: [[element, x, y], ...]},
+// ...
+// ];
+
+onload = function() {
+ tests.forEach(function(t) {
+ test(function(t_obj) {
+ if (area.shape === null) {
+ area.removeAttribute('shape');
+ } else {
+ area.shape = t.shape;
+ }
+ if (area.coords === null) {
+ area.removeAttribute('coords');
+ } else {
+ area.coords = t.coords;
+ }
+ t.hit.forEach(function(arr) {
+ var expected = arr[0];
+ var x = arr[1];
+ var y = arr[2];
+ assert_equals(document.elementFromPoint(x, y), expected, 'elementFromPoint('+x+', '+y+')');
+ });
+ }, t.desc + ': ' + format_value(t.coords) + ' (' + t.shape + ')');
+ });
+ done();
+};
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_001.htm b/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_001.htm
new file mode 100644
index 000000000..f455c6824
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_001.htm
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>HTML5 Media Elements: Content inside the 'audio' element is not shown to the user (image).</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="https://html.spec.whatwg.org/multipage/#audio" />
+ <link rel="match" href="audio_content-ref.htm" />
+ <meta name="assert" content="Content inside the 'audio' element is not shown to the user (image)." />
+</head>
+<body>
+<p>Test passes if there is no red.</p>
+<div id='testcontent'>
+<audio><img src="../../../../images/fail.gif" /></audio>
+
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_002.htm b/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_002.htm
new file mode 100644
index 000000000..23b3ea188
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_002.htm
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>HTML5 Media Elements: Content inside the 'audio' element is not shown to the user.</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="https://html.spec.whatwg.org/multipage/#audio" />
+ <link rel="match" href="audio_content-ref.htm" />
+ <meta name="assert" content="Content inside the 'audio' element is not shown to the user." />
+</head>
+<body>
+<p>Test passes if there is no red.</p>
+<div id='testcontent'>
+<audio><span style="color: red;">FAIL</span></audio>
+
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_constructor.html b/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_constructor.html
new file mode 100644
index 000000000..242098869
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_constructor.html
@@ -0,0 +1,50 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Audio constructor</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ var throwingObject = {
+ toString: function() { throw Error() },
+ valueOf: function() { throw Error() }
+ };
+ var tests = [
+ [function() { return new Audio() }, null, "No arguments"],
+ [function() { return new Audio("") }, "", "Empty string argument"],
+ [function() { return new Audio("src") }, "src", "Non-empty string argument"],
+ [function() { return new Audio(null) }, "null", "Null argument"],
+ [function() { return new Audio(undefined) }, null, "Undefined argument"],
+ [function() { return new Audio("", throwingObject) }, "", "Extra argument"],
+ ];
+ tests.forEach(function(t) {
+ var fn = t[0], expectedSrc = t[1], description = t[2];
+ test(function() {
+ var element = fn();
+ assert_equals(element.localName, "audio");
+ assert_equals(element.tagName, "AUDIO");
+ assert_equals(element.namespaceURI, "http://www.w3.org/1999/xhtml");
+ assert_equals(element.nodeType, Node.ELEMENT_NODE);
+ assert_equals(element.getAttribute("preload"), "auto");
+ assert_equals(element.getAttribute("src"), expectedSrc);
+ assert_equals(element.ownerDocument, document);
+ }, description);
+ });
+});
+test(function() {
+ assert_throws(new TypeError(), function() {
+ Audio();
+ });
+}, "Calling Audio should throw");
+test(function() {
+ assert_throws(new TypeError(), function() {
+ HTMLAudioElement();
+ });
+}, "Calling HTMLAudioElement should throw");
+test(function() {
+ assert_throws(new TypeError(), function() {
+ new HTMLAudioElement();
+ });
+}, "Constructing HTMLAudioElement should throw");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_content-ref.htm b/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_content-ref.htm
new file mode 100644
index 000000000..ef5964496
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-audio-element/audio_content-ref.htm
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>HTML5 Media Elements: Content inside the 'audio' element is not shown to the user.</title>
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+</head>
+<body>
+<p>Test passes if there is no red.</p>
+<div id='testcontent'>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.canvas.readonly.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.canvas.readonly.html
new file mode 100644
index 000000000..5e1c22d2d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.canvas.readonly.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.canvas.readonly</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.canvas.readonly</h1>
+<p class="desc">CanvasRenderingContext2D.canvas is readonly</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("CanvasRenderingContext2D.canvas is readonly");
+_addTest(function(canvas, ctx) {
+
+var c = document.createElement('canvas');
+var d = ctx.canvas;
+_assertDifferent(c, d, "c", "d");
+ctx.canvas = c;
+_assertSame(ctx.canvas, d, "ctx.canvas", "d");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.canvas.reference.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.canvas.reference.html
new file mode 100644
index 000000000..5bdb233f6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.canvas.reference.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.canvas.reference</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.canvas.reference</h1>
+<p class="desc">CanvasRenderingContext2D.canvas refers back to its canvas</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("CanvasRenderingContext2D.canvas refers back to its canvas");
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.canvas, canvas, "ctx.canvas", "canvas");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.exists.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.exists.html
new file mode 100644
index 000000000..f8b768ad8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.exists.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.getcontext.exists</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.getcontext.exists</h1>
+<p class="desc">The 2D context is implemented</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("The 2D context is implemented");
+_addTest(function(canvas, ctx) {
+
+_assertDifferent(canvas.getContext('2d'), null, "canvas.getContext('2d')", "null");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.html
new file mode 100644
index 000000000..f58911d04
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.getcontext.extraargs</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.getcontext.extraargs</h1>
+<p class="desc">The 2D context ignores extra getContext arguments</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("The 2D context ignores extra getContext arguments");
+_addTest(function(canvas, ctx) {
+
+_assertDifferent(canvas.getContext('2d', false, {}, [], 1, "2"), null, "canvas.getContext('2d', false, {}, [], 1, \"2\")", "null");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.shared.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.shared.html
new file mode 100644
index 000000000..a678a135f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.shared.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.getcontext.shared</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.getcontext.shared</h1>
+<p class="desc">getContext('2d') returns objects which share canvas state</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("getContext('2d') returns objects which share canvas state");
+_addTest(function(canvas, ctx) {
+
+var ctx2 = canvas.getContext('2d');
+ctx.fillStyle = '#f00';
+ctx2.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.unique.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.unique.html
new file mode 100644
index 000000000..d4d4a0d17
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.unique.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.getcontext.unique</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.getcontext.unique</h1>
+<p class="desc">getContext('2d') returns the same object</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("getContext('2d') returns the same object");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext('2d'), canvas.getContext('2d'), "canvas.getContext('2d')", "canvas.getContext('2d')");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.scaled-manual.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.scaled-manual.html
new file mode 100644
index 000000000..6ea8ba4b9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.scaled-manual.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.scaled</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.scaled</h1>
+<p class="desc">CSS-scaled canvases get drawn correctly</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="25" style="width: 100px; height: 50px"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.scaled.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("CSS-scaled canvases get drawn correctly");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#00f';
+ctx.fillRect(0, 0, 50, 25);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(0, 0, 25, 10);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.scaled.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.scaled.png
new file mode 100644
index 000000000..875407769
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.scaled.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.exists.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.exists.html
new file mode 100644
index 000000000..f29f13926
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.exists.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.type.exists</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.type.exists</h1>
+<p class="desc">The 2D context interface is a property of 'window'</p>
+
+<p class="notes">Defined in "Web IDL" (draft)
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("The 2D context interface is a property of 'window'");
+_addTest(function(canvas, ctx) {
+
+_assert(window.CanvasRenderingContext2D, "window.CanvasRenderingContext2D");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.extend.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.extend.html
new file mode 100644
index 000000000..f4dfea879
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.extend.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.type.extend</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.type.extend</h1>
+<p class="desc">Interface methods can be added</p>
+
+<p class="notes">Defined in "Web IDL" (draft)
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Interface methods can be added");
+_addTest(function(canvas, ctx) {
+
+window.CanvasRenderingContext2D.prototype.fillRectGreen = function (x, y, w, h)
+{
+ this.fillStyle = '#0f0';
+ this.fillRect(x, y, w, h);
+};
+ctx.fillStyle = '#f00';
+ctx.fillRectGreen(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.prototype.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.prototype.html
new file mode 100644
index 000000000..9888d7b6a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.prototype.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.type.prototype</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.type.prototype</h1>
+<p class="desc">window.CanvasRenderingContext2D.prototype are not [[Writable]] and not [[Configurable]], and its methods are [[Configurable]].</p>
+
+<p class="notes">Defined in "Web IDL" (draft)
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("window.CanvasRenderingContext2D.prototype are not [[Writable]] and not [[Configurable]], and its methods are [[Configurable]].");
+_addTest(function(canvas, ctx) {
+
+_assert(window.CanvasRenderingContext2D.prototype, "window.CanvasRenderingContext2D.prototype");
+_assert(window.CanvasRenderingContext2D.prototype.fill, "window.CanvasRenderingContext2D.prototype.fill");
+window.CanvasRenderingContext2D.prototype = null;
+_assert(window.CanvasRenderingContext2D.prototype, "window.CanvasRenderingContext2D.prototype");
+delete window.CanvasRenderingContext2D.prototype;
+_assert(window.CanvasRenderingContext2D.prototype, "window.CanvasRenderingContext2D.prototype");
+window.CanvasRenderingContext2D.prototype.fill = 1;
+_assertSame(window.CanvasRenderingContext2D.prototype.fill, 1, "window.CanvasRenderingContext2D.prototype.fill", "1");
+delete window.CanvasRenderingContext2D.prototype.fill;
+_assertSame(window.CanvasRenderingContext2D.prototype.fill, undefined, "window.CanvasRenderingContext2D.prototype.fill", "undefined");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.replace.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.replace.html
new file mode 100644
index 000000000..1e3337732
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/2d.type.replace.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.type.replace</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.type.replace</h1>
+<p class="desc">Interface methods can be overridden</p>
+
+<p class="notes">Defined in "Web IDL" (draft)
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Interface methods can be overridden");
+_addTest(function(canvas, ctx) {
+
+var fillRect = window.CanvasRenderingContext2D.prototype.fillRect;
+window.CanvasRenderingContext2D.prototype.fillRect = function (x, y, w, h)
+{
+ this.fillStyle = '#0f0';
+ fillRect.call(this, x, y, w, h);
+};
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/contains.json b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/contains.json
new file mode 100644
index 000000000..3f56f4fd8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/contains.json
@@ -0,0 +1,10 @@
+[
+ {
+ "id": "color-spaces-and-color-correction",
+ "original_id": "color-spaces-and-color-correction"
+ },
+ {
+ "id": "security-with-canvas-elements",
+ "original_id": "security-with-canvas-elements"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.arguments.missing.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.arguments.missing.html
new file mode 100644
index 000000000..37ae4e800
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.arguments.missing.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: context.arguments.missing</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>context.arguments.missing</h1>
+<p class="desc"></p>
+
+<p class="notes">Defined in "Web IDL" (draft)
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+assert_throws(new TypeError(), function() { canvas.getContext(); });
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.casesensitive.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.casesensitive.html
new file mode 100644
index 000000000..5c64f7a04
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.casesensitive.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: context.casesensitive</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>context.casesensitive</h1>
+<p class="desc">Context name "2D" is unrecognised; matching is case sensitive</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Context name \"2D\" is unrecognised; matching is case sensitive");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext('2D'), null, "canvas.getContext('2D')", "null");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.emptystring.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.emptystring.html
new file mode 100644
index 000000000..8f8b44a23
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.emptystring.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: context.emptystring</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>context.emptystring</h1>
+<p class="desc">getContext with empty string returns null</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("getContext with empty string returns null");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext(""), null, "canvas.getContext(\"\")", "null");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.badname.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.badname.html
new file mode 100644
index 000000000..75f442774
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.badname.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: context.unrecognised.badname</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>context.unrecognised.badname</h1>
+<p class="desc">getContext with unrecognised context name returns null</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("getContext with unrecognised context name returns null");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext('This is not an implemented context in any real browser'), null, "canvas.getContext('This is not an implemented context in any real browser')", "null");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.badsuffix.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.badsuffix.html
new file mode 100644
index 000000000..2f65ae3c8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.badsuffix.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: context.unrecognised.badsuffix</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>context.unrecognised.badsuffix</h1>
+<p class="desc">Context name "2d" plus a suffix is unrecognised</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Context name \"2d\" plus a suffix is unrecognised");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext("2d#"), null, "canvas.getContext(\"2d#\")", "null");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.nullsuffix.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.nullsuffix.html
new file mode 100644
index 000000000..1607fec86
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.nullsuffix.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: context.unrecognised.nullsuffix</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>context.unrecognised.nullsuffix</h1>
+<p class="desc">Context name "2d" plus a "\0" suffix is unrecognised</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Context name \"2d\" plus a \"\\0\" suffix is unrecognised");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext("2d\0"), null, "canvas.getContext(\"2d\\0\")", "null");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.unicode.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.unicode.html
new file mode 100644
index 000000000..c4eb943c2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/context.unrecognised.unicode.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: context.unrecognised.unicode</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>context.unrecognised.unicode</h1>
+<p class="desc">Context name which kind of looks like "2d" is unrecognised</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Context name which kind of looks like \"2d\" is unrecognised");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext("2\uFF44"), null, "canvas.getContext(\"2\\uFF44\")", "null"); // Fullwidth Latin Small Letter D
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/fallback.basic.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/fallback.basic.html
new file mode 100644
index 000000000..0bae976e8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/fallback.basic.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: fallback.basic</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>fallback.basic</h1>
+<p class="desc">Fallback content is inserted into the DOM</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Fallback content is inserted into the DOM");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.childNodes.length, 1, "canvas.childNodes.length", "1");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/fallback.multiple.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/fallback.multiple.html
new file mode 100644
index 000000000..5c89be519
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/fallback.multiple.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: fallback.multiple</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>fallback.multiple</h1>
+<p class="desc">Fallback content with multiple elements</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL</p><p class="fallback">FAIL</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Fallback content with multiple elements");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.childNodes.length, 2, "canvas.childNodes.length", "2");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/fallback.nested.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/fallback.nested.html
new file mode 100644
index 000000000..e84739c85
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/fallback.nested.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: fallback.nested</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>fallback.nested</h1>
+<p class="desc">Fallback content containing another canvas (mostly testing parsers)</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><canvas><p class="fallback">FAIL (fallback content)</p></canvas><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Fallback content containing another canvas (mostly testing parsers)");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.childNodes.length, 2, "canvas.childNodes.length", "2");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/historical.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/historical.html
new file mode 100644
index 000000000..58ebc5769
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/historical.html
@@ -0,0 +1,77 @@
+<!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, context;
+setup(function() {
+ canvas = document.createElement("canvas");
+ context = canvas.getContext('2d');
+ path2d = new Path2D();
+});
+function t(member, obj) {
+ var name = obj === canvas ? "Canvas" : String(obj).match(/\[object (\S+)\]/)[1];
+ test(function() {
+ assert_false(member in obj);
+ }, name + " support for " + member);
+}
+// added in https://github.com/whatwg/html/commit/0ecbf0e010df16d9c6d11eef6b2c58419158c4da
+// renamed in https://github.com/whatwg/html/commit/2542a12cb25ee93534cbed1f31b5e1bc05fcdd0e
+t("supportsContext", canvas);
+
+// removed in https://github.com/whatwg/html/commit/2cfb8e3f03d3166842d2ad0f661459d26e2a40eb
+t("probablySupportsContext", canvas);
+
+// removed in https://github.com/whatwg/html/commit/ef72f55da4acdf266174225c6ca8bf2a650d0219
+t("width", context);
+t("height", context);
+
+// removed in https://github.com/whatwg/html/commit/740634d0f30a3b76e9da166ac2fa8835fcc073ab
+t("setContext", canvas);
+t("transferControlToProxy", canvas);
+t("CanvasProxy", window);
+t("commit", canvas);
+test(function() {
+ assert_throws(new TypeError(), function() {
+ new CanvasRenderingContext2D();
+ }, 'no arguments');
+ assert_throws(new TypeError(), function() {
+ new CanvasRenderingContext2D(1, 1);
+ }, 'with arguments');
+}, "CanvasRenderingContext2D constructors");
+
+// removed in https://github.com/whatwg/html/commit/e1d04f49a38e2254a783c28987457a95a47d9511
+t("addPathByStrokingPath", path2d);
+t("addText", path2d);
+t("addPathByStrokingText", path2d);
+
+// renamed in https://github.com/whatwg/html/commit/fcb0756dd94d96df9b8355741d82fcd5ca0a6154
+test(function() {
+ var canvas = document.createElement('canvas');
+ var context = canvas.getContext('bitmaprenderer');
+ if (context) {
+ assert_false('transferImageBitmap' in context);
+ }
+}, 'ImageBitmapRenderingContext support for transferImageBitmap');
+
+// renamed in https://github.com/whatwg/html/commit/3aec2a7e04a3402201afd29c224b57fa54497517
+t('Path', window);
+
+// removed in https://github.com/whatwg/html/commit/d5759b0435091e4858c9bff90319cbe5b040eda2
+t('toDataURLHD', canvas);
+t('toBlobHD', canvas);
+t('createImageDataHD', context);
+t('getImageDataHD', context);
+t('putImageDataHD', context);
+test(function() {
+ if ('ImageData' in window) {
+ assert_false('resolution' in new ImageData(1, 1));
+ }
+}, 'ImageData support for resolution');
+
+// dropped/renamed in https://github.com/whatwg/html/commit/ff07c6d630fb986f6c4f64b2fb87387b4f89647d
+t('drawSystemFocusRing', context);
+t('drawCustomFocusRing', context);
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.colour.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.colour.html
new file mode 100644
index 000000000..f680d504c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.colour.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: initial.colour</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>initial.colour</h1>
+<p class="desc">Initial state is transparent black</p>
+
+<p class="notes">Output should be transparent black (not transparent anything-else), but manual
+verification can only confirm that it's transparent - it's not possible to make
+the actual blackness visible.
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="initial.colour.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Initial state is transparent black");
+_addTest(function(canvas, ctx) {
+
+_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.colour.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.colour.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.colour.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.2dstate.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.2dstate.html
new file mode 100644
index 000000000..b51253a6e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.2dstate.html
@@ -0,0 +1,103 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: initial.reset.2dstate</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>initial.reset.2dstate</h1>
+<p class="desc">Resetting the canvas state resets 2D state variables</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Resetting the canvas state resets 2D state variables");
+_addTest(function(canvas, ctx) {
+
+canvas.width = 100;
+var default_val;
+
+default_val = ctx.strokeStyle;
+ctx.strokeStyle = "#ff0000";
+canvas.width = 100;
+_assertSame(ctx.strokeStyle, default_val, "ctx.strokeStyle", "default_val");
+
+default_val = ctx.fillStyle;
+ctx.fillStyle = "#ff0000";
+canvas.width = 100;
+_assertSame(ctx.fillStyle, default_val, "ctx.fillStyle", "default_val");
+
+default_val = ctx.globalAlpha;
+ctx.globalAlpha = 0.5;
+canvas.width = 100;
+_assertSame(ctx.globalAlpha, default_val, "ctx.globalAlpha", "default_val");
+
+default_val = ctx.lineWidth;
+ctx.lineWidth = 0.5;
+canvas.width = 100;
+_assertSame(ctx.lineWidth, default_val, "ctx.lineWidth", "default_val");
+
+default_val = ctx.lineCap;
+ctx.lineCap = "round";
+canvas.width = 100;
+_assertSame(ctx.lineCap, default_val, "ctx.lineCap", "default_val");
+
+default_val = ctx.lineJoin;
+ctx.lineJoin = "round";
+canvas.width = 100;
+_assertSame(ctx.lineJoin, default_val, "ctx.lineJoin", "default_val");
+
+default_val = ctx.miterLimit;
+ctx.miterLimit = 0.5;
+canvas.width = 100;
+_assertSame(ctx.miterLimit, default_val, "ctx.miterLimit", "default_val");
+
+default_val = ctx.shadowOffsetX;
+ctx.shadowOffsetX = 5;
+canvas.width = 100;
+_assertSame(ctx.shadowOffsetX, default_val, "ctx.shadowOffsetX", "default_val");
+
+default_val = ctx.shadowOffsetY;
+ctx.shadowOffsetY = 5;
+canvas.width = 100;
+_assertSame(ctx.shadowOffsetY, default_val, "ctx.shadowOffsetY", "default_val");
+
+default_val = ctx.shadowBlur;
+ctx.shadowBlur = 5;
+canvas.width = 100;
+_assertSame(ctx.shadowBlur, default_val, "ctx.shadowBlur", "default_val");
+
+default_val = ctx.shadowColor;
+ctx.shadowColor = "#ff0000";
+canvas.width = 100;
+_assertSame(ctx.shadowColor, default_val, "ctx.shadowColor", "default_val");
+
+default_val = ctx.globalCompositeOperation;
+ctx.globalCompositeOperation = "copy";
+canvas.width = 100;
+_assertSame(ctx.globalCompositeOperation, default_val, "ctx.globalCompositeOperation", "default_val");
+
+default_val = ctx.font;
+ctx.font = "25px serif";
+canvas.width = 100;
+_assertSame(ctx.font, default_val, "ctx.font", "default_val");
+
+default_val = ctx.textAlign;
+ctx.textAlign = "center";
+canvas.width = 100;
+_assertSame(ctx.textAlign, default_val, "ctx.textAlign", "default_val");
+
+default_val = ctx.textBaseline;
+ctx.textBaseline = "bottom";
+canvas.width = 100;
+_assertSame(ctx.textBaseline, default_val, "ctx.textBaseline", "default_val");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.clip.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.clip.html
new file mode 100644
index 000000000..044ccc583
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.clip.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: initial.reset.clip</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>initial.reset.clip</h1>
+<p class="desc">Resetting the canvas state resets the current clip region</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Resetting the canvas state resets the current clip region");
+_addTest(function(canvas, ctx) {
+
+canvas.width = 100;
+ctx.rect(0, 0, 1, 1);
+ctx.clip();
+canvas.width = 100;
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.different.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.different.html
new file mode 100644
index 000000000..0d02f40d6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.different.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: initial.reset.different</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>initial.reset.different</h1>
+<p class="desc">Changing size resets canvas to transparent black</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="initial.reset.different.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Changing size resets canvas to transparent black");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 20,20, 255,0,0,255, "20,20", "255,0,0,255");
+canvas.width = 50;
+_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.different.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.different.png
new file mode 100644
index 000000000..d83fdd55b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.different.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.gradient.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.gradient.html
new file mode 100644
index 000000000..a1a8516d3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.gradient.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: initial.reset.gradient</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>initial.reset.gradient</h1>
+<p class="desc">Resetting the canvas state does not invalidate any existing gradients</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Resetting the canvas state does not invalidate any existing gradients");
+_addTest(function(canvas, ctx) {
+
+canvas.width = 50;
+var g = ctx.createLinearGradient(0, 0, 100, 0);
+g.addColorStop(0, '#0f0');
+g.addColorStop(1, '#0f0');
+canvas.width = 100;
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.path.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.path.html
new file mode 100644
index 000000000..ab59ce9a1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.path.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: initial.reset.path</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>initial.reset.path</h1>
+<p class="desc">Resetting the canvas state resets the current path</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="initial.reset.path.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Resetting the canvas state resets the current path");
+_addTest(function(canvas, ctx) {
+
+canvas.width = 100;
+ctx.rect(0, 0, 100, 50);
+canvas.width = 100;
+ctx.fillStyle = '#f00';
+ctx.fill();
+_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.path.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.path.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.path.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.pattern.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.pattern.html
new file mode 100644
index 000000000..f569d21f2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.pattern.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: initial.reset.pattern</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>initial.reset.pattern</h1>
+<p class="desc">Resetting the canvas state does not invalidate any existing patterns</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Resetting the canvas state does not invalidate any existing patterns");
+_addTest(function(canvas, ctx) {
+
+canvas.width = 30;
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 30, 50);
+var p = ctx.createPattern(canvas, 'repeat-x');
+canvas.width = 100;
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = p;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.same.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.same.html
new file mode 100644
index 000000000..b0bf73f8f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.same.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: initial.reset.same</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>initial.reset.same</h1>
+<p class="desc">Setting size (not changing the value) resets canvas to transparent black</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="initial.reset.same.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Setting size (not changing the value) resets canvas to transparent black");
+_addTest(function(canvas, ctx) {
+
+canvas.width = 100;
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 20,20, 255,0,0,255, "20,20", "255,0,0,255");
+canvas.width = 100;
+_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.same.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.same.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.same.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.transform.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.transform.html
new file mode 100644
index 000000000..c5a92ca0f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/initial.reset.transform.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: initial.reset.transform</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>initial.reset.transform</h1>
+<p class="desc">Resetting the canvas state resets the current transformation matrix</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Resetting the canvas state resets the current transformation matrix");
+_addTest(function(canvas, ctx) {
+
+canvas.width = 100;
+ctx.scale(0.1, 0.1);
+canvas.width = 100;
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.dataURI.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.dataURI.html
new file mode 100644
index 000000000..d13057915
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.dataURI.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: security.dataURI</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>security.dataURI</h1>
+<p class="desc">data: URIs do not count as different-origin, and do not taint the canvas</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("data: URIs do not count as different-origin, and do not taint the canvas");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+var data = canvas.toDataURL();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+var img = new Image();
+deferTest();
+img.onload = t.step_func_done(function ()
+{
+ ctx.drawImage(img, 0, 0);
+ canvas.toDataURL(); // should be permitted
+ _assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+});
+img.src = data;
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.canvas.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.canvas.html
new file mode 100644
index 000000000..918bf8f8f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.canvas.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: security.drawImage.canvas</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>security.drawImage.canvas</h1>
+<p class="desc">drawImage of unclean canvas makes the canvas origin-unclean</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("drawImage of unclean canvas makes the canvas origin-unclean");
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow.png'), 0, 0);
+ctx.drawImage(canvas2, 0, 0);
+assert_throws("SECURITY_ERR", function() { canvas.toDataURL(); });
+assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
+
+
+});
+</script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.image.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.image.html
new file mode 100644
index 000000000..48f808aa6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.image.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: security.drawImage.image</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>security.drawImage.image</h1>
+<p class="desc">drawImage of different-origin image makes the canvas origin-unclean</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("drawImage of different-origin image makes the canvas origin-unclean");
+_addTest(function(canvas, ctx) {
+
+ctx.drawImage(document.getElementById('yellow.png'), 0, 0);
+assert_throws("SECURITY_ERR", function() { canvas.toDataURL(); });
+assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
+
+
+});
+</script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.fillStyle.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.fillStyle.html
new file mode 100644
index 000000000..2997ef9bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.fillStyle.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: security.pattern.canvas.fillStyle</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>security.pattern.canvas.fillStyle</h1>
+<p class="desc">Setting fillStyle to a pattern of an unclean canvas makes the canvas origin-unclean</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Setting fillStyle to a pattern of an unclean canvas makes the canvas origin-unclean");
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow.png'), 0, 0);
+var p = ctx.createPattern(canvas2, 'repeat');
+ctx.fillStyle = p;
+ctx.fillStyle = 'red';
+assert_throws("SECURITY_ERR", function() { canvas.toDataURL(); });
+assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
+
+
+});
+</script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.strokeStyle.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.strokeStyle.html
new file mode 100644
index 000000000..8980d2d53
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.strokeStyle.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: security.pattern.canvas.strokeStyle</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>security.pattern.canvas.strokeStyle</h1>
+<p class="desc">Setting strokeStyle to a pattern of an unclean canvas makes the canvas origin-unclean</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Setting strokeStyle to a pattern of an unclean canvas makes the canvas origin-unclean");
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow.png'), 0, 0);
+var p = ctx.createPattern(canvas2, 'repeat');
+ctx.strokeStyle = p;
+ctx.strokeStyle = 'red';
+assert_throws("SECURITY_ERR", function() { canvas.toDataURL(); });
+assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
+
+
+});
+</script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.timing.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.timing.html
new file mode 100644
index 000000000..bb5fd58e6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.timing.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: security.pattern.canvas.timing</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>security.pattern.canvas.timing</h1>
+<p class="desc">Pattern safety depends on whether the source was origin-clean, not on whether it still is clean</p>
+
+<p class="notes">Disagrees with spec on "is" vs "was"
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Pattern safety depends on whether the source was origin-clean, not on whether it still is clean");
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#0f0';
+ctx2.fillRect(0, 0, 100, 50);
+var p = ctx.createPattern(canvas2, 'repeat');
+ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); // make canvas2 origin-unclean
+ctx.fillStyle = p;
+ctx.fillRect(0, 0, 100, 50);
+canvas.toDataURL();
+ctx.getImageData(0, 0, 1, 1);
+_assert(true, "true"); // okay if there was no exception
+
+
+});
+</script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.create.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.create.html
new file mode 100644
index 000000000..b81c6dfa5
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.create.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: security.pattern.create</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>security.pattern.create</h1>
+<p class="desc">Creating an unclean pattern does not make the canvas origin-unclean</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Creating an unclean pattern does not make the canvas origin-unclean");
+_addTest(function(canvas, ctx) {
+
+var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat');
+canvas.toDataURL();
+ctx.getImageData(0, 0, 1, 1);
+_assert(true, "true"); // okay if there was no exception
+
+
+});
+</script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.cross.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.cross.html
new file mode 100644
index 000000000..67e40bdaa
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.cross.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: security.pattern.cross</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>security.pattern.cross</h1>
+<p class="desc">Using an unclean pattern makes the target canvas origin-unclean, not the pattern canvas</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Using an unclean pattern makes the target canvas origin-unclean, not the pattern canvas");
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+var p = ctx2.createPattern(document.getElementById('yellow.png'), 'repeat');
+ctx.fillStyle = p;
+ctx.fillRect(0, 0, 100, 50);
+assert_throws("SECURITY_ERR", function() { canvas.toDataURL(); });
+assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
+canvas2.toDataURL();
+ctx2.getImageData(0, 0, 1, 1);
+
+
+});
+</script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.fillStyle.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.fillStyle.html
new file mode 100644
index 000000000..758c30a12
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.fillStyle.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: security.pattern.image.fillStyle</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>security.pattern.image.fillStyle</h1>
+<p class="desc">Setting fillStyle to a pattern of a different-origin image makes the canvas origin-unclean</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Setting fillStyle to a pattern of a different-origin image makes the canvas origin-unclean");
+_addTest(function(canvas, ctx) {
+
+var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat');
+ctx.fillStyle = p;
+ctx.fillStyle = 'red';
+assert_throws("SECURITY_ERR", function() { canvas.toDataURL(); });
+assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
+
+
+});
+</script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.strokeStyle.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.strokeStyle.html
new file mode 100644
index 000000000..771523973
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.strokeStyle.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: security.pattern.image.strokeStyle</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>security.pattern.image.strokeStyle</h1>
+<p class="desc">Setting strokeStyle to a pattern of a different-origin image makes the canvas origin-unclean</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Setting strokeStyle to a pattern of a different-origin image makes the canvas origin-unclean");
+_addTest(function(canvas, ctx) {
+
+var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat');
+ctx.strokeStyle = p;
+ctx.strokeStyle = 'red';
+assert_throws("SECURITY_ERR", function() { canvas.toDataURL(); });
+assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
+
+
+});
+</script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.reset.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.reset.html
new file mode 100644
index 000000000..28e65f90e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.reset.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: security.reset</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>security.reset</h1>
+<p class="desc">Resetting the canvas state does not reset the origin-clean flag</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Resetting the canvas state does not reset the origin-clean flag");
+_addTest(function(canvas, ctx) {
+
+canvas.width = 50;
+ctx.drawImage(document.getElementById('yellow.png'), 0, 0);
+assert_throws("SECURITY_ERR", function() { canvas.toDataURL(); });
+canvas.width = 100;
+assert_throws("SECURITY_ERR", function() { canvas.toDataURL(); });
+
+
+});
+</script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.default.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.default.html
new file mode 100644
index 000000000..004636d84
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.default.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.default</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.default</h1>
+<p class="desc">Default width/height when attributes are missing</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" ><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.default.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Default width/height when attributes are missing");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+_assert(!canvas.hasAttribute('width'), "!canvas.hasAttribute('width')");
+_assert(!canvas.hasAttribute('height'), "!canvas.hasAttribute('height')");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.default.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.default.png
new file mode 100644
index 000000000..a72d04755
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.default.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.get.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.get.png
new file mode 100644
index 000000000..47830c83e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.get.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.idl.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.idl.html
new file mode 100644
index 000000000..cd6796e07
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.idl.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.idl</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.idl</h1>
+<p class="desc">Getting/setting width/height IDL attributes</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Getting/setting width/height IDL attributes");
+_addTest(function(canvas, ctx) {
+
+canvas.width = "100";
+canvas.height = "100";
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+
+canvas.width = "+1.5e2";
+canvas.height = "0x96";
+_assertSame(canvas.width, 150, "canvas.width", "150");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+
+canvas.width = 200 - Math.pow(2, 32);
+canvas.height = 200 - Math.pow(2, 32);
+_assertSame(canvas.width, 200, "canvas.width", "200");
+_assertSame(canvas.height, 200, "canvas.height", "200");
+
+canvas.width = 301.999;
+canvas.height = 301.001;
+_assertSame(canvas.width, 301, "canvas.width", "301");
+_assertSame(canvas.height, 301, "canvas.height", "301");
+
+canvas.width = "400x";
+canvas.height = "foo";
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.idl.set.zero.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.idl.set.zero.html
new file mode 100644
index 000000000..a10ac5443
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.idl.set.zero.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.idl.set.zero</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.idl.set.zero</h1>
+<p class="desc">Setting width/height IDL attributes to 0</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Setting width/height IDL attributes to 0");
+_addTest(function(canvas, ctx) {
+
+canvas.width = 0;
+canvas.height = 0;
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.html
new file mode 100644
index 000000000..ccf579e05
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.decimal</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.decimal</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100.999" height="100.999"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.decimal.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '100.999', "canvas.getAttribute('width')", "'100.999'");
+_assertSame(canvas.getAttribute('height'), '100.999', "canvas.getAttribute('height')", "'100.999'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.html
new file mode 100644
index 000000000..84614691a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.em</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.em</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100em" height="100em"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.em.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '100em', "canvas.getAttribute('width')", "'100em'");
+_assertSame(canvas.getAttribute('height'), '100em', "canvas.getAttribute('height')", "'100em'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.html
new file mode 100644
index 000000000..04a19b44a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.empty</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.empty</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="" height=""><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.empty.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+_assertSame(canvas.getAttribute('width'), '', "canvas.getAttribute('width')", "''");
+_assertSame(canvas.getAttribute('height'), '', "canvas.getAttribute('height')", "''");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.png
new file mode 100644
index 000000000..a72d04755
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.html
new file mode 100644
index 000000000..7a7c72692
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.exp</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.exp</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100e1" height="100e1"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.exp.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '100e1', "canvas.getAttribute('width')", "'100e1'");
+_assertSame(canvas.getAttribute('height'), '100e1', "canvas.getAttribute('height')", "'100e1'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.hex.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.hex.html
new file mode 100644
index 000000000..7532d7753
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.hex.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.hex</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.hex</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="0x100" height="0x100"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\"");
+_assertSame(canvas.getAttribute('width'), '0x100', "canvas.getAttribute('width')", "'0x100'");
+_assertSame(canvas.getAttribute('height'), '0x100', "canvas.getAttribute('height')", "'0x100'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.html
new file mode 100644
index 000000000..8dca5ef3c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.junk</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.junk</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="#!?" height="#!?"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.junk.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+_assertSame(canvas.getAttribute('width'), '#!?', "canvas.getAttribute('width')", "'#!?'");
+_assertSame(canvas.getAttribute('height'), '#!?', "canvas.getAttribute('height')", "'#!?'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.png
new file mode 100644
index 000000000..a72d04755
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.html
new file mode 100644
index 000000000..c901dffc5
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.minus</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.minus</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="-100" height="-100"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.minus.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+_assertSame(canvas.getAttribute('width'), '-100', "canvas.getAttribute('width')", "'-100'");
+_assertSame(canvas.getAttribute('height'), '-100', "canvas.getAttribute('height')", "'-100'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.png
new file mode 100644
index 000000000..a72d04755
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.html
new file mode 100644
index 000000000..efdcfeb3a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.octal</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.octal</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="0100" height="0100"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.octal.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '0100', "canvas.getAttribute('width')", "'0100'");
+_assertSame(canvas.getAttribute('height'), '0100', "canvas.getAttribute('height')", "'0100'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.html
new file mode 100644
index 000000000..11948581e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.onlyspace</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.onlyspace</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width=" " height=" "><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.onlyspace.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+_assertSame(canvas.getAttribute('width'), ' ', "canvas.getAttribute('width')", "' '");
+_assertSame(canvas.getAttribute('height'), ' ', "canvas.getAttribute('height')", "' '");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.png
new file mode 100644
index 000000000..a72d04755
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.html
new file mode 100644
index 000000000..9073424e2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.percent</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.percent</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100%" height="100%"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.percent.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '100%', "canvas.getAttribute('width')", "'100%'");
+_assertSame(canvas.getAttribute('height'), '100%', "canvas.getAttribute('height')", "'100%'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.html
new file mode 100644
index 000000000..816f381d4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.plus</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.plus</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="+100" height="+100"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.plus.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '+100', "canvas.getAttribute('width')", "'+100'");
+_assertSame(canvas.getAttribute('height'), '+100', "canvas.getAttribute('height')", "'+100'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.html
new file mode 100644
index 000000000..417674d18
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.space</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.space</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width=" 100" height=" 100"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.space.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), ' 100', "canvas.getAttribute('width')", "' 100'");
+_assertSame(canvas.getAttribute('height'), ' 100', "canvas.getAttribute('height')", "' 100'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.html
new file mode 100644
index 000000000..76c6db05f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.trailingjunk</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.trailingjunk</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100#!?" height="100#!?"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.trailingjunk.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '100#!?', "canvas.getAttribute('width')", "'100#!?'");
+_assertSame(canvas.getAttribute('height'), '100#!?', "canvas.getAttribute('height')", "'100#!?'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html
new file mode 100644
index 000000000..dc8eab52b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.whitespace</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.whitespace</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="
+ 100" height="
+ 100"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.whitespace.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '\n\t\x0c100', "canvas.getAttribute('width')", "'\\n\\t\\x0c100'");
+_assertSame(canvas.getAttribute('height'), '\n\t\x0c100', "canvas.getAttribute('height')", "'\\n\\t\\x0c100'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.zero.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.zero.html
new file mode 100644
index 000000000..e42ebeb24
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.zero.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.parse.zero</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.parse.zero</h1>
+<p class="desc">Parsing of non-negative integers</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="0" height="0"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\"");
+_assertSame(canvas.getAttribute('width'), '0', "canvas.getAttribute('width')", "'0'");
+_assertSame(canvas.getAttribute('height'), '0', "canvas.getAttribute('height')", "'0'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setcontent.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setcontent.html
new file mode 100644
index 000000000..e77ca8ee0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setcontent.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.reflect.setcontent</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.reflect.setcontent</h1>
+<p class="desc">Setting content attributes updates IDL and content attributes</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.reflect.setcontent.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Setting content attributes updates IDL and content attributes");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '120');
+canvas.setAttribute('height', '60');
+_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'");
+_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'");
+_assertSame(canvas.width, 120, "canvas.width", "120");
+_assertSame(canvas.height, 60, "canvas.height", "60");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setcontent.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setcontent.png
new file mode 100644
index 000000000..47830c83e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setcontent.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setidl.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setidl.html
new file mode 100644
index 000000000..152288291
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setidl.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.reflect.setidl</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.reflect.setidl</h1>
+<p class="desc">Setting IDL attributes updates IDL and content attributes</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.reflect.setidl.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Setting IDL attributes updates IDL and content attributes");
+_addTest(function(canvas, ctx) {
+
+canvas.width = 120;
+canvas.height = 60;
+_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'");
+_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'");
+_assertSame(canvas.width, 120, "canvas.width", "120");
+_assertSame(canvas.height, 60, "canvas.height", "60");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setidl.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setidl.png
new file mode 100644
index 000000000..47830c83e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setidl.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setidlzero.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setidlzero.html
new file mode 100644
index 000000000..2bace5a33
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.reflect.setidlzero.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.reflect.setidlzero</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.reflect.setidlzero</h1>
+<p class="desc">Setting IDL attributes to 0 updates IDL and content attributes</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Setting IDL attributes to 0 updates IDL and content attributes");
+_addTest(function(canvas, ctx) {
+
+canvas.width = 0;
+canvas.height = 0;
+_assertSame(canvas.getAttribute('width'), '0', "canvas.getAttribute('width')", "'0'");
+_assertSame(canvas.getAttribute('height'), '0', "canvas.getAttribute('height')", "'0'");
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.removed.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.removed.html
new file mode 100644
index 000000000..58fb899e0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.removed.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.removed</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.removed</h1>
+<p class="desc">Removing content attributes reverts to default size</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="120" height="60"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.removed.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Removing content attributes reverts to default size");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 120, "canvas.width", "120");
+canvas.removeAttribute('width');
+_assertSame(canvas.width, 300, "canvas.width", "300");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.removed.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.removed.png
new file mode 100644
index 000000000..1ebf30d8a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.removed.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.set.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.set.png
new file mode 100644
index 000000000..47830c83e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.set.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.html
new file mode 100644
index 000000000..0f4fb69fa
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.decimal</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.decimal</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.decimal.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '100.999');
+canvas.setAttribute('height', '100.999');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '100.999', "canvas.getAttribute('width')", "'100.999'");
+_assertSame(canvas.getAttribute('height'), '100.999', "canvas.getAttribute('height')", "'100.999'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.html
new file mode 100644
index 000000000..5768d1727
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.em</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.em</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.em.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '100em');
+canvas.setAttribute('height', '100em');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '100em', "canvas.getAttribute('width')", "'100em'");
+_assertSame(canvas.getAttribute('height'), '100em', "canvas.getAttribute('height')", "'100em'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.html
new file mode 100644
index 000000000..65a5bc0d9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.empty</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.empty</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.empty.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '');
+canvas.setAttribute('height', '');
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+_assertSame(canvas.getAttribute('width'), '', "canvas.getAttribute('width')", "''");
+_assertSame(canvas.getAttribute('height'), '', "canvas.getAttribute('height')", "''");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.png
new file mode 100644
index 000000000..a72d04755
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.html
new file mode 100644
index 000000000..673edad56
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.exp</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.exp</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.exp.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '100e1');
+canvas.setAttribute('height', '100e1');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '100e1', "canvas.getAttribute('width')", "'100e1'");
+_assertSame(canvas.getAttribute('height'), '100e1', "canvas.getAttribute('height')", "'100e1'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.hex.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.hex.html
new file mode 100644
index 000000000..e6fde5329
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.hex.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.hex</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.hex</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '0x100');
+canvas.setAttribute('height', '0x100');
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\"");
+_assertSame(canvas.getAttribute('width'), '0x100', "canvas.getAttribute('width')", "'0x100'");
+_assertSame(canvas.getAttribute('height'), '0x100', "canvas.getAttribute('height')", "'0x100'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.html
new file mode 100644
index 000000000..77b50fd11
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.junk</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.junk</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.junk.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '#!?');
+canvas.setAttribute('height', '#!?');
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+_assertSame(canvas.getAttribute('width'), '#!?', "canvas.getAttribute('width')", "'#!?'");
+_assertSame(canvas.getAttribute('height'), '#!?', "canvas.getAttribute('height')", "'#!?'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.png
new file mode 100644
index 000000000..a72d04755
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.html
new file mode 100644
index 000000000..2bb09bbf2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.minus</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.minus</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.minus.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '-100');
+canvas.setAttribute('height', '-100');
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+_assertSame(canvas.getAttribute('width'), '-100', "canvas.getAttribute('width')", "'-100'");
+_assertSame(canvas.getAttribute('height'), '-100', "canvas.getAttribute('height')", "'-100'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.png
new file mode 100644
index 000000000..a72d04755
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.html
new file mode 100644
index 000000000..a6cb6d37f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.octal</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.octal</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.octal.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '0100');
+canvas.setAttribute('height', '0100');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '0100', "canvas.getAttribute('width')", "'0100'");
+_assertSame(canvas.getAttribute('height'), '0100', "canvas.getAttribute('height')", "'0100'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.html
new file mode 100644
index 000000000..5e2dd0c6c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.onlyspace</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.onlyspace</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.onlyspace.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', ' ');
+canvas.setAttribute('height', ' ');
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+_assertSame(canvas.getAttribute('width'), ' ', "canvas.getAttribute('width')", "' '");
+_assertSame(canvas.getAttribute('height'), ' ', "canvas.getAttribute('height')", "' '");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.png
new file mode 100644
index 000000000..a72d04755
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.html
new file mode 100644
index 000000000..2a41c667e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.percent</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.percent</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.percent.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '100%');
+canvas.setAttribute('height', '100%');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '100%', "canvas.getAttribute('width')", "'100%'");
+_assertSame(canvas.getAttribute('height'), '100%', "canvas.getAttribute('height')", "'100%'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.html
new file mode 100644
index 000000000..f384d82d3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.plus</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.plus</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.plus.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '+100');
+canvas.setAttribute('height', '+100');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '+100', "canvas.getAttribute('width')", "'+100'");
+_assertSame(canvas.getAttribute('height'), '+100', "canvas.getAttribute('height')", "'+100'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.html
new file mode 100644
index 000000000..8f8585279
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.space</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.space</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.space.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', ' 100');
+canvas.setAttribute('height', ' 100');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), ' 100', "canvas.getAttribute('width')", "' 100'");
+_assertSame(canvas.getAttribute('height'), ' 100', "canvas.getAttribute('height')", "' 100'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.html
new file mode 100644
index 000000000..f6d06bab0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.trailingjunk</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.trailingjunk</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.trailingjunk.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '100#!?');
+canvas.setAttribute('height', '100#!?');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '100#!?', "canvas.getAttribute('width')", "'100#!?'");
+_assertSame(canvas.getAttribute('height'), '100#!?', "canvas.getAttribute('height')", "'100#!?'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.html
new file mode 100644
index 000000000..8a01f57ea
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.whitespace</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.whitespace</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.whitespace.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '\r\n\t\x0c100');
+canvas.setAttribute('height', '\r\n\t\x0c100');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+_assertSame(canvas.getAttribute('width'), '\r\n\t\x0c100', "canvas.getAttribute('width')", "'\\r\\n\\t\\x0c100'");
+_assertSame(canvas.getAttribute('height'), '\r\n\t\x0c100', "canvas.getAttribute('height')", "'\\r\\n\\t\\x0c100'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.png
new file mode 100644
index 000000000..f84267333
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.zero.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.zero.html
new file mode 100644
index 000000000..d1b05ad20
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.zero.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.setAttribute.zero</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.setAttribute.zero</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("Parsing of non-negative integers in setAttribute");
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '0');
+canvas.setAttribute('height', '0');
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+_assertSame(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\"");
+_assertSame(canvas.getAttribute('width'), '0', "canvas.getAttribute('width')", "'0'");
+_assertSame(canvas.getAttribute('height'), '0', "canvas.getAttribute('height')", "'0'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.style.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.style.html
new file mode 100644
index 000000000..3bab3e79d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.style.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: size.attributes.style</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>size.attributes.style</h1>
+<p class="desc">Canvas size is independent of CSS resizing</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="30" style="width: 100px; height: 50px"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.style.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Canvas size is independent of CSS resizing");
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 50, "canvas.width", "50");
+_assertSame(canvas.height, 30, "canvas.height", "30");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.style.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.style.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/size.attributes.style.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
new file mode 100644
index 000000000..37289fea2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toBlob.jpeg</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toBlob.jpeg</h1>
+<p class="desc">toBlob with image/jpeg returns a JPEG Blob</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toBlob with image/jpeg returns a JPEG Blob");
+_addTest(function(canvas, ctx) {
+
+canvas.toBlob(function(data){
+ _assertSame(data.type, "image/jpeg", "data.type", "\"image/jpeg\"");
+}, 'image/jpeg');
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html
new file mode 100644
index 000000000..80bc16c5a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toBlob.png</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toBlob.png</h1>
+<p class="desc">toBlob with image/png returns a PNG Blob</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toBlob with image/png returns a PNG Blob");
+_addTest(function(canvas, ctx) {
+
+canvas.toBlob(function(data){
+ _assertSame(data.type, "image/png", "data.type", "\"image/png\"");
+}, 'image/png');
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.arguments.1.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.arguments.1.html
new file mode 100644
index 000000000..969d4f538
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.arguments.1.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.arguments.1</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.arguments.1</h1>
+<p class="desc">toDataURL ignores extra arguments</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL ignores extra arguments");
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('image/png', 'another argument that should not raise an exception');
+assert_regexp_match(data, /^data:image\/png[;,]/);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.arguments.2.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.arguments.2.html
new file mode 100644
index 000000000..378946608
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.arguments.2.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.arguments.2</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.arguments.2</h1>
+<p class="desc">toDataURL ignores extra arguments</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL ignores extra arguments");
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('image/png', 'another argument that should not raise an exception', 'and another');
+assert_regexp_match(data, /^data:image\/png[;,]/);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.arguments.3.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.arguments.3.html
new file mode 100644
index 000000000..236aba5ff
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.arguments.3.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.arguments.3</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.arguments.3</h1>
+<p class="desc">toDataURL ignores extra arguments</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL ignores extra arguments");
+_addTest(function(canvas, ctx) {
+
+// More arguments that should not raise exceptions
+var data = canvas.toDataURL('image/png', null, null, null);
+assert_regexp_match(data, /^data:image\/png[;,]/);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.bogustype.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.bogustype.html
new file mode 100644
index 000000000..ade95f0ac
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.bogustype.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.bogustype</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.bogustype</h1>
+<p class="desc">toDataURL with a syntactically invalid type returns a PNG</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL with a syntactically invalid type returns a PNG");
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('bogus');
+assert_regexp_match(data, /^data:image\/png[;,]/);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.default.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.default.html
new file mode 100644
index 000000000..84f4c9ed4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.default.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.default</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.default</h1>
+<p class="desc">toDataURL with no arguments returns a PNG</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL with no arguments returns a PNG");
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL();
+assert_regexp_match(data, /^data:image\/png[;,]/);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.alpha.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.alpha.html
new file mode 100644
index 000000000..80a2fca42
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.alpha.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.jpeg.alpha</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.jpeg.alpha</h1>
+<p class="desc">toDataURL with JPEG composites onto black</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="toDataURL.jpeg.alpha.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL with JPEG composites onto black");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = 'rgba(128, 255, 128, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-over'; // should be ignored by toDataURL
+var data = canvas.toDataURL('image/jpeg');
+ctx.globalCompositeOperation = 'source-over';
+if (!data.match(/^data:image\/jpeg[;,]/)) {
+ _assert(true, "true");
+} else {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ var img = new Image();
+ deferTest();
+ img.onload = t.step_func_done(function ()
+ {
+ ctx.drawImage(img, 0, 0);
+ _assertPixelApprox(canvas, 50,25, 63,127,63,255, "50,25", "63,127,63,255", 8);
+ });
+ img.src = data;
+}
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.alpha.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.alpha.png
new file mode 100644
index 000000000..551871295
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.alpha.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.primarycolours.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.primarycolours.html
new file mode 100644
index 000000000..a896cbb5c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.primarycolours.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.jpeg.primarycolours</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.jpeg.primarycolours</h1>
+<p class="desc">toDataURL with JPEG handles simple colours correctly</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="toDataURL.jpeg.primarycolours.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL with JPEG handles simple colours correctly");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#ff0';
+ctx.fillRect(0, 0, 25, 40);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(25, 0, 50, 40);
+ctx.fillStyle = '#00f';
+ctx.fillRect(75, 0, 25, 40);
+ctx.fillStyle = '#fff';
+ctx.fillRect(0, 40, 100, 10);
+var data = canvas.toDataURL('image/jpeg'); // it is okay if this returns a PNG instead
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+var img = new Image();
+deferTest();
+img.onload = t.step_func_done(function ()
+{
+ ctx.drawImage(img, 0, 0);
+ _assertPixelApprox(canvas, 12,20, 255,255,0,255, "12,20", "255,255,0,255", 8);
+ _assertPixelApprox(canvas, 50,20, 0,255,255,255, "50,20", "0,255,255,255", 8);
+ _assertPixelApprox(canvas, 87,20, 0,0,255,255, "87,20", "0,0,255,255", 8);
+ _assertPixelApprox(canvas, 50,45, 255,255,255,255, "50,45", "255,255,255,255", 8);
+});
+img.src = data;
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.primarycolours.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.primarycolours.png
new file mode 100644
index 000000000..cfd136900
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.primarycolours.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.basic.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.basic.html
new file mode 100644
index 000000000..aad56cdd5
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.basic.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.jpeg.quality.basic</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.jpeg.quality.basic</h1>
+<p class="desc">toDataURL with JPEG uses the quality parameter</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="toDataURL.jpeg.quality.basic.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL with JPEG uses the quality parameter");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#00f';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(0, 3, 100, 1);
+// Check for JPEG support first
+var data = canvas.toDataURL('image/jpeg');
+if (!data.match(/^data:image\/jpeg[;,]/)) {
+ _assert(true, "true");
+} else {
+ var data_hi = canvas.toDataURL('image/jpeg', 0.99);
+ var data_lo = canvas.toDataURL('image/jpeg', 0.01);
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ deferTest();
+ var img_hi = new Image();
+ img_hi.onload = function ()
+ {
+ var img_lo = new Image();
+ img_lo.onload = t.step_func_done(function ()
+ {
+ ctx.drawImage(img_hi, 0, 0, 50, 50, 0, 0, 50, 50);
+ ctx.drawImage(img_lo, 0, 0, 50, 50, 50, 0, 50, 50);
+ _assert(data_hi.length > data_lo.length, "data_hi.length > data_lo.length");
+ _assertPixelApprox(canvas, 25,25, 0,0,255,255, "25,25", "0,0,255,255", 8);
+ _assertPixelApprox(canvas, 75,25, 0,0,255,255, "75,25", "0,0,255,255", 32);
+ });
+ img_lo.src = data_lo;
+ };
+ img_hi.src = data_hi;
+}
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.basic.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.basic.png
new file mode 100644
index 000000000..2f8a0bc79
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.basic.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.notnumber.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.notnumber.html
new file mode 100644
index 000000000..3167e3c09
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.notnumber.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.jpeg.quality.notnumber</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.jpeg.quality.notnumber</h1>
+<p class="desc">toDataURL with JPEG handles non-numeric quality parameters</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL with JPEG handles non-numeric quality parameters");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#00f';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(0, 3, 100, 1);
+// Check for JPEG support first
+var data = canvas.toDataURL('image/jpeg');
+if (!data.match(/^data:image\/jpeg[;,]/)) {
+ _assert(true, "true");
+} else {
+ _assertSame(canvas.toDataURL('image/jpeg', 'bogus'), data, "canvas.toDataURL('image/jpeg', 'bogus')", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', {}), data, "canvas.toDataURL('image/jpeg', {})", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', null), data, "canvas.toDataURL('image/jpeg', null)", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', undefined), data, "canvas.toDataURL('image/jpeg', undefined)", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', true), data, "canvas.toDataURL('image/jpeg', true)", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', '0.01'), data, "canvas.toDataURL('image/jpeg', '0.01')", "data");
+}
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.outsiderange.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.outsiderange.html
new file mode 100644
index 000000000..885dc99b8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpeg.quality.outsiderange.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.jpeg.quality.outsiderange</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.jpeg.quality.outsiderange</h1>
+<p class="desc">toDataURL with JPEG handles out-of-range quality parameters</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL with JPEG handles out-of-range quality parameters");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#00f';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(0, 3, 100, 1);
+// Check for JPEG support first
+var data = canvas.toDataURL('image/jpeg');
+if (!data.match(/^data:image\/jpeg[;,]/)) {
+ _assert(true, "true");
+} else {
+ _assertSame(canvas.toDataURL('image/jpeg', 10), data, "canvas.toDataURL('image/jpeg', 10)", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', -10), data, "canvas.toDataURL('image/jpeg', -10)", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', 1.01), data, "canvas.toDataURL('image/jpeg', 1.01)", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', -0.01), data, "canvas.toDataURL('image/jpeg', -0.01)", "data");
+
+ _assert(canvas.toDataURL('image/jpeg', 1).length >= canvas.toDataURL('image/jpeg', 0.9).length, "canvas.toDataURL('image/jpeg', 1).length >= canvas.toDataURL('image/jpeg', 0.9).length");
+ _assert(canvas.toDataURL('image/jpeg', 0).length <= canvas.toDataURL('image/jpeg', 0.1).length, "canvas.toDataURL('image/jpeg', 0).length <= canvas.toDataURL('image/jpeg', 0.1).length");
+}
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpg.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpg.html
new file mode 100644
index 000000000..df12aeebc
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.jpg.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.jpg</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.jpg</h1>
+<p class="desc">toDataURL with image/jpg is invalid type hence returns a PNG</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL with image/jpg is invalid type hence returns a PNG");
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('image/jpg');
+assert_regexp_match(data, /^data:image\/png[;,]/);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.ascii.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.ascii.html
new file mode 100644
index 000000000..b95c8285b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.ascii.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.lowercase.ascii</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.lowercase.ascii</h1>
+<p class="desc">toDataURL type is case-insensitive</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL type is case-insensitive");
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('ImAgE/PnG');
+assert_regexp_match(data, /^data:image\/png[;,]/);
+
+// If JPEG is supported at all, it must be supported case-insensitively
+data = canvas.toDataURL('image/jpeg');
+if (data.match(/^data:image\/jpeg[;,]/)) {
+ data = canvas.toDataURL('ImAgE/JpEg');
+ assert_regexp_match(data, /^data:image\/jpeg[;,]/);
+}
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.unicode.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.unicode.html
new file mode 100644
index 000000000..ab06d59ec
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.unicode.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.lowercase.unicode</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.lowercase.unicode</h1>
+<p class="desc">toDataURL type is ASCII-case-insensitive</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL type is ASCII-case-insensitive");
+_addTest(function(canvas, ctx) {
+
+// Use LATIN CAPITAL LETTER I WITH DOT ABOVE (Unicode lowercase is "i")
+var data = canvas.toDataURL('\u0130mage/png');
+assert_regexp_match(data, /^data:image\/png[;,]/);
+
+var data = canvas.toDataURL('\u0130mage/jpeg');
+assert_regexp_match(data, /^data:image\/png[;,]/);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.nocontext.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.nocontext.html
new file mode 100644
index 000000000..07fb85dc8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.nocontext.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.nocontext</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.nocontext</h1>
+<p class="desc">toDataURL works before any context has been got</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL works before any context has been got");
+_addTest(function(canvas, ctx) {
+ var no_context_data = canvas.toDataURL();
+ var ctx = canvas.getContext('2d');
+ ctx.rect(0, 0, 100, 50);
+ ctx.fillStyle = "rgba(0, 0, 0, 0)";
+ ctx.fill();
+ var data = canvas.toDataURL();
+ assert_equals(no_context_data, data);
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.complexcolours.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.complexcolours.html
new file mode 100644
index 000000000..cc067b737
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.complexcolours.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.png.complexcolours</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.png.complexcolours</h1>
+<p class="desc">toDataURL with PNG handles non-primary and non-solid colours correctly</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="toDataURL.png.complexcolours.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL with PNG handles non-primary and non-solid colours correctly");
+_addTest(function(canvas, ctx) {
+
+// (These values are chosen to survive relatively alright through being premultiplied)
+ctx.fillStyle = 'rgba(1, 3, 254, 1)';
+ctx.fillRect(0, 0, 25, 25);
+ctx.fillStyle = 'rgba(8, 252, 248, 0.75)';
+ctx.fillRect(25, 0, 25, 25);
+ctx.fillStyle = 'rgba(6, 10, 250, 0.502)';
+ctx.fillRect(50, 0, 25, 25);
+ctx.fillStyle = 'rgba(12, 16, 244, 0.25)';
+ctx.fillRect(75, 0, 25, 25);
+var img = new Image();
+deferTest();
+img.onload = t.step_func_done(function ()
+{
+ ctx.drawImage(img, 0, 25);
+ // (The alpha values do not really survive float->int conversion, so just
+ // do approximate comparisons)
+ _assertPixel(canvas, 12,40, 1,3,254,255, "12,40", "1,3,254,255");
+ _assertPixelApprox(canvas, 37,40, 8,252,248,191, "37,40", "8,252,248,191", 2);
+ _assertPixelApprox(canvas, 62,40, 6,10,250,127, "62,40", "6,10,250,127", 4);
+ _assertPixelApprox(canvas, 87,40, 12,16,244,63, "87,40", "12,16,244,63", 8);
+});
+img.src = canvas.toDataURL();
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.complexcolours.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.complexcolours.png
new file mode 100644
index 000000000..9bc814658
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.complexcolours.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.html
new file mode 100644
index 000000000..39917eb23
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.png</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.png</h1>
+<p class="desc">toDataURL with image/png returns a PNG</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL with image/png returns a PNG");
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('image/png');
+assert_regexp_match(data, /^data:image\/png[;,]/);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.primarycolours.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.primarycolours.html
new file mode 100644
index 000000000..b962821d7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.primarycolours.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.png.primarycolours</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.png.primarycolours</h1>
+<p class="desc">toDataURL with PNG handles simple colours correctly</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="toDataURL.png.primarycolours.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL with PNG handles simple colours correctly");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#ff0';
+ctx.fillRect(0, 0, 25, 40);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(25, 0, 50, 40);
+ctx.fillStyle = '#00f';
+ctx.fillRect(75, 0, 25, 40);
+ctx.fillStyle = '#fff';
+ctx.fillRect(0, 40, 100, 10);
+var data = canvas.toDataURL();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+var img = new Image();
+deferTest();
+img.onload = t.step_func_done(function ()
+{
+ ctx.drawImage(img, 0, 0);
+ _assertPixel(canvas, 12,20, 255,255,0,255, "12,20", "255,255,0,255");
+ _assertPixel(canvas, 50,20, 0,255,255,255, "50,20", "0,255,255,255");
+ _assertPixel(canvas, 87,20, 0,0,255,255, "87,20", "0,0,255,255");
+ _assertPixel(canvas, 50,45, 255,255,255,255, "50,45", "255,255,255,255");
+});
+img.src = data;
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.primarycolours.png b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.primarycolours.png
new file mode 100644
index 000000000..cfd136900
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.png.primarycolours.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.unrecognised.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.unrecognised.html
new file mode 100644
index 000000000..3526cc3a2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.unrecognised.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.unrecognised</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.unrecognised</h1>
+<p class="desc">toDataURL with an unhandled type returns a PNG</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL with an unhandled type returns a PNG");
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('image/example');
+assert_regexp_match(data, /^data:image\/png[;,]/);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.zeroheight.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.zeroheight.html
new file mode 100644
index 000000000..04c113216
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.zeroheight.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.zeroheight</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.zeroheight</h1>
+<p class="desc">toDataURL on zero-size canvas returns 'data:,'</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" height="0"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL on zero-size canvas returns 'data:,'");
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL();
+_assertSame(data, 'data:,', "data", "'data:,'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.zerosize.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.zerosize.html
new file mode 100644
index 000000000..7d2913d02
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.zerosize.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.zerosize</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.zerosize</h1>
+<p class="desc">toDataURL on zero-size canvas returns 'data:,'</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="0" height="0"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL on zero-size canvas returns 'data:,'");
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL();
+_assertSame(data, 'data:,', "data", "'data:,'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.zerowidth.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.zerowidth.html
new file mode 100644
index 000000000..d4020aa51
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.zerowidth.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: toDataURL.zerowidth</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>toDataURL.zerowidth</h1>
+<p class="desc">toDataURL on zero-size canvas returns 'data:,'</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="0"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("toDataURL on zero-size canvas returns 'data:,'");
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL();
+_assertSame(data, 'data:,', "data", "'data:,'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.delete.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.delete.html
new file mode 100644
index 000000000..98b67b909
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.delete.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: type.delete</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>type.delete</h1>
+<p class="desc">window.HTMLCanvasElement interface object is [[Configurable]]</p>
+
+<p class="notes">Defined in "Web IDL" (draft)
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("window.HTMLCanvasElement interface object is [[Configurable]]");
+_addTest(function(canvas, ctx) {
+
+_assertSame(delete window.HTMLCanvasElement, true, "delete window.HTMLCanvasElement", "true");
+_assertSame(window.HTMLCanvasElement, undefined, "window.HTMLCanvasElement", "undefined");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.exists.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.exists.html
new file mode 100644
index 000000000..04aa97570
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.exists.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: type.exists</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>type.exists</h1>
+<p class="desc">HTMLCanvasElement is a property of window</p>
+
+<p class="notes">Defined in "Web IDL" (draft)
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("HTMLCanvasElement is a property of window");
+_addTest(function(canvas, ctx) {
+
+_assert(window.HTMLCanvasElement, "window.HTMLCanvasElement");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.extend.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.extend.html
new file mode 100644
index 000000000..572273083
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.extend.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: type.extend</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>type.extend</h1>
+<p class="desc">HTMLCanvasElement methods can be added, and the new methods used by canvases</p>
+
+<p class="notes">Defined in "Web IDL" (draft)
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("HTMLCanvasElement methods can be added, and the new methods used by canvases");
+_addTest(function(canvas, ctx) {
+
+window.HTMLCanvasElement.prototype.getZero = function () { return 0; };
+_assertSame(canvas.getZero(), 0, "canvas.getZero()", "0");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.name.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.name.html
new file mode 100644
index 000000000..a514effaa
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.name.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: type.name</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>type.name</h1>
+<p class="desc">HTMLCanvasElement type and toString</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("HTMLCanvasElement type and toString");
+_addTest(function(canvas, ctx) {
+
+_assertSame(Object.prototype.toString.call(canvas), '[object HTMLCanvasElement]', "Object.prototype.toString.call(canvas)", "'[object HTMLCanvasElement]'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.prototype.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.prototype.html
new file mode 100644
index 000000000..029a9fbbd
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.prototype.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: type.prototype</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>type.prototype</h1>
+<p class="desc">window.HTMLCanvasElement has prototype, which is { ReadOnly, DontDelete }. prototype has getContext, which is not</p>
+
+<p class="notes">Defined in "Web IDL" (draft)
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("window.HTMLCanvasElement has prototype, which is { ReadOnly, DontDelete }. prototype has getContext, which is not");
+_addTest(function(canvas, ctx) {
+
+_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype");
+_assert(window.HTMLCanvasElement.prototype.getContext, "window.HTMLCanvasElement.prototype.getContext");
+window.HTMLCanvasElement.prototype = null;
+_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype");
+delete window.HTMLCanvasElement.prototype;
+_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype");
+window.HTMLCanvasElement.prototype.getContext = 1;
+_assertSame(window.HTMLCanvasElement.prototype.getContext, 1, "window.HTMLCanvasElement.prototype.getContext", "1");
+delete window.HTMLCanvasElement.prototype.getContext;
+_assertSame(window.HTMLCanvasElement.prototype.getContext, undefined, "window.HTMLCanvasElement.prototype.getContext", "undefined");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.replace.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.replace.html
new file mode 100644
index 000000000..70a08066e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/type.replace.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: type.replace</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>type.replace</h1>
+<p class="desc">HTMLCanvasElement methods can be replaced, and the replacement methods used by canvases</p>
+
+<p class="notes">Defined in "Web IDL" (draft)
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("HTMLCanvasElement methods can be replaced, and the replacement methods used by canvases");
+_addTest(function(canvas, ctx) {
+
+window.HTMLCanvasElement.prototype.getContext = function (name) { return 0; };
+_assertSame(canvas.getContext('2d'), 0, "canvas.getContext('2d')", "0");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-dimension.html b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-dimension.html
new file mode 100644
index 000000000..608ed331c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-dimension.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: dimension</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-embed-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<embed src="/images/blue.png" height="100" width="100" id="test">
+<script>
+ test(function () {
+ var height = getComputedStyle(document.getElementById("test"), false)["height"];
+ assert_equals(height, "100px", "The height of the embed element should be 100px.");
+ }, "Check the actual length of the embed element's height");
+
+ test(function () {
+ var width = getComputedStyle(document.getElementById("test"), false)["width"];
+ assert_equals(width, "100px", "The width of the embed element should be 100px.");
+ }, "Check the actual length of the embed element's width");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-document.html b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-document.html
new file mode 100644
index 000000000..3d44678cf
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-document.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>HTML Test: The embed element represents a document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name="assert" content="Check if the embed element represents a document when a text/html resource source is used">
+<body>
+ <script type="application/javascript">
+ window.childLoaded = false;
+ async_test(function() {
+ addEventListener("load", this.step_func_done(function() {
+ assert_true(window.childLoaded);
+ }));
+ }, "Test document type embedding");
+ </script>
+ <embed src="embed-iframe.html">
+</body>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-iframe.html b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-iframe.html
new file mode 100644
index 000000000..f9b1bfdb5
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-iframe.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<body>
+ <script type="application/javascript">
+ parent.childLoaded = true;
+ </script>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-ignored-in-media-element.html b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-ignored-in-media-element.html
new file mode 100644
index 000000000..d29d520f0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-ignored-in-media-element.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>HTML Test: The embed element represents a document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name="assert" content="Check if the embed element is ignored when used inside a media element">
+<script type="application/javascript">
+ window.childLoaded = false;
+ async_test(function() {
+ addEventListener("load", this.step_func_done(function() {
+ assert_false(window.childLoaded);
+ }));
+ }, "Test embed being ignored inside media element");
+</script>
+<body>
+ <video>
+ <embed type="text/html" src="embed-iframe.html" />
+ </video>
+ <audio>
+ <embed type="text/html" src="embed-iframe.html" />
+ </audio>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-subdocument.html b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-subdocument.html
new file mode 100644
index 000000000..a2c2a9399
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback.html b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback.html
new file mode 100644
index 000000000..52fa01b91
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-01.html b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-01.html
new file mode 100644
index 000000000..e66bd4a90
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-01.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: The embed element without src and type attributes represents nothing</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-embed-element">
+<link rel="match" href="embed-represent-nothing-ref.html">
+<meta name="assert" content="Check if the embed element without src and type attributes represents nothing">
+<style>
+ embed {
+ background-color: red;
+ height: 100px;
+ width: 100px;
+ }
+</style>
+<body>
+ <p>Test passes if there is <strong>no red</strong>.</p>
+ <embed>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-02.html b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-02.html
new file mode 100644
index 000000000..65cd67238
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-02.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: The embed element represents nothing when its type and src attributs are removed</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-embed-element">
+<link rel="match" href="embed-represent-nothing-ref.html">
+<meta name="assert" content="Check if the embed element represents nothing when its src and type attributes are removed">
+<style>
+ embed {
+ background-color: red;
+ height: 100px;
+ width: 100px;
+ }
+</style>
+<body>
+ <p>Test passes if there is <strong>no red</strong>.</p>
+ <embed id="embed" src="/images/red-16x16.png" type="image/png">
+ <script>
+ document.getElementById("embed").removeAttribute("src");
+ document.getElementById("embed").removeAttribute("type");
+ </script>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-03.html b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-03.html
new file mode 100644
index 000000000..a16f3794a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-03.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: The embed element represents nothing when it has a media ancestor</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-embed-element">
+<link rel="match" href="embed-represent-nothing-ref.html">
+<meta name="assert" content="Check if the embed element represents nothing when it has a media ancestor">
+<style>
+ embed {
+ background-color: red;
+ height: 100px;
+ width: 100px;
+ }
+</style>
+<body>
+ <p>Test passes if there is <strong>no red</strong>.</p>
+ <video>
+ <embed src="/images/red-16x16.png">
+ </video>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-04.html b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-04.html
new file mode 100644
index 000000000..7cc1b668a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-04.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: The embed element represents nothing when it has an object ancestor</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-embed-element">
+<link rel="match" href="embed-represent-nothing-ref.html">
+<meta name="assert" content="Check if the embed element represents nothing when it has a object ancestor that is not showing its fallback content">
+<style>
+ embed {
+ background-color: red;
+ height: 100px;
+ width: 100px;
+ }
+</style>
+<body>
+ <p>Test passes if there is <strong>no red</strong>.</p>
+ <object type="application/x-shockwave-flash">
+ <embed src="/images/red-16x16.png">
+ </object>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-ref.html b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-ref.html
new file mode 100644
index 000000000..91d680deb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Embed Reftest Reference</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<body>
+ <p>Test passes if there is <strong>no red</strong>.</p>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/change_child.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/change_child.html
new file mode 100644
index 000000000..738ceee52
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/change_grandchild.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/change_grandchild.html
new file mode 100644
index 000000000..885622c2b
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/change_parentage.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/change_parentage.html
new file mode 100644
index 000000000..1d62ccc48
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html
new file mode 100644
index 000000000..8b44fe805
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/cross_origin_grandchild.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/cross_origin_grandchild.html
new file mode 100644
index 000000000..1eff64af1
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html
new file mode 100644
index 000000000..cd27b8ea7
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/historical.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/historical.html
new file mode 100644
index 000000000..850a52f46
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/historical.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<title>Historical iframe element features should not be supported</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+function t(property) {
+ test(function() {
+ assert_false(property in document.createElement('iframe'));
+ }, 'iframe.' + property + ' should not be supported');
+}
+
+// added in https://github.com/whatwg/html/commit/f6490f17f577fa3478791b29ad8c2b586418001f
+// removed in https://github.com/whatwg/html/commit/1490eba4dba5ab476f0981443a86c01acae01311
+t('seamless');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html
new file mode 100644
index 000000000..da5791a2d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html
@@ -0,0 +1,55 @@
+<!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>
+ async_test(function(t) {
+ var iframe = document.createElement("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_done(function() {
+ assert_false(iframe.contentDocument.fullscreenEnabled, "Document inside iframe without allowfullscreen attribute should not have fullscreen enabled flag set");
+ iframe.setAttribute("allowfullscreen", true);
+ assert_true(iframe.contentDocument.fullscreenEnabled, "Fullscreen should be allowed when allowfullscreen attribute is set");
+ iframe.removeAttribute("allowfullscreen");
+ assert_false(iframe.contentDocument.fullscreenEnabled, "Fullscreen should be denied when allowfullscreen attribute is removed");
+ }));
+ }, "iframe-allowfullscreen");
+
+ /* 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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-append-to-child-document.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-append-to-child-document.html
new file mode 100644
index 000000000..ac8bd5e05
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-append-to-child-document.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Append iframe element to its own child document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<iframe id=x></iframe>
+<script>
+test(function() {
+ var iframe = document.getElementById('x');
+ var childWindow = iframe.contentWindow;
+ assert_equals(childWindow.parent, window);
+ childWindow.document.body.appendChild(iframe);
+ assert_equals(childWindow.parent, null);
+ assert_equals(iframe.contentWindow, null);
+ assert_equals(childWindow.document.body.firstChild, iframe);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html
new file mode 100644
index 000000000..d245bf0b9
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-with-base-ref.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-with-base-ref.html
new file mode 100644
index 000000000..21f11d195
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-with-base-ref.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<html>
+<head>
+ <title>iframe Without Base Tag</title>
+</head>
+<body>
+ <iframe src="support/blank.htm">
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-with-base.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-with-base.html
new file mode 100644
index 000000000..4637a41a4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe-with-base.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html>
+<head>
+ <title>iframe With Base Tag</title>
+ <link rel="match" href="iframe-with-base-ref.html">
+ <base href="support/">
+</head>
+<body>
+ <iframe src="blank.htm">
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_harness.js b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_harness.js
new file mode 100644
index 000000000..f4ef511d1
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm
new file mode 100644
index 000000000..d6c2abe7d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm
@@ -0,0 +1,53 @@
+<!DOCTYPE html><html><head><title>javascript: URL creating a document in an about:blank iframe</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-iframe-element">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#process-the-iframe-attributes">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log">FAILED (test did not run)</div>
+
+<iframe src="about:blank" name="ifr1"></iframe>
+<iframe src="" name="ifr2"></iframe>
+<iframe src="./" name="ifr3"></iframe>
+
+<script>
+var test = async_test();
+var results = {};
+var expected = {
+ ifr1:{url:"about:blank", sameDom: true},
+ ifr2:{url:"about:blank", sameDom: true},
+ ifr3:{url: location.href.replace(/\/[^\/]*$/, '/'), sameDom: true },
+ ifr4:{url:"about:blank", sameDom: true}
+}
+
+var js_url = 'javascript:"<html><script>var sameDom = false; try{var cn = top.document.body.className;sameDom = true;}catch(e){}; parent.postMessage( {url: document.URL, name: name, sameDom: sameDom}, \'*\')<\/script><body><p>JS-generated document</p></body></<html>";'
+window.addEventListener('message', function(e){
+ var ifr = e.data.name;
+ results[ifr] = e.data;
+ test.step(function(){
+ assert_equals(results[ifr].url, expected[ifr].url);
+ assert_equals(results[ifr].sameDom, expected[ifr].sameDom);
+ }, 'Testing URL and details of IFRAME ' + ifr);
+ if(Object.keys(results).length === Object.keys(expected).length){
+ test.done();
+ }
+}, false);
+
+var ifr = document.createElement('iframe');
+ifr.name = 'ifr4';
+document.body.appendChild(ifr);
+
+window.onload = function () {
+ for (var i = 0, frame, frames = document.getElementsByTagName('iframe'); frame = frames[i]; i++) {
+ try{
+ frame.src = js_url;
+ }catch(e){
+ results[frame.name] = 'Exception on setting!';
+ }
+ };
+}
+
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_script.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_script.html
new file mode 100644
index 000000000..cd05f2246
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_script.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<meta charset="uft-8">
+<title>HTML Test: iframe_sandbox_allow_scripts</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-iframe-sandbox">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-iframe-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<div id="log"></div>
+<script>
+ // Set up all our script stuff before the iframe starts loading, so we don't
+ // miss any messages from it.
+ var step1 = false;
+ var t = async_test("iframe_sandbox_allow_scripts");
+
+ setup({timeout:1000});
+ window.addEventListener("message", callback1, false);
+
+ function run() {
+ window.removeEventListener("message", callback1, false);
+ document.getElementById("testIframe").sandbox = "allow-scripts";
+ document.getElementById("testIframe").contentWindow.location.reload();
+ window.addEventListener("message", callback2, false);
+ }
+
+ function callback1(e) {
+ step1= !step1;
+ }
+
+ function callback2(e) {
+ t.step(function () {
+ assert_false(step1, "[allow-scripts] is not set.");
+ assert_equals(e.data, "Script executed", "[allow-scripts] is set.");
+ });
+ t.done();
+ }
+
+ // Make sure the iframe loads before we mess with it.
+ window.addEventListener("load", function() {
+ // The load event might fire before a message from the child comes in...
+ // Wait a bit to see if that message does come in.
+ setTimeout(run, 500);
+ });
+</script>
+<iframe id="testIframe" src="support/sandbox_allow_script.html" sandbox="allow-same-origin" style="display:none"></iframe>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html
new file mode 100644
index 000000000..342d42203
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.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-1.html";
+ });
+ postMessage("hello", "*");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html
new file mode 100644
index 000000000..40ffbb1e0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html
@@ -0,0 +1,31 @@
+<!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");
+ });
+
+ var iframe = document.querySelector("iframe");
+ iframe.onload = function() {
+ frames[0].postMessage("start", "*");
+ }
+ iframe.src = "iframe_sandbox_popups_helper-2.html";
+ });
+ addEventListener("load", function() {
+ postMessage("hello", "*");
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html
new file mode 100644
index 000000000..2d35fd5fc
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.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-3.html";
+ });
+ postMessage("hello", "*");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-1.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-1.html
new file mode 100644
index 000000000..6b120f15d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-1.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<script>
+ 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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-2.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-2.html
new file mode 100644
index 000000000..9c393fc95
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-2.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<body>
+<script>
+ 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 from our parent and open
+ // ourselves as the popup when we get the "start" message.
+ onmessage = function (e) {
+ if (e.data == "start") {
+ // Now listen for messages from the thing we plan to open.
+ onmessage = function(e) {
+ parent.postMessage({ data: e.data, origin: e.origin }, "*");
+ }
+
+ var a = document.createElement("a");
+ a.href = location.href;
+ a.target = "_blank";
+ document.body.appendChild(a);
+ a.click();
+ }
+ };
+ }
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-3.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-3.html
new file mode 100644
index 000000000..ef3e59037
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-3.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<script>
+ 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 }, "*");
+ };
+ var popupWin = window.open();
+ popupWin.location.href = location.href;
+ }
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html
new file mode 100644
index 000000000..3dee96d67
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.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-1.html"></iframe>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html
new file mode 100644
index 000000000..27046db74
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html
@@ -0,0 +1,18 @@
+<!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");
+ });
+ addEventListener("load", function() {
+ frames[0].postMessage("start", "*");
+ });
+</script>
+<iframe sandbox="allow-scripts allow-popups"
+ src="iframe_sandbox_popups_helper-2.html"></iframe>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html
new file mode 100644
index 000000000..556387e14
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.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-3.html"></iframe>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_01.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_01.html
new file mode 100644
index 000000000..efd563f51
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_01.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<title>moving modified IFRAME in document (original page about:blank, DOM modification)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
+<iframe src="about:blank"></iframe>
+<div id="target"></div>
+<script>
+onload = function() {
+ var ifr = document.getElementsByTagName('iframe')[0];
+ ifr.contentDocument.body.appendChild(ifr.contentDocument.createElement('p')).textContent = 'Modified document';
+ setTimeout(function() {
+ ifr.onload = function() {
+ assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
+ done();
+ };
+ document.getElementById('target').appendChild(ifr);
+ }, 100);
+}
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_02.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_02.html
new file mode 100644
index 000000000..dbe266b29
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_02.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<title>moving modified IFRAME in document (original page about:blank, document.write modification)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
+<iframe src="about:blank"></iframe>
+<div id="target"></div>
+<script>
+onload = function() {
+ var ifr = document.getElementsByTagName('iframe')[0];
+ ifr.contentDocument.open();
+ ifr.contentDocument.write('Modified document');
+ ifr.contentDocument.close();
+ setTimeout(function() {
+ ifr.onload = function() {
+ assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
+ done();
+ };
+ document.getElementById('target').appendChild(ifr);
+ }, 100);
+}
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_03.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_03.html
new file mode 100644
index 000000000..c07dd42dc
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_03.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<title>moving modified IFRAME in document (original page from server, DOM modification)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
+<iframe src="support/blank.htm"></iframe>
+<div id="target"></div>
+<script>
+onload = function() {
+ var ifr = document.getElementsByTagName('iframe')[0];
+ ifr.contentDocument.body.appendChild(ifr.contentDocument.createElement('p')).textContent = 'Modified document';
+ setTimeout(function() {
+ ifr.onload = function() {
+ assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
+ done();
+ };
+ document.getElementById('target').appendChild(ifr);
+ }, 100);
+}
+</script> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_04.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_04.html
new file mode 100644
index 000000000..755cd45d3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_04.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<title>moving modified IFRAME in document (original page from server, document.write modification)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
+<iframe src="support/blank.htm"></iframe>
+<div id="target"></div>
+<script>
+onload = function(){
+ var ifr = document.getElementsByTagName('iframe')[0];
+ ifr.contentDocument.open();
+ ifr.contentDocument.write('Modified document');
+ ifr.contentDocument.close();
+ setTimeout(function() {
+ ifr.onload = function () {
+ assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
+ done();
+ };
+ document.getElementById('target').appendChild(ifr);
+ }, 100);
+}
+</script> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/same_origin_child.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/same_origin_child.html
new file mode 100644
index 000000000..a36e231fa
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/same_origin_grandchild.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/same_origin_grandchild.html
new file mode 100644
index 000000000..e7a2293b7
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/same_origin_parentage.html
new file mode 100644
index 000000000..a163eb8ee
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/stash.py b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/stash.py
new file mode 100644
index 000000000..0b8693a90
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/blank.htm b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/blank.htm
new file mode 100644
index 000000000..6c70bcfe4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/blank.htm
@@ -0,0 +1 @@
+<html></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_allow_script.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_allow_script.html
new file mode 100644
index 000000000..95c30dec1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_allow_script.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<meta charset="uft-8">
+<title>HTML Test: sandbox_allow_scripts</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<div id="test">Before change</div>
+<script>
+ parent.window.postMessage("Script executed", "*");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/3.jpg b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/3.jpg
new file mode 100644
index 000000000..d30ac2ac3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/3.jpg
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/Image-constructor.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/Image-constructor.html
new file mode 100644
index 000000000..1119f818f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/Image-constructor.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<title>DOM Image constructor Test</title>
+<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-img-element" />
+<meta name="assert" content="Tests the Image constructor for the img-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+
+<div id="log"></div>
+<script>
+ test(function() {
+ var img = new Image();
+ assert_true(img != undefined);
+ }, "Image constructor works");
+
+ test(function() {
+ assert_true(Image.prototype === HTMLImageElement.prototype);
+ }, "Image and HTMLImageElement share a prototype");
+
+ test(function() {
+ assert_true((new Image()).localName === "img");
+ }, "Image localName is img");
+
+ test(function() {
+ assert_true((new Image()).namespaceURI === "http://www.w3.org/1999/xhtml");
+ }, "Image namespace URI is correct");
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/brokenimg.jpg b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/brokenimg.jpg
new file mode 100644
index 000000000..ccff177ae
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/brokenimg.jpg
@@ -0,0 +1,4 @@
+<!DOCTYPE HTML>
+<html>
+
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/contains.json b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/contains.json
new file mode 100644
index 000000000..9ac6d3d42
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/contains.json
@@ -0,0 +1,60 @@
+[
+ {
+ "id": "alt",
+ "original_id": "alt",
+ "children": [
+ {
+ "id": "general-guidelines",
+ "original_id": "general-guidelines"
+ },
+ {
+ "id": "a-link-or-button-containing-nothing-but-the-image",
+ "original_id": "a-link-or-button-containing-nothing-but-the-image"
+ },
+ {
+ "id": "a-phrase-or-paragraph-with-an-alternative-graphical-representation-charts-diagrams-graphs-maps-illustrations",
+ "original_id": "a-phrase-or-paragraph-with-an-alternative-graphical-representation:-charts,-diagrams,-graphs,-maps,-illustrations"
+ },
+ {
+ "id": "a-short-phrase-or-label-with-an-alternative-graphical-representation-icons-logos",
+ "original_id": "a-short-phrase-or-label-with-an-alternative-graphical-representation:-icons,-logos"
+ },
+ {
+ "id": "text-that-has-been-rendered-to-a-graphic-for-typographical-effect",
+ "original_id": "text-that-has-been-rendered-to-a-graphic-for-typographical-effect"
+ },
+ {
+ "id": "a-graphical-representation-of-some-of-the-surrounding-text",
+ "original_id": "a-graphical-representation-of-some-of-the-surrounding-text"
+ },
+ {
+ "id": "a-purely-decorative-image-that-doesn-t-add-any-information",
+ "original_id": "a-purely-decorative-image-that-doesn't-add-any-information"
+ },
+ {
+ "id": "a-group-of-images-that-form-a-single-larger-picture-with-no-links",
+ "original_id": "a-group-of-images-that-form-a-single-larger-picture-with-no-links"
+ },
+ {
+ "id": "a-group-of-images-that-form-a-single-larger-picture-with-links",
+ "original_id": "a-group-of-images-that-form-a-single-larger-picture-with-links"
+ },
+ {
+ "id": "a-key-part-of-the-content",
+ "original_id": "a-key-part-of-the-content"
+ },
+ {
+ "id": "an-image-not-intended-for-the-user",
+ "original_id": "an-image-not-intended-for-the-user"
+ },
+ {
+ "id": "guidance-for-markup-generators",
+ "original_id": "guidance-for-markup-generators"
+ },
+ {
+ "id": "guidance-for-conformance-checkers",
+ "original_id": "guidance-for-conformance-checkers"
+ }
+ ]
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html
new file mode 100644
index 000000000..f7d47b364
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html
@@ -0,0 +1,37 @@
+<!doctype html>
+<title>img current pixel density basic</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<img src="/images/green-256x256.png" data-expect="256">
+<img srcset="/images/green-256x256.png 1x" data-expect="256">
+<img srcset="/images/green-256x256.png 1.6x" data-expect="160">
+<img srcset="/images/green-256x256.png 2x" data-expect="128">
+<img srcset="/images/green-256x256.png 10000x" data-expect="0">
+<img srcset="/images/green-256x256.png 9e99999999999999999999999x" data-expect="0">
+<img srcset="/images/green-256x256.png 256w" sizes="256px" data-expect="256">
+<img srcset="/images/green-256x256.png 512w" sizes="256px" data-expect="128">
+<img srcset="/images/green-256x256.png 256w" sizes="512px" data-expect="512">
+<img srcset="/images/green-256x256.png 256w" sizes="1px" data-expect="1">
+<img srcset="/images/green-256x256.png 256w" sizes="0px" data-expect="0">
+<!-- SVG -->
+<img srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-1%20-1%202%202'%20width='20'%20height='20'><circle%20r='1'/></svg> 2x" data-expect="10">
+<img srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-1%20-1%202%202'%20width='20'><circle%20r='1'/></svg> 2x" data-expect="10">
+<img srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-1%20-1%202%202'%20height='20'><circle%20r='1'/></svg> 2x" data-expect="10">
+<script>
+setup({explicit_done:true});
+onload = function() {
+ [].forEach.call(document.images, function(img) {
+ test(function() {
+ var expected = parseFloat(img.dataset.expect);
+ assert_equals(img.width, expected, 'width');
+ assert_equals(img.height, expected, 'height');
+ assert_equals(img.clientWidth, expected, 'clientWidth');
+ assert_equals(img.clientHeight, expected, 'clientHeight');
+ assert_equals(img.naturalWidth, expected, 'naturalWidth');
+ assert_equals(img.naturalHeight, expected, 'naturalHeight');
+ }, img.outerHTML);
+ });
+ done();
+};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/error.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/error.html
new file mode 100644
index 000000000..5e328b5e2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/error.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<title>img current pixel density error</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<img id=ref src="404" alt="testing">
+<img srcset="404" alt="testing">
+<img srcset="404 0.5x" alt="testing">
+<img srcset="404 2x" alt="testing">
+<img srcset="404 100w" alt="testing">
+<img srcset="404 100w" sizes="500px" alt="testing">
+<picture><img src="404 100w" sizes="500px" alt="testing"></picture>
+<script>
+setup({explicit_done:true});
+onload = function() {
+ var ref = document.getElementById("ref");
+ var expected_width = ref.width;
+ var expected_height = ref.height;
+ [].forEach.call(document.images, function(img) {
+ test(function() {
+ assert_not_equals(expected_width, 0, 'expected_width');
+ assert_not_equals(expected_height, 0, 'expected_height');
+ assert_equals(img.width, expected_width, 'width');
+ assert_equals(img.height, expected_height, 'height');
+ assert_equals(img.naturalWidth, 0, 'naturalWidth');
+ assert_equals(img.naturalHeight, 0, 'naturalHeight');
+ }, img.outerHTML);
+ });
+ done();
+};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/document-base-url-ref.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/document-base-url-ref.html
new file mode 100644
index 000000000..6e55b21ff
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/document-base-url-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE HTML>
+<meta charset="utf-8">
+<title>Document base URL img test</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-img-element" />
+<img src="resources/cat.jpg" alt="cat">
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/document-base-url.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/document-base-url.html
new file mode 100644
index 000000000..074209cc0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/document-base-url.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<meta charset="utf-8">
+<title>Document base URL img test</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-img-element" />
+<link rel="match" href="document-base-url-ref.html">
+<base href="resources/" />
+<img src="cat.jpg" alt="cat">
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/environment-changes/iframed.sub.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/environment-changes/iframed.sub.html
new file mode 100644
index 000000000..0f7ab9ae2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/environment-changes/iframed.sub.html
@@ -0,0 +1,78 @@
+<!doctype html>
+
+<img
+data-desc="img (no src)"
+data-narrow=""
+data-wide=""
+data-no-change>
+
+<img src=""
+data-desc="img (empty src)"
+data-narrow=""
+data-wide=""
+data-no-change>
+
+<img src="/images/broken.png?30-{{GET[id]}}"
+data-desc="img (src only) broken image"
+data-narrow="/images/broken.png?30-{{GET[id]}}"
+data-wide="/images/broken.png?30-{{GET[id]}}"
+data-no-change>
+
+<img src="/images/green-1x1.png?40-{{GET[id]}}"
+data-desc="img (src only) valid image"
+data-narrow="/images/green-1x1.png?40-{{GET[id]}}"
+data-wide="/images/green-1x1.png?40-{{GET[id]}}"
+data-no-change>
+
+<img srcset="/images/broken.png?50-{{GET[id]}}"
+data-desc="img (srcset 1 cand) broken image"
+data-narrow="/images/broken.png?50-{{GET[id]}}"
+data-wide="/images/broken.png?50-{{GET[id]}}"
+data-no-change>
+
+<img srcset="/images/green-1x1.png?60-{{GET[id]}}"
+data-desc="img (srcset 1 cand) valid image"
+data-narrow="/images/green-1x1.png?60-{{GET[id]}}"
+data-wide="/images/green-1x1.png?60-{{GET[id]}}"
+data-no-change>
+
+<picture>
+<source media="(max-width:500px)" srcset="/images/broken.png?70-{{GET[id]}}">
+<img src="/images/broken.png?71-{{GET[id]}}"
+data-desc="picture: source (max-width:500px) broken image, img broken image"
+data-narrow="/images/broken.png?70-{{GET[id]}}"
+data-wide="/images/broken.png?71-{{GET[id]}}">
+</picture>
+
+<picture>
+<source media="(max-width:500px)" srcset="/images/broken.png?80-{{GET[id]}}">
+<img src="/images/green-2x2.png?81-{{GET[id]}}"
+data-desc="picture: source (max-width:500px) broken image, img valid image"
+data-narrow="/images/broken.png?80-{{GET[id]}}"
+data-wide="/images/green-2x2.png?81-{{GET[id]}}">
+</picture>
+
+<picture>
+<source media="(max-width:500px)" srcset="/images/green-1x1.png?90-{{GET[id]}}">
+<img src="/images/broken.png?91-{{GET[id]}}"
+data-desc="picture: source (max-width:500px) valid image, img broken image"
+data-narrow="/images/green-1x1.png?90-{{GET[id]}}"
+data-wide="/images/broken.png?91-{{GET[id]}}">
+</picture>
+
+<picture>
+<source media="(max-width:500px)" srcset="/images/green-1x1.png?100-{{GET[id]}}">
+<img src="/images/green-2x2.png?101-{{GET[id]}}"
+data-desc="picture: source (max-width:500px) valid image, img valid image"
+data-narrow="/images/green-1x1.png?100-{{GET[id]}}"
+data-wide="/images/green-2x2.png?101-{{GET[id]}}">
+</picture>
+
+<picture>
+<source media="(max-width:500px)" srcset="/images/green-1x1.png?110-{{GET[id]}}">
+<img src="/images/green-1x1.png?110-{{GET[id]}}"
+data-desc="picture: same URL in source (max-width:500px) and img"
+data-narrow="/images/green-1x1.png?110-{{GET[id]}}"
+data-wide="/images/green-1x1.png?110-{{GET[id]}}"
+data-no-change>
+</picture>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html
new file mode 100644
index 000000000..21624712c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html
@@ -0,0 +1,65 @@
+<!doctype html>
+<title>img viewport change</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/utils.js"></script>
+<style>
+.narrow { width:50px }
+.wide { width:1000px }
+</style>
+<div id=log></div>
+<script>
+setup({explicit_done:true});
+
+function resolve(url) {
+ if (url === "") {
+ return url;
+ }
+ var a = document.createElement('a');
+ a.href = url;
+ return a.href;
+}
+
+function insertIframe(className) {
+ var iframe = document.createElement('iframe');
+ iframe.className = className;
+ iframe.src = 'iframed.sub.html?id=' + token();
+ document.body.appendChild(iframe);
+}
+insertIframe('narrow');
+insertIframe('wide');
+
+var start_date = new Date();
+
+onload = function() {
+ var load_time = new Date() - start_date;
+ var iframes = document.getElementsByTagName('iframe');
+ [].forEach.call(iframes, function(iframe) {
+ [].forEach.call(iframe.contentDocument.images, function(img) {
+ var expected = {wide:resolve(img.dataset.wide), narrow:resolve(img.dataset.narrow)};
+ var current = iframe.className;
+ var next = current === 'wide' ? 'narrow' : 'wide';
+ var expect_change = expected[next].indexOf('broken.png') !== 0 && !('noChange' in img.dataset);
+
+ test(function() {
+ assert_equals(img.currentSrc, expected[current]);
+ }, img.dataset.desc + ', onload, ' + current);
+
+ async_test(function() {
+ img.onload = this.unreached_func('Got unexpected load event');
+ img.onerror = this.unreached_func('Got unexpected error event');
+ if (expect_change) {
+ img.onload = this.step_func_done(function() {
+ assert_equals(img.currentSrc, expected[next]);
+ });
+ } else {
+ setTimeout(this.step_func_done(), 500 + load_time);
+ }
+ }, img.dataset.desc + ', resize to ' + next);
+ });
+ iframe.classList.toggle('wide');
+ iframe.classList.toggle('narrow');
+ });
+ done();
+}
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-1.jpg b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-1.jpg
new file mode 100644
index 000000000..2fb025560
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-1.jpg
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image.png b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image.png
new file mode 100644
index 000000000..d26878c9f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image.png
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/img.complete.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/img.complete.html
new file mode 100644
index 000000000..a34010aad
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/img.complete.html
@@ -0,0 +1,82 @@
+<!DOCTYPE HTML>
+<title>DOM img complete Test</title>
+<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
+<link rel="author" title="Anselm Hannemann" href="http://anselm-hannemann.com/" />
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-img-complete" />
+<meta name="assert" content="Tests the complete status of the img-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<img id="imgTestTag">
+<img src="" id="imgTestTag2">
+<img id="imgTestTag3" style="width: 80px; height:auto;">
+<img id="imgTestTag4">
+
+<script>
+ var imageInstance = document.createElement('img');
+ imageInstance.style.display = 'none';
+
+ document.body.appendChild(imageInstance);
+</script>
+
+<div id="log"></div>
+<script>
+ test(function() {
+ assert_true(document.getElementById("imgTestTag").complete);
+ }, "img src omitted");
+
+ test(function() {
+ assert_true(document.getElementById("imgTestTag2").complete);
+ }, "img src empty");
+
+ // test if set to true after img is completely available
+ var t = async_test("async src complete test");
+
+ t.step(function(){
+ document.getElementById("imgTestTag3").src = '3.jpg?nocache=' + Math.random();
+
+ //test if img.complete is set to false if src is changed
+ assert_false(document.getElementById("imgTestTag3").complete, "src changed, should be set to false")
+ });
+
+ document.getElementById("imgTestTag3").onload = t.step_func(function(){
+ assert_true(document.getElementById("imgTestTag3").complete);
+ t.done();
+ });
+
+ // https://html.spec.whatwg.org/multipage/multipage/embedded-content-1.html#update-the-image-data
+ // says to "await a stable state" before fetching so we use a separate <script>
+ imageInstance.src = 'image-1.jpg?pipe=trickle(d1)&nocache=' + Math.random(); // make sure the image isn't in cache
+</script>
+<script>
+ // test: The final task that is queued by the networking task source once the resource has been fetched has been queued, but has not yet been run, and the img element is not in the broken state
+ async_test(function(t) {
+ assert_false(imageInstance.complete, "imageInstance.complete should be false");
+ var startTime = Date.now();
+ while (true) {
+ if (Date.now() - startTime > 2000)
+ assert_unreached('.complete didn\'t change to true');
+ if (imageInstance.complete === true) break;
+ }
+ t.done();
+ },
+ 'IDL attribute complete returns true when image resource has been fetched but not run yet & image is not in broken state');
+
+ // test if broken img does not pass
+ var t2 = async_test("async src broken test");
+ var img4 = document.getElementById("imgTestTag4");
+
+ t2.step(
+ function(){
+ img4.src = 'brokenimg.jpg';
+
+ //test if img.complete is set to false if src is changed
+ assert_false(img4.complete, "src changed to broken img, should be set to false");
+ });
+
+ img4.onload = img4.onerror = t2.step_func(function(event){
+ assert_equals(event.type, "error");
+ assert_true(img4.complete);
+ t2.done();
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/invalid-src.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/invalid-src.html
new file mode 100644
index 000000000..f1fbe34c5
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/invalid-src.html
@@ -0,0 +1,42 @@
+<!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=brokenurl />
+<img id=emptysrc />
+<script>
+async_test(function(t) {
+ var img = document.getElementById("brokenurl");
+ 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");
+ }));
+}, 'src="http://also a broken url"');
+
+async_test(function(t) {
+ var img = document.getElementById("emptysrc");
+ img.src = "";
+ var loadendevent = false;
+
+ // Setting src to empty string triggers only error event.
+ // 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() {
+ // Queue this check in the event loop to check there is no loadend event
+ // fired.
+ t.step_timeout(t.step_func_done(function() {
+ assert_false(loadendevent, "loadend event should not fired");
+ }), 0)
+ }));
+ img.addEventListener('loadend', t.step_func(function() {
+ loadendevent = true;
+ }));
+}, 'src=""');
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/nonexistent-image.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/nonexistent-image.html
new file mode 100644
index 000000000..f58569ede
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/nonexistent-image.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<meta charset="utf-8">
+<title>Loading an nonexisting image should fail; triggering appropriate events</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<img>
+
+<script>
+ async_test(function(t) {
+ var img = document.querySelector("img");
+ img.onload = this.step_func_done(function() {
+ assert_unreached("image.onload() was not supposed to be called");
+ });
+ img.onerror = this.step_func_done(function(e) {
+ assert_equals(e.type, "error", "image.onerror() called");
+ t.done();
+ });
+ img.src = "404";
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html
new file mode 100644
index 000000000..c8e09e8d0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html
@@ -0,0 +1,416 @@
+<!doctype html>
+<title>img relevant mutations</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+
+<!-- should invoke update the image data -->
+
+<img data-desc="src set">
+<img src="/images/green-2x2.png" data-desc="src changed">
+<img src="/images/green-2x2.png" data-desc="src removed">
+
+<img data-desc="srcset set">
+<img srcset="/images/green-2x2.png" data-desc="srcset changed">
+<img srcset="/images/green-2x2.png" data-desc="srcset removed">
+
+<img data-desc="sizes set">
+<img sizes="" data-desc="sizes changed">
+<img sizes="" data-desc="sizes removed">
+
+<img src="/images/green-2x2.png" data-desc="src set to same value">
+
+<img data-desc="crossorigin absent to empty">
+<img data-desc="crossorigin absent to anonymous">
+<img data-desc="crossorigin absent to use-credentials">
+<img crossorigin data-desc="crossorigin empty to absent">
+<img crossorigin data-desc="crossorigin empty to use-credentials">
+<img crossorigin=anonymous data-desc="crossorigin anonymous to absent">
+<img crossorigin=anonymous data-desc="crossorigin anonymous to use-credentials">
+<img crossorigin=use-credentials data-desc="crossorigin use-credentials to absent">
+<img crossorigin=use-credentials data-desc="crossorigin use-credentials to empty">
+<img crossorigin=use-credentials data-desc="crossorigin use-credentials to anonymous">
+
+<img src="/images/green-2x2.png" data-desc="inserted into picture"><picture></picture>
+
+<picture><img src="/images/green-2x2.png" data-desc="removed from picture"></picture>
+
+<picture><img src="/images/green-2x2.png" data-desc="parent is picture, previous source inserted"></picture>
+
+<picture><source><img src="/images/green-2x2.png" data-desc="parent is picture, previous source removed"></picture>
+
+<picture><source><img src="/images/green-2x2.png" data-desc="parent is picture, previous source has srcset set"></picture>
+<picture><source srcset=""><img src="/images/green-2x2.png" data-desc="parent is picture, previous source has srcset changed"></picture>
+<picture><source srcset=""><img src="/images/green-2x2.png" data-desc="parent is picture, previous source has srcset removed"></picture>
+
+<picture><source><img src="/images/green-2x2.png" data-desc="parent is picture, previous source has sizes set"></picture>
+<picture><source sizes=""><img src="/images/green-2x2.png" data-desc="parent is picture, previous source has sizes changed"></picture>
+<picture><source sizes=""><img src="/images/green-2x2.png" data-desc="parent is picture, previous source has sizes removed"></picture>
+
+<picture><source><img src="/images/green-2x2.png" data-desc="parent is picture, previous source has media set"></picture>
+<picture><source media=""><img src="/images/green-2x2.png" data-desc="parent is picture, previous source has media changed"></picture>
+<picture><source media=""><img src="/images/green-2x2.png" data-desc="parent is picture, previous source has media removed"></picture>
+
+<picture><source><img src="/images/green-2x2.png" data-desc="parent is picture, previous source has type set"></picture>
+<picture><source type=""><img src="/images/green-2x2.png" data-desc="parent is picture, previous source has type changed"></picture>
+<picture><source type=""><img src="/images/green-2x2.png" data-desc="parent is picture, previous source has type removed"></picture>
+
+<!-- should not invoke update the image data -->
+
+<img srcset="/images/green-2x2.png" data-desc="srcset is set to same value">
+<img srcset="/images/green-2x2.png" sizes data-desc="sizes is set to same value">
+
+<img src="/images/green-2x2.png" data-desc="crossorigin state not changed: absent, removeAttribute">
+<img src="/images/green-2x2.png" crossorigin data-desc="crossorigin state not changed: empty to anonymous">
+<img src="/images/green-2x2.png" crossorigin=anonymous data-desc="crossorigin state not changed: anonymous to foobar">
+<img src="/images/green-2x2.png" crossorigin=use-credentials data-desc="crossorigin state not changed: use-credentials to USE-CREDENTIALS">
+
+<img src="/images/green-2x2.png" data-desc="inserted into picture ancestor"><picture><span></span></picture>
+<picture><span><img src="/images/green-2x2.png" data-desc="removed from picture ancestor"></span></picture>
+
+<picture><span><img src="/images/green-2x2.png" data-desc="ancestor picture has a source inserted"></span></picture>
+<picture><source><span><img src="/images/green-2x2.png" data-desc="ancestor picture has a source removed"></span></picture>
+
+<picture><span><img src="/images/green-2x2.png" data-desc="ancestor picture; previous sibling source inserted"></span></picture>
+<picture><span><source><img src="/images/green-2x2.png" data-desc="ancestor picture; previous sibling source removed"></span></picture>
+
+<picture><img src="/images/green-2x2.png" data-desc="parent is picture, following sibling source inserted"></picture>
+<picture><img src="/images/green-2x2.png" data-desc="parent is picture, following sibling source removed"><source></picture>
+
+<picture><img src="/images/green-2x2.png" data-desc="parent is picture, following sibling source has srcset set"><source></picture>
+
+<img src="/images/green-2x2.png" data-desc="media on img set">
+<img src="/images/green-2x2.png" data-desc="type on img set">
+<img src="/images/green-2x2.png" data-desc="class on img set">
+<img src="/images/green-2x2.png" data-desc="alt on img set">
+
+<picture><source><img src="/images/green-2x2.png" data-desc="src on previous sibling source set"></picture>
+<picture><source><img src="/images/green-2x2.png" data-desc="class on previous sibling source set"></picture>
+
+<img src="/images/green-2x2.png" data-desc="inserted/removed children of img">
+
+<picture><img src="/images/green-2x2.png" data-desc="picture is inserted; img has src"></picture><span></span>
+<picture><img srcset="/images/green-2x2.png" data-desc="picture is inserted; img has srcset"></picture><span></span>
+<picture><source srcset="/images/green-2x2.png"><img src="/images/green-2x2.png" data-desc="picture is inserted; img has previous sibling source"></picture><span></span>
+<picture><img src="/images/green-2x2.png" data-desc="picture is inserted; img has following sibling source"><source srcset="/images/green-2x2.png"></picture><span></span>
+
+<picture><img src="/images/green-2x2.png" data-desc="picture is removed; img has src"></picture>
+<picture><img srcset="/images/green-2x2.png" data-desc="picture is removed; img has srcset"></picture>
+<picture><source srcset="/images/green-2x2.png"><img src="/images/green-2x2.png" data-desc="picture is removed; img has previous sibling source"></picture>
+<picture><img src="/images/green-2x2.png" data-desc="picture is removed; img has following sibling source"><source srcset="/images/green-2x2.png"></picture>
+
+<picture><img src="/images/green-2x2.png" data-desc="parent is picture, following img inserted"></picture>
+<picture><img src="/images/green-2x2.png" data-desc="parent is picture, following img removed"><img></picture>
+<picture><img src="/images/green-2x2.png" data-desc="parent is picture, following img has src set"><img></picture>
+<picture><img src="/images/green-2x2.png" data-desc="parent is picture, following img has srcset set"><img></picture>
+<picture><img src="/images/green-2x2.png" data-desc="parent is picture, following img has sizes set"><img></picture>
+
+
+<script>
+setup({explicit_done:true});
+
+function t(desc, func, expect) {
+ async_test(function() {
+ var img = document.querySelector('[data-desc="' + desc + '"]');
+ img.onload = img.onerror = this.unreached_func('update the image data was run');
+ if (expect == 'timeout') {
+ setTimeout(this.step_func_done(), 1000);
+ } else {
+ img['on' + expect] = this.step_func_done(function() {});
+ }
+ func.call(this, img);
+ }, desc);
+}
+
+onload = function() {
+
+ t('src set', function(img) {
+ img.src = '/images/green-2x2.png';
+ }, 'load');
+
+ t('src changed', function(img) {
+ img.src = '/images/green-2x2.png ';
+ }, 'load');
+
+ t('src removed', function(img) {
+ img.removeAttribute('src');
+ }, 'timeout');
+
+ t('srcset set', function(img) {
+ img.srcset = '/images/green-2x2.png';
+ }, 'load');
+
+ t('srcset changed', function(img) {
+ img.srcset = '/images/green-2x2.png ';
+ }, 'load');
+
+ t('srcset removed', function(img) {
+ img.removeAttribute('srcset');
+ }, 'timeout');
+
+ t('sizes set', function(img) {
+ img.sizes = '';
+ }, 'timeout');
+
+ t('sizes changed', function(img) {
+ img.sizes = ' ';
+ }, 'timeout');
+
+ t('sizes removed', function(img) {
+ img.removeAttribute('sizes');
+ }, 'timeout');
+
+ t('src set to same value', function(img) {
+ img.src = '/images/green-2x2.png';
+ }, 'load');
+
+ t('crossorigin absent to empty', function(img) {
+ img.crossOrigin = '';
+ }, 'timeout');
+
+ t('crossorigin absent to anonymous', function(img) {
+ img.crossOrigin = 'anonymous';
+ }, 'timeout');
+
+ t('crossorigin absent to use-credentials', function(img) {
+ img.crossOrigin = 'use-credentials';
+ }, 'timeout');
+
+ t('crossorigin empty to absent', function(img) {
+ img.removeAttribute('crossorigin');
+ }, 'timeout');
+
+ t('crossorigin empty to use-credentials', function(img) {
+ img.crossOrigin = 'use-credentials';
+ }, 'timeout');
+
+ t('crossorigin anonymous to absent', function(img) {
+ img.removeAttribute('crossorigin');
+ }, 'timeout');
+
+ t('crossorigin anonymous to use-credentials', function(img) {
+ img.crossOrigin = 'use-credentials';
+ }, 'timeout');
+
+ t('crossorigin use-credentials to absent', function(img) {
+ img.removeAttribute('crossorigin');
+ }, 'timeout');
+
+ t('crossorigin use-credentials to empty', function(img) {
+ img.crossOrigin = '';
+ }, 'timeout');
+
+ t('crossorigin use-credentials to anonymous', function(img) {
+ img.crossOrigin = 'anonymous';
+ }, 'timeout');
+
+ t('inserted into picture', function(img) {
+ img.nextSibling.appendChild(img);
+ }, 'load');
+
+ t('removed from picture', function(img) {
+ img.parentNode.removeChild(img);
+ }, 'load');
+
+ t('parent is picture, previous source inserted', function(img) {
+ img.parentNode.insertBefore(document.createElement('source'), img);
+ }, 'load');
+
+ t('parent is picture, previous source removed', function(img) {
+ img.parentNode.removeChild(img.previousSibling);
+ }, 'load');
+
+ t('parent is picture, previous source has srcset set', function(img) {
+ img.previousSibling.srcset = '';
+ }, 'load');
+
+ t('parent is picture, previous source has srcset changed', function(img) {
+ img.previousSibling.srcset = ' ';
+ }, 'load');
+
+ t('parent is picture, previous source has srcset removed', function(img) {
+ img.previousSibling.removeAttribute('srcset');
+ }, 'load');
+
+ t('parent is picture, previous source has sizes set', function(img) {
+ img.previousSibling.sizes = '';
+ }, 'load');
+
+ t('parent is picture, previous source has sizes changed', function(img) {
+ img.previousSibling.sizes = ' ';
+ }, 'load');
+
+ t('parent is picture, previous source has sizes removed', function(img) {
+ img.previousSibling.removeAttribute('sizes');
+ }, 'load');
+
+ t('parent is picture, previous source has media set', function(img) {
+ img.previousSibling.media = '';
+ }, 'load');
+
+ t('parent is picture, previous source has media changed', function(img) {
+ img.previousSibling.media = ' ';
+ }, 'load');
+
+ t('parent is picture, previous source has media removed', function(img) {
+ img.previousSibling.removeAttribute('media');
+ }, 'load');
+
+ t('parent is picture, previous source has type set', function(img) {
+ img.previousSibling.type = '';
+ }, 'load');
+
+ t('parent is picture, previous source has type changed', function(img) {
+ img.previousSibling.type = ' ';
+ }, 'load');
+
+ t('parent is picture, previous source has type removed', function(img) {
+ img.previousSibling.removeAttribute('type');
+ }, 'load');
+
+ t('srcset is set to same value', function(img) {
+ img.srcset = "/images/green-2x2.png";
+ }, 'timeout');
+
+ t('sizes is set to same value', function(img) {
+ img.sizes = '';
+ }, 'timeout');
+
+ t('crossorigin state not changed: absent, removeAttribute', function(img) {
+ img.removeAttribute('crossorigin');
+ }, 'timeout');
+
+ t('crossorigin state not changed: empty to anonymous', function(img) {
+ img.crossOrigin = 'anonymous';
+ }, 'timeout');
+
+ t('crossorigin state not changed: anonymous to foobar', function(img) {
+ img.crossOrigin = 'foobar';
+ }, 'timeout');
+
+ t('crossorigin state not changed: use-credentials to USE-CREDENTIALS', function(img) {
+ img.crossOrigin = 'USE-CREDENTIALS';
+ }, 'timeout');
+
+ t('inserted into picture ancestor', function(img) {
+ img.nextSibling.firstChild.appendChild(img);
+ }, 'timeout');
+
+ t('removed from picture ancestor', function(img) {
+ img.parentNode.removeChild(img);
+ }, 'timeout');
+
+ t('ancestor picture has a source inserted', function(img) {
+ img.parentNode.parentNode.insertBefore(document.createElement('source'), img.parentNode);
+ }, 'timeout');
+
+ t('ancestor picture has a source removed', function(img) {
+ img.parentNode.parentNode.removeChild(img.parentNode.previousSibling);
+ }, 'timeout');
+
+ t('ancestor picture; previous sibling source inserted', function(img) {
+ img.parentNode.insertBefore(document.createElement('source'), img);
+ }, 'timeout');
+
+ t('ancestor picture; previous sibling source removed', function(img) {
+ img.parentNode.removeChild(img.previousSibling);
+ }, 'timeout');
+
+ t('parent is picture, following sibling source inserted', function(img) {
+ img.parentNode.appendChild(document.createElement('source'));
+ }, 'timeout');
+
+ t('parent is picture, following sibling source removed', function(img) {
+ img.parentNode.removeChild(img.nextSibling);
+ }, 'timeout');
+
+ t('parent is picture, following sibling source has srcset set', function(img) {
+ img.nextSibling.srcset = '';
+ }, 'timeout');
+
+ t('media on img set', function(img) {
+ img.setAttribute('media', '');
+ }, 'timeout');
+
+ t('type on img set', function(img) {
+ img.setAttribute('type', '');
+ }, 'timeout');
+
+ t('class on img set', function(img) {
+ img.className = '';
+ }, 'timeout');
+
+ t('alt on img set', function(img) {
+ img.alt = '';
+ }, 'timeout');
+
+ t('src on previous sibling source set', function(img) {
+ img.previousSibling.setAttribute('src', '');
+ }, 'timeout');
+
+ t('class on previous sibling source set', function(img) {
+ img.previousSibling.className = '';
+ }, 'timeout');
+
+ t('inserted/removed children of img', function(img) {
+ img.appendChild(document.createElement('source'));
+ setTimeout(this.step_func(function() {
+ img.removeChild(img.firstChild);
+ }), 0);
+ }, 'timeout');
+
+ t('picture is inserted; img has src', function(img) {
+ img.parentNode.nextSibling.appendChild(img.parentNode);
+ }, 'timeout');
+
+ t('picture is inserted; img has srcset', function(img) {
+ img.parentNode.nextSibling.appendChild(img.parentNode);
+ }, 'timeout');
+
+ t('picture is inserted; img has previous sibling source', function(img) {
+ img.parentNode.nextSibling.appendChild(img.parentNode);
+ }, 'timeout');
+
+ t('picture is inserted; img has following sibling source', function(img) {
+ img.parentNode.nextSibling.appendChild(img.parentNode);
+ }, 'timeout');
+
+ t('picture is removed; img has src', function(img) {
+ img.parentNode.parentNode.removeChild(img.parentNode);
+ }, 'timeout');
+
+ t('picture is removed; img has srcset', function(img) {
+ img.parentNode.parentNode.removeChild(img.parentNode);
+ }, 'timeout');
+
+ t('picture is removed; img has previous sibling source', function(img) {
+ img.parentNode.parentNode.removeChild(img.parentNode);
+ }, 'timeout');
+
+ t('picture is removed; img has following sibling source', function(img) {
+ img.parentNode.parentNode.removeChild(img.parentNode);
+ }, 'timeout');
+
+ t('parent is picture, following img inserted', function(img) {
+ img.parentNode.appendChild(document.createElement('img'));
+ }, 'timeout');
+
+ t('parent is picture, following img removed', function(img) {
+ img.parentNode.removeChild(img.nextSibling);
+ }, 'timeout');
+
+ t('parent is picture, following img has src set', function(img) {
+ img.nextSibling.src = '';
+ }, 'timeout');
+
+ t('parent is picture, following img has srcset set', function(img) {
+ img.nextSibling.srcset = '';
+ }, 'timeout');
+
+ t('parent is picture, following img has sizes set', function(img) {
+ img.nextSibling.sizes = '';
+ }, 'timeout');
+
+ done();
+};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/resources/cat.jpg b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/resources/cat.jpg
new file mode 100644
index 000000000..a4f14f54d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/resources/cat.jpg
Binary files differ
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
new file mode 100644
index 000000000..bd2045420
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
@@ -0,0 +1,42 @@
+<!doctype html>
+<title>img parse a sizes attribute</title>
+<meta name="timeout" content="long">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<iframe data-desc="standards mode" style="width:1000px; height:1000px" src="sizes-iframed.sub.html?doctype=doctype%20html&style="></iframe>
+<iframe data-desc="quirks mode" style="width:1000px; height:1000px" src="sizes-iframed.sub.html?doctype=----&style="></iframe>
+<iframe data-desc="display:none" style="width:1000px; height:1000px" src="sizes-iframed.sub.html?doctype=doctype%20html&style=display:none"></iframe>
+<iframe data-desc="width:1000px" style="width:1000px; height:1000px" src="sizes-iframed.sub.html?doctype=doctype%20html&style=width:1000px%3B%20height:16px"></iframe>
+<script>
+setup({explicit_done:true});
+
+function check(p, iframe) {
+ var current = p.firstElementChild;
+ var ref_sizes = current.getAttribute('sizes');
+ var expect = p.firstElementChild.currentSrc;
+ if (expect) {
+ expect = expect.split('?')[0];
+ }
+ while (current = current.nextElementSibling) {
+ test(function() {
+ if (expect === '' || expect === null || expect === undefined) {
+ assert_unreached('ref currentSrc was ' + format_value(expect));
+ }
+ var got = current.currentSrc;
+ assert_greater_than(got.indexOf('?'), -1, 'expected a "?" in currentSrc');
+ got = got.split('?')[0];
+ assert_equals(got, expect);
+ }, current.outerHTML + ' ref sizes=' + format_value(ref_sizes) + ' (' + iframe.getAttribute('data-desc') + ')');
+ }
+}
+
+onload = function() {
+ [].forEach.call(document.querySelectorAll('iframe'), function(iframe) {
+ [].forEach.call(iframe.contentDocument.querySelectorAll('p'), function(p) {
+ check(p, iframe);
+ });
+ });
+ done();
+}
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/sizes-iframed.sub.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/sizes-iframed.sub.html
new file mode 100644
index 000000000..925bb4699
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/sizes-iframed.sub.html
@@ -0,0 +1,178 @@
+<!{{GET[doctype]}}>
+<style> img { {{GET[style]}} } </style>
+<!-- First <img> in a <p> is the reference. The following <img>s should be equivalent -->
+<!-- default is 100vw, not 300px -->
+<p>
+<img srcset='/images/green-1x1.png?a1 300w, /images/green-16x16.png?a1 301w' sizes='100vw'>
+<img srcset='/images/green-1x1.png?a2 300w, /images/green-16x16.png?a2 301w'>
+<p>
+<img srcset='/images/green-1x1.png?b1 450w, /images/green-16x16.png?b1 451w' sizes='100vw'>
+<img srcset='/images/green-1x1.png?b2 450w, /images/green-16x16.png?b2 451w'>
+<p>
+<img srcset='/images/green-1x1.png?c1 600w, /images/green-16x16.png?c1 601w' sizes='100vw'>
+<img srcset='/images/green-1x1.png?c2 600w, /images/green-16x16.png?c2 601w'>
+<p>
+<img srcset='/images/green-1x1.png?d1 900w, /images/green-16x16.png?d1 901w' sizes='100vw'>
+<img srcset='/images/green-1x1.png?d2 900w, /images/green-16x16.png?d2 901w'>
+
+<p>
+<img srcset='/images/green-1x1.png?e1 50w, /images/green-16x16.png?e1 51w' sizes='1px'>
+<img srcset='/images/green-1x1.png?e2 50w, /images/green-16x16.png?e2 51w' sizes='0'>
+<img srcset='/images/green-1x1.png?e3 50w, /images/green-16x16.png?e3 51w' sizes='-0'>
+<img srcset='/images/green-1x1.png?e4 50w, /images/green-16x16.png?e4 51w' sizes='+0'>
+<img srcset='/images/green-1x1.png?e5 50w, /images/green-16x16.png?e5 51w' sizes='+1px'>
+<img srcset='/images/green-1x1.png?e6 50w, /images/green-16x16.png?e6 51w' sizes='.1px'>
+<img srcset='/images/green-1x1.png?e7 50w, /images/green-16x16.png?e7 51w' sizes='0.1em'>
+<img srcset='/images/green-1x1.png?e8 50w, /images/green-16x16.png?e8 51w' sizes='0.1ex'>
+<img srcset='/images/green-1x1.png?e9 50w, /images/green-16x16.png?e9 51w' sizes='0.1ch'>
+<img srcset='/images/green-1x1.png?e10 50w, /images/green-16x16.png?e10 51w' sizes='0.1rem'>
+<img srcset='/images/green-1x1.png?e11 50w, /images/green-16x16.png?e11 51w' sizes='0.1vw'>
+<img srcset='/images/green-1x1.png?e12 50w, /images/green-16x16.png?e12 51w' sizes='0.1vh'>
+<img srcset='/images/green-1x1.png?e13 50w, /images/green-16x16.png?e13 51w' sizes='0.1vmin'>
+<img srcset='/images/green-1x1.png?e14 50w, /images/green-16x16.png?e14 51w' sizes='0.1vmax'>
+<img srcset='/images/green-1x1.png?e15 50w, /images/green-16x16.png?e15 51w' sizes='0.1cm'>
+<img srcset='/images/green-1x1.png?e16 50w, /images/green-16x16.png?e16 51w' sizes='1mm'>
+<img srcset='/images/green-1x1.png?e17 50w, /images/green-16x16.png?e17 51w' sizes='1q'>
+<img srcset='/images/green-1x1.png?e18 50w, /images/green-16x16.png?e18 51w' sizes='0.01in'>
+<img srcset='/images/green-1x1.png?e19 50w, /images/green-16x16.png?e19 51w' sizes='0.1pc'>
+<img srcset='/images/green-1x1.png?e20 50w, /images/green-16x16.png?e20 51w' sizes='0.1pt'>
+<img srcset='/images/green-1x1.png?e21 50w, /images/green-16x16.png?e21 51w' sizes='/* */1px/* */'>
+<img srcset='/images/green-1x1.png?e22 50w, /images/green-16x16.png?e22 51w' sizes=' /**/ /**/ 1px /**/ /**/ '>
+<img srcset='/images/green-1x1.png?e23 50w, /images/green-16x16.png?e23 51w' sizes='(),1px'>
+<img srcset='/images/green-1x1.png?e24 50w, /images/green-16x16.png?e24 51w' sizes='x(),1px'>
+<img srcset='/images/green-1x1.png?e25 50w, /images/green-16x16.png?e25 51w' sizes='{},1px'>
+<img srcset='/images/green-1x1.png?e26 50w, /images/green-16x16.png?e26 51w' sizes='[],1px'>
+<img srcset='/images/green-1x1.png?e27 50w, /images/green-16x16.png?e27 51w' sizes='1px,('>
+<img srcset='/images/green-1x1.png?e28 50w, /images/green-16x16.png?e28 51w' sizes='1px,x('>
+<img srcset='/images/green-1x1.png?e29 50w, /images/green-16x16.png?e29 51w' sizes='1px,{'>
+<img srcset='/images/green-1x1.png?e30 50w, /images/green-16x16.png?e30 51w' sizes='1px,['>
+<img srcset='/images/green-1x1.png?e31 50w, /images/green-16x16.png?e31 51w' sizes='\(,1px'>
+<img srcset='/images/green-1x1.png?e32 50w, /images/green-16x16.png?e32 51w' sizes='x\(,1px'>
+<img srcset='/images/green-1x1.png?e33 50w, /images/green-16x16.png?e33 51w' sizes='\{,1px'>
+<img srcset='/images/green-1x1.png?e34 50w, /images/green-16x16.png?e34 51w' sizes='\[,1px'>
+<img srcset='/images/green-1x1.png?e35 50w, /images/green-16x16.png?e35 51w' sizes='1\p\x'>
+<img srcset='/images/green-1x1.png?e36 50w, /images/green-16x16.png?e36 51w' sizes='calc(1px)'>
+<img srcset='/images/green-1x1.png?e37 50w, /images/green-16x16.png?e37 51w' sizes='(min-width:0) calc(1px)'>
+<img srcset='/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w' sizes='(min-width:calc(0)) 1px'>
+<img srcset='/images/green-1x1.png?e39 50w, /images/green-16x16.png?e39 51w' sizes='(min-width:0) 1px, 100vw'>
+<img srcset='/images/green-1x1.png?e40 50w, /images/green-16x16.png?e40 51w' sizes='(min-width:0) 1px, (min-width:0) 100vw, 100vw'>
+<img srcset='/images/green-1x1.png?e41 50w, /images/green-16x16.png?e41 51w' sizes='(min-width:0) 1px'>
+<img srcset='/images/green-1x1.png?e42 50w, /images/green-16x16.png?e42 51w' sizes='not (min-width:0) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e43 50w, /images/green-16x16.png?e43 51w' sizes='(min-width:unknown-mf-value) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e44 50w, /images/green-16x16.png?e44 51w' sizes='not (min-width:unknown-mf-value) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e45 50w, /images/green-16x16.png?e45 51w' sizes='(min-width:-1px) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e46 50w, /images/green-16x16.png?e46 51w' sizes='not (min-width:-1px) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e47 50w, /images/green-16x16.png?e47 51w' sizes='(unknown-mf-name) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e48 50w, /images/green-16x16.png?e48 51w' sizes='not (unknown-mf-name) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e49 50w, /images/green-16x16.png?e49 51w' sizes='(unknown "general-enclosed") 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e50 50w, /images/green-16x16.png?e50 51w' sizes='not (unknown "general-enclosed") 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e51 50w, /images/green-16x16.png?e51 51w' sizes='unknown-general-enclosed(foo) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e52 50w, /images/green-16x16.png?e52 51w' sizes='not unknown-general-enclosed(foo) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e53 50w, /images/green-16x16.png?e53 51w' sizes='print 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e54 50w, /images/green-16x16.png?e54 51w' sizes='not print 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e55 50w, /images/green-16x16.png?e55 51w' sizes='unknown-media-type 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e56 50w, /images/green-16x16.png?e56 51w' sizes='not unknown-media-type 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e57 50w, /images/green-16x16.png?e57 51w' sizes='(min-width:0) or (min-width:0) 1px'>
+<img srcset='/images/green-1x1.png?e58 50w, /images/green-16x16.png?e58 51w' sizes='(min-width:0) or (unknown-mf-name) 1px'>
+<img srcset='/images/green-1x1.png?e59 50w, /images/green-16x16.png?e59 51w' sizes='(min-width:0) or (min-width:unknown-mf-value) 1px'>
+<img srcset='/images/green-1x1.png?e60 50w, /images/green-16x16.png?e60 51w' sizes='(min-width:0) or (min-width:-1px) 1px'>
+<img srcset='/images/green-1x1.png?e61 50w, /images/green-16x16.png?e61 51w' sizes='(min-width:0) or (unknown "general-enclosed") 1px'>
+<img srcset='/images/green-1x1.png?e62 50w, /images/green-16x16.png?e62 51w' sizes='(min-width:0) or unknown-general-enclosed(foo) 1px'>
+<img srcset='/images/green-1x1.png?e63 50w, /images/green-16x16.png?e63 51w' sizes='(min-width:0) or (!) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e64 50w, /images/green-16x16.png?e64 51w' sizes='(min-width:0) or unknown-media-type 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e65 50w, /images/green-16x16.png?e65 51w' sizes='(123) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e66 50w, /images/green-16x16.png?e66 51w' sizes='not (123) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e67 50w, /images/green-16x16.png?e67 51w' sizes='(!) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e68 50w, /images/green-16x16.png?e68 51w' sizes='not (!) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e69 50w, /images/green-16x16.png?e69 51w' sizes='! 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e70 50w, /images/green-16x16.png?e70 51w' sizes='not ! 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e71 50w, /images/green-16x16.png?e71 51w' sizes='(]) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e72 50w, /images/green-16x16.png?e72 51w' sizes='not (]) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e73 50w, /images/green-16x16.png?e73 51w' sizes='] 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e74 50w, /images/green-16x16.png?e74 51w' sizes='not ] 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e75 50w, /images/green-16x16.png?e75 51w' sizes='(}) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e76 50w, /images/green-16x16.png?e76 51w' sizes='not (}) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e77 50w, /images/green-16x16.png?e77 51w' sizes='} 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e78 50w, /images/green-16x16.png?e78 51w' sizes='not } 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e79 50w, /images/green-16x16.png?e79 51w' sizes=') 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e80 50w, /images/green-16x16.png?e80 51w' sizes='not ) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e81 50w, /images/green-16x16.png?e81 51w' sizes='(;) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e82 50w, /images/green-16x16.png?e82 51w' sizes='not (;) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e83 50w, /images/green-16x16.png?e83 51w' sizes='(.) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e84 50w, /images/green-16x16.png?e84 51w' sizes='not (.) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e85 50w, /images/green-16x16.png?e85 51w' sizes='; 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e86 50w, /images/green-16x16.png?e86 51w' sizes='not ; 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e87 50w, /images/green-16x16.png?e87 51w' sizes=', 1px'>
+<img srcset='/images/green-1x1.png?e88 50w, /images/green-16x16.png?e88 51w' sizes='1px,'>
+<img srcset='/images/green-1x1.png?e89 50w, /images/green-16x16.png?e89 51w' sizes='(min-width:0) 1px,'>
+<img srcset='/images/green-1x1.png?e90 50w, /images/green-16x16.png?e90 51w' sizes='-0e-0px'>
+<img srcset='/images/green-1x1.png?e91 50w, /images/green-16x16.png?e91 51w' sizes='+0.11e+01px'>
+<img srcset='/images/green-1x1.png?e92 50w, /images/green-16x16.png?e92 51w' sizes='0.2e1px'>
+<img srcset='/images/green-1x1.png?e93 50w, /images/green-16x16.png?e93 51w' sizes='0.3E1px'>
+<img srcset='/images/green-1x1.png?e94 50w, /images/green-16x16.png?e94 51w' sizes='.4E1px'>
+<img srcset='/images/green-1x1.png?e95 50w, /images/green-16x16.png?e95 51w' sizes='all 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e96 50w, /images/green-16x16.png?e96 51w' sizes='all and (min-width:0) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e97 50w, /images/green-16x16.png?e97 51w' sizes='min-width:0 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e98 50w, /images/green-16x16.png?e98 51w' sizes='1px, 100vw'>
+<img srcset='/images/green-1x1.png?e99 50w, /images/green-16x16.png?e99 51w' sizes='1px, (min-width:0) 100vw'>
+<img srcset='/images/green-1x1.png?e100 50w, /images/green-16x16.png?e100 51w' sizes='1px, foo bar'>
+<img srcset='/images/green-1x1.png?e101 50w, /images/green-16x16.png?e101 51w' sizes='(min-width:0) 1px, foo bar'>
+<img srcset='/images/green-1x1.png?e102 50w, /images/green-16x16.png?e102 51w' sizes='("grammar does not match") 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e103 50w, /images/green-16x16.png?e103 51w' sizes='not ("grammar does not match") 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e104 50w, /images/green-16x16.png?e104 51w' sizes='(unknown-general-enclosed !) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e105 50w, /images/green-16x16.png?e105 51w' sizes='not (unknown-general-enclosed !) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e106 50w, /images/green-16x16.png?e106 51w' sizes='(min-width:0) or (unknown-general-enclosed !) 1px'>
+<img srcset='/images/green-1x1.png?e107 50w, /images/green-16x16.png?e107 51w' sizes='not ((min-width:0) or (unknown "general-enclosed")) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e108 50w, /images/green-16x16.png?e108 51w' sizes='(max-width:0) or (unknown-general-enclosed !) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?e109 50w, /images/green-16x16.png?e109 51w' sizes='not ((max-width:0) or (unknown "general-enclosed")) 100vw, 1px'>
+<img srcset='/images/green-1x1.png?f48 50w, /images/green-16x16.png?f48 51w' sizes='calc(1px'>
+<img srcset='/images/green-1x1.png?f49 50w, /images/green-16x16.png?f49 51w' sizes='(min-width:0) calc(1px'>
+
+<p>
+<img srcset='/images/green-1x1.png?f1 50w, /images/green-16x16.png?f1 51w' sizes='100vw'>
+<img srcset='/images/green-1x1.png?f2 50w, /images/green-16x16.png?f2 51w' sizes=''>
+<img srcset='/images/green-1x1.png?f3 50w, /images/green-16x16.png?f3 51w' sizes=','>
+<img srcset='/images/green-1x1.png?f4 50w, /images/green-16x16.png?f4 51w' sizes='-1px'>
+<img srcset='/images/green-1x1.png?f5 50w, /images/green-16x16.png?f5 51w' sizes='1'>
+<img srcset='/images/green-1x1.png?f6 50w, /images/green-16x16.png?f6 51w' sizes='0.1%'>
+<img srcset='/images/green-1x1.png?f7 50w, /images/green-16x16.png?f7 51w' sizes='0.1deg'>
+<img srcset='/images/green-1x1.png?f8 50w, /images/green-16x16.png?f8 51w' sizes='0.1grad'>
+<img srcset='/images/green-1x1.png?f9 50w, /images/green-16x16.png?f9 51w' sizes='0.1rad'>
+<img srcset='/images/green-1x1.png?f10 50w, /images/green-16x16.png?f10 51w' sizes='0.1turn'>
+<img srcset='/images/green-1x1.png?f11 50w, /images/green-16x16.png?f11 51w' sizes='0.1s'>
+<img srcset='/images/green-1x1.png?f12 50w, /images/green-16x16.png?f12 51w' sizes='0.1ms'>
+<img srcset='/images/green-1x1.png?f13 50w, /images/green-16x16.png?f13 51w' sizes='0.1Hz'>
+<img srcset='/images/green-1x1.png?f14 50w, /images/green-16x16.png?f14 51w' sizes='0.1kHz'>
+<img srcset='/images/green-1x1.png?f15 50w, /images/green-16x16.png?f15 51w' sizes='0.1dpi'>
+<img srcset='/images/green-1x1.png?f16 50w, /images/green-16x16.png?f16 51w' sizes='0.1dpcm'>
+<img srcset='/images/green-1x1.png?f17 50w, /images/green-16x16.png?f17 51w' sizes='0.1dppx'>
+<img srcset='/images/green-1x1.png?f18 50w, /images/green-16x16.png?f18 51w' data-foo='1px' sizes='attr(data-foo, length, 1px)'>
+<img srcset='/images/green-1x1.png?f19 50w, /images/green-16x16.png?f19 51w' data-foo='1' sizes='attr(data-foo, px, 1px)'>
+<img srcset='/images/green-1x1.png?f20 50w, /images/green-16x16.png?f20 51w' sizes='toggle(1px)'>
+<img srcset='/images/green-1x1.png?f21 50w, /images/green-16x16.png?f21 51w' sizes='inherit'>
+<img srcset='/images/green-1x1.png?f22 50w, /images/green-16x16.png?f22 51w' sizes='auto'>
+<img srcset='/images/green-1x1.png?f23 50w, /images/green-16x16.png?f23 51w' sizes='initial'>
+<img srcset='/images/green-1x1.png?f24 50w, /images/green-16x16.png?f24 51w' sizes='unset'>
+<img srcset='/images/green-1x1.png?f25 50w, /images/green-16x16.png?f25 51w' sizes='default'>
+<img srcset='/images/green-1x1.png?f26 50w, /images/green-16x16.png?f26 51w' sizes='1/* */px'>
+<img srcset='/images/green-1x1.png?f27 50w, /images/green-16x16.png?f27 51w' sizes='1p/* */x'>
+<img srcset='/images/green-1x1.png?f28 50w, /images/green-16x16.png?f28 51w' sizes='-/**/0'>
+<img srcset='/images/green-1x1.png?f29 50w, /images/green-16x16.png?f29 51w' sizes='((),1px'>
+<img srcset='/images/green-1x1.png?f30 50w, /images/green-16x16.png?f30 51w' sizes='x(x(),1px'>
+<img srcset='/images/green-1x1.png?f31 50w, /images/green-16x16.png?f31 51w' sizes='{{},1px'>
+<img srcset='/images/green-1x1.png?f32 50w, /images/green-16x16.png?f32 51w' sizes='[[],1px'>
+<img srcset='/images/green-1x1.png?f33 50w, /images/green-16x16.png?f33 51w' sizes='1px !important'>
+<img srcset='/images/green-1x1.png?f34 50w, /images/green-16x16.png?f34 51w' sizes='\1px'>
+<img srcset='/images/green-1x1.png?f35 50w, /images/green-16x16.png?f35 51w' sizes='all 1px'>
+<img srcset='/images/green-1x1.png?f36 50w, /images/green-16x16.png?f36 51w' sizes='all and (min-width:0) 1px'>
+<img srcset='/images/green-1x1.png?f37 50w, /images/green-16x16.png?f37 51w' sizes='min-width:0 1px'>
+<img srcset='/images/green-1x1.png?f38 50w, /images/green-16x16.png?f38 51w' sizes='100vw, 1px'>
+<img srcset='/images/green-1x1.png?f39 50w, /images/green-16x16.png?f39 51w' sizes='100vw, (min-width:0) 1px'>
+<img srcset='/images/green-1x1.png?f40 50w, /images/green-16x16.png?f40 51w' sizes='foo bar'>
+<img srcset='/images/green-1x1.png?f41 50w, /images/green-16x16.png?f41 51w' sizes='foo-bar'>
+<img srcset='/images/green-1x1.png?f42 50w, /images/green-16x16.png?f42 51w' sizes='(min-width:0) 1px foo bar'>
+<img srcset='/images/green-1x1.png?f43 50w, /images/green-16x16.png?f43 51w' sizes='(min-width:0) 0.1%'>
+<img srcset='/images/green-1x1.png?f44 50w, /images/green-16x16.png?f44 51w' sizes='(min-width:0) 1'>
+<img srcset='/images/green-1x1.png?f45 50w, /images/green-16x16.png?f45 51w' sizes='-1e0px'>
+<img srcset='/images/green-1x1.png?f46 50w, /images/green-16x16.png?f46 51w' sizes='1e1.5px'>
+<img srcset='/images/green-1x1.png?f47 50w, /images/green-16x16.png?f47 51w' style='--foo: 1px' sizes='var(--foo)'>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/common.js b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/common.js
new file mode 100644
index 000000000..d4d2c7534
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/common.js
@@ -0,0 +1,25 @@
+setup({explicit_done:true});
+
+function check(img) {
+ var name = format_value(img.getAttribute('srcset'));
+ if (img.hasAttribute('sizes')) {
+ name += ' sizes=' + format_value(img.getAttribute('sizes'));
+ }
+ if (img.hasAttribute('data-desc')) {
+ name += ' (' + img.getAttribute('data-desc') + ')';
+ }
+ test(function() {
+ var expect = img.dataset.expect;
+ if ('resolve' in img.dataset) {
+ var a = document.createElement('a');
+ a.href = expect;
+ expect = a.href;
+ }
+ assert_equals(img.currentSrc, expect);
+ }, name);
+}
+
+onload = function() {
+ [].forEach.call(document.images, check);
+ done();
+};
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html
new file mode 100644
index 000000000..ce1e4cebe
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html
@@ -0,0 +1,245 @@
+<!doctype html>
+<title>img parse a srcset attribute</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src=common.js></script>
+<div id=log></div>
+<!-- splitting loop -->
+<img srcset='' data-expect=''>
+<img srcset=',' data-expect=''>
+<img srcset=',,,' data-expect=''>
+<img srcset=' data:,a 1x ' data-expect='data:,a'>
+<img srcset='&#x9;&#x9;data:,a&#x9;&#x9;1x&#x9;&#x9;' data-expect='data:,a'>
+<img srcset='&#xA;&#xA;data:,a&#xA;&#xA;1x&#xA;&#xA;' data-expect='data:,a'>
+<img srcset='&#xB;&#xB;data:,a&#xB;&#xB;1x&#xB;&#xB;' data-expect='&#xB;&#xB;data:,a&#xB;&#xB;1x&#xB;&#xB;' data-resolve>
+<img srcset='&#xC;&#xC;data:,a&#xC;&#xC;1x&#xC;&#xC;' data-expect='data:,a'>
+<img srcset='&#xD;&#xD;data:,a&#xD;&#xD;1x&#xD;&#xD;' data-expect='data:,a'>
+<img srcset='&#xE;&#xE;data:,a&#xE;&#xE;1x&#xE;&#xE;' data-expect='&#xE;&#xE;data:,a&#xE;&#xE;1x&#xE;&#xE;' data-resolve>
+<img srcset='&#xF;&#xF;data:,a&#xF;&#xF;1x&#xF;&#xF;' data-expect='&#xF;&#xF;data:,a&#xF;&#xF;1x&#xF;&#xF;' data-resolve>
+<img srcset='&#x10;&#x10;data:,a&#x10;&#x10;1x&#x10;&#x10;' data-expect='&#x10;&#x10;data:,a&#x10;&#x10;1x&#x10;&#x10;' data-resolve>
+<img srcset='data:,a' data-expect='data:,a'>
+<img srcset='data:,a ' data-expect='data:,a'>
+<img srcset='data:,a ,' data-expect='data:,a'>
+<img srcset='data:,a,' data-expect='data:,a'>
+<img srcset='data:,a, ' data-expect='data:,a'>
+<img srcset='data:,a,,,' data-expect='data:,a'>
+<img srcset='data:,a,, , ' data-expect='data:,a'>
+<img srcset=' data:,a' data-expect='data:,a'>
+<img srcset=',,,data:,a' data-expect='data:,a'>
+<img srcset=' , ,,data:,a' data-expect='data:,a'>
+<img srcset='&nbsp;data:,a' data-expect='&nbsp;data:,a' data-resolve>
+<img srcset='data:,a&nbsp;' data-expect='data:,a&nbsp;' data-resolve>
+<!-- descriptor tokenizer -->
+<img srcset='data:,a 1x' data-expect='data:,a'>
+<img srcset='data:,a 1x ' data-expect='data:,a'>
+<img srcset='data:,a 1x,' data-expect='data:,a'>
+<img srcset='data:,a ( , data:,b 1x, ), data:,c' data-expect='data:,c'>
+<img srcset='data:,a ((( , data:,b 1x, ), data:,c' data-expect='data:,c'>
+<img srcset='data:,a [ , data:,b 1x, ], data:,c' data-expect='data:,b'>
+<img srcset='data:,a { , data:,b 1x, }, data:,c' data-expect='data:,b'>
+<img srcset='data:,a " , data:,b 1x, ", data:,c' data-expect='data:,b'>
+<img srcset='data:,a \,data:;\,b, data:,c' data-expect='data:;\,b'>
+<img srcset='data:,a, data:,b (' data-expect='data:,a'>
+<img srcset='data:,a, data:,b ( ' data-expect='data:,a'>
+<img srcset='data:,a, data:,b (,' data-expect='data:,a'>
+<img srcset='data:,a, data:,b (x' data-expect='data:,a'>
+<img srcset='data:,a, data:,b ()' data-expect='data:,a'>
+<img srcset='data:,a (, data:,b' data-expect=''>
+<img srcset='data:,a /*, data:,b, data:,c */' data-expect='data:,b'>
+<img srcset='data:,a //, data:,b' data-expect='data:,b'>
+<!-- descriptor parser -->
+<img srcset='data:,a foo' data-expect=''>
+<img srcset='data:,a foo foo' data-expect=''>
+<img srcset='data:,a foo 1x' data-expect=''>
+<img srcset='data:,a foo 1x foo' data-expect=''>
+<img srcset='data:,a foo 1w' data-expect=''>
+<img srcset='data:,a foo 1w foo' data-expect=''>
+<img srcset='data:,a 1x 1x' data-expect=''>
+<img srcset='data:,a 1w 1w' data-expect=''>
+<img srcset='data:,a 1w 1x' data-expect=''>
+<img srcset='data:,a 1x 1w' data-expect=''>
+<img srcset='data:,a 1w 1h' data-expect='data:,a'><!-- should fail for x-only impl -->
+<img srcset='data:,a 1h 1w' data-expect='data:,a'><!-- should fail for x-only impl -->
+<img srcset='data:,a 1h 1h' data-expect=''>
+<img srcset='data:,a 1h 1x' data-expect=''>
+<img srcset='data:,a 1h 1w 1x' data-expect=''>
+<img srcset='data:,a 1x 1w 1h' data-expect=''>
+<img srcset='data:,a 1w' data-expect='data:,a'><!-- should fail for x-only impl -->
+<img srcset='data:,a 1h' data-expect=''>
+<img srcset='data:,a 1h foo' data-expect=''>
+<img srcset='data:,a foo 1h' data-expect=''>
+<img srcset='data:,a 0w' data-expect=''>
+<img srcset='data:,a -1w' data-expect=''>
+<img srcset='data:,a 1w -1w' data-expect=''>
+<img srcset='data:,a 1.0w' data-expect=''>
+<img srcset='data:,a 1w 1.0w' data-expect=''>
+<img srcset='data:,a 1e0w' data-expect=''>
+<img srcset='data:,a 1w 1e0w' data-expect=''>
+<img srcset='data:,a 1www' data-expect=''>
+<img srcset='data:,a 1w 1www' data-expect=''>
+<img srcset='data:,a +1w' data-expect=''>
+<img srcset='data:,a 1w +1w' data-expect=''>
+<img srcset='data:,a 1W' data-expect=''>
+<img srcset='data:,a 1w 1W' data-expect=''>
+<img srcset='data:,a Infinityw' data-expect=''>
+<img srcset='data:,a 1w Infinityw' data-expect=''>
+<img srcset='data:,a NaNw' data-expect=''>
+<img srcset='data:,a 1w NaNw' data-expect=''>
+<img srcset='data:,a 0x1w' data-expect=''>
+<img srcset='data:,a 0X1w' data-expect=''>
+<img srcset='data:,a 1&#x1;w' data-expect='' data-desc='trailing U+0001'>
+<img srcset='data:,a 1&nbsp;w' data-expect='' data-desc='trailing U+00A0'>
+<img srcset='data:,a 1&#x1680;w' data-expect='' data-desc='trailing U+1680'>
+<img srcset='data:,a 1&#x2000;w' data-expect='' data-desc='trailing U+2000'>
+<img srcset='data:,a 1&#x2001;w' data-expect='' data-desc='trailing U+2001'>
+<img srcset='data:,a 1&#x2002;w' data-expect='' data-desc='trailing U+2002'>
+<img srcset='data:,a 1&#x2003;w' data-expect='' data-desc='trailing U+2003'>
+<img srcset='data:,a 1&#x2004;w' data-expect='' data-desc='trailing U+2004'>
+<img srcset='data:,a 1&#x2005;w' data-expect='' data-desc='trailing U+2005'>
+<img srcset='data:,a 1&#x2006;w' data-expect='' data-desc='trailing U+2006'>
+<img srcset='data:,a 1&#x2007;w' data-expect='' data-desc='trailing U+2007'>
+<img srcset='data:,a 1&#x2008;w' data-expect='' data-desc='trailing U+2008'>
+<img srcset='data:,a 1&#x2009;w' data-expect='' data-desc='trailing U+2009'>
+<img srcset='data:,a 1&#x200A;w' data-expect='' data-desc='trailing U+200A'>
+<img srcset='data:,a 1&#x200C;w' data-expect='' data-desc='trailing U+200C'>
+<img srcset='data:,a 1&#x200D;w' data-expect='' data-desc='trailing U+200D'>
+<img srcset='data:,a 1&#x202F;w' data-expect='' data-desc='trailing U+202F'>
+<img srcset='data:,a 1&#x205F;w' data-expect='' data-desc='trailing U+205F'>
+<img srcset='data:,a 1&#x3000;w' data-expect='' data-desc='trailing U+3000'>
+<img srcset='data:,a 1&#xFEFF;w' data-expect='' data-desc='trailing U+FEFF'>
+<img srcset='data:,a &#x1;1w' data-expect='' data-desc='leading U+0001'>
+<img srcset='data:,a &nbsp;1w' data-expect='' data-desc='leading U+00A0'>
+<img srcset='data:,a &#x1680;1w' data-expect='' data-desc='leading U+1680'>
+<img srcset='data:,a &#x2000;1w' data-expect='' data-desc='leading U+2000'>
+<img srcset='data:,a &#x2001;1w' data-expect='' data-desc='leading U+2001'>
+<img srcset='data:,a &#x2002;1w' data-expect='' data-desc='leading U+2002'>
+<img srcset='data:,a &#x2003;1w' data-expect='' data-desc='leading U+2003'>
+<img srcset='data:,a &#x2004;1w' data-expect='' data-desc='leading U+2004'>
+<img srcset='data:,a &#x2005;1w' data-expect='' data-desc='leading U+2005'>
+<img srcset='data:,a &#x2006;1w' data-expect='' data-desc='leading U+2006'>
+<img srcset='data:,a &#x2007;1w' data-expect='' data-desc='leading U+2007'>
+<img srcset='data:,a &#x2008;1w' data-expect='' data-desc='leading U+2008'>
+<img srcset='data:,a &#x2009;1w' data-expect='' data-desc='leading U+2009'>
+<img srcset='data:,a &#x200A;1w' data-expect='' data-desc='leading U+200A'>
+<img srcset='data:,a &#x200C;1w' data-expect='' data-desc='leading U+200C'>
+<img srcset='data:,a &#x200D;1w' data-expect='' data-desc='leading U+200D'>
+<img srcset='data:,a &#x202F;1w' data-expect='' data-desc='leading U+202F'>
+<img srcset='data:,a &#x205F;1w' data-expect='' data-desc='leading U+205F'>
+<img srcset='data:,a &#x3000;1w' data-expect='' data-desc='leading U+3000'>
+<img srcset='data:,a &#xFEFF;1w' data-expect='' data-desc='leading U+FEFF'>
+<img srcset='data:,a 0x' data-expect='data:,a'>
+<img srcset='data:,a -0x' data-expect='data:,a'>
+<img srcset='data:,a 1x -0x' data-expect=''>
+<img srcset='data:,a -1x' data-expect=''>
+<img srcset='data:,a 1x -1x' data-expect=''>
+<img srcset='data:,a 1e0x' data-expect='data:,a'>
+<img srcset='data:,a 1E0x' data-expect='data:,a'>
+<img srcset='data:,a 1e-1x' data-expect='data:,a'>
+<img srcset='data:,a 1.5e1x' data-expect='data:,a'>
+<img srcset='data:,a -x' data-expect=''>
+<img srcset='data:,a .x' data-expect=''>
+<img srcset='data:,a -.x' data-expect=''>
+<img srcset='data:,a 1.x' data-expect=''>
+<img srcset='data:,a .5x' data-expect='data:,a'>
+<img srcset='data:,a .5e1x' data-expect='data:,a'>
+<img srcset='data:,a 1x 1.5e1x' data-expect=''>
+<img srcset='data:,a 1x 1e1.5x' data-expect=''>
+<img srcset='data:,a 1.0x' data-expect='data:,a'>
+<img srcset='data:,a 1x 1.0x' data-expect=''>
+<img srcset='data:,a +1x' data-expect=''>
+<img srcset='data:,a 1X' data-expect=''>
+<img srcset='data:,a Infinityx' data-expect=''>
+<img srcset='data:,a NaNx' data-expect=''>
+<img srcset='data:,a 0x1x' data-expect=''>
+<img srcset='data:,a 0X1x' data-expect=''>
+<img srcset='data:,a 1&#x1;x' data-expect='' data-desc='trailing U+0001'>
+<img srcset='data:,a 1&nbsp;x' data-expect='' data-desc='trailing U+00A0'>
+<img srcset='data:,a 1&#x1680;x' data-expect='' data-desc='trailing U+1680'>
+<img srcset='data:,a 1&#x2000;x' data-expect='' data-desc='trailing U+2000'>
+<img srcset='data:,a 1&#x2001;x' data-expect='' data-desc='trailing U+2001'>
+<img srcset='data:,a 1&#x2002;x' data-expect='' data-desc='trailing U+2002'>
+<img srcset='data:,a 1&#x2003;x' data-expect='' data-desc='trailing U+2003'>
+<img srcset='data:,a 1&#x2004;x' data-expect='' data-desc='trailing U+2004'>
+<img srcset='data:,a 1&#x2005;x' data-expect='' data-desc='trailing U+2005'>
+<img srcset='data:,a 1&#x2006;x' data-expect='' data-desc='trailing U+2006'>
+<img srcset='data:,a 1&#x2007;x' data-expect='' data-desc='trailing U+2007'>
+<img srcset='data:,a 1&#x2008;x' data-expect='' data-desc='trailing U+2008'>
+<img srcset='data:,a 1&#x2009;x' data-expect='' data-desc='trailing U+2009'>
+<img srcset='data:,a 1&#x200A;x' data-expect='' data-desc='trailing U+200A'>
+<img srcset='data:,a 1&#x200C;x' data-expect='' data-desc='trailing U+200C'>
+<img srcset='data:,a 1&#x200D;x' data-expect='' data-desc='trailing U+200D'>
+<img srcset='data:,a 1&#x202F;x' data-expect='' data-desc='trailing U+202F'>
+<img srcset='data:,a 1&#x205F;x' data-expect='' data-desc='trailing U+205F'>
+<img srcset='data:,a 1&#x3000;x' data-expect='' data-desc='trailing U+3000'>
+<img srcset='data:,a 1&#xFEFF;x' data-expect='' data-desc='trailing U+FEFF'>
+<img srcset='data:,a &#x1;1x' data-expect='' data-desc='leading U+0001'>
+<img srcset='data:,a &nbsp;1x' data-expect='' data-desc='leading U+00A0'>
+<img srcset='data:,a &#x1680;1x' data-expect='' data-desc='leading U+1680'>
+<img srcset='data:,a &#x2000;1x' data-expect='' data-desc='leading U+2000'>
+<img srcset='data:,a &#x2001;1x' data-expect='' data-desc='leading U+2001'>
+<img srcset='data:,a &#x2002;1x' data-expect='' data-desc='leading U+2002'>
+<img srcset='data:,a &#x2003;1x' data-expect='' data-desc='leading U+2003'>
+<img srcset='data:,a &#x2004;1x' data-expect='' data-desc='leading U+2004'>
+<img srcset='data:,a &#x2005;1x' data-expect='' data-desc='leading U+2005'>
+<img srcset='data:,a &#x2006;1x' data-expect='' data-desc='leading U+2006'>
+<img srcset='data:,a &#x2007;1x' data-expect='' data-desc='leading U+2007'>
+<img srcset='data:,a &#x2008;1x' data-expect='' data-desc='leading U+2008'>
+<img srcset='data:,a &#x2009;1x' data-expect='' data-desc='leading U+2009'>
+<img srcset='data:,a &#x200A;1x' data-expect='' data-desc='leading U+200A'>
+<img srcset='data:,a &#x200C;1x' data-expect='' data-desc='leading U+200C'>
+<img srcset='data:,a &#x200D;1x' data-expect='' data-desc='leading U+200D'>
+<img srcset='data:,a &#x202F;1x' data-expect='' data-desc='leading U+202F'>
+<img srcset='data:,a &#x205F;1x' data-expect='' data-desc='leading U+205F'>
+<img srcset='data:,a &#x3000;1x' data-expect='' data-desc='leading U+3000'>
+<img srcset='data:,a &#xFEFF;1x' data-expect='' data-desc='leading U+FEFF'>
+<img srcset='data:,a 1w 0h' data-expect=''>
+<img srcset='data:,a 1w -1h' data-expect=''>
+<img srcset='data:,a 1w 1.0h' data-expect=''>
+<img srcset='data:,a 1w 1e0h' data-expect=''>
+<img srcset='data:,a 1w 1hhh' data-expect=''>
+<img srcset='data:,a 1w +1h' data-expect=''>
+<img srcset='data:,a 1w 1H' data-expect=''>
+<img srcset='data:,a 1w Infinityh' data-expect=''>
+<img srcset='data:,a 1w NaNh' data-expect=''>
+<img srcset='data:,a 0x1h' data-expect=''>
+<img srcset='data:,a 0X1h' data-expect=''>
+<img srcset='data:,a 1w 1&#x1;h' data-expect='' data-desc='trailing U+0001'>
+<img srcset='data:,a 1w 1&nbsp;h' data-expect='' data-desc='trailing U+00A0'>
+<img srcset='data:,a 1w 1&#x1680;h' data-expect='' data-desc='trailing U+1680'>
+<img srcset='data:,a 1w 1&#x2000;h' data-expect='' data-desc='trailing U+2000'>
+<img srcset='data:,a 1w 1&#x2001;h' data-expect='' data-desc='trailing U+2001'>
+<img srcset='data:,a 1w 1&#x2002;h' data-expect='' data-desc='trailing U+2002'>
+<img srcset='data:,a 1w 1&#x2003;h' data-expect='' data-desc='trailing U+2003'>
+<img srcset='data:,a 1w 1&#x2004;h' data-expect='' data-desc='trailing U+2004'>
+<img srcset='data:,a 1w 1&#x2005;h' data-expect='' data-desc='trailing U+2005'>
+<img srcset='data:,a 1w 1&#x2006;h' data-expect='' data-desc='trailing U+2006'>
+<img srcset='data:,a 1w 1&#x2007;h' data-expect='' data-desc='trailing U+2007'>
+<img srcset='data:,a 1w 1&#x2008;h' data-expect='' data-desc='trailing U+2008'>
+<img srcset='data:,a 1w 1&#x2009;h' data-expect='' data-desc='trailing U+2009'>
+<img srcset='data:,a 1w 1&#x200A;h' data-expect='' data-desc='trailing U+200A'>
+<img srcset='data:,a 1w 1&#x200C;h' data-expect='' data-desc='trailing U+200C'>
+<img srcset='data:,a 1w 1&#x200D;h' data-expect='' data-desc='trailing U+200D'>
+<img srcset='data:,a 1w 1&#x202F;h' data-expect='' data-desc='trailing U+202F'>
+<img srcset='data:,a 1w 1&#x205F;h' data-expect='' data-desc='trailing U+205F'>
+<img srcset='data:,a 1w 1&#x3000;h' data-expect='' data-desc='trailing U+3000'>
+<img srcset='data:,a 1w 1&#xFEFF;h' data-expect='' data-desc='trailing U+FEFF'>
+<img srcset='data:,a 1w &#x1;1h' data-expect='' data-desc='leading U+0001'>
+<img srcset='data:,a 1w &nbsp;1h' data-expect='' data-desc='leading U+00A0'>
+<img srcset='data:,a 1w &#x1680;1h' data-expect='' data-desc='leading U+1680'>
+<img srcset='data:,a 1w &#x2000;1h' data-expect='' data-desc='leading U+2000'>
+<img srcset='data:,a 1w &#x2001;1h' data-expect='' data-desc='leading U+2001'>
+<img srcset='data:,a 1w &#x2002;1h' data-expect='' data-desc='leading U+2002'>
+<img srcset='data:,a 1w &#x2003;1h' data-expect='' data-desc='leading U+2003'>
+<img srcset='data:,a 1w &#x2004;1h' data-expect='' data-desc='leading U+2004'>
+<img srcset='data:,a 1w &#x2005;1h' data-expect='' data-desc='leading U+2005'>
+<img srcset='data:,a 1w &#x2006;1h' data-expect='' data-desc='leading U+2006'>
+<img srcset='data:,a 1w &#x2007;1h' data-expect='' data-desc='leading U+2007'>
+<img srcset='data:,a 1w &#x2008;1h' data-expect='' data-desc='leading U+2008'>
+<img srcset='data:,a 1w &#x2009;1h' data-expect='' data-desc='leading U+2009'>
+<img srcset='data:,a 1w &#x200A;1h' data-expect='' data-desc='leading U+200A'>
+<img srcset='data:,a 1w &#x200C;1h' data-expect='' data-desc='leading U+200C'>
+<img srcset='data:,a 1w &#x200D;1h' data-expect='' data-desc='leading U+200D'>
+<img srcset='data:,a 1w &#x202F;1h' data-expect='' data-desc='leading U+202F'>
+<img srcset='data:,a 1w &#x205F;1h' data-expect='' data-desc='leading U+205F'>
+<img srcset='data:,a 1w &#x3000;1h' data-expect='' data-desc='leading U+3000'>
+<img srcset='data:,a 1w &#xFEFF;1h' data-expect='' data-desc='leading U+FEFF'>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source.html
new file mode 100644
index 000000000..292395d3a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>img select an image source</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src=common.js></script>
+<div id=log></div>
+<!-- dup entries -->
+<img srcset='data:,a 1x, data:,b 1x' data-expect='data:,a'>
+<img srcset='data:,a , data:,b 1x' data-expect='data:,a'>
+<img srcset='data:,a 1x, data:,b' data-expect='data:,a'>
+<img srcset='data:,a 1w, data:,b 1w' data-expect='data:,a'>
+<img srcset='data:,a 1w 1h, data:,b 1w' data-expect='data:,a'>
+<img srcset='data:,a 1w, data:,b 1w 1h' data-expect='data:,a'>
+<img srcset='data:,a 1w 1h, data:,b 1w 2h' data-expect='data:,a'>
+<img srcset='data:,a 1w 2h, data:,b 1w 1h' data-expect='data:,a'>
+<img srcset='data:,a , data:,b' data-expect='data:,a'>
+<img srcset='data:,a 1w, data:,b 1x' sizes='1px' data-expect='data:,a'>
+<img srcset='data:,a 1x, data:,b 1w' sizes='1px' data-expect='data:,a'>
+<img srcset='data:,a 1w, data:,b 2x' sizes='0.5px' data-expect='data:,a'>
+<img srcset='data:,a 2x, data:,b 1w' sizes='0.5px' data-expect='data:,a'>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-media.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-media.html
new file mode 100644
index 000000000..dd679ef57
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-media.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>img update media</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+ var t = async_test('set media after src updates selected image');
+
+ var img;
+
+ onload = t.step_func(function() {
+ img = document.querySelector('img');
+ img.addEventListener('load', t.step_func_done(onImgLoad));
+
+ var source = document.querySelector('source[data-media]');
+ source.setAttribute('media', source.getAttribute('data-media'));
+ });
+
+ function onImgLoad() {
+ img.removeEventListener('load', onImgLoad);
+
+ assert_true(img.currentSrc.indexOf(img.getAttribute('data-expect')) > -1);
+ }
+
+</script>
+
+<div id="log"></div>
+<picture>
+ <source srcset="/images/fail.gif" data-media="(max-width: 1px)" />
+ <source srcset="/images/smiley.png" />
+ <img data-expect="/images/smiley.png">
+</picture> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-src-complete.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-src-complete.html
new file mode 100644
index 000000000..20cb95915
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-src-complete.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Changing the img src should retain the 'complete' property</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<p id="display"><img src="image.png"></p>
+<script>
+ function check() {
+ var img = document.querySelector("img");
+ assert_true(img.complete, "By onload, image should have loaded");
+ img.src = `image.png?${Math.random()}`;
+ assert_false(img.complete, "Now that we're loading we should no longer be complete");
+ img.onload = function () {
+ assert_true(img.complete, "The new thing should have loaded.");
+ done();
+ }
+ }
+
+ onload = function () {
+ check();
+ };
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-the-image-data/fail-to-resolve.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-the-image-data/fail-to-resolve.html
new file mode 100644
index 000000000..959ceaa97
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-the-image-data/fail-to-resolve.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>img update the image data: fail to resolve URL</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+
+<img src="//[">
+<img srcset="//[">
+<img srcset="//[" src="/images/red.png">
+<img srcset="//[, /images/red.png">
+
+<script>
+setup({explicit_done: true});
+
+var expected = '//[';
+
+onload = function() {
+ [].forEach.call(document.images, function(img) {
+ test(function() {
+ assert_equals(img.currentSrc, expected);
+ }, img.outerHTML);
+ });
+ done();
+};
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-the-source-set.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-the-source-set.html
new file mode 100644
index 000000000..063667baa
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/update-the-source-set.html
@@ -0,0 +1,140 @@
+<!doctype html>
+<title>img update the source set</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+setup({explicit_done:true});
+
+function check(p) {
+ var img = p.querySelector('[data-expect]');
+ test(function() {
+ var expect = img.dataset.expect;
+ if ('resolve' in img.dataset) {
+ var a = document.createElement('a');
+ a.href = expect;
+ expect = a.href;
+ }
+ assert_equals(img.currentSrc, expect);
+ }, p.innerHTML);
+}
+
+onload = function() {
+ [].forEach.call(document.querySelectorAll('div:not([id])'), check);
+ done();
+};
+
+</script>
+<div id=log></div>
+<div><img data-expect=''></div>
+<div><img src data-expect=''></div>
+<div><img src='data:,a' data-expect='data:,a'></div>
+<div><img srcset src='data:,a' data-expect='data:,a'></div>
+<div><img srcset='data:,b' src='data:,a' data-expect='data:,b'></div>
+<div><img src='data:,a' srcset='data:,b' data-expect='data:,b'><!-- srcset after src --></div>
+<div><img src='data:,a' srcset='data:,b 1x' data-expect='data:,b'></div>
+<div><img src='data:,a' srcset='data:,b 1.0x' data-expect='data:,b'></div>
+<div><img src='data:,a' srcset='data:,b 1e0x' data-expect='data:,b'></div>
+<div><img src='data:,a' srcset='data:,b 10000w' sizes='1px' data-expect='data:,b'></div>
+<div><img src='data:,a' srcset='data:,b 10000w, data:,c 10000x' sizes='1px' data-expect='data:,b'></div>
+<div><img src='data:,a' srcset='data:,b 10000x, data:,c 10000w' sizes='1px' data-expect='data:,b'></div>
+<div><img src='data:,a' srcset='data:,b 1w' sizes='10000px' data-expect='data:,b'></div>
+<div><img src='data:,a' srcset='data:,b 1w, data:,c 0.0001x' sizes='10000px' data-expect='data:,b'></div>
+<div><img src='data:,a' srcset='data:,b 0.0001x, data:,c 1w' sizes='10000px' data-expect='data:,b'></div>
+<div><img srcset='data:,a' data-expect='data:,a'></div>
+
+<!-- child is not a <source> -->
+
+<div><picture>foo<img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><!--foo--><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><br><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><p></p><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><video><source srcset='data:,b'></video><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><span><source srcset='data:,b'></span><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><svg><source srcset='data:,b'/></svg><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><svg/><source srcset='data:,b'/><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><svg><font/><source srcset='data:,b'/></svg><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><svg><!--<font face> tag breaks out of svg--><font face></font><source srcset='data:,b'/></svg><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><img src='data:,a'><img src='data:,b' data-expect='data:,b'></picture></div>
+
+<!-- <source> has no srcset -->
+
+<div><picture><source><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source src='data:,b'><img src='data:,a' data-expect='data:,a'></picture></div>
+
+<!-- <source srcset> has zero candidates -->
+
+<div><picture><source srcset><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset=', ,'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b 1x 1x'><img src='data:,a' data-expect='data:,a'></picture></div>
+
+<!-- <source media> -->
+
+<div><picture><source srcset='data:,b' media><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' media='all'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' media='all and (min-width:0)'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' media='all and !'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' media='all and (!)'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' media='not all'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' media='not all and (min-width:0)'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' media='not all and (max-width:0)'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' media='not all and !'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' media='not all and (!)'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' media='all, !'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' media=','><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' media=', all'><img src='data:,a' data-expect='data:,b'></picture></div>
+
+<!-- <source type> assume support for gif, png, jpg, svg, ico -->
+
+<div><picture><source srcset='data:,b' type><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type=' '><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type='image/gif'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type=' image/gif'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type='image/gif '><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type='image/gif;'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type='image/gif;encodings'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type='image/gif;encodings='><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type='image/gif;encodings=foobar'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type='image/png'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type='image/jpeg'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type='image/svg+xml'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type='image/x-icon'><img src='data:,a' data-expect='data:,b'></picture></div>
+<div><picture><source srcset='data:,b' type='text/xml'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='text/html'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='text/plain'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='text/css'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='video/mp4'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='video/ogg'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='video/webm'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='unknown/unknown'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='application/octet-stream'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='application/x-shockwave-flash'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='image\gif'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='gif'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='.gif'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='*'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='*/*'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='image/*'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type=','><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='image/gif, image/png'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='image/gif image/png'><img src='data:,a' data-expect='data:,a'></picture></div>
+<div><picture><source srcset='data:,b' type='image/foobarbaz'><img src='data:,a' data-expect='data:,a'></picture></div>
+
+<!-- trailing garbage -->
+
+<div><picture><img src='data:,a' data-expect='data:,a'>foo</picture></div>
+<div><picture><img src='data:,a' data-expect='data:,a'><br></picture></div>
+<div><picture><img src='data:,a' data-expect='data:,a'><!--foo--></picture></div>
+<div><picture><img src='data:,a' data-expect='data:,a'><img src='data:,b'></picture></div>
+<div><picture><img data-expect=''><img src='data:,b'></picture></div>
+<div><picture><img src='data:,a' data-expect='data:,a'><source srcset='data:,b'></picture></div>
+<div><picture><img data-expect=''><source srcset='data:,b'></picture></div>
+
+<!-- parent not picture -->
+
+<div><picture><span><source srcset='data:,b'><img data-expect=''></span></picture></div>
+<div><picture><span><source srcset='data:,b'><img src='data:,a' data-expect='data:,a'></span></picture></div>
+<div><picture><source srcset='data:,b'><span><img src='data:,a' data-expect='data:,a'></span></picture></div>
+
+<!-- no src -->
+
+<div><picture><source srcset='data:,b'><img data-expect='data:,b'></picture></div>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-map-element/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/the-map-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-map-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-attributes.html b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-attributes.html
new file mode 100644
index 000000000..30fdcf520
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-attributes.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: object - attributes</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body onload="on_load()">
+<div id="log"></div>
+<form>
+ <object id="obj1" data="blue.html" name="o" height="50" width="100"></object>
+ <object id="obj2" name="p" type="image/png"></object>
+</form>
+<script>
+ var obj1;
+ var obj2;
+ var t1 = async_test("object.contentWindow");
+ var t3 = async_test("object.width");
+ var t4 = async_test("object.height");
+
+ setup(function() {
+ obj1 = document.getElementById("obj1");
+ obj2 = document.getElementById("obj2");
+ });
+
+ function on_load () {
+ t1.step(function() {
+ assert_equals(obj1.contentWindow.name, "o", "The contentWindow's name of the object element should be 'o'.");
+ assert_equals(obj2.contentWindow, null, "The contentWindow of the object element should be null when it type attribute starts with 'image/'.");
+ obj1.setAttribute("name", "o1");
+ assert_equals(obj1.name, "o1", "The name of the object element should be 'o1'.");
+ assert_equals(obj1.contentWindow.name, "o1", "The contentWindow's name of the object element should be 'o1'.");
+ obj1.removeAttribute("name");
+ assert_equals(obj1.name, "", "The name of the object element should be empty string.");
+ assert_equals(obj1.contentWindow.name, "", "The contentWindow's name of the object element should be empty string.");
+ });
+ t1.done()
+
+ t3.step(function() {
+ assert_equals(getComputedStyle(obj1, null)["width"], "100px", "The width should be 100px.");
+ });
+ t3.done();
+
+ t4.step(function() {
+ assert_equals(getComputedStyle(obj1, null)["height"], "50px", "The height should be 50px.");
+ });
+ t4.done();
+ }
+</script>
+
+</body>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-events.html b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-events.html
new file mode 100644
index 000000000..9cd567173
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-events.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: object-events</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+
+async_test(function(t) {
+ var obj = document.createElement("object");
+ obj.onerror = t.step_func_done(function(e){
+ assert_equals(Object.getPrototypeOf(e).constructor, Event, "The error event should use the Event interface.");
+ assert_true(e.isTrusted, "The error event should be a trusted event.");
+ assert_false(e.cancelable, "The error event should not be a cancelable event.");
+ assert_false(e.bubbles, "The error event should not be a bubble event.");
+ assert_equals(e.target, obj, "The error event target should be the corresponding object element.");
+ });
+
+ obj.onload = t.step_func_done(function(e){
+ assert_unreached("The load event should not be fired.");
+ });
+
+ obj.data = "file:\\http://nonexistent.html";
+ document.body.appendChild(obj);
+}, "error event");
+
+async_test(function(t) {
+ var obj = document.createElement("object");
+ obj.onerror = t.step_func_done(function(e){
+ assert_equals(e.target, obj,
+ "The error event should be fired on our element");
+ });
+ obj.onload = t.step_func_done(function(e){
+ assert_unreached("The load event should not be fired.");
+ });
+
+ obj.data = "http://test:test";
+ document.body.appendChild(obj);
+}, "error event");
+
+
+async_test(function(t) {
+ var obj = document.createElement("object");
+ obj.onload = t.step_func_done(function(e){
+ 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.");
+ });
+
+ obj.data = "/images/blue.png";
+ document.body.appendChild(obj);
+}, "load event");
+
+async_test(function(t) {
+ var obj = document.createElement("object");
+ 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.");
+ });
+
+ obj.data = "about:blank";
+ document.body.appendChild(obj);
+}, "load event of about:blank");
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-fallback.html b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-fallback.html
new file mode 100644
index 000000000..d5469a3ed
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-fallback.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: display fallback content</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+
+var t1 = async_test("the typemustmatch attribute is specified");
+var t2 = async_test("the typemustmatch attribute is not specified");
+
+</script>
+<body onload="t1.done(); t2.done()">
+<object id="obj"></object>
+<div id="log"></div>
+<script>
+
+t1.step(function() {
+ var obj1 = document.createElement("object");
+ obj1.setAttribute("data", "/images/blue.png");
+ obj1.setAttribute("type", "text/plain");
+ obj1.setAttribute("typemustmatch", "");
+ obj1.onload = t1.step_func(function () {
+ assert_true("typeMustMatch" in obj1, "typeMustMatch is not supported.");
+ assert_unreached("The image of the first object should not be loaded.");
+ });
+ document.getElementById("obj").appendChild(obj1);
+});
+
+t2.step(function () {
+ var obj2 = document.createElement("object");
+ obj2.setAttribute("data", "test2.html");
+ obj2.setAttribute("type", "text/plain");
+ obj2.onload = t2.step_func( function () {
+ assert_not_equals(obj2.contentDocument, null, "The test2.html should be loaded.");
+ });
+ document.getElementById("obj").appendChild(obj2);
+});
+
+</script>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-handler.html b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-handler.html
new file mode 100644
index 000000000..a24554e0c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-handler.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: object - handler</title>
+<link rel="author" title="Intel" href="http://www.intel.com" />
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<object id="test" name="obj" data="test0.html" type="text/html"></object>
+<script>
+
+var t1 = async_test("The nested browsing context must be navigated to the resource specified by the data attribute.");
+var t2 = async_test("The object.data must not be updated if the browsing context gets further navigated.");
+
+function callback(data) {
+ if (data == "test0") {
+ t1.step(function() {
+ var testEle = document.getElementById("test");
+ assert_true(testEle.contentDocument.location.href.indexOf("test0.html") != -1, "The nested browsing context should be navigated to test0.html.");
+ window["obj"].history.replaceState({state:"ok"}, "mytitle ", "object-fallback.html");
+ assert_not_equals(testEle.contentDocument.location.href.indexOf("object-fallback.html"), -1, "The nested browsing context should be replacement enabled.");
+ });
+ t1.done();
+ } else if (data == "test1") {
+ t2.step(function() {
+ var testEle = document.getElementById("test");
+ assert_true(testEle.contentDocument.location.href.indexOf("test1.html") != -1, "The browsing context should be navigated to test1.html.");
+ assert_true(testEle.data.indexOf("test0.html") != -1, "The value of attribute data should not be updated.");
+ });
+ t2.done();
+ }
+}
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/test0.html b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/test0.html
new file mode 100644
index 000000000..17df71daa
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/test0.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<script>
+
+parent.callback("test0");
+document.location.href = "test1.html";
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/test1.html b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/test1.html
new file mode 100644
index 000000000..cf2423275
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/test1.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<script>
+
+parent.callback("test1");
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/test2.html b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/test2.html
new file mode 100644
index 000000000..e5061eaea
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-object-element/test2.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: object - fallback</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-param-element/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/the-param-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-param-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-source-element/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/the-source-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-source-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-track-element/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/the-track-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-track-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/.gitkeep b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video-tabindex.html b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video-tabindex.html
new file mode 100644
index 000000000..304487478
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video-tabindex.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<title>tabindex on video elements</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#video">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<video></video>
+</div>
+<script>
+var t = async_test("Attributes shouldn't magically appear");
+on_event(window, "load", t.step_func(function() {
+ var el = document.getElementById("test").getElementsByTagName("video")[0];
+ assert_equals(el.hasAttribute("tabindex"), false);
+ t.done()
+}))
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_content-ref.htm b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_content-ref.htm
new file mode 100644
index 000000000..c02abb123
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_content-ref.htm
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>HTML5 Media Elements: Content inside the 'video' element is not shown to the user.</title>
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ </head>
+ <body>
+ <div id='testcontent'>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_content_image.htm b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_content_image.htm
new file mode 100644
index 000000000..0808d894a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_content_image.htm
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>HTML5 Media Elements: Content inside the 'video' element is not shown to the user.</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="https://html.spec.whatwg.org/multipage/#video" />
+ <link rel="match" href="video_content-ref.htm" />
+ <meta name="assert" content="Content inside the 'video' element is not shown to the user (image)." />
+ </head>
+ <body>
+ <div id='testcontent'>
+ <video><img src="../../../../images/fail.gif" /></video>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_content_text.htm b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_content_text.htm
new file mode 100644
index 000000000..639fb73f8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_content_text.htm
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>HTML5 Media Elements: Content inside the 'video' element is not shown to the user.</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="https://html.spec.whatwg.org/multipage/#video" />
+ <link rel="match" href="video_content-ref.htm" />
+ <meta name="assert" content="Content inside the 'video' element is not shown to the user." />
+ </head>
+ <body>
+ <div id='testcontent'>
+ <video><p style="color: red;">FAIL</p></video>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_dynamic_poster-ref.htm b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_dynamic_poster-ref.htm
new file mode 100644
index 000000000..78c03626e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_dynamic_poster-ref.htm
@@ -0,0 +1,5 @@
+<!DOCTYPE HTML>
+<meta charset=UTF-8>
+<title>Reference for poster tests</title>
+<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
+<img src="/media/poster.png">
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_dynamic_poster_absolute.htm b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_dynamic_poster_absolute.htm
new file mode 100644
index 000000000..bec2b0fba
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_dynamic_poster_absolute.htm
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<meta charset=UTF-8>
+<title>The 'HTMLVideoElement' interface supports setting 'poster' to an absolute URL</title>
+<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-video-poster">
+<link rel="match" href="video_dynamic_poster-ref.htm">
+<meta name="assert" content="The 'HTMLVideoElement' interface supports setting 'poster' to an absolute URL">
+<video id="video0">Your browser does not support video.</video>
+<script>
+var testElem = document.getElementById("video0");
+testElem.poster = "/media/poster.png";
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_dynamic_poster_relative.htm b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_dynamic_poster_relative.htm
new file mode 100644
index 000000000..4faca61c4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_dynamic_poster_relative.htm
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<meta charset=UTF-8>
+<title>The 'HTMLVideoElement' interface supports setting 'poster' to a relative URL</title>
+<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-video-poster">
+<link rel="match" href="video_dynamic_poster-ref.htm">
+<meta name="assert" content="The 'HTMLVideoElement' interface supports setting 'poster' to a relative URL">
+<video id="video0">Your browser does not support video.</video>
+<script>
+var testElem = document.getElementById("video0");
+testElem.poster = "../../../../media/poster.png";
+</script>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_initially_paused-ref.html b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_initially_paused-ref.html
new file mode 100644
index 000000000..8556aabf2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_initially_paused-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML>
+<meta charset=UTF-8>
+<title>Video elements should initially be paused</title>
+<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-paused">
+<script src="/common/media.js"></script>
+<p>The following video element should be paused. (All clocks at zero).</p>
+<img src='/images/movie_300_frame_0.png'>
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_initially_paused.html b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_initially_paused.html
new file mode 100644
index 000000000..b2725b04a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_initially_paused.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<meta charset=UTF-8>
+<title>Video elements should initially be paused</title>
+<link rel="match" href="video_initially_paused-ref.html">
+<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-paused">
+<script src="/common/media.js"></script>
+<style>
+div#video {
+ padding: 6px 3px;
+}
+</style>
+<p>The following video element should be paused. (All clocks at zero).</p>
+<div id=video>
+<script>
+document.write(
+ "<video src='"+ getVideoURI('/media/movie_300') + "' >" +
+ "Your browser does not support the video element." +
+ "<\/video>");
+</script>
+</div>
diff --git a/testing/web-platform/tests/html/semantics/forms/.gitkeep b/testing/web-platform/tests/html/semantics/forms/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/.gitkeep b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/contains.json b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/contains.json
new file mode 100644
index 000000000..357a1e6a7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/contains.json
@@ -0,0 +1,34 @@
+[
+ {
+ "id": "naming-form-controls-the-name-attribute",
+ "original_id": "naming-form-controls:-the-name-attribute"
+ },
+ {
+ "id": "submitting-element-directionality-the-dirname-attribute",
+ "original_id": "submitting-element-directionality:-the-dirname-attribute"
+ },
+ {
+ "id": "limiting-user-input-length-the-maxlength-attribute",
+ "original_id": "limiting-user-input-length:-the-maxlength-attribute"
+ },
+ {
+ "id": "enabling-and-disabling-form-controls-the-disabled-attribute",
+ "original_id": "enabling-and-disabling-form-controls:-the-disabled-attribute"
+ },
+ {
+ "id": "form-submission",
+ "original_id": "form-submission"
+ },
+ {
+ "id": "autofocusing-a-form-control-the-autofocus-attribute",
+ "original_id": "autofocusing-a-form-control:-the-autofocus-attribute"
+ },
+ {
+ "id": "input-modalities-the-inputmode-attribute",
+ "original_id": "input-modalities:-the-inputmode-attribute"
+ },
+ {
+ "id": "autofilling-form-controls-the-autocomplete-attribute",
+ "original_id": "autofilling-form-controls:-the-autocomplete-attribute"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-ltr-iframe.html b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-ltr-iframe.html
new file mode 100644
index 000000000..b5ed7e3d9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-ltr-iframe.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Submitting element directionality: the dirname attribute support</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
diff --git a/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-ltr.html b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-ltr.html
new file mode 100644
index 000000000..28d1c150b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-ltr.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Submitting element directionality: the dirname attribute</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#submitting-element-directionality:-the-dirname-attribute">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form action="dirname-ltr-iframe.html" method=get target="iframe">
+ <p><label>Comment: <input type=text name="comment" dirname="comment.dir" required></label></p>
+ <p><button type=submit>Post Comment</button></p>
+</form>
+<iframe name="iframe"></iframe>
+<script>
+ function getParameterByName(name) {
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
+ results = regex.exec(document.querySelector("iframe").contentWindow.location.search);
+ return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
+ }
+
+ var t = async_test("submit element directionality");
+ document.querySelector("input").value="foobar";
+ document.querySelector("button").click();
+
+ document.querySelector("iframe").onload = t.step_func_done(function() {
+ assert_equals(getParameterByName("comment.dir"), "ltr");
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-rtl-manual.html b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-rtl-manual.html
new file mode 100644
index 000000000..cb00f6972
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-rtl-manual.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Submitting element directionality: the dirname attribute (rtl)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#submitting-element-directionality:-the-dirname-attribute">
+<form action="dirname-rtl-manual.html" method=get>
+ <p><label>Comment: <input type=text name="comment" dirname="comment.dir" required></label></p>
+ <p><button type=submit>Post Comment</button></p>
+</form>
+<p>Switch to a right-to-left writing direction, enter a text in the input and submit the form.</p>
+<p>Test passes if the word "PASS" appears below</p>
+<script>
+ function getParameterByName(name) {
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
+ results = regex.exec(location.search);
+ return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
+ }
+
+ var commentDir = getParameterByName("comment.dir");
+ if (commentDir) {
+ var p = document.createElement("p");
+ p.textContent = (commentDir == "rtl") ? "PASS" : "FAIL";
+ document.body.appendChild(p);
+ }
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/disabled-elements-01.html b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/disabled-elements-01.html
new file mode 100644
index 000000000..14443e409
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/disabled-elements-01.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<title>HTMLFormElement: the disabled attribute</title>
+<link rel="author" title="Eric Casler" href="mailto:ericorange@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#enabling-and-disabling-form-controls:-the-disabled-attribute">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id="log"></div>
+<div id="root"></div>
+<script>
+// Elements tested for in this file
+var types = ["button", "input", "select", "textarea"];
+// no tests for: optgroup, option, fieldset
+
+var root = document.getElementById("root");
+for (var element_type = 0; element_type < types.length; element_type++) {
+ test(function() {
+ root.innerHTML = "<"+types[element_type]+" + id='elem'></"+types[element_type]+">";
+
+ var elem = document.getElementById("elem");
+ assert_false(elem.disabled);
+ },
+ "Test ["+types[element_type]+"]: default behaviour is NOT disabled");
+
+ test(function() {
+ var formats = ["disabled",
+ "disabled=disabled", "disabled='disabled'",
+ "disabled='true'", "disabled=true",
+ "disabled='false'", "disabled=false"];
+
+ for (var f = 0; f < formats.length; f++) {
+ root.innerHTML = "<"+types[element_type]+" id='elem' " + formats[f] + "></"+types[element_type]+">";
+
+ var elem = document.getElementById("elem");
+ assert_true(elem.disabled);
+ }
+ },
+ "Test ["+types[element_type]+"]: verify disabled acts as boolean attribute");
+
+ test(function() {
+ root.innerHTML = "<"+types[element_type]+" id='elem'></"+types[element_type]+"><input id='other' value='no event dispatched'></input>";
+ var elem = document.getElementById("elem"),
+ other = document.getElementById("other");
+
+ assert_equals(other.value, "no event dispatched");
+
+ elem.disabled = true;
+ assert_true(elem.disabled);
+
+ elem.onclick = function () {
+ // change value of other element, to avoid *.value returning "" for disabled elements
+ document.getElementById("other").value = "event dispatched";
+ };
+
+ // Check if dispatched event executes
+ var evObj = document.createEvent('Events');
+ evObj.initEvent("click", true, false);
+ elem.dispatchEvent(evObj);
+ assert_equals(other.value, "event dispatched");
+ },
+ "Test ["+types[element_type]+"]: synthetic click events should be dispatched");
+
+ test(function() {
+ root.innerHTML = "<"+types[element_type]+" id='elem'></"+types[element_type]+"><input id='other' value='no event dispatched'></input>";
+ var elem = document.getElementById("elem"),
+ other = document.getElementById("other");
+
+ assert_equals(other.value, "no event dispatched");
+
+ elem.disabled = true;
+ assert_true(elem.disabled);
+
+ elem.onclick = function () {
+ // change value of other element, to avoid *.value returning "" for disabled elements
+ document.getElementById("other").value = "event dispatched";
+ };
+
+ // Check that click() on a disabled element doesn't dispatch a click event.
+ elem.click();
+ assert_equals(other.value, "no event dispatched");
+ },
+ "Test ["+types[element_type]+"]: click() should not dispatch a click event");
+}
+root.innerHTML = "";
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/formAction_document_address.html b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/formAction_document_address.html
new file mode 100644
index 000000000..d14cad532
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/formAction_document_address.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>HTML Test: formAction_document_address</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-fs-formaction">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-document's-address">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-button-element">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-input-element">
+ <meta name="assert" content="On getting the formAction IDL attribute, when the content attribute is missing or its value is the empty string, the document's address must be returned instead.">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <div id="missing" style="display:none">
+ <button type="submit">Submit</button>
+ <input type="submit">
+ </div>
+
+ <div id="empty_string" style="display:none">
+ <button type="submit" formaction="">Submit</button>
+ <input type="submit" formaction="">
+ </div>
+
+ <div id="no_assigned_value" style="display:none">
+ <button type="submit" formaction>Submit</button>
+ <input type="submit" formaction>
+ </div>
+
+ <script>
+ // formaction content attribute is missing
+ test(function() {
+ var formAction = document.querySelector('#missing button').formAction;
+ var address = document.location.href;
+ assert_equals(formAction, address);
+ }, "Check if button.formAction is the document's address when formaction content attribute is missing");
+
+ test(function() {
+ var formAction = document.querySelector('#missing input').formAction;
+ var address = document.location.href;
+ assert_equals(formAction, address);
+ }, "Check if input.formAction is the document's address when formaction content attribute is missing");
+
+ // formaction content attribute value is empty string
+ test(function() {
+ var formAction = document.querySelector('#empty_string button').formAction;
+ var address = document.location.href;
+ assert_equals(formAction, address);
+ }, "Check if button.formAction is the document's address when formaction content attribute value is empty string");
+
+ test(function() {
+ var formAction = document.querySelector('#empty_string input').formAction;
+ var address = document.location.href;
+ assert_equals(formAction, address);
+ }, "Check if input.formAction is the document's address when formaction content attribute value is empty string");
+
+ // formaction content attribute value is not assigned, just for comparison with empty string above
+ test(function() {
+ var formAction = document.querySelector('#no_assigned_value button').formAction;
+ var address = document.location.href;
+ assert_equals(formAction, address);
+ }, "Check if button.formAction is the document's address when formaction content attribute value is not assigned");
+
+ test(function() {
+ var formAction = document.querySelector('#no_assigned_value input').formAction;
+ var address = document.location.href;
+ assert_equals(formAction, address);
+ }, "Check if input.formAction is the document's address when formaction content attribute value is not assigned");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/formaction.html b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/formaction.html
new file mode 100644
index 000000000..82798eaa8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/formaction.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html><head>
+ <title>formaction on button element</title>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type">
+ <meta content="formaction on button element" name="description">
+ <link href="https://html.spec.whatwg.org/multipage/#dom-fs-formaction" rel="help">
+</head>
+ <body>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+
+ <div id="log"></div>
+ <button formaction="http://www.example.com/" style="display: none" type="submit">Submit</button>
+ <input formaction="http://www.example.com/" style="display: none" type="submit" value="submit">
+ <input style="display: none" type="submit" value="submit">
+ <input formaction="" style="display: none" type="submit" value="submit">
+
+ <script type="text/javascript">
+ function relativeToAbsolute(relativeURL) {
+ var a = document.createElement('a');
+ a.href = relativeURL;
+ return a.href;
+ }
+ test(function() {assert_equals(document.getElementsByTagName("button")[0].formAction, "http://www.example.com/")}, "formAction on button support");
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].formAction, "http://www.example.com/")}, "formAction on input support");
+
+ var testElem = document.getElementsByTagName("input")[0];
+ testElem.formAction = "http://www.example.com/page2.html";
+
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].formAction, "http://www.example.com/page2.html")}, "formaction absolute URL value on input reflects correct value after being updated by the DOM");
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].getAttribute("formaction"), "http://www.example.com/page2.html")}, "formAction absolute URL value is correct using getAttribute");
+
+ var testElem = document.getElementsByTagName("input")[0];
+ testElem.formAction = "../page3.html";
+
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].formAction, relativeToAbsolute('../page3.html'))}, "formAction relative URL value on input reflects correct value after being updated by the DOM");
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].getAttribute("formaction"), "../page3.html")}, "formAction relative URL value is correct using getAttribute");
+
+ test(function() {assert_equals(document.getElementsByTagName("input")[1].formAction, document.URL)}, "On getting, when formaction is missing, the document's address must be returned");
+ test(function() {assert_equals(document.getElementsByTagName("input")[2].formAction, document.URL)}, "On getting, when formaction value is the empty string, the document's address must be returned");
+ </script>
+</body></html>
diff --git a/testing/web-platform/tests/html/semantics/forms/categories/.gitkeep b/testing/web-platform/tests/html/semantics/forms/categories/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/categories/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/.gitkeep b/testing/web-platform/tests/html/semantics/forms/constraints/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/contains.json b/testing/web-platform/tests/html/semantics/forms/constraints/contains.json
new file mode 100644
index 000000000..67e4c3b12
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/contains.json
@@ -0,0 +1,18 @@
+[
+ {
+ "id": "definitions",
+ "original_id": "definitions"
+ },
+ {
+ "id": "constraint-validation",
+ "original_id": "constraint-validation"
+ },
+ {
+ "id": "the-constraint-validation-api",
+ "original_id": "the-constraint-validation-api"
+ },
+ {
+ "id": "security-forms",
+ "original_id": "security-forms"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-checkValidity.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-checkValidity.html
new file mode 100644
index 000000000..2e790c75d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-checkValidity.html
@@ -0,0 +1,145 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.checkValidity()</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-cva-checkvalidity">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+ var testElements = [
+ {
+ tag: "input",
+ types: ["text", "search", "tel", "password"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {maxLength: "4", value: "abcdef"}, expected: true, name: "[target] not suffering from being too long", dirty: true},
+ {conditions: {pattern: "[A-Z]", value: "abc"}, expected: false, name: "[target] suffering from a pattern mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["url"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {maxLength: "20", value: "http://www.example.com"}, expected: true, name: "[target] suffering from being too long", dirty: true},
+ {conditions: {pattern: "http://www.example.com", value: "http://www.example.net"}, expected: false, name: "[target] suffering from a pattern mismatch"},
+ {conditions: {value: "abc"}, expected: false, name: "[target] suffering from a type mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["email"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {maxLength: "10", value: "test@example.com"}, expected: true, name: "[target] not suffering from being too long", dirty: true},
+ {conditions: {pattern: "test@example.com", value: "test@example.net"}, expected: false, name: "[target] suffering from a pattern mismatch"},
+ {conditions: {value: "abc"}, expected: false, name: "[target] suffering from a type mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["datetime-local"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] suffering from an overflow"},
+ {conditions: {min: "2001-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] suffering from an underflow"},
+ {conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00"}, expected: false, name: "[target] suffering from a step mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["date"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {max: "2000-01-01", value: "2001-01-01"}, expected: false, name: "[target] suffering from an overflow"},
+ {conditions: {min: "2001-01-01", value: "2000-01-01"}, expected: false, name: "[target] suffering from an underflow"},
+ {conditions: {step: 2 * 1 * 86400000, value: "2001-01-03"}, expected: false, name: "[target] suffering from a step mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["month"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {max: "2000-01", value: "2001-01"}, expected: false, name: "[target] suffering from an overflow"},
+ {conditions: {min: "2001-01", value: "2000-01"}, expected: false, name: "[target] suffering from an underflow"},
+ {conditions: {step: 3 * 1 * 1, value: "2001-03"}, expected: false, name: "[target] suffering from a step mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["week"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {max: "2000-W01", value: "2001-W01"}, expected: false, name: "[target] suffering from an overflow"},
+ {conditions: {min: "2001-W01", value: "2000-W01"}, expected: false, name: "[target] suffering from an underflow"},
+ {conditions: {step: 2 * 1 * 604800000, value: "2001-W03"}, expected: false, name: "[target] suffering from a step mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["time"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {max: "12:00:00", value: "13:00:00"}, expected: false, name: "[target] suffering from an overflow"},
+ {conditions: {min: "12:00:00", value: "11:00:00"}, expected: false, name: "[target] suffering from an underflow"},
+ {conditions: {step: 2 * 60 * 1000, value: "12:03:00"}, expected: false, name: "[target] suffering from a step mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["number"],
+ testData: [
+ {conditions: {max: "5", value: "6"}, expected: false, name: "[target] suffering from an overflow"},
+ {conditions: {min: "5", value: "4"}, expected: false, name: "[target] suffering from an underflow"},
+ {conditions: {step: 2 * 1 * 1, value: "3"}, expected: false, name: "[target] suffering from a step mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["checkbox", "radio"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {required: true, checked: false, name: "test1"}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["file"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {required: true, files: null}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "select",
+ types: [],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "textarea",
+ types: [],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ }
+ ];
+
+ validator.run_test(testElements, "checkValidity");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-reportValidity.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-reportValidity.html
new file mode 100644
index 000000000..c68e21c9d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-reportValidity.html
@@ -0,0 +1,145 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.reportValidity()</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-cva-reportvalidity">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+ var testElements = [
+ {
+ tag: "input",
+ types: ["text", "search", "tel", "password"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {maxLength: "4", value: "abcdef"}, expected: true, name: "[target] not suffering from being too long", dirty: true},
+ {conditions: {pattern: "[A-Z]", value: "abc"}, expected: false, name: "[target] suffering from a pattern mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["url"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {maxLength: "20", value: "http://www.example.com"}, expected: true, name: "[target] not suffering from being too long", dirty: true},
+ {conditions: {pattern: "http://www.example.com", value: "http://www.example.net"}, expected: false, name: "[target] suffering from a pattern mismatch"},
+ {conditions: {value: "abc"}, expected: false, name: "[target] suffering from a type mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["email"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {maxLength: "10", value: "test@example.com"}, expected: true, name: "[target] not suffering from being too long", dirty: true},
+ {conditions: {pattern: "test@example.com", value: "test@example.net"}, expected: false, name: "[target] suffering from a pattern mismatch"},
+ {conditions: {value: "abc"}, expected: false, name: "[target] suffering from a type mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["datetime-local"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] suffering from an overflow"},
+ {conditions: {min: "2001-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] suffering from an underflow"},
+ {conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00"}, expected: false, name: "[target] suffering from a step mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["date"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {max: "2000-01-01", value: "2001-01-01"}, expected: false, name: "[target] suffering from an overflow"},
+ {conditions: {min: "2001-01-01", value: "2000-01-01"}, expected: false, name: "[target] suffering from an underflow"},
+ {conditions: {step: 2 * 1 * 86400000, value: "2001-01-03"}, expected: false, name: "[target] suffering from a step mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["month"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {max: "2000-01", value: "2001-01"}, expected: false, name: "[target] suffering from an overflow"},
+ {conditions: {min: "2001-01", value: "2000-01"}, expected: false, name: "[target] suffering from an underflow"},
+ {conditions: {step: 3 * 1 * 1, value: "2001-03"}, expected: false, name: "[target] suffering from a step mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["week"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {max: "2000-W01", value: "2001-W01"}, expected: false, name: "[target] suffering from an overflow"},
+ {conditions: {min: "2001-W01", value: "2000-W01"}, expected: false, name: "[target] suffering from an underflow"},
+ {conditions: {step: 2 * 1 * 604800000, value: "2001-W03"}, expected: false, name: "[target] suffering from a step mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["time"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {max: "12:00:00", value: "13:00:00"}, expected: false, name: "[target] suffering from an overflow"},
+ {conditions: {min: "12:00:00", value: "11:00:00"}, expected: false, name: "[target] suffering from an underflow"},
+ {conditions: {step: 2 * 60 * 1000, value: "12:03:00"}, expected: false, name: "[target] suffering from a step mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["number"],
+ testData: [
+ {conditions: {max: "5", value: "6"}, expected: false, name: "[target] suffering from an overflow"},
+ {conditions: {min: "5", value: "4"}, expected: false, name: "[target] suffering from an underflow"},
+ {conditions: {step: 2 * 1 * 1, value: "3"}, expected: false, name: "[target] suffering from a step mismatch"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["checkbox", "radio"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {required: true, checked: false, name: "test1"}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["file"],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {required: true, files: null}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "select",
+ types: [],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ },
+ {
+ tag: "textarea",
+ types: [],
+ testData: [
+ {conditions: {}, expected: true, name: "[target] no constraint"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
+ ]
+ }
+ ];
+
+ validator.run_test(testElements, "reportValidity");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validate.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validate.html
new file mode 100644
index 000000000..47b41ffeb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validate.html
@@ -0,0 +1,127 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Constraint validation</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#constraint-validation">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form id="fm1" style="display:none">
+ <fieldset id="test0">
+ <input type="text" required value="" id="test1">
+ </fieldset>
+ <input type="email" value="abc" id="test2">
+ <button id="test3">TEST</button>
+ <select id="test4"></select>
+ <textarea id="test5"></textarea>
+ <output id="test6"></output>
+</form>
+<form id="fm2" style="display:none">
+ <fieldset>
+ <input type="text" required value="abc">
+ </fieldset>
+ <input type="email" value="test@example.com">
+ <button>TEST</button>
+ <select></select>
+ <textarea></textarea>
+ <output></output>
+</form>
+<form id="fm3" style="display:none">
+ <fieldset id="fs">
+ <legend><input type="text" id="inp1"></legend>
+ <input type="text" required value="" id="inp2">
+ </fieldset>
+</form>
+
+<script>
+ var cancelable = true,
+ times1 = 0,
+ times2 = 0,
+ invalidList1 = [],
+ invalidList2 = [],
+ test1,
+ test2,
+ fm1,
+ fm2,
+ fm3;
+
+ setup(function () {
+ fm1 = document.getElementById("fm1");
+ fm2 = document.getElementById("fm2");
+ fm3 = document.getElementById("fm3");
+ test1 = document.getElementById("test1");
+ test2 = document.getElementById("test2");
+ for (var index = 0; index < fm1.elements.length; index++) {
+ var ele = fm1.elements.item(index);
+ ele.addEventListener("invalid", function (e) {
+ times1++;
+ invalidList1.push(e.target);
+ if (!e.cancelable)
+ cancelable = e.cancelable;
+ }, false);
+ }
+
+ for (var index = 0; index < fm1.elements.length; index++) {
+ var ele = fm2.elements.item(index);
+ ele.addEventListener("invalid", function (e) {
+ times2++;
+ invalidList2.push(ele);
+ }, false);
+ }
+ });
+
+ test(function(){
+ assert_false(fm1.checkValidity(), "The checkValidity method should be false.");
+ }, "If there is any invalid submittable element whose form owner is the form, the form.checkValidity must be false");
+
+ test(function(){
+ assert_true("reportValidity" in fm1, "The reportValidity method is not supported");
+ assert_false(fm1.reportValidity(), "The reportValidity method should be false.");
+ }, "If there is any invalid submittable element whose form owner is the form, the form.reportValidity must be false");
+
+ test(function(){
+ assert_true(fm2.checkValidity(), "The checkValidity method should be true.");
+ }, "If all of the submittable elements whose form owner is the form are valid, the form.checkValidity must be true");
+
+ test(function(){
+ assert_true("reportValidity" in fm2, "The reportValidity method is not supported.");
+ assert_true(fm2.reportValidity(), "The reportValidity method should be true.");
+ }, "If all of the submittable elements whose form owner is the form are valid, the form.reportValidity must be true");
+
+ test(function(){
+ assert_false(fm3.checkValidity(), "The checkValidity method should be false.");
+ document.getElementById("fs").disabled = true;
+ assert_true(fm3.checkValidity(), "The checkValidity method should be true.");
+
+ document.getElementById("inp1").value = "aaa";
+ document.getElementById("inp1").type = "url";
+ assert_false(fm3.checkValidity(), "The checkValidity method should be false.");
+ }, "Check the checkValidity method of the form element when it has a fieldset child");
+
+ test(function(){
+ // Restore the condition to default which was modified during the previous test.
+ document.getElementById("fs").disabled = false;
+ document.getElementById("inp1").value = "";
+ document.getElementById("inp1").type = "text";
+
+ assert_true("reportValidity" in fm3, "The reportValidity method is not supported.");
+ assert_false(fm3.reportValidity(), "The reportValidity method should be false.");
+ document.getElementById("fs").disabled = true;
+ assert_true(fm3.reportValidity(), "The reportValidity method should be true.");
+
+ document.getElementById("inp1").value = "aaa";
+ document.getElementById("inp1").type = "url";
+ assert_false(fm3.reportValidity(), "The reportValidity method should be false.");
+ }, "Check the reportValidity method of the form element when it has a fieldset child");
+
+ test(function () {
+ assert_equals(times1, 4, "The invalid event will be fired if the checkValidity or reportValidity method are called.");
+ assert_array_equals(invalidList1, [test1, test2, test1, test2], "The invalid event must be fired at the invalid control");
+ assert_true(cancelable, "The invalid event is cancelable.");
+ }, "The invalid event must be fired at the invalid controls");
+
+ test(function () {
+ assert_equals(times2, 0, "The invalid event should not be fired, times should be 0.");
+ assert_array_equals(invalidList2, [], "The invalid event should not be fired, invalid list should be empty");
+ }, "The invalid event must not be fired at the invalid controls");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-badInput.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-badInput.html
new file mode 100644
index 000000000..8f6153b92
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-badInput.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.validity.badInput</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/association-of-controls-and-forms.html#suffering-from-bad-input">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/the-button-element.html#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+var testElements = [
+ {
+ tag: "input",
+ types: ["email"],
+ testData: [
+ {conditions: {multiple: false, value: ""}, expected: false, name: "[target] The multiple attribute is false and the value attribute is empty"},
+ {conditions: {multiple: false, value: "test1@example.com"}, expected: false, name: "[target] The multiple attribute is false and the value attribute is a valid e-mail address"},
+ {conditions: {multiple: true, value: "test1@example.com,test2@eample.com"}, expected: false, name: "[target] The multiple attribute is true and the value contains valid e-mail addresses"},
+ {conditions: {multiple: true, value: "test,1@example.com"}, expected: false, name: "[target] The multiple attribute is true and the value attribute contains a ','"}
+ //TODO, the value contains characters that cannot be converted to punycode.
+ //Can not find a character that cannot be converted to punycode.
+ ]
+ },
+ {
+ tag: "input",
+ types: ["datetime-local"],
+ testData: [
+ {conditions: {value: ""}, expected: false, name: "[target] The value attribute is empty"},
+ {conditions: {value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The value attribute is a valid date and time string"},
+ {conditions: {value: "abc"}, expected: false, name: "[target] The value attribute cannot convert to a valid normalized forced-UTC global date and time string"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["color"],
+ testData: [
+ {conditions: {value: ""}, expected: false, name: "[target] The value attribute is empty"},
+ {conditions: {value: "#000000"}, expected: false, name: "[target] The value attribute is a valid sample color"},
+ {conditions: {value: "#FFFFFF"}, expected: false, name: "[target] The value attribute is not a valid lowercase sample color"},
+ {conditions: {value: "abc"}, expected: false, name: "[target] The value attribute cannot convert to a valid sample color"}
+ ]
+ },
+ ];
+ validator.run_test (testElements, "badInput");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-customError.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-customError.html
new file mode 100644
index 000000000..16e642147
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-customError.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.validity.customError</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-validitystate-customerror">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+var testElements = [
+ {
+ tag: "input",
+ types: [],
+ testData: [
+ {conditions: {message: "My custom error"}, expected: true, name: "[target] The validity.customError must be true if the custom validity error message is not empty"},
+ {conditions: {message: ""}, expected: false, name: "[target] The validity.customError must be false if the custom validity error message is empty"}
+ ]
+ },
+ {
+ tag: "button",
+ types: [],
+ testData: [
+ {conditions: {message: "My custom error"}, expected: true, name: "[target] The validity.customError must be true if the custom validity error message is not empty"},
+ {conditions: {message: ""}, expected: false, name: "[target] The validity.customError must be false if the custom validity error message is empty"}
+ ]
+ },
+ {
+ tag: "select",
+ types: [],
+ testData: [
+ {conditions: {message: "My custom error"}, expected: true, name: "[target] The validity.customError must be true if the custom validity error message is not empty"},
+ {conditions: {message: ""}, expected: false, name: "[target] The validity.customError must be false i the custom validity error message is empty"}
+ ]
+ },
+ {
+ tag: "textarea",
+ types: [],
+ testData: [
+ {conditions: {message: "My custom error"}, expected: true, name: "[target] The validity.customError must be true if the custom validity error message is not empty"},
+ {conditions: {message: ""}, expected: false, name: "[target] The validity.customError must be false if the custom validity error message is empty"}
+ ]
+ }
+ ]
+
+ validator.run_test(testElements, "customError");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-patternMismatch.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-patternMismatch.html
new file mode 100644
index 000000000..5a0012b0e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-patternMismatch.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.validity.patternMismatch</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-validitystate-patternmismatch">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+ var testElements = [
+ {
+ tag: "input",
+ types: ["text", "search", "tel", "url", "email", "password"],
+ testData: [
+ {conditions: {pattern: null, value: "abc"}, expected: false, name: "[target] The pattern attribute is not set"},
+ {conditions: {pattern: "[A-Z]+", value: ""}, expected: false, name: "[target] The value attibute is empty string"},
+ {conditions: {pattern: "[A-Z]{1}", value: "A"}, expected: false, name: "[target] The value attribute matches the pattern attribute"},
+ {conditions: {pattern: "[A-Z]+", value: "\u0041\u0042\u0043"}, expected: false, name: "[target] The value(ABC) in unicode attribute matches the pattern attribute"},
+ {conditions: {pattern: "[a-z]{3,}", value: "ABCD"}, expected: true, name: "[target] The value attribute mismatches the pattern attribute"}
+ ]
+ }
+ ];
+
+ validator.run_test (testElements, "patternMismatch");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html
new file mode 100644
index 000000000..ca423ef9e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html
@@ -0,0 +1,115 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.validity.rangeOverflow</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-validitystate-rangeoverflow">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+ var testElements = [
+ {
+ tag: "input",
+ types: ["datetime-local"],
+ testData: [
+ {conditions: {max: "", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The max attribute is not set"},
+ {conditions: {max: "2000-01-01T12:00:00", value: ""}, expected: false, name: "[target] Value is empty string"},
+ {conditions: {max: "2000-01-01 12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] The max attribute is an invalid local date time string"},
+ {conditions: {max: "2000-01-01T12:00:00", value: "2000-01-01T11:00:00"}, expected: false, name: "[target] The max attribute is greater than the value attribute"},
+ {conditions: {max: "2000-01-01T23:59:59", value: "2001-01-01T24:00:00"}, expected: false, name: "[target] The value is an invalid local date time string(hour is greater than 23)"},
+ {conditions: {max: "1970-01-01T12:00", value: "80-01-01T12:00"}, expected: false, name: "[target] The value if an invalid local date time string(year is two digits)"},
+ {conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T13:00:00"}, expected: true, name: "[target] The value is greater than max"},
+ {conditions: {max: "2000-01-01T12:00:00.1", value: "2000-01-01T12:00:00.2"}, expected: true, name: "[target] The value is greater than max(with millisecond in 1 digit)"},
+ {conditions: {max: "2000-01-01T12:00:00.01", value: "2000-01-01T12:00:00.02"}, expected: true, name: "[target] The value is greater than max(with millisecond in 2 digits)"},
+ {conditions: {max: "2000-01-01T12:00:00.001", value: "2000-01-01T12:00:00.002"}, expected: true, name: "[target] The value is greater than max(with millisecond in 3 digits)"},
+ {conditions: {max: "2000-01-01T12:00:00", value: "10000-01-01T12:00:00"}, expected: true, name: "[target] The value is greater than max(Year is 10000 should be valid)"},
+ ]
+ },
+ {
+ tag: "input",
+ types: ["date"],
+ testData: [
+ {conditions: {max: "", value: "2000-01-01"}, expected: false, name: "[target] The max attribute is not set"},
+ {conditions: {max: "2000-01-01", value: ""}, expected: false, name: "[target] Value is empty string"},
+ {conditions: {max: "2000/01/01", value: "2002-01-01"}, expected: false, name: "[target] The max attribute is an invalid date"},
+ {conditions: {max: "2000-01-01", value: "2000-2-2"}, expected: false, name: "[target] The value attribute is an invalid date"},
+ {conditions: {max: "987-01-01", value: "988-01-01"}, expected: false, name: "[target] The value is an invalid date(year is three digits)"},
+ {conditions: {max: "2000-01-01", value: "2000-13-01"}, expected: false, name: "[target] The value is an invalid date(month is greater than 12)"},
+ {conditions: {max: "2000-01-01", value: "2000-02-30"}, expected: false, name: "[target] The value is an invalid date(date is greater than 29 for Feb)"},
+ {conditions: {max: "2000-12-01", value: "2000-01-01"}, expected: false, name: "[target] The max attribute is greater than value attribute"},
+ {conditions: {max: "2000-12-01", value: "2001-01-01"}, expected: true, name: "[target] The value attribute is greater than max attribute"},
+ {conditions: {max: "9999-01-01", value: "10000-01-01"}, expected: true, name: "[target] The value attribute is greater than max attribute(Year is 10000 should be valid)"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["month"],
+ testData: [
+ {conditions: {max: "", value: "2000-01"}, expected: false, name: "[target] The max attribute is not set"},
+ {conditions: {max: "2000-01", value: ""}, expected: false, name: "[target] Value is empty string"},
+ {conditions: {max: "2000/01", value: "2001-02"}, expected: false, name: "[target] The max attribute is an invalid month string"},
+ {conditions: {max: "2000-01", value: "2000-1"}, expected: false, name: "[target] The value attribute is an invalid month string"},
+ {conditions: {max: "987-01", value: "988-01"}, expected: false, name: "[target] The value is an invalid month string(year is three digits)"},
+ {conditions: {max: "2000-01", value: "2000-13"}, expected: false, name: "[target] The value is an invalid month string(month is greater than 12)"},
+ {conditions: {max: "2000-12", value: "2000-01"}, expected: false, name: "[target] The max attribute is greater than value attribute"},
+ {conditions: {max: "2000-01", value: "2000-12"}, expected: true, name: "[target] The value attribute is greater than max attribute"},
+ {conditions: {max: "9999-01", value: "10000-01"}, expected: true, name: "[target] The value attribute is greater than max attribute(Year is 10000 should be valid)"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["week"],
+ testData: [
+ {conditions: {max: "", value: "2000-W01"}, expected: false, name: "[target] The max attribute is not set"},
+ {conditions: {max: "2000-W01", value: ""}, expected: false, name: "[target] Value is empty string"},
+ {conditions: {max: "2000/W01", value: "2001-W02"}, expected: false, name: "[target] The max attribute is an invalid week string"},
+ {conditions: {max: "2000-W01", value: "2000-W2"}, expected: false, name: "[target] The value attribute is an invalid week string"},
+ {conditions: {max: "2000-W01", value: "2000-w02"}, expected: false, name: "[target] The value attribute is an invalid week string(w is in lowercase)"},
+ {conditions: {max: "987-W01", value: "988-W01"}, expected: false, name: "[target] The value is an invalid week string(year is three digits)"},
+ {conditions: {max: "2000-W01", value: "2000-W57"}, expected: false, name: "[target] The value is an invalid week string(week is too greater)"},
+ {conditions: {max: "2000-W12", value: "2000-W01"}, expected: false, name: "[target] The max attribute is greater than value attribute"},
+ {conditions: {max: "2000-W01", value: "2000-W12"}, expected: true, name: "[target] The value attribute is greater than max attribute"},
+ {conditions: {max: "9999-W01", value: "10000-W01"}, expected: true, name: "[target] The value attribute is greater than max attribute(Year is 10000 should be valid)"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["time"],
+ testData: [
+ {conditions: {max: "", value: "12:00:00"}, expected: false, name: "[target] The max attribute is not set"},
+ {conditions: {max: "12:00:00", value: ""}, expected: false, name: "[target] Value is empty string"},
+ {conditions: {max: "12.00.00", value: "12:00:01"}, expected: false, name: "[target] The max attribute is an invalid time string"},
+ {conditions: {max: "12:00:00", value: "12.00.01"}, expected: false, name: "[target] The value attribute is an invalid time string"},
+ {conditions: {max: "23:59:59", value: "24:00:00"}, expected: false, name: "[target] The value attribute is an invalid time string(hour is greater than 23)"},
+ {conditions: {max: "23:59:59", value: "23:60:00"}, expected: false, name: "[target] The value attribute is an invalid time string(minute is greater than 59)"},
+ {conditions: {max: "23:59:59", value: "23:59:60"}, expected: false, name: "[target] The value attribute is an invalid time string(second is greater than 59)"},
+ {conditions: {max: "13:00:00", value: "12:00:00"}, expected: false, name: "[target] The max attribute is greater than value attribute"},
+ {conditions: {max: "12:00:00", value: "13"}, expected: false, name: "[target] The time missing second and minute parts is invalid"},
+ {conditions: {max: "12:00:00", value: "12:00:02"}, expected: true, name: "[target] The value attribute is greater than max attribute"},
+ {conditions: {max: "12:00:00.1", value: "12:00:00.2"}, expected: true, name: "[target] The value is greater than max(with millisecond in 1 digit)"},
+ {conditions: {max: "12:00:00.01", value: "12:00:00.02"}, expected: true, name: "[target] The value is greater than max(with millisecond in 2 digit)"},
+ {conditions: {max: "12:00:00.001", value: "12:00:00.002"}, expected: true, name: "[target] The value is greater than max(with millisecond in 3 digit)"},
+ {conditions: {max: "12:00:00", value: "12:01"}, expected: true, name: "[target] The time missing second part is valid"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["number"],
+ testData: [
+ {conditions: {max: "", value: "10"}, expected: false, name: "[target] The max attribute is not set"},
+ {conditions: {max: "5", value: ""}, expected: false, name: "[target] Value is empty string"},
+ {conditions: {max: "5", value: "4"}, expected: false, name: "[target] The max is greater than value(integer)"},
+ {conditions: {max: "-5.5", value: "-5.6"}, expected: false, name: "[target] The max is greater than value(floating number)"},
+ {conditions: {max: "-0", value: "0"}, expected: false, name: "[target] The max equals to value"},
+ {conditions: {max: "5", value: "1abc"}, expected: false, name: "[target] The value is not a number"},
+ {conditions: {max: "5", value: "6"}, expected: true, name: "[target] The value is greater than max(integer)"},
+ {conditions: {max: "-5.5", value: "-5.4"}, expected: true, name: "[target] The value is greater than max(floating number)"},
+ {conditions: {max: "-5e-1", value: "5e+2"}, expected: true, name: "[target] The value is greater than max(scientific notation)"}
+ ]
+ }
+ ];
+
+ validator.run_test(testElements, "rangeOverflow");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html
new file mode 100644
index 000000000..d6bf86060
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html
@@ -0,0 +1,113 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.validity.rangeUnderflow</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-validitystate-rangeunderflow">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+ var testElements = [
+ {
+ tag: "input",
+ types: ["datetime-local"],
+ testData: [
+ {conditions: {min: "", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The min attribute is not set"},
+ {conditions: {min: "2000-01-01T12:00:00", value: ""}, expected: false, name: "[target] Value is empty string"},
+ {conditions: {min: "2001-01-01 12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The min attribute is an invalid local date time string"},
+ {conditions: {min: "2000-01-01T11:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The min attribute is less than the value attribute"},
+ {conditions: {min: "2001-01-01T23:59:59", value: "2000-01-01T24:00:00"}, expected: false, name: "[target] The value is an invalid local date time string(hour is greater than 23)"},
+ {conditions: {min: "1980-01-01T12:00", value: "79-01-01T12:00"}, expected: false, name: "[target] The value is an invalid local date time string(year is two digits)"},
+ {conditions: {min: "2000-01-01T13:00:00", value: "2000-01-01T12:00:00"}, expected: true, name: "[target] The value is less than min"},
+ {conditions: {min: "2000-01-01T12:00:00.2", value: "2000-01-01T12:00:00.1"}, expected: true, name: "[target] The value is less than min(with millisecond in 1 digit)"},
+ {conditions: {min: "2000-01-01T12:00:00.02", value: "2000-01-01T12:00:00.01"}, expected: true, name: "[target] The value is less than min(with millisecond in 2 digits)"},
+ {conditions: {min: "2000-01-01T12:00:00.002", value: "2000-01-01T12:00:00.001"}, expected: true, name: "[target] The value is less than min(with millisecond in 3 digits)"},
+ {conditions: {min: "10000-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: true, name: "[target] The value is less than min(Year is 10000 should be valid)"},
+ {conditions: {max: "8593-01-01T02:09", value: "8592-01-01T02:09"}, expected: false, name: "[target] The value is greater than max"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["date"],
+ testData: [
+ {conditions: {min: "", value: "2000-01-01"}, expected: false, name: "[target] The min attribute is not set"},
+ {conditions: {min: "2000-01-01", value: ""}, expected: false, name: "[target] Value is empty string"},
+ {conditions: {min: "2001/01/01", value: "2000-01-01"}, expected: false, name: "[target] The min attribute is an invalid date"},
+ {conditions: {min: "2000-02-02", value: "2000-1-1"}, expected: false, name: "[target] The value attribute is an invalid date"},
+ {conditions: {min: "988-01-01", value: "987-01-01"}, expected: false, name: "[target] The value is an invalid date(year is three digits)"},
+ {conditions: {min: "2001-01-01", value: "2000-13-01"}, expected: false, name: "[target] The value is an invalid date(month is less than 12)"},
+ {conditions: {min: "2001-01-01", value: "2000-02-30"}, expected: false, name: "[target] The value is an invalid date(date is less than 29 for Feb)"},
+ {conditions: {min: "2000-01-01", value: "2000-12-01"}, expected: false, name: "[target] The min attribute is less than value attribute"},
+ {conditions: {min: "2000-12-01", value: "2000-01-01"}, expected: true, name: "[target] The value attribute is less than min attribute"},
+ {conditions: {min: "10000-01-01", value: "9999-01-01"}, expected: true, name: "[target] The value attribute is less than min attribute(Year is 10000 should be valid)"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["month"],
+ testData: [
+ {conditions: {min: "", value: "2000-01"}, expected: false, name: "[target] The min attribute is not set"},
+ {conditions: {min: "2000-01", value: ""}, expected: false, name: "[target] Value is empty string"},
+ {conditions: {min: "2001/01", value: "2000-02"}, expected: false, name: "[target] The min attribute is an invalid month string"},
+ {conditions: {min: "2000-02", value: "2000-1"}, expected: false, name: "[target] The value attribute is an invalid month string"},
+ {conditions: {min: "988-01", value: "987-01"}, expected: false, name: "[target] The value is an invalid month string(year is three digits)"},
+ {conditions: {min: "2001-01", value: "2000-13"}, expected: false, name: "[target] The value is an invalid month string(month is less than 12)"},
+ {conditions: {min: "2000-01", value: "2000-12"}, expected: false, name: "[target] The min attribute is less than value attribute"},
+ {conditions: {min: "2001-01", value: "2000-12"}, expected: true, name: "[target] The value attribute is less than min attribute"},
+ {conditions: {min: "10000-01", value: "2000-01"}, expected: true, name: "[target] The value attribute is less than min attribute(Year is 10000 should be valid)"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["week"],
+ testData: [
+ {conditions: {min: "", value: "2000-W01"}, expected: false, name: "[target] The min attribute is not set"},
+ {conditions: {min: "2000-W01", value: ""}, expected: false, name: "[target] Value is empty string"},
+ {conditions: {min: "2001/W02", value: "2000-W01"}, expected: false, name: "[target] The min attribute is an invalid week string"},
+ {conditions: {min: "2001-W02", value: "2000-W1"}, expected: false, name: "[target] The value attribute is an invalid week string"},
+ {conditions: {min: "2001-W02", value: "2000-w01"}, expected: false, name: "[target] The value attribute is an invalid week string(w is in lowercase)"},
+ {conditions: {min: "988-W01", value: "987-W01"}, expected: false, name: "[target] The value is an invalid week string(year is three digits)"},
+ {conditions: {min: "2001-W01", value: "2000-W57"}, expected: false, name: "[target] The value is an invalid week string(week is too greater)"},
+ {conditions: {min: "2000-W01", value: "2000-W12"}, expected: false, name: "[target] The min attribute is less than value attribute"},
+ {conditions: {min: "2000-W12", value: "2000-W01"}, expected: true, name: "[target] The value attribute is less than min attribute"},
+ {conditions: {min: "10000-W01", value: "2000-W01"}, expected: true, name: "[target] The value attribute is less than min attribute(Year is 10000 should be valid)"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["time"],
+ testData: [
+ {conditions: {min: "", value: "12:00:00"}, expected: false, name: "[target] The min attribute is not set"},
+ {conditions: {min: "12:00:00", value: ""}, expected: false, name: "[target] Value is empty string"},
+ {conditions: {min: "12.00.01", value: "12:00:00"}, expected: false, name: "[target] The min attribute is an invalid time string"},
+ {conditions: {min: "12:00:01", value: "12.00.00"}, expected: false, name: "[target] The value attribute is an invalid time string"},
+ {conditions: {min: "12:00:00", value: "13:00:00"}, expected: false, name: "[target] The min attribute is less than value attribute"},
+ {conditions: {min: "13:00:00", value: "12"}, expected: false, name: "[target] The time missing second and minute parts is invalid"},
+ {conditions: {min: "12:00:02", value: "12:00:00"}, expected: true, name: "[target] The value attribute is less than min attribute"},
+ {conditions: {min: "12:00:00.2", value: "12:00:00.1"}, expected: true, name: "[target] The value is less than min(with millisecond in 1 digit)"},
+ {conditions: {min: "12:00:00.02", value: "12:00:00.01"}, expected: true, name: "[target] The value is less than min(with millisecond in 2 digit)"},
+ {conditions: {min: "12:00:00.002", value: "12:00:00.001"}, expected: true, name: "[target] The value is less than min(with millisecond in 3 digit)"},
+ {conditions: {min: "12:00:00", value: "11:59"}, expected: true, name: "[target] The time missing second part is valid"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["number"],
+ testData: [
+ {conditions: {min: "", value: "10"}, expected: false, name: "[target] The min attribute is not set"},
+ {conditions: {min: "5", value: ""}, expected: false, name: "[target] Value is empty string"},
+ {conditions: {min: "4", value: "5"}, expected: false, name: "[target] The min is less than value(integer)"},
+ {conditions: {min: "-5.6", value: "-5.5"}, expected: false, name: "[target] The min is less than value(floating number)"},
+ {conditions: {min: "0", value: "-0"}, expected: false, name: "[target] The min equals to value"},
+ {conditions: {min: "5", value: "6abc"}, expected: false, name: "[target] The value is not a number"},
+ {conditions: {min: "6", value: "5"}, expected: true, name: "[target] The value is less than min(integer)"},
+ {conditions: {min: "-5.4", value: "-5.5"}, expected: true, name: "[target] The value is less than min(floating number)"},
+ {conditions: {min: "5e+2", value: "-5e-1"}, expected: true, name: "[target] The value is less than min(scientific notation)"}
+ ]
+ }
+ ];
+
+ validator.run_test(testElements, "rangeUnderflow");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html
new file mode 100644
index 000000000..174ecaf33
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.validity.stepMismatch</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-validitystate-stepmismatch">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+ //set step = 2 * default step * factor
+ var testElements = [
+ {
+ tag: "input",
+ types: ["date"],
+ testData: [
+ {conditions: {step: "", value: "2000-01-01"}, expected: false, name: "[target] The step attribute is not set"},
+ {conditions: {step: 2, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
+ {conditions: {step: 2, value: "1970-01-03"}, expected: false, name: "[target] The value must match the step"},
+ {conditions: {step: 2, value: "1970-01-02"}, expected: true, name: "[target] The value must mismatch the step"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["month"],
+ testData: [
+ {conditions: {step: "", value: "2000-01"}, expected: false, name: "[target] The step attribute is not set"},
+ {conditions: {step: 2, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
+ {conditions: {step: 2, value: "1970-03"}, expected: false, name: "[target] The value must match the step"},
+ {conditions: {step: 2, value: "1970-04"}, expected: true, name: "[target] The value must mismatch the step"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["week"],
+ testData: [
+ {conditions: {step: "", value: "1970-W01"}, expected: false, name: "[target] The step attribute is not set"},
+ {conditions: {step: 2, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
+ {conditions: {step: 2, value: "1970-W03"}, expected: false, name: "[target] The value must match the step"},
+ {conditions: {step: 2, value: "1970-W04"}, expected: true, name: "[target] The value must mismatch the step"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["time"],
+ testData: [
+ {conditions: {step: "", value: "12:00:00"}, expected: false, name: "[target] The step attribute is not set"},
+ {conditions: {step: 2 * 60, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
+ {conditions: {step: 2 * 60, value: "12:02:00"}, expected: false, name: "[target] The value must match the step"},
+ {conditions: {step: 2 * 60, value: "12:03:00"}, expected: true, name: "[target] The value must mismatch the step"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["datetime-local"],
+ testData: [
+ {conditions: {step: "", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The step attribute is not set"},
+ {conditions: {step: 2 * 60, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
+ {conditions: {step: 2 * 60, value: "1970-01-01T12:02:00"}, expected: false, name: "[target] The value must match the step"},
+ {conditions: {step: 2 * 60, value: "1970-01-01T12:03:00"}, expected: true, name: "[target] The value must mismatch the step"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["number"],
+ testData: [
+ {conditions: {step: "", value: "1"}, expected: false, name: "[target] The step attribute is not set"},
+ {conditions: {step: 2 * 1 * 1, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
+ {conditions: {step: 2 * 1 * 1, value: "2"}, expected: false, name: "[target] The value must match the step"},
+ {conditions: {step: 2 * 1 * 1, value: "3"}, expected: true, name: "[target] The value must mismatch the step"}
+ ]
+ }
+ ];
+
+ validator.run_test(testElements, "stepMismatch");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-tooLong.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-tooLong.html
new file mode 100644
index 000000000..aa787d471
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-tooLong.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.validity.tooLong</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-validitystate-toolong">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+ var testElements = [
+ {
+ tag: "input",
+ types: ["text", "search", "tel", "url", "email", "password"],
+ testData: [ // Non-dirty value
+ {conditions: {maxLength: "", value: "abc"}, expected: false, name: "[target] Non-dirty value - maxlength is not set"},
+ {conditions: {maxLength: "4", value: ""}, expected: false, name: "[target] Non-dirty value - value is empty string"},
+ {conditions: {maxLength: "4", value: "abc"}, expected: false, name: "[target] Non-dirty value - length of value is less than maxlength"},
+ {conditions: {maxLength: "4", value: "abcd"}, expected: false, name: "[target] Non-dirty value - length of value equals to maxlength"},
+ {conditions: {maxLength: "4", value: "abcde"}, expected: false, name: "[target] Non-dirty value - length of value is greater than maxlength"},
+ //Dirty value
+ {conditions: {maxLength: "4", value: "abc"}, expected: false, name: "[target] Dirty value - value is less than maxlength", dirty: true},
+ {conditions: {maxLength: "4", value: "\u0041\u0041\u0041"}, expected: false, name: "[target] Dirty value - length of value(AAA) in unicode is less than maxlength", dirty: true},
+ {conditions: {maxLength: "4", value: "abcd"}, expected: false, name: "[target] Dirty value - value equals to maxlength", dirty: true},
+ // False due to lack of required interactive editing by the user
+ {conditions: {maxLength: "4", value: "abcde"}, expected: false, name: "[target] Dirty value - length of value is greater than maxlength", dirty: true}
+ ]
+ },
+ {
+ tag: "textarea",
+ types: [],
+ testData: [
+ {conditions: {maxLength: "", value: "abc"}, expected: false, name: "[target] Non-dirty value - maxlength is not set"},
+ {conditions: {maxLength: "4", value: ""}, expected: false, name: "[target] Non-dirty value - value is empty string"},
+ {conditions: {maxLength: "4", value: "abc"}, expected: false, name: "[target] Non-dirty value - length of value is less than maxlength"},
+ {conditions: {maxLength: "4", value: "abcd"}, expected: false, name: "[target] Non-dirty value - length of value equals to maxlength"},
+ {conditions: {maxLength: "4", value: "abcde"}, expected: false, name: "[target] Non-dirty value - length of value is greater than maxlength"},
+ //Dirty value
+ {conditions: {maxLength: "4", value: "abc"}, expected: false, name: "[target] Dirty value - value is less than maxlength", dirty: true},
+ {conditions: {maxLength: "4", value: "\u000D\u000A"}, expected: false, name: "[target] Dirty value - length of value(LF, CRLF) in unicode is less than maxlength", dirty: true},
+ {conditions: {maxLength: "4", value: "abcd"}, expected: false, name: "[target] Dirty value - length of value equals to maxlength", dirty: true},
+ // False due to lack of required interactive editing by the user
+ {conditions: {maxLength: "4", value: "abcde"}, expected: false, name: "[target] Dirty value - length of value is greater than maxlength", dirty: true}
+ ]
+ }
+ ];
+
+ validator.run_test (testElements, "tooLong");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-tooShort.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-tooShort.html
new file mode 100644
index 000000000..b6c0e4399
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-tooShort.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.validity.tooShort</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#suffering-from-being-too-short">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+ var testElements = [
+ {
+ tag: "input",
+ types: ["text", "search", "tel", "url", "email", "password"],
+ testData: [
+ // Non-dirty value
+ {conditions: {minLength: "", value: "abc"}, expected: false, name: "[target] Non-dirty value - minLength is not set"},
+ {conditions: {minLength: "4", value: ""}, expected: false, name: "[target] Non-dirty value - value is empty string"},
+ {conditions: {minLength: "4", value: "abcde"}, expected: false, name: "[target] Non-dirty value - length of value is greater than minLength"},
+ {conditions: {minLength: "4", value: "abcd"}, expected: false, name: "[target] Non-dirty value - length of value equals to minLength"},
+ {conditions: {minLength: "4", value: "abc"}, expected: false, name: "[target] Non-dirty value - length of value is less than minLength"},
+ //Dirty value
+ {conditions: {minLength: "4", value: "abcde"}, expected: false, name: "[target] Dirty value - value is greater than minLength", dirty: true},
+ {conditions: {minLength: "4", value: "\u0041\u0041\u0041\u0041\u0041"}, expected: false, name: "[target] Dirty value - length of value(AAAAA) in unicode is greater than minLength", dirty: true},
+ {conditions: {minLength: "4", value: "abcd"}, expected: false, name: "[target] Dirty value - value equals to minLength", dirty: true},
+ // False due to lack of required interactive editing by the user
+ {conditions: {minLength: "4", value: "abc"}, expected: false, name: "[target] Dirty value - length of value is less than minLength", dirty: true}
+ ]
+ },
+ {
+ tag: "textarea",
+ types: [],
+ testData: [
+ // Non-dirty value
+ {conditions: {minLength: "", value: "abc"}, expected: false, name: "[target] Non-dirty value - minLength is no set"},
+ {conditions: {minLength: "4", value: ""}, expected: false, name: "[target] Non-dirty value - value is empty string"},
+ {conditions: {minLength: "4", value: "abcde"}, expected: false, name: "[target] Non-dirty value - length of value is greater than minLength"},
+ {conditions: {minLength: "4", value: "abcd"}, expected: false, name: "[target] Non-dirty value - length of value equals to minLength"},
+ {conditions: {minLength: "4", value: "abc"}, expected: false, name: "[target] Non-dirty value - length of length of value is greater than minLength"},
+ //Dirty value
+ {conditions: {minLength: "4", value: "abcde"}, expected: false, name: "[target] Dirty value - value is less than minLength", dirty: true},
+ {conditions: {minLength: "4", value: "\u000D\u000A\u000D\u000A\u000D\u000A"}, expected: false, name: "[target] Dirty value - length of value(LF, CRLF) in unicode is less than minLength", dirty: true},
+ {conditions: {minLength: "4", value: "abcd"}, expected: false, name: "[target] Dirty value - length of value equals to minLength", dirty: true},
+ // False due to lack of required interactive editing by the user
+ {conditions: {minLength: "4", value: "abc"}, expected: false, name: "[target] Dirty value - length of value is greater than minLength", dirty: true}
+ ]
+ }
+ ];
+
+ validator.run_test (testElements, "tooShort");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-typeMismatch.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-typeMismatch.html
new file mode 100644
index 000000000..40444277c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-typeMismatch.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.validity.typeMismatch</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-validitystate-typemismatch">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+ var testElements = [
+ {
+ tag: "input",
+ types: ["email"],
+ testData: [
+ // multiple is false
+ {conditions: {multiple: false, value: ""}, expected: false, name: "[target] The value is empty"},
+ {conditions: {multiple: false, value: "test@example.com"}, expected: false, name: "[target] The value is a valid email address"},
+ {conditions: {multiple: false, value: "\u000A\u000D\u0020\u0009 test@example.com \u000A\u000D\u0020\u0009"}, expected: false, name: "[target] The value is a valid email address with some white spaces."},
+ {conditions: {multiple: false, value: "abc"}, expected: true, name: "[target] The value is not an email address"},
+ {conditions: {multiple: false, value: "test1@example.com,test2@example.com"}, expected: true, name: "[target] The value contains multiple email addresses"},
+ //multiple is true
+ {conditions: {multiple: true, value: "test1@example.com,test2@example.com"}, expected: false, name: "[target] The value is valid email addresses"},
+ {conditions: {multiple: true, value: "test1@example.com;test2@example.com"}, expected: true, name: "[target] The value contains invalid separator"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["url"],
+ testData: [
+ {conditions: {multiple: false, value: ""}, expected: false, name: "[target] The value is empty"},
+ {conditions: {multiple: false, value: "http://www.example.com"}, expected: false, name: "[target] The value is a valid url"},
+ {conditions: {multiple: false, value: "\u000A\u000D\u0020\u0009 http://www.example.com \u000A\u000D\u0020\u0009 "}, expected: false, name: "[target] The value is a valid url with some white spaces."},
+ {conditions: {multiple: false, value: "abc"}, expected: true, name: "[target] The value is not an url"}
+ ]
+ }
+ ];
+
+ validator.run_test(testElements, "typeMismatch");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-valid.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-valid.html
new file mode 100644
index 000000000..5dacfeae3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-valid.html
@@ -0,0 +1,130 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.validity.valid</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-validitystate-valid">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+ var testElements = [
+ {
+ tag: "input",
+ types: ["text", "search", "tel", "password"],
+ testData: [
+ {conditions: {pattern: "[A-Z]", value: "abc"}, expected: false, name: "[target] validity.valid must be false if validity.patternMismatch is true"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["url"],
+ testData: [
+ {conditions: {pattern: "http://www.example.com", value: "http://www.example.net"}, expected: false, name: "[target] validity.valid must be false if validity.patternMismatch is true"},
+ {conditions: {value: "abc"}, expected: false, name: "[target] validity.valid must be false if validity.typeMismatch is true"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["email"],
+ testData: [
+ {conditions: {pattern: "test@example.com", value: "test@example.net"}, expected: false, name: "[target] validity.valid must be false if validity.patternMismatch is true"},
+ {conditions: {value: "abc"}, expected: false, name: "[target] validity.valid must be false if validity.typeMismatch is true"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["datetime-local"],
+ testData: [
+ {conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
+ {conditions: {min: "2001-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
+ {conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["date"],
+ testData: [
+ {conditions: {max: "2000-01-01", value: "2001-01-01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
+ {conditions: {min: "2001-01-01", value: "2000-01-01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
+ {conditions: {step: 2 * 1 * 86400000, value: "2000-01-03"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["month"],
+ testData: [
+ {conditions: {max: "2000-01", value: "2001-01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
+ {conditions: {min: "2001-01", value: "2000-01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
+ {conditions: {step: 2 * 1 * 1, value: "2001-03"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["week"],
+ testData: [
+ {conditions: {max: "2000-W01", value: "2001-W01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
+ {conditions: {min: "2001-W01", value: "2000-W01"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
+ {conditions: {step: 2 * 1 * 604800000, value: "2001-W03"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["time"],
+ testData: [
+ {conditions: {max: "12:00:00", value: "13:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
+ {conditions: {min: "12:00:00", value: "11:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
+ {conditions: {step: 2 * 60 * 1000, value: "12:03:00"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["number"],
+ testData: [
+ {conditions: {max: "5", value: "6"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
+ {conditions: {min: "5", value: "4"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
+ {conditions: {step: 2 * 1 * 1, value: "3"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["checkbox", "radio"],
+ testData: [
+ {conditions: {required: true, checked: false, name: "test1"}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["file"],
+ testData: [
+ {conditions: {required: true, files: null}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ },
+ {
+ tag: "select",
+ types: [],
+ testData: [
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ },
+ {
+ tag: "textarea",
+ types: [],
+ testData: [
+ {conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
+ ]
+ }
+ ];
+
+ validator.run_test(testElements, "isValid");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-valueMissing.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-valueMissing.html
new file mode 100644
index 000000000..3c9e4c4cb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-validity-valueMissing.html
@@ -0,0 +1,168 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.validity.valueMissing</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-validitystate-valuemissing">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+ var testElements = [
+ {
+ tag: "input",
+ types: ["text", "search", "tel", "url", "email", "password"],
+ testData: [
+ {conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
+ {conditions: {required: true, value: "abc"}, expected: false, name: "[target] The value is not empty and required is true"},
+ {conditions: {required: true, value: ""}, expected: true, name: "[target] The value is empty and required is true"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["datetime-local"],
+ testData: [
+ {conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
+ {conditions: {required: true, value: "2000-12-10T12:00:00"}, expected: false, name: "[target] Valid local date and time string(2000-12-10T12:00:00)"},
+ {conditions: {required: true, value: "2000-12-10 12:00"}, expected: false, name: "[target] Valid local date and time string(2000-12-10 12:00)"},
+ {conditions: {required: true, value: "1979-10-14T12:00:00.001"}, expected: false, name: "[target] Valid local date and time string(1979-10-14T12:00:00.001)"},
+ {conditions: {required: true, value: 1234567}, expected: true, name: "[target] The value attribute is a number(1234567)"},
+ {conditions: {required: true, value: new Date()}, expected: true, name: "[target] The value attribute is a Date object"},
+ {conditions: {required: true, value: "1979-10-99 99:99"}, expected: true, name: "[target] Invalid local date and time string(1979-10-99 99:99)"},
+ {conditions: {required: true, value: "1979-10-14 12:00:00"}, expected: false, name: "[target] Valid local date and time string(1979-10-14 12:00:00)"},
+ {conditions: {required: true, value: "2001-12-21 12:00"}, expected: true, name: "[target] Invalid local date and time string(2001-12-21 12:00)-two white space"},
+ {conditions: {required: true, value: "abc"}, expected: true, name: "[target] the value attribute is a string(abc)"},
+ {conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["date"],
+ testData: [
+ {conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
+ {conditions: {required: true, value: "2000-12-10"}, expected: false, name: "[target] Valid date string(2000-12-10)"},
+ {conditions: {required: true, value: "9999-01-01"}, expected: false, name: "[target] Valid date string(9999-01-01)"},
+ {conditions: {required: true, value: 1234567}, expected: true, name: "[target] The value attribute is a number(1234567)"},
+ {conditions: {required: true, value: new Date()}, expected: true, name: "[target] The value attribute is a Date object"},
+ {conditions: {required: true, value: "9999-99-99"}, expected: true, name: "[target] Invalid date string(9999-99-99)"},
+ {conditions: {required: true, value: "37/01/01"}, expected: true, name: "[target] Invalid date string(37-01-01)"},
+ {conditions: {required: true, value: "2000/01/01"}, expected: true, name: "[target] Invalid date string(2000/01/01)"},
+ {conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["month"],
+ testData: [
+ {conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
+ {conditions: {required: true, value: "2000-12"}, expected: false, name: "[target] Valid month string(2000-12)"},
+ {conditions: {required: true, value: "9999-01"}, expected: false, name: "[target] Valid month string(9999-01)"},
+ {conditions: {required: true, value: 1234567}, expected: true, name: "[target] The value attribute is a number(1234567)"},
+ {conditions: {required: true, value: new Date()}, expected: true, name: "[target] The value attribute is a Date object"},
+ {conditions: {required: true, value: "2000-99"}, expected: true, name: "[target] Invalid month string(2000-99)"},
+ {conditions: {required: true, value: "37-01"}, expected: true, name: "[target] Invalid month string(37-01)"},
+ {conditions: {required: true, value: "2000/01"}, expected: true, name: "[target] Invalid month string(2000/01)"},
+ {conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["week"],
+ testData: [
+ {conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
+ {conditions: {required: true, value: "2000-W12"}, expected: false, name: "[target] Valid week string(2000-W12)"},
+ {conditions: {required: true, value: "9999-W01"}, expected: false, name: "[target] Valid week string(9999-W01)"},
+ {conditions: {required: true, value: 1234567}, expected: true, name: "[target] The value attribute is a number(1234567)"},
+ {conditions: {required: true, value: new Date()}, expected: true, name: "[target] The value attribute is a Date object"},
+ {conditions: {required: true, value: "2000-W99"}, expected: true, name: "[target] Invalid week string(2000-W99)"},
+ {conditions: {required: true, value: "2000-W00"}, expected: true, name: "[target] invalid week string(2000-W00)"},
+ {conditions: {required: true, value: "2000-w01"}, expected: true, name: "[target] invalid week string(2000-w01)"},
+ {conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["time"],
+ testData: [
+ {conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
+ {conditions: {required: true, value: "12:00:00"}, expected: false, name: "[target] Validtime string(12:00:00)"},
+ {conditions: {required: true, value: "12:00"}, expected: false, name: "[target] Validtime string(12:00)"},
+ {conditions: {required: true, value: "12:00:00.001"}, expected: false, name: "[target] Valid time string(12:00:60.001)"},
+ {conditions: {required: true, value: "12:00:00.01"}, expected: false, name: "[target] Valid time string(12:00:60.01)"},
+ {conditions: {required: true, value: "12:00:00.1"}, expected: false, name: "[target] Valid time string(12:00:60.1)"},
+ {conditions: {required: true, value: 1234567}, expected: true, name: "[target] The value attribute is a number(1234567)"},
+ {conditions: {required: true, value: new Date()}, expected: true, name: "[target] The value attribute is a time object"},
+ {conditions: {required: true, value: "25:00:00"}, expected: true, name: "[target] Invalid time string(25:00:00)"},
+ {conditions: {required: true, value: "12:60:00"}, expected: true, name: "[target] Invalid time string(12:60:00)"},
+ {conditions: {required: true, value: "12:00:60"}, expected: true, name: "[target] Invalid time string(12:00:60)"},
+ {conditions: {required: true, value: "12:00:00:001"}, expected: true, name: "[target] Invalid time string(12:00:00:001)"},
+ {conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["number"],
+ testData: [
+ {conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
+ {conditions: {required: true, value: "123"}, expected: false, name: "[target] Value is an integer with a leading symbol '+'"},
+ {conditions: {required: true, value: "-123.45"}, expected: false, name: "[target] Value is a number with a '-' symbol"},
+ {conditions: {required: true, value: "123.01e-10"}, expected: false, name: "[target] Value is a number in scientific notation form(e is in lowercase)"},
+ {conditions: {required: true, value: "123.01E+10"}, expected: false, name: "[target] Value is a number in scientific notation form(E is in uppercase)"},
+ {conditions: {required: true, value: "-0"}, expected: false, name: "[target] Value is -0"},
+ {conditions: {required: true, value: " 123 "}, expected: true, name: "[target] Value is a number with some white spaces"},
+ {conditions: {required: true, value: Math.pow(2, 1024)}, expected: true, name: "[target] Value is Math.pow(2, 1024)"},
+ {conditions: {required: true, value: Math.pow(-2, 1024)}, expected: true, name: "[target] Value is Math.pow(-2, 1024)"},
+ {conditions: {required: true, value: "abc"}, expected: true, name: "[target] Value is a string that cannot be converted to a number"},
+ {conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["checkbox"],
+ testData: [
+ {conditions: {required: false, checked: false, name: "test1"}, expected: false, name: "[target] The required attribute is not set"},
+ {conditions: {required: true, checked: true, name: "test2"}, expected: false, name: "[target] The checked attribute is true"},
+ {conditions: {required: true, checked: false, name: "test3"}, expected: true, name: "[target] The checked attribute is false"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["radio"],
+ testData: [
+ {conditions: {required: false, checked: false, name: "test4"}, expected: false, name: "[target] The required attribute is not set"},
+ {conditions: {required: true, checked: true, name: "test5"}, expected: false, name: "[target] The checked attribute is true"},
+ {conditions: {required: true, checked: false, name: "test6"}, expected: true, name: "[target] The checked attribute is false"}
+ ]
+ },
+ {
+ tag: "input",
+ types: ["file"],
+ testData: [
+ {conditions: {required: false, files: null}, expected: false, name: "[target] The required attribute is not set"},
+ {conditions: {required: true, files: null}, expected: true, name: "[target] The Files attribute is null"}
+ //ToDo: Add a case to test the files is not null
+ ]
+ },
+ {
+ tag: "select",
+ types: [],
+ testData: [
+ {conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
+ {conditions: {required: true, value: 1}, expected: false, name: "[target] Selected the option with value equals to 1"},
+ {conditions: {required: true, value: ""}, expected: true, name: "[target] Selected the option with value equals to empty"}
+ ]
+ },
+ {
+ tag: "textarea",
+ types: [],
+ testData: [
+ {conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
+ {conditions: {required: true, value: "abc"}, expected: false, name: "[target] The value is not empty"},
+ {conditions: {required: true, value: ""}, expected: true , name: "[target] The value is empty"}
+ ]
+ }
+ ];
+
+ validator.run_test(testElements, "valueMissing");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-willValidate.html b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-willValidate.html
new file mode 100644
index 000000000..237572b0f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/form-validation-willValidate.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>The constraint validation API Test: element.willValidate</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-cva-willvalidate">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/validator.js"></script>
+<div id="log"></div>
+<script>
+ var testElements = [
+ //input in hidden, button and reset status must be barred from the constraint validation
+ {
+ tag: "input",
+ types: ["hidden", "button", "reset"],
+ testData: [{conditions: {}, expected: false, name: "[target] Must be barred from the constraint validation"}]
+ },
+ //button in button and reset status must be barred from the constraint validation
+ {
+ tag: "button",
+ types: ["button", "reset"],
+ testData: [{conditions: {}, expected: false, name: "[target] Must be barred from the constraint validation"}]
+ },
+ //FIELDSET, OUTPUT elements should not be barred from the constraint validation
+ {
+ tag: "fieldset",
+ types: [],
+ testData: [{conditions: {}, expected: true, name: "[target] Must not be barred from the constraint validation"}]
+ },
+ {
+ tag: "output",
+ types: [],
+ testData: [{conditions: {}, expected: true, name: "[target] Must not be barred from the constraint validation"}]
+ },
+ //OBJECT, KEYGEN, elements must be barred from the constraint validation
+ {
+ tag: "object",
+ types: [],
+ testData: [{conditions: {}, expected: false, name: "[target] Must be barred from the constraint validation"}]
+ },
+ {
+ tag: "keygen",
+ types: [],
+ testData: [{conditions: {}, expected: false, name: "[target] Must be barred from the constraint validation"}]
+ },
+ //If an element is disabled, it is barred from constraint validation.
+ //The willValidate attribute must be true if an element is mutable
+ //If the readonly attribute is specified on an INPUT element, the element is barred from constraint validation.
+ {
+ tag: "input",
+ types: ["text", "search", "tel", "url", "email", "password", "datetime-local", "date", "month", "week", "time", "color", "file", "submit"],
+ testData: [
+ {conditions: {disabled: true}, expected: false, name: "[target] Must be barred from the constraint validation if it is disabled"},
+ {conditions: {disabled: false, readOnly: false}, expected: true, name: "[target] The willValidate attribute must be true if an element is mutable"},
+ {conditions: {readOnly: true}, expected: false, name: "[target] Must be barred from the constraint validation if it is readonly"},
+ {conditions: {disabled: false, readOnly: false}, expected: false, name: "[target] The willValidate attribute must be false if it has a datalist ancestor", ancestor: "datalist"},
+ ]
+ },
+ {
+ tag: "button",
+ types: ["submit"],
+ testData: [
+ {conditions: {disabled: true}, expected: false, name: "[target] Must be barred from the constraint validation"},
+ {conditions: {disabled: false}, expected: true, name: "[target] The willValidate attribute must be true if an element is mutable"},
+ {conditions: {disabled: false}, expected: false, name: "[target] The willValidate attribute must be false if it has a datalist ancestor", ancestor: "datalist"}
+ ]
+ },
+ {
+ tag: "select",
+ types: [],
+ testData: [
+ {conditions: {disabled: true}, expected: false, name: "[target] Must be barred from the constraint validation"},
+ {conditions: {disabled: false}, expected: true, name: "[target] The willValidate attribute must be true if an element is mutable"},
+ {conditions: {disabled: false}, expected: false, name: "[target] The willValidate attribute must be false if it has a datalist ancestor", ancestor: "datalist"}
+ ]
+ },
+ {
+ tag: "textarea",
+ types: [],
+ testData: [,
+ {conditions: {disabled: true}, expected: false, name: "[target] Must be barred from the constraint validation"},
+ {conditions: {disabled: false}, expected: true, name: "[target] The willValidate attribute must be true if an element is mutable"},
+ {conditions: {disabled: false}, expected: false, name: "[target] The willValidate attribute must be false if it has a datalist ancestor", ancestor: "datalist"}
+ ]
+ }
+ ];
+
+ validator.run_test(testElements, "willValidate");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/inputwillvalidate.html b/testing/web-platform/tests/html/semantics/forms/constraints/inputwillvalidate.html
new file mode 100644
index 000000000..909fd889b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/inputwillvalidate.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html><head>
+ <title>willValidate property on the input element</title>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type">
+ <meta content="willValidate property on the input element" name="description">
+ <link href="https://html.spec.whatwg.org/multipage/#dom-cva-willvalidate" rel="help">
+ </head>
+ <body>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+
+ <div id="log"></div>
+
+ <form action="http://www.example.com/" style="display : none">
+ <input required="" type="text">
+ <input disabled="" type="text">
+ </form>
+
+ <script type="text/javascript">
+
+ test(function() {assert_true(document.getElementsByTagName("input")[0].willValidate)}, "willValidate property returns true when required attribute exists");
+ test(function() {assert_false(document.getElementsByTagName("input")[1].willValidate)}, "willValidate property returns false when disabled attribute exists");
+
+ </script>
+
+</body></html>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/support/validator.js b/testing/web-platform/tests/html/semantics/forms/constraints/support/validator.js
new file mode 100644
index 000000000..e969ce460
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/support/validator.js
@@ -0,0 +1,377 @@
+var validator = {
+ test_tooLong: function(ctl, data) {
+ var self = this;
+ test(function () {
+ self.pre_check(ctl, "tooLong");
+ self.set_conditions(ctl, data.conditions);
+ if (data.dirty)
+ self.set_dirty(ctl);
+
+ if (data.expected)
+ assert_true(ctl.validity.tooLong, "The validity.tooLong should be true.");
+ else
+ assert_false(ctl.validity.tooLong, "The validity.tooLong should be false.");
+ }, data.name);
+ },
+
+ test_tooShort: function(ctl, data) {
+ var self = this;
+ test(function () {
+ self.pre_check(ctl, "tooShort");
+ self.set_conditions(ctl, data.conditions);
+ if (data.dirty)
+ self.set_dirty(ctl);
+
+ if (data.expected)
+ assert_true(ctl.validity.tooShort, "The validity.tooShort should be true.");
+ else
+ assert_false(ctl.validity.tooShort, "The validity.tooShort should be false.");
+ }, data.name);
+ },
+
+ test_patternMismatch: function(ctl, data) {
+ var self = this;
+ test(function () {
+ self.pre_check(ctl, "patternMismatch");
+ self.set_conditions(ctl, data.conditions);
+
+ if (data.expected)
+ assert_true(ctl.validity.patternMismatch, "The validity.patternMismatch should be true.");
+ else
+ assert_false(ctl.validity.patternMismatch, "The validity.patternMismatch should be false.");
+ }, data.name);
+ },
+
+ test_valueMissing: function(ctl, data) {
+ var self = this;
+ test(function () {
+ self.pre_check(ctl, "valueMissing");
+ self.set_conditions(ctl, data.conditions);
+ if (data.expected)
+ assert_true(ctl.validity.valueMissing, "The validity.valueMissing should be true.");
+ else
+ assert_false(ctl.validity.valueMissing, "The validity.valueMissing should be false.");
+ }, data.name);
+ },
+
+ test_typeMismatch: function(ctl, data) {
+ var self = this;
+ test(function () {
+ self.pre_check(ctl, "typeMismatch");
+ self.set_conditions(ctl, data.conditions);
+
+ if (data.expected)
+ assert_true(ctl.validity.typeMismatch, "The validity.typeMismatch should be true.");
+ else
+ assert_false(ctl.validity.typeMismatch, "The validity.typeMismatch should be false.");
+ }, data.name);
+ },
+
+ test_rangeOverflow: function(ctl, data) {
+ var self = this;
+ test(function () {
+ self.pre_check(ctl, "rangeOverflow");
+ self.set_conditions(ctl, data.conditions);
+
+ if (data.expected)
+ assert_true(ctl.validity.rangeOverflow, "The validity.rangeOverflow should be true.");
+ else
+ assert_false(ctl.validity.rangeOverflow, "The validity.rangeOverflow should be false.");
+ }, data.name);
+ },
+
+ test_rangeUnderflow: function(ctl, data) {
+ var self = this;
+ test(function () {
+ self.pre_check(ctl, "rangeUnderflow");
+ self.set_conditions(ctl, data.conditions);
+ if (data.expected)
+ assert_true(ctl.validity.rangeUnderflow, "The validity.rangeUnderflow should be true.");
+ else
+ assert_false(ctl.validity.rangeUnderflow, "The validity.rangeUnderflow should be false.");
+ }, data.name);
+ },
+
+ test_stepMismatch: function(ctl, data) {
+ var self = this;
+ test(function () {
+ self.pre_check(ctl, "stepMismatch");
+ self.set_conditions(ctl, data.conditions);
+
+ if (data.expected)
+ assert_true(ctl.validity.stepMismatch, "The validity.stepMismatch should be true.");
+ else
+ assert_false(ctl.validity.stepMismatch, "The validity.stepMismatch should be false.");
+ }, data.name);
+ },
+
+ test_badInput: function(ctl, data) {
+ var self = this;
+ test(function () {
+ self.pre_check(ctl, "badInput");
+ self.set_conditions(ctl, data.conditions);
+
+ if (data.expected)
+ assert_true(ctl.validity.badInput, "The validity.badInput should be true.");
+ else
+ assert_false(ctl.validity.badInput, "The validity.badInput should be false.");
+ }, data.name);
+ },
+
+ test_customError: function(ctl, data) {
+ var self = this;
+ test(function () {
+ self.pre_check(ctl, "customError");
+ ctl.setCustomValidity(data.conditions.message);
+
+ if (data.expected) {
+ assert_true(ctl.validity.customError, "The validity.customError attribute should be true.");
+ assert_equals(ctl.validationMessage, data.conditions.message,
+ "The validationMessage attribute should be '" + data.conditions.message + "'.");
+ } else {
+ assert_false(ctl.validity.customError, "The validity.customError attribute should be false.");
+ assert_equals(ctl.validationMessage, "", "The validationMessage attribute must be empty.");
+ }
+ }, data.name);
+ },
+
+ test_isValid: function (ctl, data) {
+ var self = this;
+ test(function () {
+ self.set_conditions(ctl, data.conditions);
+ if (data.dirty)
+ self.set_dirty(ctl);
+
+ if (data.expected)
+ assert_true(ctl.validity.valid, "The validity.valid should be true.");
+ else
+ assert_false(ctl.validity.valid, "The validity.valid should be false.");
+ }, data.name);
+ },
+
+ test_willValidate: function(ctl, data) {
+ var self = this;
+ test(function () {
+ self.pre_check(ctl, "willValidate");
+ self.set_conditions(ctl, data.conditions);
+ if (data.ancestor) {
+ var dl = document.createElement("datalist");
+ dl.appendChild(ctl);
+ }
+
+ if (data.expected)
+ assert_true(ctl.willValidate, "The willValidate attribute should be true.");
+ else
+ assert_false(ctl.willValidate, "The willValidate attribute should be false.");
+ }, data.name);
+ },
+
+ test_checkValidity: function (ctl, data) {
+ var self = this;
+ test(function () {
+ var eventFired = false;
+ self.pre_check(ctl, "checkValidity");
+ self.set_conditions(ctl, data.conditions);
+ if (data.dirty)
+ self.set_dirty(ctl);
+
+ on_event(ctl, "invalid", function(e){
+ assert_equals(e.type, "invalid", "The invalid event should be fired.");
+ eventFired = true;
+ });
+
+ if (data.expected) {
+ assert_true(ctl.checkValidity(), "The checkValidity method should be true.");
+ assert_false(eventFired, "The invalid event should not be fired.");
+ } else {
+ assert_false(ctl.checkValidity(), "The checkValidity method should be false.");
+ assert_true(eventFired, "The invalid event should be fired.");
+ }
+ }, data.name);
+
+ test(function () {
+ var fm = document.createElement("form");
+ var ctl2 = ctl.cloneNode(true);
+
+ self.pre_check(ctl, "checkValidity");
+ self.set_conditions(ctl2, data.conditions);
+ fm.appendChild(ctl2);
+ document.body.appendChild(fm);
+ if (data.dirty)
+ self.set_dirty(ctl2);
+
+ var result = fm.checkValidity();
+ document.body.removeChild(fm);
+
+ if (data.expected)
+ assert_true(result, "The checkValidity method of the element's form owner should return true.");
+ else
+ assert_false(result, "The checkValidity method of the element's form owner should return false.");
+ }, data.name + " (in a form)");
+ },
+
+ test_reportValidity: function (ctl, data) {
+ var self = this;
+ test(function () {
+ var eventFired = false;
+
+ self.pre_check(ctl, "reportValidity");
+ self.set_conditions(ctl, data.conditions);
+ if (data.dirty)
+ self.set_dirty(ctl);
+
+ on_event(ctl, "invalid", function(e){
+ assert_equals(e.type, "invalid", "The invalid event should be fired.");
+ eventFired = true;
+ });
+
+ if (data.expected) {
+ assert_true(ctl.reportValidity(), "The reportValidity method should be true.");
+ assert_false(eventFired, "The invalid event should not be fired.");
+ } else {
+ assert_false(ctl.reportValidity(), "The reportValidity method should be false.");
+ assert_true(eventFired, "The invalid event should be fired.");
+ }
+ }, data.name);
+
+ test(function () {
+ var fm = document.createElement("form");
+ var ctl2 = ctl.cloneNode(true);
+
+ self.pre_check(ctl, "reportValidity");
+ self.set_conditions(ctl2, data.conditions);
+ fm.appendChild(ctl2);
+ document.body.appendChild(fm);
+ if (data.dirty)
+ self.set_dirty(ctl2);
+
+ var result = fm.reportValidity();
+ document.body.removeChild(fm);
+
+ if (data.expected)
+ assert_true(result, "The reportValidity method of the element's form owner should return true.");
+ else
+ assert_false(result, "The reportValidity method of the element's form owner should return false.");
+ }, data.name + " (in a form)");
+ },
+
+ test_support_type: function (ctl, typ, testName) {
+ test(function () {
+ assert_equals(ctl.type, typ, "The " + typ + " type should be supported.");
+ }, testName);
+ },
+
+ set_conditions: function (ctl, obj) {
+ [
+ "checked",
+ "disabled",
+ "max",
+ "maxlength",
+ "min",
+ "minlength",
+ "multiple",
+ "pattern",
+ "required",
+ "selected",
+ "step",
+ "value"
+ ].forEach(function(item) {
+ ctl.removeAttribute(item);
+ });
+ for (var attr in obj) {
+ if (attr === "checked" || obj[attr] || obj[attr] === "")
+ ctl[attr] = obj[attr];
+ }
+ },
+
+ set_dirty: function(ctl) {
+ ctl.focus();
+ var old_value = ctl.value;
+ ctl.value = "a";
+ ctl.value = old_value;
+ },
+
+ pre_check: function(ctl, item) {
+ switch (item) {
+ case "willValidate":
+ assert_true(item in ctl, "The " + item + " attribute doesn't exist.");
+ break;
+ case "checkValidity":
+ case "reportValidity":
+ assert_true(item in ctl, "The " + item + " method doesn't exist.");
+ break;
+ case "tooLong":
+ case "tooShort":
+ case "patternMismatch":
+ case "typeMismatch":
+ case "stepMismatch":
+ case "rangeOverflow":
+ case "rangeUnderflow":
+ case "valueMissing":
+ case "badInput":
+ case "valid":
+ assert_true("validity" in ctl, "The validity attribute doesn't exist.");
+ assert_true(item in ctl.validity, "The " + item + " attribute doesn't exist.");
+ break;
+ case "customError":
+ assert_true("validity" in ctl, "The validity attribute doesn't exist.");
+ assert_true("setCustomValidity" in ctl, "The validity attribute doesn't exist.");
+ assert_true("validationMessage" in ctl, "The validity attribute doesn't exist.");
+ assert_true(item in ctl.validity, "The " + item + " attribute doesn't exist.");
+ break;
+ }
+ },
+
+ run_test: function (testee, method) {
+ var testMethod = "test_" + method;
+ if (typeof this[testMethod] !== "function") {
+ return false;
+ }
+
+ var ele = null,
+ prefix = "";
+
+ for (var i = 0; i < testee.length; i++) {
+ if (testee[i].types.length > 0) {
+ for (var typ in testee[i].types) {
+ ele = document.createElement(testee[i].tag);
+ document.body.appendChild(ele);
+ try {
+ ele.type = testee[i].types[typ];
+ } catch (e) {
+ //Do nothing, avoid the runtime error breaking the test
+ }
+
+ prefix = "[" + testee[i].tag.toUpperCase() + " in " + testee[i].types[typ].toUpperCase() + " status] ";
+ if (ele.type != testee[i].types[typ]) {
+ this.test_support_type(
+ ele,
+ testee[i].types[typ],
+ prefix + "The " + testee[i].types[typ] + " type must be supported."
+ );
+ continue;
+ }
+
+ for (var j = 0; j < testee[i].testData.length; j++) {
+ testee[i].testData[j].name = testee[i].testData[j].name.replace(/\[.*\]\s/g, prefix);
+ this[testMethod](ele, testee[i].testData[j]);
+ }
+ }
+ } else {
+ ele = document.createElement(testee[i].tag);
+ document.body.appendChild(ele);
+ prefix = "[" + testee[i].tag + "] ";
+
+ if (testElements[i].tag === "select") {
+ ele.add(new Option("test1", ""));
+ ele.add(new Option("test2", 1));
+ }
+
+ for (var item in testee[i].testData) {
+ testee[i].testData[item].name = testee[i].testData[item].name.replace("[target]", prefix);
+ this[testMethod](ele, testee[i].testData[item]);
+ }
+ }
+ }
+ }
+}
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-email-delete-manual.html b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-email-delete-manual.html
new file mode 100644
index 000000000..008089f39
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-email-delete-manual.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>input[type="email"], ValidityState.tooLong and user editing</title>
+ <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#limiting-user-input-length:-the-maxlength-attribute">
+ <meta name="flags" content="interact">
+ <meta name="assert" content="Per the 'Constraint validation' definition in the referenced section, an input whose value was edited by the user but still exceeds the input's maxlength should suffer from being too long.">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p>Delete one character from the following text input:</p>
+ <input type="email" value="jane.doe@example.com" maxlength="5" autocomplete="off" id="testinput">
+
+ <div id="log"></div>
+ <script>
+var input = document.getElementById('testinput');
+setup({explicit_timeout: true, explicit_done: true});
+on_event(input, "input", function () {
+ test(function() {
+ assert_class_string(input.validity, 'ValidityState', 'HTMLInputElement.validity must be a ValidityState instance');
+ assert_true(input.validity.tooLong, "tooLong must be true since the user just changed the input's value and the value exceeds the maxlength");
+ });
+ done();
+});
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-password-delete-manual.html b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-password-delete-manual.html
new file mode 100644
index 000000000..353d9466d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-password-delete-manual.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>input[type="password"], ValidityState.tooLong and user editing</title>
+ <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#limiting-user-input-length:-the-maxlength-attribute">
+ <meta name="flags" content="interact">
+ <meta name="assert" content="Per the 'Constraint validation' definition in the referenced section, an input whose value was edited by the user but still exceeds the input's maxlength should suffer from being too long.">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p>Delete one character from the following text input:</p>
+ <input type="password" value="swordfish" maxlength="5" autocomplete="off" id="testinput">
+
+ <div id="log"></div>
+ <script>
+var input = document.getElementById('testinput');
+setup({explicit_timeout: true, explicit_done: true});
+on_event(input, "input", function () {
+ test(function() {
+ assert_class_string(input.validity, 'ValidityState', 'HTMLInputElement.validity must be a ValidityState instance');
+ assert_true(input.validity.tooLong, "tooLong must be true since the user just changed the input's value and the value exceeds the maxlength");
+ });
+ done();
+});
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-search-delete-manual.html b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-search-delete-manual.html
new file mode 100644
index 000000000..73be3b6d8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-search-delete-manual.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>input[type="search"], ValidityState.tooLong and user editing</title>
+ <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#limiting-user-input-length:-the-maxlength-attribute">
+ <meta name="flags" content="interact">
+ <meta name="assert" content="Per the 'Constraint validation' definition in the referenced section, an input whose value was edited by the user but still exceeds the input's maxlength should suffer from being too long.">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p>Delete one character from the following text input:</p>
+ <input type="search" value="abcdefghi" maxlength="5" autocomplete="off" id="testinput">
+
+ <div id="log"></div>
+ <script>
+var input = document.getElementById('testinput');
+setup({explicit_timeout: true, explicit_done: true});
+on_event(input, "input", function () {
+ test(function() {
+ assert_class_string(input.validity, 'ValidityState', 'HTMLInputElement.validity must be a ValidityState instance');
+ assert_true(input.validity.tooLong, "tooLong must be true since the user just changed the input's value and the value exceeds the maxlength");
+ });
+ done();
+});
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-tel-delete-manual.html b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-tel-delete-manual.html
new file mode 100644
index 000000000..bf7682af3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-tel-delete-manual.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>input[type="tel"], ValidityState.tooLong and user editing</title>
+ <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#limiting-user-input-length:-the-maxlength-attribute">
+ <meta name="flags" content="interact">
+ <meta name="assert" content="Per the 'Constraint validation' definition in the referenced section, an input whose value was edited by the user but still exceeds the input's maxlength should suffer from being too long.">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p>Delete one character from the following text input:</p>
+ <input type="tel" value="123-456-7890" maxlength="7" autocomplete="off" id="testinput">
+
+ <div id="log"></div>
+ <script>
+var input = document.getElementById('testinput');
+setup({explicit_timeout: true, explicit_done: true});
+on_event(input, "input", function () {
+ test(function() {
+ assert_class_string(input.validity, 'ValidityState', 'HTMLInputElement.validity must be a ValidityState instance');
+ assert_true(input.validity.tooLong, "tooLong must be true since the user just changed the input's value and the value exceeds the maxlength");
+ });
+ done();
+});
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-text-delete-manual.html b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-text-delete-manual.html
new file mode 100644
index 000000000..2eea2b724
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-text-delete-manual.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>input[type="text"], ValidityState.tooLong and user editing</title>
+ <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#limiting-user-input-length:-the-maxlength-attribute">
+ <meta name="flags" content="interact">
+ <meta name="assert" content="Per the 'Constraint validation' definition in the referenced section, an input whose value was edited by the user but still exceeds the input's maxlength should suffer from being too long.">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p>Delete one character from the following text input:</p>
+ <input type="text" value="0123456789" maxlength="5" autocomplete="off" id="testinput">
+
+ <div id="log"></div>
+ <script>
+var input = document.getElementById('testinput');
+setup({explicit_timeout: true, explicit_done: true});
+on_event(input, "input", function () {
+ test(function() {
+ assert_class_string(input.validity, 'ValidityState', 'HTMLInputElement.validity must be a ValidityState instance');
+ assert_true(input.validity.tooLong, "tooLong must be true since the user just changed the input's value and the value exceeds the maxlength");
+ });
+ done();
+});
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-url-delete-manual.html b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-url-delete-manual.html
new file mode 100644
index 000000000..17039a71a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-input-url-delete-manual.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>input[type="url"], ValidityState.tooLong and user editing</title>
+ <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#limiting-user-input-length:-the-maxlength-attribute">
+ <meta name="flags" content="interact">
+ <meta name="assert" content="Per the 'Constraint validation' definition in the referenced section, an input whose value was edited by the user but still exceeds the input's maxlength should suffer from being too long.">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p>Delete one character from the following text input:</p>
+ <input type="url" value="http://example.com/foo" maxlength="12" autocomplete="off" id="testinput">
+
+ <div id="log"></div>
+ <script>
+var input = document.getElementById('testinput');
+setup({explicit_timeout: true, explicit_done: true});
+on_event(input, "input", function () {
+ test(function() {
+ assert_class_string(input.validity, 'ValidityState', 'HTMLInputElement.validity must be a ValidityState instance');
+ assert_true(input.validity.tooLong, "tooLong must be true since the user just changed the input's value and the value exceeds the maxlength");
+ });
+ done();
+});
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-textarea-delete-manual.html b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-textarea-delete-manual.html
new file mode 100644
index 000000000..2212a1ca9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/constraints/tooLong-textarea-delete-manual.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>textarea, ValidityState.tooLong and user editing</title>
+ <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#limiting-user-input-length:-the-maxlength-attribute">
+ <meta name="flags" content="interact">
+ <meta name="assert" content="Per the 'Constraint validation' definition in the referenced section, a textarea whose value was edited by the user but still exceeds the textarea's maxlength should suffer from being too long.">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p>Delete one character from the following text area:</p>
+ <textarea maxlength="5" autocomplete="off" id="testinput">0123456789</textarea>
+
+ <div id="log"></div>
+ <script>
+var input = document.getElementById('testinput');
+setup({explicit_timeout: true, explicit_done: true});
+on_event(input, "input", function () {
+ test(function() {
+ assert_class_string(input.validity, 'ValidityState', 'HTMLTextAreaElement.validity must be a ValidityState instance');
+ assert_true(input.validity.tooLong, "tooLong must be true since the user just changed the input's value and the value exceeds the maxlength");
+ });
+ done();
+});
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/.gitkeep b/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/contains.json b/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/contains.json
new file mode 100644
index 000000000..754a6901d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/contains.json
@@ -0,0 +1,14 @@
+[
+ {
+ "id": "a-form-control-s-value",
+ "original_id": "a-form-control's-value"
+ },
+ {
+ "id": "mutability",
+ "original_id": "mutability"
+ },
+ {
+ "id": "association-of-controls-and-forms",
+ "original_id": "association-of-controls-and-forms"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/form.html b/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/form.html
new file mode 100644
index 000000000..29a14ca57
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/form.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTMLInputElement#form</title>
+<link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form id="form">
+<p><button id="button">button</button>
+<p><fieldset id="fieldset">fieldset</fieldset>
+<p><input id="input">
+<p><keygen id="keygen">
+<p><object id="object">object</object>
+<p><output id="output">output</output>
+<p><select id="select"><option>select</option></select>
+<p><textarea id="textarea">textarea</textarea>
+
+<!-- label is special: label.form is an alias for label.control.form -->
+<p><label id="label">label</label>
+<p><label id="label-form" form="form">label-form</label>
+<p><label id="label-form-form2" form="form2">label-form-form2</label>
+<p><label id="label-with-control">label-with-control <input></label>
+<p><label id="label-for" for="control-for-label">label-for</label> <input id="control-for-label">
+<p><label id="label-with-progress">label-with-progress <progress></progress></label>
+<p><label id="label-with-meter">label-with-meter <meter></meter></label>
+<p>
+ <input id="input-with-form-attr-in-form" form="form2">
+ <label id="label-for-control-form-in-form" for="input-with-form-attr-in-form">label-for-control-form-in-form</label>
+</p>
+</form>
+<form id="form2"></form>
+<p>
+ <input id="input-with-form-attr" form="form2">
+ <label id="label-for-control-form" for="input-with-form-attr">label-for-control-form</label>
+</p>
+<!-- misnested tags where form-association is set by the HTML parser -->
+<table>
+ <form id="form3"><!-- self-closes but sets the form element pointer -->
+ <tr>
+ <td><label id="label-in-table">label-in-table</label>
+ <td><label id="label-in-table-with-control">label-in-table <input></label>
+ <td><label id="label-in-table-for" for="input-in-table">label-in-table-for</label>
+ <td><input id="input-in-table"><!-- is associated with form3 -->
+ </tr>
+ </form>
+</table>
+<script>
+var form;
+setup(function() {
+ form = document.getElementById("form");
+ form2 = document.getElementById("form2");
+ form3 = document.getElementById("form3");
+ if (!form || !form2 || !form3) {
+ throw new TypeError("Didn't find all forms");
+ }
+});
+
+var listedElements = [
+ "button",
+ "fieldset",
+ "input",
+ "keygen",
+ "object",
+ "output",
+ "select",
+ "textarea",
+];
+
+listedElements.forEach(function(localName) {
+ test(function() {
+ var control = document.getElementById(localName);
+ assert_equals(control.form, form);
+ }, localName + ".form");
+});
+
+// label
+function testLabel(id, expected) {
+ test(function() {
+ var label = document.getElementById(id);
+ assert_equals(label.control && label.control.form, expected, 'Sanity check: label.control.form');
+ assert_equals(label.form, expected, 'label.form');
+ }, id + ".form");
+}
+
+testLabel("label", null);
+testLabel("label-form", null);
+testLabel("label-form-form2", null);
+testLabel("label-with-control", form);
+testLabel("label-for", form);
+testLabel("label-with-progress", null);
+testLabel("label-with-meter", null);
+testLabel("label-for-control-form-in-form", form2);
+testLabel("label-for-control-form", form2);
+testLabel("label-in-table", null);
+testLabel("label-in-table-with-control", form3);
+testLabel("label-in-table-for", form3);
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/form-submission-0/.gitkeep b/testing/web-platform/tests/html/semantics/forms/form-submission-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/form-submission-0/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/form-submission-0/contains.json b/testing/web-platform/tests/html/semantics/forms/form-submission-0/contains.json
new file mode 100644
index 000000000..f9d0d63bf
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/form-submission-0/contains.json
@@ -0,0 +1,30 @@
+[
+ {
+ "id": "introduction-2",
+ "original_id": "introduction-2"
+ },
+ {
+ "id": "implicit-submission",
+ "original_id": "implicit-submission"
+ },
+ {
+ "id": "form-submission-algorithm",
+ "original_id": "form-submission-algorithm"
+ },
+ {
+ "id": "constructing-form-data-set",
+ "original_id": "constructing-form-data-set"
+ },
+ {
+ "id": "url-encoded-form-data",
+ "original_id": "url-encoded-form-data"
+ },
+ {
+ "id": "multipart-form-data",
+ "original_id": "multipart-form-data"
+ },
+ {
+ "id": "plain-text-form-data",
+ "original_id": "plain-text-form-data"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/forms/form-submission-0/getactionurl.html b/testing/web-platform/tests/html/semantics/forms/form-submission-0/getactionurl.html
new file mode 100644
index 000000000..83de22026
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/form-submission-0/getactionurl.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<iframe id=testframe src="/common/blank.html"></iframe>
+<script>
+var tests = [
+ {
+ name: "Navigating to URL with a data scheme",
+ action: "data:,hello%20world",
+ output: "hello world"
+ }
+];
+tests.forEach(function(test_obj) {
+ test_obj.test = async_test(test_obj.name);
+});
+
+function run_test() {
+ if (tests.length == 0) {
+ return;
+ }
+ var test_obj = tests.pop();
+ var t = test_obj.test;
+ var testframe = document.getElementById("testframe");
+ var testdocument = testframe.contentWindow.document;
+ testdocument.body.innerHTML =
+ "<form id=testform method=get action=\"" + test_obj.action +"\"></form>";
+ testframe.onload = function() {
+ t.step(function() {
+ var body_text = testframe.contentWindow.document.textContent;
+ assert_equals(body_text, test_obj.output);
+ });
+ t.done();
+ run_test();
+ };
+ testdocument.getElementById("testform").submit();
+};
+document.getElementById("testframe").onload = run_test;
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/form-submission-0/submit-entity-body.html b/testing/web-platform/tests/html/semantics/forms/form-submission-0/submit-entity-body.html
new file mode 100644
index 000000000..0edc0f3df
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/forms/form-submission-0/url-encoded.html b/testing/web-platform/tests/html/semantics/forms/form-submission-0/url-encoded.html
new file mode 100644
index 000000000..5965b6633
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/form-submission-0/url-encoded.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<iframe id=testframe src="/common/blank.html"></iframe>
+<script>
+var simple_tests = [
+ {
+ name: "text.simple",
+ input: "<input name=foo value=bara>",
+ output: "foo=bara"
+ },
+ {
+ name: "textarea.simple",
+ input: "<textarea name=foo>bar</textarea>",
+ output: "foo=bar"
+ },
+];
+simple_tests.forEach(function(test_obj) {
+ test_obj.test = async_test(test_obj.name);
+});
+function run_simple_test() {
+ if (simple_tests.length == 0) {
+ return;
+ }
+ 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 action=\"/common/blank.html\">" +
+ test_obj.input +
+ "</form>";
+ testframe.onload = function() {
+ t.step(function (){
+ var get_url = testframe.contentWindow.location.toString();
+ var encoded = get_url.substr(get_url.indexOf("?") + 1);
+ assert_equals(encoded, test_obj.output);
+ });
+ t.done();
+ run_simple_test();
+ };
+ testdocument.getElementById("testform").submit();
+}
+document.getElementById("testframe").onload = run_simple_test;
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/historical.html b/testing/web-platform/tests/html/semantics/forms/historical.html
new file mode 100644
index 000000000..6873ecd25
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/historical.html
@@ -0,0 +1,85 @@
+<!doctype html>
+<title>Historical forms features should not be supported</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<form id=form hidden>
+ <label id=label></label>
+ <input id=input>
+ <button id=button></button>
+ <select id=select>
+ <optgroup id=optgroup>
+ <option id=option>
+ </select>
+ <datalist id=datalist></datalist>
+ <textarea id=textarea></textarea>
+ <progress id=progress></progress>
+ <meter id=meter></meter>
+ <fieldset id=fieldset>
+ <legend id=legend></legend>
+ </fieldset>
+</form>
+
+<form hidden action="isindex-support.txt" target=isindex_iframe id=isindex_form>
+ <input name=isindex value=x>
+ <iframe name=isindex_iframe id=isindex_iframe></iframe>
+</form>
+<script>
+var tags = ['form', 'label', 'input', 'button', 'select', 'datalist',
+'optgroup', 'option', 'textarea', 'progress', 'meter', 'fieldset', 'legend'];
+
+function t(property, tagName) {
+ var tagNames = tagName ? [tagName] : tags;
+ tagNames.forEach(function(tagName) {
+ test(function() {
+ assert_false(property in document.getElementById(tagName));
+ }, tagName + '.' + property + ' should not be supported');
+ });
+}
+
+function inputType(type) {
+ test(function() {
+ var input = document.createElement('input');
+ input.type = type;
+ assert_equals(input.type, 'text');
+ }, '<input type=' + type + '> should not be supported');
+}
+
+// <input type=range multiple>
+// added in https://github.com/whatwg/html/commit/1efac390abb3f95df61f2d2ac6c0feb47349d97b
+// removed in https://github.com/whatwg/html/commit/b598d4f873fb8c27d4b23b033837108edfbc3d75
+t('valueLow', 'input');
+t('valueHigh', 'input');
+
+// requestAutoComplete()
+// added in https://github.com/whatwg/html/commit/321659e4db11228857632487ab72b6959db1ba86
+// removed in https://github.com/whatwg/html/commit/6a257aae619f85390eee20b47767f34887450fcd
+t('requestAutocomplete', 'form');
+t('onautocomplete', 'form');
+t('onautocompleteerror', 'form');
+
+// <input type=datetime>
+// added in WF2
+// removed in https://github.com/whatwg/html/commit/80ba4fa24e5d3d81a10aa1bbd8a2f72f4bcc3f7c
+inputType('datetime');
+
+// <progress form>, <meter form>
+// removed in https://github.com/whatwg/html/commit/3814376a311837ddfac229d9a631cd10adf53157
+t('form', 'progress');
+t('form', 'meter');
+
+// form.item(), form.namedItem()
+// removed in https://github.com/whatwg/html/commit/da87ab9009d5aeca95a602e718439e35b00d0731
+t('item', 'form');
+t('namedItem', 'form');
+
+// <input name=isindex>
+// removed in https://github.com/whatwg/html/commit/5c44abc734eb483f9a7ec79da5844d2fe63d9c3b
+async_test(function() {
+ var iframe = document.getElementById('isindex_iframe');
+ iframe.onload = this.step_func_done(function() {
+ assert_regexp_match(iframe.contentWindow.location.href, /\?isindex=x$/);
+ });
+ document.getElementById('isindex_form').submit();
+}, '<input name=isindex> should not be supported');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/introduction-1/.gitkeep b/testing/web-platform/tests/html/semantics/forms/introduction-1/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/introduction-1/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/introduction-1/contains.json b/testing/web-platform/tests/html/semantics/forms/introduction-1/contains.json
new file mode 100644
index 000000000..12a866813
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/introduction-1/contains.json
@@ -0,0 +1,34 @@
+[
+ {
+ "id": "writing-a-form-s-user-interface",
+ "original_id": "writing-a-form's-user-interface"
+ },
+ {
+ "id": "implementing-the-server-side-processing-for-a-form",
+ "original_id": "implementing-the-server-side-processing-for-a-form"
+ },
+ {
+ "id": "configuring-a-form-to-communicate-with-a-server",
+ "original_id": "configuring-a-form-to-communicate-with-a-server"
+ },
+ {
+ "id": "client-side-form-validation",
+ "original_id": "client-side-form-validation"
+ },
+ {
+ "id": "enabling-client-side-automatic-filling-of-form-controls",
+ "original_id": "enabling-client-side-automatic-filling-of-form-controls"
+ },
+ {
+ "id": "improving-the-user-experience-on-mobile-devices",
+ "original_id": "improving-the-user-experience-on-mobile-devices"
+ },
+ {
+ "id": "the-difference-between-the-field-type-the-autofill-field-name-and-the-input-modality",
+ "original_id": "the-difference-between-the-field-type,-the-autofill-field-name,-and-the-input-modality"
+ },
+ {
+ "id": "input-author-notes",
+ "original_id": "input-author-notes"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/forms/resetting-a-form/.gitkeep b/testing/web-platform/tests/html/semantics/forms/resetting-a-form/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/resetting-a-form/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/resetting-a-form/reset-form.html b/testing/web-platform/tests/html/semantics/forms/resetting-a-form/reset-form.html
new file mode 100644
index 000000000..b74b52c46
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/resetting-a-form/reset-form.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: Resetting a form</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#concept-form-reset">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#category-reset">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form name="fm1" style="display:none">
+ <input value="abc" id="ipt1" />
+ <input id="ipt2" />
+ <input type="radio" id="rd1" checked="checked" />
+ <input type="radio" id="rd2"/>
+ <input type="checkbox" id="cb1" checked="checked" />
+ <input type="checkbox" id="cb2" />
+ <textarea id="ta">abc</textarea>
+ <!--<keygen id="kg"></keygen>-->
+ <output id="opt">5</output>
+ <select id="slt1">
+ <option value="1">ITEM1</option>
+ <option value="2">ITEM2</option>
+ </select>
+ <select id="slt2">
+ <option value="1">ITEM1</option>
+ <option value="2" selected>ITEM2</option>
+ </select>
+ <select id="slt3" multiple>
+ <option value="1">ITEM1</option>
+ <option value="2" selected>ITEM2</option>
+ <option value="3" selected>ITEM3</option>
+ </select>
+ <button id="rst1" type="reset">Reset1</button>
+ <input id="rst2" type="reset" value="Reset2" />
+</form>
+<script>
+
+runTest(function() {
+ document.forms.fm1.reset();
+}, "by calling the reset() method");
+
+runTest(function() {
+ document.getElementById("rst1").click();
+}, "by clicking the button in reset status");
+
+runTest(function() {
+ document.getElementById("rst2").click();
+}, "by clicking the input in reset status");
+
+function setPreconditions (arg) {
+ document.getElementById("ipt1").value = "123";
+ document.getElementById("ipt2").value = "123";
+ document.getElementById("rd1").checked = false;
+ document.getElementById("rd2").checked = true;
+ document.getElementById("cb1").checked = false;
+ document.getElementById("cb2").checked = true;
+ document.getElementById("ta").value = "123";
+ document.getElementById("opt").textContent = "abc";
+ document.getElementById("slt1").value = "2";
+ document.getElementById("slt2").value = "1";
+ document.getElementById("slt3").options[0].selected = true;
+ document.getElementById("slt3").options[1].selected = false;
+ document.getElementById("slt3").options[2].selected = false;
+
+ assert_equals(document.getElementById("ipt1").value, "123", "Precondition 1");
+ assert_equals(document.getElementById("ipt2").value, "123", "Precondition 2");
+ assert_false(document.getElementById("rd1").checked, "Precondition 3");
+ assert_true(document.getElementById("rd2").checked, "Precondition 4");
+ assert_false(document.getElementById("cb1").checked, "Precondition 5");
+ assert_true(document.getElementById("cb2").checked, "Precondition 6");
+ assert_equals(document.getElementById("ta").value, "123", "Precondition 17");
+ assert_equals(document.getElementById("opt").textContent, "abc", "Precondition 8");
+ assert_true(document.getElementById("slt1").options[1].selected, "Precondition 9");
+ assert_true(document.getElementById("slt2").options[0].selected, "Precondition 10");
+ assert_true(document.getElementById("slt3").options[0].selected, "Precondition 11");
+ assert_false(document.getElementById("slt3").options[1].selected, "Precondition 12");
+ assert_false(document.getElementById("slt3").options[2].selected, "Precondition 13");
+}
+
+function runTest(reset, description) {
+ test(function() {
+ setPreconditions("Setting preconditions for resetting " + description);
+ reset();
+ assert_equals(document.getElementById("ipt1").value, "abc", "The value of the input element in text status should be 'abc'.");
+ assert_equals(document.getElementById("ipt2").value, "", "The value of the input element in text status should be empty string.");
+ assert_true(document.getElementById("rd1").checked, "The checked attribute of the input element in radio should be true.");
+ assert_false(document.getElementById("rd2").checked, "The checked attribute of the input element in radio should be false.");
+ assert_true(document.getElementById("cb1").checked, "The checked attribute of the input element in checkbox should be true.");
+ assert_false(document.getElementById("cb2").checked, "The checked attribute of the input element in checkbox should be false.");
+ assert_equals(document.getElementById("ta").value, document.getElementById("ta").textContent, "The value attribute of the textarea element should be reset.");
+ assert_equals(document.getElementById("ta").value, "abc", "The value attribute of the textarea element should be 'abc'.");
+ assert_equals(document.getElementById("opt").textContent, document.getElementById("opt").defaultValue, "The textContent of the output element should be reset.");
+ assert_equals(document.getElementById("opt").textContent, "abc", "The textContent of the output element should be 'abc'.");
+ assert_true(document.getElementById("slt1").options[0].selected, "The first option in the select element should be selected.");
+ assert_false(document.getElementById("slt1").options[1].selected, "The second option in the select element should not be selected.");
+ assert_false(document.getElementById("slt2").options[0].selected, "The first option in the select element should not be selected.");
+ assert_true(document.getElementById("slt2").options[1].selected, "The second option in the select element should be selected.");
+ assert_false(document.getElementById("slt3").options[0].selected, "The first option in the select element with multiple attribute should not be selected.");
+ assert_true(document.getElementById("slt3").options[1].selected, "The second option in the select element with multiple attribute should be selected.");
+ assert_true(document.getElementById("slt3").options[2].selected, "The third option in the select element with multiple attribute should be selected.");
+ //TODO: The keygen reset algorithm
+ }, "Resetting the form " + description);
+}
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/textfieldselection/.gitkeep b/testing/web-platform/tests/html/semantics/forms/textfieldselection/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/textfieldselection/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/textfieldselection/original-id.json b/testing/web-platform/tests/html/semantics/forms/textfieldselection/original-id.json
new file mode 100644
index 000000000..d9fe43585
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/textfieldselection/original-id.json
@@ -0,0 +1 @@
+{"original_id":"textFieldSelection"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/forms/textfieldselection/select-event.html b/testing/web-platform/tests/html/semantics/forms/textfieldselection/select-event.html
new file mode 100644
index 000000000..92a12d12e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/textfieldselection/select-event.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>text field selection: select()</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#textFieldSelection">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<textarea>foobar</textarea>
+<script>
+ var input_types = ["text", "search", "tel", "url", "password"],
+ t1 = async_test("select() on textarea queues select event"),
+ q1 = false;
+
+ input_types.forEach(function(type) {
+ var input = document.createElement("input"),
+ t = async_test("select() on input type " + type + " queues select event"),
+ q = false;
+ t.step(function() {
+ input.type = type;
+ input.value = "foobar";
+ document.body.appendChild(input);
+ input.onselect = t.step_func_done(function(e) {
+ assert_true(q, "event should be queued");
+ assert_true(e.isTrusted, "event is trusted");
+ assert_true(e.bubbles, "event bubbles");
+ assert_false(e.cancelable, "event is not cancelable");
+ });
+ input.select();
+ q=true;
+ });
+ });
+
+ document.querySelector("textarea").onselect = t1.step_func_done(function(e) {
+ assert_true(q1, "event should be queued");
+ assert_true(e.isTrusted, "event is trusted");
+ assert_true(e.bubbles, "event bubbles");
+ assert_false(e.cancelable, "event is not cancelable");
+ });
+
+ t1.step(function() {
+ document.querySelector("textarea").select();
+ q1=true;
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/textfieldselection/selection-after-content-change.html b/testing/web-platform/tests/html/semantics/forms/textfieldselection/selection-after-content-change.html
new file mode 100644
index 000000000..90ebc28a2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/textfieldselection/selection-after-content-change.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Selection indices after content change</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+ test(function() {
+ var input = document.createElement("input");
+ input.focus();
+ input.value = "something something something dark side";
+ input.setSelectionRange(4,20);
+ assert_equals(input.selectionStart, 4);
+ assert_equals(input.selectionEnd, 20);
+ input.value = "It's a trap!";
+ assert_equals(input.selectionStart, input.value.length);
+ assert_equals(input.selectionEnd, input.value.length);
+}, "Selection indices after reseting content");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/textfieldselection/selection-not-application-textarea.html b/testing/web-platform/tests/html/semantics/forms/textfieldselection/selection-not-application-textarea.html
new file mode 100644
index 000000000..c17ad3232
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/textfieldselection/selection-not-application-textarea.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>text field selection (textarea)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#textFieldSelection">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ test(function() {
+ var el = document.createElement("textarea");
+ assert_equals(el.selectionStart, 0);
+ assert_equals(el.selectionEnd, 0);
+ el.selectionStart = 1;
+ el.selectionEnd = 1;
+ el.selectionDirection = "forward";
+ el.setRangeText("foobar");
+ el.setSelectionRange(0, 1);
+ }, "text field selection for the input textarea");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/textfieldselection/selection-not-application.html b/testing/web-platform/tests/html/semantics/forms/textfieldselection/selection-not-application.html
new file mode 100644
index 000000000..576e6d125
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/textfieldselection/selection-not-application.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>text field selection</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#textFieldSelection">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var types = ["hidden", "email", "datetime-local", "date", "month", "week", "time", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button"]; //types for which the API doesn't apply
+ var types2 = ["text", "search", "tel", "url", "password"]; //types for which the API applies
+
+ types.forEach(function(type){
+ test(function(){
+ var el = document.createElement("input");
+ el.type = type;
+ assert_throws("InvalidStateError", function(){
+ el.selectionStart;
+ });
+ assert_throws("InvalidStateError", function(){
+ el.selectionEnd;
+ });
+ assert_throws("InvalidStateError", function(){
+ el.selectionDirection;
+ });
+ assert_throws("InvalidStateError", function(){
+ el.setRangeText("foobar");
+ });
+ assert_throws("InvalidStateError", function(){
+ el.setSelectionRange(0, 1);
+ });
+ }, "text field selection for the input " + type);
+ });
+
+ types2.forEach(function(type) {
+ test(function() {
+ var el = document.createElement("input");
+ el.type = type;
+ assert_equals(el.selectionStart, 0);
+ assert_equals(el.selectionEnd, 0);
+ el.selectionStart = 1;
+ el.selectionEnd = 1;
+ el.selectionDirection = "forward";
+ el.setRangeText("foobar");
+ el.setSelectionRange(0, 1);
+ }, "text field selection for the input " + type);
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/textfieldselection/selection.html b/testing/web-platform/tests/html/semantics/forms/textfieldselection/selection.html
new file mode 100644
index 000000000..709d26e86
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/textfieldselection/selection.html
@@ -0,0 +1,145 @@
+<!DOCTYPE HTML>
+<title>test if select() API returns correct attributes</title>
+<meta charset="UTF-8">
+<meta name="timeout" content="long">
+<link rel="author" title="Koji Tashiro" href="mailto:koji.tashiro@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/association-of-controls-and-forms.html#textFieldSelection">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<div id="log"></div>
+
+<script>
+ var body = document.getElementsByTagName("body").item(0);
+ var dirs = ['forward', 'backward', 'none'];
+ var sampleText = "0123456789";
+
+ var createInputElement = function(value) {
+ var el = document.createElement("input");
+ el.type = "text";
+ el.value = value;
+ body.appendChild(el);
+ return el;
+ };
+
+ var createTextareaElement = function(value) {
+ var el = document.createElement("textarea");
+ el.value = value;
+ body.appendChild(el);
+ return el;
+ };
+
+
+ test(function() {
+ var text = 'a';
+ for (var i=0; i<255; i++) {
+ var el = createInputElement(text);
+ el.select();
+ var selectionText = el.value.substring(el.selectionStart, el.selectionEnd);
+ assert_equals(selectionText, text, "Selection text mismatched");
+ el.parentNode.removeChild(el);
+ text += 'a';
+ }
+ }, "test if selection text is correct for input");
+
+
+ test(function() {
+ var text = 'a';
+ for (var i=0; i<255; i++) {
+ var el = createTextareaElement(text);
+ el.select();
+ var selectionText = el.value.substring(el.selectionStart, el.selectionEnd);
+ assert_equals(selectionText, text, "Selection text mismatched");
+ el.parentNode.removeChild(el);
+ text += 'a';
+ }
+ }, "test if selection text is correct for textarea");
+
+
+ test(function() {
+ var text = 'あ';
+ for (var i=0; i<255; i++) {
+ var el = createInputElement(text);
+ el.select();
+ var selectionText = el.value.substring(el.selectionStart, el.selectionEnd);
+ assert_equals(selectionText, text, "Selection text mismatched");
+ el.parentNode.removeChild(el);
+ text += 'あ';
+ }
+ }, "test if non-ascii selection text is correct for input");
+
+
+ test(function() {
+ var text = 'あ';
+ for (var i=0; i<255; i++) {
+ var el = createTextareaElement(text);
+ el.select();
+ var selectionText = el.value.substring(el.selectionStart, el.selectionEnd);
+ assert_equals(selectionText, text, "Selection text mismatched");
+ el.parentNode.removeChild(el);
+ text += 'あ';
+ }
+ }, "test if non-ascii selection text is correct for textarea");
+
+
+ test(function() {
+ var el = createInputElement(sampleText);
+ // If there is no selection, then it must return the offset(in logical order)
+ // to the character that immediately follows the text entry cursor.
+ assert_equals(el.selectionStart, el.value.length, "SelectionStart offset without selection");
+ el.select();
+ assert_equals(el.selectionStart, 0, "SelectionStart offset");
+ el.parentNode.removeChild(el);
+ }, "test SelectionStart offset for input");
+
+
+ test(function() {
+ var el = createTextareaElement(sampleText);
+ // If there is no selection, then it must return the offset(in logical order)
+ // to the character that immediately follows the text entry cursor.
+ assert_equals(el.selectionStart, el.value.length, "SelectionStart offset without selection");
+ el.select();
+ assert_equals(el.selectionStart, 0, "SelectionStart offset");
+ el.parentNode.removeChild(el);
+ }, "test SelectionStart offset for textarea");
+
+
+ test(function() {
+ var el = createInputElement(sampleText);
+ // If there is no selection, then it must return the offset(in logical order)
+ // to the character that immediately follows the text entry cursor.
+ assert_equals(el.selectionEnd, el.value.length, "SelectionEnd offset without selection");
+ el.select();
+ assert_equals(el.selectionEnd, el.value.length, "SelectionEnd offset");
+ el.parentNode.removeChild(el);
+ }, "test SelectionEnd offset for input");
+
+
+ test(function() {
+ var el = createTextareaElement(sampleText);
+ // If there is no selection, then it must return the offset(in logical order)
+ // to the character that immediately follows the text entry cursor.
+ assert_equals(el.selectionEnd, el.value.length, "SelectionEnd offset without selection");
+ el.select();
+ assert_equals(el.selectionEnd, el.value.length, "SelectionEnd offset");
+ el.parentNode.removeChild(el);
+ }, "test SelectionEnd offset for textarea");
+
+
+ test(function() {
+ var el = createInputElement(sampleText);
+ assert_in_array(el.selectionDirection, dirs, "SelectionDirection");
+ el.select();
+ assert_in_array(el.selectionDirection, dirs, "SelectionDirection");
+ el.parentNode.removeChild(el);
+ }, "test SelectionDirection for input");
+
+
+ test(function() {
+ var el = createInputElement(sampleText);
+ assert_in_array(el.selectionDirection, dirs, "SelectionDirection");
+ el.select();
+ assert_in_array(el.selectionDirection, dirs, "SelectionDirection");
+ el.parentNode.removeChild(el);
+ }, "test SelectionDirection for textarea");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/textfieldselection/textfieldselection-setRangeText.html b/testing/web-platform/tests/html/semantics/forms/textfieldselection/textfieldselection-setRangeText.html
new file mode 100644
index 000000000..edc8f2a86
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/textfieldselection/textfieldselection-setRangeText.html
@@ -0,0 +1,120 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>text field selection: setRangeText</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#textFieldSelection">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+ #display_none {display:none;}
+</style>
+<div id="log"></div>
+<input type=text id=text value="foobar">
+<input type=search id=search value="foobar">
+<input type=tel id=tel value="foobar">
+<input type=url id=url value="foobar">
+<input type=password id=password value="foobar">
+<input id=display_none value="foobar">
+<textarea id=textarea>foobar</textarea>
+<script>
+ var input = document.createElement("input");
+ input.id = "input_not_in_doc";
+ input.value = "foobar";
+
+ var elements = [
+ document.getElementById("text"),
+ document.getElementById("search"),
+ document.getElementById("tel"),
+ document.getElementById("url"),
+ document.getElementById("password"),
+ document.getElementById("display_none"),
+ document.getElementById("textarea"),
+ input,
+ ]
+
+ elements.forEach(function(element) {
+ test(function() {
+ element.value = "foobar";
+ element.selectionStart = 0;
+ element.selectionEnd = 3;
+ assert_equals(element.selectionStart, 0);
+ assert_equals(element.selectionEnd, 3);
+ element.setRangeText("foobar2");
+ assert_equals(element.value, "foobar2bar");
+ assert_equals(element.selectionStart, 0);
+ assert_equals(element.selectionEnd, 7);
+ element.setRangeText("foobar3", 7, 10);
+ assert_equals(element.value, "foobar2foobar3");
+ }, element.id + " setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments");
+
+ test(function(){
+ element.value = "foobar";
+ element.selectionStart = 0;
+ element.selectionEnd = 0;
+
+ element.setRangeText("foobar2", 0, 3); // no 4th arg, default "preserve"
+ assert_equals(element.value, "foobar2bar");
+ assert_equals(element.selectionStart, 0);
+ assert_equals(element.selectionEnd, 0);
+ }, element.id + " selectionMode missing");
+
+ test(function(){
+ element.value = "foobar"
+ element.setRangeText("foo", 3, 6, "select");
+ assert_equals(element.value, "foofoo");
+ assert_equals(element.selectionStart, 3);
+ assert_equals(element.selectionEnd, 6);
+ }, element.id + " selectionMode 'select'");
+
+ test(function(){
+ element.value = "foobar"
+ element.setRangeText("foo", 3, 6, "start");
+ assert_equals(element.value, "foofoo");
+ assert_equals(element.selectionStart, 3);
+ assert_equals(element.selectionEnd, 3);
+ }, element.id + " selectionMode 'start'");
+
+ test(function(){
+ element.value = "foobar"
+ element.setRangeText("foobar", 3, 6, "end");
+ assert_equals(element.value, "foofoobar");
+ assert_equals(element.selectionStart, 9);
+ assert_equals(element.selectionEnd, 9);
+ }, element.id + " selectionMode 'end'");
+
+ test(function(){
+ element.value = "foobar"
+ element.selectionStart = 0;
+ element.selectionEnd = 5;
+ assert_equals(element.selectionStart, 0);
+ element.setRangeText("", 3, 6, "preserve");
+ assert_equals(element.value, "foo");
+ assert_equals(element.selectionStart, 0);
+ assert_equals(element.selectionEnd, 3);
+ }, element.id + " selectionMode 'preserve'");
+
+ test(function(){
+ assert_throws("INDEX_SIZE_ERR", function() {
+ element.setRangeText("barfoo", 2, 1);
+ });
+ }, element.id + " setRangeText with 3rd argument greater than 2nd argument throws an IndexSizeError exception");
+
+ test(function(){
+ assert_throws(new TypeError(), function() {
+ element.setRangeText();
+ });
+ }, element.id + " setRangeText without argument throws a type error");
+
+ async_test(function() {
+ var q = false;
+ element.onselect = this.step_func_done(function(e) {
+ assert_true(q, "event should be queued");
+ assert_true(e.isTrusted, "event is trusted");
+ assert_false(e.bubbles, "event bubbles");
+ assert_false(e.cancelable, "event is not cancelable");
+ });
+ element.setRangeText("foobar2", 0, 6);
+ q = true;
+ }, element.id + " setRangeText fires a select event");
+ })
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html b/testing/web-platform/tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html
new file mode 100644
index 000000000..60d591baf
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html
@@ -0,0 +1,274 @@
+<!DOCTYPE HTML>
+<title>Test of text field setSelectionRange</title>
+<link rel="author" title="Takeharu.Oshida" href="mailto:georgeosddev@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-textarea/input-setselectionrange">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="hide" style="display: block">
+ <input id="a" type="text" value="abcde">
+ <textarea id="b">abcde</textarea>
+</div>
+<script>
+test(function() {
+ var input = document.getElementById("a");
+ test(function() {
+ assert_equals(typeof(input.setSelectionRange), "function", "element must have 'setSelectionRange' function");
+ },"input typeof(input.setSelectionRange)'");
+
+ test(function() {
+ assert_equals(input.setSelectionRange(0,1,"forward"),undefined,"setSelectionRange is void functuon");
+ },"input setSelectionRange return void");
+
+ test(function() {
+ input.setSelectionRange(0,1)
+ assert_equals(input.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");
+ },'input setSelectionRange(0,1)');
+
+ test(function() {
+ input.setSelectionRange(0,input.value.length+1)
+ assert_equals(input.selectionEnd, input.value.length, "Arguments 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(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");
+ },'input setSelectionRange(2,2)');
+
+ test(function() {
+ input.setSelectionRange(2,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, "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");
+ },'input setSelectionRange(2,1)');
+
+ test(function() {
+ input.setSelectionRange(0,1,"backward")
+ assert_equals(input.selectionDirection, "backward", 'The direction of the selection must be set to backward if direction is a case-sensitive match for the string "backward"');
+ },'input direction of setSelectionRange(0,1,"backward")');
+
+ test(function() {
+ input.setSelectionRange(0,1,"forward")
+ assert_equals(input.selectionDirection, "forward", 'The direction of the selection must be set to forward if direction is a case-sensitive match for the string "forward"');
+ },'input direction of setSelectionRange(0,1,"forward")');
+
+ test(function() {
+ input.setSelectionRange(0,1,"none")
+ assert_equals(input.selectionDirection, "none", 'The direction of the selection must be set to forward if direction is a case-sensitive match for the string "none"');
+ },'input direction of setSelectionRange(0,1,"none")');
+
+ test(function() {
+ input.setSelectionRange(0,1,"hoge")
+ assert_equals(input.selectionDirection, "none", "otherwise");
+ },'input direction of setSelectionRange(0,1,"hoge")');
+
+ test(function() {
+ input.setSelectionRange(0,1,"BACKWARD")
+ assert_equals(input.selectionDirection, "none", "selectionDirection should be 'none'");
+ },'input direction of setSelectionRange(0,1,"BACKWARD")');
+
+ test(function() {
+ input.setSelectionRange(0,1)
+ assert_equals(input.selectionDirection, "none", "if the argument is omitted");
+ },'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");
+ },'input setSelectionRange("string",1)');
+
+ test(function() {
+ input.setSelectionRange(true,1);
+ assert_equals(input.selectionStart, 1, "element.selectionStart should be 1");
+ assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");
+ },'input setSelectionRange(true,1)');
+
+ test(function() {
+ input.setSelectionRange([],1);
+ assert_equals(input.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");
+ },'input setSelectionRange([],1)');
+
+ test(function() {
+ input.setSelectionRange({},1);
+ assert_equals(input.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");
+ },'input setSelectionRange({},1)');
+
+ test(function() {
+ input.setSelectionRange(NaN,1);
+ assert_equals(input.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");
+ },'input setSelectionRange(NaN,1)');
+
+ test(function() {
+ input.setSelectionRange(null,1);
+ assert_equals(input.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");
+ },'input setSelectionRange(null,1)');
+
+ test(function() {
+ input.setSelectionRange(undefined,1);
+ assert_equals(input.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");
+ },'input setSelectionRange(undefined,1)');
+},"test of input.setSelectionRange");
+
+async_test(function() {
+ var q = false;
+ var input = document.getElementById("a");
+ input.addEventListener("select", this.step_func_done(function(e) {
+ assert_true(q, "event should be queued");
+ assert_true(e.isTrusted, "event is trusted");
+ assert_true(e.bubbles, "event bubbles");
+ assert_false(e.cancelable, "event is not cancelable");
+ }));
+ input.setSelectionRange(0, 1);
+ q = true;
+}, "input setSelectionRange fires a select event");
+
+test(function() {
+ var textarea = document.getElementById("b");
+ test(function() {
+ assert_equals(typeof(textarea.setSelectionRange), "function", "element must have 'setSelectionRange' function");
+ },"textarea typeof(input.setSelectionRange)'");
+
+ test(function() {
+ assert_equals(textarea.setSelectionRange(0,1,"forward"),undefined,"setSelectionRange is void functuon");
+ },"textarea setSelectionRange return void");
+
+ test(function() {
+ textarea.setSelectionRange(0,1)
+ assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(textarea.selectionEnd, 1, "element.selectionEnd should be 1");
+ },'textarea setSelectionRange(0,1)');
+
+ test(function() {
+ textarea.setSelectionRange(0,textarea.value.length+1)
+ assert_equals(textarea.selectionEnd, textarea.value.length, "Arguments greater than the length of the value of the text field must be treated as pointing at the end of the text field");
+ },'textarea setSelectionRange(0,textarea.value.length+1)');
+
+ test(function() {
+ textarea.setSelectionRange(2,2)
+ assert_equals(textarea.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(textarea.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");
+ },'textarea setSelectionRange(2,2)');
+
+ test(function() {
+ textarea.setSelectionRange(2,1)
+ assert_equals(textarea.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(textarea.selectionEnd, 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");
+ },'textarea setSelectionRange(2,1)');
+
+ test(function() {
+ textarea.setSelectionRange(0,1,"backward")
+ assert_equals(textarea.selectionDirection, "backward", 'The direction of the selection must be set to backward if direction is a case-sensitive match for the string "backward"');
+ },'textarea direction of setSelectionRange(0,1,"backward")');
+
+ test(function() {
+ textarea.setSelectionRange(0,1,"forward")
+ assert_equals(textarea.selectionDirection, "forward", 'The direction of the selection must be set to forward if direction is a case-sensitive match for the string "forward"');
+ },'textarea direction of setSelectionRange(0,1,"forward")');
+
+ test(function() {
+ textarea.setSelectionRange(0,1,"none")
+ assert_equals(textarea.selectionDirection, "none", 'The direction of the selection must be set to forward if direction is a case-sensitive match for the string "none"');
+ },'textarea direction of setSelectionRange(0,1,"none")');
+
+ test(function() {
+ textarea.setSelectionRange(0,1,"hoge")
+ assert_equals(textarea.selectionDirection, "none", "otherwise");
+ },'textarea direction of setSelectionRange(0,1,"hoge")');
+
+ test(function() {
+ textarea.setSelectionRange(0,1,"BACKWARD")
+ assert_equals(textarea.selectionDirection, "none", "selectionDirection should be 'none'");
+ },'textarea direction of setSelectionRange(0,1,"BACKWARD")');
+
+ test(function() {
+ textarea.setSelectionRange(0,1)
+ assert_equals(textarea.selectionDirection, "none", "if the argument is omitted");
+ },'textarea direction of setSelectionRange(0,1)');
+
+ test(function() {
+ textarea.setSelectionRange("string",1);
+ assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
+ },'textarea setSelectionRange("string",1)');
+
+ test(function() {
+ textarea.setSelectionRange(true,1);
+ assert_equals(textarea.selectionStart, 1, "element.selectionStart should be 1");
+ assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
+ },'textarea setSelectionRange(true,1)');
+
+ test(function() {
+ textarea.setSelectionRange([],1);
+ assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
+ },'textarea setSelectionRange([],1)');
+
+ test(function() {
+ textarea.setSelectionRange({},1);
+ assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
+ },'textarea setSelectionRange({},1)');
+
+ test(function() {
+ textarea.setSelectionRange(NaN,1);
+ assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
+ },'textarea setSelectionRange(NaN,1)');
+
+ test(function() {
+ textarea.setSelectionRange(null,1);
+ assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
+ },'textarea setSelectionRange(null,1)');
+
+ test(function() {
+ textarea.setSelectionRange(undefined,1);
+ assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
+ assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
+ },'textarea setSelectionRange(undefined,1)');
+},"test of textarea.setSelectionRange");
+
+async_test(function() {
+ var q = false;
+ var textarea = document.getElementById("b");
+ textarea.addEventListener("select", this.step_func_done(function(e) {
+ assert_true(q, "event should be queued");
+ assert_true(e.isTrusted, "event is trusted");
+ assert_true(e.bubbles, "event bubbles");
+ assert_false(e.cancelable, "event is not cancelable");
+ }));
+ textarea.setSelectionRange(0, 1);
+ q = true;
+}, "textarea setSelectionRange fires a select event");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-button-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-button-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-button-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-button-element/button-activate-frame.html b/testing/web-platform/tests/html/semantics/forms/the-button-element/button-activate-frame.html
new file mode 100644
index 000000000..37619d791
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-button-element/button-activate-frame.html
@@ -0,0 +1,3 @@
+<form action="about:blank">
+ <button id="submit">Submit</button>
+</form>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-button-element/button-activate.html b/testing/web-platform/tests/html/semantics/forms/the-button-element/button-activate.html
new file mode 100644
index 000000000..43fe96d39
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-button-element/button-activate.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<meta charset="utf-8">
+<title></title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<iframe src="button-activate-frame.html" onload="runTest()"></iframe>
+<script>
+var t = async_test("button activation behaviour submits form");
+function runTest() {
+ var iframe = document.querySelector('iframe');
+ iframe.onload = t.step_func(function() {
+ t.done();
+ });
+ var doc = iframe.contentDocument;
+ doc.querySelector('button').click();
+}
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-button-element/button-events.html b/testing/web-platform/tests/html/semantics/forms/the-button-element/button-events.html
new file mode 100644
index 000000000..9d308bbed
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-button-element/button-events.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: Button - events</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-button-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form name="fm1" style="display:none">
+ <button id="btn">BUTTON</button>
+ <button id="menu_btn" type="menu" menu="menu">MENU BUTTON</button>
+ <menu id="menu" label="MENU">
+ <li>Menu item</li>
+ </menu>
+</form>
+<script>
+
+var btn = document.getElementById("btn"),
+ menu_btn = document.getElementById("menu_btn"),
+ t1 = async_test("The submit event must be fired when click a button in submit status"),
+ t2 = async_test("The reset event must be fired when click a button in reset status"),
+ t3 = async_test("The show event must be fired when click a button in menu status");
+
+document.forms.fm1.onsubmit = t1.step_func(function (evt) {
+ evt.preventDefault();
+ assert_true(evt.isTrusted, "The isTrusted attribute of the submit event should be true.");
+ assert_true(evt.bubbles, "The bubbles attribute of the submit event should be true.");
+ assert_true(evt.cancelable, "The cancelable attribute of the submit event should be true.");
+ assert_true(evt instanceof Event, "The submit event is an instance of Event interface.");
+ t1.done();
+});
+
+document.forms.fm1.onreset = t2.step_func(function (evt) {
+ assert_true(evt.isTrusted, "The isTrusted attribute of the reset event should be true.");
+ assert_true(evt.bubbles, "The bubbles attribute of the reset event should be true.");
+ assert_true(evt.cancelable, "The cancelable attribute of the reset event should be true.");
+ assert_true(evt instanceof Event, "The reset event is an instance of Event interface.");
+ t2.done();
+});
+
+document.getElementById("menu").onshow = t3.step_func(function (evt) {
+ assert_true(evt.isTrusted, "The isTrusted attribute of the show event should be true.");
+ assert_equals(evt.relatedTarget, menu_btn, "The relatedTarget attribute should be initialized to the related button element.");
+ assert_true(evt.cancelable, "The cancelable attribute of the show event should be true.");
+ assert_true(evt instanceof RelatedEvent, "The show event is an instance of RelatedEvent interface.");
+ t3.done();
+});
+
+t1.step(function () {
+ btn.type = "submit";
+ assert_equals(btn.type, "submit", "The button type should be 'submit'.");
+ btn.click();
+});
+
+t2.step(function () {
+ btn.type = "reset";
+ assert_equals(btn.type, "reset", "The button type should be 'reset'.");
+ btn.click();
+});
+
+t3.step(function () {
+ assert_equals(menu_btn.type, "menu", "The button type should be 'menu'.");
+ menu_btn.click();
+});
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-button-element/button-validation.html b/testing/web-platform/tests/html/semantics/forms/the-button-element/button-validation.html
new file mode 100644
index 000000000..a153907d7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-button-element/button-validation.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>button element validation</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-button-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<button id=btn1>button</button>
+<button id=btn2 type=submit>button</button>
+<button id=btn3 type=reset>button</button>
+<button id=btn4 type=button>button</button>
+<button id=btn5 type=menu>button</button>
+<button id=btn6 type=foobar>button</button>
+<script>
+ function willValid(element, expectedType, willValidate, desc) {
+ test(function(){
+ assert_equals(element.type, expectedType);
+ assert_equals(element.willValidate, willValidate);
+ }, desc);
+ }
+
+ willValid(document.getElementById('btn1'), "submit", true, "missing type attribute");
+ willValid(document.getElementById('btn2'), "submit", true, "submit type attribute");
+ willValid(document.getElementById('btn3'), "reset", false, "reset type attribute");
+ willValid(document.getElementById('btn4'), "button", false, "button type attribute");
+ willValid(document.getElementById('btn5'), "menu", false, "menu type attribute");
+ willValid(document.getElementById('btn6'), "submit", true, "invalid type attribute");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-datalist-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-datalist-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-datalist-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-datalist-element/datalistoptions.html b/testing/web-platform/tests/html/semantics/forms/the-datalist-element/datalistoptions.html
new file mode 100644
index 000000000..245d43cec
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-datalist-element/datalistoptions.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Datalist element options</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#the-datalist-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<label>
+ Number:
+ <input list=numbers>
+</label>
+<datalist id=numbers>
+ <label> Select number:
+ <select id=num>
+ <option label="zero" value="0">
+ <option label="one" value="1">
+ <option label="two">2
+ <option label="three" disabled>3
+ <option>
+ </select>
+ </label>
+</datalist>
+<script>
+ test(function(){
+ var datalist = document.getElementById('numbers'),
+ labels = [],
+ values = [];
+ assert_equals(datalist.options.length, 5);
+
+ for (var i = 0, len = datalist.options.length; i < len; i++) {
+ assert_equals(datalist.options[i], datalist.options.item(i));
+ labels.push(datalist.options[i].label);
+ values.push(datalist.options[i].value);
+ }
+ assert_array_equals(labels, ["zero", "one", "two", "three", ""]);
+ assert_array_equals(values, ["0", "1", "2", "3", ""]);
+ }, "options label/value");
+
+ test(function(){
+ assert_false(document.getElementById('num').willValidate);
+ }, "If an element has a datalist element ancestor, it is barred from constraint validation");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/HTMLFieldSetElement.html b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/HTMLFieldSetElement.html
new file mode 100644
index 000000000..0c394cbed
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/HTMLFieldSetElement.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: HTMLFieldSetElement interface</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-fieldset-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form name="fm1" style="display:none">
+ <fieldset id="fs_outer">
+ <legend><input type="checkbox" name="cb"></legend>
+ <input type=text name="txt" id="ctl1">
+ <button id="ctl2" name="btn">BUTTON</button>
+ <fieldset id="fs_inner">
+ <input type="text" name="txt_inner">
+ <progress name="pg" value="0.5"></progress>
+ </fieldset>
+ </fieldset>
+</form>
+<script>
+
+var fm1,
+ fs_outer,
+ children_outer;
+
+setup(function () {
+ fm1 = document.forms.fm1;
+ fs_outer = document.getElementById("fs_outer");
+ children_outer = fs_outer.elements;
+});
+
+test(function () {
+ assert_equals(fs_outer.type, "fieldset", "The value of type attribute is incorrect.");
+}, "The type attribute must return 'fieldset'");
+
+test(function () {
+ assert_equals(fs_outer.form, fm1, "The fieldset should have a form owner.");
+}, "The form attribute must return the fieldset's form owner");
+
+test(function () {
+ assert_true(children_outer instanceof HTMLFormControlsCollection,
+ "The elements attribute should be an HTMLFormControlsCollection object");
+}, "The elements must return an HTMLFormControlsCollection object");
+
+test(function () {
+ var fs_inner = document.getElementById("fs_inner");
+ var children_inner = fs_inner.elements;
+ assert_array_equals(children_inner, [fm1.txt_inner],
+ "The items in the collection must be children of the inner fieldset element.");
+ assert_array_equals(children_outer, [fm1.cb, fm1.txt, fm1.btn, fm1.fs_inner, fm1.txt_inner],
+ "The items in the collection must be children of the outer fieldset element.");
+}, "The controls must root at the fieldset element");
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-001.html b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-001.html
new file mode 100644
index 000000000..cbbda4ab0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-001.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Fieldset disabled</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-fieldset-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form>
+ <fieldset id=fs disabled>
+ <legend>
+ <input type=checkbox id=clubc_l1>
+ <input type=radio id=clubr_l1>
+ <input type=text id=clubt_l1>
+ </legend>
+ <legend><input type=checkbox id=club_l2></legend>
+ <p><label>Name on card: <input id=clubname required></label></p>
+ <p><label>Card number: <input id=clubnum required pattern="[-0-9]+"></label></p>
+ </fieldset>
+ <fieldset id=fs2 disabled>
+ <p><legend><input type=checkbox id=club2></legend></p>
+ <p><label>Name on card: <input id=clubname2 required></label></p>
+ <p><label>Card number: <input id=clubnum2 required pattern="[-0-9]+"></label></p>
+ </fieldset>
+ <fieldset id=fs3 disabled>
+ <fieldset>
+ <legend><input type=checkbox id=club3></legend>
+ </fieldset>
+ <p><label>Name on card: <input id=clubname3 required></label></p>
+ <p><label>Card number: <input id=clubnum3 required pattern="[-0-9]+"></label></p>
+ </fieldset>
+ <fieldset id=fs4 disabled>
+ <legend>
+ <fieldset><input type=checkbox id=club4></fieldset>
+ </legend>
+ <p><label>Name on card: <input id=clubname4 required></label></p>
+ <p><label>Card number: <input id=clubnum4 required pattern="[-0-9]+"></label></p>
+ </fieldset>
+</form>
+<script>
+ test(function () {
+ assert_true(document.getElementById('fs').disabled, "The fieldset is disabled");
+ assert_false(document.getElementById('clubname').willValidate, "fieldset is disabled so is input 'clubname'");
+ assert_false(document.getElementById('clubnum').willValidate, "fieldset is disabled so is input 'clubnum'");
+ assert_true(document.getElementById('clubc_l1').willValidate, "input 'clubc_l1' is descendant of the first legend child of the fieldset. It should not be disabled");
+ assert_true(document.getElementById('clubr_l1').willValidate, "input 'clubr_l1' is descendant of the first legend child of the fieldset. It should not be disabled");
+ assert_true(document.getElementById('clubt_l1').willValidate, "input 'clubt_l1' is descendant of the first legend child of the fieldset. It should not be disabled");
+ assert_false(document.getElementById('club_l2').willValidate, "input 'club_l2' is a descendant of the second legend child of the fieldset. It should be disabled");
+ }, "The disabled attribute, when specified, causes all the form control descendants of the fieldset element, excluding those that are descendants of the fieldset element's first legend element child, if any, to be disabled.");
+
+ test(function () {
+ assert_true(document.getElementById('fs2').disabled, "The fieldset is disabled");
+ assert_false(document.getElementById('clubname2').willValidate, "fieldset is disabled so is input 'clubname2'");
+ assert_false(document.getElementById('clubnum2').willValidate, "fieldset is disabled so is input 'clubnum2'");
+ assert_false(document.getElementById('club2').willValidate, "the first legend is not a child of the disbled fieldset: input 'club2' is disabled");
+ }, "The first 'legend' element is not a child of the disabled fieldset: Its descendants should be disabled.");
+
+ test(function () {
+ assert_true(document.getElementById('fs3').disabled, "The fieldset is disabled");
+ assert_false(document.getElementById('clubname3').willValidate, "fieldset is disabled so is input 'clubname3'");
+ assert_false(document.getElementById('clubnum3').willValidate, "fieldset is disabled so is input 'clubnum3'");
+ assert_false(document.getElementById('club3').willValidate, "the first legend is not a child of the disbled fieldset: input 'club3' is disabled");
+ }, "The <legend> element is not a child of the disabled fieldset: Its descendants should be disabled.");
+
+ test(function () {
+ assert_true(document.getElementById('fs4').disabled, "The fieldset is disabled");
+ assert_false(document.getElementById('clubname4').willValidate, "fieldset is disabled so is input 'clubname4'");
+ assert_false(document.getElementById('clubnum4').willValidate, "fieldset is disabled so is input 'clubnum4'");
+ assert_true(document.getElementById('club4').willValidate, "the first legend a child of the disbled fieldset: input 'club4' is disabled");
+ }, "The <legend> element is child of the disabled fieldset: Its descendants should be disabled.");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-002.xhtml b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-002.xhtml
new file mode 100644
index 000000000..896d737df
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-002.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>File input descendants of disabled fieldsets</title>
+ <link rel="author" title="Chris Rebert" href="http://chrisrebert.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-fieldset-disabled" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <div id="log"></div>
+ <form>
+ <fieldset id="fs" disabled="disabled">
+ <input id="myfile" type="file" />
+ </fieldset>
+ </form>
+ <script>
+ test(function () {
+ assert_true(document.getElementById('fs').disabled, "disabled fieldset should be disabled");
+ assert_false(document.getElementById('myfile').willValidate, "form control descendant of disabled fieldset that is not also a descendant of a legend should be disabled");
+ }, "A file input without a disabled attribute that is a descendant of a disabled fieldset should be disabled (modulo legend-related complications that don't apply here)");
+ </script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-form-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-form-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-form-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-form-element/form-autocomplete.html b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-autocomplete.html
new file mode 100644
index 000000000..c50ea7317
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-autocomplete.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>form autocomplete attribute</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#the-form-element">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#attr-fe-autocomplete">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form name="missing_attribute">
+ <input>
+ <input autocomplete="on">
+ <input autocomplete="off">
+ <input autocomplete="foobar">
+</form>
+<form name="autocomplete_on" autocomplete="on">
+ <input>
+ <input autocomplete="on">
+ <input autocomplete="off">
+ <input autocomplete="foobar">
+</form>
+<form name="autocomplete_off" autocomplete="off">
+ <input>
+ <input autocomplete="on">
+ <input autocomplete="off">
+ <input autocomplete="foobar">
+</form>
+<form name="autocomplete_invalid" autocomplete="foobar">
+ <input>
+ <input autocomplete="on">
+ <input autocomplete="off">
+ <input autocomplete="foobar">
+</form>
+<script>
+ function autocompletetest(form, expectedValues, desc) {
+ test(function(){
+ assert_equals(form.autocomplete, expectedValues[0]);
+ assert_equals(form.elements[0].autocomplete, expectedValues[1]);
+ assert_equals(form.elements[1].autocomplete, expectedValues[2]);
+ assert_equals(form.elements[2].autocomplete, expectedValues[3]);
+ assert_equals(form.elements[3].autocomplete, expectedValues[4]);
+ }, desc);
+ }
+
+ autocompletetest(document.forms.missing_attribute, ["on", "on", "on", "off", ""], "form autocomplete attribute missing");
+ autocompletetest(document.forms.autocomplete_on, ["on", "on", "on", "off", ""], "form autocomplete attribute on");
+ autocompletetest(document.forms.autocomplete_off, ["off", "off", "on", "off", ""], "form autocomplete attribute off");
+ autocompletetest(document.forms.autocomplete_invalid, ["on", "on", "on", "off", ""], "form autocomplete attribute invalid");
+
+ var keywords = [ "name", "honorific-prefix", "given-name", "additional-name", "family-name", "honorific-suffix", "nickname", "username", "new-password", "current-password", "organization-title", "organization", "street-address", "address-line1", "address-line2", "address-line3", "address-level4", "address-level3", "address-level2", "address-level1", "country", "country-name", "postal-code", "cc-name", "cc-given-name", "cc-additional-name", "cc-family-name", "cc-number", "cc-exp", "cc-exp-month", "cc-exp-year", "cc-csc", "cc-type", "transaction-currency", "transaction-amount", "language", "bday", "bday-day", "bday-month", "bday-year", "sex", "url", "photo", "tel", "tel-country-code", "tel-national", "tel-area-code", "tel-local", "tel-local-prefix", "tel-local-suffix", "tel-extension", "email", "impp" ];
+
+ keywords.forEach(function(keyword) {
+ test(function(){
+ var input = document.createElement("input");
+ input.setAttribute("autocomplete", keyword);
+ assert_equals(input.autocomplete, keyword);
+ }, keyword + " is an allowed autocomplete field name");
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-interfaces-01.html b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-interfaces-01.html
new file mode 100644
index 000000000..c8b4a6c71
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-interfaces-01.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<title>form.elements: interfaces</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-form-elements">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#htmlformcontrolscollection">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var form = document.createElement("form");
+ ["HTMLFormControlsCollection", "HTMLCollection"].forEach(function(i) {
+ test(function() {
+ assert_true(i in window, "Interface should exist")
+ assert_true(form.elements instanceof window[i],
+ "elements should implement the interface")
+ }, "Testing interface " + i)
+ })
+})
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-matches.html b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-matches.html
new file mode 100644
index 000000000..792162726
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-matches.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>form.elements: matches</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-form-elements">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<form id="form">
+<input type="image">
+</form>
+</div>
+<script>
+test(function() {
+ assert_equals(document.getElementById("form").elements.length, 0);
+}, "input type=image should not be present in the form.elements collection")
+test(function() {
+ var form = document.getElementById("form");
+ var i = document.createElement("input");
+ i.name = "2";
+ form.appendChild(i);
+ var j = document.createElement("input");
+ j.name = "03";
+ form.appendChild(j);
+ assert_equals(form.elements[-1], undefined, '[-1]');
+ assert_equals(form.elements["-1"], undefined, '["-1"]');
+ assert_equals(form.elements[0], i, '[0]');
+ assert_equals(form.elements["0"], i, '["0"]');
+ assert_equals(form.elements[1], j, '[1]');
+ assert_equals(form.elements["1"], j, '["1"]');
+ assert_equals(form.elements[2], undefined, '[2]');
+ assert_equals(form.elements["2"], undefined, '["2"]');
+ assert_equals(form.elements[03], undefined, '[03]');
+ assert_equals(form.elements["03"], j, '["03"]');
+ assert_equals(form.elements.item(-1), null, 'item(-1)');
+ assert_equals(form.elements.item(0), i, 'item(0)');
+ assert_equals(form.elements.item(1), j, 'item(1)');
+ assert_equals(form.elements.item(2), null, 'item(2)');
+ assert_equals(form.elements.namedItem("2"), i, 'namedItem("2")');
+ assert_equals(form.elements.namedItem("03"), j, 'namedItem("03")');
+ assert_equals(form.elements.namedItem("3"), null, 'namedItem("3")');
+ assert_array_equals(form.elements, [i, j]);
+ form.removeChild(i);
+ form.removeChild(j);
+}, "form.elements should include elements whose name starts with a number");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-nameditem-01.html b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-nameditem-01.html
new file mode 100644
index 000000000..0b5aeb8ef
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-nameditem-01.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>form.elements: namedItem</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-form-elements">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<form id=form>
+<input name=b id=i1>
+<input name=b id=i2>
+</form>
+</div>
+<script>
+test(function() {
+ assert_true("RadioNodeList" in window, "RadioNodeList should exist");
+}, "RadioNodeList should exist")
+test(function() {
+ var nl = document.forms.form.elements["b"];
+ assert_true(nl instanceof NodeList, "Should get a NodeList");
+ if ("RadioNodeList" in window) {
+ assert_true(nl instanceof RadioNodeList, "Should get a RadioNodeList");
+ }
+ assert_array_equals(nl,
+ [document.getElementById("i1"),
+ document.getElementById("i2")]);
+
+ var el = nl[0];
+ el.parentNode.removeChild(el);
+ assert_true(nl instanceof NodeList, "Should get a NodeList");
+ if ("RadioNodeList" in window) {
+ assert_true(nl instanceof RadioNodeList, "Should get a RadioNodeList");
+ }
+ assert_array_equals(nl, [document.getElementById("i2")]);
+ assert_equals(document.forms.form.elements["b"], document.getElementById("i2"));
+}, "elements collection should return elements or RadioNodeLists")
+test(function() {
+ var fs = document.forms.form.appendChild(document.createElement("fieldset"));
+ fs.name = "fs";
+ assert_equals(document.forms.form.elements.fs, fs);
+ fs.parentNode.removeChild(fs);
+}, "elements collection should include fieldsets")
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-nameditem-02.html b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-nameditem-02.html
new file mode 100644
index 000000000..c25e554de
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-nameditem-02.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<title>form.elements: parsing</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-form-elements">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#parsing-main-intr">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<form id=form>
+<table>
+<tr>
+<td><input type="radio" name="radio1" id="r1" value=1></td>
+<td><input type="radio" name="radio2" id="r2" value=2></td>
+<input type="radio" name="radio0" id="r0" value=0>
+</tr>
+</table>
+</form>
+</div>
+<script>
+test(function() {
+ var form = document.getElementById("form");
+ assert_array_equals(form.elements,
+ [document.getElementById("r0"),
+ document.getElementById("r1"),
+ document.getElementById("r2")]);
+}, "form.elements should work correctly in the face of table syntax errors")
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-sameobject.html b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-sameobject.html
new file mode 100644
index 000000000..d1ebac07f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-elements-sameobject.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Testing [SameObject] on the 'elements' attribute on the 'form' element</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+
+<form>
+ <input>
+</form>
+
+<script>
+test(function() {
+ var form = document.querySelector('form');
+ var elements = form.elements;
+ assert_true(elements === form.elements);
+ form.appendChild(document.createElement('input'));
+ assert_true(elements === form.elements);
+}, "[SameObject] should apply to 'elements' attr on <form>");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-form-element/form-indexed-element.html b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-indexed-element.html
new file mode 100644
index 000000000..66f00e761
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-indexed-element.html
@@ -0,0 +1,45 @@
+<!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")
+
+test(function(){
+ var form = document.getElementById("form");
+ var old_item = form[0];
+ var old_desc = Object.getOwnPropertyDescriptor(form, 0);
+ assert_equals(old_desc.value, old_item);
+ assert_true(old_desc.enumerable);
+ assert_true(old_desc.configurable);
+ assert_false(old_desc.writable);
+
+ Object.prototype[0] = 5;
+ this.add_cleanup(function () { delete Object.prototype[0]; });
+ assert_equals(form[0], old_item);
+
+ delete form[0];
+ assert_equals(form[0], old_item);
+
+ assert_throws(new TypeError(), function() {
+ "use strict";
+ delete form[0];
+ });
+ assert_equals(form[0], old_item);
+}, 'Trying to delete an indexed property name should never work');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-form-element/form-nameditem.html b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-nameditem.html
new file mode 100644
index 000000000..3edf903b7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-form-element/form-nameditem.html
@@ -0,0 +1,330 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Form named getter</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<!-- XXX Nothing tests id attributes yet. -->
+<!-- XXX Keygen. -->
+<!-- XXX We also need tests for moving inputs and forms in the DOM. -->
+<form>
+<input type=button name=button>
+<input type=radio name=radio value=x>
+<input type=radio name=radio value=y>
+<input type=radio name=radio value=z>
+</form>
+
+<form>
+<button name=l1></button>
+<fieldset name=l2></fieldset>
+<input type=hidden name=l3>
+<input type=text name=l4>
+<input type=search name=l5>
+<input type=tel name=l6>
+<input type=url name=l7>
+<input type=email name=l8>
+<input type=password name=l9>
+<input type=datetime name=l10>
+<input type=date name=l11>
+<input type=month name=l12>
+<input type=week name=l13>
+<input type=time name=l14>
+<input type=datetime-local name=l15>
+<input type=number name=l16>
+<input type=range name=l17>
+<input type=color name=l18>
+<input type=checkbox name=l19>
+<input type=radio name=l20>
+<input type=file name=l21>
+<input type=submit name=l22>
+<input type=image name=l23>
+<input type=reset name=l24>
+<input type=button name=l25>
+<input type=foo name=l26>
+<input name=l27>
+<object name=l28></object>
+<output name=l29></output>
+<select name=l30></select>
+<textarea name=l31></textarea>
+</form>
+
+<form>
+<!-- EventTarget -->
+<input type=radio name=addEventListener>
+<input type=radio name=removeEventListener>
+<input type=radio name=dispatchEvent>
+
+<!-- Node -->
+<input type=radio name=nodeType>
+<input type=radio name=nodeName>
+<input type=radio name=ownerDocument>
+
+<!-- Element -->
+<input type=radio name=namespaceURI>
+<input type=radio name=prefix>
+<input type=radio name=localName>
+
+<!-- HTMLElement -->
+<input type=radio name=title>
+<input type=radio name=lang>
+<input type=radio name=dir>
+
+<!-- HTMLFormElement -->
+<input type=radio name=acceptCharset>
+<input type=radio name=action>
+<input type=radio name=autocomplete>
+<input type=radio name=enctype>
+<input type=radio name=encoding>
+<input type=radio name=method>
+<input type=radio name=name>
+<input type=radio name=noValidate>
+<input type=radio name=target>
+<input type=radio name=elements>
+<input type=radio name=length>
+<input type=radio name=submit>
+<input type=radio name=reset>
+<input type=radio name=checkValidity>
+</form>
+
+<img name=x>
+<form></form><!-- no child nodes -->
+<img name=y>
+<form><!-- a child node --></form>
+<img name=z>
+
+<input form=a name=b>
+<form id=a></form>
+<input form=c name=d>
+<input form=c name=d>
+<form id=c></form>
+<script>
+test(function() {
+ var form = document.getElementsByTagName("form")[0]
+ assert_equals(form.item, undefined)
+ assert_false("item" in form)
+}, "Forms should not have an item method")
+
+test(function() {
+ var form = document.getElementsByTagName("form")[0]
+ assert_equals(form.namedItem, undefined)
+ assert_false("namedItem" in form)
+}, "Forms should not have a namedItem method")
+
+test(function() {
+ var form = document.getElementsByTagName("form")[0]
+ var button = document.getElementsByTagName("input")[0]
+ assert_equals(button.type, "button")
+ assert_equals(form.button, button)
+ var desc = Object.getOwnPropertyDescriptor(form, "button");
+ assert_equals(desc.value, button);
+ assert_false(desc.writable);
+ assert_true(desc.configurable);
+ assert_false(desc.enumerable);
+ assert_equals(form.button.length, undefined)
+}, "Name for a single element should work")
+
+test(function() {
+ var form = document.getElementsByTagName("form")[0]
+ assert_equals(form.radio.item(-1), null)
+ assert_array_equals([0, 1, 2].map(function(i) {
+ return form.radio.item(i).value
+ }), ["x", "y", "z"])
+ assert_equals(form.radio.item(3), null)
+}, "Calling item() on the NodeList returned from the named getter should work")
+
+test(function() {
+ var form = document.getElementsByTagName("form")[0]
+ assert_equals(form.radio.length, 3)
+ assert_equals(form.radio[-1], undefined)
+ assert_array_equals([0, 1, 2].map(function(i) {
+ return form.radio[i].value
+ }), ["x", "y", "z"])
+ assert_equals(form.radio[3], undefined)
+}, "Indexed getter on the NodeList returned from the named getter should work")
+
+test(function() {
+ var form = document.getElementsByTagName("form")[0]
+ var indices = [-1, 0, 1, 2, 3]
+ indices.forEach(function(i) {
+ assert_throws(new TypeError(), function() {
+ form.radio(i)
+ })
+ })
+}, "Invoking a legacycaller on the NodeList returned from the named getter " +
+ "should not work")
+
+test(function() {
+ var form = document.getElementsByTagName("form")[1]
+ for (var i = 1; i <= 31; ++i) {
+ if (i == 23) {
+ // input type=image
+ assert_equals(form["l" + i], undefined)
+ } else {
+ assert_equals(form["l" + i], form.children[i - 1])
+ }
+ }
+}, "All listed elements except input type=image should be present in the form")
+
+test(function() {
+ var names = [
+ // EventTarget
+ "addEventListener", "removeEventListener", "dispatchEvent",
+ // Node
+ "nodeType", "nodeName", "ownerDocument",
+ // Element
+ "namespaceURI", "prefix", "localName",
+ // HTMLElement
+ "title", "lang", "dir",
+ // HTMLFormElement
+ "acceptCharset", "action", "autocomplete", "enctype", "encoding", "method",
+ "name", "noValidate", "target", "elements", "length", "submit", "reset",
+ "checkValidity"
+ ]
+ var form = document.getElementsByTagName("form")[2]
+ names.forEach(function(name, i) {
+ assert_equals(form[name], form.children[i])
+ })
+}, "Named elements should override builtins")
+
+test(function() {
+ var form = document.getElementsByTagName("form")[3]
+ assert_equals(form.x, undefined, "x should not be associated with the form")
+ assert_equals(form.y, undefined, "y should not be associated with the form")
+ assert_equals(form.z, undefined, "z should not be associated with the form")
+ assert_equals(form[0], undefined, "The form should not have supported property indices")
+ assert_equals(form.length, 0)
+}, "Named items outside the form should not be returned (no children)")
+
+test(function() {
+ var form = document.getElementsByTagName("form")[4]
+ assert_equals(form.x, undefined, "x should not be associated with the form")
+ assert_equals(form.y, undefined, "y should not be associated with the form")
+ assert_equals(form.z, undefined, "z should not be associated with the form")
+ assert_equals(form[0], undefined, "The form should not have supported property indices")
+ assert_equals(form.length, 0)
+}, "Named items outside the form should not be returned (one child)")
+
+test(function() {
+ var form = document.getElementsByTagName("form")[5]
+ assert_equals(form.id, "a")
+
+ var input = document.getElementsByName("b")[0]
+ assert_equals(input.localName, "input")
+ assert_equals(input.getAttribute("form"), "a")
+
+ assert_equals(form.b, input);
+}, "The form attribute should be taken into account for named getters (single element)")
+
+test(function() {
+ var form = document.getElementsByTagName("form")[6]
+ assert_equals(form.id, "c")
+
+ var input1 = document.getElementsByName("d")[0]
+ assert_equals(input1.localName, "input")
+ assert_equals(input1.getAttribute("form"), "c")
+
+ var input2 = document.getElementsByName("d")[1]
+ assert_equals(input2.localName, "input")
+ assert_equals(input2.getAttribute("form"), "c")
+
+ var desc = Object.getOwnPropertyDescriptor(form, "d");
+ assert_equals(desc.value, form.d);
+ assert_false(desc.writable);
+ assert_true(desc.configurable);
+ assert_false(desc.enumerable);
+
+ assert_true(form.d instanceof NodeList, "form.d should be a NodeList")
+ assert_array_equals(form.d, [input1, input2])
+}, "The form attribute should be taken into account for named getters (multiple elements)")
+
+test(function() {
+ var f = document.body.appendChild(document.createElement("form"))
+ f.id = "f"
+ var g = f.appendChild(document.createElement("form"))
+ g.id = "g"
+ var input = g.appendChild(document.createElement("input"))
+ input.name = "x"
+ assert_equals(f.x, undefined)
+ assert_equals(g.x, input)
+}, "Input should only be a named property on the innermost form that contains it")
+
+test(function() {
+ var form = document.getElementsByTagName("form")[1];
+ var old_item = form["l1"];
+ var old_desc = Object.getOwnPropertyDescriptor(form, "l1");
+ assert_equals(old_desc.value, old_item);
+ assert_false(old_desc.enumerable);
+ assert_true(old_desc.configurable);
+ assert_false(old_desc.writable);
+
+ form["l1"] = 5;
+ assert_equals(form["l1"], old_item);
+ assert_throws(new TypeError(), function() {
+ "use strict";
+ form["l1"] = 5;
+ });
+ assert_throws(new TypeError(), function() {
+ Object.defineProperty(form, "l1", { value: 5 });
+ });
+
+ delete form["l1"];
+ assert_equals(form["l1"], old_item);
+
+ assert_throws(new TypeError(), function() {
+ "use strict";
+ delete form["l1"];
+ });
+ assert_equals(form["l1"], old_item);
+
+}, 'Trying to set an expando that would shadow an already-existing named property');
+
+test(function() {
+ var form = document.getElementsByTagName("form")[1];
+ var old_item = form["new-name"];
+ var old_desc = Object.getOwnPropertyDescriptor(form, "new-name");
+ assert_equals(old_item, undefined);
+ assert_equals(old_desc, undefined);
+
+ form["new-name"] = 5;
+ assert_equals(form["new-name"], 5);
+
+ var input = document.createElement("input");
+ this.add_cleanup(function () {input.remove();});
+ input.name = "new-name";
+ form.appendChild(input);
+
+ assert_equals(form["new-name"], 5);
+
+ delete form["new-name"];
+ assert_equals(form["new-name"], input);
+}, 'Trying to set an expando that shadows a named property that gets added later');
+
+test(function() {
+ var form = document.getElementsByTagName("form")[1];
+ var old_item = form["new-name2"];
+ var old_desc = Object.getOwnPropertyDescriptor(form, "new-name2");
+ assert_equals(old_item, undefined);
+ assert_equals(old_desc, undefined);
+
+ Object.defineProperty(form, "new-name2", { configurable: false, writable:
+ false, value: 5 });
+ assert_equals(form["new-name2"], 5);
+
+ var input = document.createElement("input");
+ this.add_cleanup(function () {input.remove();});
+ input.name = "new-name2";
+ form.appendChild(input);
+
+ assert_equals(form["new-name2"], 5);
+
+ delete form["new-name2"];
+ assert_equals(form["new-name2"], 5);
+
+ assert_throws(new TypeError(), function() {
+ "use strict";
+ delete form["new-name2"];
+ });
+ assert_equals(form["new-name2"], 5);
+}, 'Trying to set a non-configurable expando that shadows a named property that gets added later');
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-input-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/button.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/button.html
new file mode 100644
index 000000000..3c826a975
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/button.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>input type button</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#button-state-(type=button)">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form id=f1>
+ <input type=button id=b1 name=b1>
+</form>
+<form>
+ <input id=i1 value="foo">
+ <input type=button id=b2 name=b2>
+</form>
+<form>
+ <input type=radio id=i2 checked name=b3>
+ <input type=button id=b3 name=b3>
+</form>
+<form>
+ <input type=checkbox id=i3>
+ <input type=button id=b4 name=b4>
+</form>
+
+<script>
+ var t = async_test("clicking on button should not submit a form"),
+ b1 = document.getElementById('b1'),
+ b2 = document.getElementById('b2'),
+ b3 = document.getElementById('b3'),
+ b4 = document.getElementById('b4'),
+ i1 = document.getElementById('i1'),
+ i2 = document.getElementById('i2'),
+ i3 = document.getElementById('i3');
+
+ test(function(){
+ assert_false(b1.willValidate);
+ }, "the element is barred from constraint validation");
+
+ document.getElementById('f1').onsubmit = t.step_func(function(e) {
+ e.preventDefault();
+ assert_unreached("form has been submitted");
+ });
+
+ t.step(function() {
+ b1.click();
+ });
+ t.done();
+
+ test(function(){
+ i1.value = "bar";
+ b2.click();
+ assert_equals(i1.value, "bar");
+ }, "clicking on button should not reset other form fields");
+
+ test(function(){
+ assert_true(i2.checked);
+ b3.click();
+ assert_true(i2.checked);
+ }, "clicking on button should not unchecked radio buttons");
+
+ test(function(){
+ assert_false(i3.indeterminate);
+ b4.click();
+ assert_false(i3.indeterminate);
+ }, "clicking on button should not change its indeterminate IDL attribute");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/checkbox.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/checkbox.html
new file mode 100644
index 000000000..b1ccc64c1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/checkbox.html
@@ -0,0 +1,149 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>input type checkbox</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#checkbox-state-(type=checkbox)">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#run-synthetic-click-activation-steps">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<input type=checkbox id=checkbox1>
+<input type=checkbox id=checkbox2 disabled>
+<input type=checkbox id=checkbox3>
+<input type=checkbox id=checkbox4 checked>
+<input type=checkbox id=checkbox5>
+<input type=checkbox id=checkbox6>
+<script>
+ var checkbox1 = document.getElementById('checkbox1'),
+ checkbox2 = document.getElementById('checkbox2'),
+ checkbox3 = document.getElementById('checkbox3'),
+ checkbox4 = document.getElementById('checkbox4'),
+ checkbox5 = document.getElementById('checkbox5'),
+ checkbox6 = document.getElementById('checkbox6'),
+ c1_click_fired = false,
+ c1_input_fired = false,
+ c1_change_fired = false,
+ t1 = async_test("click on mutable checkbox fires a click event, then an input event, then a change event"),
+ t2 = async_test("click on non-mutable checkbox doesn't fire the input or change event"),
+ t3 = async_test("pre-activation steps on unchecked checkbox"),
+ t4 = async_test("pre-activation steps on checked checkbox"),
+ t5 = async_test("canceled activation steps on unchecked checkbox"),
+ t6 = async_test("canceled activation steps on unchecked checkbox (indeterminate=true in onclick)");
+
+ checkbox1.onclick = t1.step_func(function(e) {
+ c1_click_fired = true;
+ assert_false(c1_input_fired, "click event should fire before input event");
+ assert_false(c1_change_fired, "click event should fire before change event");
+ assert_false(e.isTrusted, "click()-initiated click event should not be trusted");
+ });
+ checkbox1.oninput = t1.step_func(function(e) {
+ c1_input_fired = true;
+ assert_true(c1_click_fired, "input event should fire after click event");
+ assert_false(c1_change_fired, "input event should fire before change event");
+ assert_true(e.bubbles, "event should bubble");
+ assert_true(e.isTrusted, "click()-initiated event should be trusted");
+ assert_false(e.cancelable, "event should not be cancelable");
+ assert_true(checkbox1.checked, "checkbox is checked");
+ assert_false(checkbox1.indeterminate, "checkbox is not indeterminate");
+ });
+
+ checkbox1.onchange = t1.step_func(function(e) {
+ c1_change_fired = true;
+ assert_true(c1_click_fired, "change event should fire after click event");
+ assert_true(c1_input_fired, "change event should fire after input event");
+ assert_true(e.bubbles, "event should bubble")
+ assert_true(e.isTrusted, "click()-initiated event should be trusted");
+ assert_false(e.cancelable, "event should not be cancelable");
+ assert_true(checkbox1.checked, "checkbox is checked");
+ assert_false(checkbox1.indeterminate, "checkbox is not indeterminate");
+ });
+
+ checkbox2.oninput= t2.step_func(function(e) {
+ assert_unreached("event input fired");
+ });
+
+ checkbox2.onchange = t2.step_func(function(e) {
+ assert_unreached("event change fired");
+ });
+
+ t1.step(function() {
+ checkbox1.click();
+ assert_true(c1_input_fired);
+ assert_true(c1_change_fired);
+ t1.done();
+ });
+
+ t2.step(function() {
+ checkbox2.click();
+ t2.done();
+ });
+
+ t3.step(function() {
+ checkbox3.indeterminate = true;
+ checkbox3.click();
+ assert_true(checkbox3.checked);
+ assert_false(checkbox3.indeterminate);
+ t3.done();
+ });
+
+ t4.step(function() {
+ checkbox4.indeterminate = true;
+ checkbox4.click();
+ assert_false(checkbox4.checked);
+ assert_false(checkbox4.indeterminate);
+ t4.done();
+ });
+
+ checkbox5.onclick = t5.step_func(function(e) {
+ e.preventDefault();
+ /*
+ The prevention of the click doesn't have an effect until after all the
+ click event handlers have been run.
+ */
+ assert_true(checkbox5.checked);
+ assert_false(checkbox5.indeterminate);
+ window.setTimeout(t5.step_func(function(e) {
+ /*
+ The click event has finished being dispatched, so the checkedness and
+ determinateness have been toggled back by now because the event
+ was preventDefault-ed.
+ */
+ assert_false(checkbox5.checked);
+ assert_false(checkbox5.indeterminate);
+ t5.done();
+ }), 0);
+ });
+
+ t5.step(function(){
+ assert_false(checkbox5.checked);
+ assert_false(checkbox5.indeterminate);
+ checkbox5.click();
+ });
+
+ checkbox6.onclick = t6.step_func(function(e) {
+ checkbox6.indeterminate = true;
+ e.preventDefault();
+ /*
+ The prevention of the click doesn't have an effect until after all the
+ click event handlers have been run.
+ */
+ assert_true(checkbox6.checked);
+ assert_true(checkbox6.indeterminate);
+ window.setTimeout(t6.step_func(function(e) {
+ /*
+ The click event has finished being dispatched, so the checkedness and
+ determinateness have been toggled back by now because the event
+ was preventDefault-ed.
+ */
+ assert_false(checkbox6.checked);
+ assert_false(checkbox6.indeterminate);
+ t6.done();
+ }), 0);
+ });
+
+ t6.step(function(){
+ assert_false(checkbox6.checked);
+ assert_false(checkbox6.indeterminate);
+ checkbox6.click();
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/checked.xhtml b/testing/web-platform/tests/html/semantics/forms/the-input-element/checked.xhtml
new file mode 100644
index 000000000..70aeb5109
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/checked.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>input@checked is immediately reflected to 'checked' IDL attribute</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<input style="display: none" type="checkbox" checked="">
+<script>
+test(function(){
+assert_true(document.querySelector('input').checked, 'Examining "checked" IDL attribute value:')
+});
+</script>
+</input>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/clone.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/clone.html
new file mode 100644
index 000000000..0f7e053ba
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/clone.html
@@ -0,0 +1,150 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test input value retention upon clone</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<style>form {display: none;} </style>
+<form>
+<p><input type=checkbox> This checkbox is initially unchecked.</p>
+<p><input type=checkbox checked="checked"> This checkbox is initially checked.</p>
+<p><input type=radio name=radio> This radiobutton is initially unchecked.</p>
+<p><input type=radio checked="checked" name=radio> This radiobutton is initially checked.</p>
+<p><input type=hidden value="DEFAULT
+DEFAULT"> This hidden field has the initial value "DEFAULT\nDEFAULT".</p>
+<p><input type=text value=DEFAULT> This text field has the initial value "DEFAULT".</p>
+<p><input type=search value=DEFAULT> This search field has the initial value "DEFAULT".</p>
+<p><input type=tel value=DEFAULT> This phone number field has the initial value "DEFAULT".</p>
+<p><input type=url value=https://default.invalid/> This URL field has the initial value "https://default.invalid/".</p>
+<p><input type=email value=default@default.invalid> This email field has the initial value "default@default.invalid".</p>
+<p><input type=password value=DEFAULT> This password field has the initial value "DEFAULT".</p>
+<p><input type=date value=2015-01-01> This date field has the initial value "2015-01-01".</p>
+<p><input type=month value=2015-01> This month field has the initial value "2015-01".</p>
+<p><input type=week value=2015-W01> This week field has the initial value "2015-W01".</p>
+<p><input type=time value=12:00> This time field has the initial value "12:00".</p>
+<p><input type=datetime-local value=2015-01-01T12:00> This datetime (local) field has the initial value "2015-01-01T12:00".</p>
+<p><input type=number value=1> This number field has the initial value "1".</p>
+<p><input type=range value=1> This range control has the initial value "1".</p>
+<p><input type=color value=#ff0000> This color picker has the initial value "#FF0000".</p>
+<p><input type="button" value="Clone" onclick="clone();"></p>
+</form>
+<script>
+setup(function() {
+ let form = document.getElementsByTagName("form")[0];
+ let inputs = form.getElementsByTagName("input");
+ inputs[0].checked = true;
+ inputs[1].checked = false;
+ inputs[2].checked = true;
+ inputs[4].value = "CHANGED\nCHANGED";
+ inputs[5].value = "CHANGED";
+ inputs[6].value = "CHANGED";
+ inputs[7].value = "CHANGED";
+ inputs[8].value = "https://changed.invalid/";
+ inputs[9].value = "changed@changed.invalid";
+ inputs[10].value = "CHANGED";
+ inputs[11].value = "2016-01-01";
+ inputs[12].value = "2016-01";
+ inputs[13].value = "2016-W01";
+ inputs[14].value = "12:30";
+ inputs[15].value = "2016-01-01T12:30";
+ inputs[16].value = "2";
+ inputs[17].value = "2";
+ inputs[18].value = "#00ff00";
+ let clone = form.cloneNode(true);
+ document.body.appendChild(clone);
+});
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_true(inputs[0].checked, "Should have retained checked state");
+}, "Checkbox must retain checked state.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_false(inputs[1].checked, "Should have retained unchecked state");
+}, "Checkbox must retain unchecked state.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_true(inputs[2].checked, "Should have retained checked state");
+}, "Radiobutton must retain checked state.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_false(inputs[3].checked, "Should have retained unchecked state");
+}, "Radiobutton must retain unchecked state.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[4].value, "CHANGED\nCHANGED", "Should have retained the changed value.");
+}, "Hidden field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[5].value, "CHANGED", "Should have retained the changed value.");
+}, "Text field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[6].value, "CHANGED", "Should have retained the changed value.");
+}, "Search field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[7].value, "CHANGED", "Should have retained the changed value.");
+}, "Phone number field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[8].value, "https://changed.invalid/", "Should have retained the changed value.");
+}, "URL field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[9].value, "changed@changed.invalid", "Should have retained the changed value.");
+}, "Email field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[10].value, "CHANGED", "Should have retained the changed value.");
+}, "Password field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[11].value, "2016-01-01", "Should have retained the changed value.");
+}, "Date field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[12].value, "2016-01", "Should have retained the changed value.");
+}, "Month field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[13].value, "2016-W01", "Should have retained the changed value.");
+}, "Week field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[14].value, "12:30", "Should have retained the changed value.");
+}, "Time field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[15].value, "2016-01-01T12:30", "Should have retained the changed value.");
+}, "Datetime (local) field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[16].value, "2", "Should have retained the changed value.");
+}, "Number field must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[17].value, "2", "Should have retained the changed value.");
+}, "Range control must retain changed value.");
+test(function() {
+ let clone = document.getElementsByTagName("form")[1];
+ let inputs = clone.getElementsByTagName("input");
+ assert_equals(inputs[18].value, "#00ff00", "Should have retained the changed value.");
+}, "Color picker must retain changed value.");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/cloning-steps.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/cloning-steps.html
new file mode 100644
index 000000000..9e6c46fd7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/cloning-steps.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Cloning of input elements</title>
+<link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode">
+<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone">
+<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone-ext">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/forms.html#the-input-element:concept-node-clone-ext">
+<link rel="author" title="Matthew Phillips" href="mailto:matthew@matthewphillips.info">
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<script>
+"use strict";
+
+test(function() {
+ var input = document.createElement("input");
+ input.value = "foo bar";
+
+ var copy = input.cloneNode();
+ assert_equals(copy.value, "foo bar");
+}, "input element's value should be cloned");
+
+test(function() {
+ var input = document.createElement("input");
+ input.value = "foo bar";
+
+ var copy = input.cloneNode();
+ copy.setAttribute("value", "something else");
+
+ assert_equals(copy.value, "foo bar");
+}, "input element's dirty value flag should be cloned, so setAttribute doesn't affect the cloned input's value");
+
+test(function() {
+ var input = document.createElement("input");
+ input.setAttribute("type", "radio");
+ input.checked = true;
+
+ var copy = input.cloneNode();
+ assert_equals(copy.checked, true);
+}, "input element's checkedness should be cloned");
+
+test(function() {
+ var input = document.createElement("input");
+ input.setAttribute("type", "radio");
+ input.checked = false;
+
+ var copy = input.cloneNode();
+ copy.setAttribute("checked", "checked");
+
+ assert_equals(copy.checked, false);
+}, "input element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/color.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/color.html
new file mode 100644
index 000000000..6164815f6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/color.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Form input type=color</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/multipage/common-microsyntaxes.html#colors">
+<link rel=help href="https://html.spec.whatwg.org/multipage/multipage/states-of-the-type-attribute.html#color-state-(type=color)">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var colors = [
+ {value: "", expected: "#000000", testname: "Empty value should return #000000"},
+ {expected: "#000000", testname: "Missing value should return #000000"},
+ {value: "#ffffff", expected: "#ffffff", testname: "Valid simple color: should return #ffffff"},
+ {value: "#FFFFFF", expected: "#ffffff", testname: "Valid simple color (containing LATIN CAPITAL LETTERS): should return #ffffff (converted to ASCII lowercase)"},
+ {value: "#0F0F0F", expected: "#0f0f0f", testname: "Zero-padding"},
+ {value: "#fff", expected: "#000000", testname: "Invalid simple color: not 7 characters long"},
+ {value: "fffffff", expected: "#000000", testname: "Invalid simple color: no starting # sign"},
+ {value: "#gggggg", expected: "#000000", testname: "Invalid simple color: non ASCII hex digits"},
+ {value: "foobar", expected: "#000000", testname: "Invalid simple color: foobar"},
+ {value: "#ffffff\u0000", expected: "#000000", testname: "Invalid color: trailing Null (U+0000)"},
+ {value: "#ffffff;", expected: "#000000", testname: "Invalid color: trailing ;"},
+ {value: " #ffffff", expected: "#000000", testname: "Invalid color: leading space"},
+ {value: "#ffffff ", expected: "#000000", testname: "Invalid color: trailing space"},
+ {value: " #ffffff ", expected: "#000000", testname: "Invalid color: leading+trailing spaces"},
+ {value: "crimson", expected: "#000000", testname: "Invalid color: keyword crimson"},
+ {value: "bisque", expected: "#000000", testname: "Invalid color: keyword bisque"},
+ {value: "currentColor", expected: "#000000", testname: "Invalid color: keyword currentColor"},
+ {value: "transparent", expected: "#000000", testname: "Invalid color: keyword transparent"},
+ {value: "ActiveBorder", expected: "#000000", testname: "Invalid color: keyword ActiveBorder"},
+ {value: "inherit", expected: "#000000", testname: "Invalid color: keyword inherit"},
+ {value: "rgb(1,1,1)", expected: "#000000", testname: "Invalid color: rgb(1,1,1)"},
+ {value: "rgb(1,1,1,1)", expected: "#000000", testname: "Invalid color: rgb(1,1,1,1)"},
+ {value: "#FFFFF\u1F4A9", expected: "#000000", testname: "Invalid color: PILE OF POO (U+1F4A9)"}
+ ];
+ for (var i = 0; i < colors.length; i++) {
+ var w = colors[i];
+ test(function() {
+ var input = document.createElement("input");
+ input.type = "color";
+ input.value = w.value;
+ assert_equals(input.value, w.expected);
+ }, w.testname);
+ }
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/contains.json b/testing/web-platform/tests/html/semantics/forms/the-input-element/contains.json
new file mode 100644
index 000000000..c2b780f0b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/contains.json
@@ -0,0 +1,154 @@
+[
+ {
+ "id": "states-of-the-type-attribute",
+ "original_id": "states-of-the-type-attribute",
+ "children": [
+ {
+ "id": "hidden-state-type-hidden",
+ "original_id": "hidden-state-(type=hidden)"
+ },
+ {
+ "id": "text-type-text-state-and-search-state-type-search",
+ "original_id": "text-(type=text)-state-and-search-state-(type=search)"
+ },
+ {
+ "id": "telephone-state-type-tel",
+ "original_id": "telephone-state-(type=tel)"
+ },
+ {
+ "id": "url-state-type-url",
+ "original_id": "url-state-(type=url)"
+ },
+ {
+ "id": "e-mail-state-type-email",
+ "original_id": "e-mail-state-(type=email)"
+ },
+ {
+ "id": "password-state-type-password",
+ "original_id": "password-state-(type=password)"
+ },
+ {
+ "id": "date-and-time-state-type-datetime",
+ "original_id": "date-and-time-state-(type=datetime)"
+ },
+ {
+ "id": "date-state-type-date",
+ "original_id": "date-state-(type=date)"
+ },
+ {
+ "id": "month-state-type-month",
+ "original_id": "month-state-(type=month)"
+ },
+ {
+ "id": "week-state-type-week",
+ "original_id": "week-state-(type=week)"
+ },
+ {
+ "id": "time-state-type-time",
+ "original_id": "time-state-(type=time)"
+ },
+ {
+ "id": "local-date-and-time-state-type-datetime-local",
+ "original_id": "local-date-and-time-state-(type=datetime-local)"
+ },
+ {
+ "id": "number-state-type-number",
+ "original_id": "number-state-(type=number)"
+ },
+ {
+ "id": "range-state-type-range",
+ "original_id": "range-state-(type=range)"
+ },
+ {
+ "id": "color-state-type-color",
+ "original_id": "color-state-(type=color)"
+ },
+ {
+ "id": "checkbox-state-type-checkbox",
+ "original_id": "checkbox-state-(type=checkbox)"
+ },
+ {
+ "id": "radio-button-state-type-radio",
+ "original_id": "radio-button-state-(type=radio)"
+ },
+ {
+ "id": "file-upload-state-type-file",
+ "original_id": "file-upload-state-(type=file)"
+ },
+ {
+ "id": "submit-button-state-type-submit",
+ "original_id": "submit-button-state-(type=submit)"
+ },
+ {
+ "id": "image-button-state-type-image",
+ "original_id": "image-button-state-(type=image)"
+ },
+ {
+ "id": "reset-button-state-type-reset",
+ "original_id": "reset-button-state-(type=reset)"
+ },
+ {
+ "id": "button-state-type-button",
+ "original_id": "button-state-(type=button)"
+ }
+ ]
+ },
+ {
+ "id": "input-impl-notes",
+ "original_id": "input-impl-notes"
+ },
+ {
+ "id": "common-input-element-attributes",
+ "original_id": "common-input-element-attributes",
+ "children": [
+ {
+ "id": "the-maxlength-attribute",
+ "original_id": "the-maxlength-attribute"
+ },
+ {
+ "id": "the-size-attribute",
+ "original_id": "the-size-attribute"
+ },
+ {
+ "id": "the-readonly-attribute",
+ "original_id": "the-readonly-attribute"
+ },
+ {
+ "id": "the-required-attribute",
+ "original_id": "the-required-attribute"
+ },
+ {
+ "id": "the-multiple-attribute",
+ "original_id": "the-multiple-attribute"
+ },
+ {
+ "id": "the-pattern-attribute",
+ "original_id": "the-pattern-attribute"
+ },
+ {
+ "id": "the-min-and-max-attributes",
+ "original_id": "the-min-and-max-attributes"
+ },
+ {
+ "id": "the-step-attribute",
+ "original_id": "the-step-attribute"
+ },
+ {
+ "id": "the-list-attribute",
+ "original_id": "the-list-attribute"
+ },
+ {
+ "id": "the-placeholder-attribute",
+ "original_id": "the-placeholder-attribute"
+ }
+ ]
+ },
+ {
+ "id": "common-input-element-apis",
+ "original_id": "common-input-element-apis"
+ },
+ {
+ "id": "common-event-behaviors",
+ "original_id": "common-event-behaviors"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/date.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/date.html
new file mode 100644
index 000000000..70885ed05
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/date.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Inputs Date</title>
+ <link rel="author" title="Morishita Hiromitsu" href="mailto:hero@asterisk-works.jp">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#date-state-(type=date)">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dates-and-times">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <h1>Inputs Date</h1>
+ <div style="display: none">
+ <input id="valid" type="date" value="2011-11-01" min="2011-01-01" max="2011-12-31" />
+ <input id="too_small_value" type="date" value="1999-01-31" min="2011-01-01" max="2011-12-31"/>
+ <input id="too_large_value" type="date" value="2099-01-31" min="2011-01-01" max="2011-12-31"/>
+ <input id="invalid_min" type="date" value="2011-01-01" min="1999-1" max="2011-12-31"/>
+ <input id="invalid_max" type="date" value="2011-01-01" min="2011-01-01" max="2011-13-162-777"/>
+ <input id="min_larger_than_max" type="date" value="2011-01-01" min="2099-01" max="2011-12-31"/>
+ <input id="invalid_value" type="date" value="invalid-date" min="2011-01-01" max="2011-12-31"/>
+ </div>
+
+ <div id="log"></div>
+
+ <script type="text/javascript">
+ test(function() {
+ assert_equals(document.getElementById("valid").type, "date")
+ }, "date type support on input element");
+
+ test(function() {
+ assert_equals(document.getElementById("valid").value, "2011-11-01");
+ assert_equals(document.getElementById("too_small_value").value, "2011-01-01");
+ assert_equals(document.getElementById("too_large_value").value, "2011-12-31");
+ }, "The value attribute, if specified and not empty, must have a value that is a valid date string.");
+
+ test(function() {
+ assert_equals(document.getElementById("valid").min, "2011-01-01"),
+ assert_equals(document.getElementById("invalid_min").min, "")
+ }, "The min attribute, if specified, must have a value that is a valid date string.");
+
+ test(function() {
+ assert_equals(document.getElementById("valid").max, "2011-12-31"),
+ assert_equals(document.getElementById("min_larger_than_max").max, "2099-01"),
+ assert_equals(document.getElementById("invalid_max").max, "")
+ },"The max attribute, if specified, must have a value that is a valid date string.");
+
+ test(function() {
+ assert_equals(document.getElementById("invalid_value").value, "");
+ }, "User agents must not allow the user to set the value to a non-empty string that is not a valid date string.");
+ test(function() {
+ var numDays = [
+ // the number of days in month month of year year is: 31 if month is 1, 3, 5, 7, 8, 10, or 12;
+ {value: "2014-01-31", expected: "2014-01-31", testname: "January has 31 days"},
+ {value: "2014-01-32", expected: "", testname: "January has 31 days"},
+ {value: "2014-03-31", expected: "2014-03-31", testname: "March has 31 days"},
+ {value: "2014-03-32", expected: "", testname: "March has 31 days"},
+ {value: "2014-05-31", expected: "2014-05-31", testname: "May has 31 days"},
+ {value: "2014-05-32", expected: "", testname: "May has 31 days"},
+ {value: "2014-07-31", expected: "2014-07-31", testname: "July has 31 days"},
+ {value: "2014-07-32", expected: "", testname: "July has 31 days"},
+ {value: "2014-08-31", expected: "2014-08-31", testname: "August has 31 days"},
+ {value: "2014-08-32", expected: "", testname: "August has 31 days"},
+ {value: "2014-10-31", expected: "2014-10-31", testname: "October has 31 days"},
+ {value: "2014-10-32", expected: "", testname: "October has 31 days"},
+ {value: "2014-12-31", expected: "2014-12-31", testname: "December has 31 days"},
+ {value: "2014-12-32", expected: "", testname: "December has 31 days"},
+ // the number of days in month month of year year is: 30 if month is 4, 6, 9, or 11;
+ {value: "2014-04-30", expected: "2014-04-30", testname: "April has 30 days"},
+ {value: "2014-04-31", expected: "", testname: "April has 30 days"},
+ {value: "2014-06-30", expected: "2014-06-30", testname: "June has 30 days"},
+ {value: "2014-06-31", expected: "", testname: "June has 30 days"},
+ {value: "2014-09-30", expected: "2014-09-30", testname: "September has 30 days"},
+ {value: "2014-09-31", expected: "", testname: "September has 30 days"},
+ {value: "2014-11-30", expected: "2014-11-30", testname: "November has 30 days"},
+ {value: "2014-11-31", expected: "", testname: "November has 30 days"},
+ // leap years
+ {value: "2014-02-28", expected: "2014-02-28", testname: "2014 is not a leap year: February has 28 days"},
+ {value: "2014-02-29", expected: "", testname: "2014 is not a leap year: February has 28 days: value should be empty"},
+ {value: "2016-02-29", expected: "2016-02-29", testname: "2016 is a leap year: February has 29 days"}
+ ];
+ for (var i = 0; i < numDays.length; i++) {
+ var input = document.createElement("input");
+ input.type = "date";
+ input.value = numDays[i].value;
+ assert_equals(input.value, numDays[i].expected, numDays[i].testname);
+ }
+ }, "Number of days");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/datetime-local.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/datetime-local.html
new file mode 100644
index 000000000..b4548b77a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/datetime-local.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Form input type=datetime-local</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/multipage/common-microsyntaxes.html#local-dates-and-times">
+<link rel=help href="https://html.spec.whatwg.org/multipage/multipage/states-of-the-type-attribute.html#local-date-and-time-state-(type=datetime-local)">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var datetimeLocal = [
+ {value: "", expected: "", testname: "empty value"},
+ {value: "2014-01-01T11:11:11.111", expected: "2014-01-01T11:11:11.111", testname: "datetime-local input value set to 2014-01-01T11:11:11.111 without min/max"},
+ {value: "2014-01-01 11:11:11.111", expected: "2014-01-01T11:11:11.111", testname: "datetime-local input value set to 2014-01-01 11:11:11.111 without min/max"},
+ {value: "2014-01-01 11:11", expected: "2014-01-01T11:11", testname: "datetime-local input value set to 2014-01-01 11:11 without min/max"},
+ {value: "2014-01-01 00:00:00.000", expected: "2014-01-01T00:00", testname: "datetime-local input value set to 2014-01-01 00:00:00.000 without min/max"},
+ {value: "2014-01-0 11:11", expected: "", testname: "datetime-local input value set to 2014-01-0 11:11 without min/max"},
+ {value: "2014-01-01 11:1", expected: "", testname: "datetime-local input value set to 2014-01-01 11:1 without min/max"},
+ {value: "2014-01-01 11:12", attributes: { min: "2014-01-01 11:11" }, expected: "2014-01-01T11:12", testname: "Value >= min attribute"},
+ {value: "2014-01-01 11:10", attributes: { min: "2014-01-01 11:11" }, expected: "2014-01-01T11:11", testname: "Value < min attribute"},
+ {value: "2014-01-01 11:10", attributes: { max: "2014-01-01 11:11" }, expected: "2014-01-01T11:10", testname: "Value <= max attribute"},
+ {value: "2014-01-01 11:12", attributes: { max: "2014-01-01 11:11" }, expected: "2014-01-01T11:11", testname: "Value > max attribute"}
+ ];
+ for (var i = 0; i < datetimeLocal.length; i++) {
+ var w = datetimeLocal[i];
+ test(function() {
+ var input = document.createElement("input");
+ input.type = "datetime-local";
+ input.value = w.value;
+ for(var attr in w.attributes) {
+ input[attr] = w.attributes[attr];
+ }
+ assert_equals(input.value, w.expected);
+ }, w.testname);
+ }
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/datetime.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/datetime.html
new file mode 100644
index 000000000..2e909da2d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/datetime.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Date & Time Inputs</title>
+ <meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no" />
+ <link rel="author" title="Fabrice Clari" href="mailto:f.clari@inno-group.com">
+ <link rel="author" title="Dimitri Bocquet" href="mailto:Dimitri.Bocquet@mosquito-fp7.eu">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-input-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+
+ <h1>Date & Time Inputs</h1>
+ <div style="display: none">
+ <input type="date" value="2011-12-01" min="2011-12-01" max="2011-12-31" step="5" />
+ <input type="time" value= "12:00" min="11:30" max="14:00" step="600" />
+ <input type="datetime" value="2011-12-01T12:00Z" min="2011-12-01T12:00Z" max="2011-12-31T22:00Z" step="7200" />
+ <input type="month" value="2011-01" min="2011-01" max="2011-12" step="2" />
+ <input type="week" value="2011-W40" min="2011-W20" max="2011-W50" step="2" />
+ </div>
+
+ <div id="log">
+ </div>
+
+ <script type="text/javascript">
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].type, "date")}, "date type support on input element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-type" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].value, "2011-12-01")}, "[date] The value must be a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-value" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].min, "2011-12-01")}, "[date] The min attribute must have a value that is a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-min" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].max, "2011-12-31")}, "[date] The max attribute must have a value that is a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-max" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].step, "5")}, "[date] The step attribute must be expressed in seconds", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-step" });
+ test(function() {assert_true(typeof(document.getElementsByTagName("input")[0].stepUp) == "function")}, "[date] stepUp method support on input 'date' element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepup" });
+ test(function() {assert_true(typeof(document.getElementsByTagName("input")[0].stepDown) == "function")}, "[date] stepDown method support on input 'date' element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepdown" });
+
+ test(function() {assert_equals(document.getElementsByTagName("input")[1].type, "time")}, "[time] time type support on input element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-type" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[1].value, "12:00")}, "[time] The value must be a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-value" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[1].min, "11:30")}, "[time] The min attribute must have a value that is a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-min" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[1].max, "14:00")}, "[time] The max attribute must have a value that is a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-max" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[1].step, "600")}, "[time] The step attribute must be expressed in seconds", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-step" });
+ test(function() {assert_true(typeof(document.getElementsByTagName("input")[1].stepUp) == "function")}, "[time] stepUp method support on input 'time' element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepup" });
+ test(function() {assert_true(typeof(document.getElementsByTagName("input")[1].stepDown) == "function")}, "[time] stepDown method support on input 'time' element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepdown" });
+
+ test(function() {assert_equals(document.getElementsByTagName("input")[2].type, "datetime")}, "datetime type support on input element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-type" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[2].value, "2011-12-01T12:00Z")}, "[datetime] The must be a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-value" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[2].min, "2011-12-01T12:00Z")}, "[datetime] The min attribute must have a value that is a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-min" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[2].max, "2011-12-31T22:00Z")}, "[datetime] The max attribute must have a value that is a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-max" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[2].step, "7200")}, "[datetime] The step attribute must be expressed in seconds", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-step" });
+ test(function() {assert_true(typeof(document.getElementsByTagName("input")[2].stepUp) == "function")}, "[datetime] stepUp method support on input 'datetime' element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepup" });
+ test(function() {assert_true(typeof(document.getElementsByTagName("input")[2].stepDown) == "function")}, "[datetime] stepDown method support on input 'datetime' element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepdown" });
+
+ test(function() {assert_equals(document.getElementsByTagName("input")[3].type, "month")}, "month type support on input element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-type" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[3].value, "2011-01")}, "[month] The value must be a value that is a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-value" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[3].min, "2011-01")}, "[month] The min attribute must have a value that is a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-min" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[3].max, "2011-12")}, "[month] The max attribute must have a value that is a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-max" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[3].step, "2")}, "[month] The step attribute must be expressed in seconds", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-step" });
+ test(function() {assert_true(typeof(document.getElementsByTagName("input")[3].stepUp) == "function")}, "[month] stepUp method support on input 'month' element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepup" });
+ test(function() {assert_true(typeof(document.getElementsByTagName("input")[3].stepDown) == "function")}, "[month] stepDown method support on input 'month' element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepdown" });
+
+ test(function() {assert_equals(document.getElementsByTagName("input")[4].type, "week")}, "week type support on input element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-type" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[4].value, "2011-W40")}, "[week] The value must be a value that is a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-value" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[4].min, "2011-W20")}, "[week] The min attribute must have a value that is a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-min" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[4].max, "2011-W50")}, "[week] The max attribute must have a value that is a valid global date and time string", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-max" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[4].step, "2")}, "[week] The step attribute must be expressed in seconds", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-step" });
+ test(function() {assert_true(typeof(document.getElementsByTagName("input")[4].stepUp) == "function")}, "[week] stepUp method support on input 'week' element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepup" });
+ test(function() {assert_true(typeof(document.getElementsByTagName("input")[4].stepDown) == "function")}, "[week] stepDown method support on input 'week' element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepdown" });
+
+ </script>
+
+ </body>
+
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/email.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/email.html
new file mode 100644
index 000000000..fc92529ef
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/email.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<title>Input Email</title>
+<link rel="author" title="Kazuki Kanamori" href="mailto:yogurito@gmail.com">
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#e-mail-state-(type=email)">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<input type="email" id="single_email" value="user@example.com"/>
+<input type="email" id="multiple_email" value="user1@example.com, user2@test.com" multiple/>
+<div id="log"></div>
+
+<script type="text/javascript">
+ var single = document.getElementById('single_email'),
+ mult = document.getElementById('multiple_email');
+
+ test(function(){
+ assert_false(single.multiple);
+ }, "single_email doesn't have the multiple attribute");
+
+ test(function(){
+ single.value = 'user2@example.com\u000A';
+ assert_equals(single.value, 'user2@example.com');
+ single.value = 'user3@example.com\u000D';
+ assert_equals(single.value, 'user3@example.com');
+ }, 'value should be sanitized: strip line breaks');
+
+ test(function(){
+ single.value = 'user4@example.com';
+ assert_true(single.validity.valid);
+ single.value = 'example.com';
+ assert_false(single.validity.valid);
+ }, 'Email address validity');
+
+ test(function(){
+ single.setAttribute('multiple', true);
+ single.value = ' user@example.com , user2@example.com ';
+ assert_equals(single.value, 'user@example.com,user2@example.com');
+ single.removeAttribute('multiple');
+ assert_equals(single.value, 'user@example.com,user2@example.com');
+ }, 'When the multiple attribute is removed, the user agent must run the value sanitization algorithm');
+
+ test(function(){
+ assert_true(mult.multiple);
+ }, "multiple_email has the multiple attribute");
+
+ test(function(){
+ mult.value = ' user1@example.com , user2@test.com, user3@test.com ';
+ assert_equals(mult.value, 'user1@example.com,user2@test.com,user3@test.com');
+ }, "run the value sanitization algorithm after setting a new value");
+
+ test(function(){
+ mult.value = 'user1@example.com,user2@test.com,user3@test.com';
+ assert_true(mult.validity.valid);
+
+ mult.value = 'u,ser1@example.com,user2@test.com,user3@test.com';
+ assert_false(mult.validity.valid);
+ }, "valid value is a set of valid email addresses separated by a single ','");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/file-manual.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/file-manual.html
new file mode 100644
index 000000000..9e2d47c42
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/file-manual.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>input type file</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#file-upload-state-(type=file)">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<p>Manual test: clicking on the input should open a prompt allowing you to select a file.</p>
+<input type=file id=file>
+<script>
+ setup({explicit_timeout:true});
+
+ var input = document.getElementById('file'),
+ t1 = async_test("selecting files should fire the input event at the input element"),
+ t2 = async_test("selecting files should fire the change event at the input element");
+
+ document.getElementById('file').oninput = t1.step_func_done(function(e) {
+ assert_true(e.bubbles, "input event bubbles");
+ assert_true(e.isTrusted, "input event should be trusted");
+ assert_false(e.cancelable, "input event should not be cancelable");
+ })
+ document.getElementById('file').onchange = t2.step_func_done(function(e) {
+ assert_true(e.bubbles, "change event bubbles");
+ assert_true(e.isTrusted, "change event should be trusted");
+ assert_false(e.cancelable, "change event should not be cancelable");
+ assert_true(input.files instanceof FileList);
+ assert_equals(input.value, "C:\\fakepath\\" + input.files[0].name);
+ })
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/files.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/files.html
new file mode 100644
index 000000000..107b86c08
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/files.html
@@ -0,0 +1,48 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLInputElement#files</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var types = [
+ "hidden",
+ "text",
+ "search",
+ "tel",
+ "url",
+ "email",
+ "password",
+ "date",
+ "month",
+ "week",
+ "time",
+ "datetime-local",
+ "number",
+ "range",
+ "color",
+ "checkbox",
+ "radio",
+ "submit",
+ "image",
+ "reset",
+ "button",
+];
+
+types.forEach(function(type) {
+ test(function() {
+ var input = document.createElement("input");
+ input.type = type;
+ assert_equals(input.files, null, "files should be null");
+ }, "files for input type=" + type);
+});
+
+test(function() {
+ var input = document.createElement("input");
+ input.type = "file";
+ assert_not_equals(input.files, null);
+ assert_true(input.files instanceof FileList, "files should be a FileList");
+ var files = input.files;
+ assert_equals(input.files, files, "files should return the same object");
+}, "files for input type=file");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/hidden.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/hidden.html
new file mode 100644
index 000000000..4aca00d8c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/hidden.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Hidden input element</title>
+ <link rel="author" title="Kinuko Yasuda" href="mailto:kinuko@chromium.org">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#hidden-state-(type=hidden)">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+
+ <body>
+ <h1>Hidden input element</h1>
+ <div style="display: none">
+
+ <input id="hidden" type="hidden" />
+ <input id="hidden_with_value" type="hidden" value="foo" />
+
+ </div>
+ <div id="log"></div>
+ <script type="text/javascript">
+
+ test(
+ function() {
+ assert_equals(document.getElementById("hidden").value, "");
+ assert_equals(document.getElementById("hidden_with_value").value, "foo");
+ }, "Value returns the current value for hidden");
+
+ test(
+ function() {
+ document.getElementById("hidden").value = "A";
+ assert_equals(document.getElementById("hidden").value, "A");
+ document.getElementById("hidden").value = "B";
+ assert_equals(document.getElementById("hidden").value, "B");
+ }, "Setting value changes the current value for hidden");
+
+ test(
+ function() {
+ assert_equals(document.getElementById("hidden").files, null);
+ }, "files attribute must return null for hidden");
+
+ test(
+ function() {
+ assert_equals(document.getElementById("hidden").valueAsDate, null);
+ }, "valueAsDate attribute must return null for hidden");
+
+ test(
+ function() {
+ assert_equals(document.getElementById("hidden").valueAsNumber, NaN);
+ }, "valueAsNumber attribute must return NaN for hidden");
+
+ test(
+ function() {
+ assert_equals(document.getElementById("hidden").list, null);
+ }, "list attribute must return null for hidden");
+
+ test(
+ function() {
+ var el = document.getElementById("hidden");
+ assert_throws("InvalidStateError", function() { el.stepDown(); }, "");
+ }, "stepDown does not apply for hidden");
+
+ test(
+ function() {
+ var el = document.getElementById("hidden");
+ assert_throws("InvalidStateError", function() { el.stepUp(); }, "");
+ }, "stepUp does not apply for hidden");
+
+ test(function(){
+ var el = document.getElementById("hidden");
+ assert_false(el.willValidate);
+ }, "input type=hidden is barred from constraint validation");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/image01-ref.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/image01-ref.html
new file mode 100644
index 000000000..62c141d96
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/image01-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>input type image reference file</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<img src="/media/poster.png"/>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/image01.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/image01.html
new file mode 100644
index 000000000..e9028dcee
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/image01.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>input type image</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#image-button-state-(type=image)">
+<link rel="match" href="image01-ref.html">
+<input type=image id=image src="/media/poster.png">
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-button.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-button.html
new file mode 100644
index 000000000..0f269355a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-button.html
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML>
+<head>
+<title>input type button</title>
+<link rel="author" title="Takeharu.Oshida" href="mailto:georgeosddev@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#button-state-(type=button)">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<div id="hide" style="display">
+ <input type="button"/>
+ <input type="button" value="BUTTON"/>
+ <form action="/" method="get" onsubmit="isSubmitted = true;return false;">
+ <input type="button" value="mutable"/>
+ </form>
+ <form action="/" method="get" onsubmit="isSubmitted = true;return false;">
+ <input type="button" value="immutable" disabled/>
+ </form>
+</div>
+<script>
+var isSubmitted = false;
+var buttons = document.getElementsByTagName("input");
+
+test(function() {
+ assert_equals(buttons[0].click(), undefined, "The input element represents a button with no default behavior");
+},"default behavior");
+
+test(function() {
+ assert_equals(buttons[0].value, "", "It must be the empty string");
+},"empty value attribute");
+
+test(function() {
+ document.getElementById("hide").style.display = "block";
+ assert_not_equals(buttons[0].offsetWidth, buttons[1].offsetWidth, "If the element has a value attribute, the button's label must be the value of that attribute");
+ document.getElementById("hide").style.display = "none";
+},"label value");
+
+test(function() {
+ isSubmitted = false;
+ buttons[2].click();
+ assert_equals(isSubmitted, false, "If the element is mutable, the element's activation behavior is to do nothing.");
+},"mutable element's activation behavior is to do nothing.");
+
+test(function() {
+ isSubmitted = false;
+ buttons[3].click()
+ assert_equals(isSubmitted, false, "If the element is immutable, the element has no activation behavior.");
+},"immutable element has no activation behavior.");
+</script>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-checkbox.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-checkbox.html
new file mode 100644
index 000000000..7dd2f26b1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-checkbox.html
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML>
+<head>
+<title>input type checkbox</title>
+<link rel="author" title="Gary Gao" href="mailto:angrytoast@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#checkbox-state-(type=checkbox)">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div style="display:none;">
+ <input id="checkbox_default" type="checkbox" width="20" />
+
+ <input id="checkbox_checked" type="checkbox" checked />
+
+ <input id="checkbox_indeterminate" type="checkbox" />
+
+ <input id="checkbox_default_value" type="checkbox" />
+</div>
+
+<div id="log"></div>
+
+<script>
+ var checkbox_default = document.getElementById('checkbox_default'),
+ checkbox_checked = document.getElementById('checkbox_checked'),
+ checkbox_indeterminate = document.getElementById('checkbox_indeterminate'),
+ checkbox_default_value = document.getElementById('checkbox_default_value');
+
+ test(function() {
+ assert_false(checkbox_default.checked);
+ }, "default checkbox has no checkedness state");
+
+ test(function() {
+ assert_true(checkbox_checked.checked);
+ }, "checkbox with initial state set to checked has checkedness state");
+
+ test(function() {
+ checkbox_default.checked = 'chicken'
+ assert_true(checkbox_default.checked);
+ }, "changing the checked attribute to a string sets the checkedness state");
+
+ test(function() {
+ assert_false(checkbox_indeterminate.indeterminate);
+ }, "a checkbox has an indeterminate state set to false onload");
+
+ test(function() {
+ checkbox_indeterminate.indeterminate = true,
+ assert_true(checkbox_indeterminate.indeterminate);
+ }, "on setting, a checkbox's indeterminate state must be set to the new value and returns the last value it was set to");
+
+ test(function() {
+ assert_equals(checkbox_default_value.value, 'on');
+ }, "default/on: on getting, if the element has a value attribute, it must return that attribute's value; otherwise, it must return the string 'on'");
+
+ test(function() {
+ checkbox_default_value.value = 'chicken'
+ assert_equals(checkbox_default_value.value, 'chicken');
+ }, "on getting, if the element has a value attribute, it must return that attribute's value");
+</script>
+
+</body>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/maxlength-manual.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/maxlength-manual.html
new file mode 100644
index 000000000..fdf6c2644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/maxlength-manual.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset=utf-8>
+ <title>input max length</title>
+ <link rel="author" title="Sam Gibson" href="mailto:sam@ifdown.net">
+ <link rel=help href="https://html.spec.whatwg.org/multipage/forms.html#the-maxlength-and-minlength-attributes">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+
+ <body>
+ <div id="log"></div>
+ <p>Type a letter anywhere into the input field (do not select any text, or otherwise manipulate the input)</p>
+ <input type=text maxlength=4 id=only-four value="inpu"></input>
+
+ <script>
+ var input;
+ setup(function() {
+ input = document.getElementById('only-four');
+ }, {explicit_done: true, explicit_timeout: true});
+
+
+ on_event(input, 'keyup', function(event) {
+ if ((event.keyCode >= 65 && event.keyCode <= 90) ||
+ (event.keyCode >= 97 && event.keyCode <= 122)) {
+ test(function() {
+ assert_equals(input.value, "inpu");
+ }, 'input content should limit to maxlength')
+
+ done();
+ }
+ });
+ </script>
+ </body>
+</html>
+
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/maxlength.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/maxlength.html
new file mode 100644
index 000000000..8f0a2567d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/maxlength.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>input max length</title>
+ <link rel="author" title="Sam Gibson" href="mailto:sam@ifdown.net">
+ <link rel=help href="https://html.spec.whatwg.org/multipage/forms.html#the-maxlength-and-minlength-attributes">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+
+ <body>
+ <h1>Text input element</h1>
+
+ <div style="display: none">
+ <input id="none" />
+ <input id="negative" type="-5" />
+ <input id="non-numeric" type="not-a-number" />
+ <input id="assign-negative" />
+ <input id="assign-non-numeric" />
+ </div>
+
+ <div id="log"></div>
+
+ <script type="text/javascript">
+ test(
+ function() {
+ assert_equals(document.getElementById("none").maxLength, -1);
+ }, "Unset maxlength is -1");
+
+ test(
+ function() {
+ assert_equals(document.getElementById("negative").maxLength, -1);
+ }, "Negative maxlength is always -1");
+
+ test(
+ function() {
+ assert_equals(document.getElementById("non-numeric").maxLength, -1);
+ }, "Non-numeric maxlength is -1");
+
+ test(
+ function() {
+ assert_throws("INDEX_SIZE_ERR", function() {
+ document.getElementById("assign-negative").maxLength = -5;
+ });
+ }, "Assigning negative integer throws IndexSizeError");
+
+ test(
+ function() {
+ document.getElementById("assign-non-numeric").maxLength = "not-a-number";
+ assert_equals(document.getElementById("assign-non-numeric").maxLength, 0);
+ }, "Assigning non-numeric to maxlength sets maxlength to 0");
+ </script>
+ </body>
+</html>
+
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/minlength.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/minlength.html
new file mode 100644
index 000000000..7bfdf189a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/minlength.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>input min length</title>
+ <link rel="author" title="Taryn Hill" href="mailto:Phrohdoh@gmail.com">
+ <link rel=help href="https://html.spec.whatwg.org/multipage/forms.html#the-minlength-and-minlength-attributes">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+
+ <body>
+ <h1>Text input element</h1>
+
+ <div style="display: none">
+ <input id="none" />
+ <input id="negative" minlength=-5 />
+ <input id="non-numeric" minlength="not-a-number" />
+ <input id="assign-negative" />
+ <input id="assign-non-numeric" />
+ </div>
+
+ <div id="log"></div>
+
+ <script type="text/javascript">
+ test(
+ function() {
+ assert_equals(document.getElementById("none").minLength, -1);
+ }, "Unset minlength is -1");
+
+ test(
+ function() {
+ assert_equals(document.getElementById("negative").minLength, -1);
+ }, "Negative minlength is always -1");
+
+ test(
+ function() {
+ assert_equals(document.getElementById("non-numeric").minLength, -1);
+ }, "Non-numeric minlength is -1");
+
+ test(
+ function() {
+ assert_throws("INDEX_SIZE_ERR", function() {
+ document.getElementById("assign-negative").minLength = -5;
+ });
+ }, "Assigning negative integer throws IndexSizeError");
+
+ test(
+ function() {
+ document.getElementById("assign-non-numeric").minLength = "not-a-number";
+ assert_equals(document.getElementById("assign-non-numeric").minLength, 0);
+ }, "Assigning non-numeric to minlength sets minlength to 0");
+ </script>
+ </body>
+</html>
+
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/month.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/month.html
new file mode 100644
index 000000000..15fa76dd4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/month.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Inputs Month</title>
+ <link rel="author" title="Morishita Hiromitsu" href="mailto:hero@asterisk-works.jp">
+ <link rel="author" title="kaseijin" href="mailto:pcmkas@gmail.com">
+ <link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#months">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#month-state-(type=month)">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <h1>Inputs Month</h1>
+ <div style="display: none">
+ <input id="valid" type="month" value="2011-11" min="2011-01" max="2011-12" />
+ <input id="invalid_value" type="month" value="invalid-month" min="2011-01" max="2011-12"/>
+ <input id="value_can_be_empty_string" type="month" value="2013-06" />
+ <input id="invalid_value_with_two_digits_year" type="month" value="13-06" />
+ <input id="invalid_value_is_set" type="month" />
+ <input id="step_attribute_is_invalid_value" type="month" value="2013-06" step="invalid_step_value" />
+ <input id="invalid_month_too_high" type="month" value="2013-13" />
+ <input id="invalid_month_too_low" type="month" value="2013-00" />
+ </div>
+
+ <div id="log"></div>
+
+ <script>
+ test(function() {
+ assert_equals(document.getElementById("valid").type, "month")
+ }, "month type support on input element");
+
+ test(function() {
+ assert_equals(document.getElementById("invalid_value").value, "")
+ }, "User agents must not allow the user to set the value to a non-empty string that is not a valid month string.");
+
+ test(function() {
+ document.getElementById("value_can_be_empty_string").value = "";
+ assert_equals(document.getElementById("value_can_be_empty_string").value, "")
+ }, "Month value can be empty string.");
+
+ test(function() {
+ assert_equals(document.getElementById("invalid_value_with_two_digits_year").value, "")
+ }, "When value attribute has two digits year value, the value,which is invalid, must return empty string.");
+
+ test(function() {
+ document.getElementById("invalid_value_is_set").value = "invalid value";
+ assert_equals(document.getElementById("invalid_value_is_set").value, "")
+ }, "When value is set with invalid value, the value must return empty string.");
+
+ test(function() {
+ document.getElementById("step_attribute_is_invalid_value").stepUp();
+ assert_equals(document.getElementById("step_attribute_is_invalid_value").value, "2013-07")
+ }, "When step attribute is given invalid value, it must ignore the invalid value and use defaul value instead.");
+
+ test(function() {
+ assert_equals(document.getElementById("invalid_month_too_high").value, "");
+ }, "Month should be <= 13: If the value of the element is not a valid month string, then set it to the empty string instead.");
+
+ test(function() {
+ assert_equals(document.getElementById("invalid_month_too_low").value, "");
+ }, "Month should be > 0: If the value of the element is not a valid month string, then set it to the empty string instead.>");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/number.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/number.html
new file mode 100644
index 000000000..5067d0e2f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/number.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Form input type=number</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#password-state-(type=number)">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var numbers = [
+ {value: "", expected: "", testname: "empty value"},
+ {value: "11", expected: "11", testname: "value = 11"},
+ {value: "11.12", expected: "11.12", testname: "value = 11.12"},
+ {value: "-11111", expected: "-11111", testname: "value = -11111"},
+ {value: "-11111.123", expected: "-11111.123", testname: "value = -11111.123"},
+ {value: "1e2", expected: "1e2", testname: "value = 1e2"},
+ {value: "1E2", expected: "1E2", testname: "value = 1E2"},
+ {value: "1e+2", expected: "1e+2", testname: "value = 1e+2"},
+ {value: "1e-2", expected: "1e-2", testname: "value = 1e-2"},
+ {value: "1d+2", expected: "", testname: "value is not a valid floating-point number: 1d+2"},
+ {value: "foobar", expected: "", testname: "value not a valid floating-point number: random string"},
+ {value: "11", attributes: { min: "10" }, expected: "11", testname: "Value >= min attribute"},
+ {value: "9", attributes: { min: "10" }, expected: "9", testname: "Value < min attribute"},
+ {value: "19", attributes: { max: "20" }, expected: "19", testname: "Value <= max attribute"},
+ {value: "21", attributes: { max: "20" }, expected: "21", testname: "Value > max attribute"},
+ {value: ".1", expected: ".1", testname: "value with a leading '.'"},
+ {value: "1.", expected: "", testname: "value ending with '.'"},
+ {value: "-0", expected: "-0", testname: "value = -0"},
+ {value: "Infinity", expected: "", testname: " value = Infinity"},
+ {value: "-Infinity", expected: "", testname: "value = -Infinity"},
+ {value: "NaN", expected: "", testname: "value = NaN"},
+ {value: "9007199254740993", expected: "9007199254740992", testname: "value = 2^53+1"},
+ {value: "2e308", expected: "", testname: "value >= Number.MAX_VALUE"},
+ {value: "1e", expected: "", testname: "value = 1e"},
+ {value: "+1", expected: "1", testname: "value = +1"},
+ {value: "+", expected: "", testname: "value = '+'"},
+ {value: "-", expected: "", testname: "value = '-'"},
+ {value: " 1", expected: "1", testname: "value with a leading whitespace"},
+ {value: "1trailing junk", expected: "1", testname: "value = 1trailing junk"}
+ ];
+ for (var i = 0; i < numbers.length; i++) {
+ var w = numbers[i];
+ test(function() {
+ var input = document.createElement("input");
+ input.type = "number";
+ input.value = w.value;
+ for(var attr in w.attributes) {
+ input[attr] = w.attributes[attr];
+ }
+ assert_equals(input.value, w.expected);
+ }, w.testname);
+ }
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/password.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/password.html
new file mode 100644
index 000000000..aac54aa1c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/password.html
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Password input element</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#password-state-%28type=password%29">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div style="display: none">
+<input id="password" type="password" />
+<input id=password2 type=password value="password">
+<input id="password_with_value" type="password" value="foobar" />
+</div>
+<script type="text/javascript">
+ setup(function() {
+ window.password = document.getElementById("password");
+ });
+
+ test(function() {
+ assert_equals(password.value, "");
+ assert_equals(document.getElementById("password_with_value").value, "foobar");
+ }, "Value returns the current value for password");
+
+ test(function() {
+ password.value = "A";
+ assert_equals(password.value, "A");
+ assert_equals(password.getAttribute("value"), null);
+ password.value = "B";
+ assert_equals(password.value, "B");
+ assert_equals(password.getAttribute("value"), null);
+ }, "Setting value changes the current value for password, but not the value content attribute");
+
+ test(function() {
+ // Any LF (\n) must be stripped.
+ password.value = "\nAB";
+ assert_equals(password.value, "AB");
+ password.value = "A\nB";
+ assert_equals(password.value, "AB");
+ password.value = "AB\n";
+ assert_equals(password.value, "AB");
+
+ // Any CR (\r) must be stripped.
+ password.value = "\rAB";
+ assert_equals(password.value, "AB");
+ password.value = "A\rB";
+ assert_equals(password.value, "AB");
+ password.value = "AB\r";
+ assert_equals(password.value, "AB");
+
+ // Any combinations of LF CR must be stripped.
+ password.value = "\r\nAB";
+ assert_equals(password.value, "AB");
+ password.value = "A\r\nB";
+ assert_equals(password.value, "AB");
+ password.value = "AB\r\n";
+ assert_equals(password.value, "AB");
+ password.value = "\r\nA\n\rB\r\n";
+ assert_equals(password.value, "AB");
+ }, "Value sanitization algorithm should strip line breaks for password");
+
+ var pass = document.getElementById('password2');
+
+ test(function(){
+ assert_equals(pass.value, "password");
+ pass.value = " pass word ";
+ assert_equals(pass.value, " pass word ");
+ }, "sanitization algorithm doesn't strip leading and trailing whitespaces");
+
+ test(function(){
+ pass.value = "pass\u000Aword";
+ assert_equals(pass.value, "password");
+ pass.value = "\u000Apassword\u000A";
+ assert_equals(pass.value, "password");
+ pass.value = "pass\u000Dword";
+ assert_equals(pass.value, "password");
+ pass.value = "\u000Dpassword\u000D";
+ assert_equals(pass.value, "password");
+ }, "sanitization algorithm strips line breaks");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/pattern_attribute.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/pattern_attribute.html
new file mode 100644
index 000000000..ef01c2972
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/pattern_attribute.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Pattern Attribute</title>
+ <meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no" />
+ <link rel="author" title="Fabrice Clari" href="mailto:f.clari@inno-group.com">
+ <link rel="author" title="Dimitri Bocquet" href="mailto:Dimitri.Bocquet@mosquito-fp7.eu">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-input-pattern">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+
+ <body>
+
+
+ <h1>Pattern Attribute</h1>
+ <div style="display: none">
+ <input pattern="[a-z]{3}" value="abcd" title="three letters max"/>
+ </div>
+
+ <div id="log">
+ </div>
+
+ <script type="text/javascript">
+
+
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].getAttribute("pattern"), "[a-z]{3}")}, "pattern attribute support on input element");
+
+ </script>
+
+ </body>
+
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/radio-groupname-case.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/radio-groupname-case.html
new file mode 100644
index 000000000..05192fc7d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/radio-groupname-case.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>radio group name compatibility caseless</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel="help" href="http://people.mozilla.org/~jdaggett/tests/radiobuttonnamecase.html">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<input id=r1 type="radio" name="sImPlE">
+<input id=r2 type="radio" name="simple">
+<input id=r3 type="radio" name="SIMPLE">
+
+<input id=r4 type="radio" name="paSSfield-killroyß">
+<input id=r5 type="radio" name="passfield-killroyß">
+<input id=r6 type="radio" name="PASSFIELD-KILLROYß">
+<input id=r7 type="radio" name="paſſfield-killroyß">
+<input id=r8 type="radio" name="passfield-&#x212a;illroyß">
+<input id=r9 type="radio" name="paßfield-killroyß">
+<input id=r10 type="radio" name="paẞfield-killroyß">
+<input id=r11 type="radio" name="passfield-killroyẞ">
+<input id=r12 type="radio" name="passfield-killroyß">
+<input id=r13 type="radio" name="passfıeld-killroyß">
+<input id=r14 type="radio" name="passfİeld-killroyß">
+
+<input id=r15 type="radio" name="глупый">
+<input id=r16 type="radio" name="глупы&#x438;&#x306;">
+<input id=r17 type="radio" name="ГЛУПЫЙ">
+<input id=r18 type="radio" name="ГЛУПЫ&#x418;&#x306;">
+
+<input id=r19 type="radio" name="åωk">
+<input id=r20 type="radio" name="ÅΩK">
+<input id=r21 type="radio" name="&#x212b;ωk">
+<input id=r22 type="radio" name="å&#x2126;k">
+<input id=r23 type="radio" name="åω&#x212a;">
+
+<input id=r24 type="radio" name="blah1">
+<input id=r25 type="radio" name="blah&#x2460;">
+<input id=r26 type="radio" name="bl&#x24b6;h1">
+<input id=r27 type="radio" name="bl&#x24d0;h1">
+
+<input id=r28 type="radio" name="t&Eacute;dz5アパートFi">
+<input id=r29 type="radio" name="T&Eacute;DZ5アパートFi">
+<input id=r30 type="radio" name="T&eacute;&#x01F1;&#x2075;アパートFi">
+<input id=r31 type="radio" name="t&Eacute;dz5&#x3300;Fi">
+<input id=r32 type="radio" name="t&Eacute;dz5&#x30A2;&#x30CF;&#x309A;&#x30FC;&#x30C8;Fi">
+<input id=r33 type="radio" name="t&Eacute;dz5&#x30A2;&#x30D1;&#x30FC;&#x30C8;Fi">
+<input id=r34 type="radio" name="T&Eacute;DZ⁵アパートFi">
+<input id=r35 type="radio" name="T&Eacute;DZ5アパートfi">
+
+<input id=r36 type="radio" name="ΣΣ">
+<input id=r37 type="radio" name="σς">
+<script>
+ var groups = [["r1" ,"r2", "r3"],
+ ["r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14"],
+ ["r15", "r16", "r17", "r18"],
+ ["r19", "r20", "r21", "r22", "r23"],
+ ["r24", "r25", "r26", "r27"],
+ ["r28", "r29", "r30", "r31", "r32", "r33", "r34", "r35"],
+ ["r36", "r37"]],
+ groupName = ["sImPlE", "paSSfield-killroyß", "глупый", "åωk", "blah1", "tÉdz5アパートFi", "ΣΣ"];
+ groups.forEach(function(group, index) {
+ test(function(){
+ group.forEach(function(radioId) {
+ assert_false(document.getElementById(radioId).checked);
+ });
+ for (var i = 0; i < group.length; i++) {
+ document.getElementById(group[i]).checked = true;
+ assert_true(document.getElementById(group[i]).checked);
+ for (var j = 0; j < group.length; j++) {
+ if (j != i) assert_false(document.getElementById(group[j]).checked);
+ }
+ }
+ }, "radio button group name = " + groupName[index]);
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/radio.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/radio.html
new file mode 100644
index 000000000..6681b3506
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/radio.html
@@ -0,0 +1,144 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>input type radio</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#radio-button-state-(type=radio)">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<input type=radio name=group1 id=radio1>
+<input type=radio name=group1 id=radio2>
+
+<input type=radio name=groüp2 id=radio3>
+<input type=radio name=groÜp2 id=radio4>
+
+<input type=radio id=radio5>
+<input type=radio id=radio6 disabled>
+
+<input type=radio name="group5" id=radio71 checked>
+<input type=radio name="group5" id=radio72>
+
+<input type=radio name=group3 id=radio8 checked>
+<input type=radio name=group3 id=radio9>
+<input type=radio name=group4 id=radio10>
+<input type=radio name=group4 id=radio11 checked>
+
+
+<script>
+ var radio1 = document.getElementById('radio1'),
+ radio2 = document.getElementById('radio2'),
+ radio3 = document.getElementById('radio3'),
+ radio4 = document.getElementById('radio4'),
+ radio5 = document.getElementById('radio5'),
+ radio6 = document.getElementById('radio6'),
+ radio71 = document.getElementById('radio71'),
+ radio72 = document.getElementById('radio72'),
+ radio8 = document.getElementById('radio8'),
+ radio9 = document.getElementById('radio9'),
+ radio10 = document.getElementById('radio10'),
+ radio11 = document.getElementById('radio11'),
+ t1 = async_test("click on mutable radio fires click event, then input event, then change event"),
+ t3 = async_test("click on non-mutable radio doesn't fire the input event"),
+ t4 = async_test("click on non-mutable radio doesn't fire the change event"),
+ t5 = async_test("canceled activation steps on unchecked radio"),
+ input_fired = false,
+ change_fired = false;
+
+ test(function(){
+ assert_false(radio1.checked);
+ assert_false(radio2.checked);
+ radio1.checked = true;
+ assert_true(radio1.checked);
+ assert_false(radio2.checked);
+ radio2.checked = true;
+ assert_false(radio1.checked);
+ assert_true(radio2.checked);
+ }, "only one control of a radio button group can have its checkedness set to true");
+
+ test(function(){
+ assert_false(radio3.checked);
+ assert_false(radio4.checked);
+ radio3.checked = true;
+ assert_true(radio3.checked);
+ assert_false(radio4.checked);
+ radio4.checked = true;
+ assert_false(radio3.checked);
+ assert_true(radio4.checked);
+ }, "radio inputs with name attributes groüp2 and groÜp2 belong to the same radio button group");
+
+ test(function(){
+ assert_true(radio8.checked);
+ assert_false(radio9.checked);
+ assert_false(radio10.checked);
+ assert_true(radio11.checked);
+ radio9.name="group4";
+ radio9.checked = true;
+ assert_true(radio8.checked);
+ assert_true(radio9.checked);
+ assert_false(radio10.checked);
+ assert_false(radio11.checked);
+ }, "changing the name of a radio input element and setting its checkedness to true makes all the other elements' checkedness in the same radio button group be set to false");
+
+ radio5.onclick = t1.step_func(function(e) {
+ click_fired = true;
+ assert_false(input_fired, "click event should fire before input event");
+ assert_false(change_fired, "click event should fire before change event");
+ assert_false(e.isTrusted, "click()-initiated click event shouldn't be trusted");
+ });
+
+ radio5.oninput = t1.step_func(function(e) {
+ input_fired = true;
+ assert_true(click_fired, "input event should fire after click event");
+ assert_false(change_fired, "input event should fire before change event");
+ assert_true(e.bubbles, "input event should bubble")
+ assert_true(e.isTrusted, "input event should be trusted");
+ assert_false(e.cancelable, "input event should not be cancelable");
+ });
+
+ radio5.onchange = t1.step_func(function(e) {
+ change_fired = true;
+ assert_true(click_fired, "change event should fire after click event");
+ assert_true(input_fired, "change event should fire after input event");
+ assert_true(e.bubbles, "change event should bubble")
+ assert_true(e.isTrusted, "change event should be trusted");
+ assert_false(e.cancelable, "change event should not be cancelable");
+ });
+
+ radio6.oninput= t3.step_func_done(function(e) {
+ assert_unreached("event input fired");
+ });
+
+ radio6.onchange = t4.step_func_done(function(e) {
+ assert_unreached("event change fired");
+ });
+
+ t1.step(function() {
+ radio5.click();
+ assert_true(input_fired);
+ t1.done();
+ });
+
+ t3.step(function(){
+ radio6.click();
+ t3.done();
+ t4.done();
+ });
+
+ radio72.onclick = t5.step_func_done(function(e){
+ assert_false(radio71.checked, "click on radio should uncheck other radio in same group");
+ assert_true(radio72.checked, "click on radio should check that radio");
+ e.preventDefault();
+ // The cancelation of the click doesn't have an effect until after all the click event handlers have been run.
+ assert_false(radio71.checked, "radio remains unchecked immediately after click event on other radio in same group is canceled");
+ assert_true(radio72.checked, "clicked radio remains checked immediately after click event is canceled");
+ });
+
+ t5.step(function(){
+ assert_true(radio71.checked, "initially checked radio should be checked");
+ assert_false(radio72.checked, "other radios in same group as initially-checked radio should be unchecked");
+ radio72.click();
+ // Now that the click event has been fully dispatched, its cancelation has taken effect.
+ assert_true(radio71.checked, "canceled click event on radio should leave the previously-checked radio checked");
+ assert_false(radio72.checked, "canceled click event on previously-unchecked radio should leave that radio unchecked");
+ });
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/range-2.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/range-2.html
new file mode 100644
index 000000000..3277dfc07
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/range-2.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<meta charset=utf-8>
+<title>range input Tests</title>
+<link rel="author" title="Microsoft" href="http://www.microsoft.com" />
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<input type="range" id="r00" min="0" max="100" step="20" value="40" style="display:none">
+<input type="range" id="r01" min="0" max="1" step=".1" value=".2" style="display:none">
+<input type="range" id="r02" style="display:none">
+<input type="range" id="r03" style="display:none">
+<input type="range" id="r04" style="display:none">
+
+<script>
+test(function rangeElementTest0() {
+ document.getElementById('r00').value = "";
+ assert_equals(document.getElementById('r00').type, "range");
+ assert_equals(document.getElementById('r00').value, "60");
+}, "range input value set to ''");
+
+test(function rangeElementTest1() {
+ document.getElementById('r01').value = .6;
+ assert_equals(document.getElementById('r01').type, "range");
+ assert_equals(document.getElementById('r01').value, "0.6");
+}, "range input value set to an integer");
+
+test(function rangeElementTest2() {
+ assert_equals(document.getElementById('r02').type, "range");
+ assert_equals(document.getElementById('r02').value, "50");
+}, "range input value equals 50");
+
+test(function rangeElementTest3() {
+ document.getElementById('r03').value = 200;
+ assert_equals(document.getElementById('r03').type, "range");
+ assert_equals(document.getElementById('r03').value, "100");
+}, "range input value equals 100");
+
+test(function rangeElementTest4() {
+ document.getElementById('r04').value = 2.1;
+ assert_equals(document.getElementById('r04').type, "range");
+ assert_equals(document.getElementById('r04').value, "2");
+}, "range input value equals 2");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/range.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/range.html
new file mode 100644
index 000000000..2e7a85ea9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/range.html
@@ -0,0 +1,276 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Input Range</title>
+ <meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no" />
+ <link rel="author" title="Fabrice Clari" href="mailto:f.clari@inno-group.com">
+ <link rel="author" title="Dimitri Bocquet" href="mailto:Dimitri.Bocquet@mosquito-fp7.eu">
+ <link rel="author" title="Tomoyuki SHIMIZU" href="mailto:tomoyuki.labs@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-input-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+
+ <body>
+
+
+ <h1>Input Range</h1>
+ <div style="display:none">
+ <input type="range" id="range_basic" min=0 max=5 />
+ <input type="range" id="value_smaller_than_min" min=0 max=5 value=-10 />
+ <input type="range" id="value_larger_than_max" min=0 max=5 value=7 />
+ <input type="range" id="empty_attributes" />
+ <input type="range" id="value_not_specified" min=2 max=6 />
+ <input type="range" id="control_step_mismatch" min=0 max=7 step=2 />
+ <input type="range" id="max_smaller_than_min" min=2 max=-3 />
+ <input type="range" id="default_step_scale_factor_1" min=5 max=12.6 value=6.7 />
+ <input type="range" id="default_step_scale_factor_2" min=5.3 max=12 value=6.7 />
+ <input type="range" id="default_step_scale_factor_3"min=5 max=12.6 step=0.5 value=6.7 />
+ <input type="range" id="float_step_scale_factor" min=5.3 max=12 step=0.5 value=6.7 />
+ <input type="range" id="stepup" min=3 max=14 value=6 step=3 />
+ <input type="range" id="stepdown" min=3 max=11 value=9 step=3 />
+ <input type="range" id="stepup_beyond_max" min=3 max=14 value=9 step=3 />
+ <input type="range" id="stepdown_beyond_min" min=3 max=11 value=6 step=3 />
+ <input type="range" id="illegal_min_and_max" min="ab" max="f" />
+ <input type="range" id="illegal_value_and_step" min=0 max=5 value="ppp" step="xyz" />
+ </div>
+
+ <div id="log">
+ </div>
+
+ <script type="text/javascript">
+
+ test(
+ function() {
+ assert_equals(document.getElementById('range_basic').type, "range");
+ },
+ "range type support on input element",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-type"
+ }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('range_basic').min, "0")
+ },
+ "min attribute support on input element",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-min"
+ }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('range_basic').max, "5")
+ },
+ "max attribute support on input element",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-max"
+ }
+ );
+
+ // HTML5 spec says the default vaules of min and max attributes are 0 and 100 respectively,
+ // however, Chrome, Opera and Firefox would not give any default value at all...
+ test(
+ function() {
+ assert_equals(document.getElementById('illegal_min_and_max').min, "0")
+ },
+ "Illegal value of min attribute",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)"
+ }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('illegal_min_and_max').max, "100")
+ },
+ "Illegal value of max attribute",
+ { "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('illegal_value_and_step').value, "3")
+ },
+ "Converting an illegal string to the default value",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)"
+ }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('illegal_value_and_step').step, "1")
+ },
+ "Converting an illegal string to the default step",
+ { "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('value_smaller_than_min').value, "0")
+ },
+ "the value is set to min when a smaller value than min attribute is given",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)"
+ }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('value_larger_than_max').value, "5")
+ },
+ "the value is set to max when a larger value than max attribute is given",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)"
+ }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('empty_attributes').min, "0")
+ },
+ "default value of min attribute in input type=range",
+ { "help" : "https://html.spec.whatwg.org/multipage/#dom-input-min" }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('empty_attributes').max, "100")
+ },
+ "default value of max attribute in input type=range",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-max"
+ }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('value_not_specified').value, "4")
+ },
+ "default value when min and max attributes are given (= min plus half the difference between min and max)",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)"
+ }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('control_step_mismatch').value, "4")
+ },
+ "default value with step control when both min and max attributes are given",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)"
+ }
+ );
+
+ // Chrome would result in different value out of the range between min and max. Why?
+ test(
+ function() {
+ assert_equals(document.getElementById('max_smaller_than_min').value, "2")
+ },
+ "default value when both min and max attributes are given, while min > max",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)"
+ }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('default_step_scale_factor_1').value, "7")
+ },
+ "The default step scale factor is 1, unless min attribute has non-integer value",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)"
+ }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('default_step_scale_factor_2').value, "6.3")
+ },
+ "Step scale factor behavior when min attribute has integer value but max attribute is non-integer ",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)" }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('default_step_scale_factor_3').step, "1")
+ },
+ "The default scale factor is 1 even if step attribute is explicitly set to non-integer value, unless min attribute has non-integer value",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)"
+ }
+ );
+
+ test(
+ function() {
+ assert_equals(document.getElementById('float_step_scale_factor').value, "6.8")
+ },
+ "Solving the step mismatch",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#range-state-(type=range)"
+ }
+ );
+
+ // Firefox Nightly (24.0a1) would result in the possible maximum value in this range... (i.e. 12)
+ test(
+ function() {
+ var e = document.getElementById('stepup');
+ e.stepUp();
+ assert_equals(e.value, "9")
+ },
+ "Performing stepUp()",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepup"
+ }
+ );
+
+ // Firefox Nightly (24.0a1) would result in the possible minimum value in this range... (i.e. 3)
+ test(
+ function() {
+ var e = document.getElementById('stepdown');
+ e.stepDown();
+ assert_equals(e.value, "6")
+ },
+ "Performing stepDown()",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepdown"
+ }
+ );
+
+ // Chrome and Opera would throw DOM Exception 11 (InvalidStateError)
+ // Firefox Nightly gives the correct result
+ test(
+ function() {
+ var e = document.getElementById('stepup_beyond_max');
+ e.stepUp(2);
+ assert_equals(e.value, "12")
+ },
+ "Performing stepUp() beyond the value of the max attribute",
+ {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepup"
+ }
+ );
+
+ // Chrome and Opera would throw DOM Exception 11 (InvalidStateError)
+ // Firefox Nightly gives the correct result
+ test(
+ function() {
+ var e = document.getElementById('stepdown_beyond_min');
+ e.stepDown(2);
+ assert_equals(e.value, "3")
+ }, "Performing stepDown() beyond the value of the min attribute", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-stepdown"
+ }
+ );
+
+ </script>
+
+ </body>
+
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/required_attribute.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/required_attribute.html
new file mode 100644
index 000000000..63488e9f4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/required_attribute.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Required Attribute</title>
+ <meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no" />
+ <link rel="author" title="Fabrice Clari" href="mailto:f.clari@inno-group.com">
+ <link rel="author" title="Dimitri Bocquet" href="mailto:Dimitri.Bocquet@mosquito-fp7.eu">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-input-required">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+
+ <body>
+
+
+ <h1>Required Attribute</h1>
+ <div style="display: none">
+ <input type="text" required="required" />
+ </div>
+
+ <div id="log">
+ </div>
+
+ <script type="text/javascript">
+
+
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].getAttribute("required"), "required")}, "required attribute support on input element");
+
+ </script>
+
+ </body>
+
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/reset.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/reset.html
new file mode 100644
index 000000000..9a9799542
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/reset.html
@@ -0,0 +1,113 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>input type reset</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#reset-button-state-(type=reset)">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form>
+ <input type=text id=input1 value="foobar">
+ <input type=text id=input2>
+ <input type=reset id=r1>
+</form>
+
+<input type=text id=input3 value="barfoo">
+
+<table>
+ <form>
+ <tr>
+ <td>
+ <input type=text id=input4 value="foobar">
+ <input type=reset id=r2>
+ </td>
+ </tr>
+ </form>
+</table>
+
+<div>
+ <form>
+ <input type=text id=input5 value="foobar">
+ </div>
+ <input type=reset id=r3>
+</form>
+
+<div>
+ <form>
+ <input type=reset id=r4>
+ </div>
+ <input type=text id=input6 value="foobar">
+</form>
+
+<form id=form5>
+ <input type=reset id=r5>
+</form>
+<input form=form5 type=text id=input7 value="foobar">
+
+<form id=form6>
+ <input type=text id=input8 value="foobar">
+</form>
+<input type=reset form=form6 id=r6>
+
+<script>
+ var input1 = document.getElementById('input1'),
+ input2 = document.getElementById('input2'),
+ input3 = document.getElementById('input3'),
+ input7 = document.getElementById('input7'),
+ input8 = document.getElementById('input8'),
+ r1 = document.getElementById('r1');
+
+ test(function(){
+ assert_equals(input1.value, "foobar");
+ assert_equals(input2.value, "");
+ assert_equals(input3.value, "barfoo");
+ input1.value = "foobar1";
+ input2.value = "notempty";
+ input3.value = "barfoo1";
+ assert_equals(input1.value, "foobar1");
+ assert_equals(input2.value, "notempty");
+ assert_equals(input3.value, "barfoo1");
+ r1.click();
+ assert_equals(input1.value, "foobar");
+ assert_equals(input2.value, "");
+ assert_equals(input3.value, "barfoo1");
+ }, "reset button only resets the form owner");
+
+ test(function(){
+ assert_false(r1.willValidate);
+ }, "the element is barred from constraint validation");
+
+ test(function(){
+ assert_equals(input1.value, "foobar");
+ assert_equals(input2.value, "");
+ assert_equals(input3.value, "barfoo1");
+ r1.disabled = true;
+ r1.click();
+ assert_equals(input1.value, "foobar");
+ assert_equals(input2.value, "");
+ assert_equals(input3.value, "barfoo1");
+ }, "clicking on a disabled reset does nothing");
+
+ function testReset(inputId, buttonId) {
+ var inp = document.getElementById(inputId);
+ assert_equals(inp.value, "foobar");
+ inp.value = "barfoo";
+ assert_equals(inp.value, "barfoo");
+ document.getElementById(buttonId).click();
+ assert_equals(inp.value, "foobar");
+ }
+
+ test(function(){
+ testReset("input4", "r2");
+ testReset("input5", "r3");
+ testReset("input6", "r4");
+ }, "reset button resets controls associated with their form using the form element pointer");
+
+ test(function(){
+ testReset("input7", "r5");
+ }, "reset button resets controls associated with a form using the form attribute");
+
+ test(function(){
+ testReset("input8", "r6");
+ }, "reset button associated with a form using the form attribute resets all the form's controls");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/search_input.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/search_input.html
new file mode 100644
index 000000000..175cdde99
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/search_input.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Search Input</title>
+ <meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no" />
+ <link rel="author" title="Fabrice Clari" href="mailto:f.clari@inno-group.com">
+ <link rel="author" title="Dimitri Bocquet" href="mailto:Dimitri.Bocquet@mosquito-fp7.eu">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-input-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+
+ <body>
+
+
+ <h1>Search Input</h1>
+ <input type="search" style="display:none" placeholder="Search..." />
+
+ <div id="log">
+ </div>
+
+ <script type="text/javascript">
+
+
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].type, "search")}, "search type support on input element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-type" });
+ test(function() {assert_equals(document.getElementsByTagName("input")[0].placeholder, "Search...")}, "placeholder attribute support on input element", {
+ "help" : "https://html.spec.whatwg.org/multipage/#dom-input-placeholder" });
+
+ </script>
+
+ </body>
+
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/selection.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/selection.html
new file mode 100644
index 000000000..4ed4bc914
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/selection.html
@@ -0,0 +1,135 @@
+<!DOCTYPE HTML>
+<title>Input element programmatic selection support</title>
+<link rel="author" title="yaycmyk" href="mailto:evan@yaycmyk.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/forms.html#dom-textarea/input-select">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+
+/* all textual, non-hidden inputs support .select() */
+test(function() {
+ var valid = [
+ "text",
+ "search",
+ "url",
+ "tel",
+ "email",
+ "password",
+ "date",
+ "month",
+ "week",
+ "time",
+ "datetime-local",
+ "number",
+ "color",
+ "file",
+ ];
+
+ var invalid = [
+ "hidden",
+ "range",
+ "checkbox",
+ "radio",
+ "submit",
+ "image",
+ "reset",
+ "button"
+ ];
+
+ valid.forEach(function(type) {
+ test(function() {
+ var input = document.createElement("input");
+ var a;
+
+ input.type = type;
+ assert_equals(input.type, type, "the given input type is not supported");
+
+ input.select();
+
+ }, "input type " + type + " should support the select() method");
+ });
+
+ invalid.forEach(function(type) {
+ test(function() {
+ var input = document.createElement("input");
+
+ input.type = type;
+ assert_equals(input.type, type, "the given input type is not supported");
+
+ assert_throws("INVALID_STATE_ERR", function() { input.select(); });
+
+ }, "input type " + type + " should not support the select() method");
+ });
+});
+
+/* only certain input types are allowed to have a variable-length selection */
+test(function() {
+ var valid = [
+ "text",
+ "search",
+ "url",
+ "tel",
+ "password"
+ ];
+
+ var invalid = [
+ "hidden",
+ "email",
+ "date",
+ "month",
+ "week",
+ "time",
+ "datetime-local",
+ "number",
+ "range",
+ "color",
+ "checkbox",
+ "radio",
+ "file",
+ "submit",
+ "image",
+ "reset",
+ "button"
+ ];
+
+ valid.forEach(function(type) {
+ test(function() {
+ var input = document.createElement("input");
+ var a;
+
+ input.type = type;
+ assert_equals(input.type, type, "the given input type is not supported");
+
+ a = input.selectionStart;
+ input.selectionStart = 0;
+ a = input.selectionEnd;
+ input.selectionEnd = 0;
+ a = input.selectionDirection;
+ input.selectionDirection = "none";
+ input.setSelectionRange(0, 0);
+ input.setRangeText('', 0, 0);
+
+ }, "input type " + type + " should support all selection attributes and methods");
+ });
+
+ invalid.forEach(function(type) {
+ test(function() {
+ var input = document.createElement("input");
+
+ input.type = type;
+ assert_equals(input.type, type, "the given input type is not supported");
+
+ assert_equals(input.selectionStart, null, 'getting input.selectionStart');
+ assert_throws("INVALID_STATE_ERR", function() { input.selectionStart = 0; });
+ assert_equals(input.selectionEnd, null, 'getting input.selectionEnd');
+ assert_throws("INVALID_STATE_ERR", function() { input.selectionEnd = 0; });
+ assert_equals(input.selectionDirection, null, 'getting input.selectionDirection');
+ assert_throws("INVALID_STATE_ERR", function() { input.selectionDirection = "none"; });
+ assert_throws("INVALID_STATE_ERR", function() { input.setSelectionRange(0, 0); });
+ assert_throws("INVALID_STATE_ERR", function() { input.setRangeText('', 0, 0); });
+
+ }, "input type " + type + " should not support variable-length selections");
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/telephone.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/telephone.html
new file mode 100644
index 000000000..974cbaf88
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/telephone.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Input tel</title>
+ <link rel="author" title="Kazuki Kanamori" href="mailto:yogurito@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#telephone-state-(type=tel)">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <h1>Input tel</h1>
+ <input type="tel" id="novalue" />
+ <input type="tel" id="value_with_LF" value="0&#x000A;1" />
+ <input type="tel" id="value_with_CR" value="0&#x000D;1" />
+ <input type="tel" id="value_with_CRLF" value="0&#x000A;&#x000D;1" />
+ <div id="log">
+ </div>
+
+ <script type="text/javascript">
+ var element = document.getElementById('novalue');
+ test(function(){
+ assert_equals(element.type, 'tel');
+ }, 'tel type supported on input element');
+ test(function(){
+ element.value = '0\u000A1';
+ assert_equals(element.value, '01');
+ }, 'User agents must not allow users to insert "LF" (U+000A)');
+ test(function(){
+ element.value = '0\u000D1';
+ assert_equals(element.value, '01');
+ }, 'User agents must not allow users to insert "CR" (U+000D)');
+
+ element = document.getElementById('value_with_LF');
+ test(function(){
+ assert_equals(element.value, '01');
+ }, 'The value attribute, if specified, must have a value that contains no "LF" (U+000A)');
+
+ element = document.getElementById('value_with_CR');
+ test(function(){
+ assert_equals(element.value, '01');
+ }, 'The value attribute, if specified, must have a value that contains no "CR" (U+000D)');
+
+ test(function(){
+ element = document.getElementById('novalue');
+ element.value = '0\u000D\u000A1';
+ assert_equals(element.value, '01');
+
+ element = document.getElementById('value_with_CRLF');
+ assert_equals(element.value, '01');
+ }, 'The value sanitization algorithm is as follows: Strip line breaks from the value');
+
+ element = document.getElementById('novalue');
+ test(function(){
+ element.value = '+811234';
+ assert_equals(element.value, '+811234');
+ }, 'Element can accept the phone number with plus sign(country code)');
+ test(function(){
+ element.value = '1234#5678';
+ assert_equals(element.value, '1234#5678');
+ }, 'Element can accept the phone number with hash mark(extension number)');
+ test(function(){
+ element.value = '123-456-789';
+ assert_equals(element.value, '123-456-789');
+ }, 'Element can accept the phone number with hyphen');
+ test(function(){
+ element.value = '123.456.789';
+ assert_equals(element.value, '123.456.789');
+ }, 'Element can accept the phone number with dots');
+ test(function(){
+ element.value = '1 23 4';
+ assert_equals(element.value, '1 23 4');
+ }, 'Element can accept the phone number with whitespace');
+ test(function(){
+ element.value = ' 1234 ';
+ assert_equals(element.value, ' 1234 ');
+ }, 'Element can accept the phone number with leading & following whitespaces');
+ test(function(){
+ element.value = '(03)12345678';
+ assert_equals(element.value, '(03)12345678');
+ }, 'Element can accept the phone number with parentheses(area code)');
+ </script>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/text.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/text.html
new file mode 100644
index 000000000..b6d4ceabf
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/text.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Text input element</title>
+ <link rel="author" title="Kinuko Yasuda" href="mailto:kinuko@chromium.org">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#text-(type=text)-state-and-search-state-(type=search)">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+
+ <body>
+ <h1>Text input element</h1>
+ <div style="display: none">
+
+ <input id="text" type="text" />
+ <input id="text_with_value" type="text" value="foo" />
+
+ <input id="search" type="search" />
+ <input id="search_with_value" type="search" value="foo" />
+
+ </div>
+ <div id="log"></div>
+ <script type="text/javascript">
+ var types = [ 'text', 'search' ];
+
+ for (var i = 0; i < types.length; ++i) {
+ test(
+ function() {
+ assert_equals(document.getElementById(types[i]).value, "");
+ assert_equals(document.getElementById(types[i] + "_with_value").value, "foo");
+ }, "Value returns the current value for " + types[i]);
+
+ test(
+ function() {
+ document.getElementById(types[i]).value = "A";
+ assert_equals(document.getElementById(types[i]).value, "A");
+ document.getElementById(types[i]).value = "B";
+ }, "Setting value changes the current value for " + types[i]);
+
+ test(
+ function() {
+ // Any LF (\n) must be stripped.
+ document.getElementById(types[i]).value = "\nAB";
+ assert_equals(document.getElementById(types[i]).value, "AB");
+ document.getElementById(types[i]).value = "A\nB";
+ assert_equals(document.getElementById(types[i]).value, "AB");
+ document.getElementById(types[i]).value = "AB\n";
+ assert_equals(document.getElementById(types[i]).value, "AB");
+
+ // Any CR (\r) must be stripped.
+ document.getElementById(types[i]).value = "\rAB";
+ assert_equals(document.getElementById(types[i]).value, "AB");
+ document.getElementById(types[i]).value = "A\rB";
+ assert_equals(document.getElementById(types[i]).value, "AB");
+ document.getElementById(types[i]).value = "AB\r";
+ assert_equals(document.getElementById(types[i]).value, "AB");
+
+ // Any combinations of LF CR must be stripped.
+ document.getElementById(types[i]).value = "\r\nAB";
+ assert_equals(document.getElementById(types[i]).value, "AB");
+ document.getElementById(types[i]).value = "A\r\nB";
+ assert_equals(document.getElementById(types[i]).value, "AB");
+ document.getElementById(types[i]).value = "AB\r\n";
+ assert_equals(document.getElementById(types[i]).value, "AB");
+ document.getElementById(types[i]).value = "\r\nA\n\rB\r\n";
+ assert_equals(document.getElementById(types[i]).value, "AB");
+ }, "Value sanitization algorithm should strip line breaks for " + types[i]);
+
+ test(
+ function() {
+ assert_equals(document.getElementById(types[i]).files, null);
+ }, "files attribute must return null for " + types[i]);
+
+ test(
+ function() {
+ assert_equals(document.getElementById(types[i]).valueAsDate, null);
+ }, "valueAsDate attribute must return null for " + types[i]);
+
+ test(
+ function() {
+ assert_equals(document.getElementById(types[i]).valueAsNumber, NaN);
+ }, "valueAsNumber attribute must return NaN for " + types[i]);
+
+ test(
+ function() {
+ assert_equals(document.getElementById("text").list, null);
+ }, "list attribute must return null for " + types[i]);
+
+ test(
+ function() {
+ var el = document.getElementById(types[i]);
+ assert_throws("InvalidStateError", function() { el.stepDown(); }, "");
+ }, "stepDown does not apply for " + types[i]);
+
+ test(
+ function() {
+ var el = document.getElementById(types[i]);
+ assert_throws("InvalidStateError", function() { el.stepUp(); }, "");
+ }, "stepUp does not apply for " + types[i]);
+ }
+
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/time-2.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/time-2.html
new file mode 100644
index 000000000..cf0d4cbbe
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/time-2.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Form input type=time</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/multipage/common-microsyntaxes.html#times">
+<link rel=help href="https://html.spec.whatwg.org/multipage/multipage/states-of-the-type-attribute.html#time-state-(type=time)">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var times = [
+ {value: "", expected: "", testname: "empty value"},
+ {value: "00:00", expected: "00:00", testname: "Valid value: value should be 00:00"},
+ {value: "00:00:00", expected: "00:00:00", testname: "Valid value: value should be 00:00:00"},
+ {value: "00:00:00.0", expected: "00:00:00.0", testname: "Valid value: value should be 00:00:00.0"},
+ {value: "00:00:00.00", expected: "00:00:00.00", testname: "Valid value: value should be 00:00:00.00"},
+ {value: "00:00:00.000", expected: "00:00:00.000", testname: "Valid value: value should be 00:00:00.000"},
+ {value: "00:00:00.0000", expected: "", testname: "Invalid value: fraction should have one, two or three ASCII digits. Value should be empty"},
+ {value: "0:00:00.000", expected: "", testname: "Invalid value: hour should have two ASCII digits. Value should be empty"},
+ {value: "00:0:00.000", expected: "", testname: "Invalid value: minutes should have two ASCII digits. Value should be empty"},
+ {value: "00:00:0.000", expected: "", testname: "Invalid value: seconds should have two ASCII digits. Value should be empty"},
+ {value: "24:00:00.000", expected: "", testname: "Invalid value: hour > 23. Value should be empty"},
+ {value: "00:60:00.000", expected: "", testname: "Invalid value: minute > 59. Value should be empty"},
+ {value: "00:00:60.000", expected: "", testname: "Invalid value: second > 59. Value should be empty"},
+ {value: "12:00:00.001", attributes: { min: "12:00:00.000" }, expected: "12:00:00.001", testname: "Value >= min attribute"},
+ {value: "12:00:00.000", attributes: { min: "12:00:00.001" }, expected: "12:00:00.001", testname: "Value < min attribute"},
+ {value: "12:00:00.000", attributes: { max: "12:00:00.001" }, expected: "12:00:00.000", testname: "Value <= max attribute"},
+ {value: "12:00:00.001", attributes: { max: "12:00:00.000" }, expected: "12:00:00.000", testname: "Value > max attribute"}
+ ];
+ for (var i = 0; i < times.length; i++) {
+ var w = times[i];
+ test(function() {
+ var input = document.createElement("input");
+ input.type = "time";
+ input.value = w.value;
+ for(var attr in w.attributes) {
+ input[attr] = w.attributes[attr];
+ }
+ assert_equals(input.value, w.expected);
+ }, w.testname);
+ }
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/time.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/time.html
new file mode 100644
index 000000000..5178d91de
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/time.html
@@ -0,0 +1,207 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Input Time</title>
+ <meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-input-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+
+ <body>
+ <h1>Input Time</h1>
+ <div style="display:none;">
+ <input type="time "id="chkDefaultValue" />
+ <input type="time" id="chkStep" />
+ <input type="time" id="chkSetValueTest" />
+ <input type="time" id="chkSupportAttribute" min="01:01:01.001" max="12:12:12.012" step="600" />
+ </div>
+ <div id="log">
+ </div>
+
+ <script type="text/javascript">
+
+/* check default value */
+test(function(){ assert_equals(document.getElementById("chkDefaultValue").value, "");
+}, "time element of default time value");
+test(function(){assert_equals(document.getElementById('chkStep').step, "");
+}, "step attribute on default value check");
+test(function(){assert_equals(document.getElementById('chkDefaultValue').max, "");
+}, "max attribute on default value check")
+test(function(){assert_equals(document.getElementById('chkDefaultValue').max, "");
+}, "min attribute on default value check")
+
+/* simple attribute test*/
+test(function(){assert_equals(document.getElementById("chkSupportAttribute").type,"time");}
+ , "type attribute support on input element");
+test(function(){assert_equals(document.getElementById('chkSupportAttribute').min, "01:01:01.001")}
+ , "max attribute support on input element");
+test(function(){assert_equals(document.getElementById('chkSupportAttribute').max, "12:12:12.012")}
+ , "min attribute support on input element");
+test(function(){assert_equals(document.getElementById("chkSupportAttribute").step, "600")}
+ , "step attribute support on input element");
+
+/* check step up and down */
+var _StepTest = document.getElementById("chkStep");
+test(function(){ assert_true(typeof(_StepTest.stepUp) ==="function" ) } , "stepUp function support on input Element");
+test(function(){ assert_true(typeof(_StepTest.stepDown) ==="function" ) } , "stepDown function support on input Element");
+
+test(function(){
+ _StepTest.value = "12:00";
+ _StepTest.step = "";
+ _StepTest.stepUp();
+ assert_equals(_StepTest.value,"12:01");
+} , "stepUp step value empty on default step value ");
+
+test(function(){
+ _StepTest.value = "12:00";
+ _StepTest.step = "";
+ _StepTest.stepDown();
+ assert_equals(_StepTest.value,"11:59");
+}, "stepDown step value empty default step value");
+
+test(function(){
+ _StepTest.value = "12:00";
+ _StepTest.step = "-600";
+ _StepTest.stepUp();
+ assert_equals(_StepTest.value, "12:01");
+},"stepUp on step value minus");
+test(function(){
+ _StepTest.value = "12:00";
+ _StepTest.step = "-600";
+ _StepTest.stepDown();
+ assert_equals(_StepTest.value, "11:59");
+},"stepDown on step value minus");
+
+test(function(){
+ _StepTest.value = "12:00";
+ _StepTest.step = "0";
+ _StepTest.stepUp();
+ assert_equals(_StepTest.value, "12:01");
+} , "stepUp on step value zero ");
+test(function(){
+ _StepTest.value = "12:00";
+ _StepTest.step = "0";
+ _StepTest.stepDown();
+ assert_equals(_StepTest.value, "11:59");
+} , "stepDown on step value zero ");
+
+test(function(){
+ _StepTest.value = "00:00";
+ _StepTest.step = "86399";
+ _StepTest.stepUp();
+ assert_equals(_StepTest.value, "23:59:59");
+} , "stepUp on step value 24 hour");
+test(function(){
+ _StepTest.value = "23:59:59";
+ _StepTest.step = "86399";
+ _StepTest.stepDown();
+ assert_equals(_StepTest.value, "00:00:00");
+} , "stepDown on step value 24 hour ");
+
+test(function(){
+ _StepTest.value = "12:00";
+ _StepTest.step = "3600";
+ _StepTest.stepUp();
+ assert_equals(_StepTest.value, "13:00");
+} , "stepUp on step value hour ");
+test(function(){
+ _StepTest.value = "12:00";
+ _StepTest.step = "3600";
+ _StepTest.stepDown();
+ assert_equals(_StepTest.value, "11:00");
+} , "stepDown on step value hour ");
+
+test(function(){
+ _StepTest.value = "12:00";
+ _StepTest.step = "1";
+ _StepTest.stepUp();
+ assert_equals(_StepTest.value, "12:00:01");
+} , "stepUp on step value second ");
+test(function(){
+ _StepTest.value = "12:00";
+ _StepTest.step = "1";
+ _StepTest.stepDown();
+ assert_equals(_StepTest.value, "11:59:59");
+} , "stepDown on step value second ");
+
+test(function(){
+ _StepTest.value = "12:00";
+ _StepTest.step = "0.001";
+ _StepTest.stepUp();
+ assert_equals(_StepTest.value, "12:00:00.001");
+} , "stepUp on step value miri second ");
+test(function(){
+ _StepTest.value = "12:00";
+ _StepTest.step = "0.001";
+ _StepTest.stepDown();
+ assert_equals(_StepTest.value, "11:59:59.999");
+} , "stepDown on step value miri second ");
+
+test(function(){
+ _StepTest.value = "13:00:00";
+ _StepTest.step = "1";
+ _StepTest.stepUp(2);
+ assert_equals(_StepTest.value, "13:00:02");
+}, "stepUp argment 2 times");
+test(function(){
+ _StepTest.value = "13:00:00";
+ _StepTest.step = "1";
+ _StepTest.stepDown(2);
+ assert_equals(_StepTest.value, "12:59:58");
+}, "stepDown argment 2 times");
+
+test(function(){
+ _StepTest.max = "15:00";
+ _StepTest.value = "15:00";
+ _StepTest.stepUp();
+ assert_equals(_StepTest.value, "15:00");
+ _StepTest.max = "";
+} , "stepUp stop because it exceeds the maximum value");
+test(function(){
+ _StepTest.min = "13:00";
+ _StepTest.value = "13:00";
+ _StepTest.stepDown();
+ assert_equals(_StepTest.value, "13:00");
+ _StepTest.min="";
+} , "stepDown Stop so lower than the minimum value");
+
+test(function(){
+ _StepTest.max = "15:01";
+ _StepTest.value = "15:00";
+ _StepTest.step = "120";
+ _StepTest.stepUp();
+ assert_equals(_StepTest.value, "15:01");
+ _StepTest.max = "";
+} , "stop at border on stepUp");
+test(function(){
+ _StepTest.min = "12:59";
+ _StepTest.value = "13:00";
+ _StepTest.step = "120";
+ _StepTest.stepDown();
+ assert_equals(_StepTest.value, "12:59");
+ _StepTest.min="";
+} , "stop at border on stepDown");
+
+test(function(){
+ _StepTest.value = "";
+ _StepTest.step = "60";
+ _StepTest.stepUp();
+ assert_equals(_StepTest.value, "00:01");
+} , " empty value of stepUp");
+
+
+/* set value test */
+test(function(){
+ var _time = document.getElementById("chkSetValueTest");
+ _time.value = "12:00:00.000";
+ assert_equals(_time.value, "12:00:00.000");
+ _time.value = "hh:mi:ss.sss";
+ assert_equals(_time.value, "");
+}, "set value on not time format value");
+
+
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/type-change-state.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/type-change-state.html
new file mode 100644
index 000000000..def11da84
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/type-change-state.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Input element's type attribute changes state</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#the-input-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var types = [
+ { type: "hidden" },
+ { type: "text", sanitizedValue: " foobar " },
+ { type: "search", sanitizedValue: " foobar " },
+ { type: "tel", sanitizedValue: " foobar " },
+ { type: "url", sanitizedValue: "foobar" },
+ { type: "email", sanitizedValue: "foobar" },
+ { type: "password", sanitizedValue: " foobar " },
+ { type: "datetime-local", sanitizedValue: "" },
+ { type: "date", sanitizedValue: "" },
+ { type: "month", sanitizedValue: "" },
+ { type: "week", sanitizedValue: "" },
+ { type: "time", sanitizedValue: "" },
+ { type: "number", sanitizedValue: "" },
+ { type: "range", sanitizedValue: "50" },
+ { type: "color", sanitizedValue: "#000000" },
+ { type: "checkbox" },
+ { type: "radio" },
+ { type: "file" },
+ { type: "submit" },
+ { type: "image" },
+ { type: "reset" },
+ { type: "button" }
+ ];
+ for (var i = 0; i < types.length; i++) {
+ for (var j = 0; j < types.length; j++) {
+ if (types[i] != types[j]) {
+ test(function() {
+ var input = document.createElement("input");
+ input.type = types[i].type;
+ if (types[i].type === "file") {
+ assert_throws("INVALID_STATE_ERR", function() {
+ input.value = " foo\rbar ";
+ });
+ assert_equals(input.value, "");
+ } else if (types[j].type === "file") {
+ input.value = " foo\rbar ";
+ input.type = types[j].type; // change state
+ assert_equals(input.value, "");
+ } else {
+ input.value = " foo\rbar ";
+ input.type = types[j].type; // change state
+ if (types[j].sanitizedValue || types[j].sanitizedValue === "") {
+ assert_equals(input.value, types[j].sanitizedValue, "input.value should be " + types[j].sanitizedValue + " after change of state");
+ } else {
+ assert_equals(input.value, " foo\rbar ", "input.value should be ' foo\\rbar ' after change of state");
+ }
+ }
+ }, "change state from " + types[i].type + " to " + types[j].type);
+ }
+ }
+ }
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/url.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/url.html
new file mode 100644
index 000000000..aafa0ced9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/url.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Input url</title>
+ <link rel="author" title="Hyeonseok Shin" href="mailto:hyeonseok@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#url-state-%28type=url%29">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <h1>Input url</h1>
+ <div style="display: none">
+ <input type="url" id="type_support" />
+ <input type="url" id="set_value_LF" />
+ <input type="url" id="set_value_CR" />
+ <input type="url" id="set_value_CRLF" />
+ <input type="url" id="value_with_CRLF" value="a&#x000D;&#x000A;a" />
+ <input type="url" id="value_with_leading_trailing_white_space" value=" aa " />
+ <input type="url" id="value_with_leading_trailing_inner_white_space" value=" a a " />
+ </div>
+ <div id="log">
+ </div>
+
+ <script type="text/javascript">
+ test(function(){
+ var element = document.getElementById('type_support');
+ assert_equals(element.type, 'url');
+ }, 'url type supported on input element');
+
+ test(function(){
+ var element = document.getElementById('set_value_LF');
+ element.value = 'a\u000Aa';
+ assert_equals(element.value, 'aa');
+
+ element = document.getElementById('set_value_CR');
+ element.value = 'a\u000Da';
+ assert_equals(element.value, 'aa');
+
+ element = document.getElementById('set_value_CRLF');
+ element.value = 'a\u000D\u000Aa';
+ assert_equals(element.value, 'aa');
+ }, 'The value must not be set with "LF" (U+000A) or "CR" (U+000D)');
+
+ test(function(){
+ var element = document.getElementById('value_with_CRLF');
+ assert_equals(element.value, 'aa');
+ }, 'The value sanitization algorithm is as follows: Strip line breaks from the value');
+
+ test(function(){
+ var element = document.getElementById('value_with_leading_trailing_white_space');
+ assert_equals(element.value, 'aa');
+
+ element = document.getElementById('value_with_leading_trailing_inner_white_space');
+ assert_equals(element.value, 'a a');
+ }, 'The value sanitization algorithm is as follows: Strip leading and trailing whitespace from the value.');
+ </script>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/valueMode.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/valueMode.html
new file mode 100644
index 000000000..709c176dd
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/valueMode.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Input element value mode</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var types = [
+ { type: "hidden", mode: "default" },
+ { type: "text", mode: "value", sanitizedValue: "foo" },
+ { type: "search", mode: "value", sanitizedValue: "foo" },
+ { type: "tel", mode: "value", sanitizedValue: "foo" },
+ { type: "url", mode: "value", sanitizedValue: "foo" },
+ { type: "email", mode: "value", sanitizedValue: "foo" },
+ { type: "password", mode: "value", sanitizedValue: "foo" },
+ { type: "datetime-local", mode: "value", sanitizedValue: "" },
+ { type: "date", mode: "value", sanitizedValue: "" },
+ { type: "month", mode: "value", sanitizedValue: "" },
+ { type: "week", mode: "value", sanitizedValue: "" },
+ { type: "time", mode: "value", sanitizedValue: "" },
+ { type: "number", mode: "value", sanitizedValue: "" },
+ { type: "range", mode: "value", sanitizedValue: "50" },
+ { type: "color", mode: "value", sanitizedValue: "#000000" },
+ { type: "checkbox", mode: "default/on" },
+ { type: "radio", mode: "default/on" },
+ { type: "submit", mode: "default" },
+ { type: "image", mode: "default" },
+ { type: "reset", mode: "default" },
+ { type: "button", mode: "default" }
+ ];
+ for (var i = 0; i < types.length; i++) {
+ test(function() {
+ var input = document.createElement("input"),
+ expected;
+ input.type = types[i].type;
+ input.value = "foo";
+ switch(types[i].mode) {
+ case "default":
+ expected = "";
+ break;
+ case "default/on":
+ expected = "on";
+ break;
+ case "value":
+ expected = types[i].sanitizedValue;
+ break;
+ }
+ assert_equals(input.value, expected);
+ }, "value IDL attribute of input type " + types[i].type + " without value attribute");
+
+ test(function() {
+ var input = document.createElement("input"),
+ expected;
+ input.type = types[i].type;
+ input.setAttribute("value", "bar");
+ input.value = "foo";
+ switch(types[i].mode) {
+ case "default":
+ expected = "bar";
+ break;
+ case "default/on":
+ expected = "bar";
+ break;
+ case "value":
+ expected = types[i].sanitizedValue;
+ break;
+ }
+ assert_equals(input.value, expected);
+ }, "value IDL attribute of input type " + types[i].type + " with value attribute");
+ }
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/week.html b/testing/web-platform/tests/html/semantics/forms/the-input-element/week.html
new file mode 100644
index 000000000..e06b67889
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/week.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Form input type=week</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#weeks">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#week-state-(type=week)">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var weeks = [
+ {value: "", expected: "", testname: "empty value"},
+ {value: "2014-W52", expected: "2014-W52", testname: "Valid value: Value should be 2014-W52"},
+ {value: "2014-W53", expected: "", testname: "2014 has 52 weeks: Value should be empty"},
+ {value: "2015-W53", expected: "2015-W53", testname: "2015 has 53 weeks: Value should be 2015-W53"},
+ {value: "2014", expected: "", testname: "Invalid value: year only"},
+ {value: "2014W", expected: "", testname: "Invalid value: no week number"},
+ {value: "2014W52", expected: "", testname: "Invalid value: no '-' (U+002D)"},
+ {value: "-W52", expected: "", testname: "Invalid value: yearless week"},
+ {value: "W52", expected: "", testname: "Invalid value: yearless week and no '-' (U+002D)"},
+ {value: "2014-W03", attributes: { min: "2014-W02" }, expected: "2014-W03", testname: "Value >= min attribute"},
+ {value: "2014-W01", attributes: { min: "2014-W02" }, expected: "2014-W02", testname: "Value < min attribute"},
+ {value: "2014-W10", attributes: { max: "2014-W11" }, expected: "2014-W10", testname: "Value <= max attribute"},
+ {value: "2014-W12", attributes: { max: "2014-W11" }, expected: "2014-W11", testname: "Value > max attribute"}
+ ];
+ for (var i = 0; i < weeks.length; i++) {
+ var w = weeks[i];
+ test(function() {
+ var input = document.createElement("input");
+ input.type = "week";
+ input.value = w.value;
+ for(var attr in w.attributes) {
+ input[attr] = w.attributes[attr];
+ }
+ assert_equals(input.value, w.expected);
+ }, w.testname);
+ }
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-keygen-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-keygen-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-keygen-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-label-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-label-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-label-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-label-element/label-attributes.html b/testing/web-platform/tests/html/semantics/forms/the-label-element/label-attributes.html
new file mode 100644
index 000000000..826533e0c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-label-element/label-attributes.html
@@ -0,0 +1,137 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: The label element</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form id="fm" style="display:none">
+ <label id="lbl0" for="test0"></label>
+ <b id="test0"></b>
+
+ <input id="test1"></input>
+
+ <label id="lbl1">
+ <a id="test2"></a>
+ <div><input id="test3"></div>
+ <input id="test4">
+ </label>
+
+ <label id="lbl2" for="testx">
+ <input id="test5">
+ </label>
+
+ <label id="lbl3" for="test6">
+ <b id="test6"></b>
+ <input id="test6" class="class1">
+ </label>
+
+ <label id="lbl4" for="">
+ <input id="" class="class2">
+ </label>
+
+ <label id="lbl5" for="test7"></label>
+ <input id="test7">
+</form>
+
+<label id="lbl6" for="test7"></label>
+
+<script>
+
+ //control attribute
+ test(function () {
+ assert_not_equals(document.getElementById("lbl0").control, document.getElementById("test0"),
+ "An element that's not a labelable element can't be a label element's labeled control.");
+ assert_equals(document.getElementById("lbl0").control, null,
+ "A label element whose 'for' attribute doesn't reference any labelable element shouldn't have any labeled control.");
+ }, "A label element with a 'for' attribute should only be associated with a labelable element.");
+
+ test(function () {
+ var label = document.createElement("label");
+ label.htmlFor = "test1";
+ assert_not_equals(label.control, document.getElementById("test1"),
+ "A label element not in a document should not label an element in a document.");
+ document.body.appendChild(label);
+ assert_equals(label.control, document.getElementById("test1"));
+ label.remove();
+ }, "A label element not in a document can not label any element in the document.");
+
+ test(function () {
+ assert_equals(document.getElementById("lbl1").control, document.getElementById("test3"),
+ "The first labelable descendant of a label element should be its labeled control.");
+
+ var input = document.createElement("input");
+ document.getElementById("lbl1").insertBefore(input, document.getElementById("test2"));
+ assert_equals(document.getElementById("lbl1").control, input,
+ "The first labelable descendant of a label element in tree order should be its labeled control.");
+ input.remove();
+ }, "The labeled control for a label element that has no 'for' attribute is the first labelable element which is a descendant of that label element.");
+
+ test(function () {
+ assert_equals(document.getElementById("lbl2").control, null,
+ "The label's 'control' property should return null if its 'for' attribute points to an inexistent element.");
+ }, "The 'for' attribute points to an inexistent id.");
+
+ test(function () {
+ assert_equals(document.getElementById("lbl3").control, null, "The label should have no control associated.");
+ assert_equals(document.querySelector(".class1").labels.length, 0);
+ }, "A non-control follows by a control with same ID.");
+
+ test(function () {
+ assert_equals(document.getElementById("lbl4").control, null,
+ "A label element with an empty 'for' attribute should not associate with anything.");
+ }, "The 'for' attribute is an empty string.");
+
+ //labels attribute
+ test(function () {
+ var labels = document.getElementById("test7").labels;
+ assert_true(labels instanceof NodeList,
+ "A form control's 'labels' property should be an instance of a NodeList.");
+ assert_equals(labels.length, 2,
+ "The number of labels associated with a form control should be the number of label elements for which it is a labeled control.");
+ assert_array_equals(labels, [document.getElementById("lbl5"), document.getElementById("lbl6")],
+ "The labels for a form control should be returned in tree order.");
+
+ var newLabel = document.createElement("label");
+ newLabel.htmlFor = "test7";
+ document.getElementById("fm").insertBefore(newLabel, document.getElementById("lbl0"));
+ assert_array_equals(document.getElementById("test7").labels, [newLabel, document.getElementById("lbl5"), document.getElementById("lbl6")],
+ "The labels for a form control should be returned in tree order.");
+ newLabel.remove();
+ }, "A form control has multiple labels.");
+
+ test(function () {
+ var labels = document.getElementById("test3").labels;
+ assert_true(labels instanceof NodeList, "A form control's 'labels' property should be an instance of a NodeList.");
+ assert_equals(labels.length, 1, "The form control has an ancestor with no explicit associated label, and is the first labelable descendant.");
+ }, "A form control has an implicit label.");
+
+ test(function () {
+ var labels = document.getElementById("test4").labels;
+ assert_true(labels instanceof NodeList, "A form control's 'labels' property should be an instance of a NodeList.");
+ assert_equals(labels.length, 0, "The form control has an ancestor with no explicit associated label, but is *not* the first labelable descendant");
+ }, "A form control has no label 1.");
+
+ test(function () {
+ assert_equals(document.getElementById("test5").labels.length, 0,
+ "The number of labels should be 0 if the form control has an ancestor label element that the for attribute points to another control.");
+ assert_equals(document.getElementById("lbl2").control, null,
+ "The labeled cotrol should be associated with the control whose ID is equal to the value of the 'for' attribute.");
+ }, "A form control has no label 2.");
+
+ // form attribute
+ test(function () {
+ assert_equals(document.getElementById("lbl0").form, null,
+ "The 'form' property for a label should return null if label.control is null.");
+ }, "A label in a form without a control");
+
+ test(function () {
+ assert_equals(document.getElementById("lbl6").form, document.getElementById("fm"),
+ "The 'form' property for a label should return label.control.form.");
+ }, "A label outside a form with a control inside the form");
+
+ // htmlFor attribute
+ test(function () {
+ assert_equals(document.getElementById("lbl2").htmlFor, "testx");
+ }, "A label's htmlFor attribute must reflect the for content attribute");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-label-element/labelable-elements.html b/testing/web-platform/tests/html/semantics/forms/the-label-element/labelable-elements.html
new file mode 100644
index 000000000..7bbb0b395
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-label-element/labelable-elements.html
@@ -0,0 +1,156 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: labelable elements</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<form style="display:none">
+ <output id="testoutput"></output>
+ <label id="lbl0" for="testoutput"></label>
+ <progress id="testprogress"></progress>
+ <label id="lbl1" for="testprogress"></label>
+ <select id="testselect"></select>
+ <label id="lbl2" for="testselect"></label>
+ <textarea id="testarea"></textarea>
+ <label id="lbl3" for="testarea"></label>
+ <button id="testButton"></button>
+ <label id="lbl4" for="testButton"></label>
+ <input type="hidden" id="testHidden">
+ <label id="lbl5" for="testHidden"></label>
+ <input type="radio" id="testRadio">
+ <label id="lbl6" for="testRadio"></label>
+ <keygen id="testkeygen">
+ <label id="lbl7" for="testkeygen"></label>
+ <meter id="testmeter"></meter>
+ <label id="lbl8" for="testmeter"></label>
+
+ <fieldset id="testfieldset"></fieldset>
+ <label id="lbl9" for="testfieldset"></label>
+ <label id="testlabel"></label>
+ <label id="lbl10" for="testlabel"></label>
+ <object id="testobject"></object>
+ <label id="lbl11" for="testobject"></label>
+ <img id="testimg">
+ <label id="lbl12" for="testimg"></label>
+</form>
+
+<script>
+function testLabelsAttr(formElementId, labelElementId, hasLabels) {
+ var elem = document.getElementById(formElementId);
+ if (labelElementId) {
+ assert_equals(elem.labels.length, 1);
+ assert_equals(elem.labels[0].id, labelElementId);
+ } else {
+ assert_equals(elem.labels.length, 0);
+ }
+}
+
+test(function() {
+ assert_equals(document.getElementById("lbl0").control.id, "testoutput", "An output element should be labelable.");
+}, "Check if the output element is a labelable element");
+
+test(function() {
+ testLabelsAttr("testoutput", "lbl0");
+}, "Check if the output element can access 'labels'");
+
+test(function() {
+ assert_equals(document.getElementById("lbl1").control.id, "testprogress", "A progress element should be labelable.");
+}, "Check if the progress element is a labelable element");
+
+test(function() {
+ testLabelsAttr("testprogress", "lbl1");
+}, "Check if the progress element can access 'labels'");
+
+test(function() {
+ assert_equals(document.getElementById("lbl2").control.id, "testselect", "A select element should be labelable.");
+}, "Check if the select element is a labelable element");
+
+test(function() {
+ testLabelsAttr("testselect", "lbl2");
+}, "Check if the select element can access 'labels'");
+
+test(function() {
+ assert_equals(document.getElementById("lbl3").control.id, "testarea", "A textarea element should be labelable.");
+}, "Check if the textarea element is a labelable form-element");
+
+test(function() {
+ testLabelsAttr("testarea", "lbl3");
+}, "Check if the textarea element can access 'labels'");
+
+test(function() {
+ assert_equals(document.getElementById("lbl4").control.id, "testButton", "A button element should be labelable.");
+}, "Check if the button element is a labelable element");
+
+test(function() {
+ testLabelsAttr("testButton", "lbl4");
+}, "Check if the button element can access 'labels'");
+
+test(function() {
+ assert_equals(document.getElementById("lbl5").control, null, "An input element in hidden state should not be labelable.");
+}, "Check if the hidden input element is not a labelable element.");
+
+test(function() {
+ testLabelsAttr("testHidden", null);
+}, "Check if the hidden input element can access 'labels'");
+
+test(function() {
+ assert_equals(document.getElementById("lbl6").control.id, "testRadio", "An input element in radio state should be labelable.");
+}, "Check if the input element in radio state is a labelable element");
+
+test(function() {
+ testLabelsAttr("testRadio", "lbl6");
+}, "Check if the input element in radio state can access 'labels'");
+
+test(function() {
+ assert_equals(document.getElementById("lbl7").control.id, "testkeygen", "A keygen element should be labelable.");
+}, "Check if the keygen element is a labelable element");
+
+test(function() {
+ testLabelsAttr("testkeygen", "lbl7");
+}, "Check if the keygen element can access 'labels'");
+
+test(function() {
+ assert_equals(document.getElementById("lbl8").control.id, "testmeter", "A meter element should be labelable.");
+}, "Check if the meter element is a labelable element");
+
+test(function() {
+ testLabelsAttr("testmeter", "lbl8");
+}, "Check if the meter element can access 'labels'");
+
+test(function() {
+ assert_not_equals(document.getElementById("lbl9").control, document.getElementById("testfieldset"));
+ assert_equals(document.getElementById("lbl9").control, null, "A fieldset element should not be labelable.");
+}, "Check if the fieldset element is not a labelable element");
+
+test(function() {
+ assert_equals(document.getElementById("testfieldset").labels, undefined);
+}, "Check if the fieldset element can access 'labels'");
+
+test(function() {
+ assert_not_equals(document.getElementById("lbl9").control, document.getElementById("testlabel"));
+ assert_equals(document.getElementById("lbl10").control, null, "A label element should not be labelable.");
+}, "Check if the label element is not a labelable element");
+
+test(function() {
+ assert_equals(document.getElementById("testlabel").labels, undefined);
+}, "Check if the label element can access 'labels'");
+
+test(function() {
+ assert_not_equals(document.getElementById("lbl9").control, document.getElementById("testobject"));
+ assert_equals(document.getElementById("lbl11").control, null, "An object element should not be labelable.");
+}, "Check if the object element is not a labelable element");
+
+test(function() {
+ assert_equals(document.getElementById("testobject").labels, undefined);
+}, "Check if the object element can access 'labels'");
+
+test(function() {
+ assert_not_equals(document.getElementById("lbl9").control, document.getElementById("testimg"));
+ assert_equals(document.getElementById("lbl12").control, null, "An img element should not be labelable.");
+}, "Check if the img element is not a labelable element");
+
+test(function() {
+ assert_equals(document.getElementById("lbl9").labels, undefined);
+}, "Check if the img element can access 'labels'");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-legend-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-legend-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-legend-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-legend-element/legend-form.html b/testing/web-platform/tests/html/semantics/forms/the-legend-element/legend-form.html
new file mode 100644
index 000000000..b127164ae
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-legend-element/legend-form.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTMLLegendElement Test: form</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<div id="log"></div>
+
+<div style="display:none">
+ <form id="testform">
+ <legend id="testlegend">radio</legend>
+ </form>
+</div>
+
+<div style="display:none">
+ <form id="testformWithFieldSet">
+ <fieldset>
+ <legend id="legendWithFieldSet">radio</legend>
+ </fieldset>
+ </form>
+</div>
+<script>
+test(function () {
+ var legendEle = document.getElementById("legendWithFieldSet");
+ assert_not_equals(legendEle.form, null);
+ assert_equals(legendEle.form, document.getElementById("testformWithFieldSet"));
+}, "Check if legend.form returns its parent when it's inside a fieldset");
+test(function () {
+ var legendEle = document.getElementById("testlegend");
+ assert_equals(legendEle.form, null);
+}, "Check if legend.form return null when legend has no fieldset element as its parent");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-meter-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-meter-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-meter-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-meter-element/meter.html b/testing/web-platform/tests/html/semantics/forms/the-meter-element/meter.html
new file mode 100644
index 000000000..1c1ce4f18
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-meter-element/meter.html
@@ -0,0 +1,250 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>The meter element</title>
+ <link rel="author" title="Tomoyuki SHIMIZU" href="mailto:tomoyuki.labs@gmail.com">
+ <link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-meter-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <h1>Meter Element</h1>
+ <div id="log"></div>
+ <div style="display: none;">
+ <meter id="meter_illegal_value" value="abc"></meter>
+ <meter id="meter_without_min" value="-10"></meter>
+ <meter id="meter_without_max" value="10"></meter>
+ <meter id="meter_min_without_max_1" value="10" min="-3.1"></meter>
+ <meter id="meter_min_without_max_2" value="210" min="12.1"></meter>
+ <meter id="meter_max_without_min_1" value="-10" max="-5342.55"></meter>
+ <meter id="meter_max_without_min_2" value="210" max="-9.9"></meter>
+ <meter id="meter_illegal_min" value="-2" min="hugfe"></meter>
+ <meter id="meter_illegal_max" value="2.4" max="min"></meter>
+ <meter id="meter_illegal_low_with_min" value="-20" min="-10.3" low="ahuge"></meter>
+ <meter id="meter_illegal_high_with_max" value="2.4" high="old" max="1.5"></meter>
+ <meter id="meter_smaller_than_min" value="-10" min="4.5"></meter>
+ <meter id="meter_larger_than_max" value="2345.53" max="52.02"></meter>
+ <meter id="meter_default_low_and_high_1" value="40" min="-12.3" max="3.4"></meter>
+ <meter id="meter_default_low_and_high_2" value="23"></meter>
+ <meter id="meter_low_smaller_than_min" value="-4" min="12.3" low="34"></meter>
+ <meter id="meter_low_larger_than_max" value="-1" min="-50" low="-5" max="-34.5"></meter>
+ <meter id="meter_high_smaller_than_min" value="-4" min="12.3" high="34"></meter>
+ <meter id="meter_high_larger_than_max" value="-1" min="-50" high="-5" max="-34.5"></meter>
+ <meter id="meter_high_smaller_than_low" value="-9" min="-20" low="-10.3" high="-15.2" max="-2"></meter>
+ <meter id="meter_low_without_min" value="-1" low="-5"></meter>
+ <meter id="meter_high_without_max" value="50000" high="4"></meter>
+ <meter id="meter_optimum_smaller_than_min" value="-8" optimum="-4"></meter>
+ <meter id="meter_optimum_larger_than_max" value="324" optimum="4.6"></meter>
+ <meter id="meter_default_optimum" value="10" min="-132.35" max="33.423"></meter>
+ </div>
+ <script>
+ var meters = [
+ {value: 0, expectedValue: 0, expectedMin: 0, expectedMax: 1.0, expectedLow: 0, expectedHigh: 1.0, expectedOptimum: 0.5, testname: "Default values"},
+ {value: 3, expectedValue: 3, min: -10.1, expectedMin: -10.1, max: 10.1, expectedMax: 10.1, low: -9.1, expectedLow: -9.1, high: 9.1, expectedHigh: 9.1, optimum: 3, expectedOptimum: 3, testname: "Setting values to min, max, low, high and optimum"},
+ {value: 0, expectedValue: 0, min: 0, expectedMin: 0, max: -1.0, expectedMax: 0, expectedLow: 0, expectedHigh: 0, expectedOptimum: 0, testname: "max < min"},
+ {value: 0, expectedValue: 10, min: 10, expectedMin: 10, max: 20, expectedMax: 20, expectedLow: 10, expectedHigh: 20, expectedOptimum: 15, testname: "value < min"},
+ {value: 30, expectedValue: 20, min: 10, expectedMin: 10, max: 20, expectedMax: 20, expectedLow: 10, expectedHigh: 20, expectedOptimum: 15, testname: "value > max"},
+ {value: 15, expectedValue: 15, min: 10, expectedMin: 10, max: 20, expectedMax: 20, low: 5, expectedLow: 10, expectedHigh: 20, expectedOptimum: 15, testname: "low < min"},
+ {value: 15, expectedValue: 15, min: 10, expectedMin: 10, max: 20, expectedMax: 20, low: 25, expectedLow: 20, expectedHigh: 20, expectedOptimum: 15, testname: "low > max"},
+ {value: 15, expectedValue: 15, min: 10, expectedMin: 10, max: 20, expectedMax: 20, low: 12, expectedLow: 12, high: 10, expectedHigh: 12, expectedOptimum: 15, testname: "high < low"},
+ {value: 15, expectedValue: 15, min: 10, expectedMin: 10, max: 20, expectedMax: 20, low: 10, expectedLow: 10, high: 22, expectedHigh: 20, expectedOptimum: 15, testname: "high > max"},
+ {value: 15, expectedValue: 15, min: 10, expectedMin: 10, max: 20, expectedMax: 20, expectedLow: 10, expectedHigh: 20, optimum: 9, expectedOptimum: 10, testname: "optimum < min"},
+ {value: 15, expectedValue: 15, min: 10, expectedMin: 10, max: 20, expectedMax: 20, expectedLow: 10, expectedHigh: 20, optimum: 21, expectedOptimum: 20, testname: "optimum > max"}
+ ];
+ for (var i = 0; i < meters.length; i++) {
+ var m = meters[i];
+ test(function() {
+ var meter = document.createElement("meter");
+ meter.value = m.value;
+ if (m.min) meter.min= m.min;
+ if (m.max) meter.max = m.max;
+ if (m.low) meter.low = m.low;
+ if (m.high) meter.high = m.high;
+ if (m.optimum) meter.optimum = m.optimum;
+ assert_equals(meter.value, m.expectedValue, "meter value");
+ assert_equals(meter.min, m.expectedMin, "min value");
+ assert_equals(meter.max, m.expectedMax, "max value");
+ assert_equals(meter.low, m.expectedLow, "low value");
+ assert_equals(meter.high, m.expectedHigh, "high value");
+ assert_equals(meter.optimum, m.expectedOptimum, "optimum value");
+ }, m.testname);
+ }
+ test(function() {
+ var meter = document.createElement("meter");
+ assert_throws(new TypeError(), function() { meter.value = "foobar"; }, "value attribute");
+ assert_throws(new TypeError(), function() { meter.min = "foobar"; }, "min attribute");
+ assert_throws(new TypeError(), function() { meter.max = "foobar"; }, "max attribute");
+ assert_throws(new TypeError(), function() { meter.low = "foobar"; }, "low attribute");
+ assert_throws(new TypeError(), function() { meter.high = "foobar"; }, "high attribute");
+ assert_throws(new TypeError(), function() { meter.optimum = "foobar"; }, "optimum attribute");
+ }, "Invalid floating-point number values");
+
+ </script>
+ <script type="text/javascript">
+ test(function() {
+ assert_equals(document.getElementById('meter_illegal_value').value, 0);
+ }, "value must be 0 when a string is given");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_without_min').min, 0);
+ }, "default value of min is 0");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_without_min').value, 0);
+ }, "If min is not specified and value is smaller than the default value of min (i.e. 0), the actual value must be 0");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_without_max').max, 1.0);
+ }, "default value of max is 1.0");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_without_max').value, 1.0);
+ }, "If max is not specified and value is larger than the default value of max (i.e. 1.0), the actual value must be 1.0");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_min_without_max_1').max, 1.0);
+ }, "If a value smaller than 1.0 is given to min and max is not specified, max must be the same value as its default value (i.e. 1.0)");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_min_without_max_1').value, 1.0);
+ }, "If a value smaller than 1.0 is given to min, max is not specified, and value is larger than the default value of max (i.e. 1.0), the actual value must be 1.0");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_min_without_max_2').max, 12.1);
+ }, "If a value larger than or equal to 1.0 is given to min and max is not specified, max must be the same value as min");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_min_without_max_2').value, 12.1);
+ }, "If a value larger than or equal to 1.0 is given to min and max is not specified, the actual value must be the same value as min");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_max_without_min_1').min, 0);
+ }, "If a value smaller than 0 is given to max and min is not specified, min must be be the same value as its default value (i.e. 0)");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_max_without_min_1').max, 0);
+ }, "If a value smaller than 0 is given to max and min is not specified, max must be be the same value as the default value of min (i.e. 0)");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_max_without_min_1').value, 0);
+ }, "If a value smaller than 0 is given to max and min is not specified, the actual value must be be the same value as the default value of min (i.e. 0)");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_max_without_min_2').max, 0);
+ }, "If a value larger than or equal to 0 is given to max and min is not specified, max must be the same value as the default value of min (i.e. 0)");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_max_without_min_2').min, 0);
+ }, "If a value larger than or equal to 0 is given to max and min is not specified, min must be the same value as its default value (i.e. 0)");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_max_without_min_2').value, 0);
+ }, "If a value larger than or equal to 0 is given to max and min is not specified, the actual value must be the same value as the default value of min (i.e. 0)");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_illegal_min').min, 0);
+ }, "min must be 0 when a string is given");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_illegal_min').value, 0);
+ }, "If a string is given to min and value is smaller than the default value of min (i.e. 0), the actual value must be 0");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_illegal_max').max, 1.0);
+ }, "max must be 1.0 when a string is given");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_illegal_max').value, 1.0);
+ }, "If a string is given to max and value is larger than the default value of min (i.e. 1.0), the actual value must be 1.0");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_illegal_low_with_min').low, -10.3);
+ }, "giving a string to low must not affect the actual value");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_illegal_high_with_max').high, 1.5);
+ }, "high must equal max when a string is given to high");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_illegal_high_with_max').value, 1.5);
+ }, "giving a string to high must not affect the actual value");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_smaller_than_min').value, 4.5);
+ }, "value must not be smaller than min");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_larger_than_max').value, 52.02);
+ }, "value must not be larger than max");
+
+ test(function() {
+ var e = document.getElementById('meter_default_low_and_high_1');
+ assert_array_equals([e.low,e.high], [-12.3,3.4]);
+ }, "default low and high values equal min and max, respectively");
+
+ test(function() {
+ var e = document.getElementById('meter_default_low_and_high_2');
+ assert_array_equals([e.low,e.high], [0,1.0]);
+ }, "default low and high values equal 0 and 1.0 respectively, if both low and high are not specified");
+
+ test(function() {
+ var e = document.getElementById('meter_low_smaller_than_min');
+ assert_array_equals([e.low,e.min,e.value], [12.3,12.3,12.3]);
+ }, "low must not be smaller than min");
+
+ test(function() {
+ var e = document.getElementById('meter_low_larger_than_max');
+ assert_array_equals([e.low,e.max,e.value], [-34.5,-34.5,-34.5]);
+ }, "low must not be larger than max");
+
+ test(function() {
+ var e = document.getElementById('meter_high_smaller_than_min');
+ assert_array_equals([e.high,e.min,e.value], [12.3,12.3,12.3]);
+ }, "high must not be smaller than min");
+
+ test(function() {
+ var e = document.getElementById('meter_high_larger_than_max');
+ assert_array_equals([e.high,e.max,e.value], [-34.5,-34.5,-34.5]);
+ }, "high must not be larger than max");
+
+ test(function() {
+ var e = document.getElementById('meter_low_without_min');
+ assert_array_equals([e.low,e.min,e.value], [0,0,0]);
+ }, "If min is not specified, low must not be smaller than default value of min (i.e. 0)");
+
+ test(function() {
+ var e = document.getElementById('meter_high_smaller_than_low');
+ assert_array_equals([e.low,e.high,e.value], [-10.3,-10.3,-9]);
+ }, "If a value smaller than low is given to high, it must be set to the same value as low");
+
+ test(function() {
+ var e = document.getElementById('meter_high_without_max');
+ assert_array_equals([e.high,e.value], [1.0,1.0]);
+ }, "If max is not specified, high must not be larger than default value of max (i.e. 1.0)");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_optimum_smaller_than_min').optimum, 0);
+ }, "optimum smaller than min");
+
+ test(function() {
+ var e = document.getElementById('meter_optimum_smaller_than_min');
+ assert_array_equals([e.min,e.value], [0,0]);
+ }, "optimum (smaller than min) must not affect min and the actual value");
+
+ test(function() {
+ assert_equals(document.getElementById('meter_optimum_larger_than_max').optimum, 1.0);
+ }, "optimum smaller than max");
+
+ test(function() {
+ var e = document.getElementById('meter_optimum_larger_than_max');
+ assert_array_equals([e.max,e.value], [1.0,1.0]);
+ }, "optimum (larger than max) must not affect max and the actual value");
+
+ test(function() {
+ var e = document.getElementById('meter_default_optimum');
+ assert_equals(e.optimum, (e.max + e.min) / 2);
+ }, "default optimum value is the midpoint between min and max");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-optgroup-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-optgroup-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-optgroup-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-optgroup-element/optgroup-disabled-manual.html b/testing/web-platform/tests/html/semantics/forms/the-optgroup-element/optgroup-disabled-manual.html
new file mode 100644
index 000000000..ca8c6cda8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-optgroup-element/optgroup-disabled-manual.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTMLOptGroupElement Test: disabled</title>
+<meta name="flags" content="interact">
+<link rel="author" title="Intel" href="http://www.intel.com/">
+
+<form>
+ <select>
+ <optgroup label="8.01" disabled>
+ <option value="8.01.1">Lecture 01: Powers of Ten</option>
+ <option value="8.01.2">Lecture 02: 1D Kinematics</option>
+ <option value="8.01.3">Lecture 03: Vectors</option>
+ </optgroup>
+ <optgroup label="8.02">
+ <option value="8.02.1">Lecture 01: What holds our world together?</option>
+ <option value="8.02.2">Lecture 02: Electric Field</option>
+ <option value="8.02.3">Lecture 03: Electric Flux</option>
+ </optgroup>
+ </select>
+</form>
+
+<h2>Description</h2>
+<p>
+ This test validates that an optgroup element is disabled if its disabled attribute is present.
+</p>
+
+<h2>Test steps:</h2>
+<ol>
+ <li>
+ Click the select flag to select section '8.01'
+ </li>
+</ol>
+
+<h2>Result:</h2>
+<p>Click the select flag and try to select section 8.01, test passes if the section 8.01 is disable to be selected</p>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-option-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-option-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-option-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-option-element/option-disabled-manual.html b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-disabled-manual.html
new file mode 100644
index 000000000..25dfcc87a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-disabled-manual.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTMLOptionElement Test: disabled</title>
+<meta name="flags" content="interact">
+<link rel="author" title="Intel" href="http://www.intel.com/">
+
+<div>
+ <select>
+ <option id="testOption1" text="Option1" >Option1</option>
+ <option id="testOption2" disabled >Option2</option>
+ <option id="testOption3" >Option3</option>
+ </select>
+</div>
+
+<h2>Description</h2>
+<p>
+ This test validates that an option element is disabled if its disabled attribute is present.
+</p>
+
+<h2>Test steps:</h2>
+<ol>
+ <li>
+ Click the select flag to select 'Option2'
+ </li>
+</ol>
+
+<h2>Result:</h2>
+<p>Test passes if not able to select 'Option2'</p>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-option-element/option-form.html b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-form.html
new file mode 100644
index 000000000..1a68b5c1c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-form.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLOptionElement.form</title>
+<link rel=author title="Sergey Alexandrov" href="mailto:splavgm@gmail.com">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-form">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<form id="form">
+ <select id="select">
+ <optgroup id="optgroup"></optgroup>
+ </select>
+</form>
+<div id=log></div>
+
+<script>
+test(function () {
+ var form = document.getElementById("form");
+ var select = document.getElementById("select");
+ var optgroup = document.getElementById("optgroup");
+
+ var o1 = document.createElement("option");
+ assert_equals(o1.form, null);
+
+ select.appendChild(o1);
+ assert_equals(o1.form, select.form);
+
+ var o2 = document.createElement("option");
+ select.appendChild(o2);
+ assert_equals(o2.form, select.form);
+
+}, "form");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-option-element/option-label-value.js b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-label-value.js
new file mode 100644
index 000000000..5c453f173
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-label-value.js
@@ -0,0 +1,82 @@
+function test_option(member) {
+ test(function() {
+ var option = document.createElement("option");
+ assert_equals(option[member], "");
+ }, "No children, no " + member);
+
+ test(function() {
+ var option = document.createElement("option");
+ option.setAttribute(member, "")
+ assert_equals(option[member], "");
+ }, "No children, empty " + member);
+
+ test(function() {
+ var option = document.createElement("option");
+ option.setAttribute(member, member)
+ assert_equals(option[member], member);
+ }, "No children, " + member);
+
+ test(function() {
+ var option = document.createElement("option");
+ option.setAttributeNS("http://www.example.com/", member, member)
+ assert_equals(option[member], "");
+ }, "No children, namespaced " + member);
+
+ test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode(" child "));
+ assert_equals(option[member], "child");
+ }, "Single child, no " + member);
+
+ test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode(" child "));
+ option.setAttribute(member, "")
+ assert_equals(option[member], "");
+ }, "Single child, empty " + member);
+
+ test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode(" child "));
+ option.setAttribute(member, member)
+ assert_equals(option[member], member);
+ }, "Single child, " + member);
+
+ test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode(" child "));
+ option.setAttributeNS("http://www.example.com/", member, member)
+ assert_equals(option[member], "child");
+ }, "Single child, namespaced " + member);
+
+ test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode(" child "));
+ option.appendChild(document.createTextNode(" node "));
+ assert_equals(option[member], "child node");
+ }, "Two children, no " + member);
+
+ test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode(" child "));
+ option.appendChild(document.createTextNode(" node "));
+ option.setAttribute(member, "")
+ assert_equals(option[member], "");
+ }, "Two children, empty " + member);
+
+ test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode(" child "));
+ option.appendChild(document.createTextNode(" node "));
+ option.setAttribute(member, member)
+ assert_equals(option[member], member);
+ }, "Two children, " + member);
+
+ test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode(" child "));
+ option.appendChild(document.createTextNode(" node "));
+ option.setAttributeNS("http://www.example.com/", member, member)
+ assert_equals(option[member], "child node");
+ }, "Two children, namespaced " + member);
+}
diff --git a/testing/web-platform/tests/html/semantics/forms/the-option-element/option-label.html b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-label.html
new file mode 100644
index 000000000..f931b9622
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-label.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLOptionElement.label</title>
+<link rel=author title=Ms2ger href="mailto:Ms2ger@gmail.com">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-label">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src=option-label-value.js></script>
+<div id=log></div>
+<script>
+test_option("label")
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-option-element/option-selected.html b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-selected.html
new file mode 100644
index 000000000..e18e90b85
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-selected.html
@@ -0,0 +1,61 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLOptionElement.selected</title>
+<link rel=author title="Corey Farwell" href="mailto:coreyf@rwell.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-selected">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+
+<script>
+test(function () {
+ var elem = document.createElement("option");
+ assert_equals(elem.selected, false);
+
+ elem.setAttribute("selected", "");
+ assert_equals(elem.selected, true);
+
+ elem.removeAttribute("selected");
+ assert_equals(elem.selected, false);
+
+ elem.defaultSelected = true
+ assert_equals(elem.selected, true);
+
+ elem.defaultSelected = false;
+ assert_equals(elem.selected, false);
+}, "not dirty");
+
+test(function () {
+ testDirty(true);
+}, "dirty, selected");
+
+test(function () {
+ testDirty(false);
+}, "dirty, not selected");
+
+function testDirty(isSelected) {
+ var elem = document.createElement("option");
+
+ elem.selected = isSelected; // After this assignment, dirtiness=true
+ assertDirty(elem, isSelected);
+
+ elem.selected = !isSelected; // Change the value, still dirty
+ assertDirty(elem, !isSelected);
+};
+
+function assertDirty(elem, expect) {
+ assert_equals(elem.selected, expect);
+
+ elem.setAttribute("selected", "");
+ assert_equals(elem.selected, expect);
+
+ elem.removeAttribute("selected");
+ assert_equals(elem.selected, expect);
+
+ elem.defaultSelected = true;
+ assert_equals(elem.selected, expect);
+
+ elem.defaultSelected = false;
+ assert_equals(elem.selected, expect);
+}
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-backslash.html b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-backslash.html
new file mode 100644
index 000000000..34bd0d368
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-backslash.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<meta charset=EUC-JP>
+<title>Test for the backslash sign in option.text</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<select id=test><option>\</option></select>
+<script>
+test(function() {
+ var select = document.getElementById("test");
+ var option = select.firstChild;
+ assert_equals(option.text, "\\");
+ assert_equals(option.textContent, "\\");
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-label.html b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-label.html
new file mode 100644
index 000000000..9259aecf3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-label.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLOptionElement.text</title>
+<link rel=author title=Ms2ger href="mailto:Ms2ger@gmail.com">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ var option = document.createElement("option");
+ option.setAttribute("label", "label");
+ option.textContent = "text";
+ assert_equals(option.text, "text");
+}, "Option with non-empty label.");
+
+test(function() {
+ var option = document.createElement("option");
+ option.setAttribute("label", "");
+ option.textContent = "text";
+ assert_equals(option.text, "text");
+}, "Option with empty label.");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-recurse.html b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-recurse.html
new file mode 100644
index 000000000..cf854f526
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-recurse.html
@@ -0,0 +1,92 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLOptionElement.text</title>
+<link rel=author title=Ms2ger href="mailto:Ms2ger@gmail.com">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createElement("font"))
+ .appendChild(document.createTextNode(" font "));
+ assert_equals(option.text, "font");
+}, "option.text should recurse");
+
+test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode(" before "));
+ option.appendChild(document.createElement("script"))
+ .appendChild(document.createTextNode(" script "));
+ option.appendChild(document.createTextNode(" after "));
+ assert_equals(option.text, "before after");
+}, "option.text should not recurse into HTML script elements");
+test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode(" before "));
+ option.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "script"))
+ .appendChild(document.createTextNode(" script "));
+ option.appendChild(document.createTextNode(" after "));
+ assert_equals(option.text, "before after");
+}, "option.text should not recurse into SVG script elements");
+test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode(" before "));
+ option.appendChild(document.createElementNS("http://www.w3.org/1998/Math/MathML", "script"))
+ .appendChild(document.createTextNode(" script "));
+ option.appendChild(document.createTextNode(" after "));
+ assert_equals(option.text, "before script after");
+}, "option.text should recurse into MathML script elements");
+test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode(" before "));
+ option.appendChild(document.createElementNS(null, "script"))
+ .appendChild(document.createTextNode(" script "));
+ option.appendChild(document.createTextNode(" after "));
+ assert_equals(option.text, "before script after");
+}, "option.text should recurse into null script elements");
+test(function() {
+ var option = document.createElement("option");
+ var span = option.appendChild(document.createElement("span"));
+ span.appendChild(document.createTextNode(" Some "));
+ span.appendChild(document.createElement("script"))
+ .appendChild(document.createTextNode(" script "));
+ option.appendChild(document.createTextNode(" Text "));
+ assert_equals(option.text, "Some Text");
+}, "option.text should work if a child of the option ends with a script");
+
+test(function() {
+ var script = document.createElement("script");
+ var option = script.appendChild(document.createElement("option"));
+ option.appendChild(document.createTextNode("text"));
+ assert_equals(option.text, "text");
+}, "option.text should work if the option is in an HTML script element");
+test(function() {
+ var script = document.createElementNS("http://www.w3.org/2000/svg", "script");
+ var option = script.appendChild(document.createElement("option"));
+ option.appendChild(document.createTextNode("text"));
+ assert_equals(option.text, "text");
+}, "option.text should work if the option is in an SVG script element");
+test(function() {
+ var script = document.createElementNS("http://www.w3.org/1998/Math/MathML", "script");
+ var option = script.appendChild(document.createElement("option"));
+ option.appendChild(document.createTextNode("text"));
+ assert_equals(option.text, "text");
+}, "option.text should work if the option is in a MathML script element");
+
+test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode("te"));
+ option.appendChild(document.createComment("comment"));
+ option.appendChild(document.createTextNode("xt"));
+ assert_equals(option.text, "text");
+}, "option.text should ignore comment children");
+test(function() {
+ var option = document.createElement("option");
+ option.appendChild(document.createTextNode("te"));
+ option.appendChild(document.createProcessingInstruction("target", "data"));
+ option.appendChild(document.createTextNode("xt"));
+ assert_equals(option.text, "text");
+}, "option.text should ignore PI children");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-spaces.html b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-spaces.html
new file mode 100644
index 000000000..2c712655a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-text-spaces.html
@@ -0,0 +1,75 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLOptionElement.text</title>
+<link rel=author title=Ms2ger href="mailto:Ms2ger@gmail.com">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ var spaces = ["\u0020", "\u0009", "\u000A", "\u000C", "\u000D"];
+ spaces.forEach(function(space) {
+ test(function() {
+ var option = document.createElement("option");
+ option.textContent = space + "text";
+ assert_equals(option.text, "text");
+ }, "option.text should strip leading space characters (" +
+ format_value(space) + ")");
+ });
+ spaces.forEach(function(space) {
+ test(function() {
+ var option = document.createElement("option");
+ option.textContent = "text" + space;
+ assert_equals(option.text, "text");
+ }, "option.text should strip trailing space characters (" +
+ format_value(space) + ")");
+ });
+ spaces.forEach(function(space) {
+ test(function() {
+ var option = document.createElement("option");
+ option.textContent = space + "text" + space;
+ assert_equals(option.text, "text");
+ }, "option.text should strip leading and trailing space characters (" +
+ format_value(space) + ")");
+ });
+ spaces.forEach(function(space) {
+ test(function() {
+ var option = document.createElement("option");
+ option.textContent = "before" + space + "after";
+ assert_equals(option.text, "before after");
+ }, "option.text should replace single internal space characters (" +
+ format_value(space) + ")");
+ });
+ spaces.forEach(function(space1) {
+ spaces.forEach(function(space2) {
+ test(function() {
+ var option = document.createElement("option");
+ option.textContent = "before" + space1 + space2 + "after";
+ assert_equals(option.text, "before after");
+ }, "option.text should replace multiple internal space characters (" +
+ format_value(space1) + ", " + format_value(space2) + ")");
+ });
+ });
+ test(function() {
+ var option = document.createElement("option");
+ option.textContent = "\u00a0text";
+ assert_equals(option.text, "\u00a0text");
+ }, "option.text should leave leading NBSP alone.");
+ test(function() {
+ var option = document.createElement("option");
+ option.textContent = "text\u00a0";
+ assert_equals(option.text, "text\u00a0");
+ }, "option.text should leave trailing NBSP alone.");
+ test(function() {
+ var option = document.createElement("option");
+ option.textContent = "before\u00a0after";
+ assert_equals(option.text, "before\u00a0after");
+ }, "option.text should leave a single internal NBSP alone.");
+ test(function() {
+ var option = document.createElement("option");
+ option.textContent = "before\u00a0\u00a0after";
+ assert_equals(option.text, "before\u00a0\u00a0after");
+ }, "option.text should leave two internal NBSPs alone.");
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-option-element/option-value.html b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-value.html
new file mode 100644
index 000000000..cccdc3748
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-option-element/option-value.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLOptionElement.value</title>
+<link rel=author title=Ms2ger href="mailto:Ms2ger@gmail.com">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-label">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src=option-label-value.js></script>
+<div id=log></div>
+<script>
+test_option("value")
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-output-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-output-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-output-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-output-element/output.html b/testing/web-platform/tests/html/semantics/forms/the-output-element/output.html
new file mode 100644
index 000000000..7682703fa
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-output-element/output.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>The output element</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#the-output-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<output id=output></output>
+<script>
+ var output = document.getElementById("output");
+
+ test(function(){
+ assert_equals(output.type, "output", "type must return the string 'output'");
+ assert_equals(output.textContent, "", "textContent is empty");
+ assert_equals(output.value, "", "value should be empty");
+ assert_equals(output.defaultValue, "", "defaultValue should be empty");
+
+ output.textContent="5";
+ assert_equals(output.value, "5", "textContent is set to 5: value is updated");
+ assert_equals(output.textContent, "5", "textContent is set to 5");
+ assert_equals(output.defaultValue, "5", "textContent is set to 5: defaultValue is updated");
+
+ output.defaultValue="10"; // value mode flag is in "default" mode. Setting defaultValue should set textContent as well
+ assert_equals(output.value, "10", "defaultValue is set to 10: value is updated");
+ assert_equals(output.textContent, "10", "defaultValue is set to 10: textContent is updated");
+ assert_equals(output.defaultValue, "10", "defaultValue is set to 10");
+
+ output.value="20"; // set the value mode flag to "value": default value remains unchanged
+ assert_equals(output.value, "20", "value is set to 20");
+ assert_equals(output.textContent, "20", "value is set to 20: textContent is updated");
+ assert_equals(output.defaultValue, "10", "value is set to 20: defaultValue remains unchanged");
+
+ output.defaultValue="15"; // value mode flag is in "value" mode. textContent remains unchanged when setting defaultValue
+ assert_equals(output.value, "20", "defaultValue is set to 15: value remains unchanged");
+ assert_equals(output.textContent, "20", "defaultValue is set to 15: textContent remains unchanged");
+ assert_equals(output.defaultValue, "15", "defaultValue is set to 15");
+ }, "output value and defaultValue");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-progress-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-progress-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-progress-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-progress-element/progress-2.html b/testing/web-platform/tests/html/semantics/forms/the-progress-element/progress-2.html
new file mode 100644
index 000000000..ebc475062
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-progress-element/progress-2.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>Progress Element Tests</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-progress-element" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <progress id="p00" style="display: none"></progress>
+ <progress id="p01" max="5.5" value=".5" style="display: none"></progress>
+ <script>
+ test(function () {
+ assert_equals(document.getElementById('p00').position, -1);
+ }, "progress position equals -1");
+
+ test(function () {
+ assert_equals(document.getElementById('p00').value, 0);
+ }, "progress value equals 0");
+
+ test(function () {
+ assert_equals(document.getElementById('p01').value, .5);
+ }, "progress value equals .5");
+
+ test(function () {
+ document.getElementById('p00').value = document.getElementById('p00').value;
+ assert_equals(document.getElementById('p00').position, 0);
+ }, "progress position equals 0");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-progress-element/progress.html b/testing/web-platform/tests/html/semantics/forms/the-progress-element/progress.html
new file mode 100644
index 000000000..0c176d8ea
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-progress-element/progress.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>The progress element</title>
+
+ <link rel="author" title="dan smith" href="mailto:XX1011@gmail.com">
+ <link rel="author" title="Tomoyuki SHIMIZU" href="mailto:tomoyuki.labs@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-progress-element">
+
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <progress id="indeterminate"></progress>
+ <progress id="removevalue" value="0.5"></progress>
+ <progress id="quarter" value="1" max="4"></progress>
+ <progress id="largerthanmax" value="2"></progress>
+ <progress id="invalidmax" value="1" max="a"></progress>
+ <progress id="negativemax" value="1" max="-1"></progress>
+ <progress id="invalidvalue" value="a"></progress>
+ <progress id="negativevalue" value="-1"></progress>
+
+ <script>
+
+ test(function() {
+ assert_equals(indeterminate.position, -1);
+ }, "Indeterminate progress bar should have position -1");
+
+ test(function() {
+ removevalue.removeAttribute('value');
+ assert_equals(removevalue.position, -1);
+ }, "Revoming the value attribute makes an intermediate progress bar, which should have position -1");
+
+ test(function() {
+ assert_equals(quarter.position, quarter.value / quarter.max);
+ }, "Determinate progress bar should have fractional position");
+
+ test(function() {
+ assert_equals(indeterminate.value, 0);
+ }, "Indeterminate progress bar should have value 0");
+
+ test(function() {
+ assert_array_equals(largerthanmax.value, 1);
+ }, "Value must equal max if the parsed value is larger than max");
+
+ test(function() {
+ assert_equals(indeterminate.max, 1);
+ }, "Max must be 1 by default");
+
+ test(function() {
+ assert_array_equals(largerthanmax.max, 1);
+ }, "Max must be 1 by default, even if value is specified");
+
+ test(function() {
+ assert_equals(invalidmax.max, 1);
+ }, "Max must be 1 if max value is invalid");
+
+ test(function() {
+ assert_equals(negativemax.max, 1);
+ }, "Max must be 1 if the parsed max value is less than or equal to zero");
+
+ test(function() {
+ assert_equals(invalidvalue.value, 0);
+ }, "Value must be 0 if value is invalid");
+
+ test(function() {
+ assert_equals(negativevalue.value, 0);
+ }, "Value must be 0 if the parsed value is less than or equal to zero");
+
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-select-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-select-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-select-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-select-element/common-HTMLOptionsCollection-namedItem.html b/testing/web-platform/tests/html/semantics/forms/the-select-element/common-HTMLOptionsCollection-namedItem.html
new file mode 100644
index 000000000..c5c8510a4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-select-element/common-HTMLOptionsCollection-namedItem.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title id='title'>HTMLOptionsCollection</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<select id="selly">
+ <option id="id1" name="name1">1</option>
+ <option id="id2" name="name2">2</option>
+ <option id="id3" name="name3">3</option>
+ <option id="id4" name="name4">4</option>
+ <option name="nameonly">nameonly</option>
+ <option id="id3">duplicate ID</option>
+ <option name="name4">duplicate name</option>
+ <option id="mixed1">mixed ID</option>
+ <option name="mixed1">mixed name</option>
+</select>
+
+<script>
+var selly;
+setup(function() {
+ selly = document.getElementById('selly');
+});
+
+test(function () {
+ assert_equals(selly.namedItem('nameonly')["value"], "nameonly");
+}, "if only one item has a *name* or id value matching the parameter, return that object and stop");
+
+test(function () {
+ assert_equals(selly.namedItem('id2')["value"], "2");
+}, "if only one item has a name or *id* value matching the parameter, return that object and stop");
+
+test(function () {
+ assert_equals(selly.namedItem('thisdoesnotexist'), null);
+}, "if no item has a name or id value matching the parameter, return null and stop");
+
+test(function () {
+ assert_equals(selly.namedItem('id3')["value"], "3");
+}, "if multiple items have a name or *id* value matching the parameter, return the first object and stop");
+
+test(function () {
+ assert_equals(selly.namedItem('name4')["value"], "4");
+}, "if multiple items have a *name* or id value matching the parameter, return the first object and stop");
+
+test(function () {
+ assert_equals(selly.namedItem('mixed1')["value"], "mixed ID");
+}, "if multiple items have a *name* or *id* value matching the parameter, return the first object and stop");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html b/testing/web-platform/tests/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html
new file mode 100644
index 000000000..6bae66ccf
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title id='title'>HTMLOptionsCollection</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<select id="selly">
+ <option>1</option>
+ <option>2</option>
+ <option>3</option>
+ <option>4</option>
+</select>
+
+<script>
+var selly;
+setup(function() {
+ selly = document.getElementById('selly');
+});
+
+test(function () {
+ assert_equals(selly.length, 4);
+}, "On getting, the length attribute must return the number of nodes represented by the collection.");
+
+test(function () {
+ selly.length = 7;
+ assert_equals(selly.length, 7,
+ "Number of nodes in collection should have changed");
+ assert_equals(selly.children.length, 7,
+ "Number of children should have changed");
+ for (var i = 4; i < 7; ++i) {
+ var child = selly.children[i];
+ assert_equals(child.localName, "option",
+ "new child should be an option");
+ assert_equals(child.namespaceURI, "http://www.w3.org/1999/xhtml",
+ "new child should be an HTML element");
+ assert_equals(child.attributes.length, 0,
+ "new child should not have attributes");
+ assert_equals(child.childNodes.length, 0,
+ "new child should not have child nodes");
+ }
+}, "Changing the length adds new nodes; The number of new nodes = new length minus old length");
+
+test(function () {
+ var elarray = [];
+ for (var i = 0; i < selly.length; i++) {
+ elarray.push(selly[i].value);
+ }
+ assert_array_equals(elarray, ["1", "2", "3", "4", "", "", ""]);
+}, "New nodes have no value");
+
+test(function () {
+ selly.length = 7;
+ assert_equals(selly.length, 7,
+ "Number of nodes in collection should not have changed");
+ assert_equals(selly.children.length, 7,
+ "Number of children should not have changed");
+}, "Setting a length equal to existing length changes nothing");
+
+test(function () {
+ selly.length = 4;
+ assert_equals(selly[6], undefined,
+ "previously set node is now undefined");
+ assert_equals(selly.length, 4,
+ "Number of nodes in collection is correctly changed");
+ assert_equals(selly.children.length, 4,
+ "Number of children should have changed");
+}, "Setting a length lower than the old length trims nodes from the end");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-select-element/select-ask-for-reset.html b/testing/web-platform/tests/html/semantics/forms/the-select-element/select-ask-for-reset.html
new file mode 100644
index 000000000..822114fb2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-select-element/select-ask-for-reset.html
@@ -0,0 +1,97 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLSelectElement ask for reset</title>
+<link rel="author" title="Dongie Agnir" href="dongie.agnir@gmail.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ var select = makeSelect(5);
+
+ select.children[4].selected = true;
+ unselectedExcept(select, 4);
+
+ select.children[4].remove();
+ unselectedExcept(select, 0); // remove selected node, should default to first
+
+ select.children[3].selected = true;
+
+ select.children[0].remove();
+ unselectedExcept(select, 2); // last node still selected
+
+ select.size = 2;
+ select.children[2].remove();
+
+ unselectedExcept(select, null);
+}, "ask for reset on node remove, non multiple.");
+
+test(function() {
+ var select = makeSelect(3);
+ select.children[1].selected = true;
+
+ // insert selected option, should remain selected
+ var opt4 = document.createElement("option");
+ opt4.selected = true;
+ select.appendChild(opt4);
+ unselectedExcept(select, 3);
+
+ // insert unselected, 3 should remain selected
+ var opt5 = document.createElement("option");
+ select.appendChild(opt5);
+ unselectedExcept(select, 3);
+}, "ask for reset on node insert, non multiple.");
+
+test(function() {
+ var select = makeSelect(3);
+
+ var options = select.children;
+
+ // select options from first to last
+ for (var i = 0; i < options.length; ++i) {
+ options[i].selected = true;
+ unselectedExcept(select, i);
+ }
+
+ // select options from last to first
+ for (var i = options.length - 1; i >= 0; --i) {
+ options[i].selected = true;
+ unselectedExcept(select, i);
+ }
+
+ options[2].selected = true;
+ options[2].selected = false; // none selected
+ unselectedExcept(select, 0);
+
+ // disable first so option at index 1 is first eligible
+ options[0].disabled = true;
+ options[2].selected = true;
+ options[2].selected = false; // none selected
+ unselectedExcept(select, 1);
+
+ select.size = 2;
+ options[1].selected = false;
+ unselectedExcept(select, null); // size > 1 so should not default to any
+}, "change selectedness of option, non multiple.");
+
+
+function unselectedExcept(sel, opt) {
+ for (var i = 0; i < sel.children.length; ++i) {
+ if (i != opt) {
+ assert_false(sel.children[i].selected, "option should not be selected.");
+ }
+ if (opt != null) {
+ assert_true(sel.children[opt].selected, "option should be selected.");
+ }
+ }
+}
+
+function makeSelect(n) {
+ var sel = document.createElement("select");
+ for (var i = 0; i < n; ++i) {
+ opt = document.createElement("option");
+ sel.appendChild(opt);
+ }
+ return sel;
+}
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-select-element/select-named-getter.html b/testing/web-platform/tests/html/semantics/forms/the-select-element/select-named-getter.html
new file mode 100644
index 000000000..da43da9d9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-select-element/select-named-getter.html
@@ -0,0 +1,46 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Absence of a named getter on HTMLSelectElement</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<select id=select>
+ <option id=op1>A</option>
+ <option name=op2>B</option>
+ <option id=op3 name=op4>C</option>
+ <option id=>D</option>
+ <option name=>D</option>
+</select>
+<script>
+test(function() {
+ var select = document.getElementById("select");
+ assert_equals(select.op1, undefined);
+ assert_false("op1" in select);
+ assert_equals(select.namedItem("op1"), select.children[0]);
+}, "Option with id")
+
+test(function() {
+ var select = document.getElementById("select");
+ assert_equals(select.op2, undefined);
+ assert_false("op2" in select);
+ assert_equals(select.namedItem("op2"), select.children[1]);
+}, "Option with name")
+
+test(function() {
+ var select = document.getElementById("select");
+ assert_equals(select.op3, undefined);
+ assert_false("op3" in select);
+ assert_equals(select.namedItem("op3"), select.children[2]);
+
+ assert_equals(select.op4, undefined);
+ assert_false("op4" in select);
+ assert_equals(select.namedItem("op4"), select.children[2]);
+}, "Option with name and id")
+
+test(function() {
+ var select = document.getElementById("select");
+ assert_equals(select[""], undefined);
+ assert_false("" in select);
+ assert_equals(select.namedItem(""), null);
+}, "Empty string name");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-select-element/select-remove.html b/testing/web-platform/tests/html/semantics/forms/the-select-element/select-remove.html
new file mode 100644
index 000000000..cf2128bd1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-select-element/select-remove.html
@@ -0,0 +1,64 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLSelectElement.remove</title>
+<link rel="author" title="Ms2ger" href="Ms2ger@gmail.com">
+<link rel="help" href="https://dom.spec.whatwg.org/#dom-childnode-remove">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-select-remove">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-htmloptionscollection-remove">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+function testRemove(getter, desc) {
+ test(function() {
+ var div = document.createElement("div");
+ var select = document.createElement("select");
+ div.appendChild(select);
+ assert_equals(select.parentNode, div);
+
+ var options = [];
+ for (var i = 0; i < 3; ++i) {
+ var option = document.createElement("option");
+ option.textContent = String(i);
+ select.appendChild(option);
+ options.push(option);
+ }
+
+ getter(select).remove(-1);
+ assert_array_equals(select.options, options, "After remove(-1)");
+ assert_equals(select.parentNode, div);
+
+ getter(select).remove(3);
+ assert_array_equals(select.options, options, "After remove(3)");
+ assert_equals(select.parentNode, div);
+
+ getter(select).remove(0);
+ assert_array_equals(select.options, [options[1], options[2]], "After remove(0)");
+ assert_equals(select.parentNode, div);
+ }, desc)
+}
+testRemove(function(select) { return select; }, "select.remove(n) should work");
+testRemove(function(select) { return select.options; }, "select.options.remove(n) should work");
+test(function() {
+ var div = document.createElement("div");
+ var select = document.createElement("select");
+ div.appendChild(select);
+ assert_equals(select.parentNode, div);
+ assert_equals(div.firstChild, select);
+
+ select.remove();
+ assert_equals(select.parentNode, null);
+ assert_equals(div.firstChild, null);
+}, "remove() should work on select elements.")
+test(function() {
+ var div = document.createElement("div");
+ var select = document.createElement("select");
+ div.appendChild(select);
+ assert_equals(select.parentNode, div);
+ assert_equals(div.firstChild, select);
+
+ Element.prototype.remove.call(select);
+ assert_equals(select.parentNode, null);
+ assert_equals(div.firstChild, null);
+}, "Element#remove() should work on select elements.")
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-textarea-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/forms/the-textarea-element/cloning-steps.html b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/cloning-steps.html
new file mode 100644
index 000000000..7a85bd26a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/cloning-steps.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Cloning of textarea elements</title>
+<link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode">
+<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone">
+<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone-ext">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/forms.html#the-textarea-element:concept-node-clone-ext">
+<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<script>
+"use strict";
+
+test(function() {
+ var textarea = document.createElement("textarea");
+ textarea.value = "foo bar";
+
+ var copy = textarea.cloneNode();
+ assert_equals(copy.value, "foo bar");
+}, "textarea element's value should be cloned");
+
+test(function() {
+ var textarea = document.createElement("textarea");
+ textarea.value = "foo bar";
+
+ var copy = textarea.cloneNode();
+ copy.setAttribute("value", "something else");
+
+ assert_equals(copy.value, "foo bar");
+}, "textarea element's dirty value flag should be cloned, so setAttribute doesn't affect the cloned textarea's value");
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-newline-bidi-ref.html b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-newline-bidi-ref.html
new file mode 100644
index 000000000..d69195b4f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-newline-bidi-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML Test reference: newline in &lt;textarea&gt; separates bidi paragraphs</title>
+ <link rel="author" title="Amir E. Aharoni" href="mailto:amir.aharoni@mail.huji.ac.il"/>
+ <link rel="author" title="Eyal Sela" href="mailto:eyal@post.isoc.org.il"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-textarea-element"/>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the rightmost character in the first line below is a full stop and to the left of it is a Hebrew letter.</p></div>
+ <div class="test">
+ <textarea cols="70" rows="3">
+A Hebrew letter and a full stop: &#x05d0;.&lrm;
+&#x05d0; this line begins with a Hebrew letter.
+ </textarea>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-newline-bidi.html b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-newline-bidi.html
new file mode 100644
index 000000000..ce1ff944c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-newline-bidi.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: newline in &lt;textarea&gt; separates bidi paragraphs</title>
+ <link rel="match" href="textarea-newline-bidi-ref.html" />
+ <link rel="author" title="Amir E. Aharoni" href="mailto:amir.aharoni@mail.huji.ac.il"/>
+ <link rel="author" title="Eyal Sela" href="mailto:eyal@post.isoc.org.il"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-textarea-element"/>
+ <meta name="assert"
+ content="A newline in a textarea element, and in its raw value, should separate paragraphs for the purposes of the Unicode bidirectional algorithm."/>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the rightmost character in the first line below is a full stop and to the left of it is a Hebrew letter.</p></div>
+ <div class="test">
+ <textarea cols="70" rows="3">
+A Hebrew letter and a full stop: &#x05d0;.
+&#x05d0; this line begins with a Hebrew letter.
+ </textarea>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-placeholder-manual.html b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-placeholder-manual.html
new file mode 100644
index 000000000..d59a25941
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-placeholder-manual.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: textarea - placeholder attribute</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-textarea-placeholder">
+<meta name="flags" content="interact">
+<body>
+ <p>
+ Test passes if there is a "Placeholder Text" in the text area,
+ and if the "Placeholder Text" disappears after type in any character.
+ </p>
+ <textarea placeholder="Placeholder Text"></textarea>
+</body>
+
diff --git a/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-select-event-manual.html b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-select-event-manual.html
new file mode 100644
index 000000000..f1679e280
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-select-event-manual.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTMLTextAreaElement Test: select event</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<meta name="flags" content="interact">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<p>Select any numberic characters in the text area below</p>
+
+<form id="testForm" name="testForm">
+ <textarea id="testtextarea">0123456789</textarea>
+</form>
+
+<script>
+
+var textarea = document.getElementById("testtextarea");
+
+setup({explicit_done : true});
+setup({explicit_timeout : true});
+
+on_event(textarea, "select", function(evt) {
+ test(function() {
+ assert_greater_than(textarea.value.substring(textarea.selectionStart, textarea.selectionEnd).length, 0, "Check if select event captured when text selected");
+ });
+ done();
+});
+
+</script>
+
+<div id="log"></div>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-select-manual.html b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-select-manual.html
new file mode 100644
index 000000000..4e98ba509
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-select-manual.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTMLTextAreaElement Test: select()</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<meta name="flags" content="interact">
+
+<p>Test passes if content of the input area is selected</p>
+
+<textarea id="test_obj">1234567</textarea>
+<script>
+var textarea = document.querySelector("#test_obj");
+textarea.select();
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-type.html b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-type.html
new file mode 100644
index 000000000..ac80f9365
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/textarea-type.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<title>The type IDL attribute</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-textarea-type">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="test">
+<textarea></textarea>
+</div>
+<script>
+test(function() {
+ assert_equals(document.getElementById("test")
+ .getElementsByTagName("textarea")[0].type,
+ "textarea");
+}, "Textarea's type attribute should return 'textarea'");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-textarea-element/wrap-reflect-1-ref.html b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/wrap-reflect-1-ref.html
new file mode 100644
index 000000000..98a7f8a3a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/wrap-reflect-1-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<title>Dynamic manipulation of textarea.wrap</title>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#dom-textarea-wrap>
+<link rel=author title=Ms2ger href=mailto:ms2ger@gmail.com>
+<textarea wrap=soft cols=20>01234567890 01234567890 01234567890</textarea>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-textarea-element/wrap-reflect-1a.html b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/wrap-reflect-1a.html
new file mode 100644
index 000000000..b3baa79d7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/wrap-reflect-1a.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<title>Dynamic manipulation of textarea.wrap</title>
+<link rel=match href=wrap-reflect-1-ref.html>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#dom-textarea-wrap>
+<link rel=author title=Ms2ger href=mailto:ms2ger@gmail.com>
+<textarea wrap=off cols=20>01234567890 01234567890 01234567890</textarea>
+<script>
+document.getElementsByTagName("textarea")[0].wrap = "soft";
+</script>
diff --git a/testing/web-platform/tests/html/semantics/forms/the-textarea-element/wrap-reflect-1b.html b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/wrap-reflect-1b.html
new file mode 100644
index 000000000..b0a9b460f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/wrap-reflect-1b.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<title>Dynamic manipulation of textarea.wrap</title>
+<link rel=match href=wrap-reflect-1-ref.html>
+<link rel=help href=https://html.spec.whatwg.org/multipage/#dom-textarea-wrap>
+<link rel=author title=Ms2ger href=mailto:ms2ger@gmail.com>
+<textarea wrap=off cols=20>01234567890 01234567890 01234567890</textarea>
+<script>
+document.getElementsByTagName("textarea")[0].setAttribute("wrap", "soft");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-blockquote-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-blockquote-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-blockquote-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-dd-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-dd-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-dd-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-dd-element/grouping-dd.html b/testing/web-platform/tests/html/semantics/grouping-content/the-dd-element/grouping-dd.html
new file mode 100644
index 000000000..022e555bd
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-dd-element/grouping-dd.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>the dd element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dd-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ "use strict";
+
+ // check that prototype matches spec's DOM interface
+ test(function () {
+ var testElement = document.createElement("dd");
+ assert_equals(Object.getPrototypeOf(testElement), HTMLElement.prototype, "HTMLElement.prototype should be used for dd");
+ }, "The prototype for dd is HTMLElement.prototype");
+
+ </script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test validates the dd element.</p>
+
+ <div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-div-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-div-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-div-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-div-element/grouping-div.html b/testing/web-platform/tests/html/semantics/grouping-content/the-div-element/grouping-div.html
new file mode 100644
index 000000000..ffde6eb53
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-div-element/grouping-div.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>The div element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-div-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ "use strict";
+
+ // check that prototype matches spec's DOM interface
+ test(function () {
+ var testElement = document.createElement("div");
+ assert_equals(Object.getPrototypeOf(testElement), HTMLDivElement.prototype, "HTMLDivElement.prototype should be used for div");
+ }, "The prototype for div is HTMLDivElement.prototype");
+
+ </script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test validates the div element.</p>
+
+ <div id="log"></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-dl-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-dl-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-dl-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-dl-element/grouping-dl.html b/testing/web-platform/tests/html/semantics/grouping-content/the-dl-element/grouping-dl.html
new file mode 100644
index 000000000..2394d6a92
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-dl-element/grouping-dl.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>the dl element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dl-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ "use strict";
+
+ // check that prototype matches spec's DOM interface
+ test(function () {
+ var testElement = document.createElement("dl");
+ assert_equals(Object.getPrototypeOf(testElement), HTMLDListElement.prototype, "HTMLDListElement.prototype should be used for dl");
+ }, "The prototype for dl is HTMLDListElement.prototype");
+
+ // Not checking: effects of markup on defining groups and the name-pair values within those groups
+
+ </script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test validates the dl element.</p>
+
+ <div id="log"></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-dt-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-dt-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-dt-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-dt-element/grouping-dt.html b/testing/web-platform/tests/html/semantics/grouping-content/the-dt-element/grouping-dt.html
new file mode 100644
index 000000000..1dbb4384d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-dt-element/grouping-dt.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>the dl element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-dt-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ "use strict";
+
+ // check that prototype matches spec's DOM interface
+ test(function () {
+ var testElement = document.createElement("dt");
+ assert_equals(Object.getPrototypeOf(testElement), HTMLElement.prototype, "HTMLElement.prototype should be used for dt");
+ }, "The prototype for dt is HTMLElement.prototype");
+
+ </script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test validates the dt element.</p>
+
+ <div id="log"></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-figcaption-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-figcaption-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-figcaption-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-figcaption-element/grouping-figcaption.html b/testing/web-platform/tests/html/semantics/grouping-content/the-figcaption-element/grouping-figcaption.html
new file mode 100644
index 000000000..68e7a516b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-figcaption-element/grouping-figcaption.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>the figcaption element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-figcaption-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ "use strict";
+
+ // check that prototype matches spec's DOM interface
+ test(function () {
+ var testElement = document.createElement("figcaption");
+ assert_equals(Object.getPrototypeOf(testElement), HTMLElement.prototype, "HTMLElement.prototype should be used for figcaption");
+ }, "The prototype for figcaption is HTMLElement.prototype");
+
+ </script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test validates the figcaption element.</p>
+
+ <div id="log"></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-figure-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-figure-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-figure-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-figure-element/grouping-figure.html b/testing/web-platform/tests/html/semantics/grouping-content/the-figure-element/grouping-figure.html
new file mode 100644
index 000000000..31c156ce3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-figure-element/grouping-figure.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>the figure element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-figure-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ "use strict";
+
+ // check that prototype matches spec's DOM interface
+ test(function () {
+ var testElement = document.createElement("figure");
+ assert_equals(Object.getPrototypeOf(testElement), HTMLElement.prototype, "HTMLElement.prototype should be used for figure");
+ }, "The prototype for figure is HTMLElement.prototype");
+
+ // Not checking: Sectioning root
+
+ </script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test validates the figure element.</p>
+
+ <div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-hr-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-hr-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-hr-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-hr-element/grouping-hr.html b/testing/web-platform/tests/html/semantics/grouping-content/the-hr-element/grouping-hr.html
new file mode 100644
index 000000000..eeadd97d4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-hr-element/grouping-hr.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>the hr element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-hr-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ "use strict";
+
+ // check that prototype matches spec's DOM interface
+ test(function () {
+ var testElement = document.createElement("hr");
+ assert_equals(Object.getPrototypeOf(testElement), HTMLHRElement.prototype, "HTMLHRElement.prototype should be used for hr");
+ }, "The prototype for hr is HTMLHRElement.prototype");
+
+ // Not checking: "The hr element does not affect the document's outline."
+
+ </script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test validates the hr element.</p>
+
+ <div id="log"></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-novalue-manual.html b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-novalue-manual.html
new file mode 100644
index 000000000..346ed5662
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-novalue-manual.html
@@ -0,0 +1,148 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Body Element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-body-element">
+ <meta name="flags" content="interact" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <h1>Validation of li characteristic requiring manual testing</h1>
+
+ <p>The spec states: "If the parent element is an ol element, then the li element has an ordinal value."</p>
+ <p>This manual test is needed to verify that NON-ol element parents do NOT result in an ordinal value.</p>
+ <p>It needs to be manual because the ordinal value assigned to each list element by the user agent is NOT available programmatically. Values which are set either via markup or IDL are available programmatically, but not the calculated values for all the other list items.</p>
+ <p>And, as we cannot be sure how a mistakenly assigned value would be rendered, this test cannot be a reftest.</p>
+ <p>So, please use the buttons to answer the following questions:</p>
+
+ <table>
+ <thead>
+ <tr>
+ <th>HTML Markup</th>
+ <th>Do you see any sort of sequencing information?</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <menu>
+ <li>Menu Item</li>
+ <li>Menu Item</li>
+ </menu>
+ </td>
+ <td>
+ <input type="button" id="btnMenuYes" value="Yes" />
+ <input type="button" id="btnMenuNo" value="No" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <menu type="toolbar">
+ <li>
+ <menu label="ToolbarLabel">
+ <li><a>Toolbar Menu Item</a></li>
+ <li><a>Toolbar Menu Item</a></li>
+ </menu>
+ </li>
+ <li>
+ <menu label="ToolbarLabel">
+ <li><a>Toolbar Menu Item</a></li>
+ <li><a>Toolbar Menu Item</a></li>
+ </menu>
+ </li>
+ </menu>
+ </td>
+ <td>
+ <input type="button" id="btnToolbarYes" value="Yes" />
+ <input type="button" id="btnToolbarNo" value="No" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <ul>
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ul>
+ </td>
+ <td>
+ <input type="button" id="btnULYes" value="Yes" />
+ <input type="button" id="btnULNo" value="No" />
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <div id="log"></div>
+
+ <script>
+ "use strict";
+
+ var testMenu = {}, testToolbar = {}, testUL = {};
+
+ // need to be able to wait for user to push button
+ setup(function () {
+ btnMenuYes.disabled = false;
+ btnMenuNo.disabled = false;
+ btnToolbarYes.disabled = false;
+ btnToolbarNo.disabled = false;
+ btnULYes.disabled = false;
+ btnULNo.disabled = false;
+ },
+ { explicit_timeout: true }
+ );
+
+ // register async tests
+ testMenu = async_test("Check that menu element does not result in values for list items.");
+ testToolbar = async_test("Check that toolbar type menu element does not result in values for list items.");
+ testUL = async_test("Check that unordered list element does not result in values for list items.");
+
+ // run async tests after buttons are clicked - MENU test
+ document.getElementById("btnMenuNo").onclick = testMenu.step_func(function (event) {
+ assert_true(true, "No sequencing applied to list elements inside menu.");
+ testMenu.done();
+ btnMenuYes.disabled = true;
+ btnMenuNo.disabled = true;
+ });
+ document.getElementById("btnMenuYes").onclick = testMenu.step_func(function (event) {
+ assert_true(false, "No sequencing applied to list elements inside menu.");
+ testMenu.done();
+ btnMenuYes.disabled = true;
+ btnMenuNo.disabled = true;
+ });
+
+ // run async tests after buttons are clicked -TOOLBAR test
+ document.getElementById("btnToolbarNo").onclick = testToolbar.step_func(function (event) {
+ assert_true(true, "No sequencing applied to list elements inside toolbar menu.");
+ testToolbar.done();
+ btnToolbarYes.disabled = true;
+ btnToolbarNo.disabled = true;
+ });
+ document.getElementById("btnToolbarYes").onclick = testToolbar.step_func(function (event) {
+ assert_true(false, "No sequencing applied to list elements inside toolbar menu.");
+ testToolbar.done();
+ btnToolbarYes.disabled = true;
+ btnToolbarNo.disabled = true;
+ });
+
+ // run async tests after buttons are clicked - UL test
+ document.getElementById("btnULNo").onclick = testUL.step_func(function (event) {
+ assert_true(true, "No sequencing applied to list elements inside UL.");
+ testUL.done();
+ btnULYes.disabled = true;
+ btnULNo.disabled = true;
+ });
+ document.getElementById("btnULYes").onclick = testUL.step_func(function (event) {
+ assert_true(false, "No sequencing applied to list elements inside UL.");
+ testUL.done();
+ btnULYes.disabled = true;
+ btnULNo.disabled = true;
+ });
+
+
+ </script>
+
+</body>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-001-ref.html b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-001-ref.html
new file mode 100644
index 000000000..5ff5296e2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-001-ref.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>li element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-li-element">
+ <meta name="assert" content="The value attribute has no effect when applied to a li element whose parent is a non-ol element." />
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test continues to validate the li element.</p>
+
+ <p>The spec states:</p>
+ <blockquote>"If the parent element is an ol element, then the li element has an ordinal value. The value attribute is processed relative to the element's parent ol element (q.v.), if there is one. If there is not, the attribute has no effect."</blockquote>
+ <p>This reftest verifies that the value attribute has no effect when applied to a list item NOT having an ol parent.</p>
+ <p>A reftest is necessary because the values of li elements as calculated by the user agent are NOT available programatically. Only explicitly-set values are then available programatically.</p>
+ <p>This reftest passes if you see NO sequencing information on any of the items below.</p>
+
+ <p>Unordered List</p>
+ <ul>
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ul>
+
+ <menu>
+ <li>Menu Item</li>
+ <li>Menu Item</li>
+ </menu>
+
+ <menu type="toolbar">
+ <li>
+ <menu label="ToolbarLabel">
+ <li><a>Toolbar Menu Item</a></li>
+ <li><a>Toolbar Menu Item</a></li>
+ </menu>
+ </li>
+ <li>
+ <menu label="ToolbarLabel">
+ <li><a>Toolbar Menu Item</a></li>
+ <li><a>Toolbar Menu Item</a></li>
+ </menu>
+ </li>
+ </menu>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-001.html b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-001.html
new file mode 100644
index 000000000..71b72c2ce
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-001.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>li element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-li-element">
+ <link rel="match" href="grouping-li-reftest-001-ref.html" />
+ <meta name="assert" content="The value attribute has no effect when applied to a li element whose parent is a non-ol element." />
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test continues to validate the li element.</p>
+
+ <p>The spec states:</p>
+ <blockquote>"If the parent element is an ol element, then the li element has an ordinal value. The value attribute is processed relative to the element's parent ol element (q.v.), if there is one. If there is not, the attribute has no effect."</blockquote>
+ <p>This reftest verifies that the value attribute has no effect when applied to a list item NOT having an ol parent.</p>
+ <p>A reftest is necessary because the values of li elements as calculated by the user agent are NOT available programatically. Only explicitly-set values are then available programatically.</p>
+ <p>This reftest passes if you see NO sequencing information on any of the items below.</p>
+
+ <p>Unordered List</p>
+ <ul>
+ <li value="2">list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ul>
+
+ <menu>
+ <li>Menu Item</li>
+ <li value="3">Menu Item</li>
+ </menu>
+
+ <menu type="toolbar">
+ <li value="4">
+ <menu label="ToolbarLabel">
+ <li value="5"><a>Toolbar Menu Item</a></li>
+ <li><a>Toolbar Menu Item</a></li>
+ </menu>
+ </li>
+ <li value="6">
+ <menu label="ToolbarLabel">
+ <li value="10"><a>Toolbar Menu Item</a></li>
+ <li><a>Toolbar Menu Item</a></li>
+ </menu>
+ </li>
+ </menu>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-002-ref.html b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-002-ref.html
new file mode 100644
index 000000000..bdb728faf
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-002-ref.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>li element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-li-element">
+ <meta name="assert" content="li elements with ol parents have ordinal values." />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span span p {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ </style>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test continues to validate the li element.</p>
+
+ <p>The spec states:</p>
+ <blockquote>"If the parent element is an ol element, then the li element has an ordinal value. The value attribute is processed relative to the element's parent ol element (q.v.), if there is one. If there is not, the attribute has no effect."</blockquote>
+ <p>This reftest verifies that the value attribute has an effect when applied to a list item with an ol parent.</p>
+ <p>A reftest is necessary because the values of li elements as calculated by the user agent are NOT available programatically. Only explicitly-set values are then available programatically.</p>
+ <p>This reftest passes if you see the numbers 1. 2. 3. below the words "Ordered List"</p>
+
+ <span>
+ <p>Ordered List</p>
+ <span>
+ <p>1.</p>
+ <p>2.</p>
+ <p>3.</p>
+ </span>
+ </span>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-002.html b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-002.html
new file mode 100644
index 000000000..ae4eebee1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-002.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>li element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-li-element">
+ <link rel="match" href="grouping-li-reftest-002-ref.html" />
+ <meta name="assert" content="li elements with ol parents have ordinal values." />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span li {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ span ol {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace;
+ list-style-position: inside; list-style-type: decimal; }
+ </style>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test continues to validate the li element.</p>
+
+ <p>The spec states:</p>
+ <blockquote>"If the parent element is an ol element, then the li element has an ordinal value. The value attribute is processed relative to the element's parent ol element (q.v.), if there is one. If there is not, the attribute has no effect."</blockquote>
+ <p>This reftest verifies that the value attribute has an effect when applied to a list item with an ol parent.</p>
+ <p>A reftest is necessary because the values of li elements as calculated by the user agent are NOT available programatically. Only explicitly-set values are then available programatically.</p>
+ <p>This reftest passes if you see the numbers 1. 2. 3. below the words "Ordered List"</p>
+
+ <span>
+ <p>Ordered List</p>
+ <ol>
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+ </span>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li.html b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li.html
new file mode 100644
index 000000000..fa342b3e2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li.html
@@ -0,0 +1,193 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>li element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-li-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test validates the li element.</p>
+
+ <div id="log"></div>
+
+ <span>
+ <menu id="listmenu">
+ <li>Command</li>
+ <li value="3">Command</li>
+ </menu>
+
+ <menu type="toolbar" id="toolbarmenu">
+ <li>
+ <menu label="File">
+ <button type="button">New...</button>
+ <button type="button">Open...</button>
+ </menu>
+ </li>
+ <li value="10">
+ <menu label="Help">
+ <li value = "2"><a href="help.html">Help Me</a></li>
+ <li><a href="about.html">About</a></li>
+ </menu>
+ </li>
+ </menu>
+
+ <p>Unordered List</p>
+ <ul id="unordered">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ul>
+ </span>
+
+ <p>Ordered List</p>
+ <ol id="basic">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="start2">
+ <li value="2">list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="negative">
+ <li value="-10">list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="posFloatDown">
+ <li value="4.03">list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="negFloatDown">
+ <li value="-4.03">list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="posFloatUp">
+ <li value="4.9">list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="negFloatUp">
+ <li value="-4.9">list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="exponent">
+ <li value="7e2">list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="decimal">
+ <li value=".5">list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="letter">
+ <li value="A">list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <script>
+ "use strict";
+
+ // "The [value] attribute has no default value" so, per https://html.spec.whatwg.org/multipage/#reflect,
+ // the default when unspecified is 0
+ test(function() {
+ var testList = document.querySelectorAll("#unordered li, #basic li");
+ for (var i = 0; i < testList.length; i++) {
+ assert_equals(testList[i].value, 0, "Default (unspecified) value of value is 0.");
+ }
+ }, "Default (unspecified) value of value is 0.");
+
+ // "If the value attribute is present, user agents must parse it as an integer, in order to determine the attribute's value.
+ // If the attribute's value cannot be converted to a number, the attribute must be treated as if it was absent."
+ // Per https://html.spec.whatwg.org/multipage/#collect-a-sequence-of-characters,
+ // an integer is parsed by collecting as many digits as possible and then aborting at the first
+ // non-digit character after the first digit (otherwise, with no beginning digit, it's just an error)
+ // and: "The value IDL attribute must reflect the value of the value content attribute."
+
+ // start2's first element has value of 2
+ test(function() {
+ var testLI = document.getElementById("start2").children[0];
+ assert_equals(testLI.value, 2, "value of 2 -> value of 2");
+ }, ".value property reflects content attribute - and both parse value of '2' correctly.");
+
+ // negative's first element has value of -10
+ test(function() {
+ var testLI = document.getElementById("negative").children[0];
+ assert_equals(testLI.value, -10, "value of -10 -> value of -10");
+ }, "IDL and content attribute parse value of '-10' correctly.");
+
+ // posFloatDown's first element has value of 4.03 which should return 4
+ test(function() {
+ var testLI = document.getElementById("posFloatDown").children[0];
+ assert_equals(testLI.value, 4, "value of 4.03 -> 4");
+ }, "IDL and content attribute parse value of '4.03' correctly.");
+
+ // negFloatDown's first element has value of -4.03 which should return -4
+ test(function() {
+ var testLI = document.getElementById("negFloatDown").children[0];
+ assert_equals(testLI.value, -4, "value of -4.03 -> -4");
+ }, "IDL and content attribute parse value of '-4.03' correctly.");
+
+ // posFloatUp's first element has value of 4.9 which should return 4
+ test(function() {
+ var testLI = document.getElementById("posFloatUp").children[0];
+ assert_equals(testLI.value, 4, "value of 4.9 -> 4");
+ }, "IDL and content attribute parse value of '4.9' correctly.");
+
+ // negFloatUp's first element has value of -4.9 which should return -4
+ test(function() {
+ var testLI = document.getElementById("negFloatUp").children[0];
+ assert_equals(testLI.value, -4, "value of -4.9 -> -4");
+ }, "IDL and content attribute parse value of '-4.9' correctly.");
+
+ // exponent's first element has value of 7e2 which should return 7
+ test(function() {
+ var testLI = document.getElementById("exponent").children[0];
+ assert_equals(testLI.value, 7, "value of 7e2 -> 7");
+ }, "IDL and content attribute parse value of '7e2' correctly.");
+
+ // decimal's first element has value of .5 which should return 0
+ test(function() {
+ var testLI = document.getElementById("decimal").children[0];
+ assert_equals(testLI.value, 0, "value of .5 -> 0 (default)");
+ }, "IDL and content attribute parse value of '.5' correctly.");
+
+ // letter's first element has value of A which should return 0
+ test(function() {
+ var testLI = document.getElementById("letter").children[0];
+ assert_equals(testLI.value, 0, "value of A -> 0 (default)");
+ }, "IDL and content attribute parse value of 'A' correctly.");
+
+ // SHOULD I TEST MORE NON-ASCII-DIGIT ENTRIES?
+
+ </script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-rev-reftest-001-ref.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-rev-reftest-001-ref.html
new file mode 100644
index 000000000..019aef1b6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-rev-reftest-001-ref.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <meta name="assert" content="OL's reversed attribute creates a descending list." />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span span p {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ </style>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test continues to validate the ol element.</p>
+
+ <p>These reftests are necessary because the values of the ol's li children as calculated by the user agent are NOT available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
+
+ <p>The spec states:</p>
+ <blockquote>"The reversed attribute is a boolean attribute. If present, it indicates that the list is a descending list (..., 3, 2, 1). If the attribute is omitted, the list is an ascending list (1, 2, 3, ...)."</blockquote>
+
+ <p><strong>This reftest passes if you see an ascending list followed by two descending lists.</strong></p>
+ <p>(Note: each list item has no content; only the sequencing should appear.)</p>
+
+ <span>
+
+ <p>Ordered List</p>
+ <span>
+ <p>1.</p>
+ <p>2.</p>
+ <p>3.</p>
+ </span>
+
+ <p>Ordered List - reversed via content attribute</p>
+ <span>
+ <p>3.</p>
+ <p>2.</p>
+ <p>1.</p>
+ </span>
+
+ <p>Ordered List - reversed via IDL</p>
+ <span>
+ <p>3.</p>
+ <p>2.</p>
+ <p>1.</p>
+ </span>
+
+ </span>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-rev-reftest-001.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-rev-reftest-001.html
new file mode 100644
index 000000000..32d4f2c86
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-rev-reftest-001.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <link rel="match" href="grouping-ol-rev-reftest-001-ref.html" />
+ <meta name="assert" content="OL's reversed attribute creates a descending list." />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span li {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ span ol {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace;
+ list-style-position: inside; list-style-type: decimal; }
+ </style>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test continues to validate the ol element.</p>
+
+ <p>These reftests are necessary because the values of the ol's li children as calculated by the user agent are NOT available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
+
+ <p>The spec states:</p>
+ <blockquote>"The reversed attribute is a boolean attribute. If present, it indicates that the list is a descending list (..., 3, 2, 1). If the attribute is omitted, the list is an ascending list (1, 2, 3, ...)."</blockquote>
+
+ <p><strong>This reftest passes if you see an ascending list followed by two descending lists.</strong></p>
+ <p>(Note: each list item has no content; only the sequencing should appear.)</p>
+
+ <span>
+
+ <p>Ordered List</p>
+ <ol>
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>Ordered List - reversed via content attribute</p>
+ <ol reversed="reversed">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>Ordered List - reversed via IDL</p>
+ <ol id="reverse_me">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ </span>
+
+ <script>
+ document.getElementById("reverse_me").reversed = true;
+ </script>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-001-ref.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-001-ref.html
new file mode 100644
index 000000000..f87074899
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-001-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <meta name="assert" content="Sequences produced by calculated values for LI elements within OL match spec's expectations. (part one)" />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span span p {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ </style>
+</head>
+<body>
+ <p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
+
+ <p>The spec states:</p>
+ <blockquote><p>The first item in the list has the ordinal value given by the ol element's start attribute, unless that li element has a value attribute with a value that can be successfully parsed, in which case it has the ordinal value given by that value attribute.</p>
+ <p>Each subsequent item in the list has the ordinal value given by its value attribute, if it has one, or, if it doesn't, the ordinal value of the previous item, plus one if the reversed is absent, or minus one if it is present.</p></blockquote>
+
+ <p><strong>This reftest passes if each list's items are numbered identically to the horizontal sequence immediately above those list items.</strong></p>
+ <p>(Note: each list item has no content; only the sequencing should appear.)</p>
+
+ <span>
+
+ <p>2, 3, 4 (ol has start attribute of 2)</p>
+ <span>
+ <p>2.</p>
+ <p>3.</p>
+ <p>4.</p>
+ </span>
+
+ <p>-9, -8, -7 (ol has start attribute of -9)</p>
+ <span>
+ <p>-9.</p>
+ <p>-8.</p>
+ <p>-7.</p>
+ </span>
+
+ <p>1000, 1001, 1002 (list's start attribute of 1000 provided by JavaScript)</p>
+ <span>
+ <p>1000.</p>
+ <p>1001.</p>
+ <p>1002.</p>
+ </span>
+
+ <p>2, 1, 9 (each list item has a specified value attribute, list has a start attribute of 1000)</p>
+ <span>
+ <p>2.</p>
+ <p>1.</p>
+ <p>9.</p>
+ </span>
+
+ </span>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-001.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-001.html
new file mode 100644
index 000000000..dc373f910
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-001.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <link rel="match" href="grouping-ol-start-reftest-001-ref.html" />
+ <meta name="assert" content="Sequences produced by calculated values for LI elements within OL match spec's expectations (part one)." />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span li {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ span ol {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace;
+ list-style-position: inside; list-style-type: decimal; }
+ </style>
+</head>
+<body>
+ <p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
+
+ <p>The spec states:</p>
+ <blockquote><p>The first item in the list has the ordinal value given by the ol element's start attribute, unless that li element has a value attribute with a value that can be successfully parsed, in which case it has the ordinal value given by that value attribute.</p>
+ <p>Each subsequent item in the list has the ordinal value given by its value attribute, if it has one, or, if it doesn't, the ordinal value of the previous item, plus one if the reversed is absent, or minus one if it is present.</p></blockquote>
+
+ <p><strong>This reftest passes if each list's items are numbered identically to the horizontal sequence immediately above those list items.</strong></p>
+ <p>(Note: each list item has no content; only the sequencing should appear.)</p>
+
+ <span>
+
+ <p>2, 3, 4 (ol has start attribute of 2)</p>
+ <ol start="2">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>-9, -8, -7 (ol has start attribute of -9)</p>
+ <ol start="-9">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>1000, 1001, 1002 (list's start attribute of 1000 provided by JavaScript)</p>
+ <ol id="start_me">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>2, 1, 9 (each list item has a specified value attribute, list has a start attribute of 1000)</p>
+ <ol istart="1000">
+ <li value="2"></li>
+ <li value="1"></li>
+ <li value="9"></li>
+ </ol>
+
+ </span>
+
+ <script>
+ document.getElementById("start_me").start = 1000;
+ </script>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-002-ref.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-002-ref.html
new file mode 100644
index 000000000..2ba4af9b1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-002-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <meta name="assert" content="Sequences produced by calculated values for LI elements within OL match spec's expectations. (part two)" />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span span p {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ </style>
+</head>
+<body>
+ <p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
+
+ <p>The spec states:</p>
+ <blockquote><p>The first item in the list has the ordinal value given by the ol element's start attribute, unless that li element has a value attribute with a value that can be successfully parsed, in which case it has the ordinal value given by that value attribute.</p>
+ <p>Each subsequent item in the list has the ordinal value given by its value attribute, if it has one, or, if it doesn't, the ordinal value of the previous item, plus one if the reversed is absent, or minus one if it is present.</p></blockquote>
+
+ <p><strong>This reftest passes if each list's items are numbered identically to the horizontal sequence immediately above those list items.</strong></p>
+ <p>(Note: each list item has no content; only the sequencing should appear.)</p>
+
+ <span>
+
+ <p>4, 5, 6 (ol has start attribute of 2 which is overridden by first list item's value attribute of 4)</p>
+ <span>
+ <p>4.</p>
+ <p>5.</p>
+ <p>6.</p>
+ </span>
+
+ <p>4, 5, 6 (ol has start attribute of -10 which is overridden by first list item's value attribute of 4)</p>
+ <span>
+ <p>4.</p>
+ <p>5.</p>
+ <p>6.</p>
+ </span>
+
+ <p>1, 5, 6 (2nd list item has value attribute of 5)</p>
+ <span>
+ <p>1.</p>
+ <p>5.</p>
+ <p>6.</p>
+ </span>
+
+ <p>-1, -5, -4 (list has a start attribute of -1, and 2nd list item has value attribute of -5)</p>
+ <span>
+ <p>-1.</p>
+ <p>-5.</p>
+ <p>-4.</p>
+ </span>
+
+ </span>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-002.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-002.html
new file mode 100644
index 000000000..559e3c219
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-002.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <link rel="match" href="grouping-ol-start-reftest-002-ref.html" />
+ <meta name="assert" content="Sequences produced by calculated values for LI elements within OL match spec's expectations. (part two)" />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span li {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ span ol {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace;
+ list-style-position: inside; list-style-type: decimal; }
+ </style>
+</head>
+<body>
+ <p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
+
+ <p>The spec states:</p>
+ <blockquote><p>The first item in the list has the ordinal value given by the ol element's start attribute, unless that li element has a value attribute with a value that can be successfully parsed, in which case it has the ordinal value given by that value attribute.</p>
+ <p>Each subsequent item in the list has the ordinal value given by its value attribute, if it has one, or, if it doesn't, the ordinal value of the previous item, plus one if the reversed is absent, or minus one if it is present.</p></blockquote>
+
+ <p><strong>This reftest passes if each list's items are numbered identically to the horizontal sequence immediately above those list items.</strong></p>
+ <p>(Note: each list item has no content; only the sequencing should appear.)</p>
+
+ <span>
+
+ <p>4, 5, 6 (ol has start attribute of 2 which is overridden by first list item's value attribute of 4)</p>
+ <ol start="2">
+ <li value="4"></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>4, 5, 6 (ol has start attribute of -10 which is overridden by first list item's value attribute of 4)</p>
+ <ol start="-10">
+ <li value="4"></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>1, 5, 6 (2nd list item has value attribute of 5)</p>
+ <ol>
+ <li></li>
+ <li value="5"></li>
+ <li></li>
+ </ol>
+
+ <p>-1, -5, -4 (list has a start attribute of -1, and 2nd list item has value attribute of -5)</p>
+ <ol start="-1">
+ <li></li>
+ <li value="-5"></li>
+ <li></li>
+ </ol>
+
+ </span>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-001-ref.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-001-ref.html
new file mode 100644
index 000000000..294c9abc2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-001-ref.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <meta name="assert" content="OL's type attribute defaults to decimal state." />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span span p {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ </style>
+</head>
+<body>
+ <p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
+
+ <p>The spec states:</p>
+ <blockquote><p>The type attribute represents the state given in the cell in the second column of the row whose first cell matches the attribute's value; if none of the cells match, or if the attribute is omitted, then the attribute represents the decimal state.</p></blockquote>
+
+ <p><strong>This reftest passes if each list's items are labelled identically to the horizontal sequence immediately above those list items:</strong></p>
+ <p>(Note: each list item has no content; only the sequencing should appear.)</p>
+
+ <span>
+ <p>1, 2, 3 (default value for unspecified type attribute is 'decimal')</p>
+ <span>
+ <p>1.</p>
+ <p>2.</p>
+ <p>3.</p>
+ </span>
+
+ <p>1, 2, 3 (default value for type attribute not listed in spec table is 'decimal' (type = "!"))</p>
+ <span>
+ <p>1.</p>
+ <p>2.</p>
+ <p>3.</p>
+ </span>
+
+ <p>1, 2, 3 (default value for type attribute not listed in spec table is 'decimal' (type = "2"))</p>
+ <span>
+ <p>1.</p>
+ <p>2.</p>
+ <p>3.</p>
+ </span>
+
+ <p>1, 2, 3 (default value for type attribute not listed in spec table is 'decimal' (type = "b"))</p>
+ <span>
+ <p>1.</p>
+ <p>2.</p>
+ <p>3.</p>
+ </span>
+
+ </span>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-001.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-001.html
new file mode 100644
index 000000000..32b0e200b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-001.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <link rel="match" href="grouping-ol-type-reftest-001-ref.html" />
+ <meta name="assert" content="OL's type attribute defaults to decimal state." />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span li {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ span ol {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace; list-style-position: inside; }
+ </style>
+</head>
+<body>
+ <p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
+
+ <p>The spec states:</p>
+ <blockquote><p>The type attribute represents the state given in the cell in the second column of the row whose first cell matches the attribute's value; if none of the cells match, or if the attribute is omitted, then the attribute represents the decimal state.</p></blockquote>
+
+ <p><strong>This reftest passes if each list's items are labelled identically to the horizontal sequence immediately above those list items:</strong></p>
+ <p>(Note: each list item has no content; only the sequencing should appear.)</p>
+
+ <span>
+
+ <p>1, 2, 3 (default value for unspecified type attribute is 'decimal')</p>
+ <ol>
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>1, 2, 3 (default value for type attribute not listed in spec table is 'decimal' (type = "!"))</p>
+ <ol type="!">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>1, 2, 3 (default value for type attribute not listed in spec table is 'decimal' (type = "2"))</p>
+ <ol type="2">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>1, 2, 3 (default value for type attribute not listed in spec table is 'decimal' (type = "b"))</p>
+ <ol type="b">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ </span>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002-ref.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002-ref.html
new file mode 100644
index 000000000..cf31b7a9c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002-ref.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <meta name="assert" content="List items are rendered consistently with the state of the type attribute." />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span span p {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ </style>
+</head>
+<body>
+ <p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
+
+ <p>The spec states:</p>
+ <blockquote>User agents should render the items of the list in a manner consistent with the state of the type attribute of the ol element.</blockquote>
+
+ <p><strong>This reftest passes if each list's items are labelled identically to the horizontal sequence immediately above those list items:</strong></p>
+ <p>(Note: each list item has no content; only the sequencing should appear.)</p>
+
+ <span>
+ <p>1, 2, 3 (type attribute of "1" results in decimal type)</p>
+ <span>
+ <p>1.</p>
+ <p>2.</p>
+ <p>3.</p>
+ </span>
+
+ <p>aa, ab, ac (type attribute of "a" results in lower case latin alphabet, start = 27)</p>
+ <span>
+ <p>aa.</p>
+ <p>ab.</p>
+ <p>ac.</p>
+ </span>
+
+ <p>AA, AB, AC (type attribute of "A" results in upper case latin alphabet, start = 27)</p>
+ <span>
+ <p>AA.</p>
+ <p>AB.</p>
+ <p>AC.</p>
+ </span>
+
+ <p>i, v, c (type attribute of "i" results in lower case roman alphabet, list values = 1, 5, 100)</p>
+ <span>
+ <p>i.</p>
+ <p>v.</p>
+ <p>c.</p>
+ </span>
+
+ <p>I, V, C (type attribute of "I" results in upper case roman alphabet, list values = 1, 5, 100)</p>
+ <span>
+ <p>I.</p>
+ <p>V.</p>
+ <p>C.</p>
+ </span>
+
+ </span>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002.html
new file mode 100644
index 000000000..7daea54c0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <link rel="match" href="grouping-ol-type-reftest-002-ref.html" />
+ <meta name="assert" content="List items are rendered consistently with the state of the type attribute." />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span li {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ span ol {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace; list-style-position: inside;}
+ </style>
+</head>
+<body>
+ <p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
+
+ <p>The spec states:</p>
+ <blockquote>User agents should render the items of the list in a manner consistent with the state of the type attribute of the ol element.</blockquote>
+
+ <p><strong>This reftest passes if each list's items are labelled identically to the horizontal sequence immediately above those list items:</strong></p>
+ <p>(Note: each list item has no content; only the sequencing should appear.)</p>
+
+ <span>
+
+ <p>1, 2, 3 (type attribute of "1" results in decimal type)</p>
+ <ol type="1">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>aa, ab, ac (type attribute of "a" results in lower case latin alphabet, start = 27)</p>
+ <ol type="a" start="27">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>AA, AB, AC (type attribute of "A" results in upper case latin alphabet, start = 27)</p>
+ <ol type="A" start="27">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>i, v, c (type attribute of "i" results in lower case roman alphabet, list values = 1, 5, 100)</p>
+ <ol type="i">
+ <li value="1"></li>
+ <li value="5"></li>
+ <li value="100"></li>
+ </ol>
+
+ <p>I, V, C (type attribute of "I" results in upper case roman alphabet, list values = 1, 5, 100)</p>
+ <ol type="I">
+ <li value="1"></li>
+ <li value="5"></li>
+ <li value="100"></li>
+ </ol>
+
+ </span>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-003-ref.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-003-ref.html
new file mode 100644
index 000000000..4906f3ca6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-003-ref.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <meta name="assert" content="OL's type attribute defaults to decimal state." />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span span p {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ </style>
+</head>
+<body>
+ <p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
+
+ <p>The spec states: Numbers less than or equal to zero should always use the decimal system regardless of the type attribute.</p>
+
+ <p><strong>This reftest passes if each list's items are labelled identically to the horizontal sequence immediately above those list items:</strong></p>
+ <p>(Note: each list item has no content; only the sequencing should appear.)</p>
+
+ <span>
+ <p>-3, -2, -1 (type is "a", start is -3)</p>
+ <span>
+ <p>-3.</p>
+ <p>-2.</p>
+ <p>-1.</p>
+ </span>
+
+ <p>0, a (type is "a", start is 0)</p>
+ <span>
+ <p>0.</p>
+ <p>a.</p>
+ </span>
+
+ <p>-3, -2, -1 (type is "A", start is -3)</p>
+ <span>
+ <p>-3.</p>
+ <p>-2.</p>
+ <p>-1.</p>
+ </span>
+
+ <p>0, A (type is "A", start is 0)</p>
+ <span>
+ <p>0.</p>
+ <p>A.</p>
+ </span>
+
+ <p>-3, -2, -1 (type is "i", start is -3)</p>
+ <span>
+ <p>-3.</p>
+ <p>-2.</p>
+ <p>-1.</p>
+ </span>
+
+ <p>0, i (type is "i", start is 0)</p>
+ <span>
+ <p>0.</p>
+ <p>i.</p>
+ </span>
+
+ <p>-3, -2, -1 (type is "I", start is -3)</p>
+ <span>
+ <p>-3.</p>
+ <p>-2.</p>
+ <p>-1.</p>
+ </span>
+
+ <p>0, I (type is "I", start is 0)</p>
+ <span>
+ <p>0.</p>
+ <p>I.</p>
+ </span>
+
+ </span>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-003.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-003.html
new file mode 100644
index 000000000..5e4b5a588
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-003.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <link rel="match" href="grouping-ol-type-reftest-003-ref.html" />
+ <meta name="assert" content="OL's type attribute defaults to decimal state." />
+ <style type="text/css">
+ span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
+ span li {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0; font-family: monospace;}
+ span ol {margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 5em; padding-top: 0; padding-bottom: 0; font-family: monospace; list-style-position: inside;}
+ </style>
+</head>
+<body>
+ <p>This test continues to validate the ol element. This reftest is necessary because the values of the ol's li children as calculated and displayed by the user agent are NOT systematically available programatically. Only explicitly-set values are available programatically. Therefore, we need to check actual rendering against expected rendering.</p>
+
+ <p>The spec states: Numbers less than or equal to zero should always use the decimal system regardless of the type attribute.</p>
+
+ <p><strong>This reftest passes if each list's items are labelled identically to the horizontal sequence immediately above those list items:</strong></p>
+ <p>(Note: each list item has no content; only the sequencing should appear.)</p>
+
+ <span>
+
+ <p>-3, -2, -1 (type is "a", start is -3)</p>
+ <ol type="a" start="-3">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>0, a (type is "a", start is 0)</p>
+ <ol type="a" start="0">
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>-3, -2, -1 (type is "A", start is -3)</p>
+ <ol type="A" start="-3">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>0, A (type is "A", start is 0)</p>
+ <ol type="A" start="0">
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>-3, -2, -1 (type is "i", start is -3)</p>
+ <ol type="i" start="-3">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>0, i (type is "i", start is 0)</p>
+ <ol type="i" start="0">
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>-3, -2, -1 (type is "I", start is -3)</p>
+ <ol type="I" start="-3">
+ <li></li>
+ <li></li>
+ <li></li>
+ </ol>
+
+ <p>0, I (type is "I", start is 0)</p>
+ <ol type="I" start="0">
+ <li></li>
+ <li></li>
+ </ol>
+
+ </span>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol.html
new file mode 100644
index 000000000..0de2a0641
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/grouping-ol.html
@@ -0,0 +1,314 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>the ol element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test validates the ol element.</p>
+
+ <div id="log"></div>
+
+ <p>Ordered List</p>
+ <ol id="basic">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="allAtts" reversed start="3" type="A">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="justRev" reversed>
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="basicRevGoodName" reversed="reversed">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="basicRevNameWithSpace" reversed=" reversed ">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="basicRevEmpty" reversed="" start="A">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="basicRevTrue" reversed="true">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="basicRevFalse" reversed="false">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="start2" start="2">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="negative" start="-10">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="posFloatDown" start="4.03">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="negFloatDown" start="-4.03">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="posFloatUp" start="4.9">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="negFloatUp" start="-4.9">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="exponent" start="7e2">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="decimal" start=".5">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="letter" start="A">
+ <li>list item</li>
+ <li>list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="middle50">
+ <li>list item</li>
+ <li value="50">list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="middleneg50">
+ <li>list item</li>
+ <li value="-50">list item</li>
+ <li>list item</li>
+ </ol>
+
+ <p>Ordered List</p>
+ <ol id="lots" reversed="reversed">
+ <li value="10">list item</li>
+ <li value="20">list item</li>
+<a></a><abbr></abbr><address></address><area></area><article></article><aside></aside><audio></audio><b></b><base></base><bdi></bdi><bdo></bdo><blockquote></blockquote><body></body><br></br><button></button><canvas></canvas><caption></caption><cite></cite><code></code><col></col><colgroup></colgroup><command></command><datalist></datalist><dd></dd><del></del><details></details><dfn></dfn><dialog></dialog><div></div><dl></dl><dt></dt><em></em><embed></embed><fieldset></fieldset><figcaption></figcaption><figure></figure><footer></footer><form></form><h1></h1><h2></h2><h3></h3><h4></h4><h5></h5><h6></h6><head></head><header></header><hgroup></hgroup><hr></hr><html></html><i></i><iframe></iframe><img></img><input></input><ins></ins><kbd></kbd><keygen></keygen><label></label><legend></legend><link></link><map></map><mark></mark><menu></menu><meta></meta><meter></meter><nav></nav><noscript></noscript><object></object><ol><li></li><li></li></ol><optgroup></optgroup><option></option><output></output><p></p><param></param><pre></pre><progress></progress><q></q><rp></rp><rt></rt><ruby></ruby><s></s><samp></samp><script></script><section></section><select></select><small></small><source></source><span></span><strong></strong><style></style><sub></sub><summary></summary><sup></sup><table></table><tbody></tbody><td></td><textarea></textarea><tfoot></tfoot><th></th><thead></thead><time></time><title></title><tr></tr><track></track><u></u><ul><li></li><li></li></ul><var></var><video></video><wbr></wbr>
+ <li value="-99">list item</li>
+ </ol>
+
+ <script>
+ "use strict";
+
+ var testList;
+
+ // check that prototype matches spec's DOM interface
+ test(function () {
+ testList = document.getElementById("basic");
+ assert_equals(Object.getPrototypeOf(testList), HTMLOListElement.prototype, "HTMLOListElement.prototype should be used for OL");
+ }, "The prototype for OL is HTMLOListElement.prototype");
+
+ // check that "own" properties reversed, start, and type are present
+ test(function () {
+ testList = document.getElementById("basic");
+ assert_idl_attribute(testList, "reversed");
+ }, "'reversed' property should be defined on OL.");
+
+ test(function () {
+ testList = document.getElementById("basic");
+ assert_idl_attribute(testList, "start");
+ }, "'start' property should be defined on OL.");
+
+ test(function () {
+ testList = document.getElementById("basic");
+ assert_idl_attribute(testList, "type");
+ }, "'type' property should be defined on OL.");
+
+ // "The reversed, start, and type IDL attributes must reflect the respective content attributes of the same name."
+ test(function () {
+ testList = document.getElementById("allAtts");
+ assert_true(testList.reversed);
+ }, "OL's 'reversed' IDL property reflects content attribute.");
+
+ test(function () {
+ testList = document.getElementById("allAtts");
+ assert_equals(testList.start, 3);
+ }, "OL's 'start' IDL property reflects content attribute.");
+
+ test(function () {
+ testList = document.getElementById("allAtts");
+ assert_equals(testList.type, "A");
+ }, "OL's 'type' IDL property reflects content attribute.");
+
+
+ // "The reversed attribute is a boolean attribute."
+
+ // check lists for which reversed value should be false
+ test(function() {
+ assert_false(document.getElementById("basic").reversed, "IDL 'reversed' attribute value false when content attribute absent");
+ }, "IDL 'reversed' attribute value false when content attribute absent");
+
+ // check lists for which reversed value should be true
+ test(function() {
+ assert_true(document.getElementById("justRev").reversed);
+ assert_true(document.getElementById("basicRevGoodName").reversed);
+ assert_true(document.getElementById("basicRevNameWithSpace").reversed);
+ assert_true(document.getElementById("basicRevEmpty").reversed);
+ assert_true(document.getElementById("basicRevTrue").reversed);
+ assert_true(document.getElementById("basicRevFalse").reversed);
+ }, "IDL 'reversed' attribute value true when content attribute exists");
+
+ // check that IDL property works to change reversed value
+ test(function() {
+ document.getElementById("justRev").reversed = false;
+ assert_false(document.getElementById("justRev").reversed, "Changing IDL 'reversed' property changes list's reversed property.");
+ }, "Changing IDL 'reversed' property changes list's reversed property.");
+
+
+ // If the start attribute is present, user agents must parse it as an integer, in order to determine the attribute's value.
+ // The default value, used if the attribute is missing or
+ // if the value cannot be converted to a number according to the referenced algorithm,
+ // is 1 if the element has no reversed attribute, and
+ // is the number of child li elements otherwise."
+ // "The start IDL attribute has the same default as its content attribute."
+
+ // basic - default should be 1
+ test(function() {
+ assert_equals(document.getElementById("basic").start, 1, "no start attribute provided -> 1");
+ }, "Default start value for non-reversed list should be 1");
+
+ // decimal's first element has value of .5 which should return 1
+ test(function() {
+ assert_equals(document.getElementById("decimal").start, 1, "start of .5 -> 1 (default)");
+ }, "IDL and content attribute parse start of '.5' correctly.");
+
+ // letter's first element has value of A which should return 1
+ test(function() {
+ assert_equals(document.getElementById("letter").start, 1, "start of A -> 1 (default)");
+ }, "IDL and content attribute parse start of 'A' correctly.");
+
+ // basicRevGoodName - default should be 3
+ test(function() {
+ assert_equals(document.getElementById("basicRevGoodName").start, 3, "no start attribute provided -> 3");
+ }, "Default start value (if none provided) for reversed list = child li elements.");
+
+ // basicRevEmpty - default should be 3
+ test(function() {
+ assert_equals(document.getElementById("basicRevEmpty").start, 3, "start of A -> 3 (default)");
+ }, "Default start value (if failed to parse) for reversed list = child li elements.");
+
+ // lots - default should be 3
+ test(function() {
+ assert_equals(document.getElementById("lots").start, 3, "no start attribute -> 3 (default)");
+ }, "Default start value for reversed list = child li elements (even with tons of other child elements).");
+
+ // adding child element changes default start value for reversed list
+ test(function() {
+ var myList = document.getElementById("basicRevGoodName"), myLI = document.createElement("li");
+ myList.appendChild(myLI);
+ assert_equals(document.getElementById("basicRevGoodName").start, 4, "Adding child element to reversed list adds 1 to start value");
+ }, "Adding child element to reversed list adds 1 to start value");
+
+ // removing child element changes default start value for reversed list
+ test(function() {
+ var myList = document.getElementById("basicRevTrue");
+ myList.removeChild(myList.children[0]);
+ assert_equals(document.getElementById("basicRevTrue").start, 2, "Deleting child element from reversed list reduces start value by 1");
+ }, "Deleting child element from reversed list reduces start value by 1");
+
+ // start2's first element has value of 2
+ test(function() {
+ assert_equals(document.getElementById("start2").start, 2, "start of 2 -> 2");
+ }, "IDL and content attribute parse start of '2' correctly.");
+
+ // negative's first element has value of -10
+ test(function() {
+ assert_equals(document.getElementById("negative").start, -10, "start of -10 -> -10");
+ }, "IDL and content attribute parse start of '-10' correctly.");
+
+ // posFloatDown's first element has value of 4.03 which should return 4
+ test(function() {
+ assert_equals(document.getElementById("posFloatDown").start, 4, "start of 4.03 -> 4");
+ }, "IDL and content attribute parse start of '4.03' correctly.");
+
+ // negFloatDown's first element has value of -4.03 which should return -4
+ test(function() {
+ assert_equals(document.getElementById("negFloatDown").start, -4, "start of -4.03 -> -4");
+ }, "IDL and content attribute parse start of '-4.03' correctly.");
+
+ // posFloatUp's first element has value of 4.9 which should return 4
+ test(function() {
+ assert_equals(document.getElementById("posFloatUp").start, 4, "start of 4.9 -> 4");
+ }, "IDL and content attribute parse start of '4.9' correctly.");
+
+ // negFloatUp's first element has value of -4.9 which should return -4
+ test(function() {
+ assert_equals(document.getElementById("negFloatUp").start, -4, "start of -4.9 -> -4");
+ }, "IDL and content attribute parse start of '-4.9' correctly.");
+
+ // exponent's first element has value of 7e2 which should return 7
+ test(function() {
+ assert_equals(document.getElementById("exponent").start, 7, "start of 7e2 -> 7");
+ }, "IDL and content attribute parse start of '7e2' correctly.");
+
+ </script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/ol.start-reflection-1.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/ol.start-reflection-1.html
new file mode 100644
index 000000000..7f2a00c70
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/ol.start-reflection-1.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>ol.start - reflection test</title>
+ <link rel="author" title="Shiki Okasaka" href="http://shiki.esrille.com/">
+ <link rel="author" title="Esrille Inc." href="http://www.esrille.com/">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <meta name="assert" content="This test checks that the start IDL attribute reflects the respective content attribute of the same name.">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol id="ol">
+ <li>One</li>
+ <li>Two</li>
+ <li>Three</li>
+ </ol>
+ <div id="log"></div>
+ <script>
+test(function() {
+ assert_equals(document.getElementById('ol').start, 1);
+})
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/ol.start-reflection-2.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/ol.start-reflection-2.html
new file mode 100644
index 000000000..f6a260a8b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/ol.start-reflection-2.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>ol.start - reflection test</title>
+ <link rel="author" title="Shiki Okasaka" href="http://shiki.esrille.com/">
+ <link rel="author" title="Esrille Inc." href="http://www.esrille.com/">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
+ <meta name="assert" content="This test checks that the start IDL attribute reflects the respective content attribute of the same name.">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <ol id='ol' reversed>
+ <li>Three</li>
+ <li>Two</li>
+ <li>One</li>
+ </ol>
+ <div id='log'></div>
+ <script>
+test(function() {
+ assert_equals(document.getElementById('ol').start, 3);
+})
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1-ref.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1-ref.html
new file mode 100644
index 000000000..f8cac3c70
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<ol>
+ <li value="3">Three</li>
+ <li value="2">Two</li>
+ <li value="1">One</li>
+</ol>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1a.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1a.html
new file mode 100644
index 000000000..202315b1c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1a.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>`reversed` should reverse the numbering correctly</title>
+<link rel=match href="reversed-1-ref.html">
+<link rel=help href="https://html.spec.whatwg.org/#attr-ol-reversed">
+<ol reversed>
+ <li>Three</li>
+ <li>Two</li>
+ <li>One</li>
+</ol>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1b.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1b.html
new file mode 100644
index 000000000..4d6202943
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1b.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Dynamically setting `reversed` should update the numbering</title>
+<link rel=match href="reversed-1-ref.html">
+<link rel=help href="https://html.spec.whatwg.org/#attr-ol-reversed">
+<ol id="x">
+ <li>Three</li>
+ <li>Two</li>
+ <li>One</li>
+</ol>
+<script>
+ var l = document.getElementById("x");
+ var w = l.offsetWidth;
+ l.setAttribute("reversed", "");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1c.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1c.html
new file mode 100644
index 000000000..6fad13053
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1c.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Reversed numbering should update on dynamic addition of child nodes</title>
+<link rel=match href="reversed-1-ref.html">
+<link rel=help href="https://html.spec.whatwg.org/#attr-ol-reversed">
+<ol id="x" reversed>
+ <li>Three</li>
+ <li>Two</li>
+</ol>
+<script>
+ var l = document.getElementById("x");
+ var w = l.offsetWidth;
+ var li = document.createElement("li");
+ li.textContent = "One"
+ l.appendChild(li);
+</script>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1d.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1d.html
new file mode 100644
index 000000000..a256b6a42
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1d.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Reverse numbering should not be affected by nested div</title>
+<link rel=match href="reversed-1-ref.html">
+<link rel=help href="https://html.spec.whatwg.org/#attr-ol-reversed">
+<ol reversed>
+ <li>Three</li>
+ <div>
+ <li>Two</li>
+ <li>One</li>
+ </div>
+</ol>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1e.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1e.html
new file mode 100644
index 000000000..48a279994
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-1e.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Reverse numbering should not count display:none elements</title>
+<link rel=match href="reversed-1-ref.html">
+<link rel=help href="https://html.spec.whatwg.org/#attr-ol-reversed">
+<ol reversed>
+ <li>Three</li>
+ <li style="display:none">Three</li>
+ <li>Two</li>
+ <li>One</li>
+</ol>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-2-ref.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-2-ref.html
new file mode 100644
index 000000000..4f3ece2be
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-2-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<ol>
+ <li value="5">Five</li>
+ <li value="4">Four</li>
+ <li value="3">Three</li>
+</ol>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-2.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-2.html
new file mode 100644
index 000000000..0d4948153
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ol-element/reversed-2.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<link rel="match" href="reversed-2-ref.html">
+<ol reversed start="5">
+ <li>Five</li>
+ <li>Four</li>
+ <li>Three</li>
+</ol>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-p-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-p-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-p-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-p-element/grouping-p.html b/testing/web-platform/tests/html/semantics/grouping-content/the-p-element/grouping-p.html
new file mode 100644
index 000000000..5f15aca31
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-p-element/grouping-p.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>the p element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-p-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ "use strict";
+
+ // check that prototype matches spec's DOM interface
+ test(function () {
+ var testElement = document.createElement("p");
+ assert_equals(Object.getPrototypeOf(testElement), HTMLParagraphElement.prototype, "HTMLParagraphElement.prototype should be used for p");
+ }, "The prototype for p is HTMLParagraphElement.prototype");
+
+ </script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test validates the p element.</p>
+
+ <div id="log"></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/grouping-pre-reftest-001-ref.html b/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/grouping-pre-reftest-001-ref.html
new file mode 100644
index 000000000..75aa91b30
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/grouping-pre-reftest-001-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>pre element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-pre-element">
+ <meta name="assert" content="Newlines within pre elements separate paragraphs for the purposes of BIDI." />
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test continues to validate the pre element.</p>
+
+ <p>The spec states:</p>
+ <blockquote>"A newline in a pre element should separate paragraphs for the purposes of the Unicode bidirectional algorithm. This requirement may be implemented indirectly through the style layer. For example, an HTML+CSS user agent could implement these requirements by implementing the CSS 'unicode-bidi' property."</blockquote>
+
+ <p>This reftest passes if below you see "ABC ABC" repeated on two separate lines below (4 ABCs total):</p>
+
+ <pre>ABC ABC
+ABC ABC</pre>
+
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/grouping-pre-reftest-001.html b/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/grouping-pre-reftest-001.html
new file mode 100644
index 000000000..29e582edd
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/grouping-pre-reftest-001.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>pre element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-pre-element">
+ <link rel="match" href="grouping-pre-reftest-001-ref.html" />
+ <meta name="assert" content="Newlines within pre elements separate paragraphs for the purposes of BIDI." />
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test continues to validate the pre element.</p>
+
+ <p>The spec states:</p>
+ <blockquote>"A newline in a pre element should separate paragraphs for the purposes of the Unicode bidirectional algorithm. This requirement may be implemented indirectly through the style layer. For example, an HTML+CSS user agent could implement these requirements by implementing the CSS 'unicode-bidi' property."</blockquote>
+
+ <p>This reftest passes if below you see "ABC ABC" repeated on two separate lines below (4 ABCs total):</p>
+
+ <pre>&#x202E CBA CBA
+ABC ABC</pre>
+
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/grouping-pre.html b/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/grouping-pre.html
new file mode 100644
index 000000000..07fc631b9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/grouping-pre.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>the pre element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-pre-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test validates the pre element.</p>
+
+ <div id="log"></div>
+
+ <script>
+ "use strict";
+
+ // check that prototype matches spec's DOM interface
+ test(function () {
+ var testElement = document.createElement("pre");
+ assert_equals(Object.getPrototypeOf(testElement), HTMLPreElement.prototype, "HTMLPreElement.prototype should be used for pre");
+ }, "The prototype for pre is HTMLPreElement.prototype");
+
+ </script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/pre-newline-bidi-ref.html b/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/pre-newline-bidi-ref.html
new file mode 100644
index 000000000..0f302b5d4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/pre-newline-bidi-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML Test reference: newline in &lt;pre&gt; separates bidi paragraphs</title>
+ <link rel="author" title="Amir E. Aharoni" href="mailto:amir.aharoni@mail.huji.ac.il"/>
+ <link rel="author" title="Eyal Sela" href="mailto:eyal@post.isoc.org.il"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-pre-element"/>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the rightmost character in the first line below is a full stop and to the left of it is a Hebrew letter.</p></div>
+ <div class="test">
+ <pre>
+A Hebrew letter and a full stop: &#x05d0;.&lrm;
+&#x05d0; this line begins with a Hebrew letter.
+ </pre>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/pre-newline-bidi.html b/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/pre-newline-bidi.html
new file mode 100644
index 000000000..23d442f52
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-pre-element/pre-newline-bidi.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: newline in pre separates bidi paragraphs</title>
+ <link rel="match" href="pre-newline-bidi-ref.html" />
+ <link rel="author" title="Amir E. Aharoni" href="mailto:amir.aharoni@mail.huji.ac.il"/>
+ <link rel="author" title="Eyal Sela" href="mailto:eyal@post.isoc.org.il"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-pre-element"/>
+ <meta name="assert"
+ content="A newline in a pre element should separate paragraphs for the purposes of the Unicode bidirectional algorithm."/>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the rightmost character in the first line below is a full stop and to the left of it is a Hebrew letter.</p></div>
+ <div class="test">
+ <pre>
+A Hebrew letter and a full stop: &#x05d0;.
+&#x05d0; this line begins with a Hebrew letter.
+ </pre>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ul-element/.gitkeep b/testing/web-platform/tests/html/semantics/grouping-content/the-ul-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ul-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/grouping-content/the-ul-element/grouping-ul.html b/testing/web-platform/tests/html/semantics/grouping-content/the-ul-element/grouping-ul.html
new file mode 100644
index 000000000..6e62343f6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/grouping-content/the-ul-element/grouping-ul.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>the ul element</title>
+ <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ul-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ "use strict";
+
+ // check that prototype matches spec's DOM interface
+ test(function () {
+ var testElement = document.createElement("ul");
+ assert_equals(Object.getPrototypeOf(testElement), HTMLUListElement.prototype, "HTMLUListElement.prototype should be used for ul");
+ }, "The prototype for ul is HTMLUListElement.prototype");
+
+ </script>
+</head>
+<body>
+ <h1>Description</h1>
+ <p>This test validates the ul element.</p>
+
+ <div id="log"></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/.gitkeep b/testing/web-platform/tests/html/semantics/interactive-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/commands/.gitkeep b/testing/web-platform/tests/html/semantics/interactive-elements/commands/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/commands/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/commands/contains.json b/testing/web-platform/tests/html/semantics/interactive-elements/commands/contains.json
new file mode 100644
index 000000000..b2ca2e771
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/commands/contains.json
@@ -0,0 +1,38 @@
+[
+ {
+ "id": "using-the-a-element-to-define-a-command",
+ "original_id": "using-the-a-element-to-define-a-command"
+ },
+ {
+ "id": "using-the-button-element-to-define-a-command",
+ "original_id": "using-the-button-element-to-define-a-command"
+ },
+ {
+ "id": "using-the-input-element-to-define-a-command",
+ "original_id": "using-the-input-element-to-define-a-command"
+ },
+ {
+ "id": "using-the-option-element-to-define-a-command",
+ "original_id": "using-the-option-element-to-define-a-command"
+ },
+ {
+ "id": "using-the-command-element-to-define-a-command",
+ "original_id": "using-the-command-element-to-define-a-command"
+ },
+ {
+ "id": "using-the-command-attribute-on-command-elements-to-define-a-command-indirectly",
+ "original_id": "using-the-command-attribute-on-command-elements-to-define-a-command-indirectly"
+ },
+ {
+ "id": "using-the-accesskey-attribute-on-a-label-element-to-define-a-command",
+ "original_id": "using-the-accesskey-attribute-on-a-label-element-to-define-a-command"
+ },
+ {
+ "id": "using-the-accesskey-attribute-on-a-legend-element-to-define-a-command",
+ "original_id": "using-the-accesskey-attribute-on-a-legend-element-to-define-a-command"
+ },
+ {
+ "id": "using-the-accesskey-attribute-to-define-a-command-on-other-elements",
+ "original_id": "using-the-accesskey-attribute-to-define-a-command-on-other-elements"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-command-element/.gitkeep b/testing/web-platform/tests/html/semantics/interactive-elements/the-command-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-command-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/.gitkeep b/testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/details.html b/testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/details.html
new file mode 100644
index 000000000..5ed14c53a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/details.html
@@ -0,0 +1,47 @@
+<!doctype html>
+<html>
+ <head>
+ <title>HTML details element API</title>
+ <style>#one, #two { visibility: hidden; }</style>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+
+ <!-- Used in parsing tests -->
+ <div id='one'><details></details><details></details></div>
+ <div id='two'><p><details></details></div>
+
+ <script type="text/javascript">
+
+function makeDetails () {
+ return document.createElement('details');
+}
+
+
+// <details>
+test(function () {
+ var times = document.getElementById('one').getElementsByTagName('details');
+ assert_equals( times.length, 2 );
+}, 'HTML parsing should locate 2 details elements in this document');
+
+test(function () {
+ assert_equals( document.getElementById('two').getElementsByTagName('p')[0].innerHTML, '' );
+}, 'HTML parsing should close an unclosed <p> before <details>');
+
+test(function () {
+ assert_true( !!window.HTMLDetailsElement );
+}, 'HTMLDetailsElement should be exposed for prototyping');
+
+test(function () {
+ assert_true( makeDetails() instanceof window.HTMLDetailsElement);
+}, 'a dynamically created details element should be instanceof HTMLDetailsElement');
+
+test(function () {
+ assert_true( document.getElementById('one').getElementsByTagName('details')[0] instanceof window.HTMLDetailsElement);
+}, 'a details element from the parser should be instanceof HTMLDetailsElement');
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html b/testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html
new file mode 100644
index 000000000..da255a384
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html
@@ -0,0 +1,157 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>The details element</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#the-details-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<details id=details1>
+ <summary>Lorem ipsum</summary>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
+</details>
+<details id=details2 open>
+ <summary>Lorem ipsum</summary>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
+</details>
+<details id=details3 style="display:none;">
+ <summary>Lorem ipsum</summary>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
+</details>
+<details id=details4>
+</details>
+<details id=details6>
+ <summary>Lorem ipsum</summary>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
+</details>
+<details id=details7>
+ <summary>Lorem ipsum</summary>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
+</details>
+<details id=details8 open>
+ <summary>Lorem ipsum</summary>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
+</details>
+<details id=details9 open>
+ <summary>Lorem ipsum</summary>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
+</details>
+<details id=details10>
+ <summary>Lorem ipsum</summary>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
+</details>
+<script>
+ var t1 = async_test("Adding open to 'details' should fire a toggle event at the 'details' element"),
+ t2 = async_test("Removing open from 'details' should fire a toggle event at the 'details' element"),
+ t3 = async_test("Adding open to 'details' (display:none) should fire a toggle event at the 'details' element"),
+ t4 = async_test("Adding open from 'details' (no children) should fire a toggle event at the 'details' element"),
+ t6 = async_test("Calling open twice on 'details' fires only one toggle event"),
+ t7 = async_test("Calling setAttribute('open', '') to 'details' should fire a toggle event at the 'details' element"),
+ t8 = async_test("Calling removeAttribute('open') to 'details' should fire a toggle event at the 'details' element"),
+ t9 = async_test("Setting open=true to opened 'details' element should not fire a toggle event at the 'details' element"),
+ t10 = async_test("Setting open=false to closed 'details' element should not fire a toggle event at the 'details' element"),
+
+ details1 = document.getElementById('details1'),
+ details2 = document.getElementById('details2'),
+ details3 = document.getElementById('details3'),
+ details4 = document.getElementById('details4'),
+ details6 = document.getElementById('details6'),
+ details7 = document.getElementById('details7'),
+ details8 = document.getElementById('details8'),
+ details9 = document.getElementById('details9'),
+ details10 = document.getElementById('details10'),
+ loop=false;
+
+ function testEvent(evt) {
+ assert_true(evt.isTrusted, "event is trusted");
+ assert_false(evt.bubbles, "event doesn't bubble");
+ assert_false(evt.cancelable, "event is not cancelable");
+ assert_equals(Object.getPrototypeOf(evt), Event.prototype, "Prototype of toggle event is Event.prototype");
+ }
+
+ details1.ontoggle = t1.step_func_done(function(evt) {
+ assert_true(details1.open);
+ testEvent(evt)
+ });
+ details1.open = true; // opens details1
+
+ details2.ontoggle = t2.step_func_done(function(evt) {
+ assert_false(details2.open);
+ testEvent(evt);
+ });
+ details2.open = false; // closes details2
+
+ details3.ontoggle = t3.step_func_done(function(evt) {
+ assert_true(details3.open);
+ testEvent(evt);
+ });
+ details3.open = true; // opens details3
+
+ details4.ontoggle = t4.step_func_done(function(evt) {
+ assert_true(details4.open);
+ testEvent(evt);
+ });
+ details4.open = true; // opens details4
+
+ async_test(function(t) {
+ var details5 = document.createElement("details");
+ details5.ontoggle = t.step_func_done(function(evt) {
+ assert_true(details5.open);
+ testEvent(evt);
+ })
+ details5.open = true;
+ }, "Adding open to 'details' (not in the document) should fire a toggle event at the 'details' element");
+
+ details6.open = true;
+ details6.open = false;
+ details6.ontoggle = t6.step_func(function() {
+ if (loop) {
+ assert_unreached("toggle event fired twice");
+ } else {
+ loop = true;
+ }
+ });
+ setTimeout(t6.step_func(function() {
+ assert_true(loop);
+ t6.done();
+ }), 0);
+
+ details7.ontoggle = t7.step_func_done(function(evt) {
+ assert_true(details7.open);
+ testEvent(evt)
+ });
+ details7.setAttribute('open', ''); // opens details7
+
+ details8.ontoggle = t8.step_func_done(function(evt) {
+ assert_false(details8.open);
+ testEvent(evt)
+ });
+ details8.removeAttribute('open'); // closes details8
+
+ var toggleFiredOnDetails9 = false;
+ details9.ontoggle = t9.step_func_done(function(evt) {
+ if (toggleFiredOnDetails9) {
+ assert_unreached("toggle event fired twice on opened details element");
+ } else {
+ toggleFiredOnDetails9 = true;
+ }
+ });
+ // The toggle event should be fired once when declaring details9 with open
+ // attribute.
+ details9.open = true; // opens details9
+ setTimeout(t9.step_func(function() {
+ assert_true(details9.open);
+ assert_true(toggleFiredOnDetails9);
+ t9.done();
+ }), 0);
+
+ details10.ontoggle = t10.step_func_done(function(evt) {
+ assert_unreached("toggle event fired on closed details element");
+ });
+ details10.open = false; // closes details10
+ setTimeout(t10.step_func(function() {
+ assert_false(details10.open);
+ t10.done();
+ }), 0);
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/contains.json b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/contains.json
new file mode 100644
index 000000000..c865c8588
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/contains.json
@@ -0,0 +1,6 @@
+[
+ {
+ "id": "anchor-points",
+ "original_id": "anchor-points"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-close.html b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-close.html
new file mode 100644
index 000000000..9029612b2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-close.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>dialog element: close()</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#the-dialog-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<dialog id="d1">
+ <p>foobar</p>
+ <button>OK</button>
+</dialog>
+<dialog id="d2" open>
+ <p>foobar</p>
+ <button>OK</button>
+</dialog>
+<dialog id="d3" open>
+ <p>foobar</p>
+ <button>OK</button>
+</dialog>
+<dialog id="d4" open>
+ <p>foobar</p>
+ <button>OK</button>
+</dialog>
+<dialog id="d5" open>
+ <p>foobar</p>
+ <button>OK</button>
+</dialog>
+<script>
+ var d1 = document.getElementById('d1'),
+ d2 = document.getElementById('d2'),
+ d3 = document.getElementById('d3'),
+ d4 = document.getElementById('d4'),
+ d5 = document.getElementById('d5'),
+ t = async_test("close() fires a close event"),
+ was_queued = false;
+
+ test(function(){
+ d1.close("closedialog");
+ assert_equals(d1.returnValue, "");
+ }, "close() on a <dialog> that doesn't have an open attribute aborts the steps");
+
+ test(function(){
+ assert_true(d2.open);
+ assert_equals(d2.returnValue, "");
+ d2.close("closedialog");
+ assert_false(d2.hasAttribute("open"));
+ assert_equals(d2.returnValue, "closedialog");
+ }, "close() removes the open attribute and set the returnValue to the first argument");
+
+ test(function(){
+ assert_true(d3.open);
+ assert_equals(d3.returnValue, "");
+ d3.returnValue = "foobar";
+ d3.close();
+ assert_false(d3.hasAttribute("open"));
+ assert_equals(d3.returnValue, "foobar");
+ }, "close() without argument removes the open attribute and there's no returnValue");
+
+ d4.onclose = t.step_func_done(function(e) {
+ assert_true(was_queued, "close event should be queued");
+ assert_true(e.isTrusted, "close event is trusted");
+ assert_false(e.bubbles, "close event doesn't bubble");
+ assert_false(e.cancelable, "close event is not cancelable");
+ });
+
+ t.step(function() {
+ d4.close();
+ was_queued = true;
+ })
+
+ test(function(){
+ Object.defineProperty(HTMLDialogElement.prototype, 'returnValue', { set: function(v) { assert_unreached('JS-defined setter returnValue on the prototype was invoked'); }, configurable:true });
+ Object.defineProperty(d5, 'returnValue', { set: function(v) { assert_unreached('JS-defined setter returnValue on the instance was invoked'); }, configurable:true });
+ d5.close('foo');
+ }, "close() should set the returnValue IDL attribute but not the JS property");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html
new file mode 100644
index 000000000..4719f63b8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>dialog element: open</title>
+<link rel=help href="https://html.spec.whatwg.org/multipage/forms.html#dom-dialog-open">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<dialog id="d1">
+ <p>foobar</p>
+ <button>OK</button>
+</dialog>
+<dialog id="d2" open>
+ <p>foobar</p>
+ <button>OK</button>
+</dialog>
+<script>
+ var d1 = document.getElementById('d1');
+ var d2 = document.getElementById('d2');
+
+ test(function(){
+ assert_false(d1.open);
+ assert_true(d2.open);
+ }, "On getting, the IDL open attribute must return true if the content open attribute is set, and false if it is absent.");
+
+ test(function(){
+ d1.open = true;
+ assert_true(d1.hasAttribute("open"));
+ d2.open = false;
+ assert_false(d2.hasAttribute("open"));
+ }, "On setting, the content open attribute must be removed if the IDL open attribute is set to false, and must be present if the IDL open attribute is set to true.");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal.html b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal.html
new file mode 100644
index 000000000..6ca9189c0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal.html
@@ -0,0 +1,125 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>dialog element: showModal()</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#the-dialog-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<button id="b0">OK</button>
+<dialog id="d1">
+ <p>foobar</p>
+ <button id="b1">OK</button>
+</dialog>
+<dialog id="d2" open>
+ <p>foobar</p>
+ <button>OK</button>
+</dialog>
+<dialog id="d3">
+ <p>foobar</p>
+ <button id="b3">OK</button>
+</dialog>
+<dialog id="d4">
+ <p>foobar</p>
+ <button id="b4">OK</button>
+</dialog>
+<dialog id="d5">
+ <p>foobar</p>
+ <button id="b5">OK</button>
+</dialog>
+<dialog id="d6"></dialog>
+<dialog id="d7">
+ <input id="i71" value="foobar">
+ <input id="i72" value="foobar">
+ <button id="b7">OK</button>
+</dialog>
+<dialog id="d8">
+ <input id="i81" value="foobar">
+ <input id="i82" value="foobar" autofocus>
+ <button id="b8">OK</button>
+</dialog>
+<script>
+ var d1 = document.getElementById('d1'),
+ d2 = document.getElementById('d2'),
+ d3 = document.getElementById('d3'),
+ d4 = document.getElementById('d4'),
+ d5 = document.getElementById('d5'),
+ d6 = document.getElementById('d6'),
+ d7 = document.getElementById('d7'),
+ d8 = document.getElementById('d8'),
+ b0 = document.getElementById('b0'),
+ b1 = document.getElementById('b1'),
+ b3 = document.getElementById('b3'),
+ b4 = document.getElementById('b4'),
+ b5 = document.getElementById('b5');
+
+ test(function(){
+ assert_false(d1.open);
+ assert_false(b0.commandDisabled);
+ d1.showModal();
+ this.add_cleanup(function() { d1.close(); });
+ assert_true(d1.open);
+ assert_true(b0.commandDisabled);
+ assert_equals(document.activeElement, b1);
+ });
+
+ test(function(){
+ assert_throws("INVALID_STATE_ERR", function() {
+ d2.showModal();
+ this.add_cleanup(function() { d2.close(); });
+ });
+ }, "showModal() on a <dialog> that already has an open attribute throws an InvalidStateError exception");
+
+ test(function(){
+ var d = document.createElement("dialog");
+ assert_throws("INVALID_STATE_ERR", function() {
+ d.showModal();
+ this.add_cleanup(function() { d.close(); });
+ });
+ }, "showModal() on a <dialog> not in a Document throws an InvalidStateError exception");
+
+ test(function(){
+ assert_false(d3.open);
+ assert_false(b3.commandDisabled);
+ assert_false(d4.open);
+ assert_false(b4.commandDisabled);
+ assert_false(d5.open);
+ assert_false(b5.commandDisabled);
+ d3.showModal();
+ this.add_cleanup(function() { d3.close(); });
+ d4.showModal();
+ this.add_cleanup(function() { d4.close(); });
+ d5.showModal();
+ this.add_cleanup(function() { d5.close(); });
+ assert_true(d3.open);
+ assert_true(b3.commandDisabled);
+ assert_true(d4.open);
+ assert_true(b4.commandDisabled);
+ assert_true(d5.open);
+ assert_false(b5.commandDisabled);
+ }, "when opening multiple dialogs, only the newest one is non-inert");
+
+ test(function(){
+ assert_false(d6.open);
+ d6.showModal();
+ this.add_cleanup(function() { d6.close(); });
+ assert_true(d6.open);
+ assert_equals(document.activeElement, d6);
+ }, "opening dialog without focusable children");
+
+ test(function(){
+ assert_false(d7.open);
+ d7.showModal();
+ this.add_cleanup(function() { d7.close(); });
+ assert_true(d7.open);
+ assert_equals(document.activeElement, document.getElementById("i71"));
+ }, "opening dialog with multiple focusable children");
+
+ test(function(){
+ assert_false(d8.open);
+ d8.showModal();
+ this.add_cleanup(function() { d8.close(); });
+ assert_true(d8.open);
+ assert_equals(document.activeElement, document.getElementById("i82"));
+ }, "opening dialog with multiple focusable children, one having the autofocus attribute");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-menu-element/.gitkeep b/testing/web-platform/tests/html/semantics/interactive-elements/the-menu-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-menu-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-menu-element/contains.json b/testing/web-platform/tests/html/semantics/interactive-elements/the-menu-element/contains.json
new file mode 100644
index 000000000..20f2439f6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-menu-element/contains.json
@@ -0,0 +1,18 @@
+[
+ {
+ "id": "menus-intro",
+ "original_id": "menus-intro"
+ },
+ {
+ "id": "building-menus-and-toolbars",
+ "original_id": "building-menus-and-toolbars"
+ },
+ {
+ "id": "context-menus",
+ "original_id": "context-menus"
+ },
+ {
+ "id": "toolbars",
+ "original_id": "toolbars"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-summary-element/.gitkeep b/testing/web-platform/tests/html/semantics/interactive-elements/the-summary-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-summary-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/interfaces.html b/testing/web-platform/tests/html/semantics/interfaces.html
new file mode 100644
index 000000000..359101dd9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interfaces.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Test of interfaces</title>
+<link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/">
+<link rel="help" href="https://heycam.github.io/webidl/#host-objects">
+<link rel="help" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf#page=96">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src=interfaces.js></script>
+<div id="log"></div>
+<script>
+function do_test(local_name, iface, variant) {
+ test(function() {
+ var e;
+ var i = "HTML" + iface + "Element";
+ if (variant === "useNS") {
+ // Use createElementNS here to preserve the case of local_name.
+ e = document.createElementNS("http://www.w3.org/1999/xhtml", local_name);
+ } else {
+ e = document.createElement(local_name);
+ }
+ assert_class_string(e, i,
+ "Element " + local_name + " should have " + i +
+ " as its primary interface.");
+ assert_true(e instanceof window[i],
+ "Element " + local_name + " should implement " + i + ".");
+ assert_true(e instanceof HTMLElement,
+ "Element " + local_name + " should implement HTMLElement.");
+ assert_true(e instanceof Element,
+ "Element " + local_name + " should implement Element.");
+ assert_true(e instanceof Node,
+ "Element " + local_name + " should implement Node.");
+ }, "Interfaces for " + local_name);
+}
+
+elements.forEach(function(a) {
+ do_test(a[0], a[1], "useNS");
+
+ // Only run the createElement variant if the input is all-lowercase, because createElement
+ // case-folds to lowercase. Custom elements are required to use all-lowercase to implement
+ // HTMLElement, otherwise they use HTMLUnknownElement per spec. Example: "foo-BAR".
+ if (a[0] === a[0].toLowerCase()) {
+ do_test(a[0].toUpperCase(), a[1]);
+ }
+})
+</script>
diff --git a/testing/web-platform/tests/html/semantics/interfaces.js b/testing/web-platform/tests/html/semantics/interfaces.js
new file mode 100644
index 000000000..0280e278c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interfaces.js
@@ -0,0 +1,150 @@
+var elements = [
+ ["a", "Anchor"],
+ ["abbr", ""],
+ ["acronym", ""],
+ ["address", ""],
+ ["applet", "Applet"],
+ ["area", "Area"],
+ ["article", ""],
+ ["aside", ""],
+ ["audio", "Audio"],
+ ["b", ""],
+ ["base", "Base"],
+ ["basefont", ""],
+ ["bdi", ""],
+ ["bdo", ""],
+ ["bgsound", "Unknown"],
+ ["big", ""],
+ ["blink", "Unknown"],
+ ["blockquote", "Quote"],
+ ["body", "Body"],
+ ["br", "BR"],
+ ["button", "Button"],
+ ["canvas", "Canvas"],
+ ["caption", "TableCaption"],
+ ["center", ""],
+ ["cite", ""],
+ ["code", ""],
+ ["col", "TableCol"],
+ ["colgroup", "TableCol"],
+ ["command", "Unknown"],
+ ["data", "Data"],
+ ["datalist", "DataList"],
+ ["dd", ""],
+ ["del", "Mod"],
+ ["details", "Details"],
+ ["dfn", ""],
+ ["dialog", "Dialog"],
+ ["dir", "Directory"],
+ ["directory", "Unknown"],
+ ["div", "Div"],
+ ["dl", "DList"],
+ ["dt", ""],
+ ["em", ""],
+ ["embed", "Embed"],
+ ["fieldset", "FieldSet"],
+ ["figcaption", ""],
+ ["figure", ""],
+ ["font", "Font"],
+ ["foo-BAR", "Unknown"], // not a valid custom element name
+ ["foo-bar", ""], // valid custom element name
+ ["foo", "Unknown"],
+ ["footer", ""],
+ ["form", "Form"],
+ ["frame", "Frame"],
+ ["frameset", "FrameSet"],
+ ["h1", "Heading"],
+ ["h2", "Heading"],
+ ["h3", "Heading"],
+ ["h4", "Heading"],
+ ["h5", "Heading"],
+ ["h6", "Heading"],
+ ["head", "Head"],
+ ["header", ""],
+ ["hgroup", ""],
+ ["hr", "HR"],
+ ["html", "Html"],
+ ["i", ""],
+ ["iframe", "IFrame"],
+ ["image", "Unknown"],
+ ["img", "Image"],
+ ["input", "Input"],
+ ["ins", "Mod"],
+ ["isindex", "Unknown"],
+ ["kbd", ""],
+ ["keygen", "Keygen"],
+ ["label", "Label"],
+ ["legend", "Legend"],
+ ["li", "LI"],
+ ["link", "Link"],
+ ["listing", "Pre"],
+ ["main", ""],
+ ["map", "Map"],
+ ["mark", ""],
+ ["marquee", "Marquee"],
+ ["menu", "Menu"],
+ ["menuitem", "MenuItem"],
+ ["meta", "Meta"],
+ ["meter", "Meter"],
+ ["mod", "Unknown"],
+ ["multicol", "Unknown"],
+ ["nav", ""],
+ ["nextid", "Unknown"],
+ ["nobr", ""],
+ ["noembed", ""],
+ ["noframes", ""],
+ ["noscript", ""],
+ ["object", "Object"],
+ ["ol", "OList"],
+ ["optgroup", "OptGroup"],
+ ["option", "Option"],
+ ["output", "Output"],
+ ["p", "Paragraph"],
+ ["param", "Param"],
+ ["picture", "Picture"],
+ ["plaintext", ""],
+ ["pre", "Pre"],
+ ["progress", "Progress"],
+ ["q", "Quote"],
+ ["quasit", "Unknown"],
+ ["rb", ""],
+ ["rp", ""],
+ ["rt", ""],
+ ["rtc", ""],
+ ["ruby", ""],
+ ["s", ""],
+ ["samp", ""],
+ ["script", "Script"],
+ ["section", ""],
+ ["select", "Select"],
+ ["slot", "Slot"],
+ ["small", ""],
+ ["source", "Source"],
+ ["spacer", "Unknown"],
+ ["span", "Span"],
+ ["strike", ""],
+ ["strong", ""],
+ ["style", "Style"],
+ ["sub", ""],
+ ["summary", ""],
+ ["sup", ""],
+ ["table", "Table"],
+ ["tbody", "TableSection"],
+ ["td", "TableCell"],
+ ["textarea", "TextArea"],
+ ["tfoot", "TableSection"],
+ ["th", "TableCell"],
+ ["thead", "TableSection"],
+ ["time", "Time"],
+ ["title", "Title"],
+ ["tr", "TableRow"],
+ ["track", "Track"],
+ ["tt", ""],
+ ["u", ""],
+ ["ul", "UList"],
+ ["var", ""],
+ ["video", "Video"],
+ ["wbr", ""],
+ ["xmp", "Pre"],
+ ["\u00E5-bar", "Unknown"], // not a valid custom element name
+];
diff --git a/testing/web-platform/tests/html/semantics/links/.gitkeep b/testing/web-platform/tests/html/semantics/links/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/links/downloading-resources/.gitkeep b/testing/web-platform/tests/html/semantics/links/downloading-resources/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/downloading-resources/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/links/downloading-resources/contains.json b/testing/web-platform/tests/html/semantics/links/downloading-resources/contains.json
new file mode 100644
index 000000000..b67f855cf
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/downloading-resources/contains.json
@@ -0,0 +1,6 @@
+[
+ {
+ "id": "hyperlink-auditing",
+ "original_id": "hyperlink-auditing"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/links/following-hyperlinks/.gitkeep b/testing/web-platform/tests/html/semantics/links/following-hyperlinks/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/following-hyperlinks/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/links/introduction-3/.gitkeep b/testing/web-platform/tests/html/semantics/links/introduction-3/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/introduction-3/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/.gitkeep b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_attribute-getter-setter.html b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_attribute-getter-setter.html
new file mode 100644
index 000000000..2db3082e2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_attribute-getter-setter.html
@@ -0,0 +1,65 @@
+<!doctype html>
+<meta charset="utf-8">
+<html>
+<head>
+<title>HTMLAnchorElement getters and setters</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<a>anchor</a>
+<script>
+function test_gettersetter(property, oldresult, newval, newresult, oldurl, newurl) {
+ var a = document.querySelector('a');
+ a.href = oldurl;
+ var r1 = a[property];
+ assert_equals(r1, oldresult);
+ a[property] = newval;
+ var r2 = a[property];
+ assert_equals(r2, newresult);
+ var r3 = a.href;
+ assert_equals(r3, newurl);
+}
+
+//Elements for each test: [property, oldresult, newvalue, newresult, oldurl, newurl]
+// [0] [1] [2] [3] [4] [5]
+tests = [
+ ["hash", "#somehash", "someother", "#someother",
+ "http://google.com/index.html#somehash",
+ "http://google.com/index.html#someother"],
+ ["hash", "#somehash", "#someother", "#someother",
+ "http://google.com/index.html#somehash",
+ "http://google.com/index.html#someother"],
+ ["host", "google.com:1234", "github.com:4444", "github.com:4444",
+ "http://google.com:1234/somedir",
+ "http://github.com:4444/somedir"],
+ ["hostname", "google.com", "github.com", "github.com",
+ "http://google.com:1234/somedir",
+ "http://github.com:1234/somedir"],
+ ["href", "http://google.com:1234/somedir", "http://goo-gle.com:1234/other/x.html", "http://goo-gle.com:1234/other/x.html",
+ "http://google.com:1234/somedir",
+ "http://goo-gle.com:1234/other/x.html"],
+ ["password", "flabada", "blubb", "blubb",
+ "https://anonymous:flabada@developer.mozilla.org/en-US/docs/",
+ "https://anonymous:blubb@developer.mozilla.org/en-US/docs/"],
+ ["pathname", "/somedir/someotherdir/index.html", "/newpath/x.txt", "/newpath/x.txt",
+ "http://google.com:1234/somedir/someotherdir/index.html",
+ "http://google.com:1234/newpath/x.txt"],
+ ["port", "1234", "4444", "4444", "http://google.com:1234/somedir", "http://google.com:4444/somedir"],
+ ["protocol", "http:", "ftp:", "ftp:", "http://google.com/somedir", "ftp://google.com/somedir"],
+ ["protocol", "http:", "ftp", "ftp:", "http://google.com/somedir", "ftp://google.com/somedir"],
+ ["search", "?ho", "?hi", "?hi", "http://google.com/q.php?ho", "http://google.com/q.php?hi"],
+ ["search", "?ho", "hi", "?hi", "http://google.com/q.php?ho", "http://google.com/q.php?hi"],
+ ["search", "?ho", "?hi", "?hi", "http://google.com/?ho", "http://google.com/?hi"],
+ ["search", "?ho", "hi", "?hi", "http://google.com/?ho", "http://google.com/?hi"],
+ ["username", "anonymous", "wellknown", "wellknown",
+ "https://anonymous:pwd@developer.mozilla.org:1234/en-US/",
+ "https://wellknown:pwd@developer.mozilla.org:1234/en-US/"]
+];
+
+for (var i = 0; i < tests.length; i++) {
+ test(function() {
+ test_gettersetter(tests[i][0], tests[i][1], tests[i][2], tests[i][3], tests[i][4], tests[i][5])
+ }, "Getter and setter for attribute of anchor element(" + i + "):" + tests[i][0] );
+}
+</script>
+</head>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_getter.html b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_getter.html
new file mode 100644
index 000000000..759eada22
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_getter.html
@@ -0,0 +1,48 @@
+<!doctype html>
+<meta charset="utf-8">
+<html>
+<head>
+<title>HTMLAnchorElement getters test</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<a id=a1 href="http://google.com?hi">a1</a>
+<a id=a2 href="http://google.com#somehash">a2</a>
+<a id=a3 href="http://google.com:1234/somedir">a3</a>
+<a id=a4 href="http://google.com:1234/somedir">a4</a>
+<a id=a5 href="http://google.com:1234/somedir">a5</a>
+<a id=a6 href="https://anonymous:flabada@developer.mozilla.org/en-US/docs/">a6</a>
+<a id=a7 href="http://google.com:1234/somedir/someotherdir/index.html">a7</a>
+<a id=a8 href="http://google.com:1234/somedir">a8</a>
+<a id=a9 href="http://google.com/somedir">a9</a>
+<a id=a10 href="https://anonymous:pwd@developer.mozilla.org:1234/en-US/">a10</a>
+<script>
+function test_getter(property, result, id) {
+ var a = document.getElementById(id);
+ var r = a[property];
+ assert_equals(r, result);
+}
+
+//Elements for each test: [property, result, id]
+// [0] [1] [2]
+tests = [
+ ["search", "?hi", "a1"],
+ ["hash", "#somehash", "a2"],
+ ["host", "google.com:1234", "a3"],
+ ["hostname", "google.com", "a4"],
+ ["href", "http://google.com:1234/somedir", "a5"],
+ ["password", "flabada", "a6"],
+ ["pathname", "/somedir/someotherdir/index.html", "a7"],
+ ["port", "1234", "a8"],
+ ["protocol", "http:", "a9"],
+ ["username", "anonymous", "a10"]
+];
+
+for (var i = 0; i < tests.length; i++) {
+ test(function() {
+ test_getter(tests[i][0], tests[i][1], tests[i][2])
+ }, "Getter for attribute of anchor element(" + i + "):" + tests[i][0]);
+}
+</script>
+</head>
+</html>
+
diff --git a/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_noopener.html b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_noopener.html
new file mode 100644
index 000000000..3d22481d2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_noopener.html
@@ -0,0 +1,78 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test behavior of rel="noopener" links</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<iframe name="oursubframe"></iframe>
+<a href="support/noopener-target-2.html" rel="noopener" target="ourpopup"></a>
+<a href="support/noopener-target-2.html" rel="noopener" target="oursubframe"></a>
+<script>
+var tests = [];
+// First test the special targets
+function target1Loaded(win) {
+ // Find the relevant test
+ var test = tests.find((t) => t.openedWindow == win);
+ test.step(function() {
+ assert_equals(win.opener, window);
+ win.close();
+ test.done();
+ });
+}
+/**
+ * Test that <a rel="noopener"> targeted at one of _self, _parent, _top does the
+ * load in the appropriate existing browsing context instead of opening a new
+ * one. The test is run in a separate popup window we open and which we can
+ * navigate without causing the test harness going into conniptions.
+ */
+for (var target of ["self", "parent", "top"]) {
+ var t = async_test("Check that rel=noopener with target=_" + target + " does a normal load");
+ tests.push(t);
+ t.openedWindow = window.open("support/noopener-popup.html");
+ t.targetName = target;
+ t.openedWindow.onload = t.step_func(function() {
+ this.openedWindow.findLink(this.targetName).click();
+ });
+}
+
+/**
+ * And now check that a noopener load targeted at something other than one of
+ * the three special targets above in fact ignores existing things with the
+ * given name. We do this in two ways. First, by opening a window named
+ * "ourpopup" and then doing a load via <a rel="noopener" target="ourpopup"> and
+ * verifying that the load happens in a window with a null opener, etc, while
+ * the opener of the thing we opened is not modified. And second, by targeting
+ * <a rel="noopener"> at a name that an existing subframe has, and ensuring that
+ * this subframe is not navigated.
+ */
+var t1 = async_test("Check that targeting of rel=noopener with a given name ignores an existing window with that name");
+var w;
+t1.add_cleanup(function() { w.close(); });
+var channel = new BroadcastChannel("ourpopup");
+channel.onmessage = t1.step_func_done(function(e) {
+ var data = e.data;
+ assert_false(data.hasOpener);
+ assert_false(data.hasParent);
+ assert_equals(data.name, "ourpopup");
+ assert_equals(w.opener, window);
+ assert_equals(w.location.href, "about:blank");
+});
+t1.step(function() {
+ w = window.open("", "ourpopup");
+ assert_equals(w.opener, window);
+ document.querySelectorAll("a")[0].click();
+});
+
+var t2 = async_test("Check that targeting of rel=noopener with a given name ignores an existing subframe with that name");
+var channel = new BroadcastChannel("oursubframe");
+channel.onmessage = t2.step_func_done(function(e) {
+ var data = e.data;
+ assert_false(data.hasOpener);
+ assert_false(data.hasParent);
+ assert_equals(data.name, "oursubframe");
+ assert_equals(document.querySelector("iframe").contentWindow.location.href,
+ "about:blank");
+});
+t2.step(function() {
+ document.querySelectorAll("a")[1].click();
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-popup.html b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-popup.html
new file mode 100644
index 000000000..2057dbf0b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-popup.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<script>
+ function findLink(arg) {
+ var doc;
+ if (arg == "self") {
+ doc = document;
+ } else {
+ doc = frames[0].document;
+ }
+ return doc.getElementById(arg + "target");
+ }
+</script>
+<a rel="noopener" target="_self" id="selftarget"
+ href="noopener-target-1.html"></a>
+<iframe srcdoc='
+ <a rel="noopener" target="_parent" id="parenttarget"
+ href="noopener-target-1.html"></a>
+ <a rel="noopener" target="_top" id="toptarget"
+ href="noopener-target-1.html"></a>'></iframe>
diff --git a/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-target-1.html b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-target-1.html
new file mode 100644
index 000000000..0dbd14275
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-target-1.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<script>
+ opener.target1Loaded(this);
+</script>
diff --git a/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-target-2.html b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-target-2.html
new file mode 100644
index 000000000..dd2d71913
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-target-2.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<script>
+ var channel = new BroadcastChannel(this.name);
+ channel.postMessage({ hasOpener: opener !== null ,
+ hasParent: parent != this,
+ name: window.name });
+ window.close();
+</script>
diff --git a/testing/web-platform/tests/html/semantics/links/linktypes/.gitkeep b/testing/web-platform/tests/html/semantics/links/linktypes/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/linktypes/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/links/linktypes/alternate-css-ref.html b/testing/web-platform/tests/html/semantics/links/linktypes/alternate-css-ref.html
new file mode 100644
index 000000000..ec961eac1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/linktypes/alternate-css-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Reference of Alternate css</title>
+<link rel="stylesheet" href="preferred.css" title="preferred">
+<div>foobar</div>
diff --git a/testing/web-platform/tests/html/semantics/links/linktypes/alternate-css.html b/testing/web-platform/tests/html/semantics/links/linktypes/alternate-css.html
new file mode 100644
index 000000000..366d6c559
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/linktypes/alternate-css.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Alternate css</title>
+<link rel="match" href="alternate-css-ref.html">
+<link rel="stylesheet" href="preferred.css" title="preferred">
+<link rel="alternate stylesheet" href="alternate.css" title="alternate">
+<div>foobar</div>
diff --git a/testing/web-platform/tests/html/semantics/links/linktypes/alternate.css b/testing/web-platform/tests/html/semantics/links/linktypes/alternate.css
new file mode 100644
index 000000000..05920c613
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/linktypes/alternate.css
@@ -0,0 +1,3 @@
+div {
+ background-color: red;
+}
diff --git a/testing/web-platform/tests/html/semantics/links/linktypes/contains.json b/testing/web-platform/tests/html/semantics/links/linktypes/contains.json
new file mode 100644
index 000000000..55aa4f677
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/linktypes/contains.json
@@ -0,0 +1,68 @@
+[
+ {
+ "id": "rel-alternate",
+ "original_id": "rel-alternate"
+ },
+ {
+ "id": "link-type-author",
+ "original_id": "link-type-author"
+ },
+ {
+ "id": "link-type-bookmark",
+ "original_id": "link-type-bookmark"
+ },
+ {
+ "id": "link-type-help",
+ "original_id": "link-type-help"
+ },
+ {
+ "id": "rel-icon",
+ "original_id": "rel-icon"
+ },
+ {
+ "id": "link-type-license",
+ "original_id": "link-type-license"
+ },
+ {
+ "id": "link-type-nofollow",
+ "original_id": "link-type-nofollow"
+ },
+ {
+ "id": "link-type-noreferrer",
+ "original_id": "link-type-noreferrer"
+ },
+ {
+ "id": "link-type-prefetch",
+ "original_id": "link-type-prefetch"
+ },
+ {
+ "id": "link-type-search",
+ "original_id": "link-type-search"
+ },
+ {
+ "id": "link-type-stylesheet",
+ "original_id": "link-type-stylesheet"
+ },
+ {
+ "id": "link-type-tag",
+ "original_id": "link-type-tag"
+ },
+ {
+ "id": "sequential-link-types",
+ "original_id": "sequential-link-types",
+ "children": [
+ {
+ "id": "link-type-next",
+ "original_id": "link-type-next"
+ },
+ {
+ "id": "link-type-prev",
+ "original_id": "link-type-prev"
+ }
+ ]
+ },
+ {
+ "id": "other-link-types",
+ "original_id": "other-link-types"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/links/linktypes/original-id.json b/testing/web-platform/tests/html/semantics/links/linktypes/original-id.json
new file mode 100644
index 000000000..1e5f7b5ed
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/linktypes/original-id.json
@@ -0,0 +1 @@
+{"original_id":"linkTypes"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/links/linktypes/preferred.css b/testing/web-platform/tests/html/semantics/links/linktypes/preferred.css
new file mode 100644
index 000000000..54b95ac28
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/links/linktypes/preferred.css
@@ -0,0 +1,3 @@
+div {
+ border: 4px solid green;
+}
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/.gitkeep b/testing/web-platform/tests/html/semantics/scripting-1/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-noscript-element/.gitkeep b/testing/web-platform/tests/html/semantics/scripting-1/the-noscript-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-noscript-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/.gitkeep b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_001.htm b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_001.htm
new file mode 100644
index 000000000..370152683
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_001.htm
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Async property on a dynamically-created script is true by default</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta description="This test checks the Async property on a dynamically-created script element. By default it should be true." />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-async"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script type="text/javascript">
+ test(function() {assert_true(document.createElement("script").async)}, "Async property on a dynamically-created script is true by default");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_002.htm b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_002.htm
new file mode 100644
index 000000000..e1850ff6e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_002.htm
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Changes to the 'async' attribute are reflected in the async property</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta description="This test ensures changes to the 'async' attribute are reflected in the async property." />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-async"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script type="text/javascript">
+ test(function() {
+ var s = document.createElement("script");
+ s.async = false;
+ s.setAttribute('async', ''); /*Should change s.async to true*/
+ assert_true(s.async)
+ }, "Test 'async' attribute are reflected in the async property with setAttribute");
+
+ test(function() {
+ var s = document.createElement("script");
+ s.async = false;
+ s.setAttribute('async', ''); /*Should change s.async to true*/
+ s.removeAttribute('async'); /*Should change s.async to false*/
+ assert_false(s.async)
+ }, "Test 'async' attribute are reflected in the async property with removeAttribute");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_003.htm b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_003.htm
new file mode 100644
index 000000000..b9a854c6b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_003.htm
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>An async script does not block the parser while downloading</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta description="This test ensures an async script does not block the parser while downloading." />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-script-async"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script type="text/javascript">
+ var t = async_test("An async script does not block the parser while downloading");
+
+ function timeout()
+ {
+ t.step(function(){ assert_equals(document.getElementById("testresult").innerHTML, "21")});
+ t.done();
+ }
+
+ var timer = setTimeout(timeout, 4000);
+
+ function log(text)
+ {
+ var textNode = document.createTextNode(text);
+ document.getElementById("testresult").appendChild(textNode);
+ }
+ </script>
+
+ <span id="testresult"></span>
+
+ <script src="log.py?sec=3&id=1" async></script>
+ <script>
+ log('2');
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_004.htm b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_004.htm
new file mode 100644
index 000000000..7908b757a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_004.htm
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>An async script executes as soon as possible after a download is complete</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta description="This test ensures an async script executes as soon as possible after a download is complete." />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-script-async"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script type="text/javascript">
+ var t = async_test("async script executes as soon as possible after a download is complete");
+
+ function timeout()
+ {
+ t.step(function(){ assert_equals(document.getElementById("testresult").innerHTML, "21")});
+ t.done();
+ }
+
+ var timer = setTimeout(timeout, 4000);
+
+ function log(text)
+ {
+ var textNode = document.createTextNode(text);
+ document.getElementById("testresult").appendChild(textNode);
+ }
+ </script>
+
+ <span id="testresult"></span>
+
+ <script src="log.py?sec=3&id=1" async></script>
+ <script src="log.py?sec=1&id=2" async></script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_005.htm b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_005.htm
new file mode 100644
index 000000000..4519d7234
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_005.htm
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>A script element with both async and defer set should execute asynchronously</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta description="This test ensures a script element with both async and defer set should execute asynchronously." />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-script-async"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script type="text/javascript">
+ var t = async_test("A script element with both async and defer set should execute asynchronously");
+
+ function timeout()
+ {
+ t.step(function(){ assert_equals(document.getElementById("testresult").innerHTML, "2134")});
+ t.done();
+ }
+
+ var timer = setTimeout(timeout, 5000);
+
+ function log(text)
+ {
+ var textNode = document.createTextNode(text);
+ document.getElementById("testresult").appendChild(textNode);
+ }
+ </script>
+
+ <span id="testresult"></span>
+
+ <script type="text/javascript" src="log.py?sec=1&id=1" defer async></script>
+ <script type="text/javascript">log('2');</script>
+ <script type="text/javascript" src="log.py?sec=3&id=3"></script>
+ <script type="text/javascript">log('4');</script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_006.htm b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_006.htm
new file mode 100644
index 000000000..86eb99897
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_006.htm
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>A dynamically created external script executes asynchronously</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta description="This test ensures a dynamically created external script executes asynchronously." />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#force-async"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script type="text/javascript">
+ var t = async_test("dynamically created external script executes asynchronously");
+
+ function timeout()
+ {
+ t.step(function(){ assert_equals(document.getElementById("testresult").innerHTML, "321")});
+ t.done();
+ }
+
+ var timer = setTimeout(timeout, 4000);
+
+ function log(text)
+ {
+ var textNode = document.createTextNode(text);
+ document.getElementById("testresult").appendChild(textNode);
+ }
+ </script>
+
+ <span id="testresult"></span>
+ <script type="text/javascript">
+ var one = document.createElement("script");
+ one.src="log.py?sec=3&id=1";
+ document.head.appendChild(one);
+
+ var two = document.createElement("script");
+ two.src="log.py?sec=1&id=2";
+ document.head.appendChild(two);
+
+ log('3');
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_007.htm b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_007.htm
new file mode 100644
index 000000000..8df0fba37
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_007.htm
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Ordered async script execution when script.async == false</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta description="This test ensures Ordered async script execution when script.async == false" />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#script-processing-src-sync"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script type="text/javascript">
+ var t = async_test("Ordered async script execution when script.async == false");
+
+ function timeout()
+ {
+ t.step(function(){ assert_equals(document.getElementById("testresult").innerHTML, "312")});
+ t.done();
+ }
+
+ var timer = setTimeout(timeout, 8000);
+
+ function log(text)
+ {
+ var textNode = document.createTextNode(text);
+ document.getElementById("testresult").appendChild(textNode);
+ }
+ </script>
+
+ <span id="testresult"></span>
+ <script type="text/javascript">
+ var one = document.createElement("script");
+ one.src="log.py?sec=3&id=1";
+ one.async = false;
+ document.head.appendChild(one);
+
+ var two = document.createElement("script");
+ two.src="log.py?sec=1&id=2";
+ two.async = false;
+ document.head.appendChild(two);
+ </script>
+ <script type="text/javascript">
+ log('3');
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_008.htm b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_008.htm
new file mode 100644
index 000000000..73529cc31
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_008.htm
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Async script element execution delays the window's load event</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta description="This test ensures an async script element's execution delays the window's load event." />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#delay-the-load-event"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script type="text/javascript">
+ var t = async_test("Async script element execution delays the window's load event");
+
+ function timeout()
+ {
+ t.step(function(){ assert_equals(document.getElementById("testresult").innerHTML, "213")});
+ t.done();
+ }
+
+ var timer = setTimeout(timeout, 8000);
+
+ function log(text)
+ {
+ var textNode = document.createTextNode(text);
+ document.getElementById("testresult").appendChild(textNode);
+ }
+ </script>
+
+ <span id="testresult"></span>
+ <script type="text/javascript">
+ window.addEventListener("load", function() {
+ log("3");
+ timeout();
+ }, false);
+
+ var s1 = document.createElement("script");
+ s1.src = "log.py?sec=2&id=1";
+ document.head.appendChild(s1);
+ </script>
+ <script type="text/javascript">
+ log('2');
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_009.htm b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_009.htm
new file mode 100644
index 000000000..501edda06
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_009.htm
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Document.write() silently fails from an Async script</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta description="This test ensures Document.write() silently fails from an Async script." />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script type="text/javascript">
+ var t = async_test("Document.write() silently fails from an Async script");
+
+ var log = t.step_func(function() {
+ document.write("<span id='writtenText'/>");
+ assert_equals(null, document.getElementById('writtenText'));
+ t.done();
+ });
+ </script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script type="text/javascript" src="log.py?sec=1&id=1" async></script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_010.htm b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_010.htm
new file mode 100644
index 000000000..959a8aa27
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_010.htm
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Removing an async script before execution</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta description="This test ensures that an async script still executes if it is removed from a markup before the download is complete. The other two scripts that come after it in insertion order should execute as well." />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script type="text/javascript">
+ var t = async_test("Removing an async script before execution");
+
+ function timeout()
+ {
+ t.step(function(){ assert_equals(document.getElementById("testresult").innerHTML, "4123")});
+ t.done();
+ }
+
+ var timer = setTimeout(timeout, 8000);
+
+ function log(text)
+ {
+ var textNode = document.createTextNode(text);
+ document.getElementById("testresult").appendChild(textNode);
+ }
+ </script>
+ </head>
+ <body>
+ <div id=log></div>
+ <span id="testresult"></span>
+ <script type="text/javascript">
+ var s1 = document.createElement("script");
+ s1.src="log.py?sec=2&id=1";
+ s1.async = false;
+ document.body.appendChild(s1);
+
+ var s2 = document.createElement("script");
+ s2.src="log.py?sec=1&id=2";
+ s2.async = false;
+ document.body.appendChild(s2);
+
+ var s3 = document.createElement("script");
+ s3.id = "s3";
+ s3.src="log.py?sec=0&id=3";
+ s3.async = false;
+ document.body.appendChild(s3);
+
+ //Remove s1 (Should still execute)
+ document.body.removeChild(s1);
+ </script>
+ <script type="text/javascript">log('4');</script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_011.htm b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_011.htm
new file mode 100644
index 000000000..d80e463ce
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/async_011.htm
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>An empty parser-inserted script element should return async=true</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <meta description="An empty parser-inserted script element should return async=true." />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#prepare-a-script"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script></script>
+ <script type="text/javascript">
+ test(function() { assert_true(document.getElementsByTagName("script")[2].async)}, "An empty parser-inserted script element should return async=true");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/contains.json b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/contains.json
new file mode 100644
index 000000000..e31ce4003
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/contains.json
@@ -0,0 +1,18 @@
+[
+ {
+ "id": "scriptinglanguages",
+ "original_id": "scriptingLanguages"
+ },
+ {
+ "id": "restrictions-for-contents-of-script-elements",
+ "original_id": "restrictions-for-contents-of-script-elements"
+ },
+ {
+ "id": "inline-documentation-for-external-scripts",
+ "original_id": "inline-documentation-for-external-scripts"
+ },
+ {
+ "id": "scripttagxslt",
+ "original_id": "scriptTagXSLT"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/external-script-utf8.js b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/external-script-utf8.js
new file mode 100644
index 000000000..eb442c97b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/external-script-utf8.js
@@ -0,0 +1,5 @@
+(function() {
+ window.getSomeString = function() {
+ return "śćążź"; //<- these are five Polish letters, similar to scazz. It can be read correctly only with windows 1250 encoding.
+ };
+})();
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/external-script-windows1250.js b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/external-script-windows1250.js
new file mode 100644
index 000000000..50de6932b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/external-script-windows1250.js
@@ -0,0 +1,5 @@
+(function() {
+ window.getSomeString = function() {
+ return "湿"; //<- these are five Polish letters, similar to scazz. It can be read correctly only with windows 1250 encoding.
+ };
+})();
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/base.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/base.html
new file mode 100644
index 000000000..dc0fa9dab
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/base.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Script src with a base URL</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<base href=../beta/>
+<div id=log></div>
+<script>
+function do_test(path) {
+ test(function() {
+ assert_equals(path, "beta");
+ });
+}
+</script>
+<script src=test.js></script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/test.js b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/test.js
new file mode 100644
index 000000000..3cbbb12e2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/test.js
@@ -0,0 +1 @@
+do_test("alpha");
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/beta/test.js b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/beta/test.js
new file mode 100644
index 000000000..4ce0f5338
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/beta/test.js
@@ -0,0 +1 @@
+do_test("beta");
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-with-base.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-with-base.html
new file mode 100644
index 000000000..edc2c3d6f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-with-base.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Script src with an empty URL</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<base href=unreachable.js>
+<div id=log></div>
+<script>
+async_test(function(t) {
+ window.unreachable = this.unreached_func("Should not load unreachable.js");
+ var queued = false;
+ var script = document.createElement("script");
+ script.onerror = this.step_func_done(function(ev) {
+ assert_equals(ev.type, "error");
+ assert_false(ev.bubbles, "bubbles");
+ assert_false(ev.cancelable, "cancelable");
+ assert_true(ev.isTrusted, "isTrusted");
+ assert_equals(ev.target, script);
+ assert_true(ev instanceof Event, "instanceof Event");
+ assert_class_string(ev, "Event");
+ assert_true(queued, "event should not be dispatched synchronously");
+ });
+ script.setAttribute("src", "");
+ document.body.appendChild(script);
+ queued = true;
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/empty.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/empty.html
new file mode 100644
index 000000000..d127f1eb3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/empty.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Script src with an empty URL</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+// For a better error message in case the UA tries to load "" (which resolves
+// to this document).
+setup({
+ "allow_uncaught_exception": true,
+});
+async_test(function(t) {
+ window.onerror = this.unreached_func("Should not get an error reported to " +
+ "the window before the script");
+ var queued = false;
+ var script = document.createElement("script");
+ script.onerror = this.step_func_done(function(ev) {
+ assert_equals(ev.type, "error");
+ assert_false(ev.bubbles, "bubbles");
+ assert_false(ev.cancelable, "cancelable");
+ assert_true(ev.isTrusted, "isTrusted");
+ assert_equals(ev.target, script);
+ assert_true(ev instanceof Event, "instanceof Event");
+ assert_class_string(ev, "Event");
+ assert_true(queued, "event should not be dispatched synchronously");
+ });
+ script.setAttribute("src", "");
+ document.body.appendChild(script);
+ queued = true;
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/failure.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/failure.html
new file mode 100644
index 000000000..b49e51740
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/failure.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Script src with an invalid URL</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+async_test(function(t) {
+ var queued = false;
+ var script = document.createElement("script");
+ script.onerror = this.step_func_done(function(ev) {
+ assert_equals(ev.type, "error");
+ assert_false(ev.bubbles, "bubbles");
+ assert_false(ev.cancelable, "cancelable");
+ assert_true(ev.isTrusted, "isTrusted");
+ assert_equals(ev.target, script);
+ assert_true(ev instanceof Event, "instanceof Event");
+ assert_class_string(ev, "Event");
+ assert_true(queued, "event should not be dispatched synchronously");
+ });
+ script.setAttribute("src", "//[]");
+ document.body.appendChild(script);
+ queued = true;
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/unreachable.js b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/unreachable.js
new file mode 100644
index 000000000..ca7fdba71
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/fetch-src/unreachable.js
@@ -0,0 +1 @@
+unreachable();
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/historical.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/historical.html
new file mode 100644
index 000000000..1f1a91228
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/historical.html
@@ -0,0 +1,53 @@
+<!doctype html>
+<title>Historical script element features should not be supported</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+function t(property) {
+ test(function() {
+ assert_false(property in document.createElement('script'));
+ }, 'script.' + property + ' should not be supported');
+}
+// added in https://github.com/whatwg/html/commit/69f83cf2eacf4543860ccb7abab0ff5bb1e8b594
+// removed in https://github.com/whatwg/html/commit/1a0b5e8377d59462e05a5cffda4b8592324a2785
+t('onbeforescriptexecute');
+t('onafterscriptexecute');
+
+var t_onbeforescriptexecute_attr = async_test('onbeforescriptexecute content attribute should not be supported');
+var t_onafterscriptexecute_attr = async_test('onafterscriptexecute content attribute should not be supported');
+var t_beforescriptexecute_event = async_test(function() {
+ addEventListener('beforescriptexecute', this.step_func(function() {
+ assert_unreached();
+ }), true);
+}, 'beforescriptexecute event should not be supported');
+var t_afterscriptexecute_event = async_test(function() {
+ addEventListener('afterscriptexecute', this.step_func(function() {
+ assert_unreached();
+ }), true);
+}, 'afterscriptexecute event should not be supported');
+
+var a = false;
+
+onload = function() {
+ t_onbeforescriptexecute_attr.step(function() {
+ assert_true(a);
+ this.done();
+ });
+ t_onafterscriptexecute_attr.step(function() {
+ assert_true(a);
+ this.done();
+ });
+ t_beforescriptexecute_event.step(function() {
+ assert_true(a);
+ this.done();
+ });
+ t_afterscriptexecute_event.step(function() {
+ assert_true(a);
+ this.done();
+ });
+};
+</script>
+<script onbeforescriptexecute="t_onbeforescriptexecute_attr.step(function() { assert_unreached(); });"
+ onafterscriptexecute="t_onafterscriptexecute_attr.step(function() { assert_unreached(); });">
+a = true;
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/load-event.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/load-event.html
new file mode 100644
index 000000000..25c2ddf3e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/load-event.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
+<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
+
+<script>
+"use strict";
+
+async_test(function(t) {
+ window.scriptExecuting = function () {
+ setTimeout(t.step_func_done(() => {
+ assert_equals(window.onloadHappened, undefined);
+ }), 0);
+ };
+}, "load events should not be fired for inline scripts");
+</script>
+
+
+<script onload="window.onloadHappened = true;">
+"use strict";
+window.scriptExecuting();
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/log.py b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/log.py
new file mode 100644
index 000000000..6803bb3e4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/log.py
@@ -0,0 +1,13 @@
+import time
+
+def main(request, response):
+ response.headers.append("Content-Type", "text/javascript")
+ try:
+ script_id = int(request.GET.first("id"))
+ delay = int(request.GET.first("sec"))
+ except:
+ response.set_error(400, "Invalid parameter")
+
+ time.sleep(int(delay))
+
+ return "log('%s')" % script_id
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/resources/cross-origin.py b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/resources/cross-origin.py
new file mode 100644
index 000000000..f8e05d966
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/resources/cross-origin.py
@@ -0,0 +1,10 @@
+def main(request, response):
+ headers = [("Content-Type", "text/javascript")]
+ milk = request.cookies.first("milk", None)
+
+ if milk is None:
+ return headers, "var included = false;"
+ elif milk.value == "yes":
+ return headers, "var included = true;"
+
+ return headers, "var included = false;"
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-01.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-01.html
new file mode 100644
index 000000000..c5ac0d0a6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-01.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+<head>
+ <meta charset="utf-8">
+ <title>Script @type: unknown parameters</title>
+ <link rel="author" title="askalski" href="github.com/askalski">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#scriptingLanguages">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <div id="log"></div>
+
+ <!-- "Step1" tests -->
+ <!-- charset is set incorrectly via Content Type "text/javascript;charset=utf-8" in response
+ which has priority before a correct setting in "charset" attribute of script tag.
+ -->
+ <script type="text/javascript"
+ src="serve-with-content-type.py?fn=external-script-windows1250.js&ct=text/javascript%3Bcharset=utf-8" charset="windows-1250">
+ </script>
+ <script>
+ test(function() {
+ //these strings should not match, since the file charset is set incorrectly
+ assert_not_equals(window.getSomeString(), "śćążź");
+ });
+ </script>
+ <!-- charset is set correctly via Content Type "text/javascript;charset=utf-8" in response
+ which has priority before a incorrect setting in "charset" attribute of script tag.
+ -->
+
+ <script type="text/javascript"
+ src="serve-with-content-type.py?fn=external-script-windows1250.js&ct=text/javascript%3Bcharset=windows-1250" charset="utf-8">
+ </script>
+ <script>
+ //the charset is set correctly via Content Type "text/javascript;charset=windows-1250" in respones
+ test(function() {
+ assert_equals(window.getSomeString(), "śćążź");
+ });
+ </script>
+
+ <!-- end of step1 tests, now step2 tests -->
+ <!-- in this case, the response's Content Type does not bring charset information.
+ Second step takes block character encoding if available.-->
+ <script type="text/javascript"
+ src="serve-with-content-type.py?fn=external-script-windows1250.js&ct=text/javascript" charset="utf-8">
+ </script>
+ <script>
+ test(function() {
+ //these strings should not match, since the file charset is set incorrectly in "charset" tag of <script> above
+ assert_not_equals(window.getSomeString(), "śćążź");
+ });
+ </script>
+ <!-- charset is set correctly via Content Type "text/javascript;charset=utf-8" in response
+ which has priority before a incorrect setting in "charset" attribute of script tag.
+ -->
+
+ <script type="text/javascript"
+ src="serve-with-content-type.py?fn=external-script-windows1250.js&ct=text/javascript" charset="windows-1250">
+ </script>
+ <script>
+ //the charset is set correctly via content attribute in <script> above
+ test(function() {
+ assert_equals(window.getSomeString(), "śćążź");
+ });
+ </script>
+
+ <!-- end of step2 tests, now step3 tests -->
+ <!-- in this case, neither response's Content Type nor charset attribute bring correct charset information.
+ Third step takes this document's character encoding (declared correctly as UTF-8).-->
+ <script type="text/javascript"
+ src="serve-with-content-type.py?fn=external-script-windows1250.js&ct=text/javascript">
+ </script>
+ <script>
+ test(function() {
+ //these strings should not match, since the tested file is in windows-1250, and document is utf-8
+ assert_not_equals(window.getSomeString(), "śćążź");
+ });
+ </script>
+
+ <script type="text/javascript"
+ src="serve-with-content-type.py?fn=external-script-utf8.js&ct=text/javascript">
+ </script>
+ <script>
+ //these strings should match, both document and tested file are utf-8
+ test(function() {
+ assert_equals(window.getSomeString(), "śćążź");
+ });
+ </script>
+
+ <!-- the last portion of tests (step4) are in file script-charset-02.html
+
+</head>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-02.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-02.html
new file mode 100644
index 000000000..77a015bb7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-02.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<head>
+ <!-- TODO:
+ askalski: while this test pass, it does not test anything now.
+ It should test, whether with no document.charset set in any way, the
+ external scripts will get decoded using utf-8 as fallback character encoding.
+ It seems like utf-8 is also a fallback encoding to html (my guess), so
+ the part of the code I was attempting to test is never reached.
+ -->
+ <title>Script @type: unknown parameters</title>
+ <link rel="author" title="askalski" href="github.com/askalski">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#scriptingLanguages">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <div id="log"></div>
+
+ <!-- test of step4, which is taking utf-8 as fallback -->
+ <!-- in this case, neither response's Content Type nor charset attribute bring correct charset information.
+ Furthermore, document's encoding is not set.-->
+ <script type="text/javascript"
+ src="serve-with-content-type.py?fn=external-script-windows1250.js&ct=text/javascript">
+ </script>
+ <script>
+ test(function() {
+ //these strings should not match, since the tested file is in windows-1250, and fallback is defined as utf-8
+ assert_not_equals(window.getSomeString().length, 5);
+ });
+ </script>
+
+ <script type="text/javascript"
+ src="serve-with-content-type.py?fn=external-script-utf8.js&ct=text/javascript">
+ </script>
+ <script>
+ //these strings should match, since fallback utf-8 is the correct setting.
+ test(function() {
+ assert_equals(window.getSomeString().length, 5);
+ });
+ </script>
+
+</head>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-03.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-03.html
new file mode 100644
index 000000000..4ff4cc6b0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-03.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<head>
+<meta charset="utf-8">
+<title>Script changing @charset</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#scriptingLanguages">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+async_test(function() {
+ var s = document.createElement("script");
+ s.src = "external-script-windows1250.js";
+ s.charset = "windows-1250";
+ document.body.appendChild(s);
+ s.charset = "utf-8";
+ window.onload = this.step_func_done(function() {
+ assert_equals(window.getSomeString(), "\u015b\u0107\u0105\u017c\u017a");
+ });
+})
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-crossorigin-network.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-crossorigin-network.html
new file mode 100644
index 000000000..488dd4488
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-crossorigin-network.html
@@ -0,0 +1,49 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>HTMLScriptElement: crossorigin attribute network test</title>
+<link rel="author" title="KiChjang" href="mailto:kungfukeith11@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#cors-settings-attribute">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<body>
+ <script type="text/javascript">
+ var test1 = async_test(document.title + "1");
+ var test2 = async_test(document.title + "2");
+ var test3 = async_test(document.title + "3");
+
+ var script1 = document.createElement("script");
+ script1.src = "resources/cross-origin.py";
+ script1.crossOrigin = "use-credentials";
+ var script2 = document.createElement("script");
+ script2.src = "resources/cross-origin.py";
+ script2.crossOrigin = "gibberish";
+ var script3 = document.createElement("script");
+ script3.src = "resources/cross-origin.py";
+
+ document.cookie = "milk=yes";
+ document.body.appendChild(script1);
+ script1.onload = function() {
+ test1.step(function() {
+ assert_true(included, "credentials should be included in script request");
+ test1.done();
+ });
+ };
+
+ document.body.appendChild(script2);
+ script2.onload = function() {
+ test2.step(function() {
+ assert_true(included, "invalid values should default to include credentials due to response tainting");
+ test2.done();
+ });
+ };
+
+ document.body.appendChild(script3);
+ script3.onload = function() {
+ test3.step(function() {
+ assert_true(included, "missing value should default to include credentials");
+ test3.done();
+ });
+ };
+ </script>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-crossorigin.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-crossorigin.html
new file mode 100644
index 000000000..52857a08e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-crossorigin.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>HTMLScriptElement: crossOrigin IDL attribute</title>
+<link rel="author" title="KiChjang" href="mailto:kungfukeith11@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#cors-settings-attribute">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script id="script1"></script>
+<script id="script2" crossorigin=""></script>
+<script id="script3" crossorigin="foo"></script>
+<script id="script4" crossorigin="anonymous"></script>
+<script id="script5" crossorigin="use-credentials"></script>
+<script>
+test(function() {
+ var script1 = document.getElementById("script1");
+ var script2 = document.getElementById("script2");
+ var script3 = document.getElementById("script3");
+ var script4 = document.getElementById("script4");
+ var script5 = document.getElementById("script5");
+
+ assert_equals(script1.crossOrigin, null, "Missing value default should be null");
+ assert_equals(script2.crossOrigin, "anonymous", "Empty string should map to anonymous");
+ assert_equals(script3.crossOrigin, "anonymous", "Invalid value default should be anonymous");
+ assert_equals(script4.crossOrigin, "anonymous", "anonymous should be parsed correctly");
+ assert_equals(script5.crossOrigin, "use-credentials", "use-credentials should be parsed correctly");
+
+ script1.crossOrigin = "bar";
+ assert_equals(script1.crossOrigin, "anonymous", "Setting to invalid value would default to anonymous");
+
+ script2.crossOrigin = null;
+ assert_equals(script2.crossOrigin, null, "Resetting to null should work");
+
+ script4.crossOrigin = "use-credentials";
+ assert_equals(script4.crossOrigin, "use-credentials", "Switching from anonymous to use-credentials should work");
+
+ script5.crossOrigin = "anonymous";
+ assert_equals(script5.crossOrigin, "anonymous", "Switching from use-credentials to anonymous should work");
+}, document.title);
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-for-event-xhtml.xhtml b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-for-event-xhtml.xhtml
new file mode 100644
index 000000000..69c4ef1f8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-for-event-xhtml.xhtml
@@ -0,0 +1,22 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Scripts with for and event attributes</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <div id="log"></div>
+ <script>
+ var run = false;
+ </script>
+ <script for="window" event="bar">
+ // This script should not run, but should not cause a parse error either.
+ run = true;
+ </script>
+ <script>
+ test(function() {
+ assert_false(run, "Script was unexpectedly run.")
+ }, "Scripts with for and event attributes should not run.")
+ </script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-for-event.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-for-event.html
new file mode 100644
index 000000000..552ea7041
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-for-event.html
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<title>Scripts with for and event attributes</title>
+<link rel="author" title="Matheus Kerschbaum" href="mailto:matjk7@gmail.com">
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#prepare-a-script">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var expected = [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ true,
+ true,
+];
+var run = expected.map(function() { return false });
+</script>
+<script for="w&#x130;ndow" event="onload">
+run[0] = true;
+</script>
+<script for="window" event="onload x">
+run[1] = true;
+</script>
+<script for="window" event="onload(x">
+run[2] = true;
+</script>
+<script for="window" event="onload(x)">
+run[3] = true;
+</script>
+<script for="window" event="onclick">
+run[4] = true;
+</script>
+<script for="" event="onload">
+run[5] = true;
+</script>
+<script for="window" event="">
+run[6] = true;
+</script>
+<script for="" event="">
+run[7] = true;
+</script>
+<script for="&#xa0;window" event="onload">
+run[8] = true;
+</script>
+<script for="window&#xa0;" event="onload">
+run[9] = true;
+</script>
+<script for="window" event="&#xa0;onload">
+run[10] = true;
+</script>
+<script for="window" event="onload&#xa0;">
+run[11] = true;
+</script>
+<script for=" window " event=" onload ">
+run[12] = true;
+</script>
+<script for=" window " event=" onload() ">
+run[13] = true;
+</script>
+<script for="object" event="handler">
+run[14] = true;
+</script>
+<script event="handler">
+run[15] = true;
+</script>
+<script for="object">
+run[16] = true;
+</script>
+<script>
+test(function() {
+ for (var i = 0; i < run.length; ++i) {
+ test(function() {
+ var script = document.querySelectorAll("script[for], script[event]")[i];
+ assert_equals(run[i], expected[i],
+ "script for=" + format_value(script.getAttribute("for")) +
+ " event=" + format_value(script.getAttribute("event")));
+ }, "Script " + i);
+ }
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-language-type.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-language-type.html
new file mode 100644
index 000000000..b94834c83
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-language-type.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<title>Script: combinations of @type and @language</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#prepare-a-script">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var run = false;
+</script>
+<script type="" language="foo">
+run = true;
+</script>
+<script>
+test(function() {
+ assert_equals(run, true);
+}, "A script with empty type should run");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-languages-01.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-languages-01.html
new file mode 100644
index 000000000..f2f2724df
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-languages-01.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<title>Script @type: unknown parameters</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#scriptingLanguages">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<script type="text/javascript;charset=UTF-8">
+test(function() {
+ assert_unreached("'charset' should have prevented this script from executing.");
+})
+</script>
+<script type="text/javascript;x-test=abc">
+test(function() {
+ assert_unreached("'x-test' should have prevented this script from executing.");
+})
+</script>
+</div>
+<script>
+test(function() {
+ assert_true(true)
+})
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-languages-02.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-languages-02.html
new file mode 100644
index 000000000..69613e510
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-languages-02.html
@@ -0,0 +1,98 @@
+<!DOCTYPE html>
+<title>Script @type: JavaScript types</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#scriptingLanguages">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+function testAttribute(attr, val, shouldRun) {
+ test(function() {
+ assert_false(ran, "ran variable not reset");
+ var script = document.createElement("script");
+ script.setAttribute(attr, val);
+ script.textContent = "ran = true;"
+ document.body.appendChild(script);
+ assert_equals(ran, shouldRun);
+ }, "Script should" + (shouldRun ? "" : "n't") + " run with " + attr + "=" + format_value(val));
+ ran = false
+}
+function testType(type) {
+ testAttribute("type", type, true);
+}
+function testLanguage(lang) {
+ testAttribute("language", lang, true);
+}
+function testTypeIgnored(type) {
+ testAttribute("type", type, false);
+}
+function testLanguageIgnored(lang) {
+ testAttribute("language", lang, false);
+}
+var application = [
+ "ecmascript",
+ "javascript",
+ "x-ecmascript",
+ "x-javascript"
+];
+var text = [
+ "ecmascript",
+ "javascript",
+ "javascript1.0",
+ "javascript1.1",
+ "javascript1.2",
+ "javascript1.3",
+ "javascript1.4",
+ "javascript1.5",
+ "jscript",
+ "livescript",
+ "x-ecmascript",
+ "x-javascript"
+];
+var spaces = [" ", "\t", "\n", "\r", "\f"];
+
+var ran = false;
+
+// Type attribute
+
+testType("");
+testTypeIgnored(" ");
+
+application.map(function(t) { return "application/" + t; }).forEach(testType);
+application.map(function(t) { return ("application/" + t).toUpperCase(); }).forEach(testType);
+
+spaces.forEach(function(s) {
+ application.map(function(t) { return "application/" + t + s; }).forEach(testType);
+ application.map(function(t) { return s + "application/" + t; }).forEach(testType);
+})
+
+application.map(function(t) { return "application/" + t + "\0"; }).forEach(testTypeIgnored);
+application.map(function(t) { return "application/" + t + "\0foo"; }).forEach(testTypeIgnored);
+
+text.map(function(t) { return "text/" + t; }).forEach(testType);
+text.map(function(t) { return ("text/" + t).toUpperCase(); }).forEach(testType);
+
+spaces.forEach(function(s) {
+ text.map(function(t) { return "text/" + t + s; }).forEach(testType);
+ text.map(function(t) { return s + "text/" + t; }).forEach(testType);
+})
+
+text.map(function(t) { return "text/" + t + "\0"; }).forEach(testTypeIgnored);
+text.map(function(t) { return "text/" + t + "\0foo"; }).forEach(testTypeIgnored);
+
+// Language attribute
+
+testLanguage("");
+testLanguageIgnored(" ");
+
+text.forEach(testLanguage);
+text.map(function(t) { return t.toUpperCase(); }).forEach(testLanguage);
+
+text.map(function(t) { return t + " "; }).forEach(testLanguageIgnored);
+text.map(function(t) { return " " + t; }).forEach(testLanguageIgnored);
+text.map(function(t) { return t + "xyz"; }).forEach(testLanguageIgnored);
+text.map(function(t) { return "xyz" + t; }).forEach(testLanguageIgnored);
+
+text.map(function(t) { return t + "\0"; }).forEach(testLanguageIgnored);
+text.map(function(t) { return t + "\0foo"; }).forEach(testLanguageIgnored);
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-noembed-noframes-iframe.xhtml b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-noembed-noframes-iframe.xhtml
new file mode 100644
index 000000000..8dd9ceb9a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-noembed-noframes-iframe.xhtml
@@ -0,0 +1,36 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Script inside noembed, noframes and iframe</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+var run = [];
+</script>
+<div id="test">
+<noembed>
+<script>
+run.push("noembed");
+</script>
+</noembed>
+<noframes>
+<script>
+run.push("noframes");
+</script>
+</noframes>
+<iframe>
+<script>
+run.push("iframe");
+</script>
+</iframe>
+</div>
+<script>
+test(function() {
+ assert_array_equals(run, ["noembed", "noframes", "iframe"], "Haven't run.");
+});
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html
new file mode 100644
index 000000000..2f3ce2368
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html
new file mode 100644
index 000000000..704e8ed36
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js
new file mode 100644
index 000000000..ccdf14c0c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js
@@ -0,0 +1 @@
+script_executed();
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed-2.py b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed-2.py
new file mode 100644
index 000000000..53caed7c0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed-2.py
@@ -0,0 +1,4 @@
+def main(request, response):
+ headers = [("Content-Type", "text/javascript")]
+ body = "test2_token = \"script executed\";"
+ return 200, headers, body
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.html
new file mode 100644
index 000000000..44ad30b01
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<meta charset="utf-8">
+<title></title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>var test1_token = "script not executed";</script>
+<script src="script-not-found-not-executed.py"></script>
+<script>
+test(function(){
+ assert_equals(test1_token, "script not executed");
+}, "Script that 404");
+</script>
+<script>var test2_token = "script not executed";</script>
+<script src="script-not-found-not-executed-2.py"></script>
+<script>
+test(function(){
+ assert_equals(test2_token, "script executed");
+}, "Script that does not 404");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.py b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.py
new file mode 100644
index 000000000..7722bd3f2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.py
@@ -0,0 +1,4 @@
+def main(request, response):
+ headers = [("Content-Type", "text/javascript")]
+ body = "test1_token = \"script executed\";"
+ return 404, headers, body
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-1.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-1.html
new file mode 100644
index 000000000..0fe39b11a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-1.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test that the insertion point is defined in the error event of a parser-inserted script that actually started a fetch (but just had it fail).</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+ var t = async_test("");
+ var writeDone = t.step_func_done(function(text) {
+ assert_equals(text, "Some text");
+ });
+</script>
+<iframe src="support/script-onerror-insertion-point-1-helper.html"></iframe>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-2.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-2.html
new file mode 100644
index 000000000..6d3f3ef09
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-2.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test that the insertion point is not defined in the error event of a
+ parser-inserted script that has an unparseable URL</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+ var t = async_test("");
+ var writeDone = t.step_func_done(function(text) {
+ assert_equals(text, "text");
+ });
+</script>
+<iframe src="support/script-onerror-insertion-point-2-helper.html"></iframe>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onload-insertion-point.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onload-insertion-point.html
new file mode 100644
index 000000000..ce3ddeee6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onload-insertion-point.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test that the insertion point is defined in the load event of a parser-inserted script.</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+ var t = async_test("");
+ var writeDone = t.step_func_done(function(text) {
+ assert_equals(text, "Some text");
+ });
+</script>
+<iframe src="support/script-onload-insertion-point-helper.html"></iframe>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onload-string.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onload-string.html
new file mode 100644
index 000000000..85f2d4dcf
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onload-string.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<title>Script: setting onload to a string</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ var s = document.createElement("script");
+ assert_equals(s.onload, null);
+ var dummy = function() {};
+ s.onload = dummy;
+ assert_equals(s.onload, dummy);
+ s.onload = "w('load DOM appended')";
+ assert_equals(s.onload, null);
+}, "Setting onload to a string should convert to null.");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-text-xhtml.xhtml b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-text-xhtml.xhtml
new file mode 100644
index 000000000..33a4635db
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-text-xhtml.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>HTMLScriptElement.text</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-text"/>
+<script src="/resources/testharness.js"/>
+<script src="/resources/testharnessreport.js"/>
+</head>
+<body>
+<div id="log"></div>
+<script>
+<x>7;</x>
+<![CDATA[
+ var x = "y";
+]]>
+</script>
+<script>
+var script;
+setup(function() {
+ script = document.body.getElementsByTagName("script")[0];
+})
+test(function() {
+ assert_equals(script.text, '\n\n\n var x = "y";\n\n')
+ assert_equals(script.textContent, '\n7;\n\n var x = "y";\n\n')
+}, "Getter with CDATA section")
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-text.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-text.html
new file mode 100644
index 000000000..6e8647224
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-text.html
@@ -0,0 +1,72 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLScriptElement.text</title>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-script-text">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var script;
+setup(function() {
+ script = document.createElement("script")
+ script.appendChild(document.createComment("COMMENT"))
+ script.appendChild(document.createTextNode(" TEXT "))
+ script.appendChild(document.createProcessingInstruction("P", "I"))
+ script.appendChild(document.createElement("a"))
+ .appendChild(document.createTextNode("ELEMENT"))
+})
+
+test(function() {
+ assert_equals(script.text, " TEXT ")
+ assert_equals(script.textContent, " TEXT ELEMENT")
+}, "Getter")
+
+test(function() {
+ script.text = " text "
+ assert_equals(script.text, " text ")
+ assert_equals(script.textContent, " text ")
+ assert_equals(script.firstChild.nodeType, Node.TEXT_NODE)
+ assert_equals(script.firstChild.data, " text ")
+ assert_equals(script.firstChild, script.lastChild)
+ assert_array_equals(script.childNodes, [script.firstChild])
+}, "Setter (non-empty string)")
+
+test(function() {
+ script.text = ""
+ assert_equals(script.text, "")
+ assert_equals(script.textContent, "")
+ assert_equals(script.firstChild, null)
+}, "Setter (empty string)")
+
+test(function() {
+ script.text = null
+ assert_equals(script.text, "null")
+ assert_equals(script.textContent, "null")
+ assert_equals(script.firstChild.nodeType, Node.TEXT_NODE)
+ assert_equals(script.firstChild.data, "null")
+ assert_equals(script.firstChild, script.lastChild)
+}, "Setter (null)")
+
+test(function() {
+ script.text = undefined
+ assert_equals(script.text, "undefined")
+ assert_equals(script.textContent, "undefined")
+ assert_equals(script.firstChild.nodeType, Node.TEXT_NODE)
+ assert_equals(script.firstChild.data, "undefined")
+ assert_equals(script.firstChild, script.lastChild)
+}, "Setter (undefined)")
+
+test(function() {
+ var s = document.createElement("script");
+ var text = document.createTextNode("one");
+ s.appendChild(text);
+
+ assert_equals(s.firstChild, text);
+ assert_equals(text.nodeValue, "one");
+
+ s.text = "two";
+ assert_not_equals(s.firstChild, text);
+ assert_equals(text.nodeValue, "one");
+ assert_equals(s.firstChild.nodeValue, "two");
+}, "Setter (text node reuse)")
+</script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/scripting-enabled.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/scripting-enabled.html
new file mode 100644
index 000000000..a2671a78f
--- /dev/null
+++ b/testing/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/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py
new file mode 100644
index 000000000..7cfe6f4ce
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py
@@ -0,0 +1,15 @@
+import os
+
+def main(request, response):
+ directory = os.path.dirname(__file__)
+
+ try:
+ file_name = request.GET.first("fn")
+ content_type = request.GET.first("ct")
+ with open(os.path.join(directory, file_name), "rb") as fh:
+ content = fh.read()
+
+ response.headers.set("Content-Type", content_type)
+ response.content = content
+ except:
+ response.set_error(400, "Not enough parameters or file not found")
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onerror-insertion-point-1-helper.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onerror-insertion-point-1-helper.html
new file mode 100644
index 000000000..d9b0c84ca
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onerror-insertion-point-1-helper.html
@@ -0,0 +1,2 @@
+Some <script src="nosuchscripthere.js"
+ onerror="document.write('text'); parent.writeDone(document.documentElement.textContent)"></script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onerror-insertion-point-2-helper.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onerror-insertion-point-2-helper.html
new file mode 100644
index 000000000..7a1739815
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onerror-insertion-point-2-helper.html
@@ -0,0 +1,2 @@
+Some <script src="http://this is not parseable"
+ onerror="document.write('text'); parent.writeDone(document.documentElement.textContent)"></script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onload-insertion-point-helper.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onload-insertion-point-helper.html
new file mode 100644
index 000000000..f0236b4fb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onload-insertion-point-helper.html
@@ -0,0 +1,2 @@
+Some <script src="script-onload-insertion-point-helper.js"
+ onload="document.write('xt'); parent.writeDone(document.documentElement.textContent)"></script>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onload-insertion-point-helper.js b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onload-insertion-point-helper.js
new file mode 100644
index 000000000..8a96a0b78
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/support/script-onload-insertion-point-helper.js
@@ -0,0 +1 @@
+document.write("te");
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document.html
new file mode 100644
index 000000000..8676319b2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document.html
@@ -0,0 +1,150 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Parsing XHTML: Node's node document</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="Parsing XHTML: Node's node document must be set to that of the element to which it will be appended">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#parsing-xhtml-documents">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+
+test(function() {
+ var doc = newXHTMLDocument();
+ doc.body = doc.createElement('body');
+ doc.body.innerHTML = '<template id="tmpl"></template>';
+
+ var template = doc.querySelector('#tmpl');
+
+ assert_not_equals(template, null, 'Template element should not be null');
+ assert_not_equals(template.content, undefined,
+ 'Content attribute of template element should not be undefined');
+ assert_not_equals(template.content, null,
+ 'Content attribute of template element should not be null');
+
+ assert_equals(template.ownerDocument, doc.body.ownerDocument,
+ 'Wrong template node owner document');
+ var ownerDoc = template.content.ownerDocument;
+ assert_not_equals(ownerDoc, doc, 'Wrong template content owner document');
+ assert_not_equals(ownerDoc, document, 'Wrong template content owner document');
+ assert_equals(ownerDoc.defaultView, null,
+ 'Template content owner document should not have a browsing context');
+
+}, 'Parsing XHTML: Node\'s node document must be set to that of the element '
+ + 'to which it will be appended. Test empty template');
+
+
+
+test(function() {
+ var doc = newXHTMLDocument();
+
+ doc.body = doc.createElement('body');
+ doc.body.innerHTML = '<template id="tmpl"><div>Div content</div></template>';
+
+ var template = doc.querySelector('#tmpl');
+
+ assert_equals(template.ownerDocument, doc.body.ownerDocument,
+ 'Wrong template node owner document');
+
+ assert_not_equals(template, null, 'Template element should not be null');
+ assert_not_equals(template.content, undefined,
+ 'Content attribute of template element should not be undefined');
+ assert_not_equals(template.content, null,
+ 'Content attribute of template element should not be null');
+
+ var div = template.content.querySelector('div');
+ assert_equals(template.content.ownerDocument, div.ownerDocument,
+ 'Wrong DIV node owner document');
+
+}, 'Parsing XHTML: Node\'s node document must be set to that of the element '
+ + 'to which it will be appended. Test not empty template');
+
+
+
+test(function() {
+ var doc = newXHTMLDocument();
+ doc.body = doc.createElement('body');
+ doc.body.innerHTML = ''
+ + '<template id="tmpl"><div>Div content</div> And some more text'
+ + '<template id="tmpl2"><div>Template content</div></template>'
+ + '</template>';
+
+ var template = doc.querySelector('#tmpl');
+ assert_not_equals(template, null, 'Template element should not be null');
+ assert_equals(template.ownerDocument, doc, 'Wrong template node owner document');
+ assert_not_equals(template.content, undefined,
+ 'Content attribute of template element should not be undefined');
+ assert_not_equals(template.content, null,
+ 'Content attribute of template element should not be null');
+
+ var nestedTemplate = template.content.querySelector('#tmpl2');
+ assert_not_equals(nestedTemplate, null, 'Nested template element should not be null');
+ assert_not_equals(nestedTemplate.content, undefined,
+ 'Content attribute of nested template element should not be undefined');
+ assert_not_equals(nestedTemplate.content, null,
+ 'Content attribute of nested template element should not be null');
+
+ assert_equals(nestedTemplate.ownerDocument, template.content.ownerDocument,
+ 'Wrong nested template node owner document');
+
+
+ var div = nestedTemplate.content.querySelector('div');
+ assert_equals(nestedTemplate.content.ownerDocument, div.ownerDocument,
+ 'Wrong DIV node owner document');
+
+}, 'Parsing XHTML: Node\'s node document must be set to that of the element '
+ + 'to which it will be appended. Test nested templates');
+
+
+
+testInIFrame('../resources/template-child-nodes-div.xhtml', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ assert_equals(template.ownerDocument, doc, 'Wrong template node owner document');
+
+ assert_not_equals(template.content, undefined,
+ 'Content attribute of template element should not be undefined');
+ assert_not_equals(template.content, null,
+ 'Content attribute of template element should not be null');
+
+ var div = template.content.querySelector('div');
+ assert_equals(template.content.ownerDocument, div.ownerDocument,
+ 'Wrong DIV node owner document');
+
+}, 'Parsing XHTML: Node\'s node document must be set to that of the element '
+ + 'to which it will be appended. Test loading XHTML document from a file');
+
+
+
+testInIFrame('../resources/template-child-nodes-nested.xhtml', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ assert_equals(template.ownerDocument, doc, 'Wrong template node owner document');
+
+ var nestedTemplate = template.content.querySelector('template');
+
+ assert_equals(nestedTemplate.ownerDocument, template.content.ownerDocument,
+ 'Wrong template node owner document');
+
+ var div = nestedTemplate.content.querySelector('div');
+ assert_equals(nestedTemplate.content.ownerDocument, div.ownerDocument,
+ 'Wrong DIV node owner document');
+
+}, 'Parsing XHTML: Node\'s node document must be set to that of the element '
+ + 'to which it will be appended. Test loading of XHTML document '
+ + 'with nested templates from a file');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/template-child-nodes.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/template-child-nodes.html
new file mode 100644
index 000000000..40abda568
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/template-child-nodes.html
@@ -0,0 +1,102 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Child nodes of template element in XHTML documents</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
+<meta name="assert" content="Child nodes of template element in XHTML documents are always appended to the template content (instead of template itself)">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#parsing-xhtml-documents">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function() {
+ var doc = newXHTMLDocument();
+
+ doc.body = doc.createElement('body');
+ doc.body.innerHTML = '<template id="tmpl1">'
+ + '<div id="div1">This is div inside template</div>'
+ + '<div id="div2">This is another div inside template</div>'
+ + '</template>';
+
+ var template = doc.querySelector('#tmpl1');
+
+ assert_equals(template.childNodes.length, 0,
+ 'Wrong number of template child nodes');
+ assert_equals(template.content.childNodes.length, 2,
+ 'Wrong number of template content child nodes');
+
+}, 'Child nodes of template element in XHTML documents must be appended to template content');
+
+
+
+test(function() {
+ var doc = newXHTMLDocument();
+ doc.body = doc.createElement('body');
+ doc.body.innerHTML = '<template id="tmpl1">'
+ + '<div id="div1">This is div inside template</div>'
+ + '<div id="div2">This is another div inside template</div>'
+ + '<template id="tmpl2">'
+ + '<div id="div3">This is div inside nested template</div>'
+ + '<div id="div4">This is another div inside nested template</div>'
+ + '</template>' + '</template>';
+
+ var template = doc.querySelector('#tmpl1');
+
+ assert_equals(template.childNodes.length, 0,
+ 'Wrong number of template child nodes');
+ assert_equals(template.content.childNodes.length, 3,
+ 'Wrong number of template content child nodes');
+
+ var nestedTemplate = template.content.querySelector('#tmpl2');
+
+ assert_equals(nestedTemplate.childNodes.length, 0,
+ 'Wrong number of template child nodes');
+ assert_equals(nestedTemplate.content.childNodes.length, 2,
+ 'Wrong number of nested template content child nodes');
+
+}, 'Child nodes of nested template element in XHTML documents must be appended to template content');
+
+
+
+testInIFrame('../resources/template-child-nodes-div.xhtml', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ assert_equals(template.childNodes.length, 0,
+ 'Wrong number of template child nodes');
+ assert_equals(template.content.querySelectorAll('div').length, 2,
+ 'Wrong number of template content child nodes');
+
+}, 'Child nodes of template element in XHTML documents must be appended to template content. '
+ + 'Test loading XHTML document from a file');
+
+
+testInIFrame('../resources/template-child-nodes-nested.xhtml', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ assert_equals(template.childNodes.length, 0,
+ 'Wrong number of template child nodes');
+
+ var nestedTemplate = template.content.querySelector('template');
+
+ assert_equals(nestedTemplate.childNodes.length, 0,
+ 'Wrong number of template child nodes');
+
+ assert_equals(nestedTemplate.content.querySelectorAll('div').length, 2,
+ 'Wrong number of template content child nodes');
+
+}, 'Child nodes of nested template element in XHTML documents must be appended to template content. '
+ + 'Test loading XHTML document from a file');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-serializing-xhtml-documents/outerhtml.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-serializing-xhtml-documents/outerhtml.html
new file mode 100644
index 000000000..416a3bc61
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-serializing-xhtml-documents/outerhtml.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: serialize template contents instead of template element</title>
+<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
+<meta name="assert" content="Template contents should be serialized instead of template element if serializing template element in XHTML document">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#serializing-xhtml-documents">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+test(function () {
+ var doc = newXHTMLDocument();
+ var template = doc.createElement('template');
+
+ var div = doc.createElement('div');
+ div.setAttribute('id', 'div1');
+ div.innerHTML = 'some text';
+ template.content.appendChild(div);
+
+ assert_equals(template.outerHTML, '<template xmlns="http://www.w3.org/1999/xhtml"><div id="div1">some text</div></template>',
+ 'template element is serialized incorrectly');
+
+}, 'Template contents should be serialized instead of template element if serializing template element');
+
+
+
+test(function () {
+ var doc = newXHTMLDocument();
+ var template = doc.createElement('template');
+ var nestedTemplate = doc.createElement('template');
+
+ template.content.appendChild(nestedTemplate);
+
+ var div = doc.createElement('div');
+ div.setAttribute('id', 'div1');
+ div.innerHTML = 'some text';
+ nestedTemplate.content.appendChild(div);
+
+ assert_equals(template.outerHTML, '<template xmlns="http://www.w3.org/1999/xhtml"><template><div id="div1">some text</div></template></template>',
+ 'template element is serialized incorrectly');
+
+
+}, 'Template contents should be serialized instead of template element if serializing template element. '
+ + 'Test nested template');
+
+
+test(function () {
+ var doc = newXHTMLDocument();
+ var template = doc.createElement('template');
+
+ var div = doc.createElement('div');
+ div.setAttribute('id', 'div1');
+ div.innerHTML = 'some text';
+ template.content.appendChild(div);
+ doc.body = doc.createElement('body');
+ doc.body.appendChild(template);
+
+ assert_equals(doc.documentElement.outerHTML, '<html xmlns="http://www.w3.org/1999/xhtml"><body><template><div id="div1">some text</div></template></body></html>',
+ 'template element is serialized incorrectly');
+
+}, 'Template contents should be serialized instead of template element if serializing template element. '
+ + 'Test serializing whole document');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001-ref.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001-ref.html
new file mode 100644
index 000000000..55c8b2e30
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<title>Template Reftest Reference</title>
+<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru"/>
+<body>
+ <p>Test passes if there's no anything below this line.</p>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001.html
new file mode 100644
index 000000000..fc310f47c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+ <title>Template Test: check that template content is invisible by default</title>
+ <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+ <link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#css-additions">
+ <meta name="assert" content="Test checks that the template contents are hidden implicitly">
+ <link rel="match" href="css-user-agent-style-sheet-test-001-ref.html">
+<body>
+ <p>Test passes if there's no anything below this line.</p>
+ <template>
+ <span style="color:red">Test fails if you can see this text</span>
+ </template>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-002.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-002.html
new file mode 100644
index 000000000..92f3d81ea
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-002.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+ <title>Template Test: check that template content is invisible by default</title>
+ <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+ <link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#css-additions">
+ <meta name="assert" content="The template element itself must be hidden by default">
+ <link rel="match" href="css-user-agent-style-sheet-test-001-ref.html">
+<body>
+ <p>Test passes if there's no anything below this line.</p>
+ <template style="border: 1px solid; width: 100px; height: 100px">
+ <span style="color:red">Test fails if you can see this text or border around it</span>
+ </template>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-003.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-003.html
new file mode 100644
index 000000000..4c477fde7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-003.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+ <title>HTML Templates: template content is invisible by default</title>
+ <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+ <link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#css-additions">
+ <meta name="assert" content="The template element itself must be hidden by default">
+ <link rel="match" href="css-user-agent-style-sheet-test-001-ref.html">
+ <style>
+ template {
+ border: 1px solid;
+ width: 100px;
+ height: 100px;
+ }
+ </style>
+<body>
+ <p>Test passes if there's no anything below this line.</p>
+ <template>
+ <span style="color:red">Test fails if you can see this text or border around it</span>
+ </template>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/template-clone-children.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/template-clone-children.html
new file mode 100644
index 000000000..c668d9095
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/template-clone-children.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Clone template node: All the children of template content are copied if 'copy children flag' set to true</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="Clone template node: all the children of template content are copied if 'copy children flag' set to true">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#node-clone-additions">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="tmpl1">' +
+ '<div id="div1">This is div inside template</div>' +
+ '<div id="div2">This is another div inside template</div>' +
+ '</template>';
+
+ var template = doc.querySelector('#tmpl1');
+ var copy = template.cloneNode(true);
+
+ assert_not_equals(copy.content, undefined, 'Template clone content attribute should not be undefined');
+ assert_not_equals(copy.content, null, 'Template clone content attribute should not be null');
+
+ assert_equals(copy.content.childNodes.length, 2,
+ 'Wrong number of template content\'s copy child nodes');
+ assert_not_equals(copy.content.querySelector('#div1'), null,
+ 'Template child node should be copied');
+ assert_not_equals(copy.content.querySelector('#div2'), null,
+ 'Template child node should be copied');
+
+}, 'Clone template node. Test call to cloneNode(true)');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="tmpl1">' +
+ '<div id="div1">This is div inside template</div>' +
+ '<div id="div2">This is another div inside template</div>' +
+ '</template>';
+
+ var template = doc.querySelector('#tmpl1');
+ var copy = template.cloneNode();
+
+ assert_not_equals(copy.content, undefined, 'Template clone content attribute should not be undefined');
+ assert_not_equals(copy.content, null, 'Template clone content attribute should not be null');
+
+ assert_equals(copy.content.childNodes.length, 0,
+ 'Wrong number of template content\'s copy child nodes');
+
+}, 'Clone template node. Test call to cloneNode() with the default parameter '
+ + '(false by default)');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="tmpl1">' +
+ '<div id="div1">This is div inside template</div>' +
+ '<div id="div2">This is another div inside template</div>' +
+ '</template>';
+
+ var template = doc.querySelector('#tmpl1');
+ var copy = template.cloneNode(false);
+
+ assert_not_equals(copy.content, undefined, 'Template clone content attribute is undefined');
+ assert_not_equals(copy.content, null, 'Template clone content attribute is null');
+
+ assert_equals(copy.content.childNodes.length, 0,
+ 'Wrong number of template content\'s copy child nodes');
+
+}, 'Clone template node. Test call to cloneNode(false)');
+
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/templates-copy-document-owner.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/templates-copy-document-owner.html
new file mode 100644
index 000000000..a2afc2304
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/templates-copy-document-owner.html
@@ -0,0 +1,126 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: ownerDocument of cloned template content is set to template content owner</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
+<meta name="assert" content="ownerDocument of cloned template content is set to template content owner">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#node-clone-additions">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+function checkOwnerDocument(node, doc) {
+ if ((node !== null) && (node !== undefined)) {
+ assert_equals(node.ownerDocument, doc,
+ 'Wrong ownerDocument of the template copy\'s node ' + node.nodeName);
+ for (var i = 0; i < node.childNodes.length; i++) {
+ if (node.childNodes[i].nodeType === Node.ELEMENT_NODE) {
+ checkOwnerDocument(node.childNodes[i], doc);
+ if (node.childNodes[i].nodeName === 'TEMPLATE') {
+ checkOwnerDocument(node.childNodes[i].content, doc);
+ }
+ }
+ }
+ }
+}
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="tmpl1">' +
+ '<div id="div1">This is div inside template</div>' +
+ '<div id="div2">This is another div inside template</div>' +
+ '</template>';
+
+ var template = doc.querySelector('#tmpl1');
+ var copy = template.cloneNode(true);
+
+ assert_equals(copy.content.childNodes.length, 2,
+ 'Wrong number of template content\'s copy child nodes');
+ checkOwnerDocument(copy.content, template.content.ownerDocument);
+
+}, 'ownerDocument of cloned template content is set to template content owner. '
+ + 'Test cloning with children');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="tmpl1">' +
+ '<div id="div1">This is div inside template</div>' +
+ '<div id="div2">This is another div inside template</div>' +
+ '</template>';
+
+ var template = doc.querySelector('#tmpl1');
+ var copy = template.cloneNode(false);
+
+ assert_equals(copy.content.childNodes.length, 0,
+ 'Wrong number of template content\'s copy child nodes');
+ checkOwnerDocument(copy.content, template.content.ownerDocument);
+
+}, 'ownerDocument of cloned template content is set to template content owner. '
+ + 'Test cloning without children');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="tmpl1">' +
+ '<div id="div1">This is div inside template</div>' +
+ '<div id="div2">This is another div inside template</div>' +
+ '</template>';
+
+ var template = doc.querySelector('#tmpl1');
+ var copy = template.cloneNode();
+
+ assert_equals(copy.content.childNodes.length, 0,
+ 'Wrong number of template content\'s copy child nodes');
+ checkOwnerDocument(copy.content, template.content.ownerDocument);
+
+}, 'ownerDocument of cloned template content is set to template content owner. '
+ + 'Test cloneNode() with no arguments (false by default)');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="tmpl1">' +
+ '<div id="div1">This is div inside template</div>' +
+ '<div id="div2">This is another div inside template</div>' +
+ '<template id="tmpl2">' +
+ '<div id="div3">This is div inside nested template</div>' +
+ '<div id="div4">This is another div inside nested template</div>' +
+ '</template>' +
+ '</template>';
+
+ var template = doc.querySelector('#tmpl1');
+ var copy = template.cloneNode(true);
+
+ assert_equals(copy.content.childNodes.length, 3,
+ 'Wrong number of template content\'s copy child nodes');
+ checkOwnerDocument(copy.content, template.content.ownerDocument);
+
+}, 'ownerDocument of cloned template content is set to template content owner. '
+ + 'Test cloning nested template');
+
+
+
+testInIFrame('../resources/template-contents.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.body.querySelector('template');
+ var copy = template.cloneNode(true);
+
+ checkOwnerDocument(copy.content, template.content.ownerDocument);
+
+}, 'ownerDocument of cloned template content is set to template content owner. '
+ + 'Test loading HTML document from file');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-document-type.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-document-type.html
new file mode 100644
index 000000000..d063acded
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-document-type.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: The template contents owner document type is HTML document</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="The template contents owner document type is HTML document, if template is declared in HTML document">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#definitions">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+testInIFrame('../resources/template-contents.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+ var template = doc.querySelector('template');
+ var content_owner = template.content.ownerDocument;
+
+ assert_class_string(content_owner, 'Document',
+ 'Template content owner should be a document');
+ assert_equals(content_owner.createElement('DIV').localName, 'div',
+ 'Template content owner should be an HTML document');
+
+}, 'The template contents owner document type is HTML document ' +
+ '(case when document has browsing context and the template ' +
+ 'is created by HTML parser)');
+
+
+testInIFrame('../resources/template-contents.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+ var template = doc.createElement('template');
+ var content_owner = template.content.ownerDocument;
+ var div = doc.createElement('DIV');
+ template.appendChild(div);
+
+ doc.body.appendChild(template);
+
+ assert_class_string(content_owner, 'Document',
+ 'Template content owner should be a document');
+ assert_equals(div.localName, 'div',
+ 'Template content owner should be an HTML document');
+
+}, 'The template contents owner document type is HTML document ' +
+ '(case when document has browsing context and the template ' +
+ 'is created by createElement())');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+ var content_owner = template.content.ownerDocument;
+ var div = doc.createElement('DIV');
+ template.appendChild(div);
+
+ doc.body.appendChild(template);
+
+ assert_class_string(content_owner, 'Document',
+ 'Template content owner should be a document');
+ assert_equals(div.localName, 'div',
+ 'Template content owner should be an HTML document');
+
+}, 'The template contents owner document type is HTML document ' +
+ '(case when document has no browsing context and the template is created ' +
+ 'by createElement())');
+
+test(function() {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template><div>Hello!</div></template>';
+ var template = doc.querySelector('template');
+ var content_owner = template.content.ownerDocument;
+
+ assert_class_string(content_owner, 'Document',
+ 'Template content owner should be a document');
+ assert_equals(content_owner.createElement('DIV').localName, 'div',
+ 'Template content owner should be an HTML document');
+
+}, 'The template contents owner document type is HTML document ' +
+ '(case when document has no browsing context and the template is created via innerHTML)');
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-001.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-001.html
new file mode 100644
index 000000000..a087f788e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-001.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: The template contents owner document (no browsing context)</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="Even if template's enclosing document has no browsing context, it gets its own template contents owner">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#definitions">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ doc.body.appendChild(template);
+
+ assert_not_equals(template.content.ownerDocument, doc, 'Wrong template content owner');
+
+}, 'Test the template contents owner document when enclosing document has '
+ + 'no browsing content. Template element is created by createElement()');
+
+
+
+test(function() {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '<template><div>some text</div></template>';
+
+ var template = doc.querySelector('template');
+
+ assert_not_equals(template.content.ownerDocument, doc, 'Wrong template content owner');
+
+}, 'Test the template contents owner document when enclosing document has '
+ + 'no browsing content. Template element is created by innerHTML');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-002.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-002.html
new file mode 100644
index 000000000..cf2e30b64
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-002.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: The template contents owner document (there's browsing context)</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="If template's enclosing document has browsing context, then templates content owner must be a new Document node without browsing context">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#definitions">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+testInIFrame(null, function(context) {
+ var doc = context.iframes[0].contentDocument;
+ var template = doc.createElement('template');
+
+ var div = doc.createElement('div');
+ div.setAttribute('id', 'div1');
+
+ template.appendChild(div);
+
+ doc.body.appendChild(template);
+
+ // doc has browsing context. There should be another document as a template
+ // content owner
+ assert_not_equals(template.content.ownerDocument, doc, 'Wrong template owner document');
+
+}, 'The template contents owner document must be different from template owner document,' +
+ ' which has browsing context. Template element is created by createElement()');
+
+
+
+testInIFrame(null, function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ doc.body.innerHTML = '<template><div>some text</div></template>';
+
+ var template = doc.querySelector('template');
+
+ // doc has browsing context. There should be another document as a template
+ // content owner
+ assert_not_equals(template.content.ownerDocument, doc, 'Wrong template owner document');
+
+}, 'The template contents owner document must be different from template owner document,' +
+ ' which has browsing context. Template element is created via innerHTML');
+
+
+
+testInIFrame('../resources/template-contents.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ // doc has browsing context. There should be another document as a template
+ // content owner
+ assert_not_equals(template.content.ownerDocument, doc, 'Wrong template owner document');
+
+}, 'The template contents owner document must be different from template owner document,' +
+ ' which has browsing context. Template element is created by HTML parser');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents.html
new file mode 100644
index 000000000..4a61dc8d3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/definitions/template-contents.html
@@ -0,0 +1,172 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: The template contents is a DocumentFragment</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="The template contents must be a DocumentFragment">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#definitions">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.nodeType, Node.DOCUMENT_FRAGMENT_NODE,
+ 'Template content should be a DocumentFragment');
+
+ assert_class_string(template.content, 'DocumentFragment',
+ 'Template content class should be a DocumentFragment');
+
+}, 'The template contents must be a DocumentFragment (empty template)');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<div>This is a div</div><span>This is a span</span>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.nodeType, Node.DOCUMENT_FRAGMENT_NODE,
+ 'Template content should be a DocumentFragment');
+
+ assert_class_string(template.content, 'DocumentFragment',
+ 'Template content class should be a DocumentFragment');
+
+}, 'The template contents must be a DocumentFragment (non empty template)');
+
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<div>This is a div</div>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.nodeType, Node.DOCUMENT_FRAGMENT_NODE,
+ 'Template content should be a documentFragment');
+
+}, 'The template contents must be a DocumentFragment (non empty template '
+ + 'containing div which is an Element instance)');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = 'Some text';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.nodeType, Node.DOCUMENT_FRAGMENT_NODE,
+ 'Template content should be a documentFragment');
+
+ assert_class_string(template.content, 'DocumentFragment',
+ 'Template content class should be a DocumentFragment');
+
+}, 'The template contents must be a DocumentFragment (not empty template '
+ + 'containing text node)');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<template id="t2">Some text</template>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.nodeType, Node.DOCUMENT_FRAGMENT_NODE,
+ 'Template content should be a documentFragment');
+ assert_class_string(template.content, 'DocumentFragment',
+ 'Template content class should be a DocumentFragment');
+
+ var nestedTemplate = template.content.querySelector("#t2");
+ assert_equals(nestedTemplate.content.nodeType, Node.DOCUMENT_FRAGMENT_NODE,
+ 'Nested template content should be a documentFragment');
+
+ assert_class_string(nestedTemplate.content, 'DocumentFragment',
+ 'Nested template content class should be a DocumentFragment');
+
+
+}, 'The template contents must be a DocumentFragment (nested template '
+ + 'containing a text node)');
+
+
+testInIFrame('../resources/template-contents-empty.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ assert_equals(template.content.nodeType, Node.DOCUMENT_FRAGMENT_NODE,
+ 'Template content should be a documentFragment');
+ assert_class_string(template.content, 'DocumentFragment',
+ 'Template content class should be a DocumentFragment');
+
+
+}, 'The template contents must be a DocumentFragment (the empty template tag '
+ + 'inside HTML file loaded in iframe)');
+
+
+testInIFrame('../resources/template-contents.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ assert_equals(template.content.nodeType, Node.DOCUMENT_FRAGMENT_NODE,
+ 'Template content should be a documentFragment');
+ assert_class_string(template.content, 'DocumentFragment',
+ 'Template content class should be a DocumentFragment');
+
+}, 'The template contents must be a DocumentFragment (non empty template '
+ + 'tag inside HTML file loaded in iframe)');
+
+
+testInIFrame('../resources/template-contents-text.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ assert_equals(template.content.nodeType, Node.DOCUMENT_FRAGMENT_NODE,
+ 'Template content should be a documentFragment');
+ assert_class_string(template.content, 'DocumentFragment',
+ 'Template content class should be a DocumentFragment');
+
+}, 'The template contents must be a DocumentFragment (the template tag '
+ + 'with some text inside HTML file loaded in iframe)');
+
+
+testInIFrame('../resources/template-contents-nested.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ assert_equals(template.content.nodeType, Node.DOCUMENT_FRAGMENT_NODE,
+ 'Template content should be a documentFragment');
+ assert_class_string(template.content, 'DocumentFragment',
+ 'Template content class should be a DocumentFragment');
+
+ var nestedTemplate = template.content.querySelector("template");
+
+ assert_equals(nestedTemplate.content.nodeType, Node.DOCUMENT_FRAGMENT_NODE,
+ 'Nested template content should be a documentFragment');
+ assert_class_string(nestedTemplate.content, 'DocumentFragment',
+ 'Nested template content class should be a DocumentFragment');
+
+}, 'The template contents must be a DocumentFragment (the template tag '
+ + 'with nested template tag inside HTML file loaded in iframe)');
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/innerhtml-on-templates/innerhtml.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/innerhtml-on-templates/innerhtml.html
new file mode 100644
index 000000000..0b7ad1e46
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/innerhtml-on-templates/innerhtml.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: innerHTML of template element replaces all referenced by the content attribute</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
+<meta name="assert" content="innerHTML of template element replaces all referenced by the content attribute">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#innerhtml-on-templates">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+test(function () {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ var div1 = doc.createElement('div');
+ div1.setAttribute('id', 'div1');
+ template.content.appendChild(div1);
+
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Element should present in template content');
+
+ template.innerHTML = '<div id="div2"></div>';
+
+ assert_equals(template.content.querySelector('#div1'), null,
+ 'Template content should be replaced by innerHTML');
+ assert_not_equals(template.content.querySelector('#div2'), null,
+ 'Element should present in template content');
+
+}, 'innerHTML of template element replaces all referenced by the content attribute');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+ var nestedTemplate = doc.createElement('template');
+
+ template.content.appendChild(nestedTemplate);
+
+ var div1 = doc.createElement('div');
+ div1.setAttribute('id', 'div1');
+ nestedTemplate.content.appendChild(div1);
+
+ assert_not_equals(nestedTemplate.content.querySelector('#div1'), null,
+ 'Element should present in template content');
+
+ nestedTemplate.innerHTML = '<div id="div2"></div>';
+
+ assert_equals(nestedTemplate.content.querySelector('#div1'), null,
+ 'Template content should be replaced by innerHTML');
+ assert_not_equals(nestedTemplate.content.querySelector('#div2'), null,
+ 'Element should present in template content');
+
+}, 'innerHTML of template element replaces all referenced by the content attribute. '
+ + 'Test nested template');
+
+
+testInIFrame('../resources/template-contents.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+ assert_not_equals(template.content.querySelector('div'), null,
+ 'Div element should present in template content');
+
+ template.innerHTML = '<span>span internals</span>';
+
+ assert_equals(template.content.querySelector('div'), null,
+ 'div element should be replaced by span in template content');
+
+ assert_not_equals(template.content.querySelector('span'), null,
+ 'span element should present in template content');
+
+
+}, 'innerHTML of template element replaces all referenced by the content attribute. '
+ + 'Test loading of HTML document from a file');
+
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/end-template-tag-in-body.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/end-template-tag-in-body.html
new file mode 100644
index 000000000..2cb149853
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/end-template-tag-in-body.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The file contains several &lt;/template&gt; tag in HTML body without start one</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+</head>
+<body>
+ </template>
+ <div>The file contains several &lt;/template&gt; tag in HTML body without start one</div>
+ </template></template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/end-template-tag-in-head.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/end-template-tag-in-head.html
new file mode 100644
index 000000000..02d0c7be6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/end-template-tag-in-head.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+ </template>
+ <title>The file contains several &lt;/template&gt; tag in HTML head without start one</title>
+ </template></template>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+ </template>
+</head>
+<body>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/frameset-end-tag.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/frameset-end-tag.html
new file mode 100644
index 000000000..b84d55595
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/frameset-end-tag.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The file contains frameset with the template and frameset end tag in it</title>
+ <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+</head>
+<frameset>
+ <template></frameset></template>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/head-template-contents-div-no-end-tag.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/head-template-contents-div-no-end-tag.html
new file mode 100644
index 000000000..e4e45bcea
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/head-template-contents-div-no-end-tag.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The file contains template element with open div tag, but without end div tag, in the head</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+ <template>
+ <div>Hello, template
+ </template>
+</head>
+<body>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/head-template-contents-table-no-end-tag.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/head-template-contents-table-no-end-tag.html
new file mode 100644
index 000000000..9db2b4af0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/head-template-contents-table-no-end-tag.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The file contains template element with open table, tr, td tags, but without end td, tr, table tags, in the head</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+ <template>
+ <table>
+ <tr>
+ <td>Hello, cell one!
+ </template>
+</head>
+<body>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/html-start-tag.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/html-start-tag.html
new file mode 100644
index 000000000..0de652cf3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/html-start-tag.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html tabindex="5">
+<head>
+ <title>The file contains html root element with attributes and some in the body</title>
+ <link rel="author" title="Sergey G. Grekhovv" href="mailto:sgrekhov@unipro.ru">
+</head>
+<body>
+<template id="tmpl"><html class="htmlClass"></html></template><html id="htmlId" tabindex="5">
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-child-nodes-div.xhtml b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-child-nodes-div.xhtml
new file mode 100644
index 000000000..14db5004d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-child-nodes-div.xhtml
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Template tag with children div tags inside</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru"/>
+</head>
+<body>
+ <p>Template tag with div tags inside</p>
+ <template>
+ <div>This is div inside template</div>
+ <div>This is another div inside template</div>
+ </template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-child-nodes-nested.xhtml b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-child-nodes-nested.xhtml
new file mode 100644
index 000000000..406fa6c3d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-child-nodes-nested.xhtml
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Template tag with children div tags inside another template tag</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru"/>
+</head>
+<body>
+ <p>Template tag with children div tags inside another template tag</p>
+ <template>
+ <template>
+ <div>This is div inside template</div>
+ <div>This is another div inside template</div>
+ </template>
+ </template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-attribute.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-attribute.html
new file mode 100644
index 000000000..b9dd5f47a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-attribute.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Empty template tag with attribute content</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<head>
+<body>
+ <template content='some text'></template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-body.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-body.html
new file mode 100644
index 000000000..a1f246fd6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-body.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>BODY tag inside template</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<head>
+<body>
+ <template><body></body></template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-div-no-end-tag.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-div-no-end-tag.html
new file mode 100644
index 000000000..304acf302
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-div-no-end-tag.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Div tag inside template tag</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+</head>
+<body>
+ <template>
+ <div>Hello, template
+ </template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-empty.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-empty.html
new file mode 100644
index 000000000..f1a539cc0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-empty.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Empty template tag</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<head>
+<body>
+ <template>
+ </template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-frameset.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-frameset.html
new file mode 100644
index 000000000..4331367df
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-frameset.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>FRAMESET tag inside template</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<head>
+<body>
+ <template><frameset></frameset></template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-head.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-head.html
new file mode 100644
index 000000000..1e3a337e8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-head.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>HEAD tag inside template</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<head>
+<body>
+ <template><head></head></template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-html.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-html.html
new file mode 100644
index 000000000..5dd3a28e6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-html.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>HTML tag inside template</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<head>
+<body>
+ <template><html></html></template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-nested.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-nested.html
new file mode 100644
index 000000000..dc2dc6f15
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-nested.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+ <title>Contains second template tag inside template tag</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<body>
+ <template>
+ <template>
+ <div>Inside nested template</div>
+ </template>
+ </template>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-table-no-end-tag.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-table-no-end-tag.html
new file mode 100644
index 000000000..4639b4dc8
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-table-no-end-tag.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The file contains template element with open table, tr, td tags, without end td, tr, table tags</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+</head>
+<body>
+ <template>
+ <table>
+ <tr>
+ <td>Hello, cell one!
+ </template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-text.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-text.html
new file mode 100644
index 000000000..a401848ef
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents-text.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Some text inside template tag</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+</head>
+<body>
+ <template>Some text</template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents.html
new file mode 100644
index 000000000..07256c06a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-contents.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Div tag inside template tag</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+</head>
+<body>
+ <template>
+ <div>Hello, template</div>
+ </template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-descendant-body.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-descendant-body.html
new file mode 100644
index 000000000..d64848c8d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-descendant-body.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Div tag inside template tag</title>
+ <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+</head>
+<body>
+ <template>
+ <div>Hello, template</div>
+ </template>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-descendant-frameset.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-descendant-frameset.html
new file mode 100644
index 000000000..480117845
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-descendant-frameset.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Template tag inside frameset</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+</head>
+<frameset>
+ <template>
+ <div>Hello, template</div>
+ </template>
+</frameset>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-descendant-head.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-descendant-head.html
new file mode 100644
index 000000000..6bab00ea9
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/template-descendant-head.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Template tag inside head</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+ <template>
+ <div>Hello, template</div>
+ </template>
+</head>
+<body>
+ Nothing interesting here
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/two-templates.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/two-templates.html
new file mode 100644
index 000000000..f6e9ab58e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/resources/two-templates.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The file contains two template elements</title>
+ <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+</head>
+<body>
+ <template id="template1">
+ <div>Hello, template</div>
+ </template>
+
+ <template id="template2">
+ <div>Hello, from second template</div>
+ </template>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/serializing-html-templates/outerhtml.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/serializing-html-templates/outerhtml.html
new file mode 100644
index 000000000..1539afbe1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/serializing-html-templates/outerhtml.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: serialize template contents instead of template element</title>
+<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
+<meta name="assert" content="template contents should be serialized instead of template element if serializing template element">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#serializing-html-templates">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+test(function () {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ var div = doc.createElement('div');
+ div.setAttribute('id', 'div1');
+ div.innerHTML = 'some text';
+ template.content.appendChild(div);
+
+ assert_equals(template.outerHTML, '<template><div id="div1">some text</div></template>',
+ 'template element is serialized incorrectly');
+
+}, 'Template contents should be serialized instead of template element if serializing template element');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+ var nestedTemplate = doc.createElement('template');
+
+ template.content.appendChild(nestedTemplate);
+
+ var div = doc.createElement('div');
+ div.setAttribute('id', 'div1');
+ div.innerHTML = 'some text';
+ nestedTemplate.content.appendChild(div);
+
+ assert_equals(template.outerHTML, '<template><template><div id="div1">some text</div></template></template>',
+ 'template element is serialized incorrectly');
+
+
+}, 'Template contents should be serialized instead of template element if serializing template element. '
+ + 'Test nested template');
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ var div = doc.createElement('div');
+ div.setAttribute('id', 'div1');
+ div.innerHTML = 'some text';
+ template.content.appendChild(div);
+ doc.body.appendChild(template);
+
+ assert_equals(doc.documentElement.outerHTML, '<html><head><title>Test Document</title></head><body><template><div id="div1">some text</div></template></body></html>',
+ 'template element is serialized incorrectly');
+
+}, 'Template contents should be serialized instead of template element if serializing template element. '
+ + 'Test serializing whole document');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/content-attribute.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/content-attribute.html
new file mode 100644
index 000000000..b4c11b841
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/content-attribute.html
@@ -0,0 +1,114 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Content attribute of template element is read-only</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="Content attribute of template element is read-only">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ assert_readonly(template, 'content',
+ 'Content attribute of template element should be read-only');
+
+}, 'Content attribute of template element is read-only. ' +
+ 'Test empty template');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+ var el1 = doc.createElement('div');
+ var el2 = doc.createElement('span');
+ el1.appendChild(el2);
+
+ template.content.appendChild(el1);
+
+ assert_readonly(template, 'content',
+ 'Content attribute of template element should be read-only');
+
+}, 'Content attribute of template element is read-only. ' +
+ 'Test not empty template populated by appendchild()');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template>Text<div>DIV</div></template>';
+
+ var template = doc.querySelector('template');
+
+ assert_readonly(template, 'content',
+ 'Content attribute of template element should be read-only');
+
+}, 'Content attribute of template element is read-only. ' +
+ 'Test not empty template populated by innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="template1" content="Some text as a content"></template>';
+
+ var template = doc.querySelector('#template1');
+
+ assert_readonly(template, 'content',
+ 'Content attribute of template element should be read-only');
+
+}, 'Content attribute of template element is read-only. ' +
+ 'Test that custom content attribute named \'content\' doesn\'t ' +
+ 'make content IDL attribute writable');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="template1" content="<div id=div1>Div content</div>"></template>';
+
+ var template = doc.querySelector('#template1');
+
+ assert_readonly(template, 'content',
+ 'Content attribute of template element should be read-only');
+
+ assert_equals(template.content.childNodes.length, 0,
+ 'Content attribute of template element should be read-only');
+
+}, 'Content attribute of template element is read-only. ' +
+ 'Test that custom content attribute named \'content\' doesn\'t ' +
+ 'affect content IDL attribute');
+
+
+testInIFrame('../resources/template-contents-attribute.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.body.querySelector('template');
+
+ assert_readonly(template, 'content',
+ 'Content attribute of template element should be read-only');
+
+}, 'Content attribute of template element is read-only. '
+ + 'Text value of content attribute of template tag should be ignored, '
+ + 'when loading document from a file');
+
+
+testInIFrame('../resources/template-contents.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.body.querySelector('template');
+
+ assert_readonly(template, 'content',
+ 'Content attribute of template element should be read-only');
+
+}, 'Content attribute of template element is read-only. '
+ + 'Test content attribute of a document loaded from a file');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/node-document-changes.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/node-document-changes.html
new file mode 100644
index 000000000..8027fbb91
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/node-document-changes.html
@@ -0,0 +1,199 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: When node's document changes its owner document should be changed</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="When a template element's node document changes, the template element's content DocumentFragment must be adopted into the new node document's template contents owner document">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function() {
+ var doc1 = newHTMLDocument();
+ var template = doc1.createElement('template');
+
+ assert_equals(template.ownerDocument, doc1, 'Wrong template node owner document');
+ assert_not_equals(template.content.ownerDocument, doc1,
+ 'Wrong template content owner document');
+
+ var doc2 = newHTMLDocument();
+ var template2 = doc2.createElement('template');
+ doc2.body.appendChild(template);
+
+ assert_equals(template.ownerDocument, template2.ownerDocument,
+ 'Template node owner document should be changed');
+ assert_equals(template.content.ownerDocument, template2.content.ownerDocument,
+ 'Template content owner document should be changed');
+
+}, 'Changing of template element\'s node document. ' +
+ 'Test that ownerDocument of an empty template and its content changes');
+
+
+test(function() {
+ var doc1 = newHTMLDocument();
+ doc1.body.innerHTML = '<template id="tmpl"><div>Div content</div> And some more text</template>';
+
+ var template = doc1.querySelector('#tmpl');
+
+ assert_equals(template.ownerDocument, doc1,
+ 'Wrong template node owner document');
+ assert_not_equals(template.content.ownerDocument, doc1,
+ 'Wrong template content owner document');
+
+ var doc2 = newHTMLDocument();
+ var template2 = doc2.createElement('template');
+ doc2.body.appendChild(template);
+
+ assert_equals(template.ownerDocument, template2.ownerDocument,
+ 'Template node owner document should be changed');
+ assert_equals(template.content.ownerDocument, template2.content.ownerDocument,
+ 'Template content owner document should be changed');
+
+ assert_equals(template.content.querySelector('div').ownerDocument,
+ template2.content.ownerDocument,
+ 'Template content descendants owner document should be changed');
+
+}, 'Changing of template element\'s node document. ' +
+ 'Test that ownerDocument of a not empty template and its content changes');
+
+
+test(function() {
+ var doc1 = newHTMLDocument();
+ doc1.body.innerHTML = ''
+ + '<template id="tmpl"><div>Div content</div> And some more text'
+ + '<template id="tmpl2"><div>Template content</div></template>'
+ + '</template>';
+
+ var template = doc1.querySelector('#tmpl');
+
+ assert_equals(template.ownerDocument, doc1, 'Wrong template node owner document');
+ assert_not_equals(template.content.ownerDocument, doc1,
+ 'Wrong template content owner document');
+
+ var nestedTemplate = template.content.querySelector('#tmpl2');
+
+ assert_equals(nestedTemplate.ownerDocument, template.content.ownerDocument,
+ 'Wrong nested template node owner document');
+ assert_equals(nestedTemplate.content.ownerDocument, template.content.ownerDocument,
+ 'Wrong nested template content owner document');
+
+ var doc2 = newHTMLDocument();
+ var template2 = doc2.createElement('template');
+ doc2.body.appendChild(template);
+
+ assert_equals(template.ownerDocument, template2.ownerDocument,
+ 'Template node owner document should be changed');
+ assert_equals(template.content.ownerDocument, template2.content.ownerDocument,
+ 'Template content owner document should be changed');
+ assert_equals(template.content.querySelector('div').ownerDocument,
+ template2.content.ownerDocument,
+ 'Template content descendants owner document should be changed');
+
+ assert_equals(nestedTemplate.ownerDocument,
+ template2.content.ownerDocument,
+ 'Nested template node owner document should be changed');
+ assert_equals(nestedTemplate.content.ownerDocument,
+ template2.content.ownerDocument,
+ 'Nested template content owner document should be changed');
+ assert_equals(nestedTemplate.content.querySelector('div').ownerDocument,
+ template2.content.ownerDocument,
+ 'Owner document of the nested template content descendants should be changed');
+
+}, 'Changing of template element\'s node document. ' +
+ 'Test that ownerDocument of nested template and its content changes');
+
+
+testInIFrame('../resources/template-contents.html', function(context) {
+ var doc1 = context.iframes[0].contentDocument;
+
+ var template = doc1.body.querySelector('template');
+
+ var doc2 = newHTMLDocument();
+ var template2 = doc2.createElement('template');
+ doc2.body.appendChild(template);
+
+ assert_equals(template.ownerDocument, template2.ownerDocument,
+ 'Template node owner document should be changed');
+ assert_equals(template.content.ownerDocument,
+ template2.content.ownerDocument,
+ 'Template content owner document should be changed');
+ assert_equals(template.content.querySelector('div').ownerDocument,
+ template2.content.ownerDocument,
+ 'Template content descendants owner document should be changed');
+
+}, 'Changing of template element\'s node document. ' +
+ 'Test document loaded from a file');
+
+
+testInIFrame('../resources/template-contents.html', function(context) {
+ var doc1 = context.iframes[0].contentDocument;
+
+ var doc2 = newHTMLDocument();
+ var template = doc2.createElement('template');
+ var div = doc2.createElement('div');
+ template.content.appendChild(div);
+
+ doc1.body.appendChild(template);
+
+ assert_not_equals(template.ownerDocument, doc2,
+ 'Template node owner document should be changed');
+ assert_not_equals(template.content.ownerDocument, doc2,
+ 'Template content owner document should be changed');
+ assert_not_equals(div.ownerDocument, doc2,
+ 'Template content descendants owner document should be changed');
+
+ assert_equals(template.ownerDocument, doc1,
+ 'Template node owner document should be changed');
+ // doc1 has browsing context so it cannot be template.content.ownerDocument
+ assert_not_equals(template.content.ownerDocument, doc1,
+ 'Template content owner document should be a new document');
+ assert_equals(div.ownerDocument, template.content.ownerDocument,
+ 'Template content descendants owner document should be ' +
+ 'template content document owner');
+
+}, 'Changing of template element\'s node document. ' +
+ 'Adobt template element into a document that has a browsing context');
+
+
+testInIFrame('../resources/template-contents.html', function(context) {
+ var doc1 = context.iframes[0].contentDocument;
+
+ var template = doc1.querySelector('template');
+ var div = template.content.querySelector('div');
+ var templateContentOwner = template.content.ownerDocument;
+
+ var doc2 = document;
+
+ doc2.body.appendChild(template);
+
+
+ assert_not_equals(template.ownerDocument, doc1,
+ 'Template node owner document should be changed');
+ assert_not_equals(template.content.ownerDocument, templateContentOwner,
+ 'Template content owner document should be changed');
+ assert_not_equals(div.ownerDocument, templateContentOwner,
+ 'Template content descendants owner document should be changed');
+
+ assert_equals(template.ownerDocument, doc2,
+ 'Template node owner document should be changed');
+ // doc2 has browsing context, so it cannot be template.content.ownerDocument
+ assert_not_equals(template.content.ownerDocument, doc2,
+ 'Template content owner document should be a new document');
+ assert_equals(div.ownerDocument, template.content.ownerDocument,
+ 'Template content descendants owner document should be ' +
+ 'template content document owner');
+
+}, 'Changing of template element\'s node document. ' +
+ 'Test the case when both old and new owner documents of template element ' +
+ 'have browsing context');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html
new file mode 100644
index 000000000..6a6482daa
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Template element as a descendant of the body element.</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="Template element can be a descendant of the body element">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+function templateIsAChild(element) {
+ element.innerHTML = '<template>some text</template>';
+
+ assert_not_equals(element.querySelector('template'), null,
+ 'Template element should be a descendant of the ' + element.tagName + ' element');
+}
+
+function templateIsDisallowedAsAChild(element) {
+ element.innerHTML = '<template>some text</template>';
+
+ assert_equals(element.querySelector('template'), null,
+ 'Template element should not be allowed as a descendant of the ' + element.tagName + ' element');
+}
+
+function templateIsAnIndirectChild(element) {
+ element.innerHTML = '<div><template>some text</template></div>';
+
+ assert_not_equals(element.querySelector('template'), null,
+ 'Template element should be a descendant of the ' + element.tagName + ' element');
+}
+
+function templateIsDisallowedAsAnIndirectChild(element) {
+ element.innerHTML = '<div><template>some text</template></div>';
+
+ assert_equals(element.querySelector('template'), null,
+ 'Template element should not be allowed as indirect descendant of the ' + element.tagName + ' element');
+}
+
+function templateIsAnAppendedChild(doc, element) {
+ var template = doc.createElement('template');
+
+ element.appendChild(template);
+
+ assert_not_equals(element.querySelector('template'), null,
+ 'Template element should be a descendant of the ' + element.tagName + ' element');
+}
+
+function templateIsAnAppendedIndirectChild(doc, element) {
+ var template = doc.createElement('template');
+ var div = doc.createElement('div');
+ div.appendChild(template);
+
+ element.appendChild(div);
+
+ assert_not_equals(element.querySelector('template'), null,
+ 'Template element should be a descendant of the ' + element.tagName + ' element');
+}
+
+var doc = newHTMLDocument();
+var frameset = doc.createElement('frameset');
+
+var parameters = [['Template element as a descendant of the BODY element. ' +
+ 'Template element is created by innerHTML',
+ doc.body],
+ ['Template element as a descendant of the HEAD element. ' +
+ 'Template element is created by innerHTML',
+ doc.head],
+ ];
+generate_tests(templateIsAChild, parameters,
+ 'Template element as a descendant of the HEAD and BODY elements');
+
+parameters = [['Template element as a descendant of the FRAMESET element. ' +
+ 'Template element is created by innerHTML',
+ frameset],
+ ];
+generate_tests(templateIsDisallowedAsAChild, parameters,
+ 'Template element should be disallowed as a descendant of the FRAMESET elements');
+
+
+parameters = [['Template element as an indirect descendant of the BODY element. ' +
+ 'Template element is created by innerHTML',
+ doc.body],
+ ['Template element as an indirect descendant of the HEAD element. ' +
+ 'Template element is created by innerHTML',
+ doc.head],
+ ];
+generate_tests(templateIsAnIndirectChild, parameters,
+ 'Template element as an indirect descendant of the HEAD, BODY and FRAMESET elements');
+
+parameters = [['Template element as a descendant of the FRAMESET element. ' +
+ 'Template element is created by innerHTML',
+ frameset],
+ ];
+generate_tests(templateIsDisallowedAsAnIndirectChild, parameters,
+ 'Template element should be disallowed as an indirect descendant of the FRAMESET elements');
+
+
+
+parameters = [['Template element as a descendant of the BODY element. ' +
+ 'Template element is appended by appendChild()',
+ doc, doc.body],
+ ['Template element as a descendant of the HEAD element. ' +
+ 'Template element is appended by appendChild()',
+ doc, doc.head],
+ ['Template element as a descendant of the FRAMESET element. ' +
+ 'Template element is appended by appendChild()',
+ doc, frameset]
+ ];
+generate_tests(templateIsAnAppendedChild, parameters,
+ 'Template element as a descendant of the HEAD, BODY and FRAMESET elements');
+
+
+
+parameters = [['Template element as an indirect descendant of the BODY element. ' +
+ 'Template element is appended by appendChild()',
+ doc, doc.body],
+ ['Template element as an indirect descendant of the HEAD element. ' +
+ 'Template element is appended by appendChild()',
+ doc, doc.head],
+ ['Template element as an indirect descendant of the FRAMESET element. ' +
+ 'Template element is appended by appendChild()',
+ doc, frameset]
+ ];
+generate_tests(templateIsAnAppendedIndirectChild, parameters,
+ 'Template element as a descendant of the HEAD, BODY and FRAMESET elements');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-content-node-document.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-content-node-document.html
new file mode 100644
index 000000000..da76c6b04
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-content-node-document.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Node document of the template content attribute must be template contents owner</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="Node document of the template content attribute must be template contents owner">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+ var nestedTemplate = doc.createElement('template');
+ template.appendChild(nestedTemplate);
+
+ assert_equals(nestedTemplate.content.ownerDocument, template.content.ownerDocument,
+ 'Wrong node document of the template content attribute');
+
+}, 'Node document of the template content attribute must be template contents owner. ' +
+ 'Nested template element created by createElement');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template><template></template></template>';
+ var template = doc.querySelector('template');
+ var nestedTemplate = template.content.querySelector('template');
+
+ assert_equals(nestedTemplate.content.ownerDocument, template.content.ownerDocument,
+ 'Wrong node document of the template content attribute');
+
+}, 'Node document of the template content attribute must be template contents owner. ' +
+ 'Nested template element created by innerHTML');
+
+testInIFrame('../resources/two-templates.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template1 = doc.querySelector('#template1');
+ var template2 = doc.querySelector('#template2');
+
+ // when there is a browsing context, template contents owner is only accessible via template.content.ownerDocument
+ // because template contents owner is bounded to document
+ // verify that multiple templates share the same instance of template contents owner
+
+ assert_equals(template1.content.ownerDocument, template2.content.ownerDocument,
+ 'Wrong node document of the template content attribute');
+}, 'Node document of the template content attribute must be template contents owner. ' +
+ 'Load HTML file with multiple template elements');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-content.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-content.html
new file mode 100644
index 000000000..8ed55d0d2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-content.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: HTML elements in template content</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
+<meta name="assert" content="Template may contain any element, except the html element, the head element, the body element, or the frameset element">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+var parameters = [];
+
+HTML5_ELEMENTS.forEach(function(value) {
+ if (value !== 'body' && value !== 'html' && value !== 'head' && value !== 'frameset') {
+
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+ var element = doc.createElement(value);
+ template.content.appendChild(element);
+ var valueToTest = template.content.querySelector(value);
+
+ doc.body.appendChild(template);
+
+ parameters.push([
+ 'Template may contain ' + value + ' element',
+ valueToTest,
+ null
+ ]);
+ }
+});
+
+generate_tests(assert_not_equals, parameters,
+ 'Template may contain any element, except the html element, '
+ + 'the head element, the body element, or the frameset element');
+
+
+
+
+var parameters = [];
+
+HTML5_ELEMENTS.forEach(function(value) {
+ if (value !== 'body' && value !== 'html' && value !== 'head' && value !== 'frameset') {
+
+ var doc = newHTMLDocument();
+
+ if (isVoidElement(value)) {
+ doc.body.innerHTML = '<template><' + value + '/></template>';
+ } else {
+ doc.body.innerHTML = '<template><' + value + '></' + value + '></template>';
+ }
+
+ var template = doc.querySelector('template');
+ var element = template.content.querySelector(value);
+
+ parameters.push([
+ 'Template may contain ' + value + ' element. '
+ +'The template element and contents are added via body.innerHTML',
+ element,
+ null
+ ]);
+ }
+});
+
+generate_tests(assert_not_equals, parameters,
+ 'Template may contain any element, except the html element, '
+ + 'the head element, the body element, or the frameset element. '
+ +'The template element and contents are added via body.innerHTML');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-body.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-body.html
new file mode 100644
index 000000000..70028c5ec
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-body.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Template element as a descendant of the body element.</title>
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="Template element can be a descendant of the body element">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+testInIFrame('../resources/template-contents.html', function(ctx) {
+ var doc = ctx.iframes[0].contentDocument;
+
+ assert_not_equals(doc.body.querySelector('template'), null,
+ 'Template element should be a descendant of the body element');
+
+}, 'Template element as a descendant of the body element. Test loading from a file');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-frameset.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-frameset.html
new file mode 100644
index 000000000..ce20a7413
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-frameset.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Template element as a descendant of the frameset element.</title>
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="Template element can not be a descendant of the frameset element">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#parsing-main-inframeset">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+testInIFrame('../resources/template-descendant-frameset.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var frameset = doc.querySelector('frameset');
+
+ assert_equals(frameset.querySelector('template'), null,
+ 'Template element should not be a descendant of the frameset element');
+
+}, 'Template element as a descendant of the frameset element. Test loading from a file');
+
+
+testInIFrame('../resources/template-descendant-frameset.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var frameset = doc.querySelector('frameset');
+
+ frameset.innerHTML = '';
+ assert_equals(doc.querySelector('template'), null,
+ 'Initial conditions are not satisfied');
+
+ frameset.innerHTML = '<template>some text</template>';
+
+ assert_equals(frameset.querySelector('template'), null,
+ 'Template element should not be a descendant of the frameset element');
+
+}, 'Template element as a descendant of the frameset element. '
+ + 'Test template element is assigned to frameset\'s innerHTML)');
+
+
+testInIFrame('../resources/template-descendant-frameset.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var frameset = doc.querySelector('frameset');
+
+ var template = doc.createElement('template');
+ frameset.appendChild(template);
+
+ assert_equals(frameset.querySelectorAll('template').length, 1,
+ 'Template element should be a descendant of the frameset element');
+
+}, 'Template element as a descendant of the frameset element. '
+ + 'Test template element appended to frameset by appendChild()');
+
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-head.html b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-head.html
new file mode 100644
index 000000000..611ec50bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-head.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Template element as a descendant of the head element.</title>
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="Template element can be a descendant of the head element">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+testInIFrame('../resources/template-descendant-head.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ assert_not_equals(doc.head.querySelector('template'), null,
+ 'Template element should be a descendant of the head element');
+
+}, 'Template element as a descendant of the head element. Test loading from a file');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/sections/.gitkeep b/testing/web-platform/tests/html/semantics/sections/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/sections/headings-and-sections/.gitkeep b/testing/web-platform/tests/html/semantics/sections/headings-and-sections/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/headings-and-sections/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/sections/headings-and-sections/contains.json b/testing/web-platform/tests/html/semantics/sections/headings-and-sections/contains.json
new file mode 100644
index 000000000..a9fecf65b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/headings-and-sections/contains.json
@@ -0,0 +1,6 @@
+[
+ {
+ "id": "outlines",
+ "original_id": "outlines"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/sections/the-address-element/.gitkeep b/testing/web-platform/tests/html/semantics/sections/the-address-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/the-address-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/sections/the-article-element/.gitkeep b/testing/web-platform/tests/html/semantics/sections/the-article-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/the-article-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/sections/the-aside-element/.gitkeep b/testing/web-platform/tests/html/semantics/sections/the-aside-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/the-aside-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/sections/the-body-element/.gitkeep b/testing/web-platform/tests/html/semantics/sections/the-body-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/the-body-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/sections/the-footer-element/.gitkeep b/testing/web-platform/tests/html/semantics/sections/the-footer-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/the-footer-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/sections/the-h1-h2-h3-h4-h5-and-h6-elements/.gitkeep b/testing/web-platform/tests/html/semantics/sections/the-h1-h2-h3-h4-h5-and-h6-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/the-h1-h2-h3-h4-h5-and-h6-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/sections/the-h1-h2-h3-h4-h5-and-h6-elements/original-id.json b/testing/web-platform/tests/html/semantics/sections/the-h1-h2-h3-h4-h5-and-h6-elements/original-id.json
new file mode 100644
index 000000000..748a548ca
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/the-h1-h2-h3-h4-h5-and-h6-elements/original-id.json
@@ -0,0 +1 @@
+{"original_id":"the-h1,-h2,-h3,-h4,-h5,-and-h6-elements"} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/sections/the-header-element/.gitkeep b/testing/web-platform/tests/html/semantics/sections/the-header-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/the-header-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/sections/the-hgroup-element/.gitkeep b/testing/web-platform/tests/html/semantics/sections/the-hgroup-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/the-hgroup-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/sections/the-nav-element/.gitkeep b/testing/web-platform/tests/html/semantics/sections/the-nav-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/the-nav-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/sections/the-section-element/.gitkeep b/testing/web-platform/tests/html/semantics/sections/the-section-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/the-section-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/sections/usage-summary-0/.gitkeep b/testing/web-platform/tests/html/semantics/sections/usage-summary-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/sections/usage-summary-0/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/selectors/.gitkeep b/testing/web-platform/tests/html/semantics/selectors/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/selectors/case-sensitivity/.gitkeep b/testing/web-platform/tests/html/semantics/selectors/case-sensitivity/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/case-sensitivity/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-001-manual.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-001-manual.html
new file mode 100644
index 000000000..76a963a60
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked-001-manual.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+ <head>
+ <title>CSS Selectors (:checked)</title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/selectors/checked/001.html"/>
+ <style type="text/css">
+ :checked, :checked + span { border: solid blue; color: blue; background: navy; }
+ </style>
+ </head>
+ <body>
+ <p>Anything that is checked below should be blue.</p>
+ <p><input checked type="checkbox"> <span>X</span></p>
+ <p><input checked type="radio" name="x"> <span>X</span> <input checked type="radio" name="x"> <span>X</span></p>
+ <p><select><option selected>X</option></select></p>
+ <p><select size="2"><option selected>X</option></select></p>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked.html
new file mode 100644
index 000000000..bf5981293
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/checked.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:checked)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="utils.js"></script>
+<div id="log"></div>
+<select id=select1>
+ <optgroup label="options" id=optgroup1>
+ <option value="option1" id=option1 selected>option1
+ <option value="option2" id=option2>option2
+ <option value="option2" id=option3 checked>option3
+</select>
+<input type=checkbox id=checkbox1 checked>
+<input type=checkbox id=checkbox2>
+<input type=checkbox id=checkbox3 selected>
+<input type=radio id=radio1 checked>
+<input type=radio id=radio2>
+<form>
+ <p><input type=submit contextmenu=formmenu id="submitbutton"></p>
+ <menu type=popup id=formmenu>
+ <menuitem type=checkbox checked default id=menuitem1>
+ <menuitem type=checkbox default id=menuitem2>
+ <menuitem type=checkbox id=menuitem3>
+ <menuitem type=radio checked id=menuitem4>
+ <menuitem type=radio id=menuitem5>
+ </menu>
+</form>
+
+<script>
+ testSelectorIdsMatch(":checked", ["option1", "checkbox1", "radio1", "menuitem1", "menuitem4"], "':checked' matches checked <input>/<menuitem> in checkbox and radio button states, selected <option>s");
+
+ document.getElementById("checkbox1").removeAttribute("type"); // change type of input
+ document.getElementById("radio1").removeAttribute("type"); // change type of input
+ testSelectorIdsMatch(":checked", ["option1", "menuitem1", "menuitem4"], "':checked' should no longer match <input>s whose type checkbox/radio has been removed");
+
+ document.getElementById("option2").selected = "selected"; // select option2
+ document.getElementById("checkbox2").click(); // check chekbox2
+ document.getElementById("radio2").click(); // check radio2
+ testSelectorIdsMatch(":checked", ["option2", "checkbox2", "radio2", "menuitem1", "menuitem4"], "':checked' matches clicked checkbox and radio buttons");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/default.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/default.html
new file mode 100644
index 000000000..3187801f6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/default.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:default)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="utils.js"></script>
+<div id="log"></div>
+<form>
+ <button id=button1 type=button>button1</button>
+ <button id=button2 type=submit>button2</button>
+</form>
+<form>
+ <button id=button3 type=reset>button3</button>
+ <button id=button4>button4</button>
+</form>
+<button id=button5 type=submit>button5</button>
+<form id=form1>
+ <input type=text id=input1>
+</form>
+<input type=text id=input2 form=form1>
+<form>
+ <input type=submit id=input3>
+ <input type=submit id=input4>
+</form>
+<form>
+ <input type=image id=input5>
+ <input type=image id=input6>
+</form>
+<form>
+ <input type=submit id=input7>
+</form>
+<input type=checkbox id=checkbox1 checked>
+<input type=checkbox id=checkbox2>
+<input type=checkbox id=checkbox3 default>
+<input type=radio name=radios id=radio1 checked>
+<input type=radio name=radios id=radio2>
+<input type=radio name=radios id=radio3 default>
+<select id=select1>
+ <optgroup label="options" id=optgroup1>
+ <option value="option1" id=option1>option1
+ <option value="option2" id=option2 selected>option2
+</select>
+<dialog id="dialog">
+ <input type=submit id=input8>
+</dialog>
+<form>
+ <button id=button6 type='invalid'>button6</button>
+ <button id=button7>button7</button>
+</form>
+<form>
+ <button id=button8>button8</button>
+ <button id=button9>button9</button>
+</form>
+
+
+<script>
+ testSelectorIdsMatch(":default", ["button2", "button4", "input3", "input5", "input7", "checkbox1", "radio1", "option2", "button6", "button8"], "':default' matches <button>s that are their form's default button, <input>s of type submit/image that are their form's default button, checked <input>s and selected <option>s");
+
+ document.getElementById("button1").type = "submit"; // change the form's default button
+ testSelectorIdsMatch(":default", ["button1", "button4", "input3", "input5", "input7", "checkbox1", "radio1", "option2", "button6", "button8"], "':default' matches dynamically changed form's default buttons");
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir.html
new file mode 100644
index 000000000..8edd9b8ab
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html id=html>
+ <head id=head>
+ <meta charset=utf-8 id=meta>
+ <title id=title>Selector: pseudo-classes (:dir(ltr), :dir(rtl))</title>
+ <link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
+ <link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
+ <script src="/resources/testharness.js" id=script1></script>
+ <script src="/resources/testharnessreport.js" id=script2></script>
+ <script src="utils.js" id=script3></script>
+ <style id=style>
+ #span1 {direction: rtl;}
+ #span5, #span6 {display: none;}
+ </style>
+ </head>
+ <body id=body>
+ <div id="log"></div>
+ <bdo dir="rtl" id=bdo1>WERBEH</bdo>
+ <bdo dir="ltr" id=bdo2>HEBREW</bdo>
+ <bdi id=bdi1>HEBREW</bdi>
+ <bdi dir="rtl" id=bdi2>WERBEH</bdi>
+ <bdi dir="ltr" id=bdi3>HEBREW</bdi>
+ <bdi id=bdi4>إيان</bdi>
+ <span id=span1>WERBEH</span>
+ <span dir="rtl" id=span2>WERBEH</span>
+ <span dir="ltr" id=span3>HEBREW</span>
+ &#x202E;<span id=span4>WERBEH</span>&#x202C;
+ <span dir="rtl" id=span5>WERBEH</span>
+ <span dir="ltr" id=span6>HEBREW</span>
+ <bdo dir="auto" id=bdo3>HEBREW</bdo>
+ <bdo dir="auto" id=bdo4>إيان</bdo>
+ <bdo dir="ltr" id=bdo5>עברית</bdo>
+
+ <script id=script4>
+ testSelectorIdsMatch(":dir(rtl)", ["bdo1", "bdi2", "bdi4", "span2", "span5", "bdo4"], "':dir(rtl)' matches all elements whose directionality is 'rtl'.");
+
+ var ltrElements = ["html", "head", "meta", "title", "link1", "link2", "script1", "script2", "script3", "style", "body", "log", "bdo2", "bdi1", "bdi3", "span1", "span3", "span4", "span6", "bdo3", "bdo5", "script4"];
+
+ testSelectorIdsMatch(":dir(ltr)", ltrElements, "':dir(ltr)' matches all elements whose directionality is 'ltr'.");
+
+ var bdo = document.createElement("bdo");
+ bdo.setAttribute("dir", "ltr");
+ testSelectorIdsMatch(":dir(ltr)", ltrElements, "':dir(ltr)' doesn't match elements not in the document.");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir01.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir01.html
new file mode 100644
index 000000000..61bbd574a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/dir01.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset=iso-8859-8 id=meta>
+<title id=title>Selector: pseudo-classes (:dir(ltr), :dir(rtl)) in iso-8859-8 documents</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
+<script src="/resources/testharness.js" id=script1></script>
+<script src="/resources/testharnessreport.js" id=script2></script>
+<script src="utils.js" id=script3></script>
+<div id="log"></div>
+<div>This text is left to right<div id=div1 style="direction:rtl">this is right to left</div></div>
+<div>This text is left to right<span id=div2 style="direction:rtl">this is left to right</span></div>
+
+<script>
+ var ltr = new Array(),
+ all = document.querySelectorAll('*');
+ for(var i = all.length; i--; ltr.unshift(all[i]));
+ testSelectorElementsMatch(":dir(ltr)", ltr, "direction doesn't affect :dir()");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/disabled.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/disabled.html
new file mode 100644
index 000000000..8808675eb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/disabled.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:disabled)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="utils.js"></script>
+<style>
+ #input4 {display:none;}
+</style>
+<div id="log"></div>
+<button id=button1 type=submit>button1</button>
+<button id=button2 disabled>button2</button>
+<input id=input1>
+<input id=input2 disabled>
+<input id=input3 readonly>
+<input id=input4>
+<select id=select1>
+ <optgroup label="options" id=optgroup1>
+ <option value="option1" id=option1 selected>option1
+</select>
+<select disabled id=select2>
+ <optgroup label="options" disabled id=optgroup2>
+ <option value="option2" disabled id=option2>option2
+</select>
+<textarea id=textarea1>textarea1</textarea>
+<textarea disabled id=textarea2>textarea2</textarea>
+<fieldset id=fieldset1></fieldset>
+<fieldset disabled id=fieldset2>
+ <legend><input type=checkbox id=club></legend>
+ <p><label>Name on card: <input id=clubname required></label></p>
+ <p><label>Card number: <input id=clubnum required pattern="[-0-9]+"></label></p>
+</fieldset>
+<label disabled></label>
+<object disabled></object>
+<output disabled></output>
+<img disabled/>
+<meter disabled></meter>
+<progress disabled></progress>
+
+<script>
+ testSelectorIdsMatch(":disabled", ["button2", "input2", "select2", "optgroup2", "option2", "textarea2", "fieldset2", "clubname", "clubnum"], "':disabled' should match only disabled elements");
+
+ document.getElementById("button2").removeAttribute("disabled");
+ testSelectorIdsMatch(":disabled", ["input2", "select2", "optgroup2", "option2", "textarea2", "fieldset2", "clubname", "clubnum"], "':disabled' should not match elements whose disabled attribute has been removed");
+
+ document.getElementById("button1").setAttribute("disabled", "disabled");
+ testSelectorIdsMatch(":disabled", ["button1", "input2", "select2", "optgroup2", "option2", "textarea2", "fieldset2", "clubname", "clubnum"], "':disabled' should also match elements whose disabled attribute has been set");
+
+ document.getElementById("button1").setAttribute("disabled", "disabled");
+ testSelectorIdsMatch(":disabled", ["button1", "input2", "select2", "optgroup2", "option2", "textarea2", "fieldset2", "clubname", "clubnum"], "':disabled' should also match elements whose disabled attribute has been set twice");
+
+ document.getElementById("input2").setAttribute("type", "submit"); // change input type to submit
+ testSelectorIdsMatch(":disabled", ["button1", "input2", "select2", "optgroup2", "option2", "textarea2", "fieldset2", "clubname", "clubnum"], "':disabled' should also match disabled elements whose type has changed");
+
+ var input = document.createElement("input");
+ input.setAttribute("disabled", "disabled");
+ testSelectorIdsMatch(":disabled", ["button1", "input2", "select2", "optgroup2", "option2", "textarea2", "fieldset2", "clubname", "clubnum"], "':disabled' should not match elements not in the document");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/enabled.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/enabled.html
new file mode 100644
index 000000000..98d81297e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/enabled.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:enabled)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="utils.js"></script>
+<div id="log"></div>
+<a id=link3></a>
+<area id=link4></area>
+<link id=link5></link>
+<a href="http://www.w3.org" id=link6></a>
+<area href="http://www.w3.org" id=link7></area>
+<link href="http://www.w3.org" id=link8></link>
+<button id=button1>button1</button>
+<button id=button2 disabled>button2</button>
+<input id=input1>
+<input id=input2 disabled>
+<select id=select1>
+ <optgroup label="options" id=optgroup1>
+ <option value="option1" id=option1 selected>option1
+</select>
+<select disabled id=select2>
+ <optgroup label="options" disabled id=optgroup2>
+ <option value="option2" disabled id=option2>option2
+</select>
+<textarea id=textarea1>textarea1</textarea>
+<textarea disabled id=textarea2>textarea2</textarea>
+<form>
+ <p><input type=submit contextmenu=formmenu id=submitbutton></p>
+ <menu type=popup id=formmenu>
+ <menuitem command="submitbutton" default id=menuitem1>
+ <menuitem command="resetbutton" disabled id=menuitem2>
+ </menu>
+</form>
+<fieldset id=fieldset1></fieldset>
+<fieldset disabled id=fieldset2></fieldset>
+
+<script>
+ testSelectorIdsMatch(":enabled", ["button1", "input1", "select1", "optgroup1", "option1", "textarea1", "submitbutton", "menuitem1", "fieldset1"], "':enabled' elements that are not disabled");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-autofocus.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-autofocus.html
new file mode 100644
index 000000000..80a75bb99
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-autofocus.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:focus for autofocus)</title>
+<link rel="author" title="Kent Tamura" href="mailto:tkent@chromium.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes">
+<link rel=help href="https://html.spec.whatwg.org/multipage/forms.html#autofocusing-a-form-control:-the-autofocus-attribute">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<script>
+// This test can't be merged to focus.html because element.focus() may affect
+// autofocus behavior.
+var autofocusTest = async_test(":focus selector should work with an autofocused element.");
+var input = document.createElement("input");
+input.autofocus = true;
+input.addEventListener("focus", function() {
+ autofocusTest.step(function() {
+ assert_array_equals(document.querySelectorAll(":focus"), [input])
+ autofocusTest.done();
+ });
+}, false);
+document.body.appendChild(input);
+</script>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-iframe.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-iframe.html
new file mode 100644
index 000000000..a269f1c67
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus-iframe.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:focus)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<input id="inputiframe" type=text value="foobar" />
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus.html
new file mode 100644
index 000000000..a319b24ef
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/focus.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:focus)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="utils.js"></script>
+<body id=body tabindex=0>
+ <div id="log"></div>
+ <button id=button1 type=submit>button1</button>
+ <input id=input1>
+ <input id=input2 disabled>
+ <textarea id=textarea1>textarea1</textarea>
+ <input type=checkbox id=checkbox1 checked>
+ <input type=radio id=radio1 checked>
+ <div tabindex=0 id=div1>hello</div>
+ <div contenteditable id=div2>content</div>
+ <iframe src="focus-iframe.html" id=iframe></iframe>
+
+ <script>
+ setup({explicit_done: true});
+
+ onload = function() {
+ if (document.hasFocus() || frames[0].document.hasFocus()) {
+ run_test()
+ } else {
+ window.onfocus = run_test;
+ }
+ }
+
+ function run_test() {
+ document.getElementById("input1").focus(); // set the focus on input1
+ testSelectorIdsMatch(":focus", ["input1"], "input1 has the focus");
+
+ document.getElementById("div1").focus();
+ testSelectorIdsMatch(":focus", ["div1"], "tabindex attribute makes the element focusable");
+
+ document.getElementById("div2").focus();
+ testSelectorIdsMatch(":focus", ["div2"], "editable elements are focusable");
+
+ document.body.focus();
+ testSelectorIdsMatch(":focus", ["body"], "':focus' matches focussed body with tabindex");
+
+ document.getElementById("iframe").contentDocument.getElementById("inputiframe").focus();
+ testSelectorIdsMatch(":focus", [], "':focus' doesn't match focused elements in iframe");
+
+ done();
+ }
+ </script>
+</body>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio.html
new file mode 100644
index 000000000..4a7b2d6ec
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate-radio.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<meta charset="utf-8">
+<title>:indeterminate and input type=radio</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style type="text/css">
+#test {
+ color: green;
+}
+input:indeterminate + #test {
+ color: red;
+}
+</style>
+<input type="radio" name="radios">
+<div id="test"></div>
+<input type="radio" name="radios" checked>
+<script type="text/javascript">
+test(function() {
+ document.getElementsByTagName("input")[0].indeterminate = true;
+ var target = document.getElementById("test");
+ var val = getComputedStyle(target, null).getPropertyValue("color");
+ assert_equals(val, "rgb(0, 128, 0)",
+ "The indeterminate IDL attribute should not cause the " +
+ ":indeterminate pseudo-class to match on input type=radio");
+})
+</script>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate.html
new file mode 100644
index 000000000..df0484667
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/indeterminate.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:indeterminate)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="utils.js"></script>
+<div id="log"></div>
+<input type=checkbox id=checkbox1>
+<input type=checkbox id=checkbox2>
+<input type=radio id=radio1 checked>
+<input type=radio name=radiogroup id=radio2>
+<input type=radio name=radiogroup id=radio3>
+<input type=radio name=group2 id=radio4>
+<input type=radio name=group2 id=radio5>
+<progress id="progress1"></progress>
+<progress id="progress2" value=10></progress>
+
+<script>
+ testSelectorIdsMatch(":indeterminate", ["radio2", "radio3", "radio4", "radio5", "progress1"], "':progress' matches <input>s radio buttons whose radio button group contains no checked input and <progress> elements without value attribute");
+
+ document.getElementById("radio2").setAttribute("checked", "checked");
+ testSelectorIdsMatch(":indeterminate", ["radio4", "radio5", "progress1"], "dynamically check a radio input in a radio button group");
+
+ document.getElementById("radio4").click();
+ testSelectorIdsMatch(":indeterminate", ["progress1"], "click on radio4 which is in the indeterminate state");
+
+ document.getElementById("progress1").setAttribute("value", "20");
+ testSelectorIdsMatch(":indeterminate", [], "adding a value to progress1 should put it in a determinate state");
+
+ document.getElementById("progress2").removeAttribute("value");
+ testSelectorIdsMatch(":indeterminate", ["progress2"], "removing progress2's value should put it in an indeterminate state");
+
+ document.getElementById("checkbox1").indeterminate = true; // set checkbox1 in the indeterminate state
+ testSelectorIdsMatch(":indeterminate", ["checkbox1", "progress2"], "':progress' also matches <input> checkbox whose indeterminate IDL is set to true");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/inrange-outofrange.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/inrange-outofrange.html
new file mode 100644
index 000000000..e9acbb374
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/inrange-outofrange.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:in-range, :out-of-range)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id="link1">
+<link rel="author" title="Chris Rebert" href="http://chrisrebert.com" id="link2">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#selector-in-range" id="link3">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#selector-out-of-range" id="link4">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="utils.js"></script>
+<div id="log"></div>
+<input type=number value=0 min=0 max=10 id=number1>
+<input type=number value=0 min=0 max=10 id=number2 disabled>
+<input type=number value=0 min=1 max=10 id=number3>
+<input type=number value=11 min=0 max=10 id=number4>
+<input type=number value=0 min=0 max=10 id=number5 readonly>
+
+<input type="date" min="2005-10-10" max="2020-10-10" value="2010-10-10" id="datein">
+<input type="date" min="2010-10-10" max="2020-10-10" value="2005-10-10" id="dateunder">
+<input type="date" min="2010-10-10" max="2020-10-10" value="2030-10-10" id="dateover">
+
+<input type="time" min="01:00:00" max="05:00:00" value="02:00:00" id="timein">
+<input type="time" min="02:00:00" max="05:00:00" value="01:00:00" id="timeunder">
+<input type="time" min="02:00:00" max="05:00:00" value="07:00:00" id="timeover">
+
+<input type="week" min="2016-W05" max="2016-W10" value="2016-W07" id="weekin">
+<input type="week" min="2016-W05" max="2016-W10" value="2016-W02" id="weekunder">
+<input type="week" min="2016-W05" max="2016-W10" value="2016-W26" id="weekover">
+
+<input type="month" min="2000-04" max="2000-09" value="2000-06" id="monthin">
+<input type="month" min="2000-04" max="2000-09" value="2000-02" id="monthunder">
+<input type="month" min="2000-04" max="2000-09" value="2000-11" id="monthover">
+
+<input type="datetime-local" min="2008-03-12T23:59:59" max="2015-02-13T23:59:59" value="2012-11-28T23:59:59" id="datetimelocalin">
+<input type="datetime-local" min="2008-03-12T23:59:59" max="2015-02-13T23:59:59" value="2008-03-01T23:59:59" id="datetimelocalunder">
+<input type="datetime-local" min="2008-03-12T23:59:59" max="2015-02-13T23:59:59" value="2016-01-01T23:59:59" id="datetimelocalover">
+
+<!-- None of the following have range limitations since they have neither min nor max attributes -->
+<input type="number" value="0" id="numbernolimit">
+<input type="date" value="2010-10-10" id="datenolimit">
+<input type="time" value="02:00:00" id="timenolimit">
+<input type="week" value="2016-W07" id="weeknolimit">
+<input type="month" value="2000-06" id="monthnolimit">
+<input type="datetime-local" value="2012-11-28T23:59:59" id="datetimelocalnolimit">
+
+<!-- range inputs have default minimum of 0 and default maximum of 100 -->
+<input type="range" value="50" id="range0">
+
+<!-- range input's value gets immediately clamped to the nearest boundary point -->
+<input type="range" min="2" max="7" value="5" id="range1">
+<input type="range" min="2" max="7" value="1" id="range2">
+<input type="range" min="2" max="7" value="9" id="range3">
+
+<!-- None of the following input types can have range limitations -->
+<input min="1" value="0" type="text">
+<input min="1" value="0" type="search">
+<input min="1" value="0" type="url">
+<input min="1" value="0" type="tel">
+<input min="1" value="0" type="email">
+<input min="1" value="0" type="password">
+<input min="1" value="#000000" type="color">
+<input min="1" value="0" type="checkbox">
+<input min="1" value="0" type="radio">
+<input min="1" value="0" type="file">
+<input min="1" value="0" type="submit">
+<input min="1" value="0" type="image">
+<!-- The following types are also barred from constraint validation -->
+<input min="1" value="0" type="hidden">
+<input min="1" value="0" type="button">
+<input min="1" value="0" type="reset">
+
+<script>
+ testSelectorIdsMatch(":in-range", ["number1", "datein", "timein", "weekin", "monthin", "datetimelocalin", "range0", "range1", "range2", "range3"], "':in-range' matches all elements that are candidates for constraint validation, have range limitations, and that are neither suffering from an underflow nor suffering from an overflow");
+
+ testSelectorIdsMatch(":out-of-range", ["number3", "number4", "dateunder", "dateover", "timeunder", "timeover", "weekunder", "weekover", "monthunder", "monthover", "datetimelocalunder", "datetimelocalover"], "':out-of-range' matches all elements that are candidates for constraint validation, have range limitations, and that are either suffering from an underflow or suffering from an overflow");
+
+ document.getElementById("number1").value = -10;
+ testSelectorIdsMatch(":in-range", ["datein", "timein", "weekin", "monthin", "datetimelocalin", "range0", "range1", "range2", "range3"], "':in-range' update number1's value < min");
+ testSelectorIdsMatch(":out-of-range", ["number1", "number3", "number4", "dateunder", "dateover", "timeunder", "timeover", "weekunder", "weekover", "monthunder", "monthover", "datetimelocalunder", "datetimelocalover"], "':out-of-range' update number1's value < min");
+
+ document.getElementById("number3").min = 0;
+ testSelectorIdsMatch(":in-range", ["number3", "datein", "timein", "weekin", "monthin", "datetimelocalin", "range0", "range1", "range2", "range3"], "':in-range' update number3's min < value");
+ testSelectorIdsMatch(":out-of-range", ["number1", "number4", "dateunder", "dateover", "timeunder", "timeover", "weekunder", "weekover", "monthunder", "monthover", "datetimelocalunder", "datetimelocalover"], "':out-of-range' update number3's min < value");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/link.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/link.html
new file mode 100644
index 000000000..fd485b83e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/link.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:link)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="utils.js"></script>
+<div id="log"></div>
+<a id=link4></a>
+<area id=link5></area>
+<link id=link6></link>
+<a href="http://www.w3.org" id=link7></a>
+<area href="http://www.w3.org" id=link8></area>
+<link href="http://www.w3.org" id=link9></link>
+<a href="http://[" id=link10></a>
+
+<script>
+ testSelectorIdsMatch(":link", ["link1", "link2", "link3", "link7", "link8", "link9", "link10"], "Only <a>s, <area>s and <link>s that have a href attribute match ':link'");
+
+ document.getElementById("link9").removeAttribute("href");
+ testSelectorIdsMatch(":link", ["link1", "link2", "link3", "link7", "link8", "link10"], "':link' doesn't match elements whos href attribute has been removed");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/readwrite-readonly.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/readwrite-readonly.html
new file mode 100644
index 000000000..d9bbadbe6
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/readwrite-readonly.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:read-write, :read-only)</title>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="utils.js"></script>
+<div id="log"></div>
+
+<div id=set0>
+<!-- The readonly attribute does not apply to the following input types -->
+<input id=checkbox1 type=checkbox>
+<input id=hidden1 type=hidden value=abc>
+<input id=range1 type=range>
+<input id=color1 type=color>
+<input id=radio1 type=radio>
+<input id=file1 type=file>
+<input id=submit1 type=submit>
+<input id=image1 type=image>
+<input id=button1 type=button value="Button">
+<input id=reset1 type=reset>
+</div>
+
+<div id=set1>
+<input id=input1>
+<input id=input2 readonly>
+<input id=input3 disabled>
+<input id=input4 type=checkbox>
+<input id=input5 type=checkbox readonly>
+</div>
+
+<div id=set2>
+<textarea id=textarea1>textarea1</textarea>
+<textarea readonly id=textarea2>textarea2</textarea>
+</div>
+
+<div id=set3>
+<textarea id=textarea3>textarea3</textarea>
+<textarea disabled id=textarea4>textarea4</textarea>
+</div>
+
+<div id=set4>
+<p id=p1>paragraph1.</p>
+<p id=p2 contenteditable>paragraph2.</p>
+</div>
+
+<script>
+ testSelectorIdsMatch("#set0 :read-write", [], "The :read-write pseudo-class must not match input elements to which the readonly attribute does not apply");
+
+ testSelectorIdsMatch("#set0 :read-only", ["checkbox1", "hidden1", "range1", "color1", "radio1", "file1", "submit1", "image1", "button1", "reset1"], "The :read-only pseudo-class must match input elements to which the readonly attribute does not apply");
+
+ testSelectorIdsMatch("#set1 :read-write", ["input1"], "The :read-write pseudo-class must match input elements to which the readonly attribute applies, and that are mutable");
+
+ testSelectorIdsMatch("#set1 :read-only", ["input2"], "The :read-only pseudo-class must not match input elements to which the readonly attribute applies, and that are mutable");
+
+ document.getElementById("input1").setAttribute("readonly", "readonly");
+ testSelectorIdsMatch("#set1 :read-write", [], "The :read-write pseudo-class must not match input elements after the readonly attribute has been added");
+
+ testSelectorIdsMatch("#set1 :read-only", ["input1", "input2"], "The :read-only pseudo-class must match input elements after the readonly attribute has been added");
+
+ document.getElementById("input1").removeAttribute("readonly");
+ testSelectorIdsMatch("#set1 :read-write", ["input1"], "The :read-write pseudo-class must not match input elements after the readonly attribute has been removed");
+
+ testSelectorIdsMatch("#set1 :read-only", ["input2"], "The :read-only pseudo-class must match input elements after the readonly attribute has been removed");
+
+ testSelectorIdsMatch("#set2 :read-write", ["textarea1"], "The :read-write pseudo-class must match textarea elements that do not have a readonly attribute, and that are not disabled");
+
+ testSelectorIdsMatch("#set2 :read-only", ["textarea2"], "The :read-only pseudo-class must match textarea elements that have a readonly attribute, or that are disabled");
+
+ document.getElementById("textarea1").setAttribute("readonly", "readonly");
+ testSelectorIdsMatch("#set2 :read-write", [], "The :read-write pseudo-class must match textarea elements after the readonly attribute has been added");
+
+ testSelectorIdsMatch("#set2 :read-only", ["textarea1", "textarea2"], "The :read-only pseudo-class must match textarea elements after the readonly attribute has been added");
+
+ testSelectorIdsMatch("#set3 :read-write", ["textarea3"], "The :read-write pseudo-class must not match textarea elements that are disabled");
+
+ testSelectorIdsMatch("#set3 :read-only", ["textarea4"], "The :read-only pseudo-class must match textarea elements that are disabled");
+
+ testSelectorIdsMatch("#set4 :read-write", ["p2"], "The :read-write pseudo-class must match elements that are editable");
+
+ testSelectorIdsMatch("#set4 :read-only", ["p1"], "The :read-only pseudo-class must not match elements that are editable");
+
+ document.designMode = "on";
+
+ testSelectorIdsMatch("#set4 :read-write", ["p1", "p2"], "The :read-write pseudo-class must match elements that are editing hosts");
+
+ testSelectorIdsMatch("#set4 :read-only", [], "The :read-only pseudo-class must not match elements that are editing hosts");
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/required-optional.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/required-optional.html
new file mode 100644
index 000000000..f06fdfa1e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/required-optional.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:required, :optional)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="utils.js"></script>
+<div id="log"></div>
+<input type=text id=text1 value="foobar" required>
+<input type=text id=text2 required>
+<input type=text id=text3>
+<select id=select1 required>
+ <optgroup label="options" id=optgroup1>
+ <option value="option1" id=option1>option1
+</select>
+<select id=select2>
+ <optgroup label="options" id=optgroup2>
+ <option value="option2" id=option2>option2
+</select>
+<textarea required id=textarea1>textarea1</textarea>
+<textarea id=textarea2>textarea2</textarea>
+
+<script>
+ testSelectorIdsMatch(":required", ["text1", "text2", "select1", "textarea1"], "':required' matches required <input>s, <select>s and <textarea>s");
+ testSelectorIdsMatch(":optional", ["text3", "select2", "textarea2"], "':optional' matches elements <input>s, <select>s and <textarea>s that are not required");
+
+ document.getElementById("text1").removeAttribute("required");
+ testSelectorIdsMatch(":required", ["text2", "select1", "textarea1"], "':required' doesn't match elements whose required attribute has been removed");
+ testSelectorIdsMatch(":optional", ["text1", "text3", "select2", "textarea2"], "':optional' matches elements whose required attribute has been removed");
+
+ document.getElementById("select2").setAttribute("required", "required");
+ testSelectorIdsMatch(":required", ["text2", "select1", "select2", "textarea1"], "':required' matches elements whose required attribute has been added");
+ testSelectorIdsMatch(":optional", ["text1", "text3", "textarea2"], "':optional' doesn't match elements whose required attribute has been added");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/utils.js b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/utils.js
new file mode 100644
index 000000000..a8b1cd62a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/utils.js
@@ -0,0 +1,20 @@
+function getElementsByIds(ids) {
+ var result = [];
+ ids.forEach(function(id) {
+ result.push(document.getElementById(id));
+ });
+ return result;
+}
+
+function testSelectorIdsMatch(selector, ids, testName) {
+ test(function(){
+ var elements = document.querySelectorAll(selector);
+ assert_array_equals(elements, getElementsByIds(ids));
+ }, testName);
+}
+
+function testSelectorElementsMatch(selector, elements, testName) {
+ test(function(){
+ assert_array_equals(document.querySelectorAll(selector), elements);
+ }, testName);
+}
diff --git a/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/valid-invalid.html b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/valid-invalid.html
new file mode 100644
index 000000000..d93407707
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/selectors/pseudo-classes/valid-invalid.html
@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Selector: pseudo-classes (:valid, :invalid)</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="utils.js"></script>
+<style>
+ #styleTests form, #styleTests fieldset, #failExample { background-color:red; }
+ #styleTests > :valid, #validExample { background-color:green; }
+ #styleTests > :invalid, #invalidExample { background-color:lime; }
+</style>
+</head>
+<body>
+<div id="log"></div>
+<div id='simpleConstraints'>
+ <input type=text id=text1 value="foobar" required>
+ <input type=text id=text2 required>
+</div>
+<div id='FormSelection'>
+ <form id=form1>
+ <input type=text id=text3 value="foobar" required>
+ </form>
+ <form id=form2>
+ <input type=text id=text4 required>
+ </form>
+</div>
+<div id='FieldSetSelection'>
+ <fieldset id=fieldset1>
+ <input type=text id=text5 value="foobar" required>
+ </fieldset>
+ <fieldset id=fieldset2>
+ <input type=text id=text6 required>
+ </fieldset>
+</div>
+<div id='patternConstraints'>
+ <input type=text id=text7 value="AAA" pattern="[0-9][A-Z]{3}">
+ <input type=text id=text8 value="0AAA" pattern="[0-9][A-Z]{3}">
+</div>
+<div id='numberConstraints'>
+ <input type=number id=number1 value=0 min=1>
+ <input type=number id=number2 value=1 min=1>
+</div>
+<div id='styleTests'>
+ <form>
+ </form>
+ <form>
+ <input type=text min=8 value=4>
+ </form>
+ <form>
+ <input type=number min=8 value=4>
+ </form>
+ <fieldset>
+ </fieldset>
+ <fieldset>
+ <input type=text min=8 value=4>
+ </fieldset>
+ <fieldset>
+ <input type=number min=8 value=4>
+ </fieldset>
+ <div id='validExample'></div>
+ <div id='invalidExample'></div>
+ <div id='failExample'></div>
+</div>
+<script>
+ testSelectorIdsMatch("#simpleConstraints :valid", ["text1"], "':valid' matches elements that satisfy their constraints");
+
+ testSelectorIdsMatch("#FormSelection :valid", ["form1", "text3"], "':valid' matches form elements that are not the form owner of any elements that themselves are candidates for constraint validation but do not satisfy their constraints");
+
+ testSelectorIdsMatch("#FieldSetSelection :valid", ["fieldset1", "text5"], "':valid' matches fieldset elements that have no descendant elements that themselves are candidates for constraint validation but do not satisfy their constraints");
+
+ testSelectorIdsMatch("#patternConstraints :valid", [ "text8" ], "':valid' matches elements that satisfy their pattern constraints");
+
+ testSelectorIdsMatch("#numberConstraints :valid", [ "number2" ], "':valid' matches elements that satisfy their number constraints");
+
+
+ testSelectorIdsMatch("#simpleConstraints :invalid", ["text2"], "':invalid' matches elements that do not satisfy their simple text constraints");
+
+ testSelectorIdsMatch("#FormSelection :invalid", ["form2", "text4"], "':invalid' matches form elements that are the form owner of one or more elements that themselves are candidates for constraint validation but do not satisfy their constraints");
+
+ testSelectorIdsMatch("#FieldSetSelection :invalid", ["fieldset2", "text6"], "':invalid' matches fieldset elements that have of one or more descendant elements that themselves are candidates for constraint validation but do not satisfy their constraints");
+
+ testSelectorIdsMatch("#patternConstraints :invalid", ["text7"], "':invalid' matches elements that do not satisfy their pattern constraints");
+
+ testSelectorIdsMatch("#numberConstraints :invalid", ["number1"], "':invalid' matches elements that do not satisfy their number constraints");
+
+ document.getElementById("text7").value="0BBB";
+ testSelectorIdsMatch("#patternConstraints :valid", [ "text7", "text8" ], "':valid' matches new elements that satisfy their constraints");
+ testSelectorIdsMatch("#patternConstraints :invalid", [], "':invalid' doesn't match new elements that satisfy their constraints");
+
+ document.getElementById("text8").value="BBB";
+ testSelectorIdsMatch("#patternConstraints :valid", ["text7"], "':valid' doesn't match new elements that do not satisfy their constraints");
+ testSelectorIdsMatch("#patternConstraints :invalid", ["text8"], "':invalid' matches new elements that do not satisfy their constraints");
+
+ function getBGColor(elem) {
+ return getComputedStyle(elem).backgroundColor;
+ }
+
+ function testStyles(type) {
+ var elems = document.querySelectorAll("#styleTests " + type),
+ empty = elems[0],
+ valid = elems[1],
+ invalid = elems[2],
+ validInput = valid.querySelector("input"),
+ invalidInput = invalid.querySelector("input"),
+ expectedValidBGColor = getBGColor(document.getElementById("validExample")),
+ expectedInvalidBGColor = getBGColor(document.getElementById("invalidExample")),
+ expectedFailBGColor = getBGColor(document.getElementById("failExample"));
+
+ test(function() {
+ assert_equals(getBGColor(empty), expectedValidBGColor, "wrong background-color");
+ }, 'empty ' + type + ' correctly styled on page-load');
+
+ test(function() {
+ assert_equals(getBGColor(valid), expectedValidBGColor, "wrong background-color");
+ }, 'valid ' + type + ' correctly styled on page-load');
+ test(function() {
+ assert_equals(getBGColor(invalid), expectedInvalidBGColor, "wrong background-color");
+ }, 'invalid ' + type + ' correctly styled on page-load');
+
+ test(function() {
+ empty.appendChild(validInput.cloneNode());
+ assert_equals(getBGColor(empty), expectedValidBGColor, "wrong background-color");
+ }, 'programmatically adding valid to empty ' + type + ' results in correct style');
+ test(function() {
+ empty.appendChild(invalidInput.cloneNode());
+ assert_equals(getBGColor(empty), expectedInvalidBGColor, "wrong background-color");
+ }, 'programmatically adding invalid to empty ' + type + ' results in correct style');
+
+ validInput.type = "number";
+ invalidInput.type = "text";
+ test(function() {
+ assert_equals(getBGColor(valid), expectedInvalidBGColor, "wrong background-color");
+ }, 'programmatically-invalidated ' + type + ' correctly styled');
+ test(function() {
+ assert_equals(getBGColor(invalid), expectedValidBGColor, "wrong background-color");
+ }, 'programmatically-validated ' + type + ' correctly styled');
+ }
+ test(testStyles.bind(undefined, "form"), ":valid/:invalid styling for <form>");
+ test(testStyles.bind(undefined, "fieldset"), ":valid/:invalid styling for <fieldset>");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/cellIndex.html b/testing/web-platform/tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/cellIndex.html
new file mode 100644
index 000000000..b8449229d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/cellIndex.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>HTMLTableCellElement.cellIndex</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var th = document.createElement("th");
+ assert_true("cellIndex" in th, '"cellIndex" in th');
+ var td = document.createElement("td");
+ assert_true("cellIndex" in td, '"cellIndex" in td');
+}, "cellIndex should exist.")
+test(function() {
+ var th = document.createElement("th");
+ assert_equals(th.cellIndex, -1);
+ var td = document.createElement("td");
+ assert_equals(td.cellIndex, -1);
+}, "For cells without a parent, cellIndex should be -1.")
+test(function() {
+ var table = document.createElement("table");
+ var th = table.appendChild(document.createElement("th"));
+ assert_equals(th.cellIndex, -1);
+ var td = table.appendChild(document.createElement("td"));
+ assert_equals(td.cellIndex, -1);
+}, "For cells whose parent is not a tr, cellIndex should be -1.")
+test(function() {
+ var tr = document.createElementNS("", "tr");
+ var th = tr.appendChild(document.createElement("th"));
+ assert_equals(th.cellIndex, -1);
+ var td = tr.appendChild(document.createElement("td"));
+ assert_equals(td.cellIndex, -1);
+}, "For cells whose parent is not a HTML tr, cellIndex should be -1.")
+test(function() {
+ var tr = document.createElement("tr");
+ var th = tr.appendChild(document.createElement("th"));
+ assert_equals(th.cellIndex, 0);
+ var td = tr.appendChild(document.createElement("td"));
+ assert_equals(td.cellIndex, 1);
+}, "For cells whose parent is a tr, cellIndex should be the index.")
+test(function() {
+ var tr = document.createElement("tr");
+ var th = tr.appendChild(document.createElement("th"));
+ assert_equals(th.cellIndex, 0);
+ tr.appendChild(document.createElement("div"));
+ tr.appendChild(document.createTextNode("Hello World"));
+ var td = tr.appendChild(document.createElement("td"));
+ assert_equals(td.cellIndex, 1)
+}, "For cells whose parent is a tr with non td/th sibling, cellIndex should skip those non td/th siblings.")
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/examples/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/examples/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/examples/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/historical.html b/testing/web-platform/tests/html/semantics/tabular-data/historical.html
new file mode 100644
index 000000000..a6be56e13
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/historical.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>Historical table features should not be supported</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+function t(property, tagNames) {
+ if (typeof tagNames === "string") {
+ tagNames = [tagNames];
+ }
+ tagNames.forEach(function(tagName) {
+ test(function() {
+ assert_false(property in document.createElement(tagName));
+ }, tagName + '.' + property + ' should not be supported');
+ });
+}
+
+// added in https://github.com/whatwg/html/commit/6db0d8d4e3456140de958c963afe9bb9ec7b6a25
+// removed in https://github.com/whatwg/html/commit/59b7e2466c2b7c5c408a4963b05b13fd808aa07a
+t('onsort', 'table');
+t('sortable', 'table');
+t('stopSorting', 'table');
+t('sorted', 'th');
+t('sort', 'th');
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/html-table-section-element.js b/testing/web-platform/tests/html/semantics/tabular-data/html-table-section-element.js
new file mode 100644
index 000000000..68b68ceed
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/html-table-section-element.js
@@ -0,0 +1,22 @@
+// https://html.spec.whatwg.org/multipage/#dom-tbody-rows
+function testRowsAttribute(localName) {
+ var elem = document.createElement(localName);
+ assert_equals(elem.rows.length, 0);
+
+ // Child <p> should *not* count as a row
+ elem.appendChild(document.createElement("p"));
+ assert_equals(elem.rows.length, 0);
+
+ // Child <tr> should count as a row
+ var childTr = document.createElement("tr");
+ elem.appendChild(childTr);
+ assert_equals(elem.rows.length, 1);
+
+ // Nested table with child <tr> should *not* count as a row
+ var nested = document.createElement(localName);
+ nested.appendChild(document.createElement("tr"));
+ var nestedTable = document.createElement("table");
+ nestedTable.appendChild(nested);
+ childTr.appendChild(nestedTable);
+ assert_equals(elem.rows.length, 1);
+}
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/processing-model-1/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/processing-model-1/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/processing-model-1/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/processing-model-1/contains.json b/testing/web-platform/tests/html/semantics/tabular-data/processing-model-1/contains.json
new file mode 100644
index 000000000..be5a8fdfd
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/processing-model-1/contains.json
@@ -0,0 +1,10 @@
+[
+ {
+ "id": "forming-a-table",
+ "original_id": "forming-a-table"
+ },
+ {
+ "id": "header-and-data-cell-semantics",
+ "original_id": "header-and-data-cell-semantics"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/caption_001.html b/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/caption_001.html
new file mode 100644
index 000000000..ecb1bef85
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/caption_001.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>HTML5 Table API Tests</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="https://html.spec.whatwg.org/multipage/#the-caption-element" />
+ </head>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <body>
+ <div id="log"></div>
+ <table id="table1" style="display:none">
+ <tr><td></td></tr>
+ <caption>first caption</caption>
+ <caption>second caption</caption>
+ </table>
+ <table id="table2" style="display:none">
+ <tr><td></td></tr>
+ </table>
+ <table id="table3" style="display:none">
+ <tr><td></td></tr>
+ </table>
+ <table id="table4" style="display:none">
+ <tr><td></td></tr>
+ <caption>first caption</caption>
+ </table>
+ <script>
+ test(function () {
+ assert_equals(document.getElementById('table1').caption.innerHTML, "first caption");
+ }, "first caption element child of the first table element");
+
+ test(function () {
+ var caption = document.createElement("caption");
+ caption.innerHTML = "new caption";
+ var table = document.getElementById('table1');
+ table.caption = caption;
+
+ assert_equals(caption.parentNode, table);
+ assert_equals(table.firstChild, caption);
+ assert_equals(table.caption.innerHTML, "new caption");
+
+ captions = table.getElementsByTagName('caption');
+ assert_equals(captions.length, 2);
+ assert_equals(captions[0].innerHTML, "new caption");
+ assert_equals(captions[1].innerHTML, "second caption");
+ }, "setting caption on a table");
+
+ test(function () {
+ assert_equals(document.getElementById('table2').caption, null);
+ }, "caption IDL attribute is null");
+
+ test(function () {
+ var table = document.getElementById('table3');
+ var caption = document.createElement("caption")
+ table.rows[0].appendChild(caption);
+ assert_equals(table.caption, null);
+ }, "caption of the third table element should be null");
+
+ test(function () {
+ assert_not_equals(document.getElementById('table4').caption, null);
+
+ var parent = document.getElementById('table4').caption.parentNode;
+ parent.removeChild(document.getElementById('table4').caption);
+
+ assert_equals(document.getElementById('table4').caption, null);
+ }, "dynamically removing caption on a table");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-col-element/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/the-col-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-col-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-colgroup-element/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/the-colgroup-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-colgroup-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/caption-methods.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/caption-methods.html
new file mode 100644
index 000000000..35ee9f445
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/caption-methods.html
@@ -0,0 +1,100 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Creating and deleting captions</title>
+ <link rel="author" title="Erika Navara" href="mailto:edoyle@microsoft.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-table-element" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-table-createcaption" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-table-deletecaption" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <div id="log"></div>
+ <table id="table0" style="display:none">
+ </table>
+ <table id="table1" style="display:none">
+ <caption id="caption1">caption</caption>
+ <tr>
+ <td>cell</td>
+ <td>cell</td>
+ </tr>
+ </table>
+ <table id="table2" style="display:none">
+ <foo:caption>caption</foo:caption>
+ <tr>
+ <td>cell</td>
+ <td>cell</td>
+ </tr>
+ </table>
+ <table id="table3" style="display:none">
+ <caption id="caption3">caption 3</caption>
+ <tr>
+ <td>cell</td>
+ <td>cell</td>
+ </tr>
+ </table>
+ <table id="table4" style="display:none">
+ </table>
+ <table id="table5" style="display:none">
+ </table>
+ <script>
+ test(function () {
+ var table0 = document.getElementById('table0');
+ var caption = document.createElementNS("foo", "caption");
+ table0.appendChild(caption);
+ var table0FirstNode = table0.firstChild;
+ var testCaption = table0.createCaption();
+ assert_not_equals(testCaption, table0FirstNode);
+ assert_equals(testCaption, table0.firstChild);
+ }, "createCaption method creates new caption if existing caption is not in html namespace")
+ test(function () {
+ var table1 = document.getElementById('table1');
+ var testCaption = table1.createCaption();
+ var table1FirstCaption = table1.caption;
+ assert_equals(testCaption, table1FirstCaption);
+ }, "createCaption method returns the first caption element child of the table")
+ test(function () {
+ var table2 = document.getElementById('table2');
+ var test2Caption = table2.createCaption();
+ var table2FirstNode = table2.firstChild;
+ assert_true(test2Caption instanceof HTMLTableCaptionElement);
+ assert_equals(table2FirstNode, test2Caption);
+ }, "createCaption method creates a new caption and inserts it as the first node of the table element")
+ test(function () {
+ var table = document.createElement('table');
+ assert_equals(table.createCaption(), table.createCaption());
+ }, "createCaption will not create new caption if one exists")
+ test(function () {
+ var table = document.createElementNS("http://www.w3.org/1999/xhtml", "foo:table")
+ var caption = table.createCaption();
+ assert_equals(caption.prefix, null);
+ }, "createCaption will not copy table's prefix")
+ test(function () {
+ var table3 = document.getElementById('table3');
+ assert_equals(table3.caption.textContent, "caption 3");
+ table3.deleteCaption();
+ assert_equals(table3.caption, null);
+ }, "deleteCaption method removes the first caption element child of the table element")
+ test(function () {
+ var table4 = document.getElementById('table4');
+ var caption = document.createElementNS("foo", "caption");
+ table4.appendChild(caption);
+ table4.deleteCaption();
+ assert_equals(caption.parentNode, table4);
+ }, "deleteCaption method not remove caption that is not in html namespace")
+ test(function() {
+ var table5 = document.getElementById('table5');
+ var caption = document.createElement('caption');
+ caption.appendChild(table5)
+
+ // Node cannot be inserted at the specified point in the hierarchy
+ assert_throws("HierarchyRequestError", function() {
+ table5.caption = caption;
+ });
+
+ assert_not_equals(table5.caption, caption);
+ }, "Setting caption rethrows exception");
+ </script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/contains.json b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/contains.json
new file mode 100644
index 000000000..ee89be21d
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/contains.json
@@ -0,0 +1,10 @@
+[
+ {
+ "id": "table-descriptions-techniques",
+ "original_id": "table-descriptions-techniques"
+ },
+ {
+ "id": "table-layout-techniques",
+ "original_id": "table-layout-techniques"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/createTBody.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/createTBody.html
new file mode 100644
index 000000000..6100aedfd
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/createTBody.html
@@ -0,0 +1,173 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLTableElement.createTBody</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+function assert_tbody(tbody) {
+ assert_equals(tbody.localName, "tbody");
+ assert_equals(tbody.namespaceURI, htmlNS);
+ assert_equals(tbody.prefix, null);
+}
+var htmlNS = "http://www.w3.org/1999/xhtml";
+test(function() {
+ var table = document.createElement("table");
+ var tbody = table.createTBody();
+ assert_equals(table.firstChild, tbody);
+ assert_tbody(tbody);
+}, "No child nodes");
+
+test(function() {
+ var table = document.createElement("table");
+ var before = table.appendChild(document.createElement("tbody"));
+ assert_array_equals(table.childNodes, [before]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before, tbody]);
+ assert_tbody(tbody);
+}, "One tbody child node");
+
+test(function() {
+ var table = document.createElement("table");
+ var before1 = table.appendChild(document.createElement("tbody"));
+ var before2 = table.appendChild(document.createElement("tbody"));
+ assert_array_equals(table.childNodes, [before1, before2]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before1, before2, tbody]);
+ assert_tbody(tbody);
+}, "Two tbody child nodes");
+
+test(function() {
+ var table = document.createElement("table");
+ var before1 = table.appendChild(document.createElement("thead"));
+ var before2 = table.appendChild(document.createElement("tbody"));
+ assert_array_equals(table.childNodes, [before1, before2]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before1, before2, tbody]);
+ assert_tbody(tbody);
+}, "A thead and a tbody child node");
+
+test(function() {
+ var table = document.createElement("table");
+ var before1 = table.appendChild(document.createElement("tfoot"));
+ var before2 = table.appendChild(document.createElement("tbody"));
+ assert_array_equals(table.childNodes, [before1, before2]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before1, before2, tbody]);
+ assert_tbody(tbody);
+}, "A tfoot and a tbody child node");
+
+test(function() {
+ var table = document.createElement("table");
+ var before = table.appendChild(document.createElement("tbody"));
+ var after = table.appendChild(document.createElement("thead"));
+ assert_array_equals(table.childNodes, [before, after]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before, tbody, after]);
+ assert_tbody(tbody);
+}, "A tbody and a thead child node");
+
+test(function() {
+ var table = document.createElement("table");
+ var before = table.appendChild(document.createElement("tbody"));
+ var after = table.appendChild(document.createElement("tfoot"));
+ assert_array_equals(table.childNodes, [before, after]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before, tbody, after]);
+ assert_tbody(tbody);
+}, "A tbody and a tfoot child node");
+
+test(function() {
+ var table = document.createElement("table");
+ var before1 = table.appendChild(document.createElement("tbody"));
+ var before2 = table.appendChild(document.createElement("tbody"));
+ var after = table.appendChild(document.createElement("div"));
+ assert_array_equals(table.childNodes, [before1, before2, after]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before1, before2, tbody, after]);
+ assert_tbody(tbody);
+}, "Two tbody child nodes and a div");
+
+test(function() {
+ var table = document.createElement("table");
+ var before = table.appendChild(document.createElement("tbody"));
+ var after = table.appendChild(document.createElementNS("x", "tbody"));
+ assert_array_equals(table.childNodes, [before, after]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before, tbody, after]);
+ assert_tbody(tbody);
+}, "One HTML and one namespaced tbody child node");
+
+test(function() {
+ var table = document.createElement("table");
+ var before1 = table.appendChild(document.createElement("tbody"));
+ var before2 = before1.appendChild(document.createElement("tbody"));
+ assert_array_equals(table.childNodes, [before1]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before1, tbody]);
+ assert_tbody(tbody);
+}, "Two nested tbody child nodes");
+
+test(function() {
+ var table = document.createElement("table");
+ var before1 = table.appendChild(document.createElement("thead"));
+ var before2 = before1.appendChild(document.createElement("tbody"));
+ assert_array_equals(table.childNodes, [before1]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before1, tbody]);
+ assert_tbody(tbody);
+}, "A tbody node inside a thead child node");
+
+test(function() {
+ var table = document.createElement("table");
+ var before1 = table.appendChild(document.createElement("tfoot"));
+ var before2 = before1.appendChild(document.createElement("tbody"));
+ assert_array_equals(table.childNodes, [before1]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before1, tbody]);
+ assert_tbody(tbody);
+}, "A tbody node inside a tfoot child node");
+
+test(function() {
+ var table = document.createElement("table");
+ var before = table.appendChild(document.createElement("tbody"));
+ var after1 = table.appendChild(document.createElement("thead"));
+ var after2 = after1.appendChild(document.createElement("tbody"));
+ assert_array_equals(table.childNodes, [before, after1]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before, tbody, after1]);
+ assert_tbody(tbody);
+}, "A tbody node inside a thead child node after a tbody child node");
+
+test(function() {
+ var table = document.createElement("table");
+ var before = table.appendChild(document.createElement("tbody"));
+ var after1 = table.appendChild(document.createElement("tfoot"));
+ var after2 = after1.appendChild(document.createElement("tbody"));
+ assert_array_equals(table.childNodes, [before, after1]);
+
+ var tbody = table.createTBody();
+ assert_array_equals(table.childNodes, [before, tbody, after1]);
+ assert_tbody(tbody);
+}, "A tbody node inside a tfoot child node after a tbody child node");
+
+test(function() {
+ var table = document.createElementNS(htmlNS, "foo:table");
+ var tbody = table.createTBody();
+
+ assert_equals(tbody.prefix, null);
+}, "A prefixed table creates tbody without prefix");
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/delete-caption.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/delete-caption.html
new file mode 100644
index 000000000..6183fa98b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/delete-caption.html
@@ -0,0 +1,94 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>deleteCaption()</title>
+ <link rel="author" title="Ben Boyle" href="mailto:benjamins.boyle@gmail.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-table-deletecaption" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <table id="one-caption">
+ <caption>Fixture table caption</caption>
+ </table>
+
+ <table id="two-captions">
+ <caption>Fixture table caption</caption>
+ <caption>A second caption element</caption>
+ </table>
+
+ <table id="zero-captions"></table>
+
+ <table id="descendent-caption">
+ <tr>
+ <td>
+ <table>
+ <caption>Nested caption</caption>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+ <script>
+ // The deleteCaption() method must remove the first caption element child of the table element, if any.
+ // https://html.spec.whatwgorg/multipage/tables.html#dom-table-deletecaption
+ test(function() {
+ var table = document.getElementById('one-caption');
+
+ table.deleteCaption();
+ assert_equals(table.getElementsByTagName('caption').length, 0, 'caption was removed');
+
+ }, 'deleteCaption() delete only caption on table');
+
+ test(function() {
+ var table = document.getElementById('one-caption');
+ var result;
+
+ result = table.deleteCaption();
+ // does .deleteCaption() have a return value?
+ assert_equals(result, undefined, '.deleteCaption() returns undefined');
+ }, 'deleteCaption() returns undefined');
+
+ test(function() {
+ var table = document.getElementById('two-captions');
+
+ table.deleteCaption();
+ assert_equals(table.getElementsByTagName('caption').length, 1, '1 caption (of 2) was removed');
+ assert_equals(table.getElementsByTagName('caption')[0].textContent, 'A second caption element', 'The first caption was removed');
+
+ // removing the only caption
+ table.deleteCaption();
+ assert_equals(table.getElementsByTagName('caption').length, 0, 'last caption was removed');
+ }, 'deleteCaption()');
+
+ test(function() {
+ var table = document.getElementById('zero-captions');
+ // removing a caption when none exists
+ table.deleteCaption();
+
+ assert_equals(table.getElementsByTagName('caption').length, 0, 'no exceptions using .deleteCaption() on a table without any captions');
+
+ }, 'deleteCaption() does not throw any exceptions when called on a table without a caption');
+
+ test(function() {
+ var table = document.getElementById( 'descendent-caption' );
+ table.deleteCaption();
+
+ assert_equals(table.getElementsByTagName('caption').length, 1, 'descendent caption was not deleted');
+ }, 'deleteCaption() does not delete captions in descendent tables');
+
+ test(function() {
+ var table = document.getElementById('zero-captions');
+ var caption;
+
+ caption = document.createElementNS('http://www.w3.org/2000/svg', 'caption');
+ table.insertBefore(caption, table.firstChild);
+ assert_equals(table.getElementsByTagName('caption').length, 1, 'SVG:caption is created');
+
+ table.deleteCaption();
+ assert_equals(table.getElementsByTagName('caption').length, 1, 'SVG:caption is not deleted');
+
+ }, 'deleteCaption() handles captions from different namespaces');
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/insertRow-method-01.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/insertRow-method-01.html
new file mode 100644
index 000000000..4e379a1cc
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/insertRow-method-01.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<title>insertRow(): INDEX_SIZE_ERR</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-table-insertrow">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<table>
+<tr>
+<td>
+</table>
+</div>
+<script>
+test(function() {
+ var table = document.getElementById("test").getElementsByTagName("table")[0];
+ assert_throws("INDEX_SIZE_ERR", function() {
+ table.insertRow(-2);
+ })
+ assert_throws("INDEX_SIZE_ERR", function() {
+ table.insertRow(2);
+ })
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/insertRow-method-02.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/insertRow-method-02.html
new file mode 100644
index 000000000..410425fb1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/insertRow-method-02.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>insertRow(): Empty table</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-table-insertrow">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<table></table>
+</div>
+<script>
+var HTML = "http://www.w3.org/1999/xhtml";
+test(function() {
+ var table = document.getElementById("test").getElementsByTagName("table")[0];
+ test(function() {
+ assert_equals(table.childNodes.length, 0);
+ assert_equals(table.rows.length, 0);
+ }, "table should start out empty")
+
+ var tr;
+ test(function() {
+ tr = table.insertRow(0);
+ assert_equals(tr.localName, "tr");
+ assert_equals(tr.namespaceURI, HTML);
+ }, "insertRow should insert a tr element")
+
+ var tbody = tr.parentNode;
+ test(function() {
+ assert_equals(tbody.localName, "tbody");
+ assert_equals(tbody.namespaceURI, HTML);
+ assert_equals(tbody.parentNode, table);
+ }, "insertRow should insert a tbody element")
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/insertRow-method-03.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/insertRow-method-03.html
new file mode 100644
index 000000000..19c3ceb3c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/insertRow-method-03.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<title>insertRow(): non-empty table</title>
+<link rel="author" title="g-k" href="mailto:greg.guthe@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-table-insertrow">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+ <table>
+ <tbody><tr id="first"></tr><tr id="second"></tr></tbody>
+ </table>
+</div>
+<script>
+var HTML = "http://www.w3.org/1999/xhtml";
+test(function() {
+ var table = document.getElementById("test").getElementsByTagName("table")[0];
+ test(function() {
+ assert_equals(table.childNodes.length, 3);
+ assert_equals(table.rows.length, 2);
+ }, "table should start out with two rows")
+
+ var tr;
+ test(function() {
+ tr = table.insertRow(1);
+ assert_equals(tr.localName, "tr");
+ assert_equals(tr.namespaceURI, HTML);
+ assert_equals(table.getElementsByTagName("tr")[0].id, "first");
+ assert_equals(table.getElementsByTagName("tr")[1].id, "");
+ assert_equals(table.getElementsByTagName("tr")[2].id, "second");
+ }, "insertRow should insert a tr element before the second row")
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/remove-row.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/remove-row.html
new file mode 100644
index 000000000..b0e529f91
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/remove-row.html
@@ -0,0 +1,50 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Delete Row tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<table id="element">
+ <thead>
+ <th>First column</th>
+ <th>Second column</th>
+ </thead>
+ <tbody>
+ <tr>
+ <td>1.1</td>
+ <td>1.2</td>
+ </tr>
+ <tr>
+ <td>2.1</td>
+ <td>2.2</td>
+ </tr>
+ </tbody>
+</table>
+
+<script>
+var el = document.getElementById('element');
+
+test(function() {
+ assert_throws("IndexSizeError", function() {
+ el.deleteRow(-2)
+ })
+}, 'deleteRow function invalid argument');
+test(function() {
+ assert_throws("IndexSizeError", function() {
+ el.deleteRow(el.rows.length)
+ })
+}, 'deleteRow function invalid argument bis');
+
+test(function() {
+ var old_length = el.rows.length;
+ el.insertRow(-1);
+ el.deleteRow(-1);
+ assert_equals(old_length, el.rows.length);
+}, "check normal deleteRow");
+test(function() {
+ while (el.rows.length > 1) {
+ el.deleteRow(-1);
+ }
+ assert_equals(1, el.rows.length);
+}, "check normal deleteRow bis");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/tBodies.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/tBodies.html
new file mode 100644
index 000000000..128dbc9f7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/tBodies.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>HTMLTableElement.tBodies</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var text =
+ '<html xmlns="http://www.w3.org/1999/xhtml">' +
+ ' <head>' +
+ ' <title>Virtual Library</title>' +
+ ' </head>' +
+ ' <body>' +
+ ' <table id="mytable" border="1">' +
+ ' <tbody>' +
+ ' <tr><td>Cell 1</td><td>Cell 2</td></tr>' +
+ ' <tr><td>Cell 3</td><td>Cell 4</td></tr>' +
+ ' </tbody>' +
+ ' </table>' +
+ ' </body>' +
+ '</html>';
+
+ var parser = new DOMParser();
+ var doc = parser.parseFromString(text, "text/xml");
+
+ // import <table>
+ var table = doc.documentElement.getElementsByTagName('table')[0];
+ var mytable = document.body.appendChild(document.importNode(table, true));
+
+ assert_equals(mytable.tBodies.length, 1);
+ var tbody = document.createElement('tbody');
+ mytable.appendChild(tbody);
+ var tr = tbody.insertRow(-1);
+ tr.insertCell(-1).appendChild(document.createTextNode('Cell 5'));
+ tr.insertCell(-1).appendChild(document.createTextNode('Cell 6'));
+ assert_equals(mytable.tBodies.length, 2);
+ assert_equals(mytable.rows.length, 3);
+ assert_equals(tr.rowIndex, 2);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/tFoot.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/tFoot.html
new file mode 100644
index 000000000..d06e16f20
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/tFoot.html
@@ -0,0 +1,57 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>tFoot tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<table id="t">
+<caption id="tcaption"></caption><thead id="thead"></thead><tbody id="tbody1"></tbody><tbody id="tbody2"></tbody><tfoot id="tfoot1"></tfoot><tfoot id="tfoot2"></tfoot><tfoot id="tfoot3"></tfoot></table>
+<script>
+test(function() {
+ var t = document.getElementById("t");
+ var tfoot1 = document.getElementById("tfoot1");
+
+ assert_equals(t.tFoot, tfoot1);
+
+ var tfoot2 = document.getElementById("tfoot2");
+ t.tFoot = null;
+
+ assert_equals(t.tFoot, tfoot2);
+
+ var tfoot3 = document.getElementById("tfoot3");
+ t.deleteTFoot();
+
+ assert_equals(t.tFoot, tfoot3);
+
+ var tfoot = t.createTFoot();
+ assert_equals(t.tFoot, tfoot);
+ assert_equals(tfoot, tfoot3);
+
+ t.deleteTFoot();
+ assert_equals(t.tFoot, null);
+
+ var tbody2 = document.getElementById("tbody2");
+
+ tfoot = t.createTFoot();
+ assert_equals(t.tFoot, tfoot);
+
+ assert_equals(t.tFoot.previousSibling, tbody2);
+ assert_equals(t.tFoot.nextSibling, null);
+
+ t.deleteTFoot();
+ assert_equals(t.tFoot, null);
+
+ t.tFoot = tfoot;
+ assert_equals(t.tFoot, tfoot);
+
+ assert_equals(t.tFoot.previousSibling, tbody2);
+ assert_equals(t.tFoot.nextSibling, null);
+
+ assert_throws(new TypeError(), function(){
+ t.tFoot = document.createElement("div");
+ });
+
+ assert_throws("HierarchyRequestError", function(){
+ t.tFoot = document.createElement("thead");
+ });
+})
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/tHead.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/tHead.html
new file mode 100644
index 000000000..ea2ebf128
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/tHead.html
@@ -0,0 +1,66 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>tHead tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<table id="t">
+<caption id="tcaption"></caption><thead id="thead1"></thead><thead id="thead2"></thead><thead id="thead3"></thead><tbody id="tbody1"></tbody><tbody id="tbody2"></tbody><tfoot id="tfoot"></tfoot>
+</table>
+<table>
+<thead id="t2thead">
+<td>
+<table id="t2">
+</table>
+</table>
+<script>
+test(function() {
+ var t = document.getElementById("t");
+ var thead1 = document.getElementById("thead1");
+
+ assert_equals(t.tHead, thead1);
+
+ var thead2 = document.getElementById("thead2");
+ t.tHead = null;
+
+ assert_equals(t.tHead, thead2);
+
+ var thead3 = document.getElementById("thead3");
+ t.deleteTHead();
+
+ assert_equals(t.tHead, thead3);
+
+ var thead = t.createTHead();
+ assert_equals(t.tHead, thead);
+ assert_equals(thead, thead3);
+
+ t.deleteTHead();
+ assert_equals(t.tHead, null);
+
+ var tcaption = document.getElementById("tcaption");
+ var tbody1 = document.getElementById("tbody1");
+
+ thead = t.createTHead();
+ assert_equals(t.tHead, thead);
+
+ assert_equals(t.tHead.previousSibling, tcaption);
+ assert_equals(t.tHead.nextSibling, tbody1);
+
+ assert_throws(new TypeError(), function(){
+ t.tHead = document.createElement("div");
+ });
+
+ assert_throws("HierarchyRequestError", function(){
+ t.tHead = document.createElement("tbody");
+ });
+
+});
+
+test(function() {
+ var t2 = document.getElementById("t2");
+ var t2thead = document.getElementById("t2thead");
+
+ assert_throws("HierarchyRequestError", function() {
+ t2.tHead = t2thead;
+ });
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/table-insertRow.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/table-insertRow.html
new file mode 100644
index 000000000..8a9574ecd
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/table-insertRow.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>HTMLTableElement.insertRow</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var HTMLNS = "http://www.w3.org/1999/xhtml"
+ var parentEl = document.createElementNS(HTMLNS, "html:table")
+ assert_equals(parentEl.namespaceURI, HTMLNS, "Parent should be in the HTML namespace")
+ assert_equals(parentEl.prefix, "html", "Parent prefix should be html")
+ assert_equals(parentEl.localName, "table", "Parent local name should be table")
+ assert_equals(parentEl.tagName, "HTML:TABLE", "Parent tag name should be HTML:TABLE")
+
+ var row = parentEl.insertRow(-1)
+ assert_equals(row.namespaceURI, HTMLNS, "Row should be in the HTML namespace")
+ assert_equals(row.prefix, null, "Row prefix should be null")
+ assert_equals(row.localName, "tr", "Row local name should be tr")
+ assert_equals(row.tagName, "TR", "Row tag name should be TR")
+
+ var body = row.parentNode
+ assert_equals(body.namespaceURI, HTMLNS, "Body should be in the HTML namespace")
+ assert_equals(body.prefix, null, "Body prefix should be null")
+ assert_equals(body.localName, "tbody", "Body local name should be tr")
+ assert_equals(body.tagName, "TBODY", "Body tag name should be TR")
+
+ assert_array_equals(parentEl.childNodes, [body])
+ assert_array_equals(body.childNodes, [row])
+ assert_array_equals(parentEl.rows, [row])
+}, "insertRow should not copy prefixes")
+test(function() {
+ var table = document.createElement("table")
+ var head = table.appendChild(document.createElement("thead"))
+ assert_array_equals(table.rows, [])
+
+ var row = table.insertRow(-1)
+ var body = row.parentNode
+ assert_array_equals(table.childNodes, [head, body])
+ assert_array_equals(head.childNodes, [])
+ assert_array_equals(body.childNodes, [row])
+ assert_array_equals(table.rows, [row])
+}, "insertRow should insert into a tbody, not into a thead, if table.rows is empty")
+test(function() {
+ var table = document.createElement("table")
+ var foot = table.appendChild(document.createElement("tfoot"))
+ assert_array_equals(table.rows, [])
+
+ var row = table.insertRow(-1)
+ var body = row.parentNode
+ assert_array_equals(table.childNodes, [foot, body])
+ assert_array_equals(foot.childNodes, [])
+ assert_array_equals(body.childNodes, [row])
+ assert_array_equals(table.rows, [row])
+}, "insertRow should insert into a tbody, not into a tfoot, if table.rows is empty")
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/table-rows.html b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/table-rows.html
new file mode 100644
index 000000000..8bc23d5a7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-table-element/table-rows.html
@@ -0,0 +1,234 @@
+<!DOCTYPE html>
+<title>HTMLTableElement.rows</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+function assert_nodelist_equals(actual, expected) {
+ assert_equals(actual.length, expected.length);
+
+ for (var i = 0; i < actual.length; ++i) {
+ assert_true(i in actual);
+ assert_true(actual.hasOwnProperty(i),
+ "property " + i + " expected to be present on the object");
+ assert_equals(actual.item(i), expected[i]);
+ assert_equals(actual[i], expected[i]);
+ }
+}
+
+function test_table_simple(group, table) {
+ var foo1 = group.appendChild(document.createElement("tr"));
+ foo1.id = "foo";
+ var bar1 = group.appendChild(document.createElement("tr"));
+ bar1.id = "bar";
+ var foo2 = group.appendChild(document.createElement("tr"));
+ foo2.id = "foo";
+ var bar2 = group.appendChild(document.createElement("tr"));
+ bar2.id = "bar";
+
+ assert_true(table.rows instanceof HTMLCollection, "table.rows should be a HTMLCollection.");
+ assert_nodelist_equals(table.rows, [foo1, bar1, foo2, bar2]);
+ assert_equals(table.rows.foo, foo1);
+ assert_equals(table.rows["foo"], foo1);
+ assert_equals(table.rows.namedItem("foo"), foo1);
+ assert_equals(table.rows.bar, bar1);
+ assert_equals(table.rows["bar"], bar1);
+ assert_equals(table.rows.namedItem("bar"), bar1);
+ assert_array_equals(Object.getOwnPropertyNames(table.rows), [
+ "0",
+ "1",
+ "2",
+ "3",
+ "foo",
+ "bar"
+ ]);
+}
+test(function() {
+ var table = document.createElement("table");
+ test_table_simple(table, table);
+}, "Children of table");
+test(function() {
+ var table = document.createElement("table");
+ var group = table.appendChild(document.createElement("thead"));
+ test_table_simple(group, table);
+}, "Children of thead");
+test(function() {
+ var table = document.createElement("table");
+ var group = table.appendChild(document.createElement("tbody"));
+ test_table_simple(group, table);
+}, "Children of tbody");
+test(function() {
+ var table = document.createElement("table");
+ var group = table.appendChild(document.createElement("tfoot"));
+ test_table_simple(group, table);
+}, "Children of tfoot");
+test(function() {
+ var table = document.createElement("table");
+ var orphan1 = table.appendChild(document.createElement("tr"));
+ orphan1.id = "orphan1";
+ var foot1 = table.appendChild(document.createElement("tfoot"));
+ var orphan2 = table.appendChild(document.createElement("tr"));
+ orphan2.id = "orphan2";
+ var foot2 = table.appendChild(document.createElement("tfoot"));
+ var orphan3 = table.appendChild(document.createElement("tr"));
+ orphan3.id = "orphan3";
+ var body1 = table.appendChild(document.createElement("tbody"));
+ var orphan4 = table.appendChild(document.createElement("tr"));
+ orphan4.id = "orphan4";
+ var body2 = table.appendChild(document.createElement("tbody"));
+ var orphan5 = table.appendChild(document.createElement("tr"));
+ orphan5.id = "orphan5";
+ var head1 = table.appendChild(document.createElement("thead"));
+ var orphan6 = table.appendChild(document.createElement("tr"));
+ orphan6.id = "orphan6";
+ var head2 = table.appendChild(document.createElement("thead"));
+ var orphan7 = table.appendChild(document.createElement("tr"));
+ orphan7.id = "orphan7";
+
+ var foot1row1 = foot1.appendChild(document.createElement("tr"));
+ foot1row1.id = "foot1row1";
+ var foot1row2 = foot1.appendChild(document.createElement("tr"));
+ foot1row2.id = "foot1row2";
+ var foot2row1 = foot2.appendChild(document.createElement("tr"));
+ foot2row1.id = "foot2row1";
+ var foot2row2 = foot2.appendChild(document.createElement("tr"));
+ foot2row2.id = "foot2row2";
+
+ var body1row1 = body1.appendChild(document.createElement("tr"));
+ body1row1.id = "body1row1";
+ var body1row2 = body1.appendChild(document.createElement("tr"));
+ body1row2.id = "body1row2";
+ var body2row1 = body2.appendChild(document.createElement("tr"));
+ body2row1.id = "body2row1";
+ var body2row2 = body2.appendChild(document.createElement("tr"));
+ body2row2.id = "body2row2";
+
+ var head1row1 = head1.appendChild(document.createElement("tr"));
+ head1row1.id = "head1row1";
+ var head1row2 = head1.appendChild(document.createElement("tr"));
+ head1row2.id = "head1row2";
+ var head2row1 = head2.appendChild(document.createElement("tr"));
+ head2row1.id = "head2row1";
+ var head2row2 = head2.appendChild(document.createElement("tr"));
+ head2row2.id = "head2row2";
+
+ // These elements should not end up in any collection.
+ table.appendChild(document.createElement("div"))
+ .appendChild(document.createElement("tr"));
+ foot1.appendChild(document.createElement("div"))
+ .appendChild(document.createElement("tr"));
+ body1.appendChild(document.createElement("div"))
+ .appendChild(document.createElement("tr"));
+ head1.appendChild(document.createElement("div"))
+ .appendChild(document.createElement("tr"));
+ table.appendChild(document.createElementNS("http://example.com/test", "tr"));
+ foot1.appendChild(document.createElementNS("http://example.com/test", "tr"));
+ body1.appendChild(document.createElementNS("http://example.com/test", "tr"));
+ head1.appendChild(document.createElementNS("http://example.com/test", "tr"));
+
+ assert_true(table.rows instanceof HTMLCollection, "table.rows should be a HTMLCollection.");
+ assert_nodelist_equals(table.rows, [
+ // thead
+ head1row1,
+ head1row2,
+ head2row1,
+ head2row2,
+
+ // tbody + table
+ orphan1,
+ orphan2,
+ orphan3,
+ body1row1,
+ body1row2,
+ orphan4,
+ body2row1,
+ body2row2,
+ orphan5,
+ orphan6,
+ orphan7,
+
+ // tfoot
+ foot1row1,
+ foot1row2,
+ foot2row1,
+ foot2row2
+ ]);
+ assert_array_equals(Object.getOwnPropertyNames(table.rows), [
+ "0",
+ "1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7",
+ "8",
+ "9",
+ "10",
+ "11",
+ "12",
+ "13",
+ "14",
+ "15",
+ "16",
+ "17",
+ "18",
+ "head1row1",
+ "head1row2",
+ "head2row1",
+ "head2row2",
+ "orphan1",
+ "orphan2",
+ "orphan3",
+ "body1row1",
+ "body1row2",
+ "orphan4",
+ "body2row1",
+ "body2row2",
+ "orphan5",
+ "orphan6",
+ "orphan7",
+ "foot1row1",
+ "foot1row2",
+ "foot2row1",
+ "foot2row2"
+ ]);
+
+ var ids = [
+ "orphan1",
+ "orphan2",
+ "orphan3",
+ "orphan4",
+ "orphan5",
+ "orphan6",
+ "orphan7",
+ "foot1row1",
+ "foot1row2",
+ "foot2row1",
+ "foot2row2",
+ "body1row1",
+ "body1row2",
+ "body2row1",
+ "body2row2",
+ "head1row1",
+ "head1row2",
+ "head2row1",
+ "head2row2"
+ ];
+ ids.forEach(function(id) {
+ assert_equals(table.rows.namedItem(id).id, id);
+ assert_true(id in table.rows);
+ assert_equals(table.rows[id].id, id);
+ assert_true(id in table.rows);
+ });
+ while (table.firstChild) {
+ table.removeChild(table.firstChild);
+ }
+ ids.forEach(function(id) {
+ assert_equals(table.rows.namedItem(id), null);
+ assert_false(id in table.rows);
+ assert_equals(table.rows[id], undefined);
+ assert_false(id in table.rows);
+ });
+}, "Complicated case");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/deleteRow.html b/testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/deleteRow.html
new file mode 100644
index 000000000..c81abd826
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/deleteRow.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTMLTableSectionElement#deleteRow</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<div id ="log"></div>
+
+<table>
+ <tbody id="testBody">
+ <tr><td>ABCDEF</td></tr>
+ <tr><td>12345</td></tr>
+ <tr><td>ABC12345DEF</td></tr>
+ </tbody>
+</table>
+
+<script>
+
+var tbody = document.getElementById("testBody");
+
+test(function () {
+ tbody.deleteRow(0);
+ assert_equals(tbody.rows.length, 2);
+ assert_equals(tbody.rows[0].childNodes[0].innerHTML, "12345");
+}, "HTMLTableSectionElement deleteRow(0)");
+
+test(function () {
+ tbody.deleteRow(-1);
+ assert_equals(tbody.rows.length, 1);
+ assert_equals(tbody.rows[0].childNodes[0].innerHTML, "12345");
+}, "HTMLTableSectionElement deleteRow(-1)");
+
+test(function () {
+ assert_throws("IndexSizeError", function () {
+ tbody.deleteRow(tbody.rows.length);
+ });
+}, "HTMLTableSectionElement deleteRow(rows.length)");
+
+test(function () {
+ assert_throws("IndexSizeError", function () {
+ tbody.deleteRow(-2);
+ });
+}, "HTMLTableSectionElement deleteRow(-2)");
+
+test(function () {
+ assert_equals(tbody.rows.length, 1);
+ tbody.deleteRow(-1);
+ assert_equals(tbody.rows.length, 0);
+ tbody.deleteRow(-1);
+ assert_equals(tbody.rows.length, 0);
+}, "HTMLTableSectionElement deleteRow(-1) with no rows");
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/insertRow.html b/testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/insertRow.html
new file mode 100644
index 000000000..4c13db7aa
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/insertRow.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTMLTableSectionElement#insertRow</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<div id ="log"></div>
+
+<table>
+ <tbody id="testBody">
+ <tr><td>ABCDEF</td></tr>
+ </tbody>
+</table>
+
+<script>
+
+var tbody = document.getElementById("testBody");
+
+test(function () {
+ var trEle = tbody.insertRow(0);
+ assert_equals(tbody.rows[0], trEle);
+ assert_equals(tbody.rows.length, 2);
+}, "HTMLTableSectionElement insertRow(0)");
+
+test(function () {
+ var trEle = tbody.insertRow(-1);
+ assert_equals(tbody.rows[tbody.rows.length - 1], trEle);
+ assert_equals(tbody.rows.length, 3);
+}, "HTMLTableSectionElement insertRow(-1)");
+
+test(function () {
+ var trEle = tbody.insertRow();
+ assert_equals(tbody.rows[tbody.rows.length - 1], trEle);
+ assert_equals(tbody.rows.length, 4);
+}, "HTMLTableSectionElement insertRow()");
+
+test(function () {
+ var trEle = tbody.insertRow(tbody.rows.length);
+ assert_equals(tbody.rows[tbody.rows.length - 1], trEle);
+ assert_equals(tbody.rows.length, 5);
+}, "HTMLTableSectionElement insertRow(rows.length)");
+
+test(function () {
+ assert_throws("IndexSizeError", function () {
+ tbody.insertRow(-2);
+ });
+}, "HTMLTableSectionElement insertRow(-2)");
+
+test(function () {
+ assert_throws("IndexSizeError", function () {
+ tbody.insertRow(tbody.rows.length + 1);
+ });
+}, "HTMLTableSectionElement insertRow(rows.length + 1)");
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/rows.html b/testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/rows.html
new file mode 100644
index 000000000..eb155de77
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-tbody-element/rows.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>'tbody' element, 'rows' attribute</title>
+<link rel="author" title="Corey Farwell" href="mailto:coreyf@rwell.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/semantics/tabular-data/html-table-section-element.js"></script>
+
+<div id ="log"></div>
+
+<script>
+test(function () {
+ testRowsAttribute('tbody');
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-td-element/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/the-td-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-td-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-tfoot-element/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/the-tfoot-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-tfoot-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-tfoot-element/rows.html b/testing/web-platform/tests/html/semantics/tabular-data/the-tfoot-element/rows.html
new file mode 100644
index 000000000..fe70d6f28
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-tfoot-element/rows.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>'tfoot' element, 'rows' attribute</title>
+<link rel="author" title="Corey Farwell" href="mailto:coreyf@rwell.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/semantics/tabular-data/html-table-section-element.js"></script>
+
+<div id ="log"></div>
+
+<script>
+test(function () {
+ testRowsAttribute('tfoot');
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-th-element/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/the-th-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-th-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-thead-element/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/the-thead-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-thead-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-thead-element/rows.html b/testing/web-platform/tests/html/semantics/tabular-data/the-thead-element/rows.html
new file mode 100644
index 000000000..7830281a0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-thead-element/rows.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>'thead' element, 'rows' attribute</title>
+<link rel="author" title="Corey Farwell" href="mailto:coreyf@rwell.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/semantics/tabular-data/html-table-section-element.js"></script>
+
+<div id ="log"></div>
+
+<script>
+test(function () {
+ testRowsAttribute('thead');
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/cells.html b/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/cells.html
new file mode 100644
index 000000000..2678d3b1c
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/cells.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTMLTableRowElement#cells</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<div id="log"></div>
+
+<table>
+ <tr id="testTr">
+ <td>First</td>
+ <div><td>Second</td></div>
+ <td>Third
+ <table>
+ <tr><td>Nested first</td></tr>
+ </table>
+ </td>
+ <img>
+ </tr>
+</table>
+<script>
+var tr = document.getElementById("testTr");
+
+test(function () {
+ tr.insertBefore(document.createElementNS("foo", "td"), tr.children[1]);
+ assert_array_equals(tr.cells, [tr.children[0], tr.children[2], tr.children[3]]);
+}, "HTMLTableRowElement cells ignores nested tables and non-HTML elements");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/deleteCell.html b/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/deleteCell.html
new file mode 100644
index 000000000..1400d32e1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/deleteCell.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTMLTableRowElement#deleteCell</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<div id="log"></div>
+
+<table>
+ <tr id="testTr">
+ <td>ABCDE</td>
+ <td>12345</td>
+ <td>ABC12</td>
+ </tr>
+</table>
+
+<script>
+
+var tr = document.getElementById("testTr");
+
+test(function () {
+ tr.deleteCell(0);
+ assert_equals(tr.cells[0].innerHTML, "12345");
+ assert_equals(tr.cells.length, 2);
+}, "HTMLTableRowElement deleteCell(0)");
+
+test(function () {
+ tr.deleteCell(-1);
+ assert_equals(tr.cells[tr.cells.length - 1].innerHTML, "12345");
+ assert_equals(tr.cells.length, 1);
+}, "HTMLTableRowElement deleteCell(-1)");
+
+test(function () {
+ assert_throws("IndexSizeError", function () {
+ tr.deleteCell(-2);
+ });
+}, "HTMLTableRowElement deleteCell(-2)");
+
+test(function () {
+ assert_throws("IndexSizeError", function () {
+ tr.deleteCell(tr.cells.length);
+ });
+}, "HTMLTableRowElement deleteCell(cells.length)");
+
+test(function () {
+ assert_equals(tr.cells.length, 1);
+ tr.deleteCell(-1);
+ assert_equals(tr.cells.length, 0);
+ tr.deleteCell(-1);
+ assert_equals(tr.cells.length, 0);
+}, "HTMLTableRowElement deleteCell(-1) with no cells");
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/insertCell.html b/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/insertCell.html
new file mode 100644
index 000000000..07eac1efb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/insertCell.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTMLTableRowElement#insertCell</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<div id="log"></div>
+
+<table>
+ <tr id="testTr"></tr>
+</table>
+
+<script>
+
+var tr = document.getElementById("testTr");
+
+test(function () {
+ var tdEle = tr.insertCell(0);
+ assert_equals(tr.cells[0], tdEle);
+ assert_equals(tr.cells.length, 1);
+}, "HTMLTableRowElement insertCell(0)");
+
+test(function () {
+ var tdEle = tr.insertCell(-1);
+ assert_equals(tr.cells[tr.cells.length - 1], tdEle);
+ assert_equals(tr.cells.length, 2);
+}, "HTMLTableRowElement insertCell(-1)");
+
+
+test(function () {
+ var tdEle = tr.insertCell(tr.cells.length);
+ assert_equals(tr.cells[tr.cells.length - 1], tdEle);
+ assert_equals(tr.cells.length, 3);
+}, "HTMLTableRowElement insertCell(cells.length)");
+
+test(function () {
+ var tdEle = tr.insertCell();
+ assert_equals(tr.cells[tr.cells.length - 1], tdEle);
+ assert_equals(tr.cells.length, 4);
+}, "HTMLTableRowElement insertCell()");
+
+test(function () {
+ assert_throws("IndexSizeError", function () {
+ tr.insertCell(-2);
+ });
+}, "HTMLTableRowElement insertCell(-2)");
+
+test(function () {
+ assert_throws("IndexSizeError", function () {
+ tr.insertCell(tr.cells.length + 1);
+ });
+}, "HTMLTableRowElement insertCell(cells.length + 1)");
+
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/rowIndex.html b/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/rowIndex.html
new file mode 100644
index 000000000..117712563
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/rowIndex.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<title>HTMLTableRowElement.rowIndex</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var row = document.createElement("table")
+ .appendChild(document.createElement("div"))
+ .appendChild(document.createElement("tr"));
+ assert_equals(row.rowIndex, -1);
+});
+test(function() {
+ var row = document.createElement("table")
+ .appendChild(document.createElement("thead"))
+ .appendChild(document.createElement("tr"));
+ assert_equals(row.rowIndex, 0);
+});
+test(function() {
+ var row = document.createElement("table")
+ .appendChild(document.createElement("tbody"))
+ .appendChild(document.createElement("tr"));
+ assert_equals(row.rowIndex, 0);
+});
+test(function() {
+ var row = document.createElement("table")
+ .appendChild(document.createElement("tfoot"))
+ .appendChild(document.createElement("tr"));
+ assert_equals(row.rowIndex, 0);
+});
+test(function() {
+ var row = document.createElement("table")
+ .appendChild(document.createElement("tr"));
+ assert_equals(row.rowIndex, 0);
+});
+test(function() {
+ var row = document.createElementNS("", "table")
+ .appendChild(document.createElement("thead"))
+ .appendChild(document.createElement("tr"));
+ assert_equals(row.rowIndex, -1);
+});
+test(function() {
+ var row = document.createElementNS("", "table")
+ .appendChild(document.createElement("tbody"))
+ .appendChild(document.createElement("tr"));
+ assert_equals(row.rowIndex, -1);
+});
+test(function() {
+ var row = document.createElementNS("", "table")
+ .appendChild(document.createElement("tfoot"))
+ .appendChild(document.createElement("tr"));
+ assert_equals(row.rowIndex, -1);
+});
+test(function() {
+ var row = document.createElementNS("", "table")
+ .appendChild(document.createElement("tr"));
+ assert_equals(row.rowIndex, -1);
+});
+test(function() {
+ var row = document.createElement("table")
+ .appendChild(document.createElementNS("", "thead"))
+ .appendChild(document.createElement("tr"));
+ assert_equals(row.rowIndex, -1);
+});
+test(function() {
+ var row = document.createElement("table")
+ .appendChild(document.createElementNS("", "tbody"))
+ .appendChild(document.createElement("tr"));
+ assert_equals(row.rowIndex, -1);
+});
+test(function() {
+ var row = document.createElement("table")
+ .appendChild(document.createElementNS("", "tfoot"))
+ .appendChild(document.createElement("tr"));
+ assert_equals(row.rowIndex, -1);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/sectionRowIndex.html b/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/sectionRowIndex.html
new file mode 100644
index 000000000..ef5366739
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-tr-element/sectionRowIndex.html
@@ -0,0 +1,130 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>HTMLTableRowElement.sectionRowIndex</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<table>
+ <thead>
+ <tr id="ht1"></tr>
+ </thead>
+ <tr id="t1"></tr>
+ <tr id="t2">
+ <td>
+ <table>
+ <thead>
+ <tr id="nht1"></tr>
+ </thead>
+ <tr></tr>
+ <tr id="nt1"></tr>
+ <tbody>
+ <tr id="nbt1"></tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tbody>
+ <tr></tr>
+ <tr id="bt1"></tr>
+ </tbody>
+ <tfoot>
+ <tr></tr>
+ <tr></tr>
+ <tr id="ft1"></tr>
+ </tfoot>
+</table>
+
+<script>
+test(function() {
+ var tHeadRow = document.getElementById('ht1');
+ assert_equals(tHeadRow.sectionRowIndex, 0);
+}, "Row in thead in HTML");
+
+test(function() {
+ var tRow1 = document.getElementById('t1');
+ assert_equals(tRow1.sectionRowIndex, 0);
+}, "Row in implicit tbody in HTML");
+
+test(function() {
+ var tRow2 = document.getElementById('t2');
+ assert_equals(tRow2.sectionRowIndex, 1);
+}, "Other row in implicit tbody in HTML");
+
+test(function() {
+ var tBodyRow = document.getElementById('bt1');
+ assert_equals(tBodyRow.sectionRowIndex, 1);
+}, "Row in explicit tbody in HTML");
+
+test(function() {
+ var tFootRow = document.getElementById('ft1');
+ assert_equals(tFootRow.sectionRowIndex, 2);
+}, "Row in tfoot in HTML");
+
+test(function() {
+ var childHeadRow = document.getElementById('nht1');
+ assert_equals(childHeadRow.sectionRowIndex, 0);
+}, "Row in thead in nested table in HTML");
+
+test(function() {
+ var childRow = document.getElementById('nt1');
+ assert_equals(childRow.sectionRowIndex, 1);
+}, "Row in implicit tbody in nested table in HTML");
+
+test(function() {
+ var childBodyRow = document.getElementById('nbt1');
+ assert_equals(childBodyRow.sectionRowIndex, 0);
+}, "Row in explicit tbody in nested table in HTML");
+
+/* script create element test */
+var mkTrElm = function (elst) {
+ var elm = document.createElement("table");
+ elst.forEach(function(item) {
+ elm = elm.appendChild(document.createElement(item));
+ });
+ return elm.appendChild(document.createElement("tr"));
+};
+
+test(function() {
+ assert_equals(mkTrElm([]).sectionRowIndex, 0);
+}, "Row in script-created table");
+
+test(function() {
+ assert_equals(mkTrElm(["div"]).sectionRowIndex, -1);
+}, "Row in script-created div in table");
+
+test(function() {
+ assert_equals(mkTrElm(["thead"]).sectionRowIndex, 0);
+}, "Row in script-created thead in table");
+
+test(function() {
+ assert_equals(mkTrElm(["tbody"]).sectionRowIndex, 0);
+}, "Row in script-created tbody in table");
+
+test(function() {
+ assert_equals(mkTrElm(["tfoot"]).sectionRowIndex, 0);
+}, "Row in script-created tfoot in table");
+
+test(function() {
+ assert_equals(mkTrElm(["tbody", "tr"]).sectionRowIndex, -1);
+}, "Row in script-created tr in tbody in table");
+
+test(function() {
+ assert_equals(mkTrElm(["tbody", "tr", "td"]).sectionRowIndex, -1);
+}, "Row in script-created td in tr in tbody in table");
+
+test(function() {
+ assert_equals(mkTrElm(["tbody", "tr", "td", "table"]).sectionRowIndex, 0);
+}, "Row in script-created nested table");
+
+test(function() {
+ assert_equals(mkTrElm(["tbody", "tr", "td", "table", "thead"]).sectionRowIndex, 0);
+}, "Row in script-created thead in nested table");
+
+test(function() {
+ assert_equals(mkTrElm(["tbody", "tr", "td", "table", "tbody"]).sectionRowIndex, 0);
+}, "Row in script-created tbody in nested table");
+
+test(function() {
+ assert_equals(mkTrElm(["tbody", "tr", "td", "table", "tfoot"]).sectionRowIndex, 0);
+}, "Row in script-created tfoot in nested table");
+</script>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/historical.html b/testing/web-platform/tests/html/semantics/text-level-semantics/historical.html
new file mode 100644
index 000000000..9de09fe5b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/historical.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<title>Historical text-level element features should not be supported</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+function t(property, tagNames) {
+ if (typeof tagNames === "string") {
+ tagNames = [tagNames];
+ }
+ tagNames.forEach(function(tagName) {
+ test(function() {
+ assert_false(property in document.createElement(tagName));
+ }, tagName + '.' + property + ' should not be supported');
+ });
+}
+
+// <area> and <link> are in other sections in the spec, but we'll test them here together with <a>
+
+// removed in https://github.com/whatwg/html/commit/790479ab1ba143efc27d1f92cd0465627df48fb0
+t('hreflang', 'area');
+t('type', 'area');
+
+// renamed to dateTime in https://github.com/whatwg/html/commit/8b6732237c7021cd61e3c3463146234ca8ce5bad
+t('datetime', 'time');
+
+// removed in https://github.com/whatwg/html/commit/66fcb2357f205448fe2f40d7834a1e8ea2ed283b
+t('media', ['a', 'area']);
+
+// renamed to noreferrer in https://github.com/whatwg/html/commit/6a34274e99593e767ae99744a6c38a19489915c6
+t('noreferer', ['link', 'a', 'area']);
+</script>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-stringifier.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-stringifier.html
new file mode 100644
index 000000000..fb0780dee
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-stringifier.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<title>HTMLAnchorElement stringifier</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://heycam.github.io/webidl/#es-stringifier">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=/common/stringifiers.js></script>
+<div id=log></div>
+<script>
+test(function() {
+ test_stringifier_attribute(document.createElement("a"), "href", false);
+ var a = document.createElement("a");
+ a.setAttribute("href", "foo");
+ test_stringifier_attribute(a, "href", false);
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-getter-01.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-getter-01.html
new file mode 100644
index 000000000..e0bb73be0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-getter-01.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>HTMLAnchorElement.text getting</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-a-text">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>var b</script>
+<div id="test">
+<a href="a">a b c </a>
+<a href="b">a <!--b-->b c </a>
+<a href="c">a <b>b</b> c </a>
+<a href="d">a <script>b</script> c </a>
+<script>
+var e = document.getElementById("test")
+ .appendChild(document.createElement("a"));
+e.href = "d";
+e.appendChild(document.createTextNode("a "));
+e.appendChild(document.createTextNode("b "));
+e.appendChild(document.createTextNode("c "));
+</script>
+</div>
+<script>
+test(function() {
+ var list = document.getElementById("test")
+ .getElementsByTagName("a");
+ for (var i = 0, il = list.length; i < il; ++i) {
+ test(function() {
+ assert_equals(list[i].text, list[i].textContent);
+ assert_equals(list[i].text, "a b c ");
+ }, "Test for anchor " + i);
+ }
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-setter-01.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-setter-01.html
new file mode 100644
index 000000000..879a9e3d0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-setter-01.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>HTMLAnchorElement.text setting</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-a-text">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<div id="test">
+<a href="a">a b c</a>
+<a href="b">a <!--b--> c</a>
+<a href="c">a <b>b</b> c</a>
+<script>
+var d = document.getElementById("test")
+ .appendChild(document.createElement("a"));
+d.href = "d";
+d.appendChild(document.createTextNode("a "));
+d.appendChild(document.createTextNode("b "));
+d.appendChild(document.createTextNode("c "));
+</script>
+</div>
+<script>
+test(function() {
+ var list = document.getElementById("test")
+ .getElementsByTagName("a");
+ for (var i = 0, il = list.length; i < il; ++i) {
+ test(function() {
+ list[i].text = "x";
+ assert_equals(list[i].text, "x");
+ assert_equals(list[i].textContent, "x");
+ assert_equals(list[i].firstChild.data, "x");
+ assert_equals(list[i].childNodes.length, 1);
+
+ list[i].textContent = "y";
+ assert_equals(list[i].text, "y");
+ assert_equals(list[i].textContent, "y");
+ assert_equals(list[i].firstChild.data, "y");
+ assert_equals(list[i].childNodes.length, 1);
+ }, "Test for anchor " + i);
+ }
+});
+</script>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-abbr-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-abbr-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-abbr-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-b-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-b-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-b-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default-ref.html
new file mode 100644
index 000000000..eff61bb41
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 500px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;[:)], [+- a &#x05D1;], [d &#x05D2; 1]...&#x202C;</div>
+ <div dir="rtl">&#x202D;...[d &#x05D2; 1] ,[+- a &#x05D1;] ,[:)]&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;[:)], [+- a &#x05D1;], [d &#x05D2; 1]...&#x202C;</div>
+ <div dir="rtl">&#x202D;...[d &#x05D2; 1] ,[+- a &#x05D1;] ,[:)]&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html
new file mode 100644
index 000000000..e658500a4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: has dir=auto by default</title>
+ <link rel="match" href="bdi-auto-dir-default-ref.html"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'The dir global attribute defaults to auto on this element (it never inherits from the parent
+ element like with other elements).'"/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 500px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ In each DIV of the test:
+ - the first BDI, having no characters with strong direction, should be LTR by default;
+ - the second BDI, having an LTR character first, should be LTR by default;
+ - the third BDI, having an RTL character first, should be RTL by default.
+ </div>
+ <div class="test">
+ <div dir="ltr"><bdi>[:)]</bdi>, <bdi>[+- a &#x05D1;]</bdi>, <bdi>[1 &#x05D2; d]</bdi>...</div>
+ <div dir="rtl"><bdi>[:)]</bdi>, <bdi>[+- a &#x05D1;]</bdi>, <bdi>[1 &#x05D2; d]</bdi>...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;[:)], [+- a &#x05D1;], [d &#x05D2; 1]...&#x202C;</div>
+ <div dir="rtl">&#x202D;...[d &#x05D2; 1] ,[+- a &#x05D1;] ,[:)]&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf-ref.html
new file mode 100644
index 000000000..b4d44c510
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf-ref.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;cb&#x05D0;de...&#x202C;</div>
+ <div dir="ltr">&#x202D;cb&#x05D0;de...&#x202C;</div>
+ <div dir="ltr">&#x202D;cb&#x05D0;de...&#x202C;</div>
+ <div dir="rtl">&#x202D;...&#x05D4;&#x05D3;a&#x05D1;&#x05D2;&#x202C;</div>
+ <div dir="rtl">&#x202D;...&#x05D4;&#x05D3;a&#x05D1;&#x05D2;&#x202C;</div>
+ <div dir="rtl">&#x202D;...&#x05D4;&#x05D3;a&#x05D1;&#x05D2;&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;cb&#x05D0;de...&#x202C;</div>
+ <div dir="ltr">&#x202D;cb&#x05D0;de...&#x202C;</div>
+ <div dir="ltr">&#x202D;cb&#x05D0;de...&#x202C;</div>
+ <div dir="rtl">&#x202D;...&#x05D4;&#x05D3;a&#x05D1;&#x05D2;&#x202C;</div>
+ <div dir="rtl">&#x202D;...&#x05D4;&#x05D3;a&#x05D1;&#x05D2;&#x202C;</div>
+ <div dir="rtl">&#x202D;...&#x05D4;&#x05D3;a&#x05D1;&#x05D2;&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf.html
new file mode 100644
index 000000000..1ce9da6b7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: neutral when contains LRO or RLO without PDF</title>
+ <link rel="match" href="bdi-neutral-missing-pdf-ref.html"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'
+ Thus, if a BDI contains LRO or RLO characters lacking a matching PDF, these must not affect
+ the visual ordering of the content outside the BDI."/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202E; - the RLO (right-to-left-override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO and RLO.
+ If the BDI in the test's first DIV were a SPAN, the RLO it contains, not being closed by a
+ PDF, would visually reorder the de into ed.
+ </div>
+ <div class="test">
+ <div dir="ltr"><bdi>&#x05D0;&#x202E;bc</bdi>de...</div>
+ <div dir="ltr"><bdi dir="ltr">&#x05D0;&#x202E;bc</bdi>de...</div>
+ <div dir="ltr"><bdi dir="rtl">&#x05D0;&#x202E;bc</bdi>de...</div>
+ <div dir="rtl"><bdi>a&#x202D;&#x05D1;&#x05D2;</bdi>&#x05D3;&#x05D4;...</div>
+ <div dir="rtl"><bdi dir="ltr">a&#x202D;&#x05D1;&#x05D2;</bdi>&#x05D3;&#x05D4;...</div>
+ <div dir="rtl"><bdi dir="rtl">a&#x202D;&#x05D1;&#x05D2;</bdi>&#x05D3;&#x05D4;...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;cb&#x05D0;de...&#x202C;</div>
+ <div dir="ltr">&#x202D;cb&#x05D0;de...&#x202C;</div>
+ <div dir="ltr">&#x202D;cb&#x05D0;de...&#x202C;</div>
+ <div dir="rtl">&#x202D;...&#x05D4;&#x05D3;a&#x05D1;&#x05D2;&#x202C;</div>
+ <div dir="rtl">&#x202D;...&#x05D4;&#x05D3;a&#x05D1;&#x05D2;&#x202C;</div>
+ <div dir="rtl">&#x202D;...&#x05D4;&#x05D3;a&#x05D1;&#x05D2;&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested-ref.html
new file mode 100644
index 000000000..d5d7674a4
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested-ref.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 500px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;1 + [a + [3 + [b + 4] + &#x05D1;] + 2] + &#x05D0;&#x202C;</div>
+ <div dir="ltr">&#x202D;1 + [a + [3 + [b + 4] + &#x05D1;] + 2] + &#x05D0;&#x202C;</div>
+ <div dir="ltr">&#x202D;1 + [a + [3 + [b + 4] + &#x05D1;] + 2] + &#x05D0;&#x202C;</div>
+ <div dir="rtl">&#x202D;a + [1 + [b + [3 + &#x05D1;] + 2] + &#x05D0;] + 0&#x202C;</div>
+ <div dir="rtl">&#x202D;a + [1 + [b + [3 + &#x05D1;] + 2] + &#x05D0;] + 0&#x202C;</div>
+ <div dir="rtl">&#x202D;a + [1 + [b + [3 + &#x05D1;] + 2] + &#x05D0;] + 0&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;1 + [a + [3 + [b + 4] + &#x05D1;] + 2] + &#x05D0;&#x202C;</div>
+ <div dir="ltr">&#x202D;1 + [a + [3 + [b + 4] + &#x05D1;] + 2] + &#x05D0;&#x202C;</div>
+ <div dir="ltr">&#x202D;1 + [a + [3 + [b + 4] + &#x05D1;] + 2] + &#x05D0;&#x202C;</div>
+ <div dir="rtl">&#x202D;a + [1 + [b + [3 + &#x05D1;] + 2] + &#x05D0;] + 0&#x202C;</div>
+ <div dir="rtl">&#x202D;a + [1 + [b + [3 + &#x05D1;] + 2] + &#x05D0;] + 0&#x202C;</div>
+ <div dir="rtl">&#x202D;a + [1 + [b + [3 + &#x05D1;] + 2] + &#x05D0;] + 0&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested.html
new file mode 100644
index 000000000..158576885
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: neutral when nested</title>
+ <link rel="match" href="bdi-neutral-nested-ref.html"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'
+ This must apply when a BDI is nested within a BDI."/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 500px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x05D0; + <bdi>[a + <bdi>[&#x05D1; + <bdi>[b + 4]</bdi> + 3]</bdi> + 2]</bdi> + 1</div>
+ <div dir="ltr">&#x05D0; + <bdi dir="rtl">[a + <bdi dir="ltr">[&#x05D1; + <bdi dir="rtl">[b + 4]</bdi> + 3]</bdi> + 2]</bdi> + 1</div>
+ <div dir="ltr">&#x05D0; + <bdi dir="ltr">[a + <bdi dir="rtl">[&#x05D1; + <bdi dir="ltr">[b + 4]</bdi> + 3]</bdi> + 2]</bdi> + 1</div>
+ <div dir="rtl">a + <bdi>[&#x05D0; + <bdi>[b + <bdi>[&#x05D1; + 3]</bdi> + 2]</bdi> + 1]</bdi> + 0</div>
+ <div dir="rtl">a + <bdi dir="ltr">[&#x05D0; + <bdi dir="rtl">[b + <bdi dir="ltr">[&#x05D1; + 3]</bdi> + 2]</bdi> + 1]</bdi> + 0</div>
+ <div dir="rtl">a + <bdi dir="rtl">[&#x05D0; + <bdi dir="ltr">[b + <bdi dir="rtl">[&#x05D1; + 3]</bdi> + 2]</bdi> + 1]</bdi> + 0</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;1 + [a + [3 + [b + 4] + &#x05D1;] + 2] + &#x05D0;&#x202C;</div>
+ <div dir="ltr">&#x202D;1 + [a + [3 + [b + 4] + &#x05D1;] + 2] + &#x05D0;&#x202C;</div>
+ <div dir="ltr">&#x202D;1 + [a + [3 + [b + 4] + &#x05D1;] + 2] + &#x05D0;&#x202C;</div>
+ <div dir="rtl">&#x202D;a + [1 + [b + [3 + &#x05D1;] + 2] + &#x05D0;] + 0&#x202C;</div>
+ <div dir="rtl">&#x202D;a + [1 + [b + [3 + &#x05D1;] + 2] + &#x05D0;] + 0&#x202C;</div>
+ <div dir="rtl">&#x202D;a + [1 + [b + [3 + &#x05D1;] + 2] + &#x05D0;] + 0&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number-ref.html
new file mode 100644
index 000000000..df7af7778
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number-ref.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;&#x05D0; - [1]...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0; - [1]...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0; - [1]...&#x202C;</div>
+ <div dir="rtl">&#x202D;...[1] - a&#x202C;</div>
+ <div dir="rtl">&#x202D;...[1] - a&#x202C;</div>
+ <div dir="rtl">&#x202D;...[1] - a&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0; - [1]...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0; - [1]...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0; - [1]...&#x202C;</div>
+ <div dir="rtl">&#x202D;...[1] - a&#x202C;</div>
+ <div dir="rtl">&#x202D;...[1] - a&#x202C;</div>
+ <div dir="rtl">&#x202D;...[1] - a&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number.html
new file mode 100644
index 000000000..37e467c17
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: neutral when number</title>
+ <link rel="match" href="bdi-neutral-number-ref.html"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ If the BDI in the test's first DIV were a SPAN, the 1 inside it would be visually ordered
+ to the left of the &#x05D0;.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x05D0; - <bdi>[1]</bdi>...</div>
+ <div dir="ltr">&#x05D0; - <bdi dir="ltr">[1]</bdi>...</div>
+ <div dir="ltr">&#x05D0; - <bdi dir="rtl">[1]</bdi>...</div>
+ <div dir="rtl">a - <bdi>[1]</bdi>...</div>
+ <div dir="rtl">a - <bdi dir="ltr">[1]</bdi>...</div>
+ <div dir="rtl">a - <bdi dir="rtl">[1]</bdi>...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0; - [1]...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0; - [1]...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0; - [1]...&#x202C;</div>
+ <div dir="rtl">&#x202D;...[1] - a&#x202C;</div>
+ <div dir="rtl">&#x202D;...[1] - a&#x202C;</div>
+ <div dir="rtl">&#x202D;...[1] - a&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate-ref.html
new file mode 100644
index 000000000..ec8e34627
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 500px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;&#x05D0; [1 b] c [d &#x05D4;] &#x05D5;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...f [e &#x05D3;] &#x05D2; [&#x05D1; 1] a&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0; [1 b] c [d &#x05D4;] &#x05D5;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...f [e &#x05D3;] &#x05D2; [&#x05D1; 1] a&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate.html
new file mode 100644
index 000000000..7bb8a2081
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: paragraph-level container</title>
+ <link rel="match" href="bdi-neutral-separate-ref.html"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'
+ Thus, under no circumstances should any part of the content outside a BDI be visually
+ reordered inside the BDI's content."/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 500px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ If the BDIs in the test's first DIV were just SPANs, the &#x05D0; would appear between the 1
+ and the b, and the &#x05D5; between the d and the &#x05D4;.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x05D0; <bdi>[1 b]</bdi> c <bdi>[d &#x05D4;]</bdi> &#x05D5;...</div>
+ <div dir="rtl">a <bdi>[1 &#x05D1;]</bdi> &#x05D2; <bdi>[&#x05D3; e]</bdi> f...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0; [1 b] c [d &#x05D4;] &#x05D5;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...f [e &#x05D3;] &#x05D2; [&#x05D1; 1] a&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1-ref.html
new file mode 100644
index 000000000..c0f323ea2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1-ref.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions">Test passes if the two boxes below look exactly the same.</div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; [a]&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; [a]&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1.html
new file mode 100644
index 000000000..822120721
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: BDI: neutral to another BDI</title>
+ <link rel="match" href="bdi-neutral-to-another-bdi-1-ref.html" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element" />
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'
+ Thus, when a BDI contains text of the same strong direction as another BDI following it, the
+ two must not form a directional run as would be the case if the BDIs were just SPANs." />
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions">Test passes if the two boxes below look exactly the same.</div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ If the BDIs in the test's first DIV were SPANs, the &#x05D1; would be rendered to the left
+ of the &#x05D0;.
+ </div>
+ <div class="test">
+ <div dir="ltr"><bdi>[&#x05D0;]</bdi> &gt; <bdi>[&#x05D1;]</bdi>...</div>
+ <div dir="ltr"><bdi dir="rtl">[&#x05D0;]</bdi> &gt; <bdi dir="rtl">[&#x05D1;]</bdi>...</div>
+ <div dir="ltr"><bdi dir="ltr">[&#x05D0;]</bdi> &gt; <bdi dir="ltr">[&#x05D1;]</bdi>...</div>
+ <div dir="rtl"><bdi>[a]</bdi> &gt; <bdi>[b]</bdi>...</div>
+ <div dir="rtl"><bdi dir="ltr">[a]</bdi> &gt; <bdi dir="ltr">[b]</bdi>...</div>
+ <div dir="rtl"><bdi dir="rtl">[a]</bdi> &gt; <bdi dir="rtl">[b]</bdi>...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; [a]&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2-ref.html
new file mode 100644
index 000000000..9aef97c0e
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2-ref.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions">Test passes if the two boxes below look exactly the same.</div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2.html
new file mode 100644
index 000000000..85aec4668
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: BDI: neutral to another immediately following BDI</title>
+ <link rel="match" href="bdi-neutral-to-another-bdi-2-ref.html">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" />
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" />
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element" />
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'
+ Thus, when a BDI contains text of the same strong direction as another BDI following it, the
+ two must not form a directional run as would be the case if the BDIs were just SPANs, even if
+ the two BDIs are not separated by anything at all." />
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="instructions">Test passes if the two boxes below look exactly the same.</div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ If the BDIs in the test's first DIV were SPANs, the &#x05D1; would be rendered to the left of
+ the &#x05D0;.
+ </div>
+ <div class="test">
+ <div dir="ltr"><bdi>&#x05D0;</bdi><bdi>&#x05D1;</bdi>...</div>
+ <div dir="ltr"><bdi dir="rtl">&#x05D0;</bdi><bdi dir="rtl">&#x05D1;</bdi>...</div>
+ <div dir="ltr"><bdi dir="ltr">&#x05D0;</bdi><bdi dir="ltr">&#x05D1;</bdi>...</div>
+ <div dir="rtl"><bdi>a</bdi><bdi>b</bdi>...</div>
+ <div dir="rtl"><bdi dir="ltr">a</bdi><bdi dir="ltr">b</bdi>...</div>
+ <div dir="rtl"><bdi dir="rtl">a</bdi><bdi dir="rtl">b</bdi>...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1-ref.html
new file mode 100644
index 000000000..a34d09bd2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1-ref.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; &#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; &#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; &#x05D1;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...b &lt; [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...b &lt; [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...b &lt; [a]&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; &#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; &#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; &#x05D1;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...b &lt; [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...b &lt; [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...b &lt; [a]&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1.html
new file mode 100644
index 000000000..76da57c2b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: neutral to following letter</title>
+ <link rel="match" href="bdi-neutral-to-letter-following-1-ref.html"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ If the BDI in the test's first DIV were a SPAN, the &#x05D1; would be rendered to the left
+ of the &#x05D0;
+ </div>
+ <div class="test">
+ <div dir="ltr"><bdi>[&#x05D0;]</bdi> &gt; &#x05D1;...</div>
+ <div dir="ltr"><bdi dir="rtl">[&#x05D0;]</bdi> &gt; &#x05D1;...</div>
+ <div dir="ltr"><bdi dir="ltr">[&#x05D0;]</bdi> &gt; &#x05D1;...</div>
+ <div dir="rtl"><bdi>[a]</bdi> &gt; b...</div>
+ <div dir="rtl"><bdi dir="ltr">[a]</bdi> &gt; b...</div>
+ <div dir="rtl"><bdi dir="rtl">[a]</bdi> &gt; b...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; &#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; &#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] &gt; &#x05D1;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...b &lt; [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...b &lt; [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...b &lt; [a]&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2-ref.html
new file mode 100644
index 000000000..80f36183b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2-ref.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2.html
new file mode 100644
index 000000000..ce41983f0
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: neutral to immediately following letter</title>
+ <link rel="match" href="bdi-neutral-to-letter-following-2-ref.html">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ If the BDI in the following DIV were a SPAN, the &#x05D1; would be rendered to the left
+ of the &#x05D0;
+ </div>
+ <div class="test">
+ <div dir="ltr"><bdi>&#x05D0;</bdi>&#x05D1;...</div>
+ <div dir="ltr"><bdi dir="rtl">&#x05D0;</bdi>&#x05D1;...</div>
+ <div dir="ltr"><bdi dir="ltr">&#x05D0;</bdi>&#x05D1;...</div>
+ <div dir="rtl"><bdi>a</bdi>b...</div>
+ <div dir="rtl"><bdi dir="ltr">a</bdi>b...</div>
+ <div dir="rtl"><bdi dir="rtl">a</bdi>b...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1-ref.html
new file mode 100644
index 000000000..5e39eabd2
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1-ref.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;&#x05D0; &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0; &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0; &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; a&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; a&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; a&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0; &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0; &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0; &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; a&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; a&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; a&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1.html
new file mode 100644
index 000000000..46772de64
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: neutral to preceding letter</title>
+ <link rel="match" href="bdi-neutral-to-letter-preceding-1-ref.html">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ If the BDI in the test's first DIV were a SPAN, the &#x05D1; would be rendered to the left
+ of the &#x05D0;
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x05D0; &gt; <bdi>[&#x05D1;]</bdi>...</div>
+ <div dir="ltr">&#x05D0; &gt; <bdi dir="rtl">[&#x05D1;]</bdi>...</div>
+ <div dir="ltr">&#x05D0; &gt; <bdi dir="ltr">[&#x05D1;]</bdi>...</div>
+ <div dir="rtl">a &gt; <bdi>[b]</bdi>...</div>
+ <div dir="rtl">a &gt; <bdi dir="ltr">[b]</bdi>...</div>
+ <div dir="rtl">a &gt; <bdi dir="rtl">[b]</bdi>...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0; &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0; &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0; &gt; [&#x05D1;]...&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; a&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; a&#x202C;</div>
+ <div dir="rtl">&#x202D;...[b] &lt; a&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2-ref.html
new file mode 100644
index 000000000..80f36183b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2-ref.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2.html
new file mode 100644
index 000000000..192115775
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: neutral to immediately preceding letter</title>
+ <link rel="match" href="bdi-neutral-to-letter-preceding-2-ref.html"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ If the BDI in the test's first DIV were a SPAN, the &#x05D1; would be rendered to the left
+ of the &#x05D0;
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x05D0;<bdi>&#x05D1;</bdi>...</div>
+ <div dir="ltr">&#x05D0;<bdi dir="rtl">&#x05D1;</bdi>...</div>
+ <div dir="ltr">&#x05D0;<bdi dir="ltr">&#x05D1;</bdi>...</div>
+ <div dir="rtl">a<bdi>b</bdi>...</div>
+ <div dir="rtl">a<bdi dir="ltr">b</bdi>...</div>
+ <div dir="rtl">a<bdi dir="rtl">b</bdi>...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;&#x05D1;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ <div dir="rtl">&#x202D;...ba&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1-ref.html
new file mode 100644
index 000000000..ad15d468b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1-ref.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;[&#x05D0;] (3 reviews)...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] (3 reviews)...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] (3 reviews)...&#x202C;</div>
+ <div dir="rtl">&#x202D;...(3) [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...(3) [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...(3) [a]&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;[&#x05D0;] (3 reviews)...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] (3 reviews)...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] (3 reviews)...&#x202C;</div>
+ <div dir="rtl">&#x202D;...(3) [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...(3) [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...(3) [a]&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1.html
new file mode 100644
index 000000000..ff566737f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: neutral to following number</title>
+ <link rel="match" href="bdi-neutral-to-number-following-1-ref.html"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ If the BDI in the test's first DIV were a SPAN, the 3 would be rendered to the left
+ of the &#x05D0;
+ </div>
+ <div class="test">
+ <div dir="ltr"><bdi>[&#x05D0;]</bdi> (3 reviews)...</div>
+ <div dir="ltr"><bdi dir="rtl">[&#x05D0;]</bdi> (3 reviews)...</div>
+ <div dir="ltr"><bdi dir="ltr">[&#x05D0;]</bdi> (3 reviews)...</div>
+ <div dir="rtl"><bdi>[a]</bdi> (3)...</div>
+ <div dir="rtl"><bdi dir="ltr">[a]</bdi> (3)...</div>
+ <div dir="rtl"><bdi dir="rtl">[a]</bdi> (3)...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;[&#x05D0;] (3 reviews)...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] (3 reviews)...&#x202C;</div>
+ <div dir="ltr">&#x202D;[&#x05D0;] (3 reviews)...&#x202C;</div>
+ <div dir="rtl">&#x202D;...(3) [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...(3) [a]&#x202C;</div>
+ <div dir="rtl">&#x202D;...(3) [a]&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2-ref.html
new file mode 100644
index 000000000..d0f1097ad
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2-ref.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;&#x05D0;1...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;1...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;1...&#x202C;</div>
+ <div dir="rtl">&#x202D;...1a&#x202C;</div>
+ <div dir="rtl">&#x202D;...1a&#x202C;</div>
+ <div dir="rtl">&#x202D;...1a&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0;1...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;1...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;1...&#x202C;</div>
+ <div dir="rtl">&#x202D;...1a&#x202C;</div>
+ <div dir="rtl">&#x202D;...1a&#x202C;</div>
+ <div dir="rtl">&#x202D;...1a&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2.html
new file mode 100644
index 000000000..62a3b50ff
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: neutral to immediately following number</title>
+ <link rel="match" href="bdi-neutral-to-number-following-2-ref.html"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ If the BDI in the test's first DIV were a SPAN, the 1 would be rendered to the left
+ of the &#x05D0;
+ </div>
+ <div class="test">
+ <div dir="ltr"><bdi>&#x05D0;</bdi>1...</div>
+ <div dir="ltr"><bdi dir="rtl">&#x05D0;</bdi>1...</div>
+ <div dir="ltr"><bdi dir="ltr">&#x05D0;</bdi>1...</div>
+ <div dir="rtl"><bdi>a</bdi>1...</div>
+ <div dir="rtl"><bdi dir="ltr">a</bdi>1...</div>
+ <div dir="rtl"><bdi dir="rtl">a</bdi>1...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0;1...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;1...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D0;1...&#x202C;</div>
+ <div dir="rtl">&#x202D;...1a&#x202C;</div>
+ <div dir="rtl">&#x202D;...1a&#x202C;</div>
+ <div dir="rtl">&#x202D;...1a&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run-ref.html
new file mode 100644
index 000000000..d7967c77f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run-ref.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;&#x05D2; &lt; [b] &lt; &#x05D0;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D2; &lt; [b] &lt; &#x05D0;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D2; &lt; [b] &lt; &#x05D0;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...a &gt; [&#x05D1;] &gt; c&#x202C;</div>
+ <div dir="rtl">&#x202D;...a &gt; [&#x05D1;] &gt; c&#x202C;</div>
+ <div dir="rtl">&#x202D;...a &gt; [&#x05D1;] &gt; c&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D2; &lt; [b] &lt; &#x05D0;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D2; &lt; [b] &lt; &#x05D0;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D2; &lt; [b] &lt; &#x05D0;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...a &gt; [&#x05D1;] &gt; c&#x202C;</div>
+ <div dir="rtl">&#x202D;...a &gt; [&#x05D1;] &gt; c&#x202C;</div>
+ <div dir="rtl">&#x202D;...a &gt; [&#x05D1;] &gt; c&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run.html
new file mode 100644
index 000000000..bff339ec3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: neutral to surrounding letters</title>
+ <link rel="match" href="bdi-neutral-to-surrounding-run-ref.html">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'
+ Thus, regardless of its content and its dir attribute (if any), a BDI will not prevent
+ a strongly RTL (or LTR) character preceding it from forming a single directional run with
+ another strongly RTL (LTR) character following it."/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ If the BDI in the test's first DIV were a SPAN, its b would prevent the &#x05D0; and the &#x05D1;
+ from forming a single RTL run and thus keep the &gt;s between from being mirrored into &lt;s.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x05D0; &gt; <bdi>[b]</bdi> &gt; &#x05D2;...</div>
+ <div dir="ltr">&#x05D0; &gt; <bdi dir="ltr">[b]</bdi> &gt; &#x05D2;...</div>
+ <div dir="ltr">&#x05D0; &gt; <bdi dir="rtl">[b]</bdi> &gt; &#x05D2;...</div>
+ <div dir="rtl">a &gt; <bdi>[&#x05D1;]</bdi> &gt; c...</div>
+ <div dir="rtl">a &gt; <bdi dir="ltr">[&#x05D1;]</bdi> &gt; c...</div>
+ <div dir="rtl">a &gt; <bdi dir="rtl">[&#x05D1;]</bdi> &gt; c...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D2; &lt; [b] &lt; &#x05D0;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D2; &lt; [b] &lt; &#x05D0;...&#x202C;</div>
+ <div dir="ltr">&#x202D;&#x05D2; &lt; [b] &lt; &#x05D0;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...a &gt; [&#x05D1;] &gt; c&#x202C;</div>
+ <div dir="rtl">&#x202D;...a &gt; [&#x05D1;] &gt; c&#x202C;</div>
+ <div dir="rtl">&#x202D;...a &gt; [&#x05D1;] &gt; c&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped-ref.html
new file mode 100644
index 000000000..9859de474
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped-ref.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ &#x202D;b &lt; &#x05D0;&#x202C;<br/>
+ &#x202D;&gt;&gt;&gt;&#x202C;<br/>
+ &#x202D;&#x05D3; &lt; c...&#x202C;
+ </div>
+ <div dir="rtl">
+ &#x202D;a &gt; &#x05D1;&#x202C;<br/>
+ &#x202D;&lt;&lt;&lt;&#x202C;<br/>
+ &#x202D;...&#x05D2; &gt; d&#x202C;
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ &#x202D;b &lt; &#x05D0;&#x202C;<br/>
+ &#x202D;&gt;&gt;&gt;&#x202C;<br/>
+ &#x202D;&#x05D3; &lt; c...&#x202C;
+ </div>
+ <div dir="rtl">
+ &#x202D;a &gt; &#x05D1;&#x202C;<br/>
+ &#x202D;&lt;&lt;&lt;&#x202C;<br/>
+ &#x202D;...&#x05D2; &gt; d&#x202C;
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped.html
new file mode 100644
index 000000000..3e21fcb0f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped.html
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: neutral when wrapped</title>
+ <link rel="match" href="bdi-neutral-wrapped-ref.html">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the paragraph-level
+ container that a bdi element finds itself within, the bdi element must be treated
+ like a U+FFFC OBJECT REPLACEMENT CHARACTER.'
+ This should hold even if the BDI's content is wrapped over more than one line."/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#xA0; - Non-breaking space.
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ In the test below, the non-breaking spaces in the BDI's middle "word" make it so long that it
+ must be displayed on a line of its own, with the BDI wrapped before and after it. At the same
+ time, the content surrounding the BDI is supposed to form a single directional run, despite
+ the containing element and the BDI both having the opposite direction, because the BDI must be
+ treated as a neutral. Thus, on the line containing the first part of the BDI, the BDI's
+ content must appear after the content preceding it, and on the line containing the last part
+ of the BDI, the BDI content must appear before the content following it, where both 'before'
+ and 'after' are defined relative to the surrounding directional run.
+ </div>
+ <div class="test">
+ <div dir="ltr">
+ &#x05D0; &gt;
+ <bdi>b
+&gt;&gt;&gt;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;
+ c</bdi>
+ &gt; &#x05D3;...
+ </div>
+ <div dir="rtl">
+ a &gt;
+ <bdi>&#x05D1;
+&gt;&gt;&gt;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;
+ &#x05D2;</bdi>
+ &gt; d...
+ </div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">
+ &#x202D;b &lt; &#x05D0;&#x202C;<br/>
+ &#x202D;&gt;&gt;&gt;&#x202C;<br/>
+ &#x202D;&#x05D3; &lt; c...&#x202C;
+ </div>
+ <div dir="rtl">
+ &#x202D;a &gt; &#x05D1;&#x202C;<br/>
+ &#x202D;&lt;&lt;&lt;&#x202C;<br/>
+ &#x202D;...&#x05D2; &gt; d&#x202C;
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container-ref.html
new file mode 100644
index 000000000..0c74ecf68
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com">
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com">
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 500px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x202D;&#x05D0; [1 2 3 b] c [d &#x05D4;?!] &#x05D5;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...f [!?e &#x05D3;] &#x05D2; [&#x05D1; 3 2 1] a&#x202C;</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0; [1 2 3 b] c [d &#x05D4;?!] &#x05D5;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...f [!?e &#x05D3;] &#x05D2; [&#x05D1; 3 2 1] a&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container.html
new file mode 100644
index 000000000..f133a9577
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BDI: paragraph-level container</title>
+ <link rel="match" href="bdi-paragraph-level-container-ref.html"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/>
+ <meta name="assert" content="
+ 'For the purposes of applying the bidirectional algorithm to the contents of a bdi element,
+ user agents must treat the element as a paragraph-level container.'
+ Thus, under no circumstances should the content outside a BDI affect the visual
+ ordering of the BDI's content."/>
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 500px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D5; - The first six Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ If the BDIs in the test's first DIV were just SPANs, the &#x05D0; would order the 1 2 3 as
+ 3 2 1, and the &#x05D5; would (with the &#x05D4;) order the ?! as !?.
+ </div>
+ <div class="test">
+ <div dir="ltr">&#x05D0; <bdi>[1 2 3 b]</bdi> c <bdi>[d &#x05D4;?!]</bdi> &#x05D5;...</div>
+ <div dir="rtl">a <bdi>[1 2 3 &#x05D1;]</bdi> &#x05D2; <bdi>[&#x05D3; e?!]</bdi> f...</div>
+ </div>
+ <div class="ref">
+ <div dir="ltr">&#x202D;&#x05D0; [1 2 3 b] c [d &#x05D4;?!] &#x05D5;...&#x202C;</div>
+ <div dir="rtl">&#x202D;...f [!?e &#x05D3;] &#x05D2; [&#x05D1; 3 2 1] a&#x202C;</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-child.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-child.html
new file mode 100644
index 000000000..feadc26d7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-child.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>HTML Test: bdo - text directionality formatting control for its children</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdo-element">
+ <link rel="match" href="bidi-001-ref.html">
+ <meta name="assert" content="Check if the bdo element represents explicit text directionality formatting control for its children.">
+ </head>
+ <body>
+ <p>Test passes if there is text 'WERBEH'.</p>
+ <bdo dir="rtl">
+ <span>HEBREW</span>
+ </bdo>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-ltr.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-ltr.html
new file mode 100644
index 000000000..8a7861086
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-ltr.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>HTML Test: The value 'ltr' of dir attribute specifies a left-to-right override</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdo-element">
+ <link rel="match" href="bidi-001-ref.html">
+ <meta name="assert" content="Check if the value ltr of dir attribute specifies a left-to-right override">
+ </head>
+ <body>
+ <p>Test passes if there is text 'WERBEH'.</p>
+ <bdo dir="ltr">WERBEH</bdo>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-override.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-override.html
new file mode 100644
index 000000000..75a45e198
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-override.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>HTML Test: bdo - override the Unicode bidirectional algorithm</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdo-element">
+ <link rel="match" href="bidi-001-ref.html">
+ <meta name="assert" content="Check if authors could override the Unicode bidirectional algorithm
+ by explicitly specifying a direction override of bdo element">
+ </head>
+ <body>
+ <p>Test passes if there is text 'WERBEH'.</p>
+ <p>
+ &#x202E;<bdo dir="ltr">WERBEH</bdo>&#x202C;
+ </p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001-ref.html
new file mode 100644
index 000000000..83d2dc4a1
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>directional type reference</title>
+</head>
+<body>
+<p>Test passes if there is text 'WERBEH'.</p>
+<div>WERBEH</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001.html
new file mode 100644
index 000000000..772dcf43b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>directional type</title>
+<meta content="W3C" name="author">
+<link rel="match" href="bidi-001-ref.html">
+<meta name="assert" content="Test text bidirectionality using the bdo element">
+</head>
+<body dir='ltr'>
+<p>Test passes if there is text 'WERBEH'.</p>
+<bdo dir="rtl">HEBREW</bdo>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors-ref.html
new file mode 100644
index 000000000..c2dd4daa7
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors-ref.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D8; - The first nine Hebrew letters (strongly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ &#x202D;&#x05D0;&#x05D1; &#x05D2;&#x05D3; 1. I like &#x05D4;. fg hi&#x202C;
+ <br/>
+ &#x202D;ab cd 2. &#x05D4; is great! &#x05D5;&#x05D6; &#x05D7;&#x05D8;&#x202C;
+ </div>
+ <div class="ref">
+ &#x202D;&#x05D0;&#x05D1; &#x05D2;&#x05D3; 1. I like &#x05D4;. fg hi&#x202C;
+ <br/>
+ &#x202D;ab cd 2. &#x05D4; is great! &#x05D5;&#x05D6; &#x05D7;&#x05D8;&#x202C;
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors.html
new file mode 100644
index 000000000..89e7f2f1a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>HTML Test: BR in inline ancestors</title>
+ <link rel="match" href="br-bidi-in-inline-ancestors-ref.html">
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-br-element"/>
+ <link rel="help" href="http://www.w3.org/TR/css3-writing-modes/#unicode-bidi" />
+ <meta name="assert" content="
+ 'A br element should separate paragraphs for the purposes of the Unicode bidirectional
+ algorithm.'
+ 'If an inline element is broken around a bidi paragraph boundary (e.g. if split by a block or
+ forced paragraph break), then the bidi control codes corresponding to the end of the element
+ are added before the interruption and the codes corresponding to the start of the element are
+ added after it. (In other words, any embedding levels or overrides started by the element are
+ closed at the paragraph break and reopened on the other side of it.)'" />
+ <style>
+ body{
+ font-size:2em;
+ }
+ .test, .ref {
+ border: medium solid gray;
+ width: 400px;
+ margin: 20px;
+ }
+ .comments { display: none; }
+ </style>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
+ <div class="comments">
+ Key to entities used below:
+ &#x05D0; ... &#x05D8; - The first nine Hebrew letters (strongly RTL).
+ &#x200E; - The LRM (left-to-right mark) formatting character (invisible, stronly LTR).
+ &#x200F; - The RLM (right-to-left mark) formatting character (invisible, stronly RTL).
+ &#x202D; - The LRO (left-to-right override) formatting character.
+ &#x202C; - The PDF (pop directional formatting) formatting character; closes LRO.
+ </div>
+ <div class="test">
+ &#x05D1;&#x05D0;&#x200E;
+ <bdo dir="rtl">ih
+ <bdo dir="ltr">&#x05D2;&#x05D3;
+ <span dir="rtl">fg&#x200F;
+ <span dir="ltr">1. I like &#x05D4;.<br/>
+ 2. &#x05D4; is great!</span>
+ &#x200F;cd</span>
+ &#x05D5;&#x05D6;</bdo>
+ ba</bdo>
+ &#x200E;&#x05D8;&#x05D7;
+ </div>
+ <div class="ref">
+ &#x202D;&#x05D0;&#x05D1; &#x05D2;&#x05D3; 1. I like &#x05D4;. fg hi&#x202C;
+ <br/>
+ &#x202D;ab cd 2. &#x05D4; is great! &#x05D5;&#x05D6; &#x05D7;&#x05D8;&#x202C;
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-ref.html
new file mode 100644
index 000000000..f07c07791
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML Test reference: BR separates bidi paragraph</title>
+ <link rel="author" title="Amir E. Aharoni" href="mailto:amir.aharoni@mail.huji.ac.il"/>
+ <link rel="author" title="Eyal Sela" href="mailto:eyal@post.isoc.org.il"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-br-element"/>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the rightmost character in the first line below is a full stop and to the left of it is a Hebrew letter.</p></div>
+ <div class="test">
+ A Hebrew letter and a full stop: &#x05d0;.&lrm;
+ <br />
+ &#x05d0; this line begins with a Hebrew letter.
+ </div>
+</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi.html
new file mode 100644
index 000000000..1dfa6836f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>HTML Test: BR separates bidi paragraph</title>
+ <link rel="match" href="br-bidi-ref.html">
+ <link rel="author" title="Amir E. Aharoni" href="mailto:amir.aharoni@mail.huji.ac.il"/>
+ <link rel="author" title="Eyal Sela" href="mailto:eyal@post.isoc.org.il"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-br-element"/>
+ <meta name="assert"
+ content="A br element should separate paragraphs for the purposes of the Unicode bidirectional algorithm."/>
+ </head>
+ <body>
+ <div class="instructions"><p>Test passes if the rightmost character in the first line below is a full stop and to the left of it is a Hebrew letter.</p></div>
+ <div class="test">
+ A Hebrew letter and a full stop: &#x05d0;.
+ <br />
+ &#x05d0; this line begins with a Hebrew letter.
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-cite-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-cite-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-cite-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-code-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-code-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-code-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-data-element/data.value-001.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-data-element/data.value-001.html
new file mode 100644
index 000000000..9fc827b9b
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-data-element/data.value-001.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTMLDataElement.value getting</title>
+ <link rel="author" title="ofekd" href="mailto:ofek@outlook.com">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#dom-data-value">
+ <script src=/resources/testharness.js></script>
+ <script src=/resources/testharnessreport.js></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <div id="container">
+ <data value=""></data>
+ <data value="40">Forty</data>
+ </div>
+ <script>
+ var newData, datasArr, container;
+
+ container = document.getElementById('container')
+
+ newData = document.createElement('data');
+ newData.textContent = 'Five';
+ newData.setAttribute('value', '5');
+ container.appendChild(newData);
+
+ datasArr = container.getElementsByTagName('data');
+
+ test(function () {
+ test(function() {
+ assert_equals(datasArr[0].value, '');
+ }, 'data[value] #0 getter test');
+
+ test(function() {
+ assert_equals(datasArr[1].value, '40');
+ }, 'data[value] #1 getter test');
+
+ test(function() {
+ assert_equals(datasArr[2].value, '5');
+ }, 'data[value] #2 getter test');
+ }, 'Getter tests');
+
+ test(function () {
+ var i;
+
+ for (i = 0; i < datasArr.length; i++) {
+ datasArr[i].textContent = 'Twenty';
+ datasArr[i].value = 20;
+
+ test(function() {
+ assert_equals(datasArr[i].getAttribute('value'), '20');
+ }, 'data[value] #' + i + ' setter test');
+ }
+
+ newData = document.createElement('data');
+ newData.textContent = 'Twenty';
+ newData.value = '20';
+ container.appendChild(newData);
+
+ test(function() {
+ assert_equals(datasArr[3].getAttribute('value'), '20');
+ }, 'data[value] #3 setter test');
+
+ }, 'Setter tests');
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-dfn-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-dfn-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-dfn-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-em-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-em-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-em-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-i-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-i-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-i-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-kbd-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-kbd-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-kbd-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-mark-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-mark-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-mark-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-q-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-q-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-q-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-rp-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-rp-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-rp-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-rt-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-rt-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-rt-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-s-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-s-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-s-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-samp-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-samp-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-samp-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-small-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-small-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-small-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-span-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-span-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-span-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-strong-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-strong-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-strong-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-sub-and-sup-elements/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-sub-and-sup-elements/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-sub-and-sup-elements/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-time-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-time-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-time-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-time-element/001.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-time-element/001.html
new file mode 100644
index 000000000..e1cd0480a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-time-element/001.html
@@ -0,0 +1,68 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset=utf-8>
+ <title>HTML time element API</title>
+ <style>
+#time { visibility: hidden; }
+ </style>
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-time-element">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <!-- intentionally nested to test parsing rules -->
+ <p id="time"><time pubdate datetime="2000-02-01T03:04:05Z">Dummy text <time>2001-06-07T<time>08:09<time></time></time>Z</time></time></p>
+ <script type="text/javascript">
+function makeTime(dateTime,contents,dateTimeProp) {
+ var timeEl = document.createElement('time');
+ if( dateTime ) {
+ timeEl.setAttribute('datetime',dateTime);
+ }
+ if( contents ) {
+ timeEl.innerHTML = contents;
+ }
+ if( dateTimeProp ) {
+ timeEl.dateTime = dateTimeProp;
+ }
+ return timeEl;
+}
+
+var timep = document.getElementById('time');
+var times = timep.getElementsByTagName('time');
+
+//TIME elements
+test(function () {
+ assert_equals( times.length, 4 );
+}, 'HTML parsing should locate 4 time elements in this document');
+test(function () {
+ assert_true( !!window.HTMLTimeElement );
+}, 'HTMLTimeElement should be exposed for prototyping');
+test(function () {
+ assert_true( makeTime() instanceof window.HTMLTimeElement, 'createElement variant' );
+ assert_true( times[0] instanceof window.HTMLTimeElement, 'HTML parsing variant' );
+}, 'the time elements should be instanceof HTMLTimeElement');
+
+//dateTime
+test(function () {
+ assert_equals( makeTime('2000-02-01T03:04:05Z','2001-02-01T03:04:05Z').dateTime, '2000-02-01T03:04:05Z' );
+}, 'the datetime attribute should be reflected by the .dateTime property');
+test(function () {
+ assert_equals( typeof makeTime().dateTime, 'string', 'typeof test' );
+ assert_equals( makeTime().dateTime, '', 'value test' );
+}, 'the dateTime IDL property should default to an empty string');
+test(function () {
+ assert_equals( makeTime(false,false,'2000-02-01T03:04:05Z').dateTime, '2000-02-01T03:04:05Z' );
+}, 'the dateTime property should be read/write');
+test(function () {
+ assert_equals( makeTime('go fish').dateTime, 'go fish' );
+}, 'the datetime attribute should be reflected by the .dateTime property even if it is invalid');
+test(function () {
+ assert_equals( makeTime(false,'2000-02-01T03:04:05Z').dateTime, '' );
+}, 'the datetime attribute should not reflect the textContent');
+
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-u-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-u-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-u-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-var-element/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/the-var-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-var-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element-ref.html
new file mode 100644
index 000000000..f167ea719
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>The wbr element</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<meta name="flags" content="ahem">
+<style>
+ p {font:15px/1 Ahem;}
+</style>
+<p>Loremipsumdolorsit<br>amet,consectetur<br>adipisicingelit,sed<br>doeiusmodtempor<br>incididuntutlaboreet<br>doloremagnaaliqua.Ut<br>enimadminimveniam,<br>quisnostrud<br>exercitationullamco<br>laborisnisiutaliquip<br>exeacommodo<br>consequat.Duisaute<br>iruredolorin<br>reprehenderitin<br>voluptatevelitesse<br>cillumdoloreeufugiat<br>nullapariatur.<br>Excepteursint<br>occaecatcupidatatnon<br>proident,suntinculpa<br>quiofficiadeserunt<br>mollitanimidest<br>laborum.</p>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element.html
new file mode 100644
index 000000000..63f271615
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>The wbr element</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#rendering">
+<link rel="match" href="wbr-element-ref.html">
+<meta name="flags" content="ahem">
+<style>
+ p {max-width: 300px; font:15px/1 Ahem;}
+</style>
+<p>AHEM_<wbr>ipsum<wbr>dolor<wbr>sit<wbr>amet,<wbr>consectetur<wbr>adipisicing<wbr>elit,<wbr>sed<wbr>do<wbr>eiusmod<wbr>tempor<wbr>incididunt<wbr>ut<wbr>labore<wbr>et<wbr>dolore<wbr>magna<wbr>aliqua.<wbr>Ut<wbr>enim<wbr>ad<wbr>minim<wbr>veniam,<wbr>quis<wbr>nostrud<wbr>exercitation<wbr>ullamco<wbr>laboris<wbr>nisi<wbr>ut<wbr>aliquip<wbr>ex<wbr>ea<wbr>commodo<wbr>consequat.<wbr>Duis<wbr>aute<wbr>irure<wbr>dolor<wbr>in<wbr>reprehenderit<wbr>in<wbr>voluptate<wbr>velit<wbr>esse<wbr>cillum<wbr>dolore<wbr>eu<wbr>fugiat<wbr>nulla<wbr>pariatur.<wbr>Excepteur<wbr>sint<wbr>occaecat<wbr>cupidatat<wbr>non<wbr>proident,<wbr>sunt<wbr>in<wbr>culpa<wbr>qui<wbr>officia<wbr>deserunt<wbr>mollit<wbr>anim<wbr>id<wbr>est<wbr>laborum.</p>
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/usage-summary/.gitkeep b/testing/web-platform/tests/html/semantics/text-level-semantics/usage-summary/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/text-level-semantics/usage-summary/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/the-root-element/.gitkeep b/testing/web-platform/tests/html/semantics/the-root-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/the-root-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/the-root-element/the-html-element/.gitkeep b/testing/web-platform/tests/html/semantics/the-root-element/the-html-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/the-root-element/the-html-element/.gitkeep
diff --git a/testing/web-platform/tests/html/syntax/.gitkeep b/testing/web-platform/tests/html/syntax/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/.gitkeep
diff --git a/testing/web-platform/tests/html/syntax/html-element-list.js b/testing/web-platform/tests/html/syntax/html-element-list.js
new file mode 100644
index 000000000..6eea8d996
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/html-element-list.js
@@ -0,0 +1,140 @@
+var elements_with_end_tag = [
+ "a",
+ "abbr",
+ "address",
+ "article",
+ "aside",
+ "audio",
+ "b",
+ "bdi",
+ "bdo",
+ "blockquote",
+ "body",
+ "button",
+ "canvas",
+ "caption",
+ "cite",
+ "code",
+ "colgroup",
+ "command",
+ "datalist",
+ "dd",
+ "del",
+ "details",
+ "dfn",
+ "dialog",
+ "div",
+ "dl",
+ "dt",
+ "em",
+ "fieldset",
+ "figcaption",
+ "figure",
+ "footer",
+ "form",
+ "h1",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ "head",
+ "header",
+ "hgroup",
+ "html",
+ "i",
+ "iframe",
+ "ins",
+ "kbd",
+ "label",
+ "legend",
+ "li",
+ "map",
+ "mark",
+ "menu",
+ "meter",
+ "nav",
+ "noscript",
+ "object",
+ "ol",
+ "optgroup",
+ "option",
+ "output",
+ "p",
+ "pre",
+ "progress",
+ "q",
+ "rp",
+ "rt",
+ "ruby",
+ "s",
+ "samp",
+ "script",
+ "section",
+ "select",
+ "small",
+ "span",
+ "strong",
+ "style",
+ "sub",
+ "summary",
+ "sup",
+ "table",
+ "tbody",
+ "td",
+ "textarea",
+ "tfoot",
+ "th",
+ "thead",
+ "time",
+ "title",
+ "tr",
+ "u",
+ "ul",
+ "var",
+ "video",
+ "data",
+ //"acronym",
+ //"applet",
+ //"basefont",
+ //"bgsound",
+ //"big",
+ //"blink",
+ //"center",
+ //"dir",
+ //"font",
+ //"frame",
+ //"frameset",
+ //"isindex",
+ //"listing",
+ //"marquee",
+ //"multicol",
+ //"nextid",
+ //"nobr",
+ //"noembed",
+ //"noframes",
+ //"plaintext",
+ //"rb",
+ //"spacer",
+ //"strike",
+ //"tt",
+ //"xmp",
+];
+
+var elements_without_end_tag = [
+ "area",
+ "base",
+ "br",
+ "col",
+ "embed",
+ "hr",
+ "img",
+ "input",
+ "keygen",
+ "link",
+ "meta",
+ "param",
+ "source",
+ "track",
+ "wbr",
+];
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/.gitkeep b/testing/web-platform/tests/html/syntax/parsing-html-fragments/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/.gitkeep
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-1.css b/testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-1.css
new file mode 100644
index 000000000..956ec70e7
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-1.css
@@ -0,0 +1,4 @@
+@charset "utf-8";
+.test div.ýäè {
+ width: 100px;
+}
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-15-inverse.css b/testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-15-inverse.css
new file mode 100644
index 000000000..4a0285419
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-15-inverse.css
@@ -0,0 +1,4 @@
+@charset "utf-8";
+.test div#box.ÜÀÚ {
+ width: 100px;
+}
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-15.css b/testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-15.css
new file mode 100644
index 000000000..ec907a1a9
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-15.css
@@ -0,0 +1,4 @@
+@charset "utf-8";
+.test div.ÜÀÚ {
+ width: 100px;
+}
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-utf8.css b/testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-utf8.css
new file mode 100644
index 000000000..3fa2d5f47
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/support/encodingtests-utf8.css
@@ -0,0 +1,4 @@
+@charset "utf-8";
+.test div.ýäè {
+ width: 100px;
+}
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-001.html b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-001.html
new file mode 100644
index 000000000..a85682adf
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-001.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+ <title>HTTP charset</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-input-byte-stream'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http'>
+<style type='text/css'>
+.test div { width: 50px; }</style>
+<link rel="stylesheet" type="text/css" href="support/encodingtests-15.css">
+</head>
+<body>
+
+
+
+<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>
+
+
+<!--Notes:
+
+The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00C3;&#x0153;&#x00C3;&#x20AC;&#x00C3;&#x0161;</code>. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.
+
+The only character encoding declaration for this HTML file is in the HTTP header, which sets the encoding to ISO 8859-15.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "The character encoding of a page can be set using the HTTP header charset declaration.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-001.html.headers b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-001.html.headers
new file mode 100644
index 000000000..3d9718c07
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-001.html.headers
@@ -0,0 +1 @@
+Content-Type: text/html; charset=iso-8859-15
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-003.html b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-003.html
new file mode 100644
index 000000000..5b3863b4c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-003.html
Binary files differ
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-004.html b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-004.html
new file mode 100644
index 000000000..2041daff0
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-004.html
Binary files differ
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-007.html b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-007.html
new file mode 100644
index 000000000..03dd532b3
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-007.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-15"> <title>meta content attribute</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-input-byte-stream'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http'>
+<style type='text/css'>
+.test div { width: 50px; }</style>
+<link rel="stylesheet" type="text/css" href="support/encodingtests-15.css">
+</head>
+<body>
+
+
+
+<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>
+
+
+<!--Notes:
+
+The only character encoding declaration for this HTML file is in the content attribute of the meta element, which declares the encoding to be ISO 8859-15.
+
+The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00C3;&#x0153;&#x00C3;&#x20AC;&#x00C3;&#x0161;</code>. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "The character encoding of the page can be set by a meta element with http-equiv and content attributes.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-007.html.headers b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-007.html.headers
new file mode 100644
index 000000000..156209f9c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-007.html.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-009.html b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-009.html
new file mode 100644
index 000000000..138329283
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-009.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+ <meta charset="iso-8859-15"> <title>meta charset attribute</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-input-byte-stream'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http'>
+<style type='text/css'>
+.test div { width: 50px; }</style>
+<link rel="stylesheet" type="text/css" href="support/encodingtests-15.css">
+</head>
+<body>
+
+
+
+<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>
+
+
+<!--Notes:
+
+The only character encoding declaration for this HTML file is in the charset attribute of the meta element, which declares the encoding to be ISO 8859-15.
+
+The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00C3;&#x0153;&#x00C3;&#x20AC;&#x00C3;&#x0161;</code>. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "The character encoding of the page can be set by a meta element with charset attribute.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-009.html.headers b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-009.html.headers
new file mode 100644
index 000000000..156209f9c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-009.html.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-015.html b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-015.html
new file mode 100644
index 000000000..383c93b5e
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-015.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+ <title>No encoding declaration</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-input-byte-stream'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http'>
+<style type='text/css'>
+.test div { width: 50px; }</style>
+<link rel="stylesheet" type="text/css" href="support/encodingtests-utf8.css">
+</head>
+<body>
+
+
+
+<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>
+
+
+<!--Notes:
+
+The test on this page contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00FD;&#x00E4;&#x00E8;</code>. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "A page with no encoding information in HTTP, BOM, XML declaration or meta element will be treated as UTF-8.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-015.html.headers b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-015.html.headers
new file mode 100644
index 000000000..156209f9c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-015.html.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-016.html b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-016.html
new file mode 100644
index 000000000..141ca3e56
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-016.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" > <title>HTTP vs meta content</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-input-byte-stream'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http'>
+<style type='text/css'>
+.test div { width: 50px; }.test div { width: 90px; }
+</style>
+<link rel="stylesheet" type="text/css" href="support/encodingtests-15.css">
+</head>
+<body>
+
+
+
+<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>
+
+
+<!--Notes:
+
+The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-1.
+
+The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00C3;&#x0153;&#x00C3;&#x20AC;&#x00C3;&#x0161;</code>. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "The HTTP header has a higher precedence than an encoding declaration in a meta content attribute.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-016.html.headers b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-016.html.headers
new file mode 100644
index 000000000..3d9718c07
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-016.html.headers
@@ -0,0 +1 @@
+Content-Type: text/html; charset=iso-8859-15
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-018.html b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-018.html
new file mode 100644
index 000000000..9ee7510e5
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-018.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+ <meta charset="iso-8859-1" > <title>HTTP vs meta charset</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-input-byte-stream'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http'>
+<style type='text/css'>
+.test div { width: 50px; }.test div { width: 90px; }
+</style>
+<link rel="stylesheet" type="text/css" href="support/encodingtests-15.css">
+</head>
+<body>
+
+
+
+<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>
+
+
+<!--Notes:
+
+The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-1.
+
+The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00C3;&#x0153;&#x00C3;&#x20AC;&#x00C3;&#x0161;</code>. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "The HTTP header has a higher precedence than an encoding declaration in a meta charset attribute.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-018.html.headers b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-018.html.headers
new file mode 100644
index 000000000..3d9718c07
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-018.html.headers
@@ -0,0 +1 @@
+Content-Type: text/html; charset=iso-8859-15
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-030.html b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-030.html
new file mode 100644
index 000000000..5f8519992
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-030.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+ <meta charset="iso-8859-15" ><meta http-equiv="content-type" content="text/html;charset=iso-8859-1" > <title>meta charset, then meta content</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-input-byte-stream'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http'>
+<style type='text/css'>
+.test div { width: 50px; }.test div { width: 90px; }
+</style>
+<link rel="stylesheet" type="text/css" href="support/encodingtests-15.css">
+</head>
+<body>
+
+
+
+<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>
+
+
+<!--Notes:
+
+The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-15, followed by a meta content attribute that tries to set the encoding to ISO 8859-1.
+
+The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00C3;&#x0153;&#x00C3;&#x20AC;&#x00C3;&#x0161;</code>. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "An encoding declaration in a meta charset attribute has a higher precedence than a following encoding declaration in a meta charset attribute.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-030.html.headers b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-030.html.headers
new file mode 100644
index 000000000..156209f9c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-030.html.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-034.html b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-034.html
new file mode 100644
index 000000000..f0b699792
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-034.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+ <title>HTTP vs UTF-8 BOM</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-input-byte-stream'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http'>
+<style type='text/css'>
+.test div { width: 50px; }</style>
+<link rel="stylesheet" type="text/css" href="support/encodingtests-utf8.css">
+</head>
+<body>
+
+
+
+<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>
+
+
+<!--Notes:
+
+The HTTP header attempts to set the character encoding to ISO 8859-15. The page starts with a UTF-8 signature.
+
+The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00FD;&#x00E4;&#x00E8;</code>. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.
+
+If the test is unsuccessful, the characters &#x00EF;&#x00BB;&#x00BF; should appear at the top of the page. These represent the bytes that make up the UTF-8 signature when encountered in the ISO 8859-15 encoding.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "A character encoding set in the HTTP header has lower precedence than the UTF-8 signature.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-034.html.headers b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-034.html.headers
new file mode 100644
index 000000000..3d9718c07
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-034.html.headers
@@ -0,0 +1 @@
+Content-Type: text/html; charset=iso-8859-15
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-037.html b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-037.html
new file mode 100644
index 000000000..1fcf157b2
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-037.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-15"> <title>UTF-8 BOM vs meta content</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-input-byte-stream'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http'>
+<style type='text/css'>
+.test div { width: 50px; }</style>
+<link rel="stylesheet" type="text/css" href="support/encodingtests-utf8.css">
+</head>
+<body>
+
+
+
+<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>
+
+
+<!--Notes:
+
+The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.
+
+The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00FD;&#x00E4;&#x00E8;</code>. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta content attribute declares a different encoding.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-037.html.headers b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-037.html.headers
new file mode 100644
index 000000000..156209f9c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-037.html.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-038.html b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-038.html
new file mode 100644
index 000000000..9432113a2
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-038.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+ <meta charset="iso-8859-15"> <title>UTF-8 BOM vs meta charset</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-input-byte-stream'>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<meta name='flags' content='http'>
+<style type='text/css'>
+.test div { width: 50px; }.test div { width: 90px; }
+</style>
+<link rel="stylesheet" type="text/css" href="support/encodingtests-utf8.css">
+</head>
+<body>
+
+
+
+<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>
+
+
+<!--Notes:
+
+The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.
+
+The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00FD;&#x00E4;&#x00E8;</code>. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.
+
+-->
+<script>
+test(function() {
+assert_equals(document.getElementById('box').offsetWidth, 100);
+}, "A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta charset attribute declares a different encoding.");
+</script>
+
+<div id='log'></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-038.html.headers b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-038.html.headers
new file mode 100644
index 000000000..156209f9c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing-html-fragments/the-input-byte-stream-038.html.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/html/syntax/parsing/.gitkeep b/testing/web-platform/tests/html/syntax/parsing/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/.gitkeep
diff --git a/testing/web-platform/tests/html/syntax/parsing/DOMContentLoaded-defer-support.js b/testing/web-platform/tests/html/syntax/parsing/DOMContentLoaded-defer-support.js
new file mode 100644
index 000000000..28487111e
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/DOMContentLoaded-defer-support.js
@@ -0,0 +1,13 @@
+t.step(function() {
+ assert_false(dcl, "DOMContentLoaded should not have fired before executing " +
+ "a defer script");
+
+ setTimeout(t.step_func(function() {
+ assert_false(dcl, "DOMContentLoaded should not have fired before " +
+ "executing a task queued from a defer script");
+ setTimeout(t.step_func_done(function() {
+ assert_true(dcl, "DOMContentLoaded should have fired in a task that " +
+ "was queued after the DOMContentLoaded task was queued");
+ }), 0);
+ }), 0);
+});
diff --git a/testing/web-platform/tests/html/syntax/parsing/DOMContentLoaded-defer.html b/testing/web-platform/tests/html/syntax/parsing/DOMContentLoaded-defer.html
new file mode 100644
index 000000000..bf365c1a0
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/DOMContentLoaded-defer.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>The end: DOMContentLoaded and defer scripts</title>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#the-end">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var dcl;
+var t = async_test(function() {
+ dcl = false;
+ document.addEventListener("DOMContentLoaded", function(e) {
+ dcl = true;
+ });
+});
+</script>
+<script defer src=DOMContentLoaded-defer-support.js></script>
diff --git a/testing/web-platform/tests/html/syntax/parsing/Document.getElementsByTagName-foreign-01.html b/testing/web-platform/tests/html/syntax/parsing/Document.getElementsByTagName-foreign-01.html
new file mode 100644
index 000000000..2bdc83145
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/Document.getElementsByTagName-foreign-01.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<title>document.getElementsByTagName and foreign parser-inserted
+elements</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://dom.spec.whatwg.org/#dom-document-getelementsbytagname">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#parsing">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<svg>
+<altglyph/>
+ <altglyphdef/>
+ <altglyphitem/>
+ <animatecolor/>
+ <animatemotion/>
+ <animatetransform/>
+ <clippath/>
+ <feblend/>
+ <fecolormatrix/>
+ <fecomponenttransfer/>
+ <fecomposite/>
+ <feconvolvematrix/>
+ <fediffuselighting/>
+ <fedisplacementmap/>
+ <fedistantlight/>
+ <feflood/>
+ <fefunca/>
+ <fefuncb/>
+ <fefuncg/>
+ <fefuncr/>
+ <fegaussianblur/>
+ <feimage/>
+ <femerge/>
+ <femergenode/>
+ <femorphology/>
+ <feoffset/>
+ <fepointlight/>
+ <fespecularlighting/>
+ <fespotlight/>
+ <fetile/>
+ <feturbulence/>
+ <foreignobject/>
+ <glyphref/>
+ <lineargradient/>
+ <radialgradient/>
+ <textpath/>
+ <ALTGLYPH/>
+ <ALTGLYPHDEF/>
+ <ALTGLYPHITEM/>
+ <ANIMATECOLOR/>
+ <ANIMATEMOTION/>
+ <ANIMATETRANSFORM/>
+ <CLIPPATH/>
+ <FEBLEND/>
+ <FECOLORMATRIX/>
+ <FECOMPONENTTRANSFER/>
+ <FECOMPOSITE/>
+ <FECONVOLVEMATRIX/>
+ <FEDIFFUSELIGHTING/>
+ <FEDISPLACEMENTMAP/>
+ <FEDISTANTLIGHT/>
+ <FEFLOOD/>
+ <FEFUNCA/>
+ <FEFUNCB/>
+ <FEFUNCG/>
+ <FEFUNCR/>
+ <FEGAUSSIANBLUR/>
+ <FEIMAGE/>
+ <FEMERGE/>
+ <FEMERGENODE/>
+ <FEMORPHOLOGY/>
+ <FEOFFSET/>
+ <FEPOINTLIGHT/>
+ <FESPECULARLIGHTING/>
+ <FESPOTLIGHT/>
+ <FETILE/>
+ <FETURBULENCE/>
+ <FOREIGNOBJECT/>
+ <GLYPHREF/>
+ <LINEARGRADIENT/>
+ <RADIALGRADIENT/>
+ <TEXTPATH/>
+</svg>
+<script>
+var elements = [
+ "altGlyph",
+ "altGlyphDef",
+ "altGlyphItem",
+ "animateColor",
+ "animateMotion",
+ "animateTransform",
+ "clipPath",
+ "feBlend",
+ "feColorMatrix",
+ "feComponentTransfer",
+ "feComposite",
+ "feConvolveMatrix",
+ "feDiffuseLighting",
+ "feDisplacementMap",
+ "feDistantLight",
+ "feFlood",
+ "feFuncA",
+ "feFuncB",
+ "feFuncG",
+ "feFuncR",
+ "feGaussianBlur",
+ "feImage",
+ "feMerge",
+ "feMergeNode",
+ "feMorphology",
+ "feOffset",
+ "fePointLight",
+ "feSpecularLighting",
+ "feSpotLight",
+ "feTile",
+ "feTurbulence",
+ "foreignObject",
+ "glyphRef",
+ "linearGradient",
+ "radialGradient",
+ "textPath"];
+</script>
+</div>
+<script>
+var SVG = "http://www.w3.org/2000/svg";
+function t(el) {
+ assert_equals(document.getElementsByTagName(el).length, 2);
+ assert_equals(document.getElementsByTagName(el.toUpperCase()).length, 0);
+ assert_equals(document.getElementsByTagName(el.toLowerCase()).length, 0);
+ assert_equals(document.getElementsByTagNameNS(SVG, el).length, 2);
+ assert_equals(document.getElementsByTagNameNS(SVG, el.toUpperCase()).length, 0);
+ assert_equals(document.getElementsByTagNameNS(SVG, el.toLowerCase()).length, 0);
+}
+test(function() {
+ var tests = [];
+ assert_equals(document.getElementsByTagName('svg').length, 1);
+ for (var i = 0, il = elements.length; i < il; ++i) {
+ tests.push(["Testing " + elements[i], elements[i]]);
+ }
+ generate_tests(t, tests);
+});
+</script>
diff --git a/testing/web-platform/tests/html/syntax/parsing/Document.getElementsByTagName-foreign-02.html b/testing/web-platform/tests/html/syntax/parsing/Document.getElementsByTagName-foreign-02.html
new file mode 100644
index 000000000..1109a24cf
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/Document.getElementsByTagName-foreign-02.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<title>getElementsByTagName and font</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://dom.spec.whatwg.org/#dom-document-getelementsbytagname">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#parsing">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<font></font>
+<svg><font/></svg>
+</div>
+<script>
+var HTML = "http://www.w3.org/1999/xhtml", SVG = "http://www.w3.org/2000/svg";
+test(function() {
+ assert_equals(document.getElementsByTagName("FONT").length, 1);
+ assert_equals(document.getElementsByTagName("FONT")[0].namespaceURI, HTML);
+}, "Upper-case font")
+test(function() {
+ assert_equals(document.getElementsByTagName("font").length, 2);
+ assert_equals(document.getElementsByTagName("font")[0].namespaceURI, HTML);
+ assert_equals(document.getElementsByTagName("font")[1].namespaceURI, SVG);
+}, "Lower-case font")
+</script>
diff --git a/testing/web-platform/tests/html/syntax/parsing/Element.getElementsByTagName-foreign-01.html b/testing/web-platform/tests/html/syntax/parsing/Element.getElementsByTagName-foreign-01.html
new file mode 100644
index 000000000..cbad9f6d1
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/Element.getElementsByTagName-foreign-01.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>getElementsByTagName and font</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://dom.spec.whatwg.org/#dom-element-getelementsbytagname">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#parsing">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<font></font>
+<svg><font/></svg>
+</div>
+<script>
+var HTML = "http://www.w3.org/1999/xhtml", SVG = "http://www.w3.org/2000/svg";
+var wrapper = document.getElementById("test");
+test(function() {
+ assert_equals(wrapper.getElementsByTagName("FONT").length, 1);
+ assert_equals(wrapper.getElementsByTagName("FONT")[0].namespaceURI, HTML);
+}, "Upper-case font")
+test(function() {
+ assert_equals(wrapper.getElementsByTagName("font").length, 2);
+ assert_equals(wrapper.getElementsByTagName("font")[0].namespaceURI, HTML);
+ assert_equals(wrapper.getElementsByTagName("font")[1].namespaceURI, SVG);
+}, "Lower-case font")
+</script>
diff --git a/testing/web-platform/tests/html/syntax/parsing/Element.getElementsByTagName-foreign-02.html b/testing/web-platform/tests/html/syntax/parsing/Element.getElementsByTagName-foreign-02.html
new file mode 100644
index 000000000..aabb169b1
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/Element.getElementsByTagName-foreign-02.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>getElementsByTagName and font</title>
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://dom.spec.whatwg.org/#dom-element-getelementsbytagname">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#parsing">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div id="test">
+<svg id="outer">
+<foreignObject>
+<font></font>
+<svg><font/></svg>
+</foreignObject>
+</svg>
+</div>
+<script>
+var HTML = "http://www.w3.org/1999/xhtml", SVG = "http://www.w3.org/2000/svg";
+var wrapper = document.getElementById("outer");
+test(function() {
+ assert_equals(wrapper.getElementsByTagName("FONT").length, 1);
+ assert_equals(wrapper.getElementsByTagName("FONT")[0].namespaceURI, HTML);
+}, "Upper-case font")
+test(function() {
+ assert_equals(wrapper.getElementsByTagName("font").length, 2);
+ assert_equals(wrapper.getElementsByTagName("font")[0].namespaceURI, HTML);
+ assert_equals(wrapper.getElementsByTagName("font")[1].namespaceURI, SVG);
+}, "Lower-case font")
+</script>
diff --git a/testing/web-platform/tests/html/syntax/parsing/README b/testing/web-platform/tests/html/syntax/parsing/README
new file mode 100644
index 000000000..343ebaff7
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/README
@@ -0,0 +1,4 @@
+Note: the html5lib_* files in this directory are autogenerated.
+
+To update them use the script /html/tools/update_html5lib_tests.py.
+Further instructions are provided in that file. \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/common.js b/testing/web-platform/tests/html/syntax/parsing/common.js
new file mode 100644
index 000000000..b3ac9ece7
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/common.js
@@ -0,0 +1,24 @@
+function mark_diffs(expected, actual) {
+ var expected_lines = expected.split("\n");
+ var actual_lines = actual.split("\n");
+
+ var max_length = Math.max(expected_lines.length, actual_lines.length);
+
+ var expected_diff = ["code", {}];
+ var actual_diff = ["code", {}];
+
+ for (var i=0; i<max_length; i++) {
+ if (expected_lines[i] === actual_lines[i]) {
+ expected_diff.push(expected_lines[i] + "\n");
+ actual_diff.push(actual_lines[i] + "\n");
+ } else {
+ if (expected_lines[i]) {
+ expected_diff.push(["span", {style:"color:red"}, expected_lines[i] + "\n"]);
+ }
+ if (actual_lines[i]) {
+ actual_diff.push(["span", {style:"color:red"}, actual_lines[i] + "\n"]);
+ }
+ }
+ }
+ return [expected_diff, actual_diff];
+}
diff --git a/testing/web-platform/tests/html/syntax/parsing/contains.json b/testing/web-platform/tests/html/syntax/parsing/contains.json
new file mode 100644
index 000000000..249c9fe01
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/contains.json
@@ -0,0 +1,490 @@
+[
+ {
+ "id": "overview-of-the-parsing-model",
+ "original_id": "overview-of-the-parsing-model"
+ },
+ {
+ "id": "the-input-byte-stream",
+ "original_id": "the-input-byte-stream",
+ "children": [
+ {
+ "id": "determining-the-character-encoding",
+ "original_id": "determining-the-character-encoding"
+ },
+ {
+ "id": "character-encodings-0",
+ "original_id": "character-encodings-0"
+ },
+ {
+ "id": "changing-the-encoding-while-parsing",
+ "original_id": "changing-the-encoding-while-parsing"
+ },
+ {
+ "id": "preprocessing-the-input-stream",
+ "original_id": "preprocessing-the-input-stream"
+ }
+ ]
+ },
+ {
+ "id": "parse-state",
+ "original_id": "parse-state",
+ "children": [
+ {
+ "id": "the-insertion-mode",
+ "original_id": "the-insertion-mode"
+ },
+ {
+ "id": "the-stack-of-open-elements",
+ "original_id": "the-stack-of-open-elements"
+ },
+ {
+ "id": "the-list-of-active-formatting-elements",
+ "original_id": "the-list-of-active-formatting-elements"
+ },
+ {
+ "id": "the-element-pointers",
+ "original_id": "the-element-pointers"
+ },
+ {
+ "id": "other-parsing-state-flags",
+ "original_id": "other-parsing-state-flags"
+ }
+ ]
+ },
+ {
+ "id": "tokenization",
+ "original_id": "tokenization",
+ "children": [
+ {
+ "id": "data-state",
+ "original_id": "data-state"
+ },
+ {
+ "id": "character-reference-in-data-state",
+ "original_id": "character-reference-in-data-state"
+ },
+ {
+ "id": "rcdata-state",
+ "original_id": "rcdata-state"
+ },
+ {
+ "id": "character-reference-in-rcdata-state",
+ "original_id": "character-reference-in-rcdata-state"
+ },
+ {
+ "id": "rawtext-state",
+ "original_id": "rawtext-state"
+ },
+ {
+ "id": "script-data-state",
+ "original_id": "script-data-state"
+ },
+ {
+ "id": "plaintext-state",
+ "original_id": "plaintext-state"
+ },
+ {
+ "id": "tag-open-state",
+ "original_id": "tag-open-state"
+ },
+ {
+ "id": "end-tag-open-state",
+ "original_id": "end-tag-open-state"
+ },
+ {
+ "id": "tag-name-state",
+ "original_id": "tag-name-state"
+ },
+ {
+ "id": "rcdata-less-than-sign-state",
+ "original_id": "rcdata-less-than-sign-state"
+ },
+ {
+ "id": "rcdata-end-tag-open-state",
+ "original_id": "rcdata-end-tag-open-state"
+ },
+ {
+ "id": "rcdata-end-tag-name-state",
+ "original_id": "rcdata-end-tag-name-state"
+ },
+ {
+ "id": "rawtext-less-than-sign-state",
+ "original_id": "rawtext-less-than-sign-state"
+ },
+ {
+ "id": "rawtext-end-tag-open-state",
+ "original_id": "rawtext-end-tag-open-state"
+ },
+ {
+ "id": "rawtext-end-tag-name-state",
+ "original_id": "rawtext-end-tag-name-state"
+ },
+ {
+ "id": "script-data-less-than-sign-state",
+ "original_id": "script-data-less-than-sign-state"
+ },
+ {
+ "id": "script-data-end-tag-open-state",
+ "original_id": "script-data-end-tag-open-state"
+ },
+ {
+ "id": "script-data-end-tag-name-state",
+ "original_id": "script-data-end-tag-name-state"
+ },
+ {
+ "id": "script-data-escape-start-state",
+ "original_id": "script-data-escape-start-state"
+ },
+ {
+ "id": "script-data-escape-start-dash-state",
+ "original_id": "script-data-escape-start-dash-state"
+ },
+ {
+ "id": "script-data-escaped-state",
+ "original_id": "script-data-escaped-state"
+ },
+ {
+ "id": "script-data-escaped-dash-state",
+ "original_id": "script-data-escaped-dash-state"
+ },
+ {
+ "id": "script-data-escaped-dash-dash-state",
+ "original_id": "script-data-escaped-dash-dash-state"
+ },
+ {
+ "id": "script-data-escaped-less-than-sign-state",
+ "original_id": "script-data-escaped-less-than-sign-state"
+ },
+ {
+ "id": "script-data-escaped-end-tag-open-state",
+ "original_id": "script-data-escaped-end-tag-open-state"
+ },
+ {
+ "id": "script-data-escaped-end-tag-name-state",
+ "original_id": "script-data-escaped-end-tag-name-state"
+ },
+ {
+ "id": "script-data-double-escape-start-state",
+ "original_id": "script-data-double-escape-start-state"
+ },
+ {
+ "id": "script-data-double-escaped-state",
+ "original_id": "script-data-double-escaped-state"
+ },
+ {
+ "id": "script-data-double-escaped-dash-state",
+ "original_id": "script-data-double-escaped-dash-state"
+ },
+ {
+ "id": "script-data-double-escaped-dash-dash-state",
+ "original_id": "script-data-double-escaped-dash-dash-state"
+ },
+ {
+ "id": "script-data-double-escaped-less-than-sign-state",
+ "original_id": "script-data-double-escaped-less-than-sign-state"
+ },
+ {
+ "id": "script-data-double-escape-end-state",
+ "original_id": "script-data-double-escape-end-state"
+ },
+ {
+ "id": "before-attribute-name-state",
+ "original_id": "before-attribute-name-state"
+ },
+ {
+ "id": "attribute-name-state",
+ "original_id": "attribute-name-state"
+ },
+ {
+ "id": "after-attribute-name-state",
+ "original_id": "after-attribute-name-state"
+ },
+ {
+ "id": "before-attribute-value-state",
+ "original_id": "before-attribute-value-state"
+ },
+ {
+ "id": "attribute-value-double-quoted-state",
+ "original_id": "attribute-value-(double-quoted)-state"
+ },
+ {
+ "id": "attribute-value-single-quoted-state",
+ "original_id": "attribute-value-(single-quoted)-state"
+ },
+ {
+ "id": "attribute-value-unquoted-state",
+ "original_id": "attribute-value-(unquoted)-state"
+ },
+ {
+ "id": "character-reference-in-attribute-value-state",
+ "original_id": "character-reference-in-attribute-value-state"
+ },
+ {
+ "id": "after-attribute-value-quoted-state",
+ "original_id": "after-attribute-value-(quoted)-state"
+ },
+ {
+ "id": "self-closing-start-tag-state",
+ "original_id": "self-closing-start-tag-state"
+ },
+ {
+ "id": "bogus-comment-state",
+ "original_id": "bogus-comment-state"
+ },
+ {
+ "id": "markup-declaration-open-state",
+ "original_id": "markup-declaration-open-state"
+ },
+ {
+ "id": "comment-start-state",
+ "original_id": "comment-start-state"
+ },
+ {
+ "id": "comment-start-dash-state",
+ "original_id": "comment-start-dash-state"
+ },
+ {
+ "id": "comment-state",
+ "original_id": "comment-state"
+ },
+ {
+ "id": "comment-end-dash-state",
+ "original_id": "comment-end-dash-state"
+ },
+ {
+ "id": "comment-end-state",
+ "original_id": "comment-end-state"
+ },
+ {
+ "id": "comment-end-bang-state",
+ "original_id": "comment-end-bang-state"
+ },
+ {
+ "id": "doctype-state",
+ "original_id": "doctype-state"
+ },
+ {
+ "id": "before-doctype-name-state",
+ "original_id": "before-doctype-name-state"
+ },
+ {
+ "id": "doctype-name-state",
+ "original_id": "doctype-name-state"
+ },
+ {
+ "id": "after-doctype-name-state",
+ "original_id": "after-doctype-name-state"
+ },
+ {
+ "id": "after-doctype-public-keyword-state",
+ "original_id": "after-doctype-public-keyword-state"
+ },
+ {
+ "id": "before-doctype-public-identifier-state",
+ "original_id": "before-doctype-public-identifier-state"
+ },
+ {
+ "id": "doctype-public-identifier-double-quoted-state",
+ "original_id": "doctype-public-identifier-(double-quoted)-state"
+ },
+ {
+ "id": "doctype-public-identifier-single-quoted-state",
+ "original_id": "doctype-public-identifier-(single-quoted)-state"
+ },
+ {
+ "id": "after-doctype-public-identifier-state",
+ "original_id": "after-doctype-public-identifier-state"
+ },
+ {
+ "id": "between-doctype-public-and-system-identifiers-state",
+ "original_id": "between-doctype-public-and-system-identifiers-state"
+ },
+ {
+ "id": "after-doctype-system-keyword-state",
+ "original_id": "after-doctype-system-keyword-state"
+ },
+ {
+ "id": "before-doctype-system-identifier-state",
+ "original_id": "before-doctype-system-identifier-state"
+ },
+ {
+ "id": "doctype-system-identifier-double-quoted-state",
+ "original_id": "doctype-system-identifier-(double-quoted)-state"
+ },
+ {
+ "id": "doctype-system-identifier-single-quoted-state",
+ "original_id": "doctype-system-identifier-(single-quoted)-state"
+ },
+ {
+ "id": "after-doctype-system-identifier-state",
+ "original_id": "after-doctype-system-identifier-state"
+ },
+ {
+ "id": "bogus-doctype-state",
+ "original_id": "bogus-doctype-state"
+ },
+ {
+ "id": "cdata-section-state",
+ "original_id": "cdata-section-state"
+ },
+ {
+ "id": "tokenizing-character-references",
+ "original_id": "tokenizing-character-references"
+ }
+ ]
+ },
+ {
+ "id": "tree-construction",
+ "original_id": "tree-construction",
+ "children": [
+ {
+ "id": "creating-and-inserting-elements",
+ "original_id": "creating-and-inserting-elements"
+ },
+ {
+ "id": "closing-elements-that-have-implied-end-tags",
+ "original_id": "closing-elements-that-have-implied-end-tags"
+ },
+ {
+ "id": "foster-parenting",
+ "original_id": "foster-parenting"
+ },
+ {
+ "id": "parsing-main-inhtml",
+ "original_id": "parsing-main-inhtml",
+ "children": [
+ {
+ "id": "the-initial-insertion-mode",
+ "original_id": "the-initial-insertion-mode"
+ },
+ {
+ "id": "the-before-html-insertion-mode",
+ "original_id": "the-before-html-insertion-mode"
+ },
+ {
+ "id": "the-before-head-insertion-mode",
+ "original_id": "the-before-head-insertion-mode"
+ },
+ {
+ "id": "parsing-main-inhead",
+ "original_id": "parsing-main-inhead"
+ },
+ {
+ "id": "parsing-main-inheadnoscript",
+ "original_id": "parsing-main-inheadnoscript"
+ },
+ {
+ "id": "the-after-head-insertion-mode",
+ "original_id": "the-after-head-insertion-mode"
+ },
+ {
+ "id": "parsing-main-inbody",
+ "original_id": "parsing-main-inbody"
+ },
+ {
+ "id": "parsing-main-incdata",
+ "original_id": "parsing-main-incdata"
+ },
+ {
+ "id": "parsing-main-intable",
+ "original_id": "parsing-main-intable"
+ },
+ {
+ "id": "parsing-main-intabletext",
+ "original_id": "parsing-main-intabletext"
+ },
+ {
+ "id": "parsing-main-incaption",
+ "original_id": "parsing-main-incaption"
+ },
+ {
+ "id": "parsing-main-incolgroup",
+ "original_id": "parsing-main-incolgroup"
+ },
+ {
+ "id": "parsing-main-intbody",
+ "original_id": "parsing-main-intbody"
+ },
+ {
+ "id": "parsing-main-intr",
+ "original_id": "parsing-main-intr"
+ },
+ {
+ "id": "parsing-main-intd",
+ "original_id": "parsing-main-intd"
+ },
+ {
+ "id": "parsing-main-inselect",
+ "original_id": "parsing-main-inselect"
+ },
+ {
+ "id": "parsing-main-inselectintable",
+ "original_id": "parsing-main-inselectintable"
+ },
+ {
+ "id": "parsing-main-afterbody",
+ "original_id": "parsing-main-afterbody"
+ },
+ {
+ "id": "parsing-main-inframeset",
+ "original_id": "parsing-main-inframeset"
+ },
+ {
+ "id": "parsing-main-afterframeset",
+ "original_id": "parsing-main-afterframeset"
+ },
+ {
+ "id": "the-after-after-body-insertion-mode",
+ "original_id": "the-after-after-body-insertion-mode"
+ },
+ {
+ "id": "the-after-after-frameset-insertion-mode",
+ "original_id": "the-after-after-frameset-insertion-mode"
+ }
+ ]
+ },
+ {
+ "id": "parsing-main-inforeign",
+ "original_id": "parsing-main-inforeign"
+ }
+ ]
+ },
+ {
+ "id": "the-end",
+ "original_id": "the-end"
+ },
+ {
+ "id": "coercing-an-html-dom-into-an-infoset",
+ "original_id": "coercing-an-html-dom-into-an-infoset"
+ },
+ {
+ "id": "an-introduction-to-error-handling-and-strange-cases-in-the-parser",
+ "original_id": "an-introduction-to-error-handling-and-strange-cases-in-the-parser",
+ "children": [
+ {
+ "id": "misnested-tags-b-i-b-i",
+ "original_id": "misnested-tags:-b-i-/b-/i"
+ },
+ {
+ "id": "misnested-tags-b-p-b-p",
+ "original_id": "misnested-tags:-b-p-/b-/p"
+ },
+ {
+ "id": "unexpected-markup-in-tables",
+ "original_id": "unexpected-markup-in-tables"
+ },
+ {
+ "id": "scripts-that-modify-the-page-as-it-is-being-parsed",
+ "original_id": "scripts-that-modify-the-page-as-it-is-being-parsed"
+ },
+ {
+ "id": "the-execution-of-scripts-that-are-moving-across-multiple-documents",
+ "original_id": "the-execution-of-scripts-that-are-moving-across-multiple-documents"
+ },
+ {
+ "id": "unclosed-formatting-elements",
+ "original_id": "unclosed-formatting-elements"
+ }
+ ]
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/foreign_content_001.html b/testing/web-platform/tests/html/syntax/parsing/foreign_content_001.html
new file mode 100644
index 000000000..10ebaa843
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/foreign_content_001.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML 5 Foreign Content SVG in HTML </title>
+ <meta description="Test to verify SVG inside HTML OBJECT element parses correctly" />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+
+ <script type="text/javascript">
+ function RunTest()
+ {
+ try
+ {
+ var svgNS = "http://www.w3.org/2000/svg";
+ if(document.getElementsByTagName("object")[0].childNodes[1].localName=="svg" && document.getElementsByTagName("rect")[0].namespaceURI==svgNS)
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","green");
+ }
+ else
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","red");
+ }
+ }
+ catch(ex)
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","red")
+ }
+ }
+ </script>
+ </head>
+
+ <body onLoad="RunTest()">
+ <div class="testdata">
+ <p id="instructions"> Test passes if a green rectangle is visible on the page below this line. </p>
+ </div>
+
+ <object>
+ <svg width="100px" height="100px" >
+ <rect width="100px" height="100px" fill="none"/>
+ </svg>
+ </object>
+ </body>
+
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/foreign_content_003.html b/testing/web-platform/tests/html/syntax/parsing/foreign_content_003.html
new file mode 100644
index 000000000..320a94409
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/foreign_content_003.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML 5 Foreign Content SVG in HTML </title>
+ <meta description="Test to verify SVG inside HTML BUTTON element parses correctly" />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+
+ <script type="text/javascript">
+ function RunTest()
+ {
+ try
+ {
+ var svgNS = "http://www.w3.org/2000/svg";
+ if(document.getElementsByTagName("button")[0].childNodes[1].localName=="svg" && document.getElementsByTagName("rect")[0].namespaceURI==svgNS)
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","green");
+ }
+ else
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","red");
+ }
+ }
+ catch(ex)
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","red")
+ }
+ }
+ </script>
+ </head>
+
+ <body onLoad="RunTest()">
+
+ <div class="testdata">
+ <p id="instructions">Test passes if the button has a green rectangle while 'FillerText1' and 'FillerText3' are on either side of the button.</p>
+ </div>
+ <div>
+ FillerText1
+ <button>
+ <svg width="100px" height="100px">
+ <rect width="100px" height="100px" fill="none" />
+ </svg>
+
+ </button>
+ FillerText3
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/foreign_content_004.html b/testing/web-platform/tests/html/syntax/parsing/foreign_content_004.html
new file mode 100644
index 000000000..eec49a81d
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/foreign_content_004.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML 5 Foreign Content SVG in HTML </title>
+ <meta description="Test to verify SVG inside HTML CAPTION element parses correctly" />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+
+ <script type="text/javascript">
+ function RunTest()
+ {
+ try
+ {
+ var svgNS = "http://www.w3.org/2000/svg";
+ if(document.getElementsByTagName("caption")[0].childNodes[1].localName=="svg" && document.getElementsByTagName("rect")[0].namespaceURI==svgNS)
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","green");
+ }
+ else
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","red");
+ }
+ }
+ catch(ex)
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","red")
+ }
+ }
+ </script>
+ </head>
+
+ <body onLoad="RunTest()">
+ <div class="testdata">
+ <p id="instructions">Test passes if a green square appears above and centered relative to the table.</p>
+ </div>
+ <div>
+ <table border="1">
+ <caption>
+ <svg width="100px" height="100px">
+ <rect width="100px" height="100px" fill="none" />
+ </svg>
+ </caption>
+ <thead>
+ <th>FillerText</th>
+ <th>FillerText</th>
+ <th>FillerText</th>
+ </thead>
+ <tr>
+ <td>FillerText</td>
+ <td>FillerText</td>
+ <td>FillerText</td>
+ </tr>
+ <tr>
+ <td>FillerText</td>
+ <td>FillerText</td>
+ <td>FillerText</td>
+ </tr>
+ <tr>
+ <td>FillerText</td>
+ <td>FillerText</td>
+ <td>FillerText</td>
+ </tr>
+ </table>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/foreign_content_005.html b/testing/web-platform/tests/html/syntax/parsing/foreign_content_005.html
new file mode 100644
index 000000000..b8629dc7c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/foreign_content_005.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML 5 Foreign Content SVG in HTML </title>
+ <meta description="Test to verify SVG inside HTML FORM element parses correctly" />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+
+ <script type="text/javascript">
+ function RunTest()
+ {
+ try
+ {
+ var svgNS = "http://www.w3.org/2000/svg";
+ if(document.getElementsByTagName("form")[0].childNodes[1].localName=="svg" && document.getElementsByTagName("rect")[0].namespaceURI==svgNS)
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","green");
+ }
+ else
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","red");
+ }
+ }
+ catch(ex)
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","red")
+ }
+ }
+ </script>
+ </head>
+
+ <body onLoad="RunTest()">
+ <div class="testdata">
+ <p id="instructions">Test passes if green rectangle is visible below 'FillerText1'.</p>
+ </div>
+ <div>
+ FillerText1
+ <form>
+ <svg width="100px" height="100px">
+ <rect width="100px" height="100px" fill="none" />
+ </svg>
+ </form>
+
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/foreign_content_006.html b/testing/web-platform/tests/html/syntax/parsing/foreign_content_006.html
new file mode 100644
index 000000000..36acda8fc
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/foreign_content_006.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <svg width="100px" height="100px">
+ <rect width="100px" height="100px" fill="none" />
+ </svg>
+
+ <head>
+ <title>HTML 5 Foreign Content SVG in HTML </title>
+ <meta description="Test to verify SVG inside HTML 'HTML' element parses correctly" />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <script type="text/javascript">
+ function RunTest()
+ {
+ try
+ {
+ if(document.body.childNodes[0].localName=="svg")
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","green");
+ }
+ else
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","red");
+ }
+ }
+ catch(ex)
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","red")
+ }
+ }
+ </script>
+ </head>
+
+ <body onLoad="RunTest()">
+ <div class="testdata">
+ <p id="instructions">Test passes if a green rectangle is visible on the page above this line.</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/foreign_content_008.html b/testing/web-platform/tests/html/syntax/parsing/foreign_content_008.html
new file mode 100644
index 000000000..348ff0b71
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/foreign_content_008.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML 5 Foreign Content SVG in HTML </title>
+ <meta description="Test to verify SVG inside HTML 'BODY' element parses correctly" />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+
+ <script type="text/javascript">
+ function RunTest()
+ {
+ try
+ {
+ if(document.body.childNodes[3].localName=="svg")
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","green");
+ }
+ else
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","red");
+ }
+ }
+ catch(ex)
+ {
+ document.getElementsByTagName("rect")[0].setAttribute("fill","red")
+ }
+ }
+ </script>
+ </head>
+
+ <body onLoad="RunTest()">
+ <div class="testdata">
+ <p id="instructions"> Test passes if a green rectangle is visible on the page below this line. </p>
+ </div>
+ <svg width="100px" height="100px" >
+ <rect x="0" y="0" width="100px" height="100px" />
+ </svg>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/foreign_content_009.html b/testing/web-platform/tests/html/syntax/parsing/foreign_content_009.html
new file mode 100644
index 000000000..364dd8578
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/foreign_content_009.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML 5 Foreign Content SVG in HTML </title>
+ <meta description="Test to verify SVG Self Closing tags parses properly" />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+
+ <script type="text/javascript">
+ function RunTest()
+ {
+ try
+ {
+ var parentNode = document.getElementById("rect1");
+ if(parentNode.childNodes[1].localName=="circle")
+ {
+ document.getElementById("testresult").innerHTML = "PASS";
+ }
+ else
+ {
+ document.getElementById("testresult").innerHTML = "FAIL"
+ }
+ }
+ catch(ex)
+ {
+ document.getElementById("testresult").innerHTML = "FAIL";
+ }
+ }
+ </script>
+ </head>
+
+ <body onload="RunTest()">
+ <div class="testdata">
+ <p id="instructions"> Test passes if the word "PASS" appears below </p>
+ <p> Test Result : </p>
+ <p id="testresult"> RUNNING </div>
+ </div>
+
+ <svg width="100px" height="100px">
+ <rect id="rect1" >
+ <circle> </circle>
+ </rect>
+ </svg>
+
+ </body>
+
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/foreign_content_010.html b/testing/web-platform/tests/html/syntax/parsing/foreign_content_010.html
new file mode 100644
index 000000000..11e1bf100
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/foreign_content_010.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML 5 Foreign Content SVG in HTML </title>
+ <meta description="Test to verify SVG Self Closing tags parses properly" />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+
+ <script type="text/javascript">
+ function RunTest()
+ {
+ try
+ {
+ var parentNode = document.getElementById("svg1");
+ if(parentNode.childNodes[1].localName=="rect" && parentNode.childNodes[3].localName=="circle")
+ {
+ document.getElementById("testresult").innerHTML = "PASS";
+ }
+ else
+ {
+ document.getElementById("testresult").innerHTML = "FAIL"
+ }
+ }
+ catch(ex)
+ {
+ document.getElementById("testresult").innerHTML = "FAIL";
+ }
+ }
+ </script>
+ </head>
+
+ <body onload="RunTest()">
+
+ <div class="testdata">
+ <p id="instructions"> Test passes if the word "PASS" appears below </p>
+ <p> Test Result : </p>
+ <p id="testresult"> RUNNING </div>
+ </div>
+ <svg id="svg1" width="100px" height="100px">
+ <rect id="rect1" />
+ <circle id="circle1" />
+ </svg>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/foreign_content_011.html b/testing/web-platform/tests/html/syntax/parsing/foreign_content_011.html
new file mode 100644
index 000000000..a8a9d7a1b
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/foreign_content_011.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML 5 Foreign Content SVG in HTML </title>
+ <meta description="Test to verify SVG elements are styled using ID Selector" />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+
+ <style>
+ #d1
+ {
+ fill: green;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div class="testdata">
+ <p id="instructions">Test passes if a green square is visible below this line.</p>
+ </div>
+ <div id="d1">
+ <svg width="100px" height="100px">
+ <rect width="100px" height="100px" />
+ </svg>
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/foreign_content_013.html b/testing/web-platform/tests/html/syntax/parsing/foreign_content_013.html
new file mode 100644
index 000000000..e88aae9e4
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/foreign_content_013.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML 5 Foreign Content SVG in HTML </title>
+ <meta description="Test to verify SVG elements are styled using CLASS Selector" />
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+
+ <style>
+ .svg1
+ {
+ fill: green ;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div class="testdata">
+ <p id="instructions">Test passes if a green square is visible below this line. </p>
+ </div>
+ <div id="d1">
+ <svg class="svg1" width="100px" height="100px">
+ <rect width="100px" height="100px"/>
+ </svg>
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_adoption01.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_adoption01.html
new file mode 100644
index 000000000..87664da77
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_adoption01.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_adoption01.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['dab5eca760a630bc57719d678d789dd1ca74f492','a3a46907dc73b7be1e1171f797a9f696b7fb185b','b720cd1d95283d6288e7ca17142540b10ef8f847','83b2bd6f0849b2c7283448f15095806a17c7f0c0','1d56fa2d9d756f9053638a3db25fcd84e57e41ec','c129fce97933067558d7833632ad7ef2d149616e','39a3ec04f54cda2bf1e06c54caf0b302da4fd252','d0bdfe6be48309b2d01b497667b350a8e6ec8ffb','63401082c6afd4b3c3201e348a1a61722f167b21','883cfd89f63da854dffbfbc938da1f31887a55e5','4dc0665051dac0d72c71aba5c95c5b86437dea2c','4f376c0a798e71a91065e215dc0175d3107d5208','52b62611a847a3f5fc3dc607a6b0174f1697247c','88d0d3403d2a7b4058fcfb4e62835acb1c207e0f','d7338f457789f65d47b240e203b9e40a3925f2ca','bf8088acd8bd48d8487bae49a613c248c488c041','39edaa2e298c60ad4a1b0b9fdb4481d4aea98f36',];
+ var tests = {
+ "dab5eca760a630bc57719d678d789dd1ca74f492":[async_test('html5lib_adoption01.html dab5eca760a630bc57719d678d789dd1ca74f492'), "%3Ca%3E%3Cp%3E%3C/a%3E%3C/p%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E"],"a3a46907dc73b7be1e1171f797a9f696b7fb185b":[async_test('html5lib_adoption01.html a3a46907dc73b7be1e1171f797a9f696b7fb185b'), "%3Ca%3E1%3Cp%3E2%3C/a%3E3%3C/p%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%20%20%223%22"],"b720cd1d95283d6288e7ca17142540b10ef8f847":[async_test('html5lib_adoption01.html b720cd1d95283d6288e7ca17142540b10ef8f847'), "%3Ca%3E1%3Cbutton%3E2%3C/a%3E3%3C/button%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%20%20%223%22"],"83b2bd6f0849b2c7283448f15095806a17c7f0c0":[async_test('html5lib_adoption01.html 83b2bd6f0849b2c7283448f15095806a17c7f0c0'), "%3Ca%3E1%3Cb%3E2%3C/a%3E3%3C/b%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%223%22"],"1d56fa2d9d756f9053638a3db25fcd84e57e41ec":[async_test('html5lib_adoption01.html 1d56fa2d9d756f9053638a3db25fcd84e57e41ec'), "%3Ca%3E1%3Cdiv%3E2%3Cdiv%3E3%3C/a%3E4%3C/div%3E5%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%223%22%0A%7C%20%20%20%20%20%20%20%20%20%224%22%0A%7C%20%20%20%20%20%20%20%225%22"],"c129fce97933067558d7833632ad7ef2d149616e":[async_test('html5lib_adoption01.html c129fce97933067558d7833632ad7ef2d149616e'), "%3Ctable%3E%3Ca%3E1%3Cp%3E2%3C/a%3E3%3C/p%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%20%20%223%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"39a3ec04f54cda2bf1e06c54caf0b302da4fd252":[async_test('html5lib_adoption01.html 39a3ec04f54cda2bf1e06c54caf0b302da4fd252'), "%3Cb%3E%3Cb%3E%3Ca%3E%3Cp%3E%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E"],"d0bdfe6be48309b2d01b497667b350a8e6ec8ffb":[async_test('html5lib_adoption01.html d0bdfe6be48309b2d01b497667b350a8e6ec8ffb'), "%3Cb%3E%3Ca%3E%3Cb%3E%3Cp%3E%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E"],"63401082c6afd4b3c3201e348a1a61722f167b21":[async_test('html5lib_adoption01.html 63401082c6afd4b3c3201e348a1a61722f167b21'), "%3Ca%3E%3Cb%3E%3Cb%3E%3Cp%3E%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E"],"883cfd89f63da854dffbfbc938da1f31887a55e5":[async_test('html5lib_adoption01.html 883cfd89f63da854dffbfbc938da1f31887a55e5'), "%3Cp%3E1%3Cs%20id%3D%22A%22%3E2%3Cb%20id%3D%22B%22%3E3%3C/p%3E4%3C/s%3E5%3C/b%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Cs%3E%0A%7C%20%20%20%20%20%20%20%20%20id%3D%22A%22%0A%7C%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20id%3D%22B%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%223%22%0A%7C%20%20%20%20%20%3Cs%3E%0A%7C%20%20%20%20%20%20%20id%3D%22A%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20id%3D%22B%22%0A%7C%20%20%20%20%20%20%20%20%20%224%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20id%3D%22B%22%0A%7C%20%20%20%20%20%20%20%225%22"],"4dc0665051dac0d72c71aba5c95c5b86437dea2c":[async_test('html5lib_adoption01.html 4dc0665051dac0d72c71aba5c95c5b86437dea2c'), "%3Ctable%3E%3Ca%3E1%3Ctd%3E2%3C/td%3E3%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%223%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%222%22"],"4f376c0a798e71a91065e215dc0175d3107d5208":[async_test('html5lib_adoption01.html 4f376c0a798e71a91065e215dc0175d3107d5208'), "%3Ctable%3EA%3Ctd%3EB%3C/td%3EC%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22AC%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22B%22"],"52b62611a847a3f5fc3dc607a6b0174f1697247c":[async_test('html5lib_adoption01.html 52b62611a847a3f5fc3dc607a6b0174f1697247c'), "%3Ca%3E%3Csvg%3E%3Ctr%3E%3Cinput%3E%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20tr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20input%3E"],"88d0d3403d2a7b4058fcfb4e62835acb1c207e0f":[async_test('html5lib_adoption01.html 88d0d3403d2a7b4058fcfb4e62835acb1c207e0f'), "%3Cdiv%3E%3Ca%3E%3Cb%3E%3Cdiv%3E%3Cdiv%3E%3Cdiv%3E%3Cdiv%3E%3Cdiv%3E%3Cdiv%3E%3Cdiv%3E%3Cdiv%3E%3Cdiv%3E%3Cdiv%3E%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"d7338f457789f65d47b240e203b9e40a3925f2ca":[async_test('html5lib_adoption01.html d7338f457789f65d47b240e203b9e40a3925f2ca'), "%3Cdiv%3E%3Ca%3E%3Cb%3E%3Cu%3E%3Ci%3E%3Ccode%3E%3Cdiv%3E%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cu%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ccode%3E%0A%7C%20%20%20%20%20%20%20%3Cu%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ccode%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E"],"bf8088acd8bd48d8487bae49a613c248c488c041":[async_test('html5lib_adoption01.html bf8088acd8bd48d8487bae49a613c248c488c041'), "%3Cb%3E%3Cb%3E%3Cb%3E%3Cb%3Ex%3C/b%3E%3C/b%3E%3C/b%3E%3C/b%3Ey", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%22y%22"],"39edaa2e298c60ad4a1b0b9fdb4481d4aea98f36":[async_test('html5lib_adoption01.html 39edaa2e298c60ad4a1b0b9fdb4481d4aea98f36'), "%3Cp%3E%3Cb%3E%3Cb%3E%3Cb%3E%3Cb%3E%3Cp%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22x%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_adoption02.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_adoption02.html
new file mode 100644
index 000000000..81bb8d35f
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_adoption02.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_adoption02.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['cefc9890d621707fedf5eb634f3a86d753659d9b','2a8f569e9d55b3cb7e54b026f758dea8593f4cb4',];
+ var tests = {
+ "cefc9890d621707fedf5eb634f3a86d753659d9b":[async_test('html5lib_adoption02.html cefc9890d621707fedf5eb634f3a86d753659d9b'), "%3Cb%3E1%3Ci%3E2%3Cp%3E3%3C/b%3E4", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%223%22%0A%7C%20%20%20%20%20%20%20%20%20%224%22"],"2a8f569e9d55b3cb7e54b026f758dea8593f4cb4":[async_test('html5lib_adoption02.html 2a8f569e9d55b3cb7e54b026f758dea8593f4cb4'), "%3Ca%3E%3Cdiv%3E%3Cstyle%3E%3C/style%3E%3Caddress%3E%3Ca%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%3Caddress%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_comments01.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_comments01.html
new file mode 100644
index 000000000..3464bc5e4
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_comments01.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_comments01.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['3dbda8330033c3fbf3185a55e963075328099578','7476098e9823b3deee1857739daf719ff18e37b4','a6c42885c32fa988374894c0871b5a289786912a','d59b196ec9f6f19ded28d5e1fb48cbec2b1a4187','97486c43262a9a5c3fec1a3b028b99b7ca8c0e3e','06145ae05b1d92b71aed067ed6f1aab1afea50ae','5064d84d3adaf6262cf3573e9e112f40e3abc147','8b36d140a4a223b083a8d41af7c98a1c20377856','1894e23c5ee89d6f4b5f1dbe9b681b42863b4d1f','2cefeae994b6b0be0accbfff4757fef40ed914eb','ac9fd94008255e73cba953dbd374cb41703f5446','617815b6a683613fcb6b9cd5841b2ea7428d838d','bb8faf75d2e28aee13ec4a0d8eab00b4d7475763','89c4ae1ae34df9dff0e516afdef87cd169c3e6a5',];
+ var tests = {
+ "3dbda8330033c3fbf3185a55e963075328099578":[async_test('html5lib_comments01.html 3dbda8330033c3fbf3185a55e963075328099578'), "FOO%3C%21--%20BAR%20--%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20BAR%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"7476098e9823b3deee1857739daf719ff18e37b4":[async_test('html5lib_comments01.html 7476098e9823b3deee1857739daf719ff18e37b4'), "FOO%3C%21--%20BAR%20--%21%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20BAR%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"a6c42885c32fa988374894c0871b5a289786912a":[async_test('html5lib_comments01.html a6c42885c32fa988374894c0871b5a289786912a'), "FOO%3C%21--%20BAR%20--%20%20%20%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20BAR%20--%20%20%20%3EBAZ%20--%3E"],"d59b196ec9f6f19ded28d5e1fb48cbec2b1a4187":[async_test('html5lib_comments01.html d59b196ec9f6f19ded28d5e1fb48cbec2b1a4187'), "FOO%3C%21--%20BAR%20--%20%3CQUX%3E%20--%20MUX%20--%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20BAR%20--%20%3CQUX%3E%20--%20MUX%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"97486c43262a9a5c3fec1a3b028b99b7ca8c0e3e":[async_test('html5lib_comments01.html 97486c43262a9a5c3fec1a3b028b99b7ca8c0e3e'), "FOO%3C%21--%20BAR%20--%20%3CQUX%3E%20--%20MUX%20--%21%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20BAR%20--%20%3CQUX%3E%20--%20MUX%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"06145ae05b1d92b71aed067ed6f1aab1afea50ae":[async_test('html5lib_comments01.html 06145ae05b1d92b71aed067ed6f1aab1afea50ae'), "FOO%3C%21--%20BAR%20--%20%3CQUX%3E%20--%20MUX%20--%20%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20BAR%20--%20%3CQUX%3E%20--%20MUX%20--%20%3EBAZ%20--%3E"],"5064d84d3adaf6262cf3573e9e112f40e3abc147":[async_test('html5lib_comments01.html 5064d84d3adaf6262cf3573e9e112f40e3abc147'), "FOO%3C%21----%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"8b36d140a4a223b083a8d41af7c98a1c20377856":[async_test('html5lib_comments01.html 8b36d140a4a223b083a8d41af7c98a1c20377856'), "FOO%3C%21---%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"1894e23c5ee89d6f4b5f1dbe9b681b42863b4d1f":[async_test('html5lib_comments01.html 1894e23c5ee89d6f4b5f1dbe9b681b42863b4d1f'), "FOO%3C%21--%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"2cefeae994b6b0be0accbfff4757fef40ed914eb":[async_test('html5lib_comments01.html 2cefeae994b6b0be0accbfff4757fef40ed914eb'), "%3C%3Fxml%20version%3D%221.0%22%3EHi", "%23document%0A%7C%20%3C%21--%20%3Fxml%20version%3D%221.0%22%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hi%22"],"ac9fd94008255e73cba953dbd374cb41703f5446":[async_test('html5lib_comments01.html ac9fd94008255e73cba953dbd374cb41703f5446'), "%3C%3Fxml%20version%3D%221.0%22%3E", "%23document%0A%7C%20%3C%21--%20%3Fxml%20version%3D%221.0%22%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"617815b6a683613fcb6b9cd5841b2ea7428d838d":[async_test('html5lib_comments01.html 617815b6a683613fcb6b9cd5841b2ea7428d838d'), "%3C%3Fxml%20version", "%23document%0A%7C%20%3C%21--%20%3Fxml%20version%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"bb8faf75d2e28aee13ec4a0d8eab00b4d7475763":[async_test('html5lib_comments01.html bb8faf75d2e28aee13ec4a0d8eab00b4d7475763'), "FOO%3C%21-----%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20-%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"89c4ae1ae34df9dff0e516afdef87cd169c3e6a5":[async_test('html5lib_comments01.html 89c4ae1ae34df9dff0e516afdef87cd169c3e6a5'), "%3Chtml%3E%3C%21--%20comment%20--%3E%3Ctitle%3EComment%20before%20head%3C/title%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3C%21--%20%20comment%20%20--%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22Comment%20before%20head%22%0A%7C%20%20%20%3Cbody%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_doctype01.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_doctype01.html
new file mode 100644
index 000000000..fcf616e1a
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_doctype01.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_doctype01.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['8c660236fa29672c9b1ed0b64be59835a2a2f8cf','6a757c8c420fe3273632e84a4d999f17164f1214','a8ba29d82bb59f5ca03cfc193a1af770b889d4df','7a5044da1f470565fc4c6697b05132ff803d33e5','6514baf0155d3d10c1449752666c9da1c3db7141','ab7af413296ccb0e5705d978b98751821eb60ee3','3f3585cd61875a7f824422eda85a568952c1b08d','32bf847dcfae86480610633948efb2eca296abdd','692ab73d917820f55f789498c003ff184694becd','69af8e298e3560620c7598a9d2a6be0c50fe6881','93737d931105f8441c51a61ce6c9c625708aa690','be48ad2b635136c6ae4d99ff06bc930711e26ab7','6b90a61449551f1d7ac3aaa54669e81b1adbeb48','dc641c8a55963188374a5ab0f9be4c00897a113d','a157f7a60a42840003e9a798ca4c3981c17eb08b','826518fc2114e88a3dd7caecef77fa9ed0967f9e','0d86430bce85790c6eb1ead82133ee74077c6ac9','79ef363724b7881ee356c0a105e6add81941d57e','d8d1295947c1944ba51f7be60165e2d5d7592225','8214eb8bef5c817fd5fee4befdc15dbcc49ff6e0','51dd468ef51c8c0ea3e4b5a81517831c6a9168cb','dab4dcff81a1d051394a34771eb9627d07700377','6c679921462b1833e5203e6cd48f761b479d8924','a45fad90fa4d150fdb82f61bf49e0f92a0aaaf94','18cc825780e6be5a1ab60475c07be505759b25ad','37960ee5e9a9252988a63d9653336d30c1645834','095187e72e2336527d8c39293d68d456dfb1a10e','46383e4754c42b37ebba10ad4e3644dcff1eec18','702c2be9dc6bf31da96af43947e0e16d040bd395','7ffeed0800cff7c5117ba7de33f5e70d037129c3','2d57d9c9c46d222676eeb8e8531f3a77ca7aa4c0','544240cd747ec56acbc607b6b8ad9f99de4c4085','af212d55a1c59b5e3658fb39a2f86daab3686f94','10d43f89829998731c313c85eb31e981961b1981','99d16cdde20971b45a3b81ca7a2b9d9858525b22','44ac65856abd110419aafffde69f0dc127f98ec3','a69ffa9525892dbb38be6ee78f4fe1216ef6ea5d',];
+ var tests = {
+ "8c660236fa29672c9b1ed0b64be59835a2a2f8cf":[async_test('html5lib_doctype01.html 8c660236fa29672c9b1ed0b64be59835a2a2f8cf'), "%3C%21DOCTYPE%20html%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"6a757c8c420fe3273632e84a4d999f17164f1214":[async_test('html5lib_doctype01.html 6a757c8c420fe3273632e84a4d999f17164f1214'), "%3C%21dOctYpE%20HtMl%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"a8ba29d82bb59f5ca03cfc193a1af770b889d4df":[async_test('html5lib_doctype01.html a8ba29d82bb59f5ca03cfc193a1af770b889d4df'), "%3C%21DOCTYPEhtml%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"7a5044da1f470565fc4c6697b05132ff803d33e5":[async_test('html5lib_doctype01.html 7a5044da1f470565fc4c6697b05132ff803d33e5'), "%3C%21DOCTYPE%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"6514baf0155d3d10c1449752666c9da1c3db7141":[async_test('html5lib_doctype01.html 6514baf0155d3d10c1449752666c9da1c3db7141'), "%3C%21DOCTYPE%20%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"ab7af413296ccb0e5705d978b98751821eb60ee3":[async_test('html5lib_doctype01.html ab7af413296ccb0e5705d978b98751821eb60ee3'), "%3C%21DOCTYPE%20potato%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"3f3585cd61875a7f824422eda85a568952c1b08d":[async_test('html5lib_doctype01.html 3f3585cd61875a7f824422eda85a568952c1b08d'), "%3C%21DOCTYPE%20potato%20%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"32bf847dcfae86480610633948efb2eca296abdd":[async_test('html5lib_doctype01.html 32bf847dcfae86480610633948efb2eca296abdd'), "%3C%21DOCTYPE%20potato%20taco%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"692ab73d917820f55f789498c003ff184694becd":[async_test('html5lib_doctype01.html 692ab73d917820f55f789498c003ff184694becd'), "%3C%21DOCTYPE%20potato%20taco%20%22ddd%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"69af8e298e3560620c7598a9d2a6be0c50fe6881":[async_test('html5lib_doctype01.html 69af8e298e3560620c7598a9d2a6be0c50fe6881'), "%3C%21DOCTYPE%20potato%20sYstEM%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"93737d931105f8441c51a61ce6c9c625708aa690":[async_test('html5lib_doctype01.html 93737d931105f8441c51a61ce6c9c625708aa690'), "%3C%21DOCTYPE%20potato%20sYstEM%20%20%20%20%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"be48ad2b635136c6ae4d99ff06bc930711e26ab7":[async_test('html5lib_doctype01.html be48ad2b635136c6ae4d99ff06bc930711e26ab7'), "%3C%21DOCTYPE%20%20%20potato%20%20%20%20%20%20%20sYstEM%20%20ggg%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"6b90a61449551f1d7ac3aaa54669e81b1adbeb48":[async_test('html5lib_doctype01.html 6b90a61449551f1d7ac3aaa54669e81b1adbeb48'), "%3C%21DOCTYPE%20potato%20SYSTEM%20taco%20%20%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"dc641c8a55963188374a5ab0f9be4c00897a113d":[async_test('html5lib_doctype01.html dc641c8a55963188374a5ab0f9be4c00897a113d'), "%3C%21DOCTYPE%20potato%20SYSTEM%20%27taco%22%27%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%20%22%22%20%22taco%22%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"a157f7a60a42840003e9a798ca4c3981c17eb08b":[async_test('html5lib_doctype01.html a157f7a60a42840003e9a798ca4c3981c17eb08b'), "%3C%21DOCTYPE%20potato%20SYSTEM%20%22taco%22%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%20%22%22%20%22taco%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"826518fc2114e88a3dd7caecef77fa9ed0967f9e":[async_test('html5lib_doctype01.html 826518fc2114e88a3dd7caecef77fa9ed0967f9e'), "%3C%21DOCTYPE%20potato%20SYSTEM%20%22tai%27co%22%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%20%22%22%20%22tai%27co%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"0d86430bce85790c6eb1ead82133ee74077c6ac9":[async_test('html5lib_doctype01.html 0d86430bce85790c6eb1ead82133ee74077c6ac9'), "%3C%21DOCTYPE%20potato%20SYSTEMtaco%20%22ddd%22%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"79ef363724b7881ee356c0a105e6add81941d57e":[async_test('html5lib_doctype01.html 79ef363724b7881ee356c0a105e6add81941d57e'), "%3C%21DOCTYPE%20potato%20grass%20SYSTEM%20taco%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"d8d1295947c1944ba51f7be60165e2d5d7592225":[async_test('html5lib_doctype01.html d8d1295947c1944ba51f7be60165e2d5d7592225'), "%3C%21DOCTYPE%20potato%20pUbLIc%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"8214eb8bef5c817fd5fee4befdc15dbcc49ff6e0":[async_test('html5lib_doctype01.html 8214eb8bef5c817fd5fee4befdc15dbcc49ff6e0'), "%3C%21DOCTYPE%20potato%20pUbLIc%20%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"51dd468ef51c8c0ea3e4b5a81517831c6a9168cb":[async_test('html5lib_doctype01.html 51dd468ef51c8c0ea3e4b5a81517831c6a9168cb'), "%3C%21DOCTYPE%20potato%20pUbLIcgoof%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"dab4dcff81a1d051394a34771eb9627d07700377":[async_test('html5lib_doctype01.html dab4dcff81a1d051394a34771eb9627d07700377'), "%3C%21DOCTYPE%20potato%20PUBLIC%20goof%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"6c679921462b1833e5203e6cd48f761b479d8924":[async_test('html5lib_doctype01.html 6c679921462b1833e5203e6cd48f761b479d8924'), "%3C%21DOCTYPE%20potato%20PUBLIC%20%22go%27of%22%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%20%22go%27of%22%20%22%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"a45fad90fa4d150fdb82f61bf49e0f92a0aaaf94":[async_test('html5lib_doctype01.html a45fad90fa4d150fdb82f61bf49e0f92a0aaaf94'), "%3C%21DOCTYPE%20potato%20PUBLIC%20%27go%27of%27%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%20%22go%22%20%22%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"18cc825780e6be5a1ab60475c07be505759b25ad":[async_test('html5lib_doctype01.html 18cc825780e6be5a1ab60475c07be505759b25ad'), "%3C%21DOCTYPE%20potato%20PUBLIC%20%27go%3Ahh%20%20%20of%27%20%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%20%22go%3Ahh%20%20%20of%22%20%22%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"37960ee5e9a9252988a63d9653336d30c1645834":[async_test('html5lib_doctype01.html 37960ee5e9a9252988a63d9653336d30c1645834'), "%3C%21DOCTYPE%20potato%20PUBLIC%20%22W3C-//dfdf%22%20SYSTEM%20ggg%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20potato%20%22W3C-//dfdf%22%20%22%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"095187e72e2336527d8c39293d68d456dfb1a10e":[async_test('html5lib_doctype01.html 095187e72e2336527d8c39293d68d456dfb1a10e'), "%3C%21DOCTYPE%20HTML%20PUBLIC%20%22-//W3C//DTD%20HTML%204.01//EN%22%0A%20%20%20%22http%3A//www.w3.org/TR/html4/strict.dtd%22%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20html%20%22-//W3C//DTD%20HTML%204.01//EN%22%20%22http%3A//www.w3.org/TR/html4/strict.dtd%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"46383e4754c42b37ebba10ad4e3644dcff1eec18":[async_test('html5lib_doctype01.html 46383e4754c42b37ebba10ad4e3644dcff1eec18'), "%3C%21DOCTYPE%20...%3EHello", "%23document%0A%7C%20%3C%21DOCTYPE%20...%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hello%22"],"702c2be9dc6bf31da96af43947e0e16d040bd395":[async_test('html5lib_doctype01.html 702c2be9dc6bf31da96af43947e0e16d040bd395'), "%3C%21DOCTYPE%20html%20PUBLIC%20%22-//W3C//DTD%20XHTML%201.0%20Transitional//EN%22%0A%22http%3A//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%20%22-//W3C//DTD%20XHTML%201.0%20Transitional//EN%22%20%22http%3A//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"7ffeed0800cff7c5117ba7de33f5e70d037129c3":[async_test('html5lib_doctype01.html 7ffeed0800cff7c5117ba7de33f5e70d037129c3'), "%3C%21DOCTYPE%20html%20PUBLIC%20%22-//W3C//DTD%20XHTML%201.0%20Frameset//EN%22%0A%22http%3A//www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%20%22-//W3C//DTD%20XHTML%201.0%20Frameset//EN%22%20%22http%3A//www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"2d57d9c9c46d222676eeb8e8531f3a77ca7aa4c0":[async_test('html5lib_doctype01.html 2d57d9c9c46d222676eeb8e8531f3a77ca7aa4c0'), "%3C%21DOCTYPE%20root-element%20%5BSYSTEM%20OR%20PUBLIC%20FPI%5D%20%22uri%22%20%5B%20%0A%3C%21--%20internal%20declarations%20--%3E%0A%5D%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20root-element%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%5D%3E%22"],"544240cd747ec56acbc607b6b8ad9f99de4c4085":[async_test('html5lib_doctype01.html 544240cd747ec56acbc607b6b8ad9f99de4c4085'), "%3C%21DOCTYPE%20html%20PUBLIC%0A%20%20%22-//WAPFORUM//DTD%20XHTML%20Mobile%201.0//EN%22%0A%20%20%20%20%22http%3A//www.wapforum.org/DTD/xhtml-mobile10.dtd%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%20%22-//WAPFORUM//DTD%20XHTML%20Mobile%201.0//EN%22%20%22http%3A//www.wapforum.org/DTD/xhtml-mobile10.dtd%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"af212d55a1c59b5e3658fb39a2f86daab3686f94":[async_test('html5lib_doctype01.html af212d55a1c59b5e3658fb39a2f86daab3686f94'), "%3C%21DOCTYPE%20HTML%20SYSTEM%20%22http%3A//www.w3.org/DTD/HTML4-strict.dtd%22%3E%3Cbody%3E%3Cb%3EMine%21%3C/b%3E%3C/body%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%20%22%22%20%22http%3A//www.w3.org/DTD/HTML4-strict.dtd%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22Mine%21%22"],"10d43f89829998731c313c85eb31e981961b1981":[async_test('html5lib_doctype01.html 10d43f89829998731c313c85eb31e981961b1981'), "%3C%21DOCTYPE%20HTML%20PUBLIC%20%22-//W3C//DTD%20HTML%204.01//EN%22%22http%3A//www.w3.org/TR/html4/strict.dtd%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%20%22-//W3C//DTD%20HTML%204.01//EN%22%20%22http%3A//www.w3.org/TR/html4/strict.dtd%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"99d16cdde20971b45a3b81ca7a2b9d9858525b22":[async_test('html5lib_doctype01.html 99d16cdde20971b45a3b81ca7a2b9d9858525b22'), "%3C%21DOCTYPE%20HTML%20PUBLIC%20%22-//W3C//DTD%20HTML%204.01//EN%22%27http%3A//www.w3.org/TR/html4/strict.dtd%27%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%20%22-//W3C//DTD%20HTML%204.01//EN%22%20%22http%3A//www.w3.org/TR/html4/strict.dtd%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"44ac65856abd110419aafffde69f0dc127f98ec3":[async_test('html5lib_doctype01.html 44ac65856abd110419aafffde69f0dc127f98ec3'), "%3C%21DOCTYPE%20HTML%20PUBLIC%22-//W3C//DTD%20HTML%204.01//EN%22%27http%3A//www.w3.org/TR/html4/strict.dtd%27%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%20%22-//W3C//DTD%20HTML%204.01//EN%22%20%22http%3A//www.w3.org/TR/html4/strict.dtd%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"a69ffa9525892dbb38be6ee78f4fe1216ef6ea5d":[async_test('html5lib_doctype01.html a69ffa9525892dbb38be6ee78f4fe1216ef6ea5d'), "%3C%21DOCTYPE%20HTML%20PUBLIC%27-//W3C//DTD%20HTML%204.01//EN%27%27http%3A//www.w3.org/TR/html4/strict.dtd%27%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%20%22-//W3C//DTD%20HTML%204.01//EN%22%20%22http%3A//www.w3.org/TR/html4/strict.dtd%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_domjs-unsafe.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_domjs-unsafe.html
new file mode 100644
index 000000000..6a8c9d506
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_domjs-unsafe.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_domjs-unsafe.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['b76df4b192c11a5ef7a3e895a7dd2aaea2dcc5c7','da5cf60e732fcf20d288e772e51a7a9ccd3471e4','c32f77685b52841e1685110a8a6fac17b3ae127a','4fd39e063b0ad1fa82274d6de3122859f76934a8','7208fbe8702c37cf180b1c736c984f5340517408','7b5dd0bcb2a92ebf1974a0ec6017a798e774ca5b','54c3b7008093eea8c5b45f729585097df53641a8','b8de3bd0272a8362093670968eb21ad0bfa3cd40','40033d4270de7ad3595607426efc221988100175','4ffebb41a5c7f9239ba71301793a1e1cfd65dece','4fa68424ed093da8a6c954d64bb154ef4269ea83','41ddb90fa2e7785945dd18c32736dc83c1440fa4','89466f9770c893ffb117d18eac80993bd69564ad','72186fc6836326792e7e46ce4b5432191a5ac192','9863747db1e2676bad75c9929d895db2bb02306c','01818845dd1283fc54707a140be17e689a91f013','3255082e063beec09c3b0e605f0e3bfae177a113','54cd599d050ee568b0ed0060d1926479d3e528c3','bf081558b113ea712baeeb3294f3b53845510996','25e3471f40f3b6b0b448f7f7be41f0ee06403faa','006df46be5600e3d99caaf7dfc6a8af1636fd43a','b9bea556d1a155ef04e3f583328d51cf95995945','9eff404da18d0c20765a19613c718a9f49b874ac','1d246a13e96719a3fb48f1a81d1218671ee3a472','92bb86082f237803c7ace5fcd41a36861b364551','3a89dee49af0d2b537ad0c50fb74bb68d4dfe651','89bd023b6e2cbc5c7a37d85b45eadc88143bd670','9574dbbf3302c84fc4ddb965bf1f43ae7106e68c','341226c7328f8d3d6ab1d373368cc14aad712f20','15b3a23030aed47b3795d9c1ef11cd241b6902cb','4b318ddd18e0e360e70df9da138eabb002e34666','5a107feb60f518e1bed5fbd44de19f10dfde1d1e','92d4f652bcf5160b9815ea29546bde415cb83b04','42ebb8a722e7940826975575b2cb422c0a112c68','1a761bd94b707be3a5bd87fbcce0e0873c0b60ab','2fc6eb9f9eb3e005eb3c4765f638203ce0c34f5f','57672cdb7506becfcf63d59cc06f88d7e240808c','59ad4ed1b502b7adb49cf799c107bf405ddc0cca','4f00716246c38ec50813c6dd1e17b1e87a399252','767cec7804216f7b7bf6565a735c683fb2282059','c3258281fe46017ff5ea19cb08c711a6c281d673','755e6ed1b6f991af24c720c51546b5e0f6ef9ca5','3fb041d606429c494f972b82556759cf1a22171f','2f2ff31150ecec96cae1417fab3c4bda7e626948','6253f7f734608919f9966365fbbdd42163af7af2','db7da9a182140259b590eedd078f64b4831df749','9db35cf980c7170803f09243fb2f631ea0558adc','a96cbc244801cd9c8e201fa5a35e29dbb2a6cf08','920ab711970123a6123c8aa41190b63862399a5b',];
+ var tests = {
+ "b76df4b192c11a5ef7a3e895a7dd2aaea2dcc5c7":[async_test('html5lib_domjs-unsafe.html b76df4b192c11a5ef7a3e895a7dd2aaea2dcc5c7'), "%3Csvg%3E%3C%21%5BCDATA%5Bfoo%0Abar%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22foo%0Abar%22"],"da5cf60e732fcf20d288e772e51a7a9ccd3471e4":[async_test('html5lib_domjs-unsafe.html da5cf60e732fcf20d288e772e51a7a9ccd3471e4'), "%3Csvg%3E%3C%21%5BCDATA%5Bfoo%0Dbar%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22foo%0Abar%22"],"c32f77685b52841e1685110a8a6fac17b3ae127a":[async_test('html5lib_domjs-unsafe.html c32f77685b52841e1685110a8a6fac17b3ae127a'), "%3Csvg%3E%3C%21%5BCDATA%5Bfoo%0D%0Abar%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22foo%0Abar%22"],"4fd39e063b0ad1fa82274d6de3122859f76934a8":[async_test('html5lib_domjs-unsafe.html 4fd39e063b0ad1fa82274d6de3122859f76934a8'), "%3Cscript%3Ea%3D%27%00%27%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22a%3D%27%EF%BF%BD%27%22%0A%7C%20%20%20%3Cbody%3E"],"7208fbe8702c37cf180b1c736c984f5340517408":[async_test('html5lib_domjs-unsafe.html 7208fbe8702c37cf180b1c736c984f5340517408'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%00%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%EF%BF%BD%22%0A%7C%20%20%20%3Cbody%3E"],"7b5dd0bcb2a92ebf1974a0ec6017a798e774ca5b":[async_test('html5lib_domjs-unsafe.html 7b5dd0bcb2a92ebf1974a0ec6017a798e774ca5b'), "%3Cscript%20type%3D%22data%22%3E%3C%21--foo%00%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--foo%EF%BF%BD%22%0A%7C%20%20%20%3Cbody%3E"],"54c3b7008093eea8c5b45f729585097df53641a8":[async_test('html5lib_domjs-unsafe.html 54c3b7008093eea8c5b45f729585097df53641a8'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%20foo-%00%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%20foo-%EF%BF%BD%22%0A%7C%20%20%20%3Cbody%3E"],"b8de3bd0272a8362093670968eb21ad0bfa3cd40":[async_test('html5lib_domjs-unsafe.html b8de3bd0272a8362093670968eb21ad0bfa3cd40'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%20foo--%00%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%20foo--%EF%BF%BD%22%0A%7C%20%20%20%3Cbody%3E"],"40033d4270de7ad3595607426efc221988100175":[async_test('html5lib_domjs-unsafe.html 40033d4270de7ad3595607426efc221988100175'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%20foo-", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%20foo-%22%0A%7C%20%20%20%3Cbody%3E"],"4ffebb41a5c7f9239ba71301793a1e1cfd65dece":[async_test('html5lib_domjs-unsafe.html 4ffebb41a5c7f9239ba71301793a1e1cfd65dece'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%20foo-%3C%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%20foo-%3C%22%0A%7C%20%20%20%3Cbody%3E"],"4fa68424ed093da8a6c954d64bb154ef4269ea83":[async_test('html5lib_domjs-unsafe.html 4fa68424ed093da8a6c954d64bb154ef4269ea83'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%20foo-%3CS", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%20foo-%3CS%22%0A%7C%20%20%20%3Cbody%3E"],"41ddb90fa2e7785945dd18c32736dc83c1440fa4":[async_test('html5lib_domjs-unsafe.html 41ddb90fa2e7785945dd18c32736dc83c1440fa4'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%20foo-%3C/SCRIPT%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%20foo-%22%0A%7C%20%20%20%3Cbody%3E"],"89466f9770c893ffb117d18eac80993bd69564ad":[async_test('html5lib_domjs-unsafe.html 89466f9770c893ffb117d18eac80993bd69564ad'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%3Cp%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cp%3E%22%0A%7C%20%20%20%3Cbody%3E"],"72186fc6836326792e7e46ce4b5432191a5ac192":[async_test('html5lib_domjs-unsafe.html 72186fc6836326792e7e46ce4b5432191a5ac192'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%3Cscript%3E%3C/script%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%22%0A%7C%20%20%20%3Cbody%3E"],"9863747db1e2676bad75c9929d895db2bb02306c":[async_test('html5lib_domjs-unsafe.html 9863747db1e2676bad75c9929d895db2bb02306c'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%3Cscript%3E%00%3C/script%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%EF%BF%BD%3C/script%3E%22%0A%7C%20%20%20%3Cbody%3E"],"01818845dd1283fc54707a140be17e689a91f013":[async_test('html5lib_domjs-unsafe.html 01818845dd1283fc54707a140be17e689a91f013'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%3Cscript%3E-%00%3C/script%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E-%EF%BF%BD%3C/script%3E%22%0A%7C%20%20%20%3Cbody%3E"],"3255082e063beec09c3b0e605f0e3bfae177a113":[async_test('html5lib_domjs-unsafe.html 3255082e063beec09c3b0e605f0e3bfae177a113'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%3Cscript%3E--%00%3C/script%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E--%EF%BF%BD%3C/script%3E%22%0A%7C%20%20%20%3Cbody%3E"],"54cd599d050ee568b0ed0060d1926479d3e528c3":[async_test('html5lib_domjs-unsafe.html 54cd599d050ee568b0ed0060d1926479d3e528c3'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%3Cscript%3E---%3C/script%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E---%3C/script%3E%22%0A%7C%20%20%20%3Cbody%3E"],"bf081558b113ea712baeeb3294f3b53845510996":[async_test('html5lib_domjs-unsafe.html bf081558b113ea712baeeb3294f3b53845510996'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%3Cscript%3E%3C/scrip%3E%3C/SCRIPT%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/scrip%3E%3C/SCRIPT%3E%22%0A%7C%20%20%20%3Cbody%3E"],"25e3471f40f3b6b0b448f7f7be41f0ee06403faa":[async_test('html5lib_domjs-unsafe.html 25e3471f40f3b6b0b448f7f7be41f0ee06403faa'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%3Cscript%3E%3C/scrip%20%3C/SCRIPT%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/scrip%20%3C/SCRIPT%3E%22%0A%7C%20%20%20%3Cbody%3E"],"006df46be5600e3d99caaf7dfc6a8af1636fd43a":[async_test('html5lib_domjs-unsafe.html 006df46be5600e3d99caaf7dfc6a8af1636fd43a'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%3Cscript%3E%3C/scrip/%3C/SCRIPT%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/scrip/%3C/SCRIPT%3E%22%0A%7C%20%20%20%3Cbody%3E"],"b9bea556d1a155ef04e3f583328d51cf95995945":[async_test('html5lib_domjs-unsafe.html b9bea556d1a155ef04e3f583328d51cf95995945'), "%3Cscript%20type%3D%22data%22%3E%3C/scrip/%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C/scrip/%3E%22%0A%7C%20%20%20%3Cbody%3E"],"9eff404da18d0c20765a19613c718a9f49b874ac":[async_test('html5lib_domjs-unsafe.html 9eff404da18d0c20765a19613c718a9f49b874ac'), "%3Cscript%20type%3D%22data%22%3E%3C/scrip%20%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C/scrip%20%3E%22%0A%7C%20%20%20%3Cbody%3E"],"1d246a13e96719a3fb48f1a81d1218671ee3a472":[async_test('html5lib_domjs-unsafe.html 1d246a13e96719a3fb48f1a81d1218671ee3a472'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%3C/scrip%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3C/scrip%3E%22%0A%7C%20%20%20%3Cbody%3E"],"92bb86082f237803c7ace5fcd41a36861b364551":[async_test('html5lib_domjs-unsafe.html 92bb86082f237803c7ace5fcd41a36861b364551'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%3C/scrip%20%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3C/scrip%20%22%0A%7C%20%20%20%3Cbody%3E"],"3a89dee49af0d2b537ad0c50fb74bb68d4dfe651":[async_test('html5lib_domjs-unsafe.html 3a89dee49af0d2b537ad0c50fb74bb68d4dfe651'), "%3Cscript%20type%3D%22data%22%3E%3C%21--%3C/scrip/%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22data%22%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3C/scrip/%22%0A%7C%20%20%20%3Cbody%3E"],"89bd023b6e2cbc5c7a37d85b45eadc88143bd670":[async_test('html5lib_domjs-unsafe.html 89bd023b6e2cbc5c7a37d85b45eadc88143bd670'), "%3C%21DOCTYPE%20html%3E%3C%21DOCTYPE%20html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"9574dbbf3302c84fc4ddb965bf1f43ae7106e68c":[async_test('html5lib_domjs-unsafe.html 9574dbbf3302c84fc4ddb965bf1f43ae7106e68c'), "%3Chtml%3E%3C%21DOCTYPE%20html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"341226c7328f8d3d6ab1d373368cc14aad712f20":[async_test('html5lib_domjs-unsafe.html 341226c7328f8d3d6ab1d373368cc14aad712f20'), "%3Chtml%3E%3Chead%3E%3C%21DOCTYPE%20html%3E%3C/head%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"15b3a23030aed47b3795d9c1ef11cd241b6902cb":[async_test('html5lib_domjs-unsafe.html 15b3a23030aed47b3795d9c1ef11cd241b6902cb'), "%3Chtml%3E%3Chead%3E%3C/head%3E%3C%21DOCTYPE%20html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"4b318ddd18e0e360e70df9da138eabb002e34666":[async_test('html5lib_domjs-unsafe.html 4b318ddd18e0e360e70df9da138eabb002e34666'), "%3Cbody%3E%3C/body%3E%3C%21DOCTYPE%20html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"5a107feb60f518e1bed5fbd44de19f10dfde1d1e":[async_test('html5lib_domjs-unsafe.html 5a107feb60f518e1bed5fbd44de19f10dfde1d1e'), "%3Ctable%3E%3C%21DOCTYPE%20html%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E"],"92d4f652bcf5160b9815ea29546bde415cb83b04":[async_test('html5lib_domjs-unsafe.html 92d4f652bcf5160b9815ea29546bde415cb83b04'), "%3Cselect%3E%3C%21DOCTYPE%20html%3E%3C/select%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"42ebb8a722e7940826975575b2cb422c0a112c68":[async_test('html5lib_domjs-unsafe.html 42ebb8a722e7940826975575b2cb422c0a112c68'), "%3Ctable%3E%3Ccolgroup%3E%3C%21DOCTYPE%20html%3E%3C/colgroup%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E"],"1a761bd94b707be3a5bd87fbcce0e0873c0b60ab":[async_test('html5lib_domjs-unsafe.html 1a761bd94b707be3a5bd87fbcce0e0873c0b60ab'), "%3Ctable%3E%3Ccolgroup%3E%3C%21--test--%3E%3C/colgroup%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3C%21--%20test%20--%3E"],"2fc6eb9f9eb3e005eb3c4765f638203ce0c34f5f":[async_test('html5lib_domjs-unsafe.html 2fc6eb9f9eb3e005eb3c4765f638203ce0c34f5f'), "%3Ctable%3E%3Ccolgroup%3E%3Chtml%3E%3C/colgroup%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E"],"57672cdb7506becfcf63d59cc06f88d7e240808c":[async_test('html5lib_domjs-unsafe.html 57672cdb7506becfcf63d59cc06f88d7e240808c'), "%3Ctable%3E%3Ccolgroup%3E%20foo%3C/colgroup%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20%22"],"59ad4ed1b502b7adb49cf799c107bf405ddc0cca":[async_test('html5lib_domjs-unsafe.html 59ad4ed1b502b7adb49cf799c107bf405ddc0cca'), "%3Cselect%3E%3C%21--test--%3E%3C/select%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3C%21--%20test%20--%3E"],"4f00716246c38ec50813c6dd1e17b1e87a399252":[async_test('html5lib_domjs-unsafe.html 4f00716246c38ec50813c6dd1e17b1e87a399252'), "%3Cselect%3E%3Chtml%3E%3C/select%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"767cec7804216f7b7bf6565a735c683fb2282059":[async_test('html5lib_domjs-unsafe.html 767cec7804216f7b7bf6565a735c683fb2282059'), "%3Cframeset%3E%3Chtml%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"c3258281fe46017ff5ea19cb08c711a6c281d673":[async_test('html5lib_domjs-unsafe.html c3258281fe46017ff5ea19cb08c711a6c281d673'), "%3Cframeset%3E%3C/frameset%3E%3Chtml%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"755e6ed1b6f991af24c720c51546b5e0f6ef9ca5":[async_test('html5lib_domjs-unsafe.html 755e6ed1b6f991af24c720c51546b5e0f6ef9ca5'), "%3Cframeset%3E%3C/frameset%3E%3C%21DOCTYPE%20html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"3fb041d606429c494f972b82556759cf1a22171f":[async_test('html5lib_domjs-unsafe.html 3fb041d606429c494f972b82556759cf1a22171f'), "%3Chtml%3E%3Cbody%3E%3C/body%3E%3C/html%3E%3C%21DOCTYPE%20html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"2f2ff31150ecec96cae1417fab3c4bda7e626948":[async_test('html5lib_domjs-unsafe.html 2f2ff31150ecec96cae1417fab3c4bda7e626948'), "%3Csvg%3E%3C%21DOCTYPE%20html%3E%3C/svg%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E"],"6253f7f734608919f9966365fbbdd42163af7af2":[async_test('html5lib_domjs-unsafe.html 6253f7f734608919f9966365fbbdd42163af7af2'), "%3Csvg%3E%3Cfont%3E%3C/font%3E%3C/svg%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20font%3E"],"db7da9a182140259b590eedd078f64b4831df749":[async_test('html5lib_domjs-unsafe.html db7da9a182140259b590eedd078f64b4831df749'), "%3Csvg%3E%3Cfont%20id%3Dfoo%3E%3C/font%3E%3C/svg%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20font%3E%0A%7C%20%20%20%20%20%20%20%20%20id%3D%22foo%22"],"9db35cf980c7170803f09243fb2f631ea0558adc":[async_test('html5lib_domjs-unsafe.html 9db35cf980c7170803f09243fb2f631ea0558adc'), "%3Csvg%3E%3Cfont%20size%3D4%3E%3C/font%3E%3C/svg%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20size%3D%224%22"],"a96cbc244801cd9c8e201fa5a35e29dbb2a6cf08":[async_test('html5lib_domjs-unsafe.html a96cbc244801cd9c8e201fa5a35e29dbb2a6cf08'), "%3Csvg%3E%3Cfont%20color%3Dred%3E%3C/font%3E%3C/svg%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20color%3D%22red%22"],"920ab711970123a6123c8aa41190b63862399a5b":[async_test('html5lib_domjs-unsafe.html 920ab711970123a6123c8aa41190b63862399a5b'), "%3Csvg%3E%3Cfont%20font%3Dsans%3E%3C/font%3E%3C/svg%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20font%3E%0A%7C%20%20%20%20%20%20%20%20%20font%3D%22sans%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_entities01.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_entities01.html
new file mode 100644
index 000000000..c3af61b79
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_entities01.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_entities01.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['16c694bcf0b3ff3723fa070eea7e1e82ef12a337','05e04b39ef06e2367a33326f5dd566913aa6628f','fbf7d9fec595585869c5c595d5588b34fd175278','e59b0a76d7bcfb429b27e00e469f35e08a9bdd1a','5ea854d6ecd4d6dd459cb36d4faf3ed36e11c073','119cd15b852615cd0fce759769b4a3788595e3bb','9c00a1833e8cf4af28c8bd94902412ad7052b4b0','b5bcdcbc6e88b380be0e48ca2620fbbb8e92e497','bf6c90305b2856c2d9c9a146dfff867fe7a5e0f3','6b9c8d175a3d7b6cf04ffd72e44a7dc88686460f','76c184d9ce64b8a52c2e67eafeb8d332c096f2be','4c30f8f931eb44c2f208e837555c0cc444dd4612','1db77ef761092d65ce847c0bcd6e7cb892db754d','284c18aa40a73e4052525a9ffb30b23182f237ea','6b336a43e394d3ab7ceb2ab54c63409e8a27aded','436c30dd76bf9b5c2b29a181d9a9412ec0ab4bdf','1373a52ddcb71f20f29d92abb6714eaabeba7424','d60f4f324a1ad9c09c4d3590c8c537af2852eeb4','d21511e2df56c306c78e1449c960c66e565e016e','39107d16f24d4c7bcd40ad1239b5f4f677877ee8','a44b740e8b2349e75c9eb0376f665eab13ff821d','a0e38b1c19eba037b34c68864634cff032f0b892','390d9571a24be0961c8fcd78c69eea16a6414246','ceba8404405dd3b3b423c45411bde15bf72a846d','f8dd2fccc21d3a08790a7877186840a692adf111','d526830d439d3c4e966b22fbedf819d465d3107b','240af7bacbfecce6e2a973de9c89fad817fb8d42','d657585ca1df5b86693fca8a0a2eae76bd9b1c2b','b508fcffb2d9f2424c7837270e51824321fb4570','897ab551df27df14418a46ff1c3acef8338c53f3','493a472ccf903088c813ff6874d54482a161df8f','67d19edb1f6ecbbb6ccb90df2345e52e5c58efc3','dded422b7406c966c944555f220d7d3dfcf2a143','60a76c9e10e4ac53f836f9e45eb0518dd0b7b73b','b47fcc6a614247319908b00935f10ec134399917','3b5c7d0331ae900e1179eaf3545c78d147434fbf','a0f119508046dbb4f8059232f6e99f66c1e8e7a6','daab384be8471edeb755353c5dccaad0c415dac5','8485e4d103a517615f39c0d0b71fe5065c5437db','4c28749faddb096d1f04792b7daf039268c43181','c84c576954c4c493528eaa34233c926653152be5','b2797e18c499df32296545225c259dbf4bea2908','5b2dfe6f187413faecd91336bd353c05768ea722','34af7be5bcff18ec869a306b19daea70f61f7088','8f2e74688427858fc1a895fc472d074a0528a7ae','530d6251a43d688e69959237e519812585de8266','bced9b8c339d0d2838ea0fffe9a64027b4f3a877','9c9e8079df25999c606bc84f46b348544a23b9b4','ec61d22b3bc6f93e54bbff964311bba9a3a06b21','391f0136aebdd0e874c8eb85651ffda7e9f86f24','e2974e7029b008539aacc1ee885705764f8c53f4','23e105ca5329cc0338a96fe7e088ba9b319c46d1','87af28752724c400edef3970e52440639be5b1a8','f50d9e39e2bda3d8c0b1c69d1f1e4e86c4b39ac3','12827fadb8d36b829e9c2c7315e0848d2d7ef278','f603997321070e6ccada6fefe4240a9e6c7e870a','a88e381bf36e74aaa8ac5b0877153b7158bae579','11019fa64a25748a5bfb864fc200ec2710b54aa3','3d238b9146102bd11e898ff4913f86e8ded65be4','a1375bfde7be56e514471700e030b1c7e7090e2f','7936b73efa385d183e93453bea24fd0c4dff4742','41cdf6978b0c48e7044d5e4534fc8bb08de4cdf2','5138f572a4db2e2edc2d723e1bb87af72ab501f4','f30757617b6df330deba1cb607e8d47f71bda13f','a6fd8cdca1fa8cf07519d9a0c5b779eafa438b70','ada342466887e85d89c3b815b127bfced036ac76','74bd99a9263f0b8e8a5fac4d2684fe37d5a1a9cc',];
+ var tests = {
+ "16c694bcf0b3ff3723fa070eea7e1e82ef12a337":[async_test('html5lib_entities01.html 16c694bcf0b3ff3723fa070eea7e1e82ef12a337'), "FOO%26gt%3BBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%3EBAR%22"],"05e04b39ef06e2367a33326f5dd566913aa6628f":[async_test('html5lib_entities01.html 05e04b39ef06e2367a33326f5dd566913aa6628f'), "FOO%26gtBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%3EBAR%22"],"fbf7d9fec595585869c5c595d5588b34fd175278":[async_test('html5lib_entities01.html fbf7d9fec595585869c5c595d5588b34fd175278'), "FOO%26gt%20BAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%3E%20BAR%22"],"e59b0a76d7bcfb429b27e00e469f35e08a9bdd1a":[async_test('html5lib_entities01.html e59b0a76d7bcfb429b27e00e469f35e08a9bdd1a'), "FOO%26gt%3B%3B%3BBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%3E%3B%3BBAR%22"],"5ea854d6ecd4d6dd459cb36d4faf3ed36e11c073":[async_test('html5lib_entities01.html 5ea854d6ecd4d6dd459cb36d4faf3ed36e11c073'), "I%27m%20%26notit%3B%20I%20tell%20you", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22I%27m%20%C2%ACit%3B%20I%20tell%20you%22"],"119cd15b852615cd0fce759769b4a3788595e3bb":[async_test('html5lib_entities01.html 119cd15b852615cd0fce759769b4a3788595e3bb'), "I%27m%20%26notin%3B%20I%20tell%20you", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22I%27m%20%E2%88%89%20I%20tell%20you%22"],"9c00a1833e8cf4af28c8bd94902412ad7052b4b0":[async_test('html5lib_entities01.html 9c00a1833e8cf4af28c8bd94902412ad7052b4b0'), "FOO%26%20BAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%26%20BAR%22"],"b5bcdcbc6e88b380be0e48ca2620fbbb8e92e497":[async_test('html5lib_entities01.html b5bcdcbc6e88b380be0e48ca2620fbbb8e92e497'), "FOO%26%3CBAR%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%26%22%0A%7C%20%20%20%20%20%3Cbar%3E"],"bf6c90305b2856c2d9c9a146dfff867fe7a5e0f3":[async_test('html5lib_entities01.html bf6c90305b2856c2d9c9a146dfff867fe7a5e0f3'), "FOO%26%26%26%26gt%3BBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%26%26%26%3EBAR%22"],"6b9c8d175a3d7b6cf04ffd72e44a7dc88686460f":[async_test('html5lib_entities01.html 6b9c8d175a3d7b6cf04ffd72e44a7dc88686460f'), "FOO%26%2341%3BBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%29BAR%22"],"76c184d9ce64b8a52c2e67eafeb8d332c096f2be":[async_test('html5lib_entities01.html 76c184d9ce64b8a52c2e67eafeb8d332c096f2be'), "FOO%26%23x41%3BBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOOABAR%22"],"4c30f8f931eb44c2f208e837555c0cc444dd4612":[async_test('html5lib_entities01.html 4c30f8f931eb44c2f208e837555c0cc444dd4612'), "FOO%26%23X41%3BBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOOABAR%22"],"1db77ef761092d65ce847c0bcd6e7cb892db754d":[async_test('html5lib_entities01.html 1db77ef761092d65ce847c0bcd6e7cb892db754d'), "FOO%26%23BAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%26%23BAR%22"],"284c18aa40a73e4052525a9ffb30b23182f237ea":[async_test('html5lib_entities01.html 284c18aa40a73e4052525a9ffb30b23182f237ea'), "FOO%26%23ZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%26%23ZOO%22"],"6b336a43e394d3ab7ceb2ab54c63409e8a27aded":[async_test('html5lib_entities01.html 6b336a43e394d3ab7ceb2ab54c63409e8a27aded'), "FOO%26%23xBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C2%BAR%22"],"436c30dd76bf9b5c2b29a181d9a9412ec0ab4bdf":[async_test('html5lib_entities01.html 436c30dd76bf9b5c2b29a181d9a9412ec0ab4bdf'), "FOO%26%23xZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%26%23xZOO%22"],"1373a52ddcb71f20f29d92abb6714eaabeba7424":[async_test('html5lib_entities01.html 1373a52ddcb71f20f29d92abb6714eaabeba7424'), "FOO%26%23XZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%26%23XZOO%22"],"d60f4f324a1ad9c09c4d3590c8c537af2852eeb4":[async_test('html5lib_entities01.html d60f4f324a1ad9c09c4d3590c8c537af2852eeb4'), "FOO%26%2341BAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%29BAR%22"],"d21511e2df56c306c78e1449c960c66e565e016e":[async_test('html5lib_entities01.html d21511e2df56c306c78e1449c960c66e565e016e'), "FOO%26%23x41BAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E4%86%BAR%22"],"39107d16f24d4c7bcd40ad1239b5f4f677877ee8":[async_test('html5lib_entities01.html 39107d16f24d4c7bcd40ad1239b5f4f677877ee8'), "FOO%26%23x41ZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOOAZOO%22"],"a44b740e8b2349e75c9eb0376f665eab13ff821d":[async_test('html5lib_entities01.html a44b740e8b2349e75c9eb0376f665eab13ff821d'), "FOO%26%23x0000%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%EF%BF%BDZOO%22"],"a0e38b1c19eba037b34c68864634cff032f0b892":[async_test('html5lib_entities01.html a0e38b1c19eba037b34c68864634cff032f0b892'), "FOO%26%23x0078%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOOxZOO%22"],"390d9571a24be0961c8fcd78c69eea16a6414246":[async_test('html5lib_entities01.html 390d9571a24be0961c8fcd78c69eea16a6414246'), "FOO%26%23x0079%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOOyZOO%22"],"ceba8404405dd3b3b423c45411bde15bf72a846d":[async_test('html5lib_entities01.html ceba8404405dd3b3b423c45411bde15bf72a846d'), "FOO%26%23x0080%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%82%ACZOO%22"],"f8dd2fccc21d3a08790a7877186840a692adf111":[async_test('html5lib_entities01.html f8dd2fccc21d3a08790a7877186840a692adf111'), "FOO%26%23x0081%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C2%81ZOO%22"],"d526830d439d3c4e966b22fbedf819d465d3107b":[async_test('html5lib_entities01.html d526830d439d3c4e966b22fbedf819d465d3107b'), "FOO%26%23x0082%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%9AZOO%22"],"240af7bacbfecce6e2a973de9c89fad817fb8d42":[async_test('html5lib_entities01.html 240af7bacbfecce6e2a973de9c89fad817fb8d42'), "FOO%26%23x0083%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C6%92ZOO%22"],"d657585ca1df5b86693fca8a0a2eae76bd9b1c2b":[async_test('html5lib_entities01.html d657585ca1df5b86693fca8a0a2eae76bd9b1c2b'), "FOO%26%23x0084%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%9EZOO%22"],"b508fcffb2d9f2424c7837270e51824321fb4570":[async_test('html5lib_entities01.html b508fcffb2d9f2424c7837270e51824321fb4570'), "FOO%26%23x0085%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%A6ZOO%22"],"897ab551df27df14418a46ff1c3acef8338c53f3":[async_test('html5lib_entities01.html 897ab551df27df14418a46ff1c3acef8338c53f3'), "FOO%26%23x0086%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%A0ZOO%22"],"493a472ccf903088c813ff6874d54482a161df8f":[async_test('html5lib_entities01.html 493a472ccf903088c813ff6874d54482a161df8f'), "FOO%26%23x0087%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%A1ZOO%22"],"67d19edb1f6ecbbb6ccb90df2345e52e5c58efc3":[async_test('html5lib_entities01.html 67d19edb1f6ecbbb6ccb90df2345e52e5c58efc3'), "FOO%26%23x0088%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%CB%86ZOO%22"],"dded422b7406c966c944555f220d7d3dfcf2a143":[async_test('html5lib_entities01.html dded422b7406c966c944555f220d7d3dfcf2a143'), "FOO%26%23x0089%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%B0ZOO%22"],"60a76c9e10e4ac53f836f9e45eb0518dd0b7b73b":[async_test('html5lib_entities01.html 60a76c9e10e4ac53f836f9e45eb0518dd0b7b73b'), "FOO%26%23x008A%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C5%A0ZOO%22"],"b47fcc6a614247319908b00935f10ec134399917":[async_test('html5lib_entities01.html b47fcc6a614247319908b00935f10ec134399917'), "FOO%26%23x008B%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%B9ZOO%22"],"3b5c7d0331ae900e1179eaf3545c78d147434fbf":[async_test('html5lib_entities01.html 3b5c7d0331ae900e1179eaf3545c78d147434fbf'), "FOO%26%23x008C%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C5%92ZOO%22"],"a0f119508046dbb4f8059232f6e99f66c1e8e7a6":[async_test('html5lib_entities01.html a0f119508046dbb4f8059232f6e99f66c1e8e7a6'), "FOO%26%23x008D%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C2%8DZOO%22"],"daab384be8471edeb755353c5dccaad0c415dac5":[async_test('html5lib_entities01.html daab384be8471edeb755353c5dccaad0c415dac5'), "FOO%26%23x008E%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C5%BDZOO%22"],"8485e4d103a517615f39c0d0b71fe5065c5437db":[async_test('html5lib_entities01.html 8485e4d103a517615f39c0d0b71fe5065c5437db'), "FOO%26%23x008F%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C2%8FZOO%22"],"4c28749faddb096d1f04792b7daf039268c43181":[async_test('html5lib_entities01.html 4c28749faddb096d1f04792b7daf039268c43181'), "FOO%26%23x0090%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C2%90ZOO%22"],"c84c576954c4c493528eaa34233c926653152be5":[async_test('html5lib_entities01.html c84c576954c4c493528eaa34233c926653152be5'), "FOO%26%23x0091%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%98ZOO%22"],"b2797e18c499df32296545225c259dbf4bea2908":[async_test('html5lib_entities01.html b2797e18c499df32296545225c259dbf4bea2908'), "FOO%26%23x0092%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%99ZOO%22"],"5b2dfe6f187413faecd91336bd353c05768ea722":[async_test('html5lib_entities01.html 5b2dfe6f187413faecd91336bd353c05768ea722'), "FOO%26%23x0093%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%9CZOO%22"],"34af7be5bcff18ec869a306b19daea70f61f7088":[async_test('html5lib_entities01.html 34af7be5bcff18ec869a306b19daea70f61f7088'), "FOO%26%23x0094%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%9DZOO%22"],"8f2e74688427858fc1a895fc472d074a0528a7ae":[async_test('html5lib_entities01.html 8f2e74688427858fc1a895fc472d074a0528a7ae'), "FOO%26%23x0095%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%A2ZOO%22"],"530d6251a43d688e69959237e519812585de8266":[async_test('html5lib_entities01.html 530d6251a43d688e69959237e519812585de8266'), "FOO%26%23x0096%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%93ZOO%22"],"bced9b8c339d0d2838ea0fffe9a64027b4f3a877":[async_test('html5lib_entities01.html bced9b8c339d0d2838ea0fffe9a64027b4f3a877'), "FOO%26%23x0097%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%94ZOO%22"],"9c9e8079df25999c606bc84f46b348544a23b9b4":[async_test('html5lib_entities01.html 9c9e8079df25999c606bc84f46b348544a23b9b4'), "FOO%26%23x0098%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%CB%9CZOO%22"],"ec61d22b3bc6f93e54bbff964311bba9a3a06b21":[async_test('html5lib_entities01.html ec61d22b3bc6f93e54bbff964311bba9a3a06b21'), "FOO%26%23x0099%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%84%A2ZOO%22"],"391f0136aebdd0e874c8eb85651ffda7e9f86f24":[async_test('html5lib_entities01.html 391f0136aebdd0e874c8eb85651ffda7e9f86f24'), "FOO%26%23x009A%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C5%A1ZOO%22"],"e2974e7029b008539aacc1ee885705764f8c53f4":[async_test('html5lib_entities01.html e2974e7029b008539aacc1ee885705764f8c53f4'), "FOO%26%23x009B%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%E2%80%BAZOO%22"],"23e105ca5329cc0338a96fe7e088ba9b319c46d1":[async_test('html5lib_entities01.html 23e105ca5329cc0338a96fe7e088ba9b319c46d1'), "FOO%26%23x009C%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C5%93ZOO%22"],"87af28752724c400edef3970e52440639be5b1a8":[async_test('html5lib_entities01.html 87af28752724c400edef3970e52440639be5b1a8'), "FOO%26%23x009D%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C2%9DZOO%22"],"f50d9e39e2bda3d8c0b1c69d1f1e4e86c4b39ac3":[async_test('html5lib_entities01.html f50d9e39e2bda3d8c0b1c69d1f1e4e86c4b39ac3'), "FOO%26%23x009E%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C5%BEZOO%22"],"12827fadb8d36b829e9c2c7315e0848d2d7ef278":[async_test('html5lib_entities01.html 12827fadb8d36b829e9c2c7315e0848d2d7ef278'), "FOO%26%23x009F%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C5%B8ZOO%22"],"f603997321070e6ccada6fefe4240a9e6c7e870a":[async_test('html5lib_entities01.html f603997321070e6ccada6fefe4240a9e6c7e870a'), "FOO%26%23x00A0%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%C2%A0ZOO%22"],"a88e381bf36e74aaa8ac5b0877153b7158bae579":[async_test('html5lib_entities01.html a88e381bf36e74aaa8ac5b0877153b7158bae579'), "FOO%26%23xD7FF%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%ED%9F%BFZOO%22"],"11019fa64a25748a5bfb864fc200ec2710b54aa3":[async_test('html5lib_entities01.html 11019fa64a25748a5bfb864fc200ec2710b54aa3'), "FOO%26%23xD800%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%EF%BF%BDZOO%22"],"3d238b9146102bd11e898ff4913f86e8ded65be4":[async_test('html5lib_entities01.html 3d238b9146102bd11e898ff4913f86e8ded65be4'), "FOO%26%23xD801%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%EF%BF%BDZOO%22"],"a1375bfde7be56e514471700e030b1c7e7090e2f":[async_test('html5lib_entities01.html a1375bfde7be56e514471700e030b1c7e7090e2f'), "FOO%26%23xDFFE%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%EF%BF%BDZOO%22"],"7936b73efa385d183e93453bea24fd0c4dff4742":[async_test('html5lib_entities01.html 7936b73efa385d183e93453bea24fd0c4dff4742'), "FOO%26%23xDFFF%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%EF%BF%BDZOO%22"],"41cdf6978b0c48e7044d5e4534fc8bb08de4cdf2":[async_test('html5lib_entities01.html 41cdf6978b0c48e7044d5e4534fc8bb08de4cdf2'), "FOO%26%23xE000%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%EE%80%80ZOO%22"],"5138f572a4db2e2edc2d723e1bb87af72ab501f4":[async_test('html5lib_entities01.html 5138f572a4db2e2edc2d723e1bb87af72ab501f4'), "FOO%26%23x10FFFE%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%F4%8F%BF%BEZOO%22"],"f30757617b6df330deba1cb607e8d47f71bda13f":[async_test('html5lib_entities01.html f30757617b6df330deba1cb607e8d47f71bda13f'), "FOO%26%23x1087D4%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%F4%88%9F%94ZOO%22"],"a6fd8cdca1fa8cf07519d9a0c5b779eafa438b70":[async_test('html5lib_entities01.html a6fd8cdca1fa8cf07519d9a0c5b779eafa438b70'), "FOO%26%23x10FFFF%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%F4%8F%BF%BFZOO%22"],"ada342466887e85d89c3b815b127bfced036ac76":[async_test('html5lib_entities01.html ada342466887e85d89c3b815b127bfced036ac76'), "FOO%26%23x110000%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%EF%BF%BDZOO%22"],"74bd99a9263f0b8e8a5fac4d2684fe37d5a1a9cc":[async_test('html5lib_entities01.html 74bd99a9263f0b8e8a5fac4d2684fe37d5a1a9cc'), "FOO%26%23xFFFFFF%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%EF%BF%BDZOO%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_entities02.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_entities02.html
new file mode 100644
index 000000000..fdfddded2
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_entities02.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_entities02.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['ea66863900b0b42deee5a77c58a432c2215c32ac','bc2a229b7c801ad045da76f411faf1d4c89886d0','e30755b30108f65919767f57a2200097b638f2b4','17c5acad9075755a413541d57d0d135338450834','ec40a7216b4ac918c5e16cae66bfb8b69bcfabce','54d2e9d13436e6850a5257e8028122581cf7088d','99c8496d0ea75429a5836de44dd18708974f6de8','7e4e70e57f63968ebba82682a2629158bd053a65','dca2db4f61b5fd60121e3da3e15065654f8d8a0c','fe22904d5f3936bedc1fa110e6bde48895b399a0','6553483a30141fcff05787287c2c212df9f468e8','88d7c74afcb27bbee3e3255d9116dce9c3dc6d73','db5d22d3350e0a51d675dc17c641c73251a4739d','ea08276faa7ba526e612fc1e80047d705cd29885','c59d1cfe1b36e75e0f57664e45bef7023a73c9e9','f9d3950620f8adcbe5f9a0542c7967de4be65963','8e35dacd7c296f054e58f1ce83719401c8aff8a0','48edddaa93bbebc5cd1615cc67422ca6508e47a2','9c69a29b53eebd93db20f12d405335274098e662','565c5f6744a27602bb466d6df77803a80f064752','742984a32ecd86cb9cdedffbba47eb212e19c80f','f908b529ac9ca5366e1160856db2c3d17e3898c9','1294ffc6bee2ee41f65a60ac48ba445b99504286','ba7d8cdd4b40020f7af6bdde75a3574b5771fac9','ce23051409f58749cbce6836bc4c7c21e9c548cf',];
+ var tests = {
+ "ea66863900b0b42deee5a77c58a432c2215c32ac":[async_test('html5lib_entities02.html ea66863900b0b42deee5a77c58a432c2215c32ac'), "%3Cdiv%20bar%3D%22ZZ%26gt%3BYY%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%3EYY%22"],"bc2a229b7c801ad045da76f411faf1d4c89886d0":[async_test('html5lib_entities02.html bc2a229b7c801ad045da76f411faf1d4c89886d0'), "%3Cdiv%20bar%3D%22ZZ%26%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%26%22"],"e30755b30108f65919767f57a2200097b638f2b4":[async_test('html5lib_entities02.html e30755b30108f65919767f57a2200097b638f2b4'), "%3Cdiv%20bar%3D%27ZZ%26%27%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%26%22"],"17c5acad9075755a413541d57d0d135338450834":[async_test('html5lib_entities02.html 17c5acad9075755a413541d57d0d135338450834'), "%3Cdiv%20bar%3DZZ%26%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%26%22"],"ec40a7216b4ac918c5e16cae66bfb8b69bcfabce":[async_test('html5lib_entities02.html ec40a7216b4ac918c5e16cae66bfb8b69bcfabce'), "%3Cdiv%20bar%3D%22ZZ%26gt%3DYY%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%26gt%3DYY%22"],"54d2e9d13436e6850a5257e8028122581cf7088d":[async_test('html5lib_entities02.html 54d2e9d13436e6850a5257e8028122581cf7088d'), "%3Cdiv%20bar%3D%22ZZ%26gt0YY%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%26gt0YY%22"],"99c8496d0ea75429a5836de44dd18708974f6de8":[async_test('html5lib_entities02.html 99c8496d0ea75429a5836de44dd18708974f6de8'), "%3Cdiv%20bar%3D%22ZZ%26gt9YY%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%26gt9YY%22"],"7e4e70e57f63968ebba82682a2629158bd053a65":[async_test('html5lib_entities02.html 7e4e70e57f63968ebba82682a2629158bd053a65'), "%3Cdiv%20bar%3D%22ZZ%26gtaYY%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%26gtaYY%22"],"dca2db4f61b5fd60121e3da3e15065654f8d8a0c":[async_test('html5lib_entities02.html dca2db4f61b5fd60121e3da3e15065654f8d8a0c'), "%3Cdiv%20bar%3D%22ZZ%26gtZYY%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%26gtZYY%22"],"fe22904d5f3936bedc1fa110e6bde48895b399a0":[async_test('html5lib_entities02.html fe22904d5f3936bedc1fa110e6bde48895b399a0'), "%3Cdiv%20bar%3D%22ZZ%26gt%20YY%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%3E%20YY%22"],"6553483a30141fcff05787287c2c212df9f468e8":[async_test('html5lib_entities02.html 6553483a30141fcff05787287c2c212df9f468e8'), "%3Cdiv%20bar%3D%22ZZ%26gt%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%3E%22"],"88d7c74afcb27bbee3e3255d9116dce9c3dc6d73":[async_test('html5lib_entities02.html 88d7c74afcb27bbee3e3255d9116dce9c3dc6d73'), "%3Cdiv%20bar%3D%27ZZ%26gt%27%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%3E%22"],"db5d22d3350e0a51d675dc17c641c73251a4739d":[async_test('html5lib_entities02.html db5d22d3350e0a51d675dc17c641c73251a4739d'), "%3Cdiv%20bar%3DZZ%26gt%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%3E%22"],"ea08276faa7ba526e612fc1e80047d705cd29885":[async_test('html5lib_entities02.html ea08276faa7ba526e612fc1e80047d705cd29885'), "%3Cdiv%20bar%3D%22ZZ%26pound_id%3D23%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%C2%A3_id%3D23%22"],"c59d1cfe1b36e75e0f57664e45bef7023a73c9e9":[async_test('html5lib_entities02.html c59d1cfe1b36e75e0f57664e45bef7023a73c9e9'), "%3Cdiv%20bar%3D%22ZZ%26prod_id%3D23%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%26prod_id%3D23%22"],"f9d3950620f8adcbe5f9a0542c7967de4be65963":[async_test('html5lib_entities02.html f9d3950620f8adcbe5f9a0542c7967de4be65963'), "%3Cdiv%20bar%3D%22ZZ%26pound%3B_id%3D23%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%C2%A3_id%3D23%22"],"8e35dacd7c296f054e58f1ce83719401c8aff8a0":[async_test('html5lib_entities02.html 8e35dacd7c296f054e58f1ce83719401c8aff8a0'), "%3Cdiv%20bar%3D%22ZZ%26prod%3B_id%3D23%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%E2%88%8F_id%3D23%22"],"48edddaa93bbebc5cd1615cc67422ca6508e47a2":[async_test('html5lib_entities02.html 48edddaa93bbebc5cd1615cc67422ca6508e47a2'), "%3Cdiv%20bar%3D%22ZZ%26pound%3D23%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%26pound%3D23%22"],"9c69a29b53eebd93db20f12d405335274098e662":[async_test('html5lib_entities02.html 9c69a29b53eebd93db20f12d405335274098e662'), "%3Cdiv%20bar%3D%22ZZ%26prod%3D23%22%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22ZZ%26prod%3D23%22"],"565c5f6744a27602bb466d6df77803a80f064752":[async_test('html5lib_entities02.html 565c5f6744a27602bb466d6df77803a80f064752'), "%3Cdiv%3EZZ%26pound_id%3D23%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22ZZ%C2%A3_id%3D23%22"],"742984a32ecd86cb9cdedffbba47eb212e19c80f":[async_test('html5lib_entities02.html 742984a32ecd86cb9cdedffbba47eb212e19c80f'), "%3Cdiv%3EZZ%26prod_id%3D23%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22ZZ%26prod_id%3D23%22"],"f908b529ac9ca5366e1160856db2c3d17e3898c9":[async_test('html5lib_entities02.html f908b529ac9ca5366e1160856db2c3d17e3898c9'), "%3Cdiv%3EZZ%26pound%3B_id%3D23%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22ZZ%C2%A3_id%3D23%22"],"1294ffc6bee2ee41f65a60ac48ba445b99504286":[async_test('html5lib_entities02.html 1294ffc6bee2ee41f65a60ac48ba445b99504286'), "%3Cdiv%3EZZ%26prod%3B_id%3D23%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22ZZ%E2%88%8F_id%3D23%22"],"ba7d8cdd4b40020f7af6bdde75a3574b5771fac9":[async_test('html5lib_entities02.html ba7d8cdd4b40020f7af6bdde75a3574b5771fac9'), "%3Cdiv%3EZZ%26pound%3D23%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22ZZ%C2%A3%3D23%22"],"ce23051409f58749cbce6836bc4c7c21e9c548cf":[async_test('html5lib_entities02.html ce23051409f58749cbce6836bc4c7c21e9c548cf'), "%3Cdiv%3EZZ%26prod%3D23%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22ZZ%26prod%3D23%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_html5test-com.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_html5test-com.html
new file mode 100644
index 000000000..b74b7f999
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_html5test-com.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_html5test-com.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['71bd5e6b9e907e65295b6d670627e0da4a8a65ed','32cd504d36a6db3584b716b3681ab4b0741423b3','f0bf0506a2d3e5ca4aa5f14a1f260e405882827e','666a215d91c4e83d99f4be4caebb67fd65569480','fd2cd459bdc79db754b24bc537758990d392b1fc','86be28614bf72e24c162d865c04d687447098867','be72b058e5be0f6aef2c442d83c92c0d251fcb7f','ab6e31cf52c8d57d6dfdcaf7165f1abf7bd5e73d','11240d9b03b14eb515d6a1d1595c5a409830ea38','809c1bebcded8f43981af902442ff8a2db5d2578','bcbeb84f40e56a642b794d514e97e3ec303d4a79','1cbb987dd0a35af3a5b2e4fc11eba36a60eba03d','5b5e75eca2f5c80e1c4d5676254b9891090e288e','93e966e2edad3297ecb159f3983bdd2dc84f829e','7a02a2d7ab875dbeedc9a34c6c27b6119bd6d1f0','46615acdb9dd6231e2a65fed5bcce7e19f086d03','381de12234a699cbfb775b3ca7c679f357e7403e','72736fc894b2077928559cc4284a102635cac898','290d5e7fa9684038411e78c4b0e0ade83150eeea','a5fb9cf46ed215a61d073ae4b7e7477ba49fa5d8','88dea19243733a9bda26c6f5290d2c4f5bbac157','9906bb30ae08654f4c67bf6d97040abbca91082d','c6cd25ce02329e4a42b9be9ba35453532fec7599','81af3f9d6ccc2a1a1a58ace18dd530c544675610',];
+ var tests = {
+ "71bd5e6b9e907e65295b6d670627e0da4a8a65ed":[async_test('html5lib_html5test-com.html 71bd5e6b9e907e65295b6d670627e0da4a8a65ed'), "%3Cdiv%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3Cdiv%3E"],"32cd504d36a6db3584b716b3681ab4b0741423b3":[async_test('html5lib_html5test-com.html 32cd504d36a6db3584b716b3681ab4b0741423b3'), "%3Cdiv%20foo%3Cbar%3D%27%27%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20foo%3Cbar%3D%22%22"],"f0bf0506a2d3e5ca4aa5f14a1f260e405882827e":[async_test('html5lib_html5test-com.html f0bf0506a2d3e5ca4aa5f14a1f260e405882827e'), "%3Cdiv%20foo%3D%60bar%60%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20foo%3D%22%60bar%60%22"],"666a215d91c4e83d99f4be4caebb67fd65569480":[async_test('html5lib_html5test-com.html 666a215d91c4e83d99f4be4caebb67fd65569480'), "%3Cdiv%20%5C%22foo%3D%27%27%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%5C%22foo%3D%22%22"],"fd2cd459bdc79db754b24bc537758990d392b1fc":[async_test('html5lib_html5test-com.html fd2cd459bdc79db754b24bc537758990d392b1fc'), "%3Ca%20href%3D%27%5Cnbar%27%3E%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20href%3D%22%5Cnbar%22"],"86be28614bf72e24c162d865c04d687447098867":[async_test('html5lib_html5test-com.html 86be28614bf72e24c162d865c04d687447098867'), "%3C%21DOCTYPE%20html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"be72b058e5be0f6aef2c442d83c92c0d251fcb7f":[async_test('html5lib_html5test-com.html be72b058e5be0f6aef2c442d83c92c0d251fcb7f'), "%26lang%3B%26rang%3B", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%9F%A8%E2%9F%A9%22"],"ab6e31cf52c8d57d6dfdcaf7165f1abf7bd5e73d":[async_test('html5lib_html5test-com.html ab6e31cf52c8d57d6dfdcaf7165f1abf7bd5e73d'), "%26apos%3B", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%27%22"],"11240d9b03b14eb515d6a1d1595c5a409830ea38":[async_test('html5lib_html5test-com.html 11240d9b03b14eb515d6a1d1595c5a409830ea38'), "%26ImaginaryI%3B", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%85%88%22"],"809c1bebcded8f43981af902442ff8a2db5d2578":[async_test('html5lib_html5test-com.html 809c1bebcded8f43981af902442ff8a2db5d2578'), "%26Kopf%3B", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%F0%9D%95%82%22"],"bcbeb84f40e56a642b794d514e97e3ec303d4a79":[async_test('html5lib_html5test-com.html bcbeb84f40e56a642b794d514e97e3ec303d4a79'), "%26notinva%3B", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%88%89%22"],"1cbb987dd0a35af3a5b2e4fc11eba36a60eba03d":[async_test('html5lib_html5test-com.html 1cbb987dd0a35af3a5b2e4fc11eba36a60eba03d'), "%3C%3Fimport%20namespace%3D%22foo%22%20implementation%3D%22%23bar%22%3E", "%23document%0A%7C%20%3C%21--%20%3Fimport%20namespace%3D%22foo%22%20implementation%3D%22%23bar%22%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"5b5e75eca2f5c80e1c4d5676254b9891090e288e":[async_test('html5lib_html5test-com.html 5b5e75eca2f5c80e1c4d5676254b9891090e288e'), "%3C%21--foo--bar--%3E", "%23document%0A%7C%20%3C%21--%20foo--bar%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"93e966e2edad3297ecb159f3983bdd2dc84f829e":[async_test('html5lib_html5test-com.html 93e966e2edad3297ecb159f3983bdd2dc84f829e'), "%3C%21%5BCDATA%5Bx%5D%5D%3E", "%23document%0A%7C%20%3C%21--%20%5BCDATA%5Bx%5D%5D%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"7a02a2d7ab875dbeedc9a34c6c27b6119bd6d1f0":[async_test('html5lib_html5test-com.html 7a02a2d7ab875dbeedc9a34c6c27b6119bd6d1f0'), "%3Ctextarea%3E%3C%21--%3C/textarea%3E--%3E%3C/textarea%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%20%20%22--%3E%22"],"46615acdb9dd6231e2a65fed5bcce7e19f086d03":[async_test('html5lib_html5test-com.html 46615acdb9dd6231e2a65fed5bcce7e19f086d03'), "%3Ctextarea%3E%3C%21--%3C/textarea%3E--%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%20%20%22--%3E%22"],"381de12234a699cbfb775b3ca7c679f357e7403e":[async_test('html5lib_html5test-com.html 381de12234a699cbfb775b3ca7c679f357e7403e'), "%3Cstyle%3E%3C%21--%3C/style%3E--%3E%3C/style%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"72736fc894b2077928559cc4284a102635cac898":[async_test('html5lib_html5test-com.html 72736fc894b2077928559cc4284a102635cac898'), "%3Cstyle%3E%3C%21--%3C/style%3E--%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"290d5e7fa9684038411e78c4b0e0ade83150eeea":[async_test('html5lib_html5test-com.html 290d5e7fa9684038411e78c4b0e0ade83150eeea'), "%3Cul%3E%3Cli%3EA%20%3C/li%3E%20%3Cli%3EB%3C/li%3E%3C/ul%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cul%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%20%20%22A%20%22%0A%7C%20%20%20%20%20%20%20%22%20%22%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%20%20%22B%22"],"a5fb9cf46ed215a61d073ae4b7e7477ba49fa5d8":[async_test('html5lib_html5test-com.html a5fb9cf46ed215a61d073ae4b7e7477ba49fa5d8'), "%3Ctable%3E%3Cform%3E%3Cinput%20type%3Dhidden%3E%3Cinput%3E%3C/form%3E%3Cdiv%3E%3C/div%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20type%3D%22hidden%22"],"88dea19243733a9bda26c6f5290d2c4f5bbac157":[async_test('html5lib_html5test-com.html 88dea19243733a9bda26c6f5290d2c4f5bbac157'), "%3Ci%3EA%3Cb%3EB%3Cp%3E%3C/i%3EC%3C/b%3ED", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%22A%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22B%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%22C%22%0A%7C%20%20%20%20%20%20%20%22D%22"],"9906bb30ae08654f4c67bf6d97040abbca91082d":[async_test('html5lib_html5test-com.html 9906bb30ae08654f4c67bf6d97040abbca91082d'), "%3Cdiv%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E"],"c6cd25ce02329e4a42b9be9ba35453532fec7599":[async_test('html5lib_html5test-com.html c6cd25ce02329e4a42b9be9ba35453532fec7599'), "%3Csvg%3E%3C/svg%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E"],"81af3f9d6ccc2a1a1a58ace18dd530c544675610":[async_test('html5lib_html5test-com.html 81af3f9d6ccc2a1a1a58ace18dd530c544675610'), "%3Cmath%3E%3C/math%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_inbody01.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_inbody01.html
new file mode 100644
index 000000000..43064d43f
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_inbody01.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_inbody01.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['3e20aae3cbc7f10b28cbfc1e20b2949708872a3c','ec6b9d9dccaa3494a317afac0edfcc485b959663','cc4923612d10b2115cd03e269080ddf5463d95ae','a5ebf8808e479239966038951d5383ed65ff4eb6',];
+ var tests = {
+ "3e20aae3cbc7f10b28cbfc1e20b2949708872a3c":[async_test('html5lib_inbody01.html 3e20aae3cbc7f10b28cbfc1e20b2949708872a3c'), "%3Cbutton%3E1%3C/foo%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%221%22"],"ec6b9d9dccaa3494a317afac0edfcc485b959663":[async_test('html5lib_inbody01.html ec6b9d9dccaa3494a317afac0edfcc485b959663'), "%3Cfoo%3E1%3Cp%3E2%3C/foo%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfoo%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22"],"cc4923612d10b2115cd03e269080ddf5463d95ae":[async_test('html5lib_inbody01.html cc4923612d10b2115cd03e269080ddf5463d95ae'), "%3Cdd%3E1%3C/foo%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdd%3E%0A%7C%20%20%20%20%20%20%20%221%22"],"a5ebf8808e479239966038951d5383ed65ff4eb6":[async_test('html5lib_inbody01.html a5ebf8808e479239966038951d5383ed65ff4eb6'), "%3Cfoo%3E1%3Cdd%3E2%3C/foo%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfoo%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Cdd%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests4.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests4.html
new file mode 100644
index 000000000..9394df7f1
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests4.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_innerHTML_tests4.html</title>
+ <meta name="timeout" content="long">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['8c692a23f8c9b5860cf06fb334041d2e97e96f5c','95cb768746a1ca7ac02d39c0bb2b10d9e965e37c','06bd3583493359d112d19765f68fac3901267408','48d8375ef2d9d73bd133f2947858a3450a988d53','36fb2178fbdfa1b32701a9d9214c3fd115fd7184','d373bc3abdda01b17a6055af21b16c151dd1d697','4f91b1d4c6e2bbc0595c9effc490b7357e9cefc2',];
+ var tests = {
+ "8c692a23f8c9b5860cf06fb334041d2e97e96f5c":[async_test('html5lib_innerHTML_tests4.html 8c692a23f8c9b5860cf06fb334041d2e97e96f5c'), "direct%20div%20content", "%23document%0A%7C%20%22direct%20div%20content%22", 'div'],"95cb768746a1ca7ac02d39c0bb2b10d9e965e37c":[async_test('html5lib_innerHTML_tests4.html 95cb768746a1ca7ac02d39c0bb2b10d9e965e37c'), "direct%20textarea%20content", "%23document%0A%7C%20%22direct%20textarea%20content%22", 'textarea'],"06bd3583493359d112d19765f68fac3901267408":[async_test('html5lib_innerHTML_tests4.html 06bd3583493359d112d19765f68fac3901267408'), "textarea%20content%20with%20%3Cem%3Epseudo%3C/em%3E%20%3Cfoo%3Emarkup", "%23document%0A%7C%20%22textarea%20content%20with%20%3Cem%3Epseudo%3C/em%3E%20%3Cfoo%3Emarkup%22", 'textarea'],"48d8375ef2d9d73bd133f2947858a3450a988d53":[async_test('html5lib_innerHTML_tests4.html 48d8375ef2d9d73bd133f2947858a3450a988d53'), "this%20is%20%26%23x0043%3BDATA%20inside%20a%20%3Cstyle%3E%20element", "%23document%0A%7C%20%22this%20is%20%26%23x0043%3BDATA%20inside%20a%20%3Cstyle%3E%20element%22", 'style'],"36fb2178fbdfa1b32701a9d9214c3fd115fd7184":[async_test('html5lib_innerHTML_tests4.html 36fb2178fbdfa1b32701a9d9214c3fd115fd7184'), "%3C/plaintext%3E", "%23document%0A%7C%20%22%3C/plaintext%3E%22", 'plaintext'],"d373bc3abdda01b17a6055af21b16c151dd1d697":[async_test('html5lib_innerHTML_tests4.html d373bc3abdda01b17a6055af21b16c151dd1d697'), "setting%20html%27s%20innerHTML", "%23document%0A%7C%20%3Chead%3E%0A%7C%20%3Cbody%3E%0A%7C%20%20%20%22setting%20html%27s%20innerHTML%22", 'html'],"4f91b1d4c6e2bbc0595c9effc490b7357e9cefc2":[async_test('html5lib_innerHTML_tests4.html 4f91b1d4c6e2bbc0595c9effc490b7357e9cefc2'), "%3Ctitle%3Esetting%20head%27s%20innerHTML%3C/title%3E", "%23document%0A%7C%20%3Ctitle%3E%0A%7C%20%20%20%22setting%20head%27s%20innerHTML%22", 'head'],
+ }
+ init_tests("innerHTML");
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests6.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests6.html
new file mode 100644
index 000000000..7b7669e2f
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests6.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_innerHTML_tests6.html</title>
+ <meta name="timeout" content="long">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['ccb245e2f1d9fe1580235854daa1a124525aca61','ed2b0f8fe477e3a6a0d9052b46bd94e628fb666a','ed4acc4544b7ee83072a3c2ae078e3cbaf8303fb','28f111cdfb84bfa4a70b57e3aeec1f0aa13337de','616bd17e481973f9fe286aa30727ee22850fc31e','1cfb3baf2ad29109ddd5581daa3a009029c71491','98ba377bacd2ec343919bdc589116eabf94402d5','7cf2db8c65b79da98e39b13772ed0440ff177fd7','cb78efe1d4f4279be6c0a363cce643b3591efdc5','82911b0551c00e9971dd1491f8f2d2782aa3ac63','a3ff1f1809e8018b725620f1d04b6ebb24fda9a4','e35e330f7eb5bb27df1fe702843747e104a193be','c1dc3add1fcb1f506ea395691a710eb8e727b123',];
+ var tests = {
+ "ccb245e2f1d9fe1580235854daa1a124525aca61":[async_test('html5lib_innerHTML_tests6.html ccb245e2f1d9fe1580235854daa1a124525aca61'), "%3Cbody%3E%0A%3Cdiv%3E", "%23document%0A%7C%20%22%0A%22%0A%7C%20%3Cdiv%3E", 'div'],"ed2b0f8fe477e3a6a0d9052b46bd94e628fb666a":[async_test('html5lib_innerHTML_tests6.html ed2b0f8fe477e3a6a0d9052b46bd94e628fb666a'), "%3C/caption%3E%3Cdiv%3E", "%23document%0A%7C%20%3Cdiv%3E", 'caption'],"ed4acc4544b7ee83072a3c2ae078e3cbaf8303fb":[async_test('html5lib_innerHTML_tests6.html ed4acc4544b7ee83072a3c2ae078e3cbaf8303fb'), "%3C/table%3E%3Cdiv%3E", "%23document%0A%7C%20%3Cdiv%3E", 'caption'],"28f111cdfb84bfa4a70b57e3aeec1f0aa13337de":[async_test('html5lib_innerHTML_tests6.html 28f111cdfb84bfa4a70b57e3aeec1f0aa13337de'), "%3C/table%3E%3C/tbody%3E%3C/tfoot%3E%3C/thead%3E%3C/tr%3E%3Cdiv%3E", "%23document%0A%7C%20%3Cdiv%3E", 'td'],"616bd17e481973f9fe286aa30727ee22850fc31e":[async_test('html5lib_innerHTML_tests6.html 616bd17e481973f9fe286aa30727ee22850fc31e'), "foo%3Ccol%3E", "%23document%0A%7C%20%3Ccol%3E", 'colgroup'],"1cfb3baf2ad29109ddd5581daa3a009029c71491":[async_test('html5lib_innerHTML_tests6.html 1cfb3baf2ad29109ddd5581daa3a009029c71491'), "%3C/frameset%3E%3Cframe%3E", "%23document%0A%7C%20%3Cframe%3E", 'frameset'],"98ba377bacd2ec343919bdc589116eabf94402d5":[async_test('html5lib_innerHTML_tests6.html 98ba377bacd2ec343919bdc589116eabf94402d5'), "%3C/body%3E%3Cdiv%3E", "%23document%0A%7C%20%3Cdiv%3E", 'body'],"7cf2db8c65b79da98e39b13772ed0440ff177fd7":[async_test('html5lib_innerHTML_tests6.html 7cf2db8c65b79da98e39b13772ed0440ff177fd7'), "%3C/tr%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"cb78efe1d4f4279be6c0a363cce643b3591efdc5":[async_test('html5lib_innerHTML_tests6.html cb78efe1d4f4279be6c0a363cce643b3591efdc5'), "%3C/tbody%3E%3C/tfoot%3E%3C/thead%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"82911b0551c00e9971dd1491f8f2d2782aa3ac63":[async_test('html5lib_innerHTML_tests6.html 82911b0551c00e9971dd1491f8f2d2782aa3ac63'), "%3Ccaption%3E%3Ccol%3E%3Ccolgroup%3E%3Ctbody%3E%3Ctfoot%3E%3Cthead%3E%3Ctr%3E", "%23document%0A%7C%20%3Ctr%3E", 'tbody'],"a3ff1f1809e8018b725620f1d04b6ebb24fda9a4":[async_test('html5lib_innerHTML_tests6.html a3ff1f1809e8018b725620f1d04b6ebb24fda9a4'), "%3C/table%3E%3Ctr%3E", "%23document%0A%7C%20%3Ctr%3E", 'tbody'],"e35e330f7eb5bb27df1fe702843747e104a193be":[async_test('html5lib_innerHTML_tests6.html e35e330f7eb5bb27df1fe702843747e104a193be'), "%3C/table%3E%3Ctr%3E", "%23document%0A%7C%20%3Ctbody%3E%0A%7C%20%20%20%3Ctr%3E", 'table'],"c1dc3add1fcb1f506ea395691a710eb8e727b123":[async_test('html5lib_innerHTML_tests6.html c1dc3add1fcb1f506ea395691a710eb8e727b123'), "%3Cbody%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3Chead%3E%0A%7C%20%3Cbody%3E", 'html'],
+ }
+ init_tests("innerHTML");
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests7.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests7.html
new file mode 100644
index 000000000..cc7752297
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests7.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_innerHTML_tests7.html</title>
+ <meta name="timeout" content="long">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['7aabda442dc7b37110c3d03b1465fa893dc25625',];
+ var tests = {
+ "7aabda442dc7b37110c3d03b1465fa893dc25625":[async_test('html5lib_innerHTML_tests7.html 7aabda442dc7b37110c3d03b1465fa893dc25625'), "%3Cbody%3EX%3C/body%3E%3C/body%3E", "%23document%0A%7C%20%3Chead%3E%0A%7C%20%3Cbody%3E%0A%7C%20%20%20%22X%22", 'html'],
+ }
+ init_tests("innerHTML");
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests_innerHTML_1.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests_innerHTML_1.html
new file mode 100644
index 000000000..29df3868a
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests_innerHTML_1.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_innerHTML_tests_innerHTML_1.html</title>
+ <meta name="timeout" content="long">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['7a9e287595dd570e0f19b7eec0ac424228908daf','6f766fa07c8697a5379c5542adbba2a42f913004','dbbe75ae41228f9264d56a018e620217ec87fd32','32e2fea7531c0c910ac73b35665b2f8bca47a049','7fc9ad33d4bc6af760883f0581cf869f96473f2e','8883d04b33c7e718b0d201a5f0bf5aa6d98754e6','347f73ada7ab974a081c65385444cca0b6a2d446','25a03753c27ab46891e2c59665215e4657ca7177','75e9c86aff595da8999673fce99bc12741552c4e','e35e330f7eb5bb27df1fe702843747e104a193be','b55e32e22980fe99bab895005a0a757a2fcb1a2b','ce6fc19319d2568fec9084d8d4d1cc10f20b8565','b600f8c7df58e42342feff051778923dbf7616af','6056619333f1a780052612e1dda18112147f67fa','d9300c4d8d36e950490bbe5800c1a3ba4e744e2a','411ebe3bea1d0508263ec17618492feaa9ca99d7','6c7c85721f823ab889bcb9e035341a1fb6d6eeee','973d06969d7968d200d5639ce06f7209655b1e26','dfb6ec1e412a6634b497151f222f4272721ae57e','4916096ab7dbdd051dc96de7952ec60674d617a3','58277507de4ce0df9b4eb03262e4cb04d2fcc7af','8e5727f170507ba6b86c1c3bdb3a5201d3480b33','61eb343f71030688ab1a26bb980b9e4409993e3d','3548939a56a148b59781c5f930036c1528db1545','0b88a12102fba0634b44ac9f157544faeca68df6','c300553f45f4ad6e5e1da9d884fafb95f36ab05a','00a7ed4082183eba76af197418305b2d196ec7e6','5dfd84382f85ff8343a62d6bb5028996111e5017','9b1a1cd33bb3f26ec3f969f3158edf5c2db47052','8ab89f758b96bf994a21d8283d27e8ae9804b924','25add8314f59cdc264d7779f36ae4dffd1f9ad29','7104e981f6018b18766fd95109bfbffeb878cc56','28fbaa710ce3f440a56fdf909c4b8bc223a1b965','3380b0143f3d1e2edb216d388acd72702e141165','a630fb272be6de118b728a28d6ce71b296a75694','5adf8b7bd3d63a77ea1dbe6deb6741c5b92de6cd','4e0312ac349a70d07f2bb1ae154740e46e8c9a6e','987061379d2542e88d8a72ce6f0169a211d3ac41','e0798aa003863ba2be750d3e6c2e6766fea11279','586ed8e0d1395198f43ee68843d654a49169f379','8896feedef576c1ed768a4eb67f57c3dc5242fed','89f4f0f289a23d1ebfbf499c2ecd24cd35fc10b4','2c07361470533b905a7ff9a685439cad2fe35549','a36f27cbe53991c647055c95bfa250a0ab734b0d','ac28c352ae8453434e3aefb24e798a9580c1b230','f8770f97671a805b37277db7e42536b40c0804cb','469a071b520d8436e6a0f6da6f9385f5ebd8e2f8','7cf2db8c65b79da98e39b13772ed0440ff177fd7','3940fdb54783cb3c42138670a17d28e77e29e900','3b5ab5fbb3585d7215a5766f1e2377b7929b5cc6','7c4a40203d5830d36432b0f30a09cebea6e9d2e4','e6d930d4239666fdc6c0722106bd2b115b4d3fd3','c8817b3b55a437bd153e978fc5f49fbe10bb56e2','2a302c14f1983aaad9fd7abe49336d9561ed82e9','28cfddd5b5875f7044b0859ba4ce88175fcbf07e','887596c50809eeb809ad24d86c239130a42f5a46','fa3797a2d2baeb8b8b2de81f1e7f33725e6b2aad','dc0e2582ff83e60c0eb549dc3387562d3482e364','4ea02fd705291eb2d14274ebeaa0117ba2b9b306','52cc77eac9488a8bb1a2c8c695f16f8919c52044','c53ab7d84ae27de9f0937521c74eec2fd6c1b1ec','d8747a49503f3486155d77dd366e0ee8ad9512a6','03e71832c254852f206f6f0ae6f4d161a276a699','92786cfafa890c23f200dccea089ca52233ef395','11d284c2b1e2f87d28dd06b938518361fe834855','bf6aebcd54d5dead9e6d56c77b41f01ea666d8b1','4d448a4239cb4c465a21c04997d656e51fdd388f','1e8faedc427045d59305218c1aba2f545c4eb4b7','6762997c1a93b1ec65722498f3fd00f0d8129369','a162461c18d9b09734f6fe5d362b84edb4eed31f','0befc335ffd6cace344d94a35de96af22b1313a5','a23b70f1f246ba08d13b570319391b4a5c3e9456','9d5e0c25bfe921df9ea2897c027f42bc88950e69','9210d577d6deecf5ab3505af86c501c5befa0b50','c34af491c0a339db6ba63fcc478108533347319b','2c4284e6b2bb480daa50bca43bcbe29cfcdeeab4','d75277b65d0118463afeb66b478509d4e27565ab','b354df69dbe9b3ef0c42177648e3aace114cf8ea','fd3be386292ea1f411cea8e86e29595deb177d28','1cfb3baf2ad29109ddd5581daa3a009029c71491','2555d238e04f3d2853cfbc5f6dd366f82cf0e868',];
+ var tests = {
+ "7a9e287595dd570e0f19b7eec0ac424228908daf":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 7a9e287595dd570e0f19b7eec0ac424228908daf'), "%3Cbody%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E", 'body'],"6f766fa07c8697a5379c5542adbba2a42f913004":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 6f766fa07c8697a5379c5542adbba2a42f913004'), "%3Cspan%3E%3Cbody%3E", "%23document%0A%7C%20%3Cspan%3E", 'body'],"dbbe75ae41228f9264d56a018e620217ec87fd32":[async_test('html5lib_innerHTML_tests_innerHTML_1.html dbbe75ae41228f9264d56a018e620217ec87fd32'), "%3Cspan%3E%3Cbody%3E", "%23document%0A%7C%20%3Cspan%3E", 'div'],"32e2fea7531c0c910ac73b35665b2f8bca47a049":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 32e2fea7531c0c910ac73b35665b2f8bca47a049'), "%3Cbody%3E%3Cspan%3E", "%23document%0A%7C%20%3Chead%3E%0A%7C%20%3Cbody%3E%0A%7C%20%20%20%3Cspan%3E", 'html'],"7fc9ad33d4bc6af760883f0581cf869f96473f2e":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 7fc9ad33d4bc6af760883f0581cf869f96473f2e'), "%3Cframeset%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E", 'body'],"8883d04b33c7e718b0d201a5f0bf5aa6d98754e6":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 8883d04b33c7e718b0d201a5f0bf5aa6d98754e6'), "%3Cspan%3E%3Cframeset%3E", "%23document%0A%7C%20%3Cspan%3E", 'body'],"347f73ada7ab974a081c65385444cca0b6a2d446":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 347f73ada7ab974a081c65385444cca0b6a2d446'), "%3Cspan%3E%3Cframeset%3E", "%23document%0A%7C%20%3Cspan%3E", 'div'],"25a03753c27ab46891e2c59665215e4657ca7177":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 25a03753c27ab46891e2c59665215e4657ca7177'), "%3Cframeset%3E%3Cspan%3E", "%23document%0A%7C%20%3Chead%3E%0A%7C%20%3Cframeset%3E", 'html'],"75e9c86aff595da8999673fce99bc12741552c4e":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 75e9c86aff595da8999673fce99bc12741552c4e'), "%3Ctable%3E%3Ctr%3E", "%23document%0A%7C%20%3Ctbody%3E%0A%7C%20%20%20%3Ctr%3E", 'table'],"e35e330f7eb5bb27df1fe702843747e104a193be":[async_test('html5lib_innerHTML_tests_innerHTML_1.html e35e330f7eb5bb27df1fe702843747e104a193be'), "%3C/table%3E%3Ctr%3E", "%23document%0A%7C%20%3Ctbody%3E%0A%7C%20%20%20%3Ctr%3E", 'table'],"b55e32e22980fe99bab895005a0a757a2fcb1a2b":[async_test('html5lib_innerHTML_tests_innerHTML_1.html b55e32e22980fe99bab895005a0a757a2fcb1a2b'), "%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'table'],"ce6fc19319d2568fec9084d8d4d1cc10f20b8565":[async_test('html5lib_innerHTML_tests_innerHTML_1.html ce6fc19319d2568fec9084d8d4d1cc10f20b8565'), "%3Ca%3E%3Ccaption%3Ea", "%23document%0A%7C%20%3Ca%3E%0A%7C%20%3Ccaption%3E%0A%7C%20%20%20%22a%22", 'table'],"b600f8c7df58e42342feff051778923dbf7616af":[async_test('html5lib_innerHTML_tests_innerHTML_1.html b600f8c7df58e42342feff051778923dbf7616af'), "%3Ca%3E%3Ccolgroup%3E%3Ccol%3E", "%23document%0A%7C%20%3Ca%3E%0A%7C%20%3Ccolgroup%3E%0A%7C%20%20%20%3Ccol%3E", 'table'],"6056619333f1a780052612e1dda18112147f67fa":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 6056619333f1a780052612e1dda18112147f67fa'), "%3Ca%3E%3Ctbody%3E%3Ctr%3E", "%23document%0A%7C%20%3Ca%3E%0A%7C%20%3Ctbody%3E%0A%7C%20%20%20%3Ctr%3E", 'table'],"d9300c4d8d36e950490bbe5800c1a3ba4e744e2a":[async_test('html5lib_innerHTML_tests_innerHTML_1.html d9300c4d8d36e950490bbe5800c1a3ba4e744e2a'), "%3Ca%3E%3Ctfoot%3E%3Ctr%3E", "%23document%0A%7C%20%3Ca%3E%0A%7C%20%3Ctfoot%3E%0A%7C%20%20%20%3Ctr%3E", 'table'],"411ebe3bea1d0508263ec17618492feaa9ca99d7":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 411ebe3bea1d0508263ec17618492feaa9ca99d7'), "%3Ca%3E%3Cthead%3E%3Ctr%3E", "%23document%0A%7C%20%3Ca%3E%0A%7C%20%3Cthead%3E%0A%7C%20%20%20%3Ctr%3E", 'table'],"6c7c85721f823ab889bcb9e035341a1fb6d6eeee":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 6c7c85721f823ab889bcb9e035341a1fb6d6eeee'), "%3Ca%3E%3Ctr%3E", "%23document%0A%7C%20%3Ca%3E%0A%7C%20%3Ctbody%3E%0A%7C%20%20%20%3Ctr%3E", 'table'],"973d06969d7968d200d5639ce06f7209655b1e26":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 973d06969d7968d200d5639ce06f7209655b1e26'), "%3Ca%3E%3Cth%3E", "%23document%0A%7C%20%3Ca%3E%0A%7C%20%3Ctbody%3E%0A%7C%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%3Cth%3E", 'table'],"dfb6ec1e412a6634b497151f222f4272721ae57e":[async_test('html5lib_innerHTML_tests_innerHTML_1.html dfb6ec1e412a6634b497151f222f4272721ae57e'), "%3Ca%3E%3Ctd%3E", "%23document%0A%7C%20%3Ca%3E%0A%7C%20%3Ctbody%3E%0A%7C%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%3Ctd%3E", 'table'],"4916096ab7dbdd051dc96de7952ec60674d617a3":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 4916096ab7dbdd051dc96de7952ec60674d617a3'), "%3Ctable%3E%3C/table%3E%3Ctbody%3E", "%23document%0A%7C%20%3Ctable%3E", 'caption'],"58277507de4ce0df9b4eb03262e4cb04d2fcc7af":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 58277507de4ce0df9b4eb03262e4cb04d2fcc7af'), "%3C/table%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E", 'caption'],"8e5727f170507ba6b86c1c3bdb3a5201d3480b33":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 8e5727f170507ba6b86c1c3bdb3a5201d3480b33'), "%3Cspan%3E%3C/table%3E", "%23document%0A%7C%20%3Cspan%3E", 'caption'],"61eb343f71030688ab1a26bb980b9e4409993e3d":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 61eb343f71030688ab1a26bb980b9e4409993e3d'), "%3C/caption%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E", 'caption'],"3548939a56a148b59781c5f930036c1528db1545":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 3548939a56a148b59781c5f930036c1528db1545'), "%3Cspan%3E%3C/caption%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E%0A%7C%20%20%20%3Cspan%3E", 'caption'],"0b88a12102fba0634b44ac9f157544faeca68df6":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 0b88a12102fba0634b44ac9f157544faeca68df6'), "%3Cspan%3E%3Ccaption%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E%0A%7C%20%20%20%3Cspan%3E", 'caption'],"c300553f45f4ad6e5e1da9d884fafb95f36ab05a":[async_test('html5lib_innerHTML_tests_innerHTML_1.html c300553f45f4ad6e5e1da9d884fafb95f36ab05a'), "%3Cspan%3E%3Ccol%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E%0A%7C%20%20%20%3Cspan%3E", 'caption'],"00a7ed4082183eba76af197418305b2d196ec7e6":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 00a7ed4082183eba76af197418305b2d196ec7e6'), "%3Cspan%3E%3Ccolgroup%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E%0A%7C%20%20%20%3Cspan%3E", 'caption'],"5dfd84382f85ff8343a62d6bb5028996111e5017":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 5dfd84382f85ff8343a62d6bb5028996111e5017'), "%3Cspan%3E%3Chtml%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E%0A%7C%20%20%20%3Cspan%3E", 'caption'],"9b1a1cd33bb3f26ec3f969f3158edf5c2db47052":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 9b1a1cd33bb3f26ec3f969f3158edf5c2db47052'), "%3Cspan%3E%3Ctbody%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E%0A%7C%20%20%20%3Cspan%3E", 'caption'],"8ab89f758b96bf994a21d8283d27e8ae9804b924":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 8ab89f758b96bf994a21d8283d27e8ae9804b924'), "%3Cspan%3E%3Ctd%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E%0A%7C%20%20%20%3Cspan%3E", 'caption'],"25add8314f59cdc264d7779f36ae4dffd1f9ad29":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 25add8314f59cdc264d7779f36ae4dffd1f9ad29'), "%3Cspan%3E%3Ctfoot%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E%0A%7C%20%20%20%3Cspan%3E", 'caption'],"7104e981f6018b18766fd95109bfbffeb878cc56":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 7104e981f6018b18766fd95109bfbffeb878cc56'), "%3Cspan%3E%3Cthead%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E%0A%7C%20%20%20%3Cspan%3E", 'caption'],"28fbaa710ce3f440a56fdf909c4b8bc223a1b965":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 28fbaa710ce3f440a56fdf909c4b8bc223a1b965'), "%3Cspan%3E%3Cth%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E%0A%7C%20%20%20%3Cspan%3E", 'caption'],"3380b0143f3d1e2edb216d388acd72702e141165":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 3380b0143f3d1e2edb216d388acd72702e141165'), "%3Cspan%3E%3Ctr%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E%0A%7C%20%20%20%3Cspan%3E", 'caption'],"a630fb272be6de118b728a28d6ce71b296a75694":[async_test('html5lib_innerHTML_tests_innerHTML_1.html a630fb272be6de118b728a28d6ce71b296a75694'), "%3Cspan%3E%3C/table%3E%3Cspan%3E", "%23document%0A%7C%20%3Cspan%3E%0A%7C%20%20%20%3Cspan%3E", 'caption'],"5adf8b7bd3d63a77ea1dbe6deb6741c5b92de6cd":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 5adf8b7bd3d63a77ea1dbe6deb6741c5b92de6cd'), "%3C/colgroup%3E%3Ccol%3E", "%23document%0A%7C%20%3Ccol%3E", 'colgroup'],"4e0312ac349a70d07f2bb1ae154740e46e8c9a6e":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 4e0312ac349a70d07f2bb1ae154740e46e8c9a6e'), "%3Ca%3E%3Ccol%3E", "%23document%0A%7C%20%3Ccol%3E", 'colgroup'],"987061379d2542e88d8a72ce6f0169a211d3ac41":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 987061379d2542e88d8a72ce6f0169a211d3ac41'), "%3Ccaption%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'tbody'],"e0798aa003863ba2be750d3e6c2e6766fea11279":[async_test('html5lib_innerHTML_tests_innerHTML_1.html e0798aa003863ba2be750d3e6c2e6766fea11279'), "%3Ccol%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'tbody'],"586ed8e0d1395198f43ee68843d654a49169f379":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 586ed8e0d1395198f43ee68843d654a49169f379'), "%3Ccolgroup%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'tbody'],"8896feedef576c1ed768a4eb67f57c3dc5242fed":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 8896feedef576c1ed768a4eb67f57c3dc5242fed'), "%3Ctbody%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'tbody'],"89f4f0f289a23d1ebfbf499c2ecd24cd35fc10b4":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 89f4f0f289a23d1ebfbf499c2ecd24cd35fc10b4'), "%3Ctfoot%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'tbody'],"2c07361470533b905a7ff9a685439cad2fe35549":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 2c07361470533b905a7ff9a685439cad2fe35549'), "%3Cthead%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'tbody'],"a36f27cbe53991c647055c95bfa250a0ab734b0d":[async_test('html5lib_innerHTML_tests_innerHTML_1.html a36f27cbe53991c647055c95bfa250a0ab734b0d'), "%3C/table%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'tbody'],"ac28c352ae8453434e3aefb24e798a9580c1b230":[async_test('html5lib_innerHTML_tests_innerHTML_1.html ac28c352ae8453434e3aefb24e798a9580c1b230'), "%3Ca%3E%3Ctr%3E", "%23document%0A%7C%20%3Ca%3E%0A%7C%20%3Ctr%3E", 'tbody'],"f8770f97671a805b37277db7e42536b40c0804cb":[async_test('html5lib_innerHTML_tests_innerHTML_1.html f8770f97671a805b37277db7e42536b40c0804cb'), "%3Ca%3E%3Ctd%3E", "%23document%0A%7C%20%3Ca%3E%0A%7C%20%3Ctr%3E%0A%7C%20%20%20%3Ctd%3E", 'tbody'],"469a071b520d8436e6a0f6da6f9385f5ebd8e2f8":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 469a071b520d8436e6a0f6da6f9385f5ebd8e2f8'), "%3Ctd%3E%3Ctable%3E%3Ctbody%3E%3Ca%3E%3Ctr%3E", "%23document%0A%7C%20%3Ctr%3E%0A%7C%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E", 'tbody'],"7cf2db8c65b79da98e39b13772ed0440ff177fd7":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 7cf2db8c65b79da98e39b13772ed0440ff177fd7'), "%3C/tr%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"3940fdb54783cb3c42138670a17d28e77e29e900":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 3940fdb54783cb3c42138670a17d28e77e29e900'), "%3Ctd%3E%3Ctable%3E%3Ca%3E%3Ctr%3E%3C/tr%3E%3Ctr%3E", "%23document%0A%7C%20%3Ctd%3E%0A%7C%20%20%20%3Ca%3E%0A%7C%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%3Ctr%3E", 'tr'],"3b5ab5fbb3585d7215a5766f1e2377b7929b5cc6":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 3b5ab5fbb3585d7215a5766f1e2377b7929b5cc6'), "%3Ccaption%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"7c4a40203d5830d36432b0f30a09cebea6e9d2e4":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 7c4a40203d5830d36432b0f30a09cebea6e9d2e4'), "%3Ccol%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"e6d930d4239666fdc6c0722106bd2b115b4d3fd3":[async_test('html5lib_innerHTML_tests_innerHTML_1.html e6d930d4239666fdc6c0722106bd2b115b4d3fd3'), "%3Ccolgroup%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"c8817b3b55a437bd153e978fc5f49fbe10bb56e2":[async_test('html5lib_innerHTML_tests_innerHTML_1.html c8817b3b55a437bd153e978fc5f49fbe10bb56e2'), "%3Ctbody%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"2a302c14f1983aaad9fd7abe49336d9561ed82e9":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 2a302c14f1983aaad9fd7abe49336d9561ed82e9'), "%3Ctfoot%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"28cfddd5b5875f7044b0859ba4ce88175fcbf07e":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 28cfddd5b5875f7044b0859ba4ce88175fcbf07e'), "%3Cthead%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"887596c50809eeb809ad24d86c239130a42f5a46":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 887596c50809eeb809ad24d86c239130a42f5a46'), "%3Ctr%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"fa3797a2d2baeb8b8b2de81f1e7f33725e6b2aad":[async_test('html5lib_innerHTML_tests_innerHTML_1.html fa3797a2d2baeb8b8b2de81f1e7f33725e6b2aad'), "%3C/table%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"dc0e2582ff83e60c0eb549dc3387562d3482e364":[async_test('html5lib_innerHTML_tests_innerHTML_1.html dc0e2582ff83e60c0eb549dc3387562d3482e364'), "%3Ctd%3E%3Ctable%3E%3C/table%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E%0A%7C%20%20%20%3Ctable%3E%0A%7C%20%3Ctd%3E", 'tr'],"4ea02fd705291eb2d14274ebeaa0117ba2b9b306":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 4ea02fd705291eb2d14274ebeaa0117ba2b9b306'), "%3Ccaption%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"52cc77eac9488a8bb1a2c8c695f16f8919c52044":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 52cc77eac9488a8bb1a2c8c695f16f8919c52044'), "%3Ccol%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"c53ab7d84ae27de9f0937521c74eec2fd6c1b1ec":[async_test('html5lib_innerHTML_tests_innerHTML_1.html c53ab7d84ae27de9f0937521c74eec2fd6c1b1ec'), "%3Ccolgroup%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"d8747a49503f3486155d77dd366e0ee8ad9512a6":[async_test('html5lib_innerHTML_tests_innerHTML_1.html d8747a49503f3486155d77dd366e0ee8ad9512a6'), "%3Ctbody%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"03e71832c254852f206f6f0ae6f4d161a276a699":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 03e71832c254852f206f6f0ae6f4d161a276a699'), "%3Ctfoot%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"92786cfafa890c23f200dccea089ca52233ef395":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 92786cfafa890c23f200dccea089ca52233ef395'), "%3Cth%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"11d284c2b1e2f87d28dd06b938518361fe834855":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 11d284c2b1e2f87d28dd06b938518361fe834855'), "%3Cthead%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"bf6aebcd54d5dead9e6d56c77b41f01ea666d8b1":[async_test('html5lib_innerHTML_tests_innerHTML_1.html bf6aebcd54d5dead9e6d56c77b41f01ea666d8b1'), "%3Ctr%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"4d448a4239cb4c465a21c04997d656e51fdd388f":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 4d448a4239cb4c465a21c04997d656e51fdd388f'), "%3C/table%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"1e8faedc427045d59305218c1aba2f545c4eb4b7":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 1e8faedc427045d59305218c1aba2f545c4eb4b7'), "%3C/tbody%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"6762997c1a93b1ec65722498f3fd00f0d8129369":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 6762997c1a93b1ec65722498f3fd00f0d8129369'), "%3C/td%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"a162461c18d9b09734f6fe5d362b84edb4eed31f":[async_test('html5lib_innerHTML_tests_innerHTML_1.html a162461c18d9b09734f6fe5d362b84edb4eed31f'), "%3C/tfoot%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"0befc335ffd6cace344d94a35de96af22b1313a5":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 0befc335ffd6cace344d94a35de96af22b1313a5'), "%3C/thead%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"a23b70f1f246ba08d13b570319391b4a5c3e9456":[async_test('html5lib_innerHTML_tests_innerHTML_1.html a23b70f1f246ba08d13b570319391b4a5c3e9456'), "%3C/th%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"9d5e0c25bfe921df9ea2897c027f42bc88950e69":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 9d5e0c25bfe921df9ea2897c027f42bc88950e69'), "%3C/tr%3E%3Ca%3E", "%23document%0A%7C%20%3Ca%3E", 'td'],"9210d577d6deecf5ab3505af86c501c5befa0b50":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 9210d577d6deecf5ab3505af86c501c5befa0b50'), "%3Ctable%3E%3Ctd%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctable%3E%0A%7C%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%3Ctd%3E", 'td'],"c34af491c0a339db6ba63fcc478108533347319b":[async_test('html5lib_innerHTML_tests_innerHTML_1.html c34af491c0a339db6ba63fcc478108533347319b'), "%3C/select%3E%3Coption%3E", "%23document%0A%7C%20%3Coption%3E", 'select'],"2c4284e6b2bb480daa50bca43bcbe29cfcdeeab4":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 2c4284e6b2bb480daa50bca43bcbe29cfcdeeab4'), "%3Cinput%3E%3Coption%3E", "%23document%0A%7C%20%3Coption%3E", 'select'],"d75277b65d0118463afeb66b478509d4e27565ab":[async_test('html5lib_innerHTML_tests_innerHTML_1.html d75277b65d0118463afeb66b478509d4e27565ab'), "%3Ckeygen%3E%3Coption%3E", "%23document%0A%7C%20%3Coption%3E", 'select'],"b354df69dbe9b3ef0c42177648e3aace114cf8ea":[async_test('html5lib_innerHTML_tests_innerHTML_1.html b354df69dbe9b3ef0c42177648e3aace114cf8ea'), "%3Ctextarea%3E%3Coption%3E", "%23document%0A%7C%20%3Coption%3E", 'select'],"fd3be386292ea1f411cea8e86e29595deb177d28":[async_test('html5lib_innerHTML_tests_innerHTML_1.html fd3be386292ea1f411cea8e86e29595deb177d28'), "%3C/html%3E%3C%21--abc--%3E", "%23document%0A%7C%20%3Chead%3E%0A%7C%20%3Cbody%3E%0A%7C%20%3C%21--%20abc%20--%3E", 'html'],"1cfb3baf2ad29109ddd5581daa3a009029c71491":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 1cfb3baf2ad29109ddd5581daa3a009029c71491'), "%3C/frameset%3E%3Cframe%3E", "%23document%0A%7C%20%3Cframe%3E", 'frameset'],"2555d238e04f3d2853cfbc5f6dd366f82cf0e868":[async_test('html5lib_innerHTML_tests_innerHTML_1.html 2555d238e04f3d2853cfbc5f6dd366f82cf0e868'), "", "%23document%0A%7C%20%3Chead%3E%0A%7C%20%3Cbody%3E", 'html'],
+ }
+ init_tests("innerHTML");
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_isindex.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_isindex.html
new file mode 100644
index 000000000..e73fb5a94
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_isindex.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_isindex.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['579ca96e69c47b3d2ac83f1aa79a450b745d21f3','cb91f67071d81dd18d7ba9990de8f0f845c375f0','bd8ac64cc8f1422fac94bbe1c8828c0b51dca3f2',];
+ var tests = {
+ "579ca96e69c47b3d2ac83f1aa79a450b745d21f3":[async_test('html5lib_isindex.html 579ca96e69c47b3d2ac83f1aa79a450b745d21f3'), "%3Cisindex%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20%3Chr%3E%0A%7C%20%20%20%20%20%20%20%3Clabel%3E%0A%7C%20%20%20%20%20%20%20%20%20%22This%20is%20a%20searchable%20index.%20Enter%20search%20keywords%3A%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20name%3D%22isindex%22%0A%7C%20%20%20%20%20%20%20%3Chr%3E"],"cb91f67071d81dd18d7ba9990de8f0f845c375f0":[async_test('html5lib_isindex.html cb91f67071d81dd18d7ba9990de8f0f845c375f0'), "%3Cisindex%20name%3D%22A%22%20action%3D%22B%22%20prompt%3D%22C%22%20foo%3D%22D%22%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20action%3D%22B%22%0A%7C%20%20%20%20%20%20%20%3Chr%3E%0A%7C%20%20%20%20%20%20%20%3Clabel%3E%0A%7C%20%20%20%20%20%20%20%20%20%22C%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20foo%3D%22D%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20name%3D%22isindex%22%0A%7C%20%20%20%20%20%20%20%3Chr%3E"],"bd8ac64cc8f1422fac94bbe1c8828c0b51dca3f2":[async_test('html5lib_isindex.html bd8ac64cc8f1422fac94bbe1c8828c0b51dca3f2'), "%3Cform%3E%3Cisindex%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_main-element.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_main-element.html
new file mode 100644
index 000000000..8f0183150
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_main-element.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_main-element.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['336a047fbc84b86dfd4baea5881b50fe0cdb5ce8','fc887f078ddc2723261a7dfb25829efe2da284f2','ebd10973e73d3a339bdf22f8bbac2f028044e096',];
+ var tests = {
+ "336a047fbc84b86dfd4baea5881b50fe0cdb5ce8":[async_test('html5lib_main-element.html 336a047fbc84b86dfd4baea5881b50fe0cdb5ce8'), "%3C%21doctype%20html%3E%3Cp%3Efoo%3Cmain%3Ebar%3Cp%3Ebaz", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%3Cmain%3E%0A%7C%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%22baz%22"],"fc887f078ddc2723261a7dfb25829efe2da284f2":[async_test('html5lib_main-element.html fc887f078ddc2723261a7dfb25829efe2da284f2'), "%3C%21doctype%20html%3E%3Cmain%3E%3Cp%3Efoo%3C/main%3Ebar", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmain%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%22bar%22"],"ebd10973e73d3a339bdf22f8bbac2f028044e096":[async_test('html5lib_main-element.html ebd10973e73d3a339bdf22f8bbac2f028044e096'), "%3C%21DOCTYPE%20html%3Exxx%3Csvg%3E%3Cx%3E%3Cg%3E%3Ca%3E%3Cmain%3E%3Cb%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22xxx%22%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20x%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20a%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20main%3E%0A%7C%20%20%20%20%20%3Cb%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_pending-spec-changes-plain-text-unsafe.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_pending-spec-changes-plain-text-unsafe.html
new file mode 100644
index 000000000..394375842
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_pending-spec-changes-plain-text-unsafe.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_pending-spec-changes-plain-text-unsafe.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['8afa8d082dc447be5cab2eeb3e13efb07ec72aa6',];
+ var tests = {
+ "8afa8d082dc447be5cab2eeb3e13efb07ec72aa6":[async_test('html5lib_pending-spec-changes-plain-text-unsafe.html 8afa8d082dc447be5cab2eeb3e13efb07ec72aa6'), "%3Cbody%3E%3Ctable%3E%00filler%00text%00", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22fillertext%22%0A%7C%20%20%20%20%20%3Ctable%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_pending-spec-changes.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_pending-spec-changes.html
new file mode 100644
index 000000000..f7aa17e72
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_pending-spec-changes.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_pending-spec-changes.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['965e062f9d01c4334cb12637e84dcbf438d38faf','8772d25919914a17118b2105e126aaa5bc83f92c','9804e9659cd045f199d9f58ef85c2639724359aa',];
+ var tests = {
+ "965e062f9d01c4334cb12637e84dcbf438d38faf":[async_test('html5lib_pending-spec-changes.html 965e062f9d01c4334cb12637e84dcbf438d38faf'), "%3Cinput%20type%3D%22hidden%22%3E%3Cframeset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"8772d25919914a17118b2105e126aaa5bc83f92c":[async_test('html5lib_pending-spec-changes.html 8772d25919914a17118b2105e126aaa5bc83f92c'), "%3C%21DOCTYPE%20html%3E%3Ctable%3E%3Ccaption%3E%3Csvg%3Efoo%3C/table%3Ebar", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%22bar%22"],"9804e9659cd045f199d9f58ef85c2639724359aa":[async_test('html5lib_pending-spec-changes.html 9804e9659cd045f199d9f58ef85c2639724359aa'), "%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Csvg%3E%3Cdesc%3E%3Ctd%3E%3C/desc%3E%3Ccircle%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20desc%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ccircle%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_plain-text-unsafe.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_plain-text-unsafe.html
new file mode 100644
index 000000000..d99328907
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_plain-text-unsafe.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_plain-text-unsafe.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['7e4ca4cb5e73852744a876bf8652dd2c8998d94a','e552342bdd3ac62316bd91126556512683f3d4a9','9112cef60139e6988b66334e522777329051442a','5dfa36c8a466dd245e7977924936f4940df65e53','e057c57a5f32e5e341d70b0a6581bdad39b84ac5','dee24cacc42c7d0cdacab20abbcf128d8ac423bb','24ed904940ecdad39c61706e709ffed5ee804514','0829c314a34a62cd1caf52ddc4100050bf32aef3','024ba847361612e5e87bce271d0497eeee07f87f','ec721aae75752c688fa48ad4b251d3a5a394dc8f','1e262b6f330b0870e854458f11b2280c72c8bd16','29f42d8bf04aea6ab4c051bd77da7e79173cf159','1d65ea8967bdc24e89d6548320b7fb9e2ad2c915','f1c51609a504e4ab4f7ae4d61fb6175619974b0d','692122e8d2a27e37cb585c827fb33e22e31c018e','a4537cad9c2386108157889b3bf6ddd414f0366d','252ca95f75b077320bc167cb117a05edfcbd7d0e','dde4bba02ef4e37d010e552111bc668d9660a076','41b9352a4d99b4fd545551fe260754b3137ad148','4b9e317cba617324fea77a4e525602b3ad2717ef','a1e08cb99d89381a1c997fcd60bad23c029c4500','26d850208425cc885d4d0143909cf341f61fa1f1','68f0365c01dc386c706edd2b18672f9d85caaa2e','e415a2e7cf090e2c308af905d52c5f8163ae52ce','822702de65b80ec8e79da19335ab9d6a49f6ec6a','ee8b017ab043ff51b593787961626acb4c6488cd','304960c795639128844445166238350682ba0516','275bb0b518ec00b1e64a28cb9088989371fca9d9','068ac565b7c7bdad572f26dafb4580483cdbc6f7','f5ff59e9765a468913e14a6a9612edb2cd4f30f0','9ff76ac49f95ab0e22278fd07ed4dfee50519286','6a9486cce6ebcb83329c17ebcf3c9b6fe8bb8096','6f2f3f4f91f5484170a6dc8cc6165ce0ce498bff',];
+ var tests = {
+ "7e4ca4cb5e73852744a876bf8652dd2c8998d94a":[async_test('html5lib_plain-text-unsafe.html 7e4ca4cb5e73852744a876bf8652dd2c8998d94a'), "FOO%26%23x000D%3BZOO", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%0DZOO%22"],"e552342bdd3ac62316bd91126556512683f3d4a9":[async_test('html5lib_plain-text-unsafe.html e552342bdd3ac62316bd91126556512683f3d4a9'), "%3Chtml%3E%00%3Cframeset%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"9112cef60139e6988b66334e522777329051442a":[async_test('html5lib_plain-text-unsafe.html 9112cef60139e6988b66334e522777329051442a'), "%3Chtml%3E%20%00%20%3Cframeset%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"5dfa36c8a466dd245e7977924936f4940df65e53":[async_test('html5lib_plain-text-unsafe.html 5dfa36c8a466dd245e7977924936f4940df65e53'), "%3Chtml%3Ea%00a%3Cframeset%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22aa%22"],"e057c57a5f32e5e341d70b0a6581bdad39b84ac5":[async_test('html5lib_plain-text-unsafe.html e057c57a5f32e5e341d70b0a6581bdad39b84ac5'), "%3Chtml%3E%00%00%3Cframeset%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"dee24cacc42c7d0cdacab20abbcf128d8ac423bb":[async_test('html5lib_plain-text-unsafe.html dee24cacc42c7d0cdacab20abbcf128d8ac423bb'), "%3Chtml%3E%00%0A%20%3Cframeset%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"24ed904940ecdad39c61706e709ffed5ee804514":[async_test('html5lib_plain-text-unsafe.html 24ed904940ecdad39c61706e709ffed5ee804514'), "%3Chtml%3E%3Cselect%3E%00", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"0829c314a34a62cd1caf52ddc4100050bf32aef3":[async_test('html5lib_plain-text-unsafe.html 0829c314a34a62cd1caf52ddc4100050bf32aef3'), "%00", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"024ba847361612e5e87bce271d0497eeee07f87f":[async_test('html5lib_plain-text-unsafe.html 024ba847361612e5e87bce271d0497eeee07f87f'), "%3Cbody%3E%00", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"ec721aae75752c688fa48ad4b251d3a5a394dc8f":[async_test('html5lib_plain-text-unsafe.html ec721aae75752c688fa48ad4b251d3a5a394dc8f'), "%3Cplaintext%3E%00filler%00text%00", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cplaintext%3E%0A%7C%20%20%20%20%20%20%20%22%EF%BF%BDfiller%EF%BF%BDtext%EF%BF%BD%22"],"1e262b6f330b0870e854458f11b2280c72c8bd16":[async_test('html5lib_plain-text-unsafe.html 1e262b6f330b0870e854458f11b2280c72c8bd16'), "%3Csvg%3E%3C%21%5BCDATA%5B%00filler%00text%00%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%EF%BF%BDfiller%EF%BF%BDtext%EF%BF%BD%22"],"29f42d8bf04aea6ab4c051bd77da7e79173cf159":[async_test('html5lib_plain-text-unsafe.html 29f42d8bf04aea6ab4c051bd77da7e79173cf159'), "%3Cbody%3E%3C%21%00%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3C%21--%20%EF%BF%BD%20--%3E"],"1d65ea8967bdc24e89d6548320b7fb9e2ad2c915":[async_test('html5lib_plain-text-unsafe.html 1d65ea8967bdc24e89d6548320b7fb9e2ad2c915'), "%3Cbody%3E%3C%21%00filler%00text%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3C%21--%20%EF%BF%BDfiller%EF%BF%BDtext%20--%3E"],"f1c51609a504e4ab4f7ae4d61fb6175619974b0d":[async_test('html5lib_plain-text-unsafe.html f1c51609a504e4ab4f7ae4d61fb6175619974b0d'), "%3Cbody%3E%3Csvg%3E%3CforeignObject%3E%00filler%00text", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%22fillertext%22"],"692122e8d2a27e37cb585c827fb33e22e31c018e":[async_test('html5lib_plain-text-unsafe.html 692122e8d2a27e37cb585c827fb33e22e31c018e'), "%3Csvg%3E%00filler%00text", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%EF%BF%BDfiller%EF%BF%BDtext%22"],"a4537cad9c2386108157889b3bf6ddd414f0366d":[async_test('html5lib_plain-text-unsafe.html a4537cad9c2386108157889b3bf6ddd414f0366d'), "%3Csvg%3E%00%3Cframeset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%EF%BF%BD%22%0A%7C%20%20%20%20%20%20%20%3Csvg%20frameset%3E"],"252ca95f75b077320bc167cb117a05edfcbd7d0e":[async_test('html5lib_plain-text-unsafe.html 252ca95f75b077320bc167cb117a05edfcbd7d0e'), "%3Csvg%3E%00%20%3Cframeset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%EF%BF%BD%20%22%0A%7C%20%20%20%20%20%20%20%3Csvg%20frameset%3E"],"dde4bba02ef4e37d010e552111bc668d9660a076":[async_test('html5lib_plain-text-unsafe.html dde4bba02ef4e37d010e552111bc668d9660a076'), "%3Csvg%3E%00a%3Cframeset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%EF%BF%BDa%22%0A%7C%20%20%20%20%20%20%20%3Csvg%20frameset%3E"],"41b9352a4d99b4fd545551fe260754b3137ad148":[async_test('html5lib_plain-text-unsafe.html 41b9352a4d99b4fd545551fe260754b3137ad148'), "%3Csvg%3E%00%3C/svg%3E%3Cframeset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"4b9e317cba617324fea77a4e525602b3ad2717ef":[async_test('html5lib_plain-text-unsafe.html 4b9e317cba617324fea77a4e525602b3ad2717ef'), "%3Csvg%3E%00%20%3C/svg%3E%3Cframeset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"a1e08cb99d89381a1c997fcd60bad23c029c4500":[async_test('html5lib_plain-text-unsafe.html a1e08cb99d89381a1c997fcd60bad23c029c4500'), "%3Csvg%3E%00a%3C/svg%3E%3Cframeset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%EF%BF%BDa%22"],"26d850208425cc885d4d0143909cf341f61fa1f1":[async_test('html5lib_plain-text-unsafe.html 26d850208425cc885d4d0143909cf341f61fa1f1'), "%3Csvg%3E%3Cpath%3E%3C/path%3E%3C/svg%3E%3Cframeset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"68f0365c01dc386c706edd2b18672f9d85caaa2e":[async_test('html5lib_plain-text-unsafe.html 68f0365c01dc386c706edd2b18672f9d85caaa2e'), "%3Csvg%3E%3Cp%3E%3Cframeset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"e415a2e7cf090e2c308af905d52c5f8163ae52ce":[async_test('html5lib_plain-text-unsafe.html e415a2e7cf090e2c308af905d52c5f8163ae52ce'), "%3C%21DOCTYPE%20html%3E%3Cpre%3E%0D%0A%0D%0AA%3C/pre%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cpre%3E%0A%7C%20%20%20%20%20%20%20%22%0AA%22"],"822702de65b80ec8e79da19335ab9d6a49f6ec6a":[async_test('html5lib_plain-text-unsafe.html 822702de65b80ec8e79da19335ab9d6a49f6ec6a'), "%3C%21DOCTYPE%20html%3E%3Cpre%3E%0D%0DA%3C/pre%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cpre%3E%0A%7C%20%20%20%20%20%20%20%22%0AA%22"],"ee8b017ab043ff51b593787961626acb4c6488cd":[async_test('html5lib_plain-text-unsafe.html ee8b017ab043ff51b593787961626acb4c6488cd'), "%3C%21DOCTYPE%20html%3E%3Cpre%3E%0DA%3C/pre%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cpre%3E%0A%7C%20%20%20%20%20%20%20%22A%22"],"304960c795639128844445166238350682ba0516":[async_test('html5lib_plain-text-unsafe.html 304960c795639128844445166238350682ba0516'), "%3C%21DOCTYPE%20html%3E%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Cmath%3E%3Cmtext%3E%00a", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mtext%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"275bb0b518ec00b1e64a28cb9088989371fca9d9":[async_test('html5lib_plain-text-unsafe.html 275bb0b518ec00b1e64a28cb9088989371fca9d9'), "%3C%21DOCTYPE%20html%3E%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Csvg%3E%3CforeignObject%3E%00a", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"068ac565b7c7bdad572f26dafb4580483cdbc6f7":[async_test('html5lib_plain-text-unsafe.html 068ac565b7c7bdad572f26dafb4580483cdbc6f7'), "%3C%21DOCTYPE%20html%3E%3Cmath%3E%3Cmi%3Ea%00b", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22ab%22"],"f5ff59e9765a468913e14a6a9612edb2cd4f30f0":[async_test('html5lib_plain-text-unsafe.html f5ff59e9765a468913e14a6a9612edb2cd4f30f0'), "%3C%21DOCTYPE%20html%3E%3Cmath%3E%3Cmo%3Ea%00b", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mo%3E%0A%7C%20%20%20%20%20%20%20%20%20%22ab%22"],"9ff76ac49f95ab0e22278fd07ed4dfee50519286":[async_test('html5lib_plain-text-unsafe.html 9ff76ac49f95ab0e22278fd07ed4dfee50519286'), "%3C%21DOCTYPE%20html%3E%3Cmath%3E%3Cmn%3Ea%00b", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mn%3E%0A%7C%20%20%20%20%20%20%20%20%20%22ab%22"],"6a9486cce6ebcb83329c17ebcf3c9b6fe8bb8096":[async_test('html5lib_plain-text-unsafe.html 6a9486cce6ebcb83329c17ebcf3c9b6fe8bb8096'), "%3C%21DOCTYPE%20html%3E%3Cmath%3E%3Cms%3Ea%00b", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20ms%3E%0A%7C%20%20%20%20%20%20%20%20%20%22ab%22"],"6f2f3f4f91f5484170a6dc8cc6165ce0ce498bff":[async_test('html5lib_plain-text-unsafe.html 6f2f3f4f91f5484170a6dc8cc6165ce0ce498bff'), "%3C%21DOCTYPE%20html%3E%3Cmath%3E%3Cmtext%3Ea%00b", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mtext%3E%0A%7C%20%20%20%20%20%20%20%20%20%22ab%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_scriptdata01.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_scriptdata01.html
new file mode 100644
index 000000000..123391714
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_scriptdata01.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_scriptdata01.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['3fc7e140adb65f9cfdf39219996f98e0749f398d','38ab7bda69dfd05e3ff01788cf5dac2d150a712a','09abe1da30643fd813db75facc7fde7b75762d43','193920d1c0fff50991d61655c529c62075a3da7f','66754fc904199af367a0a2b26cc89ea1834939cc','8c8a34698899e39e7b0879c07821aeb90f46cd83','a454052b572d9952465190ec354ad0ec2defca0b','6cc06752976c2cc9a4239f608b47cdb8df2b0b6b','4176aaaa17b9009e1ac8a293acbaa0d0cfd56975','e05f6594ea01489b55fca25aa79e5cffa43d9587','c7728688e5d12d5350c4228ac82c03a9886bef2f','c2a2bd66cbf430ee517678470fb560fa8862fa86','e04bd4c273176c0638e98dce1cbdcfc6438ec7eb','96a8546fd066084179852aa72bb599c1ee6f513f','1dae0f9ba7e933c1f6f9912d2289c290b2c8495a','44437869d870fea50416386a003d0b477a7d4f9d','3c72e7aa1fe7b65598a88a8cba1d7691824ec8a2','026ad2b8a6c85ab7a8804b1553b16560bc36fefd','d6b18cb44b4eda72b75fb64fe4287ee984562aaf','6ebea78eedeb25cbefd06e1ff55423db91f98c6d','fb5424c9ab36d5f8383268df1d64b17bab310e4d','3123b21e759d33987c407189584a5533c31a7482','f208b834bd4a2e13d79cebd59c02659f2f75ff04','0b72c0fef80895598cdf691a4913ff7aa5b1934b','bc7d3b5d37eaf53e338d81215f552e55cb555fc2','df2e36330e2e9609b1b9e1ff8a9440a66281dd46',];
+ var tests = {
+ "3fc7e140adb65f9cfdf39219996f98e0749f398d":[async_test('html5lib_scriptdata01.html 3fc7e140adb65f9cfdf39219996f98e0749f398d'), "FOO%3Cscript%3E%27Hello%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%27Hello%27%22%0A%7C%20%20%20%20%20%22BAR%22"],"38ab7bda69dfd05e3ff01788cf5dac2d150a712a":[async_test('html5lib_scriptdata01.html 38ab7bda69dfd05e3ff01788cf5dac2d150a712a'), "FOO%3Cscript%3E%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%22BAR%22"],"09abe1da30643fd813db75facc7fde7b75762d43":[async_test('html5lib_scriptdata01.html 09abe1da30643fd813db75facc7fde7b75762d43'), "FOO%3Cscript%3E%3C/script%20%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%22BAR%22"],"193920d1c0fff50991d61655c529c62075a3da7f":[async_test('html5lib_scriptdata01.html 193920d1c0fff50991d61655c529c62075a3da7f'), "FOO%3Cscript%3E%3C/script/%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%22BAR%22"],"66754fc904199af367a0a2b26cc89ea1834939cc":[async_test('html5lib_scriptdata01.html 66754fc904199af367a0a2b26cc89ea1834939cc'), "FOO%3Cscript%3E%3C/script/%20%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%22BAR%22"],"8c8a34698899e39e7b0879c07821aeb90f46cd83":[async_test('html5lib_scriptdata01.html 8c8a34698899e39e7b0879c07821aeb90f46cd83'), "FOO%3Cscript%20type%3D%22text/plain%22%3E%3C/scriptx%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22text/plain%22%0A%7C%20%20%20%20%20%20%20%22%3C/scriptx%3EBAR%22"],"a454052b572d9952465190ec354ad0ec2defca0b":[async_test('html5lib_scriptdata01.html a454052b572d9952465190ec354ad0ec2defca0b'), "FOO%3Cscript%3E%3C/script%20foo%3D%22%3E%22%20dd%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%22BAR%22"],"6cc06752976c2cc9a4239f608b47cdb8df2b0b6b":[async_test('html5lib_scriptdata01.html 6cc06752976c2cc9a4239f608b47cdb8df2b0b6b'), "FOO%3Cscript%3E%27%3C%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%27%3C%27%22%0A%7C%20%20%20%20%20%22BAR%22"],"4176aaaa17b9009e1ac8a293acbaa0d0cfd56975":[async_test('html5lib_scriptdata01.html 4176aaaa17b9009e1ac8a293acbaa0d0cfd56975'), "FOO%3Cscript%3E%27%3C%21%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%27%3C%21%27%22%0A%7C%20%20%20%20%20%22BAR%22"],"e05f6594ea01489b55fca25aa79e5cffa43d9587":[async_test('html5lib_scriptdata01.html e05f6594ea01489b55fca25aa79e5cffa43d9587'), "FOO%3Cscript%3E%27%3C%21-%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%27%3C%21-%27%22%0A%7C%20%20%20%20%20%22BAR%22"],"c7728688e5d12d5350c4228ac82c03a9886bef2f":[async_test('html5lib_scriptdata01.html c7728688e5d12d5350c4228ac82c03a9886bef2f'), "FOO%3Cscript%3E%27%3C%21--%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%27%22%0A%7C%20%20%20%20%20%22BAR%22"],"c2a2bd66cbf430ee517678470fb560fa8862fa86":[async_test('html5lib_scriptdata01.html c2a2bd66cbf430ee517678470fb560fa8862fa86'), "FOO%3Cscript%3E%27%3C%21---%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%27%3C%21---%27%22%0A%7C%20%20%20%20%20%22BAR%22"],"e04bd4c273176c0638e98dce1cbdcfc6438ec7eb":[async_test('html5lib_scriptdata01.html e04bd4c273176c0638e98dce1cbdcfc6438ec7eb'), "FOO%3Cscript%3E%27%3C%21--%3E%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%3E%27%22%0A%7C%20%20%20%20%20%22BAR%22"],"96a8546fd066084179852aa72bb599c1ee6f513f":[async_test('html5lib_scriptdata01.html 96a8546fd066084179852aa72bb599c1ee6f513f'), "FOO%3Cscript%3E%27%3C%21--%20potato%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%20potato%27%22%0A%7C%20%20%20%20%20%22BAR%22"],"1dae0f9ba7e933c1f6f9912d2289c290b2c8495a":[async_test('html5lib_scriptdata01.html 1dae0f9ba7e933c1f6f9912d2289c290b2c8495a'), "FOO%3Cscript%3E%27%3C%21--%20%3CsCrIpt%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%20%3CsCrIpt%27%22%0A%7C%20%20%20%20%20%22BAR%22"],"44437869d870fea50416386a003d0b477a7d4f9d":[async_test('html5lib_scriptdata01.html 44437869d870fea50416386a003d0b477a7d4f9d'), "FOO%3Cscript%20type%3D%22text/plain%22%3E%27%3C%21--%20%3CsCrIpt%3E%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22text/plain%22%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%20%3CsCrIpt%3E%27%3C/script%3EBAR%22"],"3c72e7aa1fe7b65598a88a8cba1d7691824ec8a2":[async_test('html5lib_scriptdata01.html 3c72e7aa1fe7b65598a88a8cba1d7691824ec8a2'), "FOO%3Cscript%20type%3D%22text/plain%22%3E%27%3C%21--%20%3CsCrIpt%3E%20-%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22text/plain%22%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%20%3CsCrIpt%3E%20-%27%3C/script%3EBAR%22"],"026ad2b8a6c85ab7a8804b1553b16560bc36fefd":[async_test('html5lib_scriptdata01.html 026ad2b8a6c85ab7a8804b1553b16560bc36fefd'), "FOO%3Cscript%20type%3D%22text/plain%22%3E%27%3C%21--%20%3CsCrIpt%3E%20--%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22text/plain%22%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%20%3CsCrIpt%3E%20--%27%3C/script%3EBAR%22"],"d6b18cb44b4eda72b75fb64fe4287ee984562aaf":[async_test('html5lib_scriptdata01.html d6b18cb44b4eda72b75fb64fe4287ee984562aaf'), "FOO%3Cscript%3E%27%3C%21--%20%3CsCrIpt%3E%20--%3E%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%20%3CsCrIpt%3E%20--%3E%27%22%0A%7C%20%20%20%20%20%22BAR%22"],"6ebea78eedeb25cbefd06e1ff55423db91f98c6d":[async_test('html5lib_scriptdata01.html 6ebea78eedeb25cbefd06e1ff55423db91f98c6d'), "FOO%3Cscript%20type%3D%22text/plain%22%3E%27%3C%21--%20%3CsCrIpt%3E%20--%21%3E%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22text/plain%22%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%20%3CsCrIpt%3E%20--%21%3E%27%3C/script%3EBAR%22"],"fb5424c9ab36d5f8383268df1d64b17bab310e4d":[async_test('html5lib_scriptdata01.html fb5424c9ab36d5f8383268df1d64b17bab310e4d'), "FOO%3Cscript%20type%3D%22text/plain%22%3E%27%3C%21--%20%3CsCrIpt%3E%20--%20%3E%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22text/plain%22%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%20%3CsCrIpt%3E%20--%20%3E%27%3C/script%3EBAR%22"],"3123b21e759d33987c407189584a5533c31a7482":[async_test('html5lib_scriptdata01.html 3123b21e759d33987c407189584a5533c31a7482'), "FOO%3Cscript%20type%3D%22text/plain%22%3E%27%3C%21--%20%3CsCrIpt%20%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22text/plain%22%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%20%3CsCrIpt%20%27%3C/script%3EBAR%22"],"f208b834bd4a2e13d79cebd59c02659f2f75ff04":[async_test('html5lib_scriptdata01.html f208b834bd4a2e13d79cebd59c02659f2f75ff04'), "FOO%3Cscript%20type%3D%22text/plain%22%3E%27%3C%21--%20%3CsCrIpt/%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22text/plain%22%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%20%3CsCrIpt/%27%3C/script%3EBAR%22"],"0b72c0fef80895598cdf691a4913ff7aa5b1934b":[async_test('html5lib_scriptdata01.html 0b72c0fef80895598cdf691a4913ff7aa5b1934b'), "FOO%3Cscript%20type%3D%22text/plain%22%3E%27%3C%21--%20%3CsCrIpt%5C%27%3C/script%3EBAR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22text/plain%22%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%20%3CsCrIpt%5C%27%22%0A%7C%20%20%20%20%20%22BAR%22"],"bc7d3b5d37eaf53e338d81215f552e55cb555fc2":[async_test('html5lib_scriptdata01.html bc7d3b5d37eaf53e338d81215f552e55cb555fc2'), "FOO%3Cscript%20type%3D%22text/plain%22%3E%27%3C%21--%20%3CsCrIpt/%27%3C/script%3EBAR%3C/script%3EQUX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22text/plain%22%0A%7C%20%20%20%20%20%20%20%22%27%3C%21--%20%3CsCrIpt/%27%3C/script%3EBAR%22%0A%7C%20%20%20%20%20%22QUX%22"],"df2e36330e2e9609b1b9e1ff8a9440a66281dd46":[async_test('html5lib_scriptdata01.html df2e36330e2e9609b1b9e1ff8a9440a66281dd46'), "FOO%3Cscript%3E%3C%21--%3Cscript%3E-%3E%3C/script%3E--%3E%3C/script%3EQUX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E-%3E%3C/script%3E--%3E%22%0A%7C%20%20%20%20%20%22QUX%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_adoption01.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_adoption01.html
new file mode 100644
index 000000000..479208aa9
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_adoption01.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_scripted_adoption01.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['8970fe21b551a270aa74648bb2e8b905edb54522',];
+ var tests = {
+ "8970fe21b551a270aa74648bb2e8b905edb54522":[async_test('html5lib_scripted_adoption01.html 8970fe21b551a270aa74648bb2e8b905edb54522'), "%3Cp%3E%3Cb%20id%3D%22A%22%3E%3Cscript%3Edocument.getElementById%28%22A%22%29.id%20%3D%20%22B%22%3C/script%3E%3C/p%3ETEXT%3C/b%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20id%3D%22B%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22document.getElementById%28%22A%22%29.id%20%3D%20%22B%22%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20id%3D%22A%22%0A%7C%20%20%20%20%20%20%20%22TEXT%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_ark.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_ark.html
new file mode 100644
index 000000000..4542b7c7d
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_ark.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_scripted_ark.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['b9a7cd0310cab4fd4eb77aed9149b966918e7ca2',];
+ var tests = {
+ "b9a7cd0310cab4fd4eb77aed9149b966918e7ca2":[async_test('html5lib_scripted_ark.html b9a7cd0310cab4fd4eb77aed9149b966918e7ca2'), "%3Cp%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cscript%3Edocument.getElementsByTagName%28%22font%22%29%5B2%5D.setAttribute%28%22size%22%2C%20%225%22%29%3B%3C/script%3E%3Cfont%20size%3D4%3E%3Cp%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%225%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22document.getElementsByTagName%28%22font%22%29%5B2%5D.setAttribute%28%22size%22%2C%20%225%22%29%3B%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22X%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_webkit01.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_webkit01.html
new file mode 100644
index 000000000..ef4f16d9c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_webkit01.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_scripted_webkit01.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['3ff6ec1125852c7933bf6d89ecb375354e6e1b40','46ae362de712eb9c55916de93110299dbbcb5726',];
+ var tests = {
+ "3ff6ec1125852c7933bf6d89ecb375354e6e1b40":[async_test('html5lib_scripted_webkit01.html 3ff6ec1125852c7933bf6d89ecb375354e6e1b40'), "1%3Cscript%3Edocument.write%28%222%22%29%3C/script%3E3", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22document.write%28%222%22%29%22%0A%7C%20%20%20%20%20%2223%22"],"46ae362de712eb9c55916de93110299dbbcb5726":[async_test('html5lib_scripted_webkit01.html 46ae362de712eb9c55916de93110299dbbcb5726'), "1%3Cscript%3Edocument.write%28%22%3Cscript%3Edocument.write%28%272%27%29%3C/scr%22%2B%20%22ipt%3E%3Cscript%3Edocument.write%28%273%27%29%3C/scr%22%20%2B%20%22ipt%3E%22%29%3C/script%3E4", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22document.write%28%22%3Cscript%3Edocument.write%28%272%27%29%3C/scr%22%2B%20%22ipt%3E%3Cscript%3Edocument.write%28%273%27%29%3C/scr%22%20%2B%20%22ipt%3E%22%29%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22document.write%28%272%27%29%22%0A%7C%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22document.write%28%273%27%29%22%0A%7C%20%20%20%20%20%2234%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tables01.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tables01.html
new file mode 100644
index 000000000..a22bfe0b2
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tables01.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tables01.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['86a267778d1960b41f887b7bd2cd3ebf691d2e42','b6c1142484570bb90c36e454ee193cca17bb618a','7c507b825650f9721ea9656b1e844752a2424271','d10316cac9d03820ecfbc85ab373632e12d70c75','331a8c15a2f1dd3a9a1c31f5c65b99d356a65f30','6cdb83f12cb37a56f5ebad018ec3b07c2ad5b89f','9d01d4a7d7519e410e10493c8b108298b6733c31','b4615709ab72b6aa6cbf836582bd40fd93c0deb5','24132334bffa9eea4c8e29c940a8201f4253baf5','103784c31b8e3280b19e30f3b26f467585fbc304','0787e31440ae020f6f6e6207c364e9a2daec1c6f','1c40461886d4fdfca6ac5ef1d766b6fbf360ff9c','aea3c063f853938a36184825893e0820b700e241','6595dc192b10c479a543dbe25e67e6e0b6923ea8','9fcd09d757401684bcc28eaec005ed82718e836f','4be18eaaf0aa53f224b4ff8aeaf47d44ba854260','8e743c4f0ab5783b8973533640f669c92acb3797',];
+ var tests = {
+ "86a267778d1960b41f887b7bd2cd3ebf691d2e42":[async_test('html5lib_tables01.html 86a267778d1960b41f887b7bd2cd3ebf691d2e42'), "%3Ctable%3E%3Cth%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cth%3E"],"b6c1142484570bb90c36e454ee193cca17bb618a":[async_test('html5lib_tables01.html b6c1142484570bb90c36e454ee193cca17bb618a'), "%3Ctable%3E%3Ctd%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"7c507b825650f9721ea9656b1e844752a2424271":[async_test('html5lib_tables01.html 7c507b825650f9721ea9656b1e844752a2424271'), "%3Ctable%3E%3Ccol%20foo%3D%27bar%27%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20foo%3D%22bar%22"],"d10316cac9d03820ecfbc85ab373632e12d70c75":[async_test('html5lib_tables01.html d10316cac9d03820ecfbc85ab373632e12d70c75'), "%3Ctable%3E%3Ccolgroup%3E%3C/html%3Efoo", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E"],"331a8c15a2f1dd3a9a1c31f5c65b99d356a65f30":[async_test('html5lib_tables01.html 331a8c15a2f1dd3a9a1c31f5c65b99d356a65f30'), "%3Ctable%3E%3C/table%3E%3Cp%3Efoo", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22foo%22"],"6cdb83f12cb37a56f5ebad018ec3b07c2ad5b89f":[async_test('html5lib_tables01.html 6cdb83f12cb37a56f5ebad018ec3b07c2ad5b89f'), "%3Ctable%3E%3C/body%3E%3C/caption%3E%3C/col%3E%3C/colgroup%3E%3C/html%3E%3C/tbody%3E%3C/td%3E%3C/tfoot%3E%3C/th%3E%3C/thead%3E%3C/tr%3E%3Ctd%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"9d01d4a7d7519e410e10493c8b108298b6733c31":[async_test('html5lib_tables01.html 9d01d4a7d7519e410e10493c8b108298b6733c31'), "%3Ctable%3E%3Cselect%3E%3Coption%3E3%3C/select%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%20%20%223%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"b4615709ab72b6aa6cbf836582bd40fd93c0deb5":[async_test('html5lib_tables01.html b4615709ab72b6aa6cbf836582bd40fd93c0deb5'), "%3Ctable%3E%3Cselect%3E%3Ctable%3E%3C/table%3E%3C/select%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%3Ctable%3E"],"24132334bffa9eea4c8e29c940a8201f4253baf5":[async_test('html5lib_tables01.html 24132334bffa9eea4c8e29c940a8201f4253baf5'), "%3Ctable%3E%3Cselect%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%3Ctable%3E"],"103784c31b8e3280b19e30f3b26f467585fbc304":[async_test('html5lib_tables01.html 103784c31b8e3280b19e30f3b26f467585fbc304'), "%3Ctable%3E%3Cselect%3E%3Coption%3EA%3Ctr%3E%3Ctd%3EB%3C/td%3E%3C/tr%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%20%20%22A%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22B%22"],"0787e31440ae020f6f6e6207c364e9a2daec1c6f":[async_test('html5lib_tables01.html 0787e31440ae020f6f6e6207c364e9a2daec1c6f'), "%3Ctable%3E%3Ctd%3E%3C/body%3E%3C/caption%3E%3C/col%3E%3C/colgroup%3E%3C/html%3Efoo", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22foo%22"],"1c40461886d4fdfca6ac5ef1d766b6fbf360ff9c":[async_test('html5lib_tables01.html 1c40461886d4fdfca6ac5ef1d766b6fbf360ff9c'), "%3Ctable%3E%3Ctd%3EA%3C/table%3EB", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22A%22%0A%7C%20%20%20%20%20%22B%22"],"aea3c063f853938a36184825893e0820b700e241":[async_test('html5lib_tables01.html aea3c063f853938a36184825893e0820b700e241'), "%3Ctable%3E%3Ctr%3E%3Ccaption%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E"],"6595dc192b10c479a543dbe25e67e6e0b6923ea8":[async_test('html5lib_tables01.html 6595dc192b10c479a543dbe25e67e6e0b6923ea8'), "%3Ctable%3E%3Ctr%3E%3C/body%3E%3C/caption%3E%3C/col%3E%3C/colgroup%3E%3C/html%3E%3C/td%3E%3C/th%3E%3Ctd%3Efoo", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22foo%22"],"9fcd09d757401684bcc28eaec005ed82718e836f":[async_test('html5lib_tables01.html 9fcd09d757401684bcc28eaec005ed82718e836f'), "%3Ctable%3E%3Ctd%3E%3Ctr%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"4be18eaaf0aa53f224b4ff8aeaf47d44ba854260":[async_test('html5lib_tables01.html 4be18eaaf0aa53f224b4ff8aeaf47d44ba854260'), "%3Ctable%3E%3Ctd%3E%3Cbutton%3E%3Ctd%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"8e743c4f0ab5783b8973533640f669c92acb3797":[async_test('html5lib_tables01.html 8e743c4f0ab5783b8973533640f669c92acb3797'), "%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Csvg%3E%3Cdesc%3E%3Ctd%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20desc%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_template.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_template.html
new file mode 100644
index 000000000..92500dd34
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_template.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_template.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['010950d55f4eccf16e9c4af1d263bb747294c646','a838bd54410cef059a42eea9606356488e16535b','27fb9111f6675a7e033b867480c0afddcda161a6','aee883a65775489399a003b2371d58248a6aff6f','89b17b54ab343191bf74ef5434f4d2cfac40ea97','c4433556c7414cfd71f27b420f1ffc4348774f5e','3dcce7d97108b3e9ea7fa96f240ac62bf280e74b','a1f587f7ea85ccfe294bd45bfb501e850cb979e0','cd26a7832f13bdc135697321ca6c2fecdca6ef5d','e30571d90b0e56864499961eb7be955994cf72e2','01cbe9f6a25f286b08d8dc4f7b65421e8eb3500c','96cbbcdffe02c86a8b929604c2fd5f3571a18dbe','d51676f55550e960dd0f5fa7fd0bdfa20bdde046','f9dfd9acfd494489c899604649a01d864741f50f','ea00361c265d3ffb47ce636d919c94ca10d58911','d8ebfcf7694c9d04457e796ac73049210313602e','b4d5e6fe9b92e2c8f54199d7cab3da383c42add0','07724ef8f7a4fa61c77ffcd5180d3101c4781502','e90f8aae8fc690540b42b3ffa3e741e7c1dfbf43','687bdf4adda88a316ec69fe20e84720acc5d1fe6','5b232642f472c2b4c0c7511fed464eebe686b427','dc1ac1830a881d1532a1e6fd6d0cfa56d6571da2','c58747a85e8b4f44d7ae63c04cdad783a903c25e','ca59bfdaec7451f704973176fab46e582bd691b2','cf807d6391a58c172b6c15c3b01d2a99ec0e6cf8','350b7ac850e46de79615308fc923649264406104','a31ff44edf7f377543dabdda8141cda9bb6de134','533c5c1b5f0d0cbb1ede2cc5ae927095c5b21f0b','61f79e083005007853c4f8e431559ac8d3845cfd','e802e85f36792b176b73c102c0e8761d9478621d','51d0797ff7653cd7be34458d689146e08a666c7f','d60e4079a18bd6266740cc61d1ca736e9d5098ce','308709292677b4d74c108a811ad7b7acd0bdfc9c','8965cdf9c4e9936262e25c90c7a7f8673840a445','7dccda789764beb489e09be10188af9347335d05','e15be51c77e1a6de35568a099ed339440ce9426d','503d3782e45940c19f096f360a092282b46ab1ea','b4ab56fd9e9cebf479d14adfa523c06d16483a5e','cd8bc9521f9683086a9e8529dd97314a6869daeb','f915e7b3407c24b28c3aad318e5693cc774020f4','3c5eb261787b3d15aff86fa61de773fd7e439b0e','2b57775750c198d4b98b23aed74ff80a866a01f5','dc3d016610f3ab532525a6c2871f03d6b62b0168','6a184d71d00580a26a8b6bd97aafe5503339f3f6','ce570a6c4bcee8b72a03e25508c6dd72e3cc6c35','e0c3d922f7b1f1654f02f716c3d9b31198ce3385','87e67242bf6debcf3b7dca852d10aa0f7b625b28','35ac4d4c972a01d368ed0cacb41370efef0a644d','5226c39dfc2d624ad4191b4eacb7e40c7ae528eb','aa90cd4db6b12e0a47341914a90cc536eec32d64','48af1faf5fcf48a0854af5a5c33656d9ccf6736b','ed3a029ba5e7f59969d65a4fc490a8f13b098cb9','6c8880d54475ad9574e203dcf2e55820b123cc64','275060925a844cb51b29bae660301de9780d68c8','9f82f6ec4c0a48c1d4dfbe6803b94abd553aea88','f094bf7e94a88b86c80a0643e70c8e5ff3354698','35a07ec3b4bf26ea407dc1ddf52f14195a714059','24faa53b271f994a4ff31d5796c8ff47d6f2c3e6','0f1c491b58c2dd3c402a62e37f833bc1f1db8d21','868d918a7b5d8b5c065c15229492bc2022bfbcba','0538efa44e857596c556033a3821d424378aea3f','e7d7bf3973c70d3cf9b0adad2ebed9f25be48d66','c69d0ac542d477b7312bb24981127b8aa8fdb1df','b496a8c13a7bd75b778bb0de489726aee952ae0c','5d6ee61de40274c9626ca78ee208d51276d5662d','9bd9687a65f258adc24450fc5cbd781fff6c038a','db1baeb846d718c773324746524fbd68f2e9436e','4b0ce46c611dbcc016db272ef007f302bee0c897','1a735e1c7f28f8701f3c7fd5e9404b8911916086','0686eedec06b2db1dc283fac92c1ef1a33114c71','d4dfb87ce626f12923056a6cd77448eaf4660ac2','1f295920f2937b2c8023b3761c43a0d4d9e5353c','3b91fa08fad923d387d924cff37fbf6b4c3a5712','45a1c1ad5d99ad67c573096a79253996a664e01b','0fe3a66773c6048c8f6f2c92f2611f65be972ec1','be40897ca411e1507197c31ab2a9f9752a05f769','dcfb1048ed5c40e406b4fbf0cde24c826713907f','78263aeea68ac97903598682013bae9c0c21d547','5aa177ef1a35bf4502dcb867d8e666288982ba99','5d303375907dc4d4380b477e0317c17b660613e9','d822f726927c34b92fe102b13e63920850878f6a','07acdcaeb4fa639296d46673cf28823ddf2a6ca7','58bd846ce1be0caf7560fba2ef19e2c2070ab123','8eeee377e5ab324731cc592f1fa8abe1045ad610','b30690019090149132fc228a7261c5cf2fd149fc','67a209d928804f90fdb66d070201b23f3d0c8a42','12104886b8f87daa937eac30b5ff0e1e074eaa6f','483cc9957a7225fe435112642be59abb4c459a1e','72d8ac431a154c40ab75d53a258d9d80d47689eb','1125967cbbcd404f4cb14d48270b8ec778970d77','32c963e164b9ec82c60e490bb141c1ccc70b992f','574a95fc9c9f2de3aeaa0c9ee1e6967fc3d4770d','332863a7f9e61bff32bd3427ede7a088b790d453','2121db07146781773df9e53b94fa921a805175ce','8675de267cd7e34f2febdee3feb665614d1562fe','c5d26ad923a2b1e988ddd378ca4fb26eb48353e1','eec1542e2fa0e9eafb7f8d4a51eae56b5a31b3c8','b79387a54c3b136db0f28ed96555ff683b3947fe','c477a29a4deb32d072a415fa809a84a4f2beee0c','26e4480c08e1f5f7b6ac8b8c1832ab0312e3b7c5','24b3b50fdd0bf8d5cf2ebaa6bf502d7bcfde1da4','d3704c68528357189eb5826ab66eea071d6137a5','d958f7d44faf772d1fb60f1a8f186f837ca735d9','3fc4d97fa68fc2658356bdbd4e051c867de8de53','94820107bbf3fab3f82de1f717e8413aead7d3a6','657c00ebdda37ae060cc69633ed98482ccc29e18',];
+ var tests = {
+ "010950d55f4eccf16e9c4af1d263bb747294c646":[async_test('html5lib_template.html 010950d55f4eccf16e9c4af1d263bb747294c646'), "%3Cbody%3E%3Ctemplate%3EHello%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%22Hello%22"],"a838bd54410cef059a42eea9606356488e16535b":[async_test('html5lib_template.html a838bd54410cef059a42eea9606356488e16535b'), "%3Ctemplate%3EHello%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%22Hello%22%0A%7C%20%20%20%3Cbody%3E"],"27fb9111f6675a7e033b867480c0afddcda161a6":[async_test('html5lib_template.html 27fb9111f6675a7e033b867480c0afddcda161a6'), "%3Ctemplate%3E%3C/template%3E%3Cdiv%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E"],"aee883a65775489399a003b2371d58248a6aff6f":[async_test('html5lib_template.html aee883a65775489399a003b2371d58248a6aff6f'), "%3Chtml%3E%3Ctemplate%3EHello%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%22Hello%22%0A%7C%20%20%20%3Cbody%3E"],"89b17b54ab343191bf74ef5434f4d2cfac40ea97":[async_test('html5lib_template.html 89b17b54ab343191bf74ef5434f4d2cfac40ea97'), "%3Chead%3E%3Ctemplate%3E%3Cdiv%3E%3C/div%3E%3C/template%3E%3C/head%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%3Cbody%3E"],"c4433556c7414cfd71f27b420f1ffc4348774f5e":[async_test('html5lib_template.html c4433556c7414cfd71f27b420f1ffc4348774f5e'), "%3Cdiv%3E%3Ctemplate%3E%3Cdiv%3E%3Cspan%3E%3C/template%3E%3Cb%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E"],"3dcce7d97108b3e9ea7fa96f240ac62bf280e74b":[async_test('html5lib_template.html 3dcce7d97108b3e9ea7fa96f240ac62bf280e74b'), "%3Cdiv%3E%3Ctemplate%3E%3C/div%3EHello", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22Hello%22"],"a1f587f7ea85ccfe294bd45bfb501e850cb979e0":[async_test('html5lib_template.html a1f587f7ea85ccfe294bd45bfb501e850cb979e0'), "%3Cdiv%3E%3C/template%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E"],"cd26a7832f13bdc135697321ca6c2fecdca6ef5d":[async_test('html5lib_template.html cd26a7832f13bdc135697321ca6c2fecdca6ef5d'), "%3Ctable%3E%3Ctemplate%3E%3C/template%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content"],"e30571d90b0e56864499961eb7be955994cf72e2":[async_test('html5lib_template.html e30571d90b0e56864499961eb7be955994cf72e2'), "%3Ctable%3E%3Ctemplate%3E%3C/template%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content"],"01cbe9f6a25f286b08d8dc4f7b65421e8eb3500c":[async_test('html5lib_template.html 01cbe9f6a25f286b08d8dc4f7b65421e8eb3500c'), "%3Ctable%3E%3Cdiv%3E%3Ctemplate%3E%3C/template%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%3Ctable%3E"],"96cbbcdffe02c86a8b929604c2fd5f3571a18dbe":[async_test('html5lib_template.html 96cbbcdffe02c86a8b929604c2fd5f3571a18dbe'), "%3Ctable%3E%3Ctemplate%3E%3C/template%3E%3Cdiv%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content"],"d51676f55550e960dd0f5fa7fd0bdfa20bdde046":[async_test('html5lib_template.html d51676f55550e960dd0f5fa7fd0bdfa20bdde046'), "%3Ctable%3E%20%20%20%3Ctemplate%3E%3C/template%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%22%20%20%20%22%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content"],"f9dfd9acfd494489c899604649a01d864741f50f":[async_test('html5lib_template.html f9dfd9acfd494489c899604649a01d864741f50f'), "%3Ctable%3E%3Ctbody%3E%3Ctemplate%3E%3C/template%3E%3C/tbody%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content"],"ea00361c265d3ffb47ce636d919c94ca10d58911":[async_test('html5lib_template.html ea00361c265d3ffb47ce636d919c94ca10d58911'), "%3Ctable%3E%3Ctbody%3E%3Ctemplate%3E%3C/tbody%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content"],"d8ebfcf7694c9d04457e796ac73049210313602e":[async_test('html5lib_template.html d8ebfcf7694c9d04457e796ac73049210313602e'), "%3Ctable%3E%3Ctbody%3E%3Ctemplate%3E%3C/template%3E%3C/tbody%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content"],"b4d5e6fe9b92e2c8f54199d7cab3da383c42add0":[async_test('html5lib_template.html b4d5e6fe9b92e2c8f54199d7cab3da383c42add0'), "%3Ctable%3E%3Cthead%3E%3Ctemplate%3E%3C/template%3E%3C/thead%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cthead%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content"],"07724ef8f7a4fa61c77ffcd5180d3101c4781502":[async_test('html5lib_template.html 07724ef8f7a4fa61c77ffcd5180d3101c4781502'), "%3Ctable%3E%3Ctfoot%3E%3Ctemplate%3E%3C/template%3E%3C/tfoot%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctfoot%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content"],"e90f8aae8fc690540b42b3ffa3e741e7c1dfbf43":[async_test('html5lib_template.html e90f8aae8fc690540b42b3ffa3e741e7c1dfbf43'), "%3Cselect%3E%3Ctemplate%3E%3C/template%3E%3C/select%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content"],"687bdf4adda88a316ec69fe20e84720acc5d1fe6":[async_test('html5lib_template.html 687bdf4adda88a316ec69fe20e84720acc5d1fe6'), "%3Cselect%3E%3Ctemplate%3E%3Coption%3E%3C/option%3E%3C/template%3E%3C/select%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Coption%3E"],"5b232642f472c2b4c0c7511fed464eebe686b427":[async_test('html5lib_template.html 5b232642f472c2b4c0c7511fed464eebe686b427'), "%3Ctemplate%3E%3Coption%3E%3C/option%3E%3C/select%3E%3Coption%3E%3C/option%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%3Cbody%3E"],"dc1ac1830a881d1532a1e6fd6d0cfa56d6571da2":[async_test('html5lib_template.html dc1ac1830a881d1532a1e6fd6d0cfa56d6571da2'), "%3Cselect%3E%3Ctemplate%3E%3C/template%3E%3Coption%3E%3C/select%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%3Coption%3E"],"c58747a85e8b4f44d7ae63c04cdad783a903c25e":[async_test('html5lib_template.html c58747a85e8b4f44d7ae63c04cdad783a903c25e'), "%3Cselect%3E%3Coption%3E%3Ctemplate%3E%3C/template%3E%3C/select%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content"],"ca59bfdaec7451f704973176fab46e582bd691b2":[async_test('html5lib_template.html ca59bfdaec7451f704973176fab46e582bd691b2'), "%3Cselect%3E%3Ctemplate%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content"],"cf807d6391a58c172b6c15c3b01d2a99ec0e6cf8":[async_test('html5lib_template.html cf807d6391a58c172b6c15c3b01d2a99ec0e6cf8'), "%3Cselect%3E%3Coption%3E%3C/option%3E%3Ctemplate%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content"],"350b7ac850e46de79615308fc923649264406104":[async_test('html5lib_template.html 350b7ac850e46de79615308fc923649264406104'), "%3Cselect%3E%3Coption%3E%3C/option%3E%3Ctemplate%3E%3Coption%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Coption%3E"],"a31ff44edf7f377543dabdda8141cda9bb6de134":[async_test('html5lib_template.html a31ff44edf7f377543dabdda8141cda9bb6de134'), "%3Ctable%3E%3Cthead%3E%3Ctemplate%3E%3Ctd%3E%3C/template%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cthead%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"533c5c1b5f0d0cbb1ede2cc5ae927095c5b21f0b":[async_test('html5lib_template.html 533c5c1b5f0d0cbb1ede2cc5ae927095c5b21f0b'), "%3Ctable%3E%3Ctemplate%3E%3Cthead%3E%3C/template%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cthead%3E"],"61f79e083005007853c4f8e431559ac8d3845cfd":[async_test('html5lib_template.html 61f79e083005007853c4f8e431559ac8d3845cfd'), "%3Cbody%3E%3Ctable%3E%3Ctemplate%3E%3Ctd%3E%3C/tr%3E%3Cdiv%3E%3C/template%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"e802e85f36792b176b73c102c0e8761d9478621d":[async_test('html5lib_template.html e802e85f36792b176b73c102c0e8761d9478621d'), "%3Ctable%3E%3Ctemplate%3E%3Cthead%3E%3C/template%3E%3C/thead%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cthead%3E"],"51d0797ff7653cd7be34458d689146e08a666c7f":[async_test('html5lib_template.html 51d0797ff7653cd7be34458d689146e08a666c7f'), "%3Ctable%3E%3Cthead%3E%3Ctemplate%3E%3Ctr%3E%3C/template%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cthead%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"d60e4079a18bd6266740cc61d1ca736e9d5098ce":[async_test('html5lib_template.html d60e4079a18bd6266740cc61d1ca736e9d5098ce'), "%3Ctable%3E%3Ctemplate%3E%3Ctr%3E%3C/template%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"308709292677b4d74c108a811ad7b7acd0bdfc9c":[async_test('html5lib_template.html 308709292677b4d74c108a811ad7b7acd0bdfc9c'), "%3Ctable%3E%3Ctr%3E%3Ctemplate%3E%3Ctd%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"8965cdf9c4e9936262e25c90c7a7f8673840a445":[async_test('html5lib_template.html 8965cdf9c4e9936262e25c90c7a7f8673840a445'), "%3Ctable%3E%3Ctemplate%3E%3Ctr%3E%3Ctemplate%3E%3Ctd%3E%3C/template%3E%3C/tr%3E%3C/template%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"7dccda789764beb489e09be10188af9347335d05":[async_test('html5lib_template.html 7dccda789764beb489e09be10188af9347335d05'), "%3Ctable%3E%3Ctemplate%3E%3Ctr%3E%3Ctemplate%3E%3Ctd%3E%3C/td%3E%3C/template%3E%3C/tr%3E%3C/template%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"e15be51c77e1a6de35568a099ed339440ce9426d":[async_test('html5lib_template.html e15be51c77e1a6de35568a099ed339440ce9426d'), "%3Ctable%3E%3Ctemplate%3E%3Ctd%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"503d3782e45940c19f096f360a092282b46ab1ea":[async_test('html5lib_template.html 503d3782e45940c19f096f360a092282b46ab1ea'), "%3Cbody%3E%3Ctemplate%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"b4ab56fd9e9cebf479d14adfa523c06d16483a5e":[async_test('html5lib_template.html b4ab56fd9e9cebf479d14adfa523c06d16483a5e'), "%3Cbody%3E%3Ctemplate%3E%3Ctemplate%3E%3Ctr%3E%3C/tr%3E%3C/template%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"cd8bc9521f9683086a9e8529dd97314a6869daeb":[async_test('html5lib_template.html cd8bc9521f9683086a9e8529dd97314a6869daeb'), "%3Ctable%3E%3Ccolgroup%3E%3Ctemplate%3E%3Ccol%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ccol%3E"],"f915e7b3407c24b28c3aad318e5693cc774020f4":[async_test('html5lib_template.html f915e7b3407c24b28c3aad318e5693cc774020f4'), "%3Cframeset%3E%3Ctemplate%3E%3Cframe%3E%3C/frame%3E%3C/template%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%3Cframe%3E"],"3c5eb261787b3d15aff86fa61de773fd7e439b0e":[async_test('html5lib_template.html 3c5eb261787b3d15aff86fa61de773fd7e439b0e'), "%3Ctemplate%3E%3Cframe%3E%3C/frame%3E%3C/frameset%3E%3Cframe%3E%3C/frame%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%3Cbody%3E"],"2b57775750c198d4b98b23aed74ff80a866a01f5":[async_test('html5lib_template.html 2b57775750c198d4b98b23aed74ff80a866a01f5'), "%3Ctemplate%3E%3Cdiv%3E%3Cframeset%3E%3Cspan%3E%3C/span%3E%3C/div%3E%3Cspan%3E%3C/span%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%3Cbody%3E"],"dc3d016610f3ab532525a6c2871f03d6b62b0168":[async_test('html5lib_template.html dc3d016610f3ab532525a6c2871f03d6b62b0168'), "%3Cbody%3E%3Ctemplate%3E%3Cdiv%3E%3Cframeset%3E%3Cspan%3E%3C/span%3E%3C/div%3E%3Cspan%3E%3C/span%3E%3C/template%3E%3C/body%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cspan%3E"],"6a184d71d00580a26a8b6bd97aafe5503339f3f6":[async_test('html5lib_template.html 6a184d71d00580a26a8b6bd97aafe5503339f3f6'), "%3Cbody%3E%3Ctemplate%3E%3Cscript%3Evar%20i%20%3D%201%3B%3C/script%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22var%20i%20%3D%201%3B%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"ce570a6c4bcee8b72a03e25508c6dd72e3cc6c35":[async_test('html5lib_template.html ce570a6c4bcee8b72a03e25508c6dd72e3cc6c35'), "%3Cbody%3E%3Ctemplate%3E%3Ctr%3E%3Cdiv%3E%3C/div%3E%3C/tr%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"e0c3d922f7b1f1654f02f716c3d9b31198ce3385":[async_test('html5lib_template.html e0c3d922f7b1f1654f02f716c3d9b31198ce3385'), "%3Cbody%3E%3Ctemplate%3E%3Ctr%3E%3C/tr%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"87e67242bf6debcf3b7dca852d10aa0f7b625b28":[async_test('html5lib_template.html 87e67242bf6debcf3b7dca852d10aa0f7b625b28'), "%3Cbody%3E%3Ctemplate%3E%3Ctd%3E%3C/td%3E%3C/tr%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"35ac4d4c972a01d368ed0cacb41370efef0a644d":[async_test('html5lib_template.html 35ac4d4c972a01d368ed0cacb41370efef0a644d'), "%3Cbody%3E%3Ctemplate%3E%3Ctd%3E%3C/td%3E%3Ctbody%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"5226c39dfc2d624ad4191b4eacb7e40c7ae528eb":[async_test('html5lib_template.html 5226c39dfc2d624ad4191b4eacb7e40c7ae528eb'), "%3Cbody%3E%3Ctemplate%3E%3Ctd%3E%3C/td%3E%3Ccaption%3E%3C/caption%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"aa90cd4db6b12e0a47341914a90cc536eec32d64":[async_test('html5lib_template.html aa90cd4db6b12e0a47341914a90cc536eec32d64'), "%3Cbody%3E%3Ctemplate%3E%3Ctd%3E%3C/td%3E%3Ccolgroup%3E%3C/caption%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"48af1faf5fcf48a0854af5a5c33656d9ccf6736b":[async_test('html5lib_template.html 48af1faf5fcf48a0854af5a5c33656d9ccf6736b'), "%3Cbody%3E%3Ctemplate%3E%3Ctd%3E%3C/td%3E%3C/table%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"ed3a029ba5e7f59969d65a4fc490a8f13b098cb9":[async_test('html5lib_template.html ed3a029ba5e7f59969d65a4fc490a8f13b098cb9'), "%3Cbody%3E%3Ctemplate%3E%3Ctr%3E%3C/tr%3E%3Ctbody%3E%3Ctr%3E%3C/tr%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"6c8880d54475ad9574e203dcf2e55820b123cc64":[async_test('html5lib_template.html 6c8880d54475ad9574e203dcf2e55820b123cc64'), "%3Cbody%3E%3Ctemplate%3E%3Ctr%3E%3C/tr%3E%3Ccaption%3E%3Ctr%3E%3C/tr%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"275060925a844cb51b29bae660301de9780d68c8":[async_test('html5lib_template.html 275060925a844cb51b29bae660301de9780d68c8'), "%3Cbody%3E%3Ctemplate%3E%3Ctr%3E%3C/tr%3E%3C/table%3E%3Ctr%3E%3C/tr%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"9f82f6ec4c0a48c1d4dfbe6803b94abd553aea88":[async_test('html5lib_template.html 9f82f6ec4c0a48c1d4dfbe6803b94abd553aea88'), "%3Cbody%3E%3Ctemplate%3E%3Cthead%3E%3C/thead%3E%3Ccaption%3E%3C/caption%3E%3Ctbody%3E%3C/tbody%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cthead%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E"],"f094bf7e94a88b86c80a0643e70c8e5ff3354698":[async_test('html5lib_template.html f094bf7e94a88b86c80a0643e70c8e5ff3354698'), "%3Cbody%3E%3Ctemplate%3E%3Cthead%3E%3C/thead%3E%3C/table%3E%3Ctbody%3E%3C/tbody%3E%3C/template%3E%3C/body%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cthead%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E"],"35a07ec3b4bf26ea407dc1ddf52f14195a714059":[async_test('html5lib_template.html 35a07ec3b4bf26ea407dc1ddf52f14195a714059'), "%3Cbody%3E%3Ctemplate%3E%3Cdiv%3E%3Ctr%3E%3C/tr%3E%3C/div%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"24faa53b271f994a4ff31d5796c8ff47d6f2c3e6":[async_test('html5lib_template.html 24faa53b271f994a4ff31d5796c8ff47d6f2c3e6'), "%3Cbody%3E%3Ctemplate%3E%3Cem%3EHello%3C/em%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cem%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22Hello%22"],"0f1c491b58c2dd3c402a62e37f833bc1f1db8d21":[async_test('html5lib_template.html 0f1c491b58c2dd3c402a62e37f833bc1f1db8d21'), "%3Cbody%3E%3Ctemplate%3E%3C%21--comment--%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3C%21--%20comment%20--%3E"],"868d918a7b5d8b5c065c15229492bc2022bfbcba":[async_test('html5lib_template.html 868d918a7b5d8b5c065c15229492bc2022bfbcba'), "%3Cbody%3E%3Ctemplate%3E%3Cstyle%3E%3C/style%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"0538efa44e857596c556033a3821d424378aea3f":[async_test('html5lib_template.html 0538efa44e857596c556033a3821d424378aea3f'), "%3Cbody%3E%3Ctemplate%3E%3Cmeta%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"e7d7bf3973c70d3cf9b0adad2ebed9f25be48d66":[async_test('html5lib_template.html e7d7bf3973c70d3cf9b0adad2ebed9f25be48d66'), "%3Cbody%3E%3Ctemplate%3E%3Clink%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Clink%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"c69d0ac542d477b7312bb24981127b8aa8fdb1df":[async_test('html5lib_template.html c69d0ac542d477b7312bb24981127b8aa8fdb1df'), "%3Cbody%3E%3Ctable%3E%3Ccolgroup%3E%3Ctemplate%3E%3Ccol%3E%3C/col%3E%3C/template%3E%3C/colgroup%3E%3C/table%3E%3C/body%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ccol%3E"],"b496a8c13a7bd75b778bb0de489726aee952ae0c":[async_test('html5lib_template.html b496a8c13a7bd75b778bb0de489726aee952ae0c'), "%3Cbody%20a%3Db%3E%3Ctemplate%3E%3Cdiv%3E%3C/div%3E%3Cbody%20c%3Dd%3E%3Cdiv%3E%3C/div%3E%3C/body%3E%3C/template%3E%3C/body%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20a%3D%22b%22%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"5d6ee61de40274c9626ca78ee208d51276d5662d":[async_test('html5lib_template.html 5d6ee61de40274c9626ca78ee208d51276d5662d'), "%3Chtml%20a%3Db%3E%3Ctemplate%3E%3Cdiv%3E%3Chtml%20b%3Dc%3E%3Cspan%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20a%3D%22b%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%3Cbody%3E"],"9bd9687a65f258adc24450fc5cbd781fff6c038a":[async_test('html5lib_template.html 9bd9687a65f258adc24450fc5cbd781fff6c038a'), "%3Chtml%20a%3Db%3E%3Ctemplate%3E%3Ccol%3E%3C/col%3E%3Chtml%20b%3Dc%3E%3Ccol%3E%3C/col%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20a%3D%22b%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%3Cbody%3E"],"db1baeb846d718c773324746524fbd68f2e9436e":[async_test('html5lib_template.html db1baeb846d718c773324746524fbd68f2e9436e'), "%3Chtml%20a%3Db%3E%3Ctemplate%3E%3Cframe%3E%3C/frame%3E%3Chtml%20b%3Dc%3E%3Cframe%3E%3C/frame%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20a%3D%22b%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%3Cbody%3E"],"4b0ce46c611dbcc016db272ef007f302bee0c897":[async_test('html5lib_template.html 4b0ce46c611dbcc016db272ef007f302bee0c897'), "%3Cbody%3E%3Ctemplate%3E%3Ctr%3E%3C/tr%3E%3Ctemplate%3E%3C/template%3E%3Ctd%3E%3C/td%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"1a735e1c7f28f8701f3c7fd5e9404b8911916086":[async_test('html5lib_template.html 1a735e1c7f28f8701f3c7fd5e9404b8911916086'), "%3Cbody%3E%3Ctemplate%3E%3Cthead%3E%3C/thead%3E%3Ctemplate%3E%3Ctr%3E%3C/tr%3E%3C/template%3E%3Ctr%3E%3C/tr%3E%3Ctfoot%3E%3C/tfoot%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cthead%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctfoot%3E"],"0686eedec06b2db1dc283fac92c1ef1a33114c71":[async_test('html5lib_template.html 0686eedec06b2db1dc283fac92c1ef1a33114c71'), "%3Cbody%3E%3Ctemplate%3E%3Ctemplate%3E%3Cb%3E%3Ctemplate%3E%3C/template%3E%3C/template%3Etext%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%22text%22"],"d4dfb87ce626f12923056a6cd77448eaf4660ac2":[async_test('html5lib_template.html d4dfb87ce626f12923056a6cd77448eaf4660ac2'), "%3Cbody%3E%3Ctemplate%3E%3Ccol%3E%3Ccolgroup%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E"],"1f295920f2937b2c8023b3761c43a0d4d9e5353c":[async_test('html5lib_template.html 1f295920f2937b2c8023b3761c43a0d4d9e5353c'), "%3Cbody%3E%3Ctemplate%3E%3Ccol%3E%3C/colgroup%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E"],"3b91fa08fad923d387d924cff37fbf6b4c3a5712":[async_test('html5lib_template.html 3b91fa08fad923d387d924cff37fbf6b4c3a5712'), "%3Cbody%3E%3Ctemplate%3E%3Ccol%3E%3Ccolgroup%3E%3C/template%3E%3C/body%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E"],"45a1c1ad5d99ad67c573096a79253996a664e01b":[async_test('html5lib_template.html 45a1c1ad5d99ad67c573096a79253996a664e01b'), "%3Cbody%3E%3Ctemplate%3E%3Ccol%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E"],"0fe3a66773c6048c8f6f2c92f2611f65be972ec1":[async_test('html5lib_template.html 0fe3a66773c6048c8f6f2c92f2611f65be972ec1'), "%3Cbody%3E%3Ctemplate%3E%3Ccol%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E"],"be40897ca411e1507197c31ab2a9f9752a05f769":[async_test('html5lib_template.html be40897ca411e1507197c31ab2a9f9752a05f769'), "%3Cbody%3E%3Ctemplate%3E%3Ccol%3EHello", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E"],"dcfb1048ed5c40e406b4fbf0cde24c826713907f":[async_test('html5lib_template.html dcfb1048ed5c40e406b4fbf0cde24c826713907f'), "%3Cbody%3E%3Ctemplate%3E%3Ci%3E%3Cmenu%3EFoo%3C/i%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmenu%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22Foo%22"],"78263aeea68ac97903598682013bae9c0c21d547":[async_test('html5lib_template.html 78263aeea68ac97903598682013bae9c0c21d547'), "%3Cbody%3E%3Ctemplate%3E%3C/div%3E%3Cdiv%3EFoo%3C/div%3E%3Ctemplate%3E%3C/template%3E%3Ctr%3E%3C/tr%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22Foo%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content"],"5aa177ef1a35bf4502dcb867d8e666288982ba99":[async_test('html5lib_template.html 5aa177ef1a35bf4502dcb867d8e666288982ba99'), "%3Cbody%3E%3Cdiv%3E%3Ctemplate%3E%3C/div%3E%3Ctr%3E%3Ctd%3EFoo%3C/td%3E%3C/tr%3E%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Foo%22"],"5d303375907dc4d4380b477e0317c17b660613e9":[async_test('html5lib_template.html 5d303375907dc4d4380b477e0317c17b660613e9'), "%3Ctemplate%3E%3C/figcaption%3E%3Csub%3E%3Ctable%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Csub%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%3Cbody%3E"],"d822f726927c34b92fe102b13e63920850878f6a":[async_test('html5lib_template.html d822f726927c34b92fe102b13e63920850878f6a'), "%3Ctemplate%3E%3Ctemplate%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%3Cbody%3E"],"07acdcaeb4fa639296d46673cf28823ddf2a6ca7":[async_test('html5lib_template.html 07acdcaeb4fa639296d46673cf28823ddf2a6ca7'), "%3Ctemplate%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%3Cbody%3E"],"58bd846ce1be0caf7560fba2ef19e2c2070ab123":[async_test('html5lib_template.html 58bd846ce1be0caf7560fba2ef19e2c2070ab123'), "%3Ctemplate%3E%3Ctemplate%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%3Cbody%3E"],"8eeee377e5ab324731cc592f1fa8abe1045ad610":[async_test('html5lib_template.html 8eeee377e5ab324731cc592f1fa8abe1045ad610'), "%3Ctemplate%3E%3Ctemplate%3E%3Ctable%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%3Cbody%3E"],"b30690019090149132fc228a7261c5cf2fd149fc":[async_test('html5lib_template.html b30690019090149132fc228a7261c5cf2fd149fc'), "%3Ctemplate%3E%3Ctemplate%3E%3Ctbody%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%3Cbody%3E"],"67a209d928804f90fdb66d070201b23f3d0c8a42":[async_test('html5lib_template.html 67a209d928804f90fdb66d070201b23f3d0c8a42'), "%3Ctemplate%3E%3Ctemplate%3E%3Ctr%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%3Cbody%3E"],"12104886b8f87daa937eac30b5ff0e1e074eaa6f":[async_test('html5lib_template.html 12104886b8f87daa937eac30b5ff0e1e074eaa6f'), "%3Ctemplate%3E%3Ctemplate%3E%3Ctd%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%3Cbody%3E"],"483cc9957a7225fe435112642be59abb4c459a1e":[async_test('html5lib_template.html 483cc9957a7225fe435112642be59abb4c459a1e'), "%3Ctemplate%3E%3Ctemplate%3E%3Ccaption%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%3Cbody%3E"],"72d8ac431a154c40ab75d53a258d9d80d47689eb":[async_test('html5lib_template.html 72d8ac431a154c40ab75d53a258d9d80d47689eb'), "%3Ctemplate%3E%3Ctemplate%3E%3Ccolgroup%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%3Cbody%3E"],"1125967cbbcd404f4cb14d48270b8ec778970d77":[async_test('html5lib_template.html 1125967cbbcd404f4cb14d48270b8ec778970d77'), "%3Ctemplate%3E%3Ctemplate%3E%3Ccol%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%3Cbody%3E"],"32c963e164b9ec82c60e490bb141c1ccc70b992f":[async_test('html5lib_template.html 32c963e164b9ec82c60e490bb141c1ccc70b992f'), "%3Ctemplate%3E%3Ctemplate%3E%3Ctbody%3E%3Cselect%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%3Cbody%3E"],"574a95fc9c9f2de3aeaa0c9ee1e6967fc3d4770d":[async_test('html5lib_template.html 574a95fc9c9f2de3aeaa0c9ee1e6967fc3d4770d'), "%3Ctemplate%3E%3Ctemplate%3E%3Ctable%3EFoo", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22Foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%3Cbody%3E"],"332863a7f9e61bff32bd3427ede7a088b790d453":[async_test('html5lib_template.html 332863a7f9e61bff32bd3427ede7a088b790d453'), "%3Ctemplate%3E%3Ctemplate%3E%3Cframe%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%3Cbody%3E"],"2121db07146781773df9e53b94fa921a805175ce":[async_test('html5lib_template.html 2121db07146781773df9e53b94fa921a805175ce'), "%3Ctemplate%3E%3Ctemplate%3E%3Cscript%3Evar%20i", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22var%20i%22%0A%7C%20%20%20%3Cbody%3E"],"8675de267cd7e34f2febdee3feb665614d1562fe":[async_test('html5lib_template.html 8675de267cd7e34f2febdee3feb665614d1562fe'), "%3Ctemplate%3E%3Ctemplate%3E%3Cstyle%3Evar%20i", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22var%20i%22%0A%7C%20%20%20%3Cbody%3E"],"c5d26ad923a2b1e988ddd378ca4fb26eb48353e1":[async_test('html5lib_template.html c5d26ad923a2b1e988ddd378ca4fb26eb48353e1'), "%3Ctemplate%3E%3Ctable%3E%3C/template%3E%3Cbody%3E%3Cspan%3EFoo", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%22Foo%22"],"eec1542e2fa0e9eafb7f8d4a51eae56b5a31b3c8":[async_test('html5lib_template.html eec1542e2fa0e9eafb7f8d4a51eae56b5a31b3c8'), "%3Ctemplate%3E%3Ctd%3E%3C/template%3E%3Cbody%3E%3Cspan%3EFoo", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%22Foo%22"],"b79387a54c3b136db0f28ed96555ff683b3947fe":[async_test('html5lib_template.html b79387a54c3b136db0f28ed96555ff683b3947fe'), "%3Ctemplate%3E%3Cobject%3E%3C/template%3E%3Cbody%3E%3Cspan%3EFoo", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Cobject%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%22Foo%22"],"c477a29a4deb32d072a415fa809a84a4f2beee0c":[async_test('html5lib_template.html c477a29a4deb32d072a415fa809a84a4f2beee0c'), "%3Ctemplate%3E%3Csvg%3E%3Ctemplate%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20template%3E%0A%7C%20%20%20%3Cbody%3E"],"26e4480c08e1f5f7b6ac8b8c1832ab0312e3b7c5":[async_test('html5lib_template.html 26e4480c08e1f5f7b6ac8b8c1832ab0312e3b7c5'), "%3Ctemplate%3E%3Csvg%3E%3Cfoo%3E%3Ctemplate%3E%3CforeignObject%3E%3Cdiv%3E%3C/template%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foo%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20template%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E"],"24b3b50fdd0bf8d5cf2ebaa6bf502d7bcfde1da4":[async_test('html5lib_template.html 24b3b50fdd0bf8d5cf2ebaa6bf502d7bcfde1da4'), "%3Cdummy%3E%3Ctemplate%3E%3Cspan%3E%3C/dummy%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdummy%3E%0A%7C%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E"],"d3704c68528357189eb5826ab66eea071d6137a5":[async_test('html5lib_template.html d3704c68528357189eb5826ab66eea071d6137a5'), "%3Cbody%3E%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Cselect%3E%3Ctemplate%3EFoo%3C/template%3E%3Ccaption%3EA%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Foo%22%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%22A%22"],"d958f7d44faf772d1fb60f1a8f186f837ca735d9":[async_test('html5lib_template.html d958f7d44faf772d1fb60f1a8f186f837ca735d9'), "%3Cbody%3E%3C/body%3E%3Ctemplate%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content"],"3fc4d97fa68fc2658356bdbd4e051c867de8de53":[async_test('html5lib_template.html 3fc4d97fa68fc2658356bdbd4e051c867de8de53'), "%3Chead%3E%3C/head%3E%3Ctemplate%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%3Cbody%3E"],"94820107bbf3fab3f82de1f717e8413aead7d3a6":[async_test('html5lib_template.html 94820107bbf3fab3f82de1f717e8413aead7d3a6'), "%3Chead%3E%3C/head%3E%3Ctemplate%3EFoo%3C/template%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%22Foo%22%0A%7C%20%20%20%3Cbody%3E"],"657c00ebdda37ae060cc69633ed98482ccc29e18":[async_test('html5lib_template.html 657c00ebdda37ae060cc69633ed98482ccc29e18'), "%3C%21DOCTYPE%20HTML%3E%3Cdummy%3E%3Ctable%3E%3Ctemplate%3E%3Ctable%3E%3Ctemplate%3E%3Ctable%3E%3Cscript%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdummy%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctemplate%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20content%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cscript%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests1.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests1.html
new file mode 100644
index 000000000..fa658fc76
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests1.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests1.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['4235382bf15f93f7dd1096832ae74cc71edef4d7','ad8515e9db0abd26469d0d2e46b42cebf606d4f3','2433aa5c088d78da9e7824e499f639177f56625d','c99d322c3502e38e9d18ac6c0180fa5462ce612e','d8473f7b5cec9d99526179f980ebf55a0beccbd3','ac7703fbb5c62cadb25024aed762c206c187a919','a00121213e2eb2c846a575f662e8c69389bfc44d','447f22e6a43ddbbc308afbc78b64b16452bc7bbb','cdac424e0f2fb979f21a64f50793d529375c01b3','63587d177231d2478a6ffd25f3c830fed7cc2efe','a3e13da13681f9f16c65334099136f3b5c235e6d','b7a06a5aa0c19d7914b853f5ed497743bb269e56','3d28b753b97f460868ca65ed8fc153021a815b8c','83cce5b1e1e49c92c618aabf1ed60926a8736456','b9e809bc4521004440bf558c7dc5d7dc1ae3dd40','60302916ab9a2128104dbf72629875ad19b5cb16','f4ad8e574fcac3bb08070eeb345855ea7081ea1d','d38fe13d87344a20bdf6e111988b5a09ed247913','e5f2e91cbff6a4bc56149b889f4f9396e455c5ad','18b58d1de184b6866963c902ff8451dd3522f540','88eb93691065e212a4323f55ec326585c7c44262','260db4c31fb80894beb825c4793e6142f178497d','59d9c5e2941952f7af99ed3e21d66e4fdb1df07c','1e788677da8eb26f560409392ff674744c6f8b64','240ee32b47e30bcf34483c7a7530cfeb99a6d1f1','e85dc012a49630206e6163cd1e0fd6c706865106','c440d1f0223d6b3ce85955d8246fdd47ecdfb034','9a2ce05a0b342b377ef054385131ad4d1b5ae84b','daa9d8440e2bc4d560536b52123b01e52aa81692','0b27e026dd03a356bbd78690fff7fb40cd63b606','a2d3321d1ea23b55d9117e5c2014e4ab0fa5e224','cc9c12dd44b43fa78ad340a91d20432e3f119c19','3d0cb9632b521a3fb334f567b3cdec985e85abd7','f158c8b44e4cdf872cc5bb4d148fad3ff27ea03f','1dfb5ce6c1a10d870a35b24314976d887c700c42','1fc4fad5eead893c51be2b6aa1d705cd58ebcfe9','f85417e345053cf627abf572911c0f7ffefe16c8','277ea1a5aade6c61a8386ff73086a91160caf5a2','32714c0ca1bae661ba9342ef275b2e6e5e025c34','619aa593419925064f51b0602000a2b9d13a8bc3','40fd9f6e4a08a69596f0dc0846d44ebd39e4913d','82120b3520ad73b9e11a413631e6f015ed0cf265','a9f265e67b901f8d41ece9bb631696795327ed50','6325e1d53c83784c1e5092861c8b0138fb4871ad','451c02faba02d2768e3497fdcc8ffb0dec41640d','fefda3429288aa79b4c9e8e9e3ba97897d0783c8','6328f70bb445e1dd692c36d6c92e2a2a7ed6ee0f','287320444eec6e3b4481d33738f971b696a2d6f0','65ea3a80efc973b5cd92c1db5a4520365bbb5478','d60de29dd2f3e8a080882986d6689d74fb981619','343048017f1928db8ba4c0b45a4f1dd3dadf3063','cf14f5563275bac3fe2c77f8973e882e51965b5b','2d8f9308951237fd0dcba3ff7709369cfd7563fd','87421a25ca75e2d6a165eb981921235f4de9210a','30d87693aead287d5a63310d2f819623455f4133','20d7a996a47fab66aead30ed7012d50b990dc65d','258c0966cc576ec8a563e41e783fa34f6b5c8baf','f7ee5b858e93b22e1594d6d8cd0bc0def665ac02','6d9127103f8733d168e69cf04b576a7b0bea3d5c','03db7399a2d674955930611fdbcaad9f4064243a','a0a1dcb330314ce12af02d136319a1be6a1ffa53','09b3483ef5f7a83aa9e3224d0335b6f9aa78ac73','34d56f09a1a9c0f51a8abc41be2f157faf0e8d15','dffa0785e6c80af52950a64d8612633de58bbb29','076e6ac3cb344d60f6ce9a5188cf103ff053830c','5f14cb9c8502f09105ad83e27842625c70f3857d','25172f395b855b6eeb61ff95a8162a34ca92195e','053beabf01d70d03a0ca61b809d5d986ddf2ea3d','bd385dbe93b192c2182e09e75d3664b96845ea0a','2ddaacb4f4e566ae79af5259f57f5b4dd166c19f','d430f2fc3bd20e658ed00b55e6c27f14204a7b6f','bbdb0a08b66b0789068ddac96a05ac39e104553d','37ed2a3a96026e7a78f6675154d11746aa9484e0','4177a74406cf1c048d2d6d6bcf774445f55ba517','fc188652d9f486174b21d1919f35ea8c13636ca1','c10f83cc69763e42964e08ddb976a1bd27b51e2f','64452c62ced87bd3cd8fd88df33a33d5531818d6','96dc04673021ad113df40397113df972f090c1f6','26b7eb0b18d9cd0a69d19c7f6ee9f12c2d0b2783','f8d500cd7089942814fa0751c75bd37e63790685','3b386c205ec767f842e63491d14ec90192f562dd','ca8ecc666a82d1f2f48a095d42d9f95700e015bd','6727ab7c4240bf05f0a5d9ca4b384ca8d61e2d4f','3ad08edf5b9690be261dc375da3b1d9ec82e499a','06ed0f32cfd261010c9d810ff8317ef96b47c04c','44ea84c7e4e401c9d3f96d7cc39709e4be81edc8','67af290f1b04c4b1a67131edba1ee832c690432c','2f1899f72fafcb062418e8ce892188040de4708c','ed2a4958c832ef6cec993cb52afc808132714d0a','c7943ccd9d880664b0894a2035e1f2a837f37c7a','bbc836b1f494223d4eb8982930d693489d135740','617fdf08035740698b2f0f4c3874dbb469fd1848','e901fe2093e51eccb4d9d23103214bc527af265c','63970995ab6b8aee63de9e7a7667178d4fc86820','d7607fdd41625431bcbee319a86db1b73fc49edd','ce31a583a3921e306aaa558b1ea798b34d2bb0dc','04ba864e740f7ef104570ddc6af834e6336031ed','ea6ab4a56efd19cc04b5656583ea6d5c9cfd2752','1bb5dfba014f63c0a18b12097ed9a28d64552e07','a2dd4d5a28a61ec99ce9dae35e9d4ffe92812e2f','e26f001557952154c308e3e6f6d1789cf711ef27','34c1f9c212198edd7baf56e658db21d98c59f74c','e1c47adbde197e3eaa9504f3582fd9deac1cbbff','0f5aba4c1ed57ac3c6a2774f3bf43ef598bd9915','d11ff75681c4df2ff24ad731ff244afc3e1c87af','fa392f5dd6f2f6a73635c06208c8989caa874588','5815b2afbb0a7f4756af7914407f71f469658f38','a100bb6a2a80bec65c418d672144b6f647fbd46b','f66797fd63c8b0254b4ef28e9c38c3d4e512c93c','f10a41faca4cf01e39ed92c4eefff0631d1195dc','5d14e20ae19e0b3e14dcb997e3ccad5f0e1956e1','1949f8c612e660985fb5eb28235b6f9386ed4ffc',];
+ var tests = {
+ "4235382bf15f93f7dd1096832ae74cc71edef4d7":[async_test('html5lib_tests1.html 4235382bf15f93f7dd1096832ae74cc71edef4d7'), "Test", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Test%22"],"ad8515e9db0abd26469d0d2e46b42cebf606d4f3":[async_test('html5lib_tests1.html ad8515e9db0abd26469d0d2e46b42cebf606d4f3'), "%3Cp%3EOne%3Cp%3ETwo", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22One%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22Two%22"],"2433aa5c088d78da9e7824e499f639177f56625d":[async_test('html5lib_tests1.html 2433aa5c088d78da9e7824e499f639177f56625d'), "Line1%3Cbr%3ELine2%3Cbr%3ELine3%3Cbr%3ELine4", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Line1%22%0A%7C%20%20%20%20%20%3Cbr%3E%0A%7C%20%20%20%20%20%22Line2%22%0A%7C%20%20%20%20%20%3Cbr%3E%0A%7C%20%20%20%20%20%22Line3%22%0A%7C%20%20%20%20%20%3Cbr%3E%0A%7C%20%20%20%20%20%22Line4%22"],"c99d322c3502e38e9d18ac6c0180fa5462ce612e":[async_test('html5lib_tests1.html c99d322c3502e38e9d18ac6c0180fa5462ce612e'), "%3Chtml%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"d8473f7b5cec9d99526179f980ebf55a0beccbd3":[async_test('html5lib_tests1.html d8473f7b5cec9d99526179f980ebf55a0beccbd3'), "%3Chead%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"ac7703fbb5c62cadb25024aed762c206c187a919":[async_test('html5lib_tests1.html ac7703fbb5c62cadb25024aed762c206c187a919'), "%3Cbody%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"a00121213e2eb2c846a575f662e8c69389bfc44d":[async_test('html5lib_tests1.html a00121213e2eb2c846a575f662e8c69389bfc44d'), "%3Chtml%3E%3Chead%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"447f22e6a43ddbbc308afbc78b64b16452bc7bbb":[async_test('html5lib_tests1.html 447f22e6a43ddbbc308afbc78b64b16452bc7bbb'), "%3Chtml%3E%3Chead%3E%3C/head%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"cdac424e0f2fb979f21a64f50793d529375c01b3":[async_test('html5lib_tests1.html cdac424e0f2fb979f21a64f50793d529375c01b3'), "%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"63587d177231d2478a6ffd25f3c830fed7cc2efe":[async_test('html5lib_tests1.html 63587d177231d2478a6ffd25f3c830fed7cc2efe'), "%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E%3C/body%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"a3e13da13681f9f16c65334099136f3b5c235e6d":[async_test('html5lib_tests1.html a3e13da13681f9f16c65334099136f3b5c235e6d'), "%3Chtml%3E%3Chead%3E%3Cbody%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"b7a06a5aa0c19d7914b853f5ed497743bb269e56":[async_test('html5lib_tests1.html b7a06a5aa0c19d7914b853f5ed497743bb269e56'), "%3Chtml%3E%3Chead%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"3d28b753b97f460868ca65ed8fc153021a815b8c":[async_test('html5lib_tests1.html 3d28b753b97f460868ca65ed8fc153021a815b8c'), "%3Chtml%3E%3Chead%3E%3Cbody%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"83cce5b1e1e49c92c618aabf1ed60926a8736456":[async_test('html5lib_tests1.html 83cce5b1e1e49c92c618aabf1ed60926a8736456'), "%3Chtml%3E%3Cbody%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"b9e809bc4521004440bf558c7dc5d7dc1ae3dd40":[async_test('html5lib_tests1.html b9e809bc4521004440bf558c7dc5d7dc1ae3dd40'), "%3Cbody%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"60302916ab9a2128104dbf72629875ad19b5cb16":[async_test('html5lib_tests1.html 60302916ab9a2128104dbf72629875ad19b5cb16'), "%3Chead%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"f4ad8e574fcac3bb08070eeb345855ea7081ea1d":[async_test('html5lib_tests1.html f4ad8e574fcac3bb08070eeb345855ea7081ea1d'), "%3C/head%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"d38fe13d87344a20bdf6e111988b5a09ed247913":[async_test('html5lib_tests1.html d38fe13d87344a20bdf6e111988b5a09ed247913'), "%3C/body%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"e5f2e91cbff6a4bc56149b889f4f9396e455c5ad":[async_test('html5lib_tests1.html e5f2e91cbff6a4bc56149b889f4f9396e455c5ad'), "%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"18b58d1de184b6866963c902ff8451dd3522f540":[async_test('html5lib_tests1.html 18b58d1de184b6866963c902ff8451dd3522f540'), "%3Cb%3E%3Ctable%3E%3Ctd%3E%3Ci%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E"],"88eb93691065e212a4323f55ec326585c7c44262":[async_test('html5lib_tests1.html 88eb93691065e212a4323f55ec326585c7c44262'), "%3Cb%3E%3Ctable%3E%3Ctd%3E%3C/b%3E%3Ci%3E%3C/table%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%22X%22"],"260db4c31fb80894beb825c4793e6142f178497d":[async_test('html5lib_tests1.html 260db4c31fb80894beb825c4793e6142f178497d'), "%3Ch1%3EHello%3Ch2%3EWorld", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ch1%3E%0A%7C%20%20%20%20%20%20%20%22Hello%22%0A%7C%20%20%20%20%20%3Ch2%3E%0A%7C%20%20%20%20%20%20%20%22World%22"],"59d9c5e2941952f7af99ed3e21d66e4fdb1df07c":[async_test('html5lib_tests1.html 59d9c5e2941952f7af99ed3e21d66e4fdb1df07c'), "%3Ca%3E%3Cp%3EX%3Ca%3EY%3C/a%3EZ%3C/p%3E%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%22Y%22%0A%7C%20%20%20%20%20%20%20%22Z%22"],"1e788677da8eb26f560409392ff674744c6f8b64":[async_test('html5lib_tests1.html 1e788677da8eb26f560409392ff674744c6f8b64'), "%3Cb%3E%3Cbutton%3Efoo%3C/b%3Ebar", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%22bar%22"],"240ee32b47e30bcf34483c7a7530cfeb99a6d1f1":[async_test('html5lib_tests1.html 240ee32b47e30bcf34483c7a7530cfeb99a6d1f1'), "%3C%21DOCTYPE%20html%3E%3Cspan%3E%3Cbutton%3Efoo%3C/span%3Ebar", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foobar%22"],"e85dc012a49630206e6163cd1e0fd6c706865106":[async_test('html5lib_tests1.html e85dc012a49630206e6163cd1e0fd6c706865106'), "%3Cp%3E%3Cb%3E%3Cdiv%3E%3Cmarquee%3E%3C/p%3E%3C/b%3E%3C/div%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmarquee%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22X%22"],"c440d1f0223d6b3ce85955d8246fdd47ecdfb034":[async_test('html5lib_tests1.html c440d1f0223d6b3ce85955d8246fdd47ecdfb034'), "%3Cscript%3E%3Cdiv%3E%3C/script%3E%3C/div%3E%3Ctitle%3E%3Cp%3E%3C/title%3E%3Cp%3E%3Cp%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3Cdiv%3E%22%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%3Cp%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Cp%3E"],"9a2ce05a0b342b377ef054385131ad4d1b5ae84b":[async_test('html5lib_tests1.html 9a2ce05a0b342b377ef054385131ad4d1b5ae84b'), "%3C%21--%3E%3Cdiv%3E--%3C%21--%3E", "%23document%0A%7C%20%3C%21--%20%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22--%22%0A%7C%20%20%20%20%20%20%20%3C%21--%20%20--%3E"],"daa9d8440e2bc4d560536b52123b01e52aa81692":[async_test('html5lib_tests1.html daa9d8440e2bc4d560536b52123b01e52aa81692'), "%3Cp%3E%3Chr%3E%3C/p%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Chr%3E%0A%7C%20%20%20%20%20%3Cp%3E"],"0b27e026dd03a356bbd78690fff7fb40cd63b606":[async_test('html5lib_tests1.html 0b27e026dd03a356bbd78690fff7fb40cd63b606'), "%3Cselect%3E%3Cb%3E%3Coption%3E%3Cselect%3E%3Coption%3E%3C/b%3E%3C/select%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%22X%22"],"a2d3321d1ea23b55d9117e5c2014e4ab0fa5e224":[async_test('html5lib_tests1.html a2d3321d1ea23b55d9117e5c2014e4ab0fa5e224'), "%3Ca%3E%3Ctable%3E%3Ctd%3E%3Ca%3E%3Ctable%3E%3C/table%3E%3Ca%3E%3C/tr%3E%3Ca%3E%3C/table%3E%3Cb%3EX%3C/b%3EC%3Ca%3EY", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%20%20%22C%22%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%22Y%22"],"cc9c12dd44b43fa78ad340a91d20432e3f119c19":[async_test('html5lib_tests1.html cc9c12dd44b43fa78ad340a91d20432e3f119c19'), "%3Ca%20X%3E0%3Cb%3E1%3Ca%20Y%3E2", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20x%3D%22%22%0A%7C%20%20%20%20%20%20%20%220%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20y%3D%22%22%0A%7C%20%20%20%20%20%20%20%20%20%222%22"],"3d0cb9632b521a3fb334f567b3cdec985e85abd7":[async_test('html5lib_tests1.html 3d0cb9632b521a3fb334f567b3cdec985e85abd7'), "%3C%21-----%3E%3Cfont%3E%3Cdiv%3Ehello%3Ctable%3Eexcite%21%3Cb%3Eme%21%3Cth%3E%3Ci%3Eplease%21%3C/tr%3E%3C%21--X--%3E", "%23document%0A%7C%20%3C%21--%20-%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%22helloexcite%21%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22me%21%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cth%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22please%21%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%21--%20X%20--%3E"],"f158c8b44e4cdf872cc5bb4d148fad3ff27ea03f":[async_test('html5lib_tests1.html f158c8b44e4cdf872cc5bb4d148fad3ff27ea03f'), "%3C%21DOCTYPE%20html%3E%3Cli%3Ehello%3Cli%3Eworld%3Cul%3Ehow%3Cli%3Edo%3C/ul%3Eyou%3C/body%3E%3C%21--do--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%22hello%22%0A%7C%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%22world%22%0A%7C%20%20%20%20%20%20%20%3Cul%3E%0A%7C%20%20%20%20%20%20%20%20%20%22how%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22do%22%0A%7C%20%20%20%20%20%20%20%22you%22%0A%7C%20%20%20%3C%21--%20do%20--%3E"],"1dfb5ce6c1a10d870a35b24314976d887c700c42":[async_test('html5lib_tests1.html 1dfb5ce6c1a10d870a35b24314976d887c700c42'), "%3C%21DOCTYPE%20html%3EA%3Coption%3EB%3Coptgroup%3EC%3Cselect%3ED%3C/option%3EE", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22A%22%0A%7C%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%22B%22%0A%7C%20%20%20%20%20%3Coptgroup%3E%0A%7C%20%20%20%20%20%20%20%22C%22%0A%7C%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%20%20%22DE%22"],"1fc4fad5eead893c51be2b6aa1d705cd58ebcfe9":[async_test('html5lib_tests1.html 1fc4fad5eead893c51be2b6aa1d705cd58ebcfe9'), "%3C", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%3C%22"],"f85417e345053cf627abf572911c0f7ffefe16c8":[async_test('html5lib_tests1.html f85417e345053cf627abf572911c0f7ffefe16c8'), "%3C%23", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%3C%23%22"],"277ea1a5aade6c61a8386ff73086a91160caf5a2":[async_test('html5lib_tests1.html 277ea1a5aade6c61a8386ff73086a91160caf5a2'), "%3C/", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%3C/%22"],"32714c0ca1bae661ba9342ef275b2e6e5e025c34":[async_test('html5lib_tests1.html 32714c0ca1bae661ba9342ef275b2e6e5e025c34'), "%3C/%23", "%23document%0A%7C%20%3C%21--%20%23%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"619aa593419925064f51b0602000a2b9d13a8bc3":[async_test('html5lib_tests1.html 619aa593419925064f51b0602000a2b9d13a8bc3'), "%3C%3F", "%23document%0A%7C%20%3C%21--%20%3F%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"40fd9f6e4a08a69596f0dc0846d44ebd39e4913d":[async_test('html5lib_tests1.html 40fd9f6e4a08a69596f0dc0846d44ebd39e4913d'), "%3C%3F%23", "%23document%0A%7C%20%3C%21--%20%3F%23%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"82120b3520ad73b9e11a413631e6f015ed0cf265":[async_test('html5lib_tests1.html 82120b3520ad73b9e11a413631e6f015ed0cf265'), "%3C%21", "%23document%0A%7C%20%3C%21--%20%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"a9f265e67b901f8d41ece9bb631696795327ed50":[async_test('html5lib_tests1.html a9f265e67b901f8d41ece9bb631696795327ed50'), "%3C%21%23", "%23document%0A%7C%20%3C%21--%20%23%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"6325e1d53c83784c1e5092861c8b0138fb4871ad":[async_test('html5lib_tests1.html 6325e1d53c83784c1e5092861c8b0138fb4871ad'), "%3C%3FCOMMENT%3F%3E", "%23document%0A%7C%20%3C%21--%20%3FCOMMENT%3F%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"451c02faba02d2768e3497fdcc8ffb0dec41640d":[async_test('html5lib_tests1.html 451c02faba02d2768e3497fdcc8ffb0dec41640d'), "%3C%21COMMENT%3E", "%23document%0A%7C%20%3C%21--%20COMMENT%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"fefda3429288aa79b4c9e8e9e3ba97897d0783c8":[async_test('html5lib_tests1.html fefda3429288aa79b4c9e8e9e3ba97897d0783c8'), "%3C/%20COMMENT%20%3E", "%23document%0A%7C%20%3C%21--%20%20COMMENT%20%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"6328f70bb445e1dd692c36d6c92e2a2a7ed6ee0f":[async_test('html5lib_tests1.html 6328f70bb445e1dd692c36d6c92e2a2a7ed6ee0f'), "%3C%3FCOM--MENT%3F%3E", "%23document%0A%7C%20%3C%21--%20%3FCOM--MENT%3F%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"287320444eec6e3b4481d33738f971b696a2d6f0":[async_test('html5lib_tests1.html 287320444eec6e3b4481d33738f971b696a2d6f0'), "%3C%21COM--MENT%3E", "%23document%0A%7C%20%3C%21--%20COM--MENT%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"65ea3a80efc973b5cd92c1db5a4520365bbb5478":[async_test('html5lib_tests1.html 65ea3a80efc973b5cd92c1db5a4520365bbb5478'), "%3C/%20COM--MENT%20%3E", "%23document%0A%7C%20%3C%21--%20%20COM--MENT%20%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"d60de29dd2f3e8a080882986d6689d74fb981619":[async_test('html5lib_tests1.html d60de29dd2f3e8a080882986d6689d74fb981619'), "%3C%21DOCTYPE%20html%3E%3Cstyle%3E%20EOF", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%20EOF%22%0A%7C%20%20%20%3Cbody%3E"],"343048017f1928db8ba4c0b45a4f1dd3dadf3063":[async_test('html5lib_tests1.html 343048017f1928db8ba4c0b45a4f1dd3dadf3063'), "%3C%21DOCTYPE%20html%3E%3Cscript%3E%20%3C%21--%20%3C/script%3E%20--%3E%20%3C/script%3E%20EOF", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%20%3C%21--%20%22%0A%7C%20%20%20%20%20%22%20%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%20%20EOF%22"],"cf14f5563275bac3fe2c77f8973e882e51965b5b":[async_test('html5lib_tests1.html cf14f5563275bac3fe2c77f8973e882e51965b5b'), "%3Cb%3E%3Cp%3E%3C/b%3ETEST", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22TEST%22"],"2d8f9308951237fd0dcba3ff7709369cfd7563fd":[async_test('html5lib_tests1.html 2d8f9308951237fd0dcba3ff7709369cfd7563fd'), "%3Cp%20id%3Da%3E%3Cb%3E%3Cp%20id%3Db%3E%3C/b%3ETEST", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20id%3D%22a%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20id%3D%22b%22%0A%7C%20%20%20%20%20%20%20%22TEST%22"],"87421a25ca75e2d6a165eb981921235f4de9210a":[async_test('html5lib_tests1.html 87421a25ca75e2d6a165eb981921235f4de9210a'), "%3Cb%20id%3Da%3E%3Cp%3E%3Cb%20id%3Db%3E%3C/p%3E%3C/b%3ETEST", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20id%3D%22a%22%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20id%3D%22b%22%0A%7C%20%20%20%20%20%20%20%22TEST%22"],"30d87693aead287d5a63310d2f819623455f4133":[async_test('html5lib_tests1.html 30d87693aead287d5a63310d2f819623455f4133'), "%3C%21DOCTYPE%20html%3E%3Ctitle%3EU-test%3C/title%3E%3Cbody%3E%3Cdiv%3E%3Cp%3ETest%3Cu%3E%3C/p%3E%3C/div%3E%3C/body%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22U-test%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%22Test%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cu%3E"],"20d7a996a47fab66aead30ed7012d50b990dc65d":[async_test('html5lib_tests1.html 20d7a996a47fab66aead30ed7012d50b990dc65d'), "%3C%21DOCTYPE%20html%3E%3Cfont%3E%3Ctable%3E%3C/font%3E%3C/table%3E%3C/font%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E"],"258c0966cc576ec8a563e41e783fa34f6b5c8baf":[async_test('html5lib_tests1.html 258c0966cc576ec8a563e41e783fa34f6b5c8baf'), "%3Cfont%3E%3Cp%3Ehello%3Cb%3Ecruel%3C/font%3Eworld", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%22hello%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22cruel%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22world%22"],"f7ee5b858e93b22e1594d6d8cd0bc0def665ac02":[async_test('html5lib_tests1.html f7ee5b858e93b22e1594d6d8cd0bc0def665ac02'), "%3Cb%3ETest%3C/i%3ETest", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22TestTest%22"],"6d9127103f8733d168e69cf04b576a7b0bea3d5c":[async_test('html5lib_tests1.html 6d9127103f8733d168e69cf04b576a7b0bea3d5c'), "%3Cb%3EA%3Ccite%3EB%3Cdiv%3EC", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22A%22%0A%7C%20%20%20%20%20%20%20%3Ccite%3E%0A%7C%20%20%20%20%20%20%20%20%20%22B%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22C%22"],"03db7399a2d674955930611fdbcaad9f4064243a":[async_test('html5lib_tests1.html 03db7399a2d674955930611fdbcaad9f4064243a'), "%3Cb%3EA%3Ccite%3EB%3Cdiv%3EC%3C/cite%3ED", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22A%22%0A%7C%20%20%20%20%20%20%20%3Ccite%3E%0A%7C%20%20%20%20%20%20%20%20%20%22B%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22CD%22"],"a0a1dcb330314ce12af02d136319a1be6a1ffa53":[async_test('html5lib_tests1.html a0a1dcb330314ce12af02d136319a1be6a1ffa53'), "%3Cb%3EA%3Ccite%3EB%3Cdiv%3EC%3C/b%3ED", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22A%22%0A%7C%20%20%20%20%20%20%20%3Ccite%3E%0A%7C%20%20%20%20%20%20%20%20%20%22B%22%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22C%22%0A%7C%20%20%20%20%20%20%20%22D%22"],"09b3483ef5f7a83aa9e3224d0335b6f9aa78ac73":[async_test('html5lib_tests1.html 09b3483ef5f7a83aa9e3224d0335b6f9aa78ac73'), "", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"34d56f09a1a9c0f51a8abc41be2f157faf0e8d15":[async_test('html5lib_tests1.html 34d56f09a1a9c0f51a8abc41be2f157faf0e8d15'), "%3CDIV%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E"],"dffa0785e6c80af52950a64d8612633de58bbb29":[async_test('html5lib_tests1.html dffa0785e6c80af52950a64d8612633de58bbb29'), "%3CDIV%3E%20abc", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%22"],"076e6ac3cb344d60f6ce9a5188cf103ff053830c":[async_test('html5lib_tests1.html 076e6ac3cb344d60f6ce9a5188cf103ff053830c'), "%3CDIV%3E%20abc%20%3CB%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%20%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E"],"5f14cb9c8502f09105ad83e27842625c70f3857d":[async_test('html5lib_tests1.html 5f14cb9c8502f09105ad83e27842625c70f3857d'), "%3CDIV%3E%20abc%20%3CB%3E%20def", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%20%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20def%22"],"25172f395b855b6eeb61ff95a8162a34ca92195e":[async_test('html5lib_tests1.html 25172f395b855b6eeb61ff95a8162a34ca92195e'), "%3CDIV%3E%20abc%20%3CB%3E%20def%20%3CI%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%20%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20def%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E"],"053beabf01d70d03a0ca61b809d5d986ddf2ea3d":[async_test('html5lib_tests1.html 053beabf01d70d03a0ca61b809d5d986ddf2ea3d'), "%3CDIV%3E%20abc%20%3CB%3E%20def%20%3CI%3E%20ghi", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%20%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20def%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20ghi%22"],"bd385dbe93b192c2182e09e75d3664b96845ea0a":[async_test('html5lib_tests1.html bd385dbe93b192c2182e09e75d3664b96845ea0a'), "%3CDIV%3E%20abc%20%3CB%3E%20def%20%3CI%3E%20ghi%20%3CP%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%20%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20def%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20ghi%20%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E"],"2ddaacb4f4e566ae79af5259f57f5b4dd166c19f":[async_test('html5lib_tests1.html 2ddaacb4f4e566ae79af5259f57f5b4dd166c19f'), "%3CDIV%3E%20abc%20%3CB%3E%20def%20%3CI%3E%20ghi%20%3CP%3E%20jkl", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%20%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20def%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20ghi%20%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22%20jkl%22"],"d430f2fc3bd20e658ed00b55e6c27f14204a7b6f":[async_test('html5lib_tests1.html d430f2fc3bd20e658ed00b55e6c27f14204a7b6f'), "%3CDIV%3E%20abc%20%3CB%3E%20def%20%3CI%3E%20ghi%20%3CP%3E%20jkl%20%3C/B%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%20%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20def%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20ghi%20%22%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22%20jkl%20%22"],"bbdb0a08b66b0789068ddac96a05ac39e104553d":[async_test('html5lib_tests1.html bbdb0a08b66b0789068ddac96a05ac39e104553d'), "%3CDIV%3E%20abc%20%3CB%3E%20def%20%3CI%3E%20ghi%20%3CP%3E%20jkl%20%3C/B%3E%20mno", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%20%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20def%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20ghi%20%22%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22%20jkl%20%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20mno%22"],"37ed2a3a96026e7a78f6675154d11746aa9484e0":[async_test('html5lib_tests1.html 37ed2a3a96026e7a78f6675154d11746aa9484e0'), "%3CDIV%3E%20abc%20%3CB%3E%20def%20%3CI%3E%20ghi%20%3CP%3E%20jkl%20%3C/B%3E%20mno%20%3C/I%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%20%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20def%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20ghi%20%22%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22%20jkl%20%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20mno%20%22"],"4177a74406cf1c048d2d6d6bcf774445f55ba517":[async_test('html5lib_tests1.html 4177a74406cf1c048d2d6d6bcf774445f55ba517'), "%3CDIV%3E%20abc%20%3CB%3E%20def%20%3CI%3E%20ghi%20%3CP%3E%20jkl%20%3C/B%3E%20mno%20%3C/I%3E%20pqr", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%20%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20def%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20ghi%20%22%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22%20jkl%20%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20mno%20%22%0A%7C%20%20%20%20%20%20%20%20%20%22%20pqr%22"],"fc188652d9f486174b21d1919f35ea8c13636ca1":[async_test('html5lib_tests1.html fc188652d9f486174b21d1919f35ea8c13636ca1'), "%3CDIV%3E%20abc%20%3CB%3E%20def%20%3CI%3E%20ghi%20%3CP%3E%20jkl%20%3C/B%3E%20mno%20%3C/I%3E%20pqr%20%3C/P%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%20%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20def%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20ghi%20%22%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22%20jkl%20%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20mno%20%22%0A%7C%20%20%20%20%20%20%20%20%20%22%20pqr%20%22"],"c10f83cc69763e42964e08ddb976a1bd27b51e2f":[async_test('html5lib_tests1.html c10f83cc69763e42964e08ddb976a1bd27b51e2f'), "%3CDIV%3E%20abc%20%3CB%3E%20def%20%3CI%3E%20ghi%20%3CP%3E%20jkl%20%3C/B%3E%20mno%20%3C/I%3E%20pqr%20%3C/P%3E%20stu", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%20abc%20%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20def%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20ghi%20%22%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22%20jkl%20%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20mno%20%22%0A%7C%20%20%20%20%20%20%20%20%20%22%20pqr%20%22%0A%7C%20%20%20%20%20%20%20%22%20stu%22"],"64452c62ced87bd3cd8fd88df33a33d5531818d6":[async_test('html5lib_tests1.html 64452c62ced87bd3cd8fd88df33a33d5531818d6'), "%3Ctest%20attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctest%3E%0A%7C%20%20%20%20%20%20%20attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------%3D%22%22"],"96dc04673021ad113df40397113df972f090c1f6":[async_test('html5lib_tests1.html 96dc04673021ad113df40397113df972f090c1f6'), "%3Ca%20href%3D%22blah%22%3Eaba%3Ctable%3E%3Ca%20href%3D%22foo%22%3Ebr%3Ctr%3E%3Ctd%3E%3C/td%3E%3C/tr%3Ex%3C/table%3Eaoe", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20href%3D%22blah%22%0A%7C%20%20%20%20%20%20%20%22aba%22%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20href%3D%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%22br%22%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20href%3D%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20href%3D%22foo%22%0A%7C%20%20%20%20%20%20%20%22aoe%22"],"26b7eb0b18d9cd0a69d19c7f6ee9f12c2d0b2783":[async_test('html5lib_tests1.html 26b7eb0b18d9cd0a69d19c7f6ee9f12c2d0b2783'), "%3Ca%20href%3D%22blah%22%3Eaba%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Ca%20href%3D%22foo%22%3Ebr%3C/td%3E%3C/tr%3Ex%3C/table%3Eaoe", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20href%3D%22blah%22%0A%7C%20%20%20%20%20%20%20%22abax%22%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20href%3D%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22br%22%0A%7C%20%20%20%20%20%20%20%22aoe%22"],"f8d500cd7089942814fa0751c75bd37e63790685":[async_test('html5lib_tests1.html f8d500cd7089942814fa0751c75bd37e63790685'), "%3Ctable%3E%3Ca%20href%3D%22blah%22%3Eaba%3Ctr%3E%3Ctd%3E%3Ca%20href%3D%22foo%22%3Ebr%3C/td%3E%3C/tr%3Ex%3C/table%3Eaoe", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20href%3D%22blah%22%0A%7C%20%20%20%20%20%20%20%22aba%22%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20href%3D%22blah%22%0A%7C%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20href%3D%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22br%22%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20href%3D%22blah%22%0A%7C%20%20%20%20%20%20%20%22aoe%22"],"3b386c205ec767f842e63491d14ec90192f562dd":[async_test('html5lib_tests1.html 3b386c205ec767f842e63491d14ec90192f562dd'), "%3Ca%20href%3Da%3Eaa%3Cmarquee%3Eaa%3Ca%20href%3Db%3Ebb%3C/marquee%3Eaa", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20href%3D%22a%22%0A%7C%20%20%20%20%20%20%20%22aa%22%0A%7C%20%20%20%20%20%20%20%3Cmarquee%3E%0A%7C%20%20%20%20%20%20%20%20%20%22aa%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20href%3D%22b%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22bb%22%0A%7C%20%20%20%20%20%20%20%22aa%22"],"ca8ecc666a82d1f2f48a095d42d9f95700e015bd":[async_test('html5lib_tests1.html ca8ecc666a82d1f2f48a095d42d9f95700e015bd'), "%3Cwbr%3E%3Cstrike%3E%3Ccode%3E%3C/strike%3E%3Ccode%3E%3Cstrike%3E%3C/code%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cwbr%3E%0A%7C%20%20%20%20%20%3Cstrike%3E%0A%7C%20%20%20%20%20%20%20%3Ccode%3E%0A%7C%20%20%20%20%20%3Ccode%3E%0A%7C%20%20%20%20%20%20%20%3Ccode%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cstrike%3E"],"6727ab7c4240bf05f0a5d9ca4b384ca8d61e2d4f":[async_test('html5lib_tests1.html 6727ab7c4240bf05f0a5d9ca4b384ca8d61e2d4f'), "%3C%21DOCTYPE%20html%3E%3Cspacer%3Efoo", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cspacer%3E%0A%7C%20%20%20%20%20%20%20%22foo%22"],"3ad08edf5b9690be261dc375da3b1d9ec82e499a":[async_test('html5lib_tests1.html 3ad08edf5b9690be261dc375da3b1d9ec82e499a'), "%3Ctitle%3E%3Cmeta%3E%3C/title%3E%3Clink%3E%3Ctitle%3E%3Cmeta%3E%3C/title%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%3Cmeta%3E%22%0A%7C%20%20%20%20%20%3Clink%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%3Cmeta%3E%22%0A%7C%20%20%20%3Cbody%3E"],"06ed0f32cfd261010c9d810ff8317ef96b47c04c":[async_test('html5lib_tests1.html 06ed0f32cfd261010c9d810ff8317ef96b47c04c'), "%3Cstyle%3E%3C%21--%3C/style%3E%3Cmeta%3E%3Cscript%3E--%3E%3Clink%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22--%3E%3Clink%3E%22%0A%7C%20%20%20%3Cbody%3E"],"44ea84c7e4e401c9d3f96d7cc39709e4be81edc8":[async_test('html5lib_tests1.html 44ea84c7e4e401c9d3f96d7cc39709e4be81edc8'), "%3Chead%3E%3Cmeta%3E%3C/head%3E%3Clink%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%3Clink%3E%0A%7C%20%20%20%3Cbody%3E"],"67af290f1b04c4b1a67131edba1ee832c690432c":[async_test('html5lib_tests1.html 67af290f1b04c4b1a67131edba1ee832c690432c'), "%3Ctable%3E%3Ctr%3E%3Ctr%3E%3Ctd%3E%3Ctd%3E%3Cspan%3E%3Cth%3E%3Cspan%3EX%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cth%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22X%22"],"2f1899f72fafcb062418e8ce892188040de4708c":[async_test('html5lib_tests1.html 2f1899f72fafcb062418e8ce892188040de4708c'), "%3Cbody%3E%3Cbody%3E%3Cbase%3E%3Clink%3E%3Cmeta%3E%3Ctitle%3E%3Cp%3E%3C/title%3E%3Cbody%3E%3Cp%3E%3C/body%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbase%3E%0A%7C%20%20%20%20%20%3Clink%3E%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%3Cp%3E%22%0A%7C%20%20%20%20%20%3Cp%3E"],"ed2a4958c832ef6cec993cb52afc808132714d0a":[async_test('html5lib_tests1.html ed2a4958c832ef6cec993cb52afc808132714d0a'), "%3Ctextarea%3E%3Cp%3E%3C/textarea%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22%3Cp%3E%22"],"c7943ccd9d880664b0894a2035e1f2a837f37c7a":[async_test('html5lib_tests1.html c7943ccd9d880664b0894a2035e1f2a837f37c7a'), "%3Cp%3E%3Cimage%3E%3C/p%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cimg%3E"],"bbc836b1f494223d4eb8982930d693489d135740":[async_test('html5lib_tests1.html bbc836b1f494223d4eb8982930d693489d135740'), "%3Ca%3E%3Ctable%3E%3Ca%3E%3C/table%3E%3Cp%3E%3Ca%3E%3Cdiv%3E%3Ca%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E"],"617fdf08035740698b2f0f4c3874dbb469fd1848":[async_test('html5lib_tests1.html 617fdf08035740698b2f0f4c3874dbb469fd1848'), "%3Chead%3E%3C/p%3E%3Cmeta%3E%3Cp%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E"],"e901fe2093e51eccb4d9d23103214bc527af265c":[async_test('html5lib_tests1.html e901fe2093e51eccb4d9d23103214bc527af265c'), "%3Chead%3E%3C/html%3E%3Cmeta%3E%3Cp%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%3Cp%3E"],"63970995ab6b8aee63de9e7a7667178d4fc86820":[async_test('html5lib_tests1.html 63970995ab6b8aee63de9e7a7667178d4fc86820'), "%3Cb%3E%3Ctable%3E%3Ctd%3E%3C/b%3E%3Ci%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E"],"d7607fdd41625431bcbee319a86db1b73fc49edd":[async_test('html5lib_tests1.html d7607fdd41625431bcbee319a86db1b73fc49edd'), "%3Ch1%3E%3Ch2%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ch1%3E%0A%7C%20%20%20%20%20%3Ch2%3E"],"ce31a583a3921e306aaa558b1ea798b34d2bb0dc":[async_test('html5lib_tests1.html ce31a583a3921e306aaa558b1ea798b34d2bb0dc'), "%3Ca%3E%3Cp%3E%3Ca%3E%3C/a%3E%3C/p%3E%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E"],"04ba864e740f7ef104570ddc6af834e6336031ed":[async_test('html5lib_tests1.html 04ba864e740f7ef104570ddc6af834e6336031ed'), "%3Cb%3E%3Cbutton%3E%3C/b%3E%3C/button%3E%3C/b%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E"],"ea6ab4a56efd19cc04b5656583ea6d5c9cfd2752":[async_test('html5lib_tests1.html ea6ab4a56efd19cc04b5656583ea6d5c9cfd2752'), "%3Cp%3E%3Cb%3E%3Cdiv%3E%3Cmarquee%3E%3C/p%3E%3C/b%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmarquee%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E"],"1bb5dfba014f63c0a18b12097ed9a28d64552e07":[async_test('html5lib_tests1.html 1bb5dfba014f63c0a18b12097ed9a28d64552e07'), "%3Cscript%3E%3C/script%3E%3C/div%3E%3Ctitle%3E%3C/title%3E%3Cp%3E%3Cp%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Cp%3E"],"a2dd4d5a28a61ec99ce9dae35e9d4ffe92812e2f":[async_test('html5lib_tests1.html a2dd4d5a28a61ec99ce9dae35e9d4ffe92812e2f'), "%3Cselect%3E%3Cb%3E%3Coption%3E%3Cselect%3E%3Coption%3E%3C/b%3E%3C/select%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%3Coption%3E"],"e26f001557952154c308e3e6f6d1789cf711ef27":[async_test('html5lib_tests1.html e26f001557952154c308e3e6f6d1789cf711ef27'), "%3Chtml%3E%3Chead%3E%3Ctitle%3E%3C/title%3E%3Cbody%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%3Cbody%3E"],"34c1f9c212198edd7baf56e658db21d98c59f74c":[async_test('html5lib_tests1.html 34c1f9c212198edd7baf56e658db21d98c59f74c'), "%3Ca%3E%3Ctable%3E%3Ctd%3E%3Ca%3E%3Ctable%3E%3C/table%3E%3Ca%3E%3C/tr%3E%3Ca%3E%3C/table%3E%3Ca%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Ca%3E"],"e1c47adbde197e3eaa9504f3582fd9deac1cbbff":[async_test('html5lib_tests1.html e1c47adbde197e3eaa9504f3582fd9deac1cbbff'), "%3Cul%3E%3Cli%3E%3C/li%3E%3Cdiv%3E%3Cli%3E%3C/div%3E%3Cli%3E%3Cli%3E%3Cdiv%3E%3Cli%3E%3Caddress%3E%3Cli%3E%3Cb%3E%3Cem%3E%3C/b%3E%3Cli%3E%3C/ul%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cul%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Caddress%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cem%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E"],"0f5aba4c1ed57ac3c6a2774f3bf43ef598bd9915":[async_test('html5lib_tests1.html 0f5aba4c1ed57ac3c6a2774f3bf43ef598bd9915'), "%3Cul%3E%3Cli%3E%3Cul%3E%3C/li%3E%3Cli%3Ea%3C/li%3E%3C/ul%3E%3C/li%3E%3C/ul%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cul%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cul%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"d11ff75681c4df2ff24ad731ff244afc3e1c87af":[async_test('html5lib_tests1.html d11ff75681c4df2ff24ad731ff244afc3e1c87af'), "%3Cframeset%3E%3Cframe%3E%3Cframeset%3E%3Cframe%3E%3C/frameset%3E%3Cnoframes%3E%3C/noframes%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%3Cframe%3E%0A%7C%20%20%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%20%20%3Cframe%3E%0A%7C%20%20%20%20%20%3Cnoframes%3E"],"fa392f5dd6f2f6a73635c06208c8989caa874588":[async_test('html5lib_tests1.html fa392f5dd6f2f6a73635c06208c8989caa874588'), "%3Ch1%3E%3Ctable%3E%3Ctd%3E%3Ch3%3E%3C/table%3E%3Ch3%3E%3C/h1%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ch1%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ch3%3E%0A%7C%20%20%20%20%20%3Ch3%3E"],"5815b2afbb0a7f4756af7914407f71f469658f38":[async_test('html5lib_tests1.html 5815b2afbb0a7f4756af7914407f71f469658f38'), "%3Ctable%3E%3Ccolgroup%3E%3Ccol%3E%3Ccolgroup%3E%3Ccol%3E%3Ccol%3E%3Ccol%3E%3Ccolgroup%3E%3Ccol%3E%3Ccol%3E%3Cthead%3E%3Ctr%3E%3Ctd%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%3Cthead%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"a100bb6a2a80bec65c418d672144b6f647fbd46b":[async_test('html5lib_tests1.html a100bb6a2a80bec65c418d672144b6f647fbd46b'), "%3Ctable%3E%3Ccol%3E%3Ctbody%3E%3Ccol%3E%3Ctr%3E%3Ccol%3E%3Ctd%3E%3Ccol%3E%3C/table%3E%3Ccol%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccol%3E"],"f66797fd63c8b0254b4ef28e9c38c3d4e512c93c":[async_test('html5lib_tests1.html f66797fd63c8b0254b4ef28e9c38c3d4e512c93c'), "%3Ctable%3E%3Ccolgroup%3E%3Ctbody%3E%3Ccolgroup%3E%3Ctr%3E%3Ccolgroup%3E%3Ctd%3E%3Ccolgroup%3E%3C/table%3E%3Ccolgroup%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E"],"f10a41faca4cf01e39ed92c4eefff0631d1195dc":[async_test('html5lib_tests1.html f10a41faca4cf01e39ed92c4eefff0631d1195dc'), "%3C/strong%3E%3C/b%3E%3C/em%3E%3C/i%3E%3C/u%3E%3C/strike%3E%3C/s%3E%3C/blink%3E%3C/tt%3E%3C/pre%3E%3C/big%3E%3C/small%3E%3C/font%3E%3C/select%3E%3C/h1%3E%3C/h2%3E%3C/h3%3E%3C/h4%3E%3C/h5%3E%3C/h6%3E%3C/body%3E%3C/br%3E%3C/a%3E%3C/img%3E%3C/title%3E%3C/span%3E%3C/style%3E%3C/script%3E%3C/table%3E%3C/th%3E%3C/td%3E%3C/tr%3E%3C/frame%3E%3C/area%3E%3C/link%3E%3C/param%3E%3C/hr%3E%3C/input%3E%3C/col%3E%3C/base%3E%3C/meta%3E%3C/basefont%3E%3C/bgsound%3E%3C/embed%3E%3C/spacer%3E%3C/p%3E%3C/dd%3E%3C/dt%3E%3C/caption%3E%3C/colgroup%3E%3C/tbody%3E%3C/tfoot%3E%3C/thead%3E%3C/address%3E%3C/blockquote%3E%3C/center%3E%3C/dir%3E%3C/div%3E%3C/dl%3E%3C/fieldset%3E%3C/listing%3E%3C/menu%3E%3C/ol%3E%3C/ul%3E%3C/li%3E%3C/nobr%3E%3C/wbr%3E%3C/form%3E%3C/button%3E%3C/marquee%3E%3C/object%3E%3C/html%3E%3C/frameset%3E%3C/head%3E%3C/iframe%3E%3C/image%3E%3C/isindex%3E%3C/noembed%3E%3C/noframes%3E%3C/noscript%3E%3C/optgroup%3E%3C/option%3E%3C/plaintext%3E%3C/textarea%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbr%3E%0A%7C%20%20%20%20%20%3Cp%3E"],"5d14e20ae19e0b3e14dcb997e3ccad5f0e1956e1":[async_test('html5lib_tests1.html 5d14e20ae19e0b3e14dcb997e3ccad5f0e1956e1'), "%3Ctable%3E%3Ctr%3E%3C/strong%3E%3C/b%3E%3C/em%3E%3C/i%3E%3C/u%3E%3C/strike%3E%3C/s%3E%3C/blink%3E%3C/tt%3E%3C/pre%3E%3C/big%3E%3C/small%3E%3C/font%3E%3C/select%3E%3C/h1%3E%3C/h2%3E%3C/h3%3E%3C/h4%3E%3C/h5%3E%3C/h6%3E%3C/body%3E%3C/br%3E%3C/a%3E%3C/img%3E%3C/title%3E%3C/span%3E%3C/style%3E%3C/script%3E%3C/table%3E%3C/th%3E%3C/td%3E%3C/tr%3E%3C/frame%3E%3C/area%3E%3C/link%3E%3C/param%3E%3C/hr%3E%3C/input%3E%3C/col%3E%3C/base%3E%3C/meta%3E%3C/basefont%3E%3C/bgsound%3E%3C/embed%3E%3C/spacer%3E%3C/p%3E%3C/dd%3E%3C/dt%3E%3C/caption%3E%3C/colgroup%3E%3C/tbody%3E%3C/tfoot%3E%3C/thead%3E%3C/address%3E%3C/blockquote%3E%3C/center%3E%3C/dir%3E%3C/div%3E%3C/dl%3E%3C/fieldset%3E%3C/listing%3E%3C/menu%3E%3C/ol%3E%3C/ul%3E%3C/li%3E%3C/nobr%3E%3C/wbr%3E%3C/form%3E%3C/button%3E%3C/marquee%3E%3C/object%3E%3C/html%3E%3C/frameset%3E%3C/head%3E%3C/iframe%3E%3C/image%3E%3C/isindex%3E%3C/noembed%3E%3C/noframes%3E%3C/noscript%3E%3C/optgroup%3E%3C/option%3E%3C/plaintext%3E%3C/textarea%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbr%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%3Cp%3E"],"1949f8c612e660985fb5eb28235b6f9386ed4ffc":[async_test('html5lib_tests1.html 1949f8c612e660985fb5eb28235b6f9386ed4ffc'), "%3Cframeset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests10.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests10.html
new file mode 100644
index 000000000..26411582b
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests10.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests10.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['33cab27b810c8329105a4447f7767307577cb52f','b833b22c2ce59749e320b26fbc4d277bc015f261','5159857bc8326870c92e525f000abe74b51f9104','fee2541ab7080ca5b363bb4b7b0c18ee1d3699ba','679fbaa80e9d15416f17eb041a8fe04c373f0e12','0fe5609efd1436590d64aa7f47643fcaf1decc9c','7900ad087a3da10cbd7eb3eae57181ca7e417f0e','52f78e3d4b60a998fe249f7c026078f13ef65fe3','01dd3726b85de9278486adaf23c7cd553ea701b0','c993a3cf01522d1b958e942f781c535bd63e7f43','3f8ac796f286506aa56f87a8b430c4d6d2802695','df1f29ea6a1d57e029cdb95216b85e9daac07ad0','ae19484ce5b8e2087e3df7f13183622d2cf059a7','7f9c4aeecce3bbf1483104213487a506cfdc6650','219f8f9866ad87d2e98f0cbbf35e0d7070848f81','a1e3a3515da712da9fa9bae0ab874a0a31207e6b','badaa2069df3f2bb2d2da79f8ae2598f66ab2d0f','64e72bd5af825a0b014a78c77d6d0be8c330892b','6b6728b11b3f67a6b67e0dec03222222783e2c40','c16f6e833fafc8e96c4d888aace5e7df190f8bb5','8b5cc06ce9513c4b0b2be26adad3357c79a10241','f396d620bf4e128981156d61f4768634c407c806','3c262f2c74c6cf5519cfad9440e118dd36fcc37f','4e788a289a02c283f0a7b71340f4947c30fd289e','b0a2a300705d9a5b6ceb8f7b9d4d240a9eb9f9e0','2e92f741697be25c07416f7885b7decc0684c874','3cffa6d987cfd48c6cd5f9e7d198ca0e79b6cdb8','f89f8c14aeaa1d3107b6aa6d87fbf10e8fd5f8c3','663691222288a8f734149fba4f1b7ff5bb201df0','dbe5123aed0264b7fe421fea4b9bc5bd304cc596','982e01ebddec435aeb2dc0f23fa77e4201a38b28','b613b907ffa87da6f3076a24ad775843e5c2a43a','4553fc5ae2782aef4100d8db614041e42c3612e9','6c10b9811a0d228cf26bc0b55ee12c7d99926270','ee2de7753d6594fbf05d321b24e2c8bb6f2323c6','225170b3f08201a11d43f153fa3c8a041173b55f','716a01ee7d076876318395625e08e555065fc3b0','3c5cc236386d2d4a16d14e5c65da7edd26697a43','6c3447a16060d2805f8c969ec0a7b5c551468f25','071f13f248eb7af8f7d512cf453b16c8ccc57483','0ef97c924e3e5e8ddf8a0bc74530868684685c38','25a94dd91d982fa75c89944ad8f066f7961c590b','575adfd2e679ad44140d8afd131fee2e5e819fc0','2eb6893275ff1de69569440710f5588b8558ca17','4f57b212888bfcc7ac6d8e29ef444cc7ae3ec495','c069a88f172919c862432dbef290a425e71414aa','f944f978d6a10ec9f194f03a5e232f9663d96ec1','d5ab79a14609f3ed214baa8e02bedb54ddcf33ec','4318bf46f0256426716a911e194f9bdf6185bd7c','aa5c4b093ee603618493cff853af125b5fb0d401','bfd98674d75ff3291d377f2a7cec3321844a0701','7fc99b729a6d57d28b2ad1edc33bb15167e051bb','8e87f0d5ca606ca162384d1bf3bb8de62bd6f398','6476f80f3d2a04e9c1323ffe78686188c579e9ac',];
+ var tests = {
+ "33cab27b810c8329105a4447f7767307577cb52f":[async_test('html5lib_tests10.html 33cab27b810c8329105a4447f7767307577cb52f'), "%3C%21DOCTYPE%20html%3E%3Csvg%3E%3C/svg%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E"],"b833b22c2ce59749e320b26fbc4d277bc015f261":[async_test('html5lib_tests10.html b833b22c2ce59749e320b26fbc4d277bc015f261'), "%3C%21DOCTYPE%20html%3E%3Csvg%3E%3C/svg%3E%3C%21%5BCDATA%5Ba%5D%5D%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%3C%21--%20%5BCDATA%5Ba%5D%5D%20--%3E"],"5159857bc8326870c92e525f000abe74b51f9104":[async_test('html5lib_tests10.html 5159857bc8326870c92e525f000abe74b51f9104'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Csvg%3E%3C/svg%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E"],"fee2541ab7080ca5b363bb4b7b0c18ee1d3699ba":[async_test('html5lib_tests10.html fee2541ab7080ca5b363bb4b7b0c18ee1d3699ba'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cselect%3E%3Csvg%3E%3C/svg%3E%3C/select%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"679fbaa80e9d15416f17eb041a8fe04c373f0e12":[async_test('html5lib_tests10.html 679fbaa80e9d15416f17eb041a8fe04c373f0e12'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cselect%3E%3Coption%3E%3Csvg%3E%3C/svg%3E%3C/option%3E%3C/select%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E"],"0fe5609efd1436590d64aa7f47643fcaf1decc9c":[async_test('html5lib_tests10.html 0fe5609efd1436590d64aa7f47643fcaf1decc9c'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Csvg%3E%3C/svg%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%3Ctable%3E"],"7900ad087a3da10cbd7eb3eae57181ca7e417f0e":[async_test('html5lib_tests10.html 7900ad087a3da10cbd7eb3eae57181ca7e417f0e'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3C/svg%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"52f78e3d4b60a998fe249f7c026078f13ef65fe3":[async_test('html5lib_tests10.html 52f78e3d4b60a998fe249f7c026078f13ef65fe3'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3E%3C/svg%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"01dd3726b85de9278486adaf23c7cd553ea701b0":[async_test('html5lib_tests10.html 01dd3726b85de9278486adaf23c7cd553ea701b0'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ctbody%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3E%3C/svg%3E%3C/tbody%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E"],"c993a3cf01522d1b958e942f781c535bd63e7f43":[async_test('html5lib_tests10.html c993a3cf01522d1b958e942f781c535bd63e7f43'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ctbody%3E%3Ctr%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3E%3C/svg%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"3f8ac796f286506aa56f87a8b430c4d6d2802695":[async_test('html5lib_tests10.html 3f8ac796f286506aa56f87a8b430c4d6d2802695'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ctbody%3E%3Ctr%3E%3Ctd%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3E%3C/svg%3E%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22bar%22"],"df1f29ea6a1d57e029cdb95216b85e9daac07ad0":[async_test('html5lib_tests10.html df1f29ea6a1d57e029cdb95216b85e9daac07ad0'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ctbody%3E%3Ctr%3E%3Ctd%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3E%3C/svg%3E%3Cp%3Ebaz%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22baz%22"],"ae19484ce5b8e2087e3df7f13183622d2cf059a7":[async_test('html5lib_tests10.html ae19484ce5b8e2087e3df7f13183622d2cf059a7'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ccaption%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3E%3C/svg%3E%3Cp%3Ebaz%3C/caption%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22baz%22"],"7f9c4aeecce3bbf1483104213487a506cfdc6650":[async_test('html5lib_tests10.html 7f9c4aeecce3bbf1483104213487a506cfdc6650'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ccaption%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3E%3Cp%3Ebaz%3C/table%3E%3Cp%3Equux", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22baz%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22quux%22"],"219f8f9866ad87d2e98f0cbbf35e0d7070848f81":[async_test('html5lib_tests10.html 219f8f9866ad87d2e98f0cbbf35e0d7070848f81'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ccaption%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3Ebaz%3C/table%3E%3Cp%3Equux", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22baz%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22quux%22"],"a1e3a3515da712da9fa9bae0ab874a0a31207e6b":[async_test('html5lib_tests10.html a1e3a3515da712da9fa9bae0ab874a0a31207e6b'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ccolgroup%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3E%3Cp%3Ebaz%3C/table%3E%3Cp%3Equux", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22baz%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22quux%22"],"badaa2069df3f2bb2d2da79f8ae2598f66ab2d0f":[async_test('html5lib_tests10.html badaa2069df3f2bb2d2da79f8ae2598f66ab2d0f'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Cselect%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3E%3Cp%3Ebaz%3C/table%3E%3Cp%3Equux", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22foobarbaz%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22quux%22"],"64e72bd5af825a0b014a78c77d6d0be8c330892b":[async_test('html5lib_tests10.html 64e72bd5af825a0b014a78c77d6d0be8c330892b'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Cselect%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3E%3Cp%3Ebaz%3C/table%3E%3Cp%3Equux", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%22foobarbaz%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22quux%22"],"6b6728b11b3f67a6b67e0dec03222222783e2c40":[async_test('html5lib_tests10.html 6b6728b11b3f67a6b67e0dec03222222783e2c40'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3C/body%3E%3C/html%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3E%3Cp%3Ebaz", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22baz%22"],"c16f6e833fafc8e96c4d888aace5e7df190f8bb5":[async_test('html5lib_tests10.html c16f6e833fafc8e96c4d888aace5e7df190f8bb5'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3C/body%3E%3Csvg%3E%3Cg%3Efoo%3C/g%3E%3Cg%3Ebar%3C/g%3E%3Cp%3Ebaz", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22baz%22"],"8b5cc06ce9513c4b0b2be26adad3357c79a10241":[async_test('html5lib_tests10.html 8b5cc06ce9513c4b0b2be26adad3357c79a10241'), "%3C%21DOCTYPE%20html%3E%3Cframeset%3E%3Csvg%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cp%3E%3Cspan%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"f396d620bf4e128981156d61f4768634c407c806":[async_test('html5lib_tests10.html f396d620bf4e128981156d61f4768634c407c806'), "%3C%21DOCTYPE%20html%3E%3Cframeset%3E%3C/frameset%3E%3Csvg%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cp%3E%3Cspan%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"3c262f2c74c6cf5519cfad9440e118dd36fcc37f":[async_test('html5lib_tests10.html 3c262f2c74c6cf5519cfad9440e118dd36fcc37f'), "%3C%21DOCTYPE%20html%3E%3Cbody%20xlink%3Ahref%3Dfoo%3E%3Csvg%20xlink%3Ahref%3Dfoo%3E%3C/svg%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20xlink%3Ahref%3D%22foo%22%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20xlink%20href%3D%22foo%22"],"4e788a289a02c283f0a7b71340f4947c30fd289e":[async_test('html5lib_tests10.html 4e788a289a02c283f0a7b71340f4947c30fd289e'), "%3C%21DOCTYPE%20html%3E%3Cbody%20xlink%3Ahref%3Dfoo%20xml%3Alang%3Den%3E%3Csvg%3E%3Cg%20xml%3Alang%3Den%20xlink%3Ahref%3Dfoo%3E%3C/g%3E%3C/svg%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20xlink%3Ahref%3D%22foo%22%0A%7C%20%20%20%20%20xml%3Alang%3D%22en%22%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20xlink%20href%3D%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20xml%20lang%3D%22en%22"],"b0a2a300705d9a5b6ceb8f7b9d4d240a9eb9f9e0":[async_test('html5lib_tests10.html b0a2a300705d9a5b6ceb8f7b9d4d240a9eb9f9e0'), "%3C%21DOCTYPE%20html%3E%3Cbody%20xlink%3Ahref%3Dfoo%20xml%3Alang%3Den%3E%3Csvg%3E%3Cg%20xml%3Alang%3Den%20xlink%3Ahref%3Dfoo%20/%3E%3C/svg%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20xlink%3Ahref%3D%22foo%22%0A%7C%20%20%20%20%20xml%3Alang%3D%22en%22%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20xlink%20href%3D%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20xml%20lang%3D%22en%22"],"2e92f741697be25c07416f7885b7decc0684c874":[async_test('html5lib_tests10.html 2e92f741697be25c07416f7885b7decc0684c874'), "%3C%21DOCTYPE%20html%3E%3Cbody%20xlink%3Ahref%3Dfoo%20xml%3Alang%3Den%3E%3Csvg%3E%3Cg%20xml%3Alang%3Den%20xlink%3Ahref%3Dfoo%20/%3Ebar%3C/svg%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20xlink%3Ahref%3D%22foo%22%0A%7C%20%20%20%20%20xml%3Alang%3D%22en%22%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20xlink%20href%3D%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20xml%20lang%3D%22en%22%0A%7C%20%20%20%20%20%20%20%22bar%22"],"3cffa6d987cfd48c6cd5f9e7d198ca0e79b6cdb8":[async_test('html5lib_tests10.html 3cffa6d987cfd48c6cd5f9e7d198ca0e79b6cdb8'), "%3Csvg%3E%3C/path%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E"],"f89f8c14aeaa1d3107b6aa6d87fbf10e8fd5f8c3":[async_test('html5lib_tests10.html f89f8c14aeaa1d3107b6aa6d87fbf10e8fd5f8c3'), "%3Cdiv%3E%3Csvg%3E%3C/div%3Ea", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%22a%22"],"663691222288a8f734149fba4f1b7ff5bb201df0":[async_test('html5lib_tests10.html 663691222288a8f734149fba4f1b7ff5bb201df0'), "%3Cdiv%3E%3Csvg%3E%3Cpath%3E%3C/div%3Ea", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20path%3E%0A%7C%20%20%20%20%20%22a%22"],"dbe5123aed0264b7fe421fea4b9bc5bd304cc596":[async_test('html5lib_tests10.html dbe5123aed0264b7fe421fea4b9bc5bd304cc596'), "%3Cdiv%3E%3Csvg%3E%3Cpath%3E%3C/svg%3E%3Cpath%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20path%3E%0A%7C%20%20%20%20%20%20%20%3Cpath%3E"],"982e01ebddec435aeb2dc0f23fa77e4201a38b28":[async_test('html5lib_tests10.html 982e01ebddec435aeb2dc0f23fa77e4201a38b28'), "%3Cdiv%3E%3Csvg%3E%3Cpath%3E%3CforeignObject%3E%3Cmath%3E%3C/div%3Ea", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20path%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"b613b907ffa87da6f3076a24ad775843e5c2a43a":[async_test('html5lib_tests10.html b613b907ffa87da6f3076a24ad775843e5c2a43a'), "%3Cdiv%3E%3Csvg%3E%3Cpath%3E%3CforeignObject%3E%3Cp%3E%3C/div%3Ea", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20path%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"4553fc5ae2782aef4100d8db614041e42c3612e9":[async_test('html5lib_tests10.html 4553fc5ae2782aef4100d8db614041e42c3612e9'), "%3C%21DOCTYPE%20html%3E%3Csvg%3E%3Cdesc%3E%3Cdiv%3E%3Csvg%3E%3Cul%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20desc%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cul%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"6c10b9811a0d228cf26bc0b55ee12c7d99926270":[async_test('html5lib_tests10.html 6c10b9811a0d228cf26bc0b55ee12c7d99926270'), "%3C%21DOCTYPE%20html%3E%3Csvg%3E%3Cdesc%3E%3Csvg%3E%3Cul%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20desc%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cul%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"ee2de7753d6594fbf05d321b24e2c8bb6f2323c6":[async_test('html5lib_tests10.html ee2de7753d6594fbf05d321b24e2c8bb6f2323c6'), "%3C%21DOCTYPE%20html%3E%3Cp%3E%3Csvg%3E%3Cdesc%3E%3Cp%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20desc%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E"],"225170b3f08201a11d43f153fa3c8a041173b55f":[async_test('html5lib_tests10.html 225170b3f08201a11d43f153fa3c8a041173b55f'), "%3C%21DOCTYPE%20html%3E%3Cp%3E%3Csvg%3E%3Ctitle%3E%3Cp%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20title%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E"],"716a01ee7d076876318395625e08e555065fc3b0":[async_test('html5lib_tests10.html 716a01ee7d076876318395625e08e555065fc3b0'), "%3Cdiv%3E%3Csvg%3E%3Cpath%3E%3CforeignObject%3E%3Cp%3E%3C/foreignObject%3E%3Cp%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20path%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E"],"3c5cc236386d2d4a16d14e5c65da7edd26697a43":[async_test('html5lib_tests10.html 3c5cc236386d2d4a16d14e5c65da7edd26697a43'), "%3Cmath%3E%3Cmi%3E%3Cdiv%3E%3Cobject%3E%3Cdiv%3E%3Cspan%3E%3C/span%3E%3C/div%3E%3C/object%3E%3C/div%3E%3C/mi%3E%3Cmi%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cobject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E"],"6c3447a16060d2805f8c969ec0a7b5c551468f25":[async_test('html5lib_tests10.html 6c3447a16060d2805f8c969ec0a7b5c551468f25'), "%3Cmath%3E%3Cmi%3E%3Csvg%3E%3CforeignObject%3E%3Cdiv%3E%3Cdiv%3E%3C/div%3E%3C/div%3E%3C/foreignObject%3E%3C/svg%3E%3C/mi%3E%3Cmi%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E"],"071f13f248eb7af8f7d512cf453b16c8ccc57483":[async_test('html5lib_tests10.html 071f13f248eb7af8f7d512cf453b16c8ccc57483'), "%3Csvg%3E%3Cscript%3E%3C/script%3E%3Cpath%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20script%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20path%3E"],"0ef97c924e3e5e8ddf8a0bc74530868684685c38":[async_test('html5lib_tests10.html 0ef97c924e3e5e8ddf8a0bc74530868684685c38'), "%3Ctable%3E%3Csvg%3E%3C/svg%3E%3Ctr%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"25a94dd91d982fa75c89944ad8f066f7961c590b":[async_test('html5lib_tests10.html 25a94dd91d982fa75c89944ad8f066f7961c590b'), "%3Cmath%3E%3Cmi%3E%3Cmglyph%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mglyph%3E"],"575adfd2e679ad44140d8afd131fee2e5e819fc0":[async_test('html5lib_tests10.html 575adfd2e679ad44140d8afd131fee2e5e819fc0'), "%3Cmath%3E%3Cmi%3E%3Cmalignmark%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20malignmark%3E"],"2eb6893275ff1de69569440710f5588b8558ca17":[async_test('html5lib_tests10.html 2eb6893275ff1de69569440710f5588b8558ca17'), "%3Cmath%3E%3Cmo%3E%3Cmglyph%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mo%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mglyph%3E"],"4f57b212888bfcc7ac6d8e29ef444cc7ae3ec495":[async_test('html5lib_tests10.html 4f57b212888bfcc7ac6d8e29ef444cc7ae3ec495'), "%3Cmath%3E%3Cmo%3E%3Cmalignmark%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mo%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20malignmark%3E"],"c069a88f172919c862432dbef290a425e71414aa":[async_test('html5lib_tests10.html c069a88f172919c862432dbef290a425e71414aa'), "%3Cmath%3E%3Cmn%3E%3Cmglyph%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mn%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mglyph%3E"],"f944f978d6a10ec9f194f03a5e232f9663d96ec1":[async_test('html5lib_tests10.html f944f978d6a10ec9f194f03a5e232f9663d96ec1'), "%3Cmath%3E%3Cmn%3E%3Cmalignmark%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mn%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20malignmark%3E"],"d5ab79a14609f3ed214baa8e02bedb54ddcf33ec":[async_test('html5lib_tests10.html d5ab79a14609f3ed214baa8e02bedb54ddcf33ec'), "%3Cmath%3E%3Cms%3E%3Cmglyph%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20ms%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mglyph%3E"],"4318bf46f0256426716a911e194f9bdf6185bd7c":[async_test('html5lib_tests10.html 4318bf46f0256426716a911e194f9bdf6185bd7c'), "%3Cmath%3E%3Cms%3E%3Cmalignmark%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20ms%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20malignmark%3E"],"aa5c4b093ee603618493cff853af125b5fb0d401":[async_test('html5lib_tests10.html aa5c4b093ee603618493cff853af125b5fb0d401'), "%3Cmath%3E%3Cmtext%3E%3Cmglyph%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mtext%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mglyph%3E"],"bfd98674d75ff3291d377f2a7cec3321844a0701":[async_test('html5lib_tests10.html bfd98674d75ff3291d377f2a7cec3321844a0701'), "%3Cmath%3E%3Cmtext%3E%3Cmalignmark%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mtext%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20malignmark%3E"],"7fc99b729a6d57d28b2ad1edc33bb15167e051bb":[async_test('html5lib_tests10.html 7fc99b729a6d57d28b2ad1edc33bb15167e051bb'), "%3Cmath%3E%3Cannotation-xml%3E%3Csvg%3E%3C/svg%3E%3C/annotation-xml%3E%3Cmi%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E"],"8e87f0d5ca606ca162384d1bf3bb8de62bd6f398":[async_test('html5lib_tests10.html 8e87f0d5ca606ca162384d1bf3bb8de62bd6f398'), "%3Cmath%3E%3Cannotation-xml%3E%3Csvg%3E%3CforeignObject%3E%3Cdiv%3E%3Cmath%3E%3Cmi%3E%3C/mi%3E%3C/math%3E%3Cspan%3E%3C/span%3E%3C/div%3E%3C/foreignObject%3E%3Cpath%3E%3C/path%3E%3C/svg%3E%3C/annotation-xml%3E%3Cmi%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20path%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E"],"6476f80f3d2a04e9c1323ffe78686188c579e9ac":[async_test('html5lib_tests10.html 6476f80f3d2a04e9c1323ffe78686188c579e9ac'), "%3Cmath%3E%3Cannotation-xml%3E%3Csvg%3E%3CforeignObject%3E%3Cmath%3E%3Cmi%3E%3Csvg%3E%3C/svg%3E%3C/mi%3E%3Cmo%3E%3C/mo%3E%3C/math%3E%3Cspan%3E%3C/span%3E%3C/foreignObject%3E%3Cpath%3E%3C/path%3E%3C/svg%3E%3C/annotation-xml%3E%3Cmi%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mo%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20path%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests11.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests11.html
new file mode 100644
index 000000000..e21b0328a
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests11.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests11.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['d3a8de194ffc676baf08142bcda59ba18dcde2ba','7ab36bc30d0d6bee4be899f13baed214e1ff0a74','45b6adfc38d306084d105aa7779a3b4fb83c031f','b6ce0d4b36700a2f000199109155d1869f3c8d2f','39c50f080b2b9ae9e7a1070679ab97d7b814f9ec','6d1fa1599f75625fe4d019abb04a064cf6ed39e8','791437ece7ba684e00162d1dd79dfe540e3621a7','af40d26164229c29b9be77ed6dd7dda780cba55c','16e68d18f8f0fb81013fe77a30b7d396c5081e5e',];
+ var tests = {
+ "d3a8de194ffc676baf08142bcda59ba18dcde2ba":[async_test('html5lib_tests11.html d3a8de194ffc676baf08142bcda59ba18dcde2ba'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Csvg%20attributeName%3D%27%27%20attributeType%3D%27%27%20baseFrequency%3D%27%27%20baseProfile%3D%27%27%20calcMode%3D%27%27%20clipPathUnits%3D%27%27%20contentScriptType%3D%27%27%20contentStyleType%3D%27%27%20diffuseConstant%3D%27%27%20edgeMode%3D%27%27%20externalResourcesRequired%3D%27%27%20filterRes%3D%27%27%20filterUnits%3D%27%27%20glyphRef%3D%27%27%20gradientTransform%3D%27%27%20gradientUnits%3D%27%27%20kernelMatrix%3D%27%27%20kernelUnitLength%3D%27%27%20keyPoints%3D%27%27%20keySplines%3D%27%27%20keyTimes%3D%27%27%20lengthAdjust%3D%27%27%20limitingConeAngle%3D%27%27%20markerHeight%3D%27%27%20markerUnits%3D%27%27%20markerWidth%3D%27%27%20maskContentUnits%3D%27%27%20maskUnits%3D%27%27%20numOctaves%3D%27%27%20pathLength%3D%27%27%20patternContentUnits%3D%27%27%20patternTransform%3D%27%27%20patternUnits%3D%27%27%20pointsAtX%3D%27%27%20pointsAtY%3D%27%27%20pointsAtZ%3D%27%27%20preserveAlpha%3D%27%27%20preserveAspectRatio%3D%27%27%20primitiveUnits%3D%27%27%20refX%3D%27%27%20refY%3D%27%27%20repeatCount%3D%27%27%20repeatDur%3D%27%27%20requiredExtensions%3D%27%27%20requiredFeatures%3D%27%27%20specularConstant%3D%27%27%20specularExponent%3D%27%27%20spreadMethod%3D%27%27%20startOffset%3D%27%27%20stdDeviation%3D%27%27%20stitchTiles%3D%27%27%20surfaceScale%3D%27%27%20systemLanguage%3D%27%27%20tableValues%3D%27%27%20targetX%3D%27%27%20targetY%3D%27%27%20textLength%3D%27%27%20viewBox%3D%27%27%20viewTarget%3D%27%27%20xChannelSelector%3D%27%27%20yChannelSelector%3D%27%27%20zoomAndPan%3D%27%27%3E%3C/svg%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20attributeName%3D%22%22%0A%7C%20%20%20%20%20%20%20attributeType%3D%22%22%0A%7C%20%20%20%20%20%20%20baseFrequency%3D%22%22%0A%7C%20%20%20%20%20%20%20baseProfile%3D%22%22%0A%7C%20%20%20%20%20%20%20calcMode%3D%22%22%0A%7C%20%20%20%20%20%20%20clipPathUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20contentscripttype%3D%22%22%0A%7C%20%20%20%20%20%20%20contentstyletype%3D%22%22%0A%7C%20%20%20%20%20%20%20diffuseConstant%3D%22%22%0A%7C%20%20%20%20%20%20%20edgeMode%3D%22%22%0A%7C%20%20%20%20%20%20%20externalresourcesrequired%3D%22%22%0A%7C%20%20%20%20%20%20%20filterUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20filterres%3D%22%22%0A%7C%20%20%20%20%20%20%20glyphRef%3D%22%22%0A%7C%20%20%20%20%20%20%20gradientTransform%3D%22%22%0A%7C%20%20%20%20%20%20%20gradientUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20kernelMatrix%3D%22%22%0A%7C%20%20%20%20%20%20%20kernelUnitLength%3D%22%22%0A%7C%20%20%20%20%20%20%20keyPoints%3D%22%22%0A%7C%20%20%20%20%20%20%20keySplines%3D%22%22%0A%7C%20%20%20%20%20%20%20keyTimes%3D%22%22%0A%7C%20%20%20%20%20%20%20lengthAdjust%3D%22%22%0A%7C%20%20%20%20%20%20%20limitingConeAngle%3D%22%22%0A%7C%20%20%20%20%20%20%20markerHeight%3D%22%22%0A%7C%20%20%20%20%20%20%20markerUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20markerWidth%3D%22%22%0A%7C%20%20%20%20%20%20%20maskContentUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20maskUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20numOctaves%3D%22%22%0A%7C%20%20%20%20%20%20%20pathLength%3D%22%22%0A%7C%20%20%20%20%20%20%20patternContentUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20patternTransform%3D%22%22%0A%7C%20%20%20%20%20%20%20patternUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20pointsAtX%3D%22%22%0A%7C%20%20%20%20%20%20%20pointsAtY%3D%22%22%0A%7C%20%20%20%20%20%20%20pointsAtZ%3D%22%22%0A%7C%20%20%20%20%20%20%20preserveAlpha%3D%22%22%0A%7C%20%20%20%20%20%20%20preserveAspectRatio%3D%22%22%0A%7C%20%20%20%20%20%20%20primitiveUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20refX%3D%22%22%0A%7C%20%20%20%20%20%20%20refY%3D%22%22%0A%7C%20%20%20%20%20%20%20repeatCount%3D%22%22%0A%7C%20%20%20%20%20%20%20repeatDur%3D%22%22%0A%7C%20%20%20%20%20%20%20requiredExtensions%3D%22%22%0A%7C%20%20%20%20%20%20%20requiredFeatures%3D%22%22%0A%7C%20%20%20%20%20%20%20specularConstant%3D%22%22%0A%7C%20%20%20%20%20%20%20specularExponent%3D%22%22%0A%7C%20%20%20%20%20%20%20spreadMethod%3D%22%22%0A%7C%20%20%20%20%20%20%20startOffset%3D%22%22%0A%7C%20%20%20%20%20%20%20stdDeviation%3D%22%22%0A%7C%20%20%20%20%20%20%20stitchTiles%3D%22%22%0A%7C%20%20%20%20%20%20%20surfaceScale%3D%22%22%0A%7C%20%20%20%20%20%20%20systemLanguage%3D%22%22%0A%7C%20%20%20%20%20%20%20tableValues%3D%22%22%0A%7C%20%20%20%20%20%20%20targetX%3D%22%22%0A%7C%20%20%20%20%20%20%20targetY%3D%22%22%0A%7C%20%20%20%20%20%20%20textLength%3D%22%22%0A%7C%20%20%20%20%20%20%20viewBox%3D%22%22%0A%7C%20%20%20%20%20%20%20viewTarget%3D%22%22%0A%7C%20%20%20%20%20%20%20xChannelSelector%3D%22%22%0A%7C%20%20%20%20%20%20%20yChannelSelector%3D%22%22%0A%7C%20%20%20%20%20%20%20zoomAndPan%3D%22%22"],"7ab36bc30d0d6bee4be899f13baed214e1ff0a74":[async_test('html5lib_tests11.html 7ab36bc30d0d6bee4be899f13baed214e1ff0a74'), "%3C%21DOCTYPE%20html%3E%3CBODY%3E%3CSVG%20ATTRIBUTENAME%3D%27%27%20ATTRIBUTETYPE%3D%27%27%20BASEFREQUENCY%3D%27%27%20BASEPROFILE%3D%27%27%20CALCMODE%3D%27%27%20CLIPPATHUNITS%3D%27%27%20CONTENTSCRIPTTYPE%3D%27%27%20CONTENTSTYLETYPE%3D%27%27%20DIFFUSECONSTANT%3D%27%27%20EDGEMODE%3D%27%27%20EXTERNALRESOURCESREQUIRED%3D%27%27%20FILTERRES%3D%27%27%20FILTERUNITS%3D%27%27%20GLYPHREF%3D%27%27%20GRADIENTTRANSFORM%3D%27%27%20GRADIENTUNITS%3D%27%27%20KERNELMATRIX%3D%27%27%20KERNELUNITLENGTH%3D%27%27%20KEYPOINTS%3D%27%27%20KEYSPLINES%3D%27%27%20KEYTIMES%3D%27%27%20LENGTHADJUST%3D%27%27%20LIMITINGCONEANGLE%3D%27%27%20MARKERHEIGHT%3D%27%27%20MARKERUNITS%3D%27%27%20MARKERWIDTH%3D%27%27%20MASKCONTENTUNITS%3D%27%27%20MASKUNITS%3D%27%27%20NUMOCTAVES%3D%27%27%20PATHLENGTH%3D%27%27%20PATTERNCONTENTUNITS%3D%27%27%20PATTERNTRANSFORM%3D%27%27%20PATTERNUNITS%3D%27%27%20POINTSATX%3D%27%27%20POINTSATY%3D%27%27%20POINTSATZ%3D%27%27%20PRESERVEALPHA%3D%27%27%20PRESERVEASPECTRATIO%3D%27%27%20PRIMITIVEUNITS%3D%27%27%20REFX%3D%27%27%20REFY%3D%27%27%20REPEATCOUNT%3D%27%27%20REPEATDUR%3D%27%27%20REQUIREDEXTENSIONS%3D%27%27%20REQUIREDFEATURES%3D%27%27%20SPECULARCONSTANT%3D%27%27%20SPECULAREXPONENT%3D%27%27%20SPREADMETHOD%3D%27%27%20STARTOFFSET%3D%27%27%20STDDEVIATION%3D%27%27%20STITCHTILES%3D%27%27%20SURFACESCALE%3D%27%27%20SYSTEMLANGUAGE%3D%27%27%20TABLEVALUES%3D%27%27%20TARGETX%3D%27%27%20TARGETY%3D%27%27%20TEXTLENGTH%3D%27%27%20VIEWBOX%3D%27%27%20VIEWTARGET%3D%27%27%20XCHANNELSELECTOR%3D%27%27%20YCHANNELSELECTOR%3D%27%27%20ZOOMANDPAN%3D%27%27%3E%3C/SVG%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20attributeName%3D%22%22%0A%7C%20%20%20%20%20%20%20attributeType%3D%22%22%0A%7C%20%20%20%20%20%20%20baseFrequency%3D%22%22%0A%7C%20%20%20%20%20%20%20baseProfile%3D%22%22%0A%7C%20%20%20%20%20%20%20calcMode%3D%22%22%0A%7C%20%20%20%20%20%20%20clipPathUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20contentscripttype%3D%22%22%0A%7C%20%20%20%20%20%20%20contentstyletype%3D%22%22%0A%7C%20%20%20%20%20%20%20diffuseConstant%3D%22%22%0A%7C%20%20%20%20%20%20%20edgeMode%3D%22%22%0A%7C%20%20%20%20%20%20%20externalresourcesrequired%3D%22%22%0A%7C%20%20%20%20%20%20%20filterUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20filterres%3D%22%22%0A%7C%20%20%20%20%20%20%20glyphRef%3D%22%22%0A%7C%20%20%20%20%20%20%20gradientTransform%3D%22%22%0A%7C%20%20%20%20%20%20%20gradientUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20kernelMatrix%3D%22%22%0A%7C%20%20%20%20%20%20%20kernelUnitLength%3D%22%22%0A%7C%20%20%20%20%20%20%20keyPoints%3D%22%22%0A%7C%20%20%20%20%20%20%20keySplines%3D%22%22%0A%7C%20%20%20%20%20%20%20keyTimes%3D%22%22%0A%7C%20%20%20%20%20%20%20lengthAdjust%3D%22%22%0A%7C%20%20%20%20%20%20%20limitingConeAngle%3D%22%22%0A%7C%20%20%20%20%20%20%20markerHeight%3D%22%22%0A%7C%20%20%20%20%20%20%20markerUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20markerWidth%3D%22%22%0A%7C%20%20%20%20%20%20%20maskContentUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20maskUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20numOctaves%3D%22%22%0A%7C%20%20%20%20%20%20%20pathLength%3D%22%22%0A%7C%20%20%20%20%20%20%20patternContentUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20patternTransform%3D%22%22%0A%7C%20%20%20%20%20%20%20patternUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20pointsAtX%3D%22%22%0A%7C%20%20%20%20%20%20%20pointsAtY%3D%22%22%0A%7C%20%20%20%20%20%20%20pointsAtZ%3D%22%22%0A%7C%20%20%20%20%20%20%20preserveAlpha%3D%22%22%0A%7C%20%20%20%20%20%20%20preserveAspectRatio%3D%22%22%0A%7C%20%20%20%20%20%20%20primitiveUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20refX%3D%22%22%0A%7C%20%20%20%20%20%20%20refY%3D%22%22%0A%7C%20%20%20%20%20%20%20repeatCount%3D%22%22%0A%7C%20%20%20%20%20%20%20repeatDur%3D%22%22%0A%7C%20%20%20%20%20%20%20requiredExtensions%3D%22%22%0A%7C%20%20%20%20%20%20%20requiredFeatures%3D%22%22%0A%7C%20%20%20%20%20%20%20specularConstant%3D%22%22%0A%7C%20%20%20%20%20%20%20specularExponent%3D%22%22%0A%7C%20%20%20%20%20%20%20spreadMethod%3D%22%22%0A%7C%20%20%20%20%20%20%20startOffset%3D%22%22%0A%7C%20%20%20%20%20%20%20stdDeviation%3D%22%22%0A%7C%20%20%20%20%20%20%20stitchTiles%3D%22%22%0A%7C%20%20%20%20%20%20%20surfaceScale%3D%22%22%0A%7C%20%20%20%20%20%20%20systemLanguage%3D%22%22%0A%7C%20%20%20%20%20%20%20tableValues%3D%22%22%0A%7C%20%20%20%20%20%20%20targetX%3D%22%22%0A%7C%20%20%20%20%20%20%20targetY%3D%22%22%0A%7C%20%20%20%20%20%20%20textLength%3D%22%22%0A%7C%20%20%20%20%20%20%20viewBox%3D%22%22%0A%7C%20%20%20%20%20%20%20viewTarget%3D%22%22%0A%7C%20%20%20%20%20%20%20xChannelSelector%3D%22%22%0A%7C%20%20%20%20%20%20%20yChannelSelector%3D%22%22%0A%7C%20%20%20%20%20%20%20zoomAndPan%3D%22%22"],"45b6adfc38d306084d105aa7779a3b4fb83c031f":[async_test('html5lib_tests11.html 45b6adfc38d306084d105aa7779a3b4fb83c031f'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Csvg%20attributename%3D%27%27%20attributetype%3D%27%27%20basefrequency%3D%27%27%20baseprofile%3D%27%27%20calcmode%3D%27%27%20clippathunits%3D%27%27%20contentscripttype%3D%27%27%20contentstyletype%3D%27%27%20diffuseconstant%3D%27%27%20edgemode%3D%27%27%20externalresourcesrequired%3D%27%27%20filterres%3D%27%27%20filterunits%3D%27%27%20glyphref%3D%27%27%20gradienttransform%3D%27%27%20gradientunits%3D%27%27%20kernelmatrix%3D%27%27%20kernelunitlength%3D%27%27%20keypoints%3D%27%27%20keysplines%3D%27%27%20keytimes%3D%27%27%20lengthadjust%3D%27%27%20limitingconeangle%3D%27%27%20markerheight%3D%27%27%20markerunits%3D%27%27%20markerwidth%3D%27%27%20maskcontentunits%3D%27%27%20maskunits%3D%27%27%20numoctaves%3D%27%27%20pathlength%3D%27%27%20patterncontentunits%3D%27%27%20patterntransform%3D%27%27%20patternunits%3D%27%27%20pointsatx%3D%27%27%20pointsaty%3D%27%27%20pointsatz%3D%27%27%20preservealpha%3D%27%27%20preserveaspectratio%3D%27%27%20primitiveunits%3D%27%27%20refx%3D%27%27%20refy%3D%27%27%20repeatcount%3D%27%27%20repeatdur%3D%27%27%20requiredextensions%3D%27%27%20requiredfeatures%3D%27%27%20specularconstant%3D%27%27%20specularexponent%3D%27%27%20spreadmethod%3D%27%27%20startoffset%3D%27%27%20stddeviation%3D%27%27%20stitchtiles%3D%27%27%20surfacescale%3D%27%27%20systemlanguage%3D%27%27%20tablevalues%3D%27%27%20targetx%3D%27%27%20targety%3D%27%27%20textlength%3D%27%27%20viewbox%3D%27%27%20viewtarget%3D%27%27%20xchannelselector%3D%27%27%20ychannelselector%3D%27%27%20zoomandpan%3D%27%27%3E%3C/svg%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20attributeName%3D%22%22%0A%7C%20%20%20%20%20%20%20attributeType%3D%22%22%0A%7C%20%20%20%20%20%20%20baseFrequency%3D%22%22%0A%7C%20%20%20%20%20%20%20baseProfile%3D%22%22%0A%7C%20%20%20%20%20%20%20calcMode%3D%22%22%0A%7C%20%20%20%20%20%20%20clipPathUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20contentscripttype%3D%22%22%0A%7C%20%20%20%20%20%20%20contentstyletype%3D%22%22%0A%7C%20%20%20%20%20%20%20diffuseConstant%3D%22%22%0A%7C%20%20%20%20%20%20%20edgeMode%3D%22%22%0A%7C%20%20%20%20%20%20%20externalresourcesrequired%3D%22%22%0A%7C%20%20%20%20%20%20%20filterUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20filterres%3D%22%22%0A%7C%20%20%20%20%20%20%20glyphRef%3D%22%22%0A%7C%20%20%20%20%20%20%20gradientTransform%3D%22%22%0A%7C%20%20%20%20%20%20%20gradientUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20kernelMatrix%3D%22%22%0A%7C%20%20%20%20%20%20%20kernelUnitLength%3D%22%22%0A%7C%20%20%20%20%20%20%20keyPoints%3D%22%22%0A%7C%20%20%20%20%20%20%20keySplines%3D%22%22%0A%7C%20%20%20%20%20%20%20keyTimes%3D%22%22%0A%7C%20%20%20%20%20%20%20lengthAdjust%3D%22%22%0A%7C%20%20%20%20%20%20%20limitingConeAngle%3D%22%22%0A%7C%20%20%20%20%20%20%20markerHeight%3D%22%22%0A%7C%20%20%20%20%20%20%20markerUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20markerWidth%3D%22%22%0A%7C%20%20%20%20%20%20%20maskContentUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20maskUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20numOctaves%3D%22%22%0A%7C%20%20%20%20%20%20%20pathLength%3D%22%22%0A%7C%20%20%20%20%20%20%20patternContentUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20patternTransform%3D%22%22%0A%7C%20%20%20%20%20%20%20patternUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20pointsAtX%3D%22%22%0A%7C%20%20%20%20%20%20%20pointsAtY%3D%22%22%0A%7C%20%20%20%20%20%20%20pointsAtZ%3D%22%22%0A%7C%20%20%20%20%20%20%20preserveAlpha%3D%22%22%0A%7C%20%20%20%20%20%20%20preserveAspectRatio%3D%22%22%0A%7C%20%20%20%20%20%20%20primitiveUnits%3D%22%22%0A%7C%20%20%20%20%20%20%20refX%3D%22%22%0A%7C%20%20%20%20%20%20%20refY%3D%22%22%0A%7C%20%20%20%20%20%20%20repeatCount%3D%22%22%0A%7C%20%20%20%20%20%20%20repeatDur%3D%22%22%0A%7C%20%20%20%20%20%20%20requiredExtensions%3D%22%22%0A%7C%20%20%20%20%20%20%20requiredFeatures%3D%22%22%0A%7C%20%20%20%20%20%20%20specularConstant%3D%22%22%0A%7C%20%20%20%20%20%20%20specularExponent%3D%22%22%0A%7C%20%20%20%20%20%20%20spreadMethod%3D%22%22%0A%7C%20%20%20%20%20%20%20startOffset%3D%22%22%0A%7C%20%20%20%20%20%20%20stdDeviation%3D%22%22%0A%7C%20%20%20%20%20%20%20stitchTiles%3D%22%22%0A%7C%20%20%20%20%20%20%20surfaceScale%3D%22%22%0A%7C%20%20%20%20%20%20%20systemLanguage%3D%22%22%0A%7C%20%20%20%20%20%20%20tableValues%3D%22%22%0A%7C%20%20%20%20%20%20%20targetX%3D%22%22%0A%7C%20%20%20%20%20%20%20targetY%3D%22%22%0A%7C%20%20%20%20%20%20%20textLength%3D%22%22%0A%7C%20%20%20%20%20%20%20viewBox%3D%22%22%0A%7C%20%20%20%20%20%20%20viewTarget%3D%22%22%0A%7C%20%20%20%20%20%20%20xChannelSelector%3D%22%22%0A%7C%20%20%20%20%20%20%20yChannelSelector%3D%22%22%0A%7C%20%20%20%20%20%20%20zoomAndPan%3D%22%22"],"b6ce0d4b36700a2f000199109155d1869f3c8d2f":[async_test('html5lib_tests11.html b6ce0d4b36700a2f000199109155d1869f3c8d2f'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cmath%20attributeName%3D%27%27%20attributeType%3D%27%27%20baseFrequency%3D%27%27%20baseProfile%3D%27%27%20calcMode%3D%27%27%20clipPathUnits%3D%27%27%20contentScriptType%3D%27%27%20contentStyleType%3D%27%27%20diffuseConstant%3D%27%27%20edgeMode%3D%27%27%20externalResourcesRequired%3D%27%27%20filterRes%3D%27%27%20filterUnits%3D%27%27%20glyphRef%3D%27%27%20gradientTransform%3D%27%27%20gradientUnits%3D%27%27%20kernelMatrix%3D%27%27%20kernelUnitLength%3D%27%27%20keyPoints%3D%27%27%20keySplines%3D%27%27%20keyTimes%3D%27%27%20lengthAdjust%3D%27%27%20limitingConeAngle%3D%27%27%20markerHeight%3D%27%27%20markerUnits%3D%27%27%20markerWidth%3D%27%27%20maskContentUnits%3D%27%27%20maskUnits%3D%27%27%20numOctaves%3D%27%27%20pathLength%3D%27%27%20patternContentUnits%3D%27%27%20patternTransform%3D%27%27%20patternUnits%3D%27%27%20pointsAtX%3D%27%27%20pointsAtY%3D%27%27%20pointsAtZ%3D%27%27%20preserveAlpha%3D%27%27%20preserveAspectRatio%3D%27%27%20primitiveUnits%3D%27%27%20refX%3D%27%27%20refY%3D%27%27%20repeatCount%3D%27%27%20repeatDur%3D%27%27%20requiredExtensions%3D%27%27%20requiredFeatures%3D%27%27%20specularConstant%3D%27%27%20specularExponent%3D%27%27%20spreadMethod%3D%27%27%20startOffset%3D%27%27%20stdDeviation%3D%27%27%20stitchTiles%3D%27%27%20surfaceScale%3D%27%27%20systemLanguage%3D%27%27%20tableValues%3D%27%27%20targetX%3D%27%27%20targetY%3D%27%27%20textLength%3D%27%27%20viewBox%3D%27%27%20viewTarget%3D%27%27%20xChannelSelector%3D%27%27%20yChannelSelector%3D%27%27%20zoomAndPan%3D%27%27%3E%3C/math%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20attributename%3D%22%22%0A%7C%20%20%20%20%20%20%20attributetype%3D%22%22%0A%7C%20%20%20%20%20%20%20basefrequency%3D%22%22%0A%7C%20%20%20%20%20%20%20baseprofile%3D%22%22%0A%7C%20%20%20%20%20%20%20calcmode%3D%22%22%0A%7C%20%20%20%20%20%20%20clippathunits%3D%22%22%0A%7C%20%20%20%20%20%20%20contentscripttype%3D%22%22%0A%7C%20%20%20%20%20%20%20contentstyletype%3D%22%22%0A%7C%20%20%20%20%20%20%20diffuseconstant%3D%22%22%0A%7C%20%20%20%20%20%20%20edgemode%3D%22%22%0A%7C%20%20%20%20%20%20%20externalresourcesrequired%3D%22%22%0A%7C%20%20%20%20%20%20%20filterres%3D%22%22%0A%7C%20%20%20%20%20%20%20filterunits%3D%22%22%0A%7C%20%20%20%20%20%20%20glyphref%3D%22%22%0A%7C%20%20%20%20%20%20%20gradienttransform%3D%22%22%0A%7C%20%20%20%20%20%20%20gradientunits%3D%22%22%0A%7C%20%20%20%20%20%20%20kernelmatrix%3D%22%22%0A%7C%20%20%20%20%20%20%20kernelunitlength%3D%22%22%0A%7C%20%20%20%20%20%20%20keypoints%3D%22%22%0A%7C%20%20%20%20%20%20%20keysplines%3D%22%22%0A%7C%20%20%20%20%20%20%20keytimes%3D%22%22%0A%7C%20%20%20%20%20%20%20lengthadjust%3D%22%22%0A%7C%20%20%20%20%20%20%20limitingconeangle%3D%22%22%0A%7C%20%20%20%20%20%20%20markerheight%3D%22%22%0A%7C%20%20%20%20%20%20%20markerunits%3D%22%22%0A%7C%20%20%20%20%20%20%20markerwidth%3D%22%22%0A%7C%20%20%20%20%20%20%20maskcontentunits%3D%22%22%0A%7C%20%20%20%20%20%20%20maskunits%3D%22%22%0A%7C%20%20%20%20%20%20%20numoctaves%3D%22%22%0A%7C%20%20%20%20%20%20%20pathlength%3D%22%22%0A%7C%20%20%20%20%20%20%20patterncontentunits%3D%22%22%0A%7C%20%20%20%20%20%20%20patterntransform%3D%22%22%0A%7C%20%20%20%20%20%20%20patternunits%3D%22%22%0A%7C%20%20%20%20%20%20%20pointsatx%3D%22%22%0A%7C%20%20%20%20%20%20%20pointsaty%3D%22%22%0A%7C%20%20%20%20%20%20%20pointsatz%3D%22%22%0A%7C%20%20%20%20%20%20%20preservealpha%3D%22%22%0A%7C%20%20%20%20%20%20%20preserveaspectratio%3D%22%22%0A%7C%20%20%20%20%20%20%20primitiveunits%3D%22%22%0A%7C%20%20%20%20%20%20%20refx%3D%22%22%0A%7C%20%20%20%20%20%20%20refy%3D%22%22%0A%7C%20%20%20%20%20%20%20repeatcount%3D%22%22%0A%7C%20%20%20%20%20%20%20repeatdur%3D%22%22%0A%7C%20%20%20%20%20%20%20requiredextensions%3D%22%22%0A%7C%20%20%20%20%20%20%20requiredfeatures%3D%22%22%0A%7C%20%20%20%20%20%20%20specularconstant%3D%22%22%0A%7C%20%20%20%20%20%20%20specularexponent%3D%22%22%0A%7C%20%20%20%20%20%20%20spreadmethod%3D%22%22%0A%7C%20%20%20%20%20%20%20startoffset%3D%22%22%0A%7C%20%20%20%20%20%20%20stddeviation%3D%22%22%0A%7C%20%20%20%20%20%20%20stitchtiles%3D%22%22%0A%7C%20%20%20%20%20%20%20surfacescale%3D%22%22%0A%7C%20%20%20%20%20%20%20systemlanguage%3D%22%22%0A%7C%20%20%20%20%20%20%20tablevalues%3D%22%22%0A%7C%20%20%20%20%20%20%20targetx%3D%22%22%0A%7C%20%20%20%20%20%20%20targety%3D%22%22%0A%7C%20%20%20%20%20%20%20textlength%3D%22%22%0A%7C%20%20%20%20%20%20%20viewbox%3D%22%22%0A%7C%20%20%20%20%20%20%20viewtarget%3D%22%22%0A%7C%20%20%20%20%20%20%20xchannelselector%3D%22%22%0A%7C%20%20%20%20%20%20%20ychannelselector%3D%22%22%0A%7C%20%20%20%20%20%20%20zoomandpan%3D%22%22"],"39c50f080b2b9ae9e7a1070679ab97d7b814f9ec":[async_test('html5lib_tests11.html 39c50f080b2b9ae9e7a1070679ab97d7b814f9ec'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Csvg%3E%3CaltGlyph%20/%3E%3CaltGlyphDef%20/%3E%3CaltGlyphItem%20/%3E%3CanimateColor%20/%3E%3CanimateMotion%20/%3E%3CanimateTransform%20/%3E%3CclipPath%20/%3E%3CfeBlend%20/%3E%3CfeColorMatrix%20/%3E%3CfeComponentTransfer%20/%3E%3CfeComposite%20/%3E%3CfeConvolveMatrix%20/%3E%3CfeDiffuseLighting%20/%3E%3CfeDisplacementMap%20/%3E%3CfeDistantLight%20/%3E%3CfeFlood%20/%3E%3CfeFuncA%20/%3E%3CfeFuncB%20/%3E%3CfeFuncG%20/%3E%3CfeFuncR%20/%3E%3CfeGaussianBlur%20/%3E%3CfeImage%20/%3E%3CfeMerge%20/%3E%3CfeMergeNode%20/%3E%3CfeMorphology%20/%3E%3CfeOffset%20/%3E%3CfePointLight%20/%3E%3CfeSpecularLighting%20/%3E%3CfeSpotLight%20/%3E%3CfeTile%20/%3E%3CfeTurbulence%20/%3E%3CforeignObject%20/%3E%3CglyphRef%20/%3E%3ClinearGradient%20/%3E%3CradialGradient%20/%3E%3CtextPath%20/%3E%3C/svg%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20altGlyph%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20altGlyphDef%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20altGlyphItem%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20animateColor%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20animateMotion%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20animateTransform%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20clipPath%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feBlend%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feColorMatrix%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feComponentTransfer%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feComposite%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feConvolveMatrix%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feDiffuseLighting%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feDisplacementMap%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feDistantLight%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFlood%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFuncA%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFuncB%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFuncG%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFuncR%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feGaussianBlur%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feImage%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feMerge%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feMergeNode%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feMorphology%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feOffset%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20fePointLight%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feSpecularLighting%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feSpotLight%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feTile%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feTurbulence%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20glyphRef%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20linearGradient%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20radialGradient%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20textPath%3E"],"6d1fa1599f75625fe4d019abb04a064cf6ed39e8":[async_test('html5lib_tests11.html 6d1fa1599f75625fe4d019abb04a064cf6ed39e8'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Csvg%3E%3Caltglyph%20/%3E%3Caltglyphdef%20/%3E%3Caltglyphitem%20/%3E%3Canimatecolor%20/%3E%3Canimatemotion%20/%3E%3Canimatetransform%20/%3E%3Cclippath%20/%3E%3Cfeblend%20/%3E%3Cfecolormatrix%20/%3E%3Cfecomponenttransfer%20/%3E%3Cfecomposite%20/%3E%3Cfeconvolvematrix%20/%3E%3Cfediffuselighting%20/%3E%3Cfedisplacementmap%20/%3E%3Cfedistantlight%20/%3E%3Cfeflood%20/%3E%3Cfefunca%20/%3E%3Cfefuncb%20/%3E%3Cfefuncg%20/%3E%3Cfefuncr%20/%3E%3Cfegaussianblur%20/%3E%3Cfeimage%20/%3E%3Cfemerge%20/%3E%3Cfemergenode%20/%3E%3Cfemorphology%20/%3E%3Cfeoffset%20/%3E%3Cfepointlight%20/%3E%3Cfespecularlighting%20/%3E%3Cfespotlight%20/%3E%3Cfetile%20/%3E%3Cfeturbulence%20/%3E%3Cforeignobject%20/%3E%3Cglyphref%20/%3E%3Clineargradient%20/%3E%3Cradialgradient%20/%3E%3Ctextpath%20/%3E%3C/svg%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20altGlyph%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20altGlyphDef%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20altGlyphItem%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20animateColor%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20animateMotion%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20animateTransform%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20clipPath%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feBlend%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feColorMatrix%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feComponentTransfer%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feComposite%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feConvolveMatrix%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feDiffuseLighting%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feDisplacementMap%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feDistantLight%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFlood%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFuncA%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFuncB%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFuncG%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFuncR%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feGaussianBlur%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feImage%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feMerge%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feMergeNode%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feMorphology%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feOffset%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20fePointLight%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feSpecularLighting%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feSpotLight%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feTile%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feTurbulence%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20glyphRef%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20linearGradient%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20radialGradient%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20textPath%3E"],"791437ece7ba684e00162d1dd79dfe540e3621a7":[async_test('html5lib_tests11.html 791437ece7ba684e00162d1dd79dfe540e3621a7'), "%3C%21DOCTYPE%20html%3E%3CBODY%3E%3CSVG%3E%3CALTGLYPH%20/%3E%3CALTGLYPHDEF%20/%3E%3CALTGLYPHITEM%20/%3E%3CANIMATECOLOR%20/%3E%3CANIMATEMOTION%20/%3E%3CANIMATETRANSFORM%20/%3E%3CCLIPPATH%20/%3E%3CFEBLEND%20/%3E%3CFECOLORMATRIX%20/%3E%3CFECOMPONENTTRANSFER%20/%3E%3CFECOMPOSITE%20/%3E%3CFECONVOLVEMATRIX%20/%3E%3CFEDIFFUSELIGHTING%20/%3E%3CFEDISPLACEMENTMAP%20/%3E%3CFEDISTANTLIGHT%20/%3E%3CFEFLOOD%20/%3E%3CFEFUNCA%20/%3E%3CFEFUNCB%20/%3E%3CFEFUNCG%20/%3E%3CFEFUNCR%20/%3E%3CFEGAUSSIANBLUR%20/%3E%3CFEIMAGE%20/%3E%3CFEMERGE%20/%3E%3CFEMERGENODE%20/%3E%3CFEMORPHOLOGY%20/%3E%3CFEOFFSET%20/%3E%3CFEPOINTLIGHT%20/%3E%3CFESPECULARLIGHTING%20/%3E%3CFESPOTLIGHT%20/%3E%3CFETILE%20/%3E%3CFETURBULENCE%20/%3E%3CFOREIGNOBJECT%20/%3E%3CGLYPHREF%20/%3E%3CLINEARGRADIENT%20/%3E%3CRADIALGRADIENT%20/%3E%3CTEXTPATH%20/%3E%3C/SVG%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20altGlyph%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20altGlyphDef%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20altGlyphItem%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20animateColor%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20animateMotion%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20animateTransform%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20clipPath%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feBlend%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feColorMatrix%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feComponentTransfer%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feComposite%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feConvolveMatrix%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feDiffuseLighting%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feDisplacementMap%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feDistantLight%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFlood%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFuncA%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFuncB%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFuncG%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feFuncR%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feGaussianBlur%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feImage%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feMerge%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feMergeNode%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feMorphology%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feOffset%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20fePointLight%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feSpecularLighting%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feSpotLight%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feTile%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20feTurbulence%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20glyphRef%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20linearGradient%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20radialGradient%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20textPath%3E"],"af40d26164229c29b9be77ed6dd7dda780cba55c":[async_test('html5lib_tests11.html af40d26164229c29b9be77ed6dd7dda780cba55c'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cmath%3E%3CaltGlyph%20/%3E%3CaltGlyphDef%20/%3E%3CaltGlyphItem%20/%3E%3CanimateColor%20/%3E%3CanimateMotion%20/%3E%3CanimateTransform%20/%3E%3CclipPath%20/%3E%3CfeBlend%20/%3E%3CfeColorMatrix%20/%3E%3CfeComponentTransfer%20/%3E%3CfeComposite%20/%3E%3CfeConvolveMatrix%20/%3E%3CfeDiffuseLighting%20/%3E%3CfeDisplacementMap%20/%3E%3CfeDistantLight%20/%3E%3CfeFlood%20/%3E%3CfeFuncA%20/%3E%3CfeFuncB%20/%3E%3CfeFuncG%20/%3E%3CfeFuncR%20/%3E%3CfeGaussianBlur%20/%3E%3CfeImage%20/%3E%3CfeMerge%20/%3E%3CfeMergeNode%20/%3E%3CfeMorphology%20/%3E%3CfeOffset%20/%3E%3CfePointLight%20/%3E%3CfeSpecularLighting%20/%3E%3CfeSpotLight%20/%3E%3CfeTile%20/%3E%3CfeTurbulence%20/%3E%3CforeignObject%20/%3E%3CglyphRef%20/%3E%3ClinearGradient%20/%3E%3CradialGradient%20/%3E%3CtextPath%20/%3E%3C/math%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20altglyph%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20altglyphdef%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20altglyphitem%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20animatecolor%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20animatemotion%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20animatetransform%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20clippath%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20feblend%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fecolormatrix%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fecomponenttransfer%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fecomposite%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20feconvolvematrix%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fediffuselighting%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fedisplacementmap%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fedistantlight%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20feflood%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fefunca%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fefuncb%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fefuncg%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fefuncr%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fegaussianblur%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20feimage%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20femerge%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20femergenode%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20femorphology%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20feoffset%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fepointlight%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fespecularlighting%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fespotlight%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20fetile%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20feturbulence%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20foreignobject%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20glyphref%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20lineargradient%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20radialgradient%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20textpath%3E"],"16e68d18f8f0fb81013fe77a30b7d396c5081e5e":[async_test('html5lib_tests11.html 16e68d18f8f0fb81013fe77a30b7d396c5081e5e'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Csvg%3E%3CsolidColor%20/%3E%3C/svg%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20solidcolor%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests12.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests12.html
new file mode 100644
index 000000000..4c1b388f0
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests12.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests12.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['95751b82f57d4feaaf06d208d57b7f6cc4d5fef5','411c792cef85cbb029d5c91f4a2142751a319bc2',];
+ var tests = {
+ "95751b82f57d4feaaf06d208d57b7f6cc4d5fef5":[async_test('html5lib_tests12.html 95751b82f57d4feaaf06d208d57b7f6cc4d5fef5'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cp%3Efoo%3Cmath%3E%3Cmtext%3E%3Ci%3Ebaz%3C/i%3E%3C/mtext%3E%3Cannotation-xml%3E%3Csvg%3E%3Cdesc%3E%3Cb%3Eeggs%3C/b%3E%3C/desc%3E%3Cg%3E%3CforeignObject%3E%3CP%3Espam%3CTABLE%3E%3Ctr%3E%3Ctd%3E%3Cimg%3E%3C/td%3E%3C/table%3E%3C/foreignObject%3E%3C/g%3E%3Cg%3Equux%3C/g%3E%3C/svg%3E%3C/annotation-xml%3E%3C/math%3Ebar", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mtext%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22baz%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20desc%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22eggs%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22spam%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cimg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22quux%22%0A%7C%20%20%20%20%20%20%20%22bar%22"],"411c792cef85cbb029d5c91f4a2142751a319bc2":[async_test('html5lib_tests12.html 411c792cef85cbb029d5c91f4a2142751a319bc2'), "%3C%21DOCTYPE%20html%3E%3Cbody%3Efoo%3Cmath%3E%3Cmtext%3E%3Ci%3Ebaz%3C/i%3E%3C/mtext%3E%3Cannotation-xml%3E%3Csvg%3E%3Cdesc%3E%3Cb%3Eeggs%3C/b%3E%3C/desc%3E%3Cg%3E%3CforeignObject%3E%3CP%3Espam%3CTABLE%3E%3Ctr%3E%3Ctd%3E%3Cimg%3E%3C/td%3E%3C/table%3E%3C/foreignObject%3E%3C/g%3E%3Cg%3Equux%3C/g%3E%3C/svg%3E%3C/annotation-xml%3E%3C/math%3Ebar", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mtext%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22baz%22%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20desc%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22eggs%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22spam%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cimg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22quux%22%0A%7C%20%20%20%20%20%22bar%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests14.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests14.html
new file mode 100644
index 000000000..b1a4323c2
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests14.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests14.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['d0faa36cd34bbc8e41bacd676e995aef68cb8ef7','9d97df65d72e97363840684da4e164b50c4bf1cb','c5de9372cd188bc22d40d4ad08eb6f787ab521ea','d16e1c0655b2086c1bd995cf6f1c5c7106e48ef0','383a71bb62eacf93dcb2399c7dd7419d92a91899','ee5e2e4a3346d225907f27c1f12b3cb2e77c32c4','cd557ae48cd48356c367e470927d0fc108724409',];
+ var tests = {
+ "d0faa36cd34bbc8e41bacd676e995aef68cb8ef7":[async_test('html5lib_tests14.html d0faa36cd34bbc8e41bacd676e995aef68cb8ef7'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Cbody%3E%3Cxyz%3Aabc%3E%3C/xyz%3Aabc%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cxyz%3Aabc%3E"],"9d97df65d72e97363840684da4e164b50c4bf1cb":[async_test('html5lib_tests14.html 9d97df65d72e97363840684da4e164b50c4bf1cb'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Cbody%3E%3Cxyz%3Aabc%3E%3C/xyz%3Aabc%3E%3Cspan%3E%3C/span%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cxyz%3Aabc%3E%0A%7C%20%20%20%20%20%3Cspan%3E"],"c5de9372cd188bc22d40d4ad08eb6f787ab521ea":[async_test('html5lib_tests14.html c5de9372cd188bc22d40d4ad08eb6f787ab521ea'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Chtml%20abc%3Adef%3Dgh%3E%3Cxyz%3Aabc%3E%3C/xyz%3Aabc%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20abc%3Adef%3D%22gh%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cxyz%3Aabc%3E"],"d16e1c0655b2086c1bd995cf6f1c5c7106e48ef0":[async_test('html5lib_tests14.html d16e1c0655b2086c1bd995cf6f1c5c7106e48ef0'), "%3C%21DOCTYPE%20html%3E%3Chtml%20xml%3Alang%3Dbar%3E%3Chtml%20xml%3Alang%3Dfoo%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20xml%3Alang%3D%22bar%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"383a71bb62eacf93dcb2399c7dd7419d92a91899":[async_test('html5lib_tests14.html 383a71bb62eacf93dcb2399c7dd7419d92a91899'), "%3C%21DOCTYPE%20html%3E%3Chtml%20123%3D456%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20123%3D%22456%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"ee5e2e4a3346d225907f27c1f12b3cb2e77c32c4":[async_test('html5lib_tests14.html ee5e2e4a3346d225907f27c1f12b3cb2e77c32c4'), "%3C%21DOCTYPE%20html%3E%3Chtml%20123%3D456%3E%3Chtml%20789%3D012%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20123%3D%22456%22%0A%7C%20%20%20789%3D%22012%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"cd557ae48cd48356c367e470927d0fc108724409":[async_test('html5lib_tests14.html cd557ae48cd48356c367e470927d0fc108724409'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Cbody%20789%3D012%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20789%3D%22012%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests15.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests15.html
new file mode 100644
index 000000000..3e9ac0cbe
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests15.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests15.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['6b53427ced5c2da3830c5053af874df81b59f4dc','e4719f96139431e67dc783631eb1b3b25e0e62e8','6c880904728529240130ab72c30a1f800502e1fc','59cae979c2d8110a1015fd401afb42d1015e2c05','fdac591df8c2ff9db7bdd63adee17e002a620ea1','72352f74535e62a2b0623446073f3edb7698bcf3','93c2841d64ce8d4745de6a0fbd28ddba273fd3d0','e83c7f01a04d3ff180019d1578cc666f67ea71eb','8ed7e05d49dfc6701ef8325a5d9504d596d8d083','938af694979b4eae59e7bd3ab71d76e5254192a0','e7bba1876ae72e36eb68142d21f64fee1043cff6','fc3373f9cb00e32fc98435157d1d74a6a27a7fb9','f4c1486ad877d96aeb9a31fde16d2a93ada53b35','c1176256398117ceca6c3878106893855c39aa5a',];
+ var tests = {
+ "6b53427ced5c2da3830c5053af874df81b59f4dc":[async_test('html5lib_tests15.html 6b53427ced5c2da3830c5053af874df81b59f4dc'), "%3C%21DOCTYPE%20html%3E%3Cp%3E%3Cb%3E%3Ci%3E%3Cu%3E%3C/p%3E%20%3Cp%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cu%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cu%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22X%22"],"e4719f96139431e67dc783631eb1b3b25e0e62e8":[async_test('html5lib_tests15.html e4719f96139431e67dc783631eb1b3b25e0e62e8'), "%3Cp%3E%3Cb%3E%3Ci%3E%3Cu%3E%3C/p%3E%0A%3Cp%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cu%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cu%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22X%22"],"6c880904728529240130ab72c30a1f800502e1fc":[async_test('html5lib_tests15.html 6c880904728529240130ab72c30a1f800502e1fc'), "%3C%21doctype%20html%3E%3C/html%3E%20%3Chead%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%20%22"],"59cae979c2d8110a1015fd401afb42d1015e2c05":[async_test('html5lib_tests15.html 59cae979c2d8110a1015fd401afb42d1015e2c05'), "%3C%21doctype%20html%3E%3C/body%3E%3Cmeta%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmeta%3E"],"fdac591df8c2ff9db7bdd63adee17e002a620ea1":[async_test('html5lib_tests15.html fdac591df8c2ff9db7bdd63adee17e002a620ea1'), "%3Chtml%3E%3C/html%3E%3C%21--%20foo%20--%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%3C%21--%20%20foo%20%20--%3E"],"72352f74535e62a2b0623446073f3edb7698bcf3":[async_test('html5lib_tests15.html 72352f74535e62a2b0623446073f3edb7698bcf3'), "%3C%21doctype%20html%3E%3C/body%3E%3Ctitle%3EX%3C/title%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22X%22"],"93c2841d64ce8d4745de6a0fbd28ddba273fd3d0":[async_test('html5lib_tests15.html 93c2841d64ce8d4745de6a0fbd28ddba273fd3d0'), "%3C%21doctype%20html%3E%3Ctable%3E%20X%3Cmeta%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%20X%22%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%3Ctable%3E"],"e83c7f01a04d3ff180019d1578cc666f67ea71eb":[async_test('html5lib_tests15.html e83c7f01a04d3ff180019d1578cc666f67ea71eb'), "%3C%21doctype%20html%3E%3Ctable%3E%20x%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%20x%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"8ed7e05d49dfc6701ef8325a5d9504d596d8d083":[async_test('html5lib_tests15.html 8ed7e05d49dfc6701ef8325a5d9504d596d8d083'), "%3C%21doctype%20html%3E%3Ctable%3E%20x%20%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%20x%20%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"938af694979b4eae59e7bd3ab71d76e5254192a0":[async_test('html5lib_tests15.html 938af694979b4eae59e7bd3ab71d76e5254192a0'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctr%3E%20x%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%20x%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"e7bba1876ae72e36eb68142d21f64fee1043cff6":[async_test('html5lib_tests15.html e7bba1876ae72e36eb68142d21f64fee1043cff6'), "%3C%21doctype%20html%3E%3Ctable%3EX%3Cstyle%3E%20%3Ctr%3Ex%20%3C/style%3E%20%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20%3Ctr%3Ex%20%22%0A%7C%20%20%20%20%20%20%20%22%20%22"],"fc3373f9cb00e32fc98435157d1d74a6a27a7fb9":[async_test('html5lib_tests15.html fc3373f9cb00e32fc98435157d1d74a6a27a7fb9'), "%3C%21doctype%20html%3E%3Cdiv%3E%3Ctable%3E%3Ca%3Efoo%3C/a%3E%20%3Ctr%3E%3Ctd%3Ebar%3C/td%3E%20%3C/tr%3E%3C/table%3E%3C/div%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22%20%22"],"f4c1486ad877d96aeb9a31fde16d2a93ada53b35":[async_test('html5lib_tests15.html f4c1486ad877d96aeb9a31fde16d2a93ada53b35'), "%3Cframe%3E%3C/frame%3E%3C/frame%3E%3Cframeset%3E%3Cframe%3E%3Cframeset%3E%3Cframe%3E%3C/frameset%3E%3Cnoframes%3E%3C/frameset%3E%3Cnoframes%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%3Cframe%3E%0A%7C%20%20%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%20%20%3Cframe%3E%0A%7C%20%20%20%20%20%3Cnoframes%3E%0A%7C%20%20%20%20%20%20%20%22%3C/frameset%3E%3Cnoframes%3E%22"],"c1176256398117ceca6c3878106893855c39aa5a":[async_test('html5lib_tests15.html c1176256398117ceca6c3878106893855c39aa5a'), "%3C%21DOCTYPE%20html%3E%3Cobject%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cobject%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests16.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests16.html
new file mode 100644
index 000000000..f6c8a027c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests16.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests16.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['6d8b9d29f1890d59ef2453cff3f6d57b7e398c5c','5d4ac4961f9d52a42f309886d16fbe9c55c198bb','132c6e3cd2659e15b69904c67981a04e81fabe78','bf0b3062e7cbe684380581919947333beef23a8c','cd76a82b9a4bde442e4f8819b37e6308e3eef8f5','747087d5bf2fe9a8a6c0ecf822211d93a4e0cc2a','413482922b0185970bfdd6008e6a0e70ad1b554f','0e3cc8b1f36a34fb3048bb4f01e0e7fec678ceef','3d7a659a8880588e831c7198867b65ac2a974353','46914793d44763c3cd37c3aef0c3689d826602d1','bc8ed1aea5ac5d7eac284386a5defe779eeab3d7','48e7e206aade47bdd9ad3a7cce2c9c86fb4227f6','cc10f706cec3e9356f8c42f77b970f669f74be03','9a6506b01fabf7ba73bb5c90f11b3898c2f119fa','f840264cf775999580e621a83d34af302e139632','efe27c508629d48cf36861e680918f11f48aad15','c51f18f140335e61f0158fadd282fb0f0c75bee6','76d621ce4bd9e462bacaa40ebf43e1ccb569bd21','70e4352779315880955134dfe67c53acb76c4850','b05be3f93446c26026591cbfee84b9603cd6f151','3f08f2e2326b621f819b73336f502610dd94d54f','4932d705ce9c31d4141a630d305e16ae130982e7','accb817d72edbb0d9f72e2c44f47055fb1719d0a','b7b2e78af3f5846dc7f67246c92d95aacc2bd996','52e03d2903a9556823275541c58c173ac077a2a9','1daec6e34a3b4b4ea28f3e90595052090e67cbf7','539e26d76efe146f95bd7b6bfa88ae2d29afd35a','ab43ce067468a33bb658e0d6cc542b9dbcd0c80f','3f93565e7a692675cc519326cc4122b5ea44b533','e579c03d00de7a95bad40602af783b4d7775ab78','1541ebd513bc357af538635050f1b3ec854648e5','ae91f664e0c85f63d21dddaa03a9104d27a9d5ce','17b1bf0912a302c2bed5358791fae3ea6d3efa7d','beac9d7ec99b6317c8504e80118dd0f2d5fad573','d5ead5851ba4d1cdac136d97a449e6b48b0c2cb4','17fe63597371d22c41ccbc4abcd8f468373559d7','26a585731ba7caa063ad5c87a09748a223e56639','91dc36fa03b62334c115db6d4b4a420ef1081753','b0ee0820468ee622b802020e20be120d3c534af2','65907331b39d13cc2128eb57afb7185f0173a953','c284310f4becf9d64252eaec25fe46de8c6e4f2c','63bbe135b3dbb75f2262ce1cc5e9259634596a55','c83e5a48a9409482b62903960b0a04a932832668','193aa9aa570a39d74e340e8d6ddd015ee0a7477c','0ce3d12fa6ac40027b789b09fd987194426e09e6','fd613c2eb713e158fae7a54c45a3d952efa3d5a7','14220896fd483fbeae58f2d69975acc99682be0c','11ca3aa17a2c0b1b6cfc0fb842105247272fbc8d','b524c040a6ab671b006713c8f117d494b11e92ce','9032e7dd5c12caaaf2baf259cee186aaaa67e0e7','aea756cf197079dc506242b729a1d16231644e31','7446d6b66ccedb48db489df92102a0cf439004ce','935849b22e851061994b7da0a7abb626cfe27cab','075cdcf1f8b05fe1a1306ae9702fb7442a76754c','c7d08dec7a358d06f64235f1f6189c0c53e7e75e','c0c7b3e8f7109cf2fef447c2ac28e1566a246a74','d95e3c1ce7b2b79e43654cc23a4a1fc65c084d82','49e2f750500035dfc265752923b58a26d743bc60','c9a6e8a5f0da04035a690465b85c49e1c7259390','7e0c780436a6c11fcdc39dfa30c7e40542bb4745','10b54008a6e2f12bbfcaa0d9e19c0f98d67dfb53','6cdd162096c7fb581b808d491baff3c1234b02e1','243a2da6a25d3d7641fac624e712f4c96376d23c','86ff3afe4315b87db9a5d1d566b029c775e62b94','e20f08402b6afc6d237e8261e512f89ce5299881','c48c5eae7882c00df9026ba16f890266291635f2','d055df57faa87a91d463956c4816bb9c67384c73','33cc450505dd8b55c690589d441a793bb8985f11','40077f2a5b88cf53f3a53485194fc29e39feb39b','10bd03da7b29a7ebe5e18e2163849c2521ae4555','39e7696382843bda945f5717030388257f54dad0','6d0edc9ca958384e4c608386588400b63f8cbc1a','0ec48786ebc1bf532930e5f442c83fc05d5ab873','763803287fa8300b3fd5a0285ce1ab6520640245','f9b350e5c8304caf954b333f54060cd1ab377b47','c82aa963e4443053afe065da586dc6f5df062f9f','a97946be8e03c386e23023e6b6184d11517fc4f5','5b1e9bf7ee6e6222b78d38d99ffd3d0281b930a3','252c0a3870902b1fdf15224188ffd5abf56ced5f','10f2c0e9041fe19c9aea3c9f6a61842372242691','a68fa9f51d285e08b95b34a1ad7ae303d1180cda','1553cebdf01dc953ed7983d39a18752a4fbb24d7','802e7c9b307082d9f15835722eb9ef2dee60ea5f','c7f41e79f00db5b41872c0ef1443094e7ad5bc22','ae3967a139a3ecf61ecbc59c8c769a2731626fac','3586a5a4a1d1d69b139d139b0823af4753bc3e8d','0e99e2603bc91553c252713108e30495d71c3f37','f9858d096fa1e68cce0742d125c551878d2d7020','225e87bce5a4518c3e5cd248ef93ebc39dba14e0','bb08b00b361470ce18b435c97aff4449dc98cc51','cd74b727c1c8233f98e325293a2307e882e10f41','367bf426c092467300f78e5d7526b5a95b490871','96630ff73c222ae5aa31c5d8d32391c00e01d4ae','efd159c8bb96c72857a1b23247240fef25c4bc16','302c14341a82cd1ed9c77beb7ad60ce574f764ff','40369d98631eb17e8ae0cad61d9b7d6dbcddf424','4285eba81853a6d9ea3121ffa93f1b68bb33c157','824bd03d81ed9d5c1d3effe1ea45db39c27d520e','5593651c759624a4b7d91f3e07fc3e02c9bc6642','8862cf5a3972eec607fabbac4bd1dcf5eb50c3f2','bdaf31925507cd81bace2411601cb50be9ed3339','7df307e7cede64fda865c44c0897fc6191ce788c','8f275021b4d57f5235abc4efa2f53d0c633a22d6','b3b17f7b0a43afc62fcc24602488f7c1535eafb1','4383e943d6be1525114a923c5c5c7875d3506f43','c47db9cd301d75cc4ff1f4f66a70efaf04d88d34','c02e6a5ec0971e7e860b61f3638baecfe8d12edc','b3e566664033b9b6c550d44627807a9c17ac0fec','e1b7c9e452fbd47b9f62901e2802d4880c9798d5','20b70b5e4c22aae23ed2f06f957d611b60a16e69','80275b0c1f6bd16a37660822a9accc973b9ad6f6','0707f977884170b8e752fb7956e658e60b96a39c','3634374d8c7b8c049cfeb6cc9cab3284103d7745','1cef2f6f416ac760843e475fdc3aca248fde2a64','bcc75b33353806f86f5ecb7137309fe33fbc39cf','2b2b5615880e8fdd80ec772540344d3bf9f6cf98','87f5714929355b5a84c5bd86ade881e98135bbb8','bc926c61b947962e23f1424d178e8b6caec63984','0f8650ed2fd554c65428eed896e5a6d0276ffe43','e6c000aaa91a5cf04f15a4b6775e17d1bd9143b7','6783594161f7848e42e7c89a32da546163892d75','9c23cc23237032d8decf39d3d886a300c9304707','985c2415bc39a322004bbba6817df37dcdf3f10b','649e75657bd308f81f93189a02efa6b9a7702902','d42bb3557b0fbbe59cf5f606445ba973d4a3d720','d0178734ef1a063624bfd6a737dba933a54bf63d','f6ac88b3fe1743a446da7e0ad895b8f46ea31b23','fb513439a4a4683ec8fc60dc5f2d5588bd656910','4ed828c62d9dcc18ecf8608c9c38708b0b89b83d','51bbdaeed5d24b370a3456040561f8cad226b1a7','45b8f97a3a29d8b1d5e7b7f2586189ead21873b7','1ca26210654f4c95e3f5a337922cd5e8b0694789','a2cd3e4d9dfccfe71bbf5780b537396b5f76c0d6','bb1450fbedebc1605f79eaa4dc501f47d1d7feb6','a9d29f0909132226fd57de4a55282f95682778fd','1fdf0dda892b230252ce864b5c7073ee09aa9165','af1c863ec4e65c29006a0c98ef0872950618a05e','18763f4dd0f9681f043e0124ac26b76795f8afad','499e8bdd759619c5c2248e854e7cd9148ff5fe6d','b442057918b0f6954cf88be6da17b0c5ace03382','8a4c1d1a49ab635498f581f8341f0f037178d01d','c4d806ce1a7cb0abe0cb26e6950839b47134dc68','189378cd03b029adb6e679b6a349124155c697b7','6c9b32168850736c788f14208a39e70272ccc54e','2e9cd7a39540b3bd1df32320556cec71585fb2df','15fee76589fa386fa841a369bf84eb5c75ec131a','689bc409ce3f93662f1223f16271f8ca9883c647','47097173fe23e65b63647777b53b0bdde6ce0f18','fcaa6c59f13ef6a3d6cafeaffaad71b017c34c3c','dd0a2f0c0e6fdcf01c7a917ea662a7ef1e953f11','b29fb15f9b7a448bb70ca27a4b1aac48c1d4f51f','0d91bcb1f42c1a7214168ee61e875166bd75d547','d561d1634333a05fe3428e355f6ab3d67b69ed44','6a13a34b36f6ea738d10b2a2da4958045c243fb7','ee49c31a8c40676f366959341cd98aecdcf9c14f','c541aa24beb8107a3726bd8b9e655ca8f95d7b48','7ae06c19dd24dea99940ceaed8dffdd0e24cd5f9','6d2029f0e2404dcc7f836481cef6bf56f060b248','5c5a26c8bcb37a214c47f4b6d9843de20a8fb7e1','3ee633bf4e4eadc2b70c6eebfa14c600435604c9','ad5d10a0d7d8fc98040ff33f1db197735d6d3d52','2bde3ac14192be5f4e664c2b01b5aaa57c14e347','a87a03c8c3a06269e6ff8d11e142f6ebb05e9306','190325aed218711647eae5581a1f629c76da297c','e244d9f1edb6275b69c4a832620b9439d39bfb22','751f7c9538b9fd00f5c7dd0ed59df07f4d51fdac','762904de405fa26afdd39e024395a441bc6a0f8a','4df21df646897816e166b3dd829a8a3e21157f22','9c241f721c1f6677d736b37ecd86bb230df329df','96ebedcc684f27f984cc7be467c908bdab2470a9','419cfbd87ad35c1d43214b122630cfde1c3ccf1b','cf75ace0d7531b8daa271001dbf92b93b0b4490c','a058b4bb03a689ce8528ed412d62cdd5bb879571','d7c871c41c9db40312ffc5af996ede62ecdfc579','6c353ee8f48c1227eeab81279dc3eb3890c9c3bd','fea28aab54637701c5dfaef4f3fe64c72b272e1c','ecd79b7eb7af2bb4dadf710f70e0d78f62adc40e','43917824cc1d9b5a65601f46e13a0779c3dcff4e','5423bb28649f37e70a0559cba78c3b253a60c277','2c091a50dfd31e766a5a629c0b7c21973e33319d','920feb4f9d1032dcec2abc5c526e4996f642968b','31b9b446263cd5b7a844d43f2a235ed9b0c53efb','dbb5127246fee18718bcffc6cf0730674d12b98a','3872a4cfeba7651f0671de7e5f3922fd5053837b','2fbcb2db61b6416cdf46e0526e1929d146ab3da7','999da234e770bbf681a819423d04ea57415d9bbc','6fc6be53a87bbb2d2a51a5617009063002321d09','b0de72088fa3e543572329eda36fa4bd16e29fa3','2a6d8110b8148a9aa83db81dc38d544becea2fa9','6556aaaca3956eafbc1660bce50a2f3568f1bff6','8ba3d2c7712e9c0484a4cafc8b0ca6f35d8f11ed',];
+ var tests = {
+ "6d8b9d29f1890d59ef2453cff3f6d57b7e398c5c":[async_test('html5lib_tests16.html 6d8b9d29f1890d59ef2453cff3f6d57b7e398c5c'), "%3C%21doctype%20html%3E%3Cscript%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%3Cbody%3E"],"5d4ac4961f9d52a42f309886d16fbe9c55c198bb":[async_test('html5lib_tests16.html 5d4ac4961f9d52a42f309886d16fbe9c55c198bb'), "%3C%21doctype%20html%3E%3Cscript%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%3Cbody%3E"],"132c6e3cd2659e15b69904c67981a04e81fabe78":[async_test('html5lib_tests16.html 132c6e3cd2659e15b69904c67981a04e81fabe78'), "%3C%21doctype%20html%3E%3Cscript%3E%3C", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%22%0A%7C%20%20%20%3Cbody%3E"],"bf0b3062e7cbe684380581919947333beef23a8c":[async_test('html5lib_tests16.html bf0b3062e7cbe684380581919947333beef23a8c'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/%22%0A%7C%20%20%20%3Cbody%3E"],"cd76a82b9a4bde442e4f8819b37e6308e3eef8f5":[async_test('html5lib_tests16.html cd76a82b9a4bde442e4f8819b37e6308e3eef8f5'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/S", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/S%22%0A%7C%20%20%20%3Cbody%3E"],"747087d5bf2fe9a8a6c0ecf822211d93a4e0cc2a":[async_test('html5lib_tests16.html 747087d5bf2fe9a8a6c0ecf822211d93a4e0cc2a'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/SC", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/SC%22%0A%7C%20%20%20%3Cbody%3E"],"413482922b0185970bfdd6008e6a0e70ad1b554f":[async_test('html5lib_tests16.html 413482922b0185970bfdd6008e6a0e70ad1b554f'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/SCR", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/SCR%22%0A%7C%20%20%20%3Cbody%3E"],"0e3cc8b1f36a34fb3048bb4f01e0e7fec678ceef":[async_test('html5lib_tests16.html 0e3cc8b1f36a34fb3048bb4f01e0e7fec678ceef'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/SCRI", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/SCRI%22%0A%7C%20%20%20%3Cbody%3E"],"3d7a659a8880588e831c7198867b65ac2a974353":[async_test('html5lib_tests16.html 3d7a659a8880588e831c7198867b65ac2a974353'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/SCRIP", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/SCRIP%22%0A%7C%20%20%20%3Cbody%3E"],"46914793d44763c3cd37c3aef0c3689d826602d1":[async_test('html5lib_tests16.html 46914793d44763c3cd37c3aef0c3689d826602d1'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/SCRIPT", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/SCRIPT%22%0A%7C%20%20%20%3Cbody%3E"],"bc8ed1aea5ac5d7eac284386a5defe779eeab3d7":[async_test('html5lib_tests16.html bc8ed1aea5ac5d7eac284386a5defe779eeab3d7'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/SCRIPT%20", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%3Cbody%3E"],"48e7e206aade47bdd9ad3a7cce2c9c86fb4227f6":[async_test('html5lib_tests16.html 48e7e206aade47bdd9ad3a7cce2c9c86fb4227f6'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/s", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/s%22%0A%7C%20%20%20%3Cbody%3E"],"cc10f706cec3e9356f8c42f77b970f669f74be03":[async_test('html5lib_tests16.html cc10f706cec3e9356f8c42f77b970f669f74be03'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/sc", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/sc%22%0A%7C%20%20%20%3Cbody%3E"],"9a6506b01fabf7ba73bb5c90f11b3898c2f119fa":[async_test('html5lib_tests16.html 9a6506b01fabf7ba73bb5c90f11b3898c2f119fa'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/scr", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/scr%22%0A%7C%20%20%20%3Cbody%3E"],"f840264cf775999580e621a83d34af302e139632":[async_test('html5lib_tests16.html f840264cf775999580e621a83d34af302e139632'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/scri", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/scri%22%0A%7C%20%20%20%3Cbody%3E"],"efe27c508629d48cf36861e680918f11f48aad15":[async_test('html5lib_tests16.html efe27c508629d48cf36861e680918f11f48aad15'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/scrip", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/scrip%22%0A%7C%20%20%20%3Cbody%3E"],"c51f18f140335e61f0158fadd282fb0f0c75bee6":[async_test('html5lib_tests16.html c51f18f140335e61f0158fadd282fb0f0c75bee6'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/script", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/script%22%0A%7C%20%20%20%3Cbody%3E"],"76d621ce4bd9e462bacaa40ebf43e1ccb569bd21":[async_test('html5lib_tests16.html 76d621ce4bd9e462bacaa40ebf43e1ccb569bd21'), "%3C%21doctype%20html%3E%3Cscript%3E%3C/script%20", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%3Cbody%3E"],"70e4352779315880955134dfe67c53acb76c4850":[async_test('html5lib_tests16.html 70e4352779315880955134dfe67c53acb76c4850'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21%22%0A%7C%20%20%20%3Cbody%3E"],"b05be3f93446c26026591cbfee84b9603cd6f151":[async_test('html5lib_tests16.html b05be3f93446c26026591cbfee84b9603cd6f151'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21a", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21a%22%0A%7C%20%20%20%3Cbody%3E"],"3f08f2e2326b621f819b73336f502610dd94d54f":[async_test('html5lib_tests16.html 3f08f2e2326b621f819b73336f502610dd94d54f'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21-", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21-%22%0A%7C%20%20%20%3Cbody%3E"],"4932d705ce9c31d4141a630d305e16ae130982e7":[async_test('html5lib_tests16.html 4932d705ce9c31d4141a630d305e16ae130982e7'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21-a", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21-a%22%0A%7C%20%20%20%3Cbody%3E"],"accb817d72edbb0d9f72e2c44f47055fb1719d0a":[async_test('html5lib_tests16.html accb817d72edbb0d9f72e2c44f47055fb1719d0a'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%3Cbody%3E"],"b7b2e78af3f5846dc7f67246c92d95aacc2bd996":[async_test('html5lib_tests16.html b7b2e78af3f5846dc7f67246c92d95aacc2bd996'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--a", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--a%22%0A%7C%20%20%20%3Cbody%3E"],"52e03d2903a9556823275541c58c173ac077a2a9":[async_test('html5lib_tests16.html 52e03d2903a9556823275541c58c173ac077a2a9'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3C", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3C%22%0A%7C%20%20%20%3Cbody%3E"],"1daec6e34a3b4b4ea28f3e90595052090e67cbf7":[async_test('html5lib_tests16.html 1daec6e34a3b4b4ea28f3e90595052090e67cbf7'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Ca", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Ca%22%0A%7C%20%20%20%3Cbody%3E"],"539e26d76efe146f95bd7b6bfa88ae2d29afd35a":[async_test('html5lib_tests16.html 539e26d76efe146f95bd7b6bfa88ae2d29afd35a'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3C/", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3C/%22%0A%7C%20%20%20%3Cbody%3E"],"ab43ce067468a33bb658e0d6cc542b9dbcd0c80f":[async_test('html5lib_tests16.html ab43ce067468a33bb658e0d6cc542b9dbcd0c80f'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3C/script", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3C/script%22%0A%7C%20%20%20%3Cbody%3E"],"3f93565e7a692675cc519326cc4122b5ea44b533":[async_test('html5lib_tests16.html 3f93565e7a692675cc519326cc4122b5ea44b533'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3C/script%20", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%3Cbody%3E"],"e579c03d00de7a95bad40602af783b4d7775ab78":[async_test('html5lib_tests16.html e579c03d00de7a95bad40602af783b4d7775ab78'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cs", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cs%22%0A%7C%20%20%20%3Cbody%3E"],"1541ebd513bc357af538635050f1b3ec854648e5":[async_test('html5lib_tests16.html 1541ebd513bc357af538635050f1b3ec854648e5'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%22%0A%7C%20%20%20%3Cbody%3E"],"ae91f664e0c85f63d21dddaa03a9104d27a9d5ce":[async_test('html5lib_tests16.html ae91f664e0c85f63d21dddaa03a9104d27a9d5ce'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%22%0A%7C%20%20%20%3Cbody%3E"],"17b1bf0912a302c2bed5358791fae3ea6d3efa7d":[async_test('html5lib_tests16.html 17b1bf0912a302c2bed5358791fae3ea6d3efa7d'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C%22%0A%7C%20%20%20%3Cbody%3E"],"beac9d7ec99b6317c8504e80118dd0f2d5fad573":[async_test('html5lib_tests16.html beac9d7ec99b6317c8504e80118dd0f2d5fad573'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3Ca", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3Ca%22%0A%7C%20%20%20%3Cbody%3E"],"d5ead5851ba4d1cdac136d97a449e6b48b0c2cb4":[async_test('html5lib_tests16.html d5ead5851ba4d1cdac136d97a449e6b48b0c2cb4'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/%22%0A%7C%20%20%20%3Cbody%3E"],"17fe63597371d22c41ccbc4abcd8f468373559d7":[async_test('html5lib_tests16.html 17fe63597371d22c41ccbc4abcd8f468373559d7'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/s", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/s%22%0A%7C%20%20%20%3Cbody%3E"],"26a585731ba7caa063ad5c87a09748a223e56639":[async_test('html5lib_tests16.html 26a585731ba7caa063ad5c87a09748a223e56639'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/script", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%22%0A%7C%20%20%20%3Cbody%3E"],"91dc36fa03b62334c115db6d4b4a420ef1081753":[async_test('html5lib_tests16.html 91dc36fa03b62334c115db6d4b4a420ef1081753'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/scripta", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/scripta%22%0A%7C%20%20%20%3Cbody%3E"],"b0ee0820468ee622b802020e20be120d3c534af2":[async_test('html5lib_tests16.html b0ee0820468ee622b802020e20be120d3c534af2'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%22%0A%7C%20%20%20%3Cbody%3E"],"65907331b39d13cc2128eb57afb7185f0173a953":[async_test('html5lib_tests16.html 65907331b39d13cc2128eb57afb7185f0173a953'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/script%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%3E%22%0A%7C%20%20%20%3Cbody%3E"],"c284310f4becf9d64252eaec25fe46de8c6e4f2c":[async_test('html5lib_tests16.html c284310f4becf9d64252eaec25fe46de8c6e4f2c'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/script/", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script/%22%0A%7C%20%20%20%3Cbody%3E"],"63bbe135b3dbb75f2262ce1cc5e9259634596a55":[async_test('html5lib_tests16.html 63bbe135b3dbb75f2262ce1cc5e9259634596a55'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3C", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%3C%22%0A%7C%20%20%20%3Cbody%3E"],"c83e5a48a9409482b62903960b0a04a932832668":[async_test('html5lib_tests16.html c83e5a48a9409482b62903960b0a04a932832668'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3Ca", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%3Ca%22%0A%7C%20%20%20%3Cbody%3E"],"193aa9aa570a39d74e340e8d6ddd015ee0a7477c":[async_test('html5lib_tests16.html 193aa9aa570a39d74e340e8d6ddd015ee0a7477c'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3C/", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%3C/%22%0A%7C%20%20%20%3Cbody%3E"],"0ce3d12fa6ac40027b789b09fd987194426e09e6":[async_test('html5lib_tests16.html 0ce3d12fa6ac40027b789b09fd987194426e09e6'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3C/script", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%3C/script%22%0A%7C%20%20%20%3Cbody%3E"],"fd613c2eb713e158fae7a54c45a3d952efa3d5a7":[async_test('html5lib_tests16.html fd613c2eb713e158fae7a54c45a3d952efa3d5a7'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3C/script%20", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%22%0A%7C%20%20%20%3Cbody%3E"],"14220896fd483fbeae58f2d69975acc99682be0c":[async_test('html5lib_tests16.html 14220896fd483fbeae58f2d69975acc99682be0c'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3C/script/", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%22%0A%7C%20%20%20%3Cbody%3E"],"11ca3aa17a2c0b1b6cfc0fb842105247272fbc8d":[async_test('html5lib_tests16.html 11ca3aa17a2c0b1b6cfc0fb842105247272fbc8d'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3C/script%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%22%0A%7C%20%20%20%3Cbody%3E"],"b524c040a6ab671b006713c8f117d494b11e92ce":[async_test('html5lib_tests16.html b524c040a6ab671b006713c8f117d494b11e92ce'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20-", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20-%22%0A%7C%20%20%20%3Cbody%3E"],"9032e7dd5c12caaaf2baf259cee186aaaa67e0e7":[async_test('html5lib_tests16.html 9032e7dd5c12caaaf2baf259cee186aaaa67e0e7'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20-a", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20-a%22%0A%7C%20%20%20%3Cbody%3E"],"aea756cf197079dc506242b729a1d16231644e31":[async_test('html5lib_tests16.html aea756cf197079dc506242b729a1d16231644e31'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20-%3C", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20-%3C%22%0A%7C%20%20%20%3Cbody%3E"],"7446d6b66ccedb48db489df92102a0cf439004ce":[async_test('html5lib_tests16.html 7446d6b66ccedb48db489df92102a0cf439004ce'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20--", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%22%0A%7C%20%20%20%3Cbody%3E"],"935849b22e851061994b7da0a7abb626cfe27cab":[async_test('html5lib_tests16.html 935849b22e851061994b7da0a7abb626cfe27cab'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20--a", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--a%22%0A%7C%20%20%20%3Cbody%3E"],"075cdcf1f8b05fe1a1306ae9702fb7442a76754c":[async_test('html5lib_tests16.html 075cdcf1f8b05fe1a1306ae9702fb7442a76754c'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20--%3C", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3C%22%0A%7C%20%20%20%3Cbody%3E"],"c7d08dec7a358d06f64235f1f6189c0c53e7e75e":[async_test('html5lib_tests16.html c7d08dec7a358d06f64235f1f6189c0c53e7e75e'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"c0c7b3e8f7109cf2fef447c2ac28e1566a246a74":[async_test('html5lib_tests16.html c0c7b3e8f7109cf2fef447c2ac28e1566a246a74'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20--%3E%3C", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%3C%22%0A%7C%20%20%20%3Cbody%3E"],"d95e3c1ce7b2b79e43654cc23a4a1fc65c084d82":[async_test('html5lib_tests16.html d95e3c1ce7b2b79e43654cc23a4a1fc65c084d82'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20--%3E%3C/", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%3C/%22%0A%7C%20%20%20%3Cbody%3E"],"49e2f750500035dfc265752923b58a26d743bc60":[async_test('html5lib_tests16.html 49e2f750500035dfc265752923b58a26d743bc60'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20--%3E%3C/script", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%3C/script%22%0A%7C%20%20%20%3Cbody%3E"],"c9a6e8a5f0da04035a690465b85c49e1c7259390":[async_test('html5lib_tests16.html c9a6e8a5f0da04035a690465b85c49e1c7259390'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20--%3E%3C/script%20", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"7e0c780436a6c11fcdc39dfa30c7e40542bb4745":[async_test('html5lib_tests16.html 7e0c780436a6c11fcdc39dfa30c7e40542bb4745'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20--%3E%3C/script/", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"10b54008a6e2f12bbfcaa0d9e19c0f98d67dfb53":[async_test('html5lib_tests16.html 10b54008a6e2f12bbfcaa0d9e19c0f98d67dfb53'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%20--%3E%3C/script%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"6cdd162096c7fb581b808d491baff3c1234b02e1":[async_test('html5lib_tests16.html 6cdd162096c7fb581b808d491baff3c1234b02e1'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%3E%3C%5C/script%3E--%3E%3C/script%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C%5C/script%3E--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"243a2da6a25d3d7641fac624e712f4c96376d23c":[async_test('html5lib_tests16.html 243a2da6a25d3d7641fac624e712f4c96376d23c'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%3E%3C/scr%27%2B%27ipt%3E--%3E%3C/script%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/scr%27%2B%27ipt%3E--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"86ff3afe4315b87db9a5d1d566b029c775e62b94":[async_test('html5lib_tests16.html 86ff3afe4315b87db9a5d1d566b029c775e62b94'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E%3C/script%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E%22%0A%7C%20%20%20%3Cbody%3E"],"e20f08402b6afc6d237e8261e512f89ce5299881":[async_test('html5lib_tests16.html e20f08402b6afc6d237e8261e512f89ce5299881'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E--%3E%3C%21--%3C/script%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E--%3E%3C%21--%22%0A%7C%20%20%20%3Cbody%3E"],"c48c5eae7882c00df9026ba16f890266291635f2":[async_test('html5lib_tests16.html c48c5eae7882c00df9026ba16f890266291635f2'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E--%20%3E%3C/script%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E--%20%3E%22%0A%7C%20%20%20%3Cbody%3E"],"d055df57faa87a91d463956c4816bb9c67384c73":[async_test('html5lib_tests16.html d055df57faa87a91d463956c4816bb9c67384c73'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E-%20-%3E%3C/script%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E-%20-%3E%22%0A%7C%20%20%20%3Cbody%3E"],"33cc450505dd8b55c690589d441a793bb8985f11":[async_test('html5lib_tests16.html 33cc450505dd8b55c690589d441a793bb8985f11'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E-%20-%20%3E%3C/script%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E-%20-%20%3E%22%0A%7C%20%20%20%3Cbody%3E"],"40077f2a5b88cf53f3a53485194fc29e39feb39b":[async_test('html5lib_tests16.html 40077f2a5b88cf53f3a53485194fc29e39feb39b'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E-%3E%3C/script%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E-%3E%22%0A%7C%20%20%20%3Cbody%3E"],"10bd03da7b29a7ebe5e18e2163849c2521ae4555":[async_test('html5lib_tests16.html 10bd03da7b29a7ebe5e18e2163849c2521ae4555'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%3E--%21%3E%3C/script%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E--%21%3E%3C/script%3EX%22%0A%7C%20%20%20%3Cbody%3E"],"39e7696382843bda945f5717030388257f54dad0":[async_test('html5lib_tests16.html 39e7696382843bda945f5717030388257f54dad0'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscr%27%2B%27ipt%3E%3C/script%3E--%3E%3C/script%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscr%27%2B%27ipt%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"6d0edc9ca958384e4c608386588400b63f8cbc1a":[async_test('html5lib_tests16.html 6d0edc9ca958384e4c608386588400b63f8cbc1a'), "%3C%21doctype%20html%3E%3Cscript%3E%3C%21--%3Cscript%3E%3C/scr%27%2B%27ipt%3E%3C/script%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/scr%27%2B%27ipt%3E%3C/script%3EX%22%0A%7C%20%20%20%3Cbody%3E"],"0ec48786ebc1bf532930e5f442c83fc05d5ab873":[async_test('html5lib_tests16.html 0ec48786ebc1bf532930e5f442c83fc05d5ab873'), "%3C%21doctype%20html%3E%3Cstyle%3E%3C%21--%3Cstyle%3E%3C/style%3E--%3E%3C/style%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cstyle%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"763803287fa8300b3fd5a0285ce1ab6520640245":[async_test('html5lib_tests16.html 763803287fa8300b3fd5a0285ce1ab6520640245'), "%3C%21doctype%20html%3E%3Cstyle%3E%3C%21--%3C/style%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22"],"f9b350e5c8304caf954b333f54060cd1ab377b47":[async_test('html5lib_tests16.html f9b350e5c8304caf954b333f54060cd1ab377b47'), "%3C%21doctype%20html%3E%3Cstyle%3E%3C%21--...%3C/style%3E...--%3E%3C/style%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--...%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22...--%3E%22"],"c82aa963e4443053afe065da586dc6f5df062f9f":[async_test('html5lib_tests16.html c82aa963e4443053afe065da586dc6f5df062f9f'), "%3C%21doctype%20html%3E%3Cstyle%3E%3C%21--%3Cbr%3E%3Chtml%20xmlns%3Av%3D%22urn%3Aschemas-microsoft-com%3Avml%22%3E%3C%21--%5Bif%20%21mso%5D%3E%3Cstyle%3E%3C/style%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cbr%3E%3Chtml%20xmlns%3Av%3D%22urn%3Aschemas-microsoft-com%3Avml%22%3E%3C%21--%5Bif%20%21mso%5D%3E%3Cstyle%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22"],"a97946be8e03c386e23023e6b6184d11517fc4f5":[async_test('html5lib_tests16.html a97946be8e03c386e23023e6b6184d11517fc4f5'), "%3C%21doctype%20html%3E%3Cstyle%3E%3C%21--...%3Cstyle%3E%3C%21--...--%21%3E%3C/style%3E--%3E%3C/style%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--...%3Cstyle%3E%3C%21--...--%21%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"5b1e9bf7ee6e6222b78d38d99ffd3d0281b930a3":[async_test('html5lib_tests16.html 5b1e9bf7ee6e6222b78d38d99ffd3d0281b930a3'), "%3C%21doctype%20html%3E%3Cstyle%3E%3C%21--...%3C/style%3E%3C%21--%20--%3E%3Cstyle%3E%40import%20...%3C/style%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--...%22%0A%7C%20%20%20%20%20%3C%21--%20%20%20--%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%40import%20...%22%0A%7C%20%20%20%3Cbody%3E"],"252c0a3870902b1fdf15224188ffd5abf56ced5f":[async_test('html5lib_tests16.html 252c0a3870902b1fdf15224188ffd5abf56ced5f'), "%3C%21doctype%20html%3E%3Cstyle%3E...%3Cstyle%3E%3C%21--...%3C/style%3E%3C%21--%20--%3E%3C/style%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22...%3Cstyle%3E%3C%21--...%22%0A%7C%20%20%20%20%20%3C%21--%20%20%20--%3E%0A%7C%20%20%20%3Cbody%3E"],"10f2c0e9041fe19c9aea3c9f6a61842372242691":[async_test('html5lib_tests16.html 10f2c0e9041fe19c9aea3c9f6a61842372242691'), "%3C%21doctype%20html%3E%3Cstyle%3E...%3C%21--%5Bif%20IE%5D%3E%3Cstyle%3E...%3C/style%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22...%3C%21--%5Bif%20IE%5D%3E%3Cstyle%3E...%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22"],"a68fa9f51d285e08b95b34a1ad7ae303d1180cda":[async_test('html5lib_tests16.html a68fa9f51d285e08b95b34a1ad7ae303d1180cda'), "%3C%21doctype%20html%3E%3Ctitle%3E%3C%21--%3Ctitle%3E%3C/title%3E--%3E%3C/title%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Ctitle%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"1553cebdf01dc953ed7983d39a18752a4fbb24d7":[async_test('html5lib_tests16.html 1553cebdf01dc953ed7983d39a18752a4fbb24d7'), "%3C%21doctype%20html%3E%3Ctitle%3E%26lt%3B/title%3E%3C/title%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%3C/title%3E%22%0A%7C%20%20%20%3Cbody%3E"],"802e7c9b307082d9f15835722eb9ef2dee60ea5f":[async_test('html5lib_tests16.html 802e7c9b307082d9f15835722eb9ef2dee60ea5f'), "%3C%21doctype%20html%3E%3Ctitle%3Efoo/title%3E%3Clink%3E%3C/head%3E%3Cbody%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22foo/title%3E%3Clink%3E%3C/head%3E%3Cbody%3EX%22%0A%7C%20%20%20%3Cbody%3E"],"c7f41e79f00db5b41872c0ef1443094e7ad5bc22":[async_test('html5lib_tests16.html c7f41e79f00db5b41872c0ef1443094e7ad5bc22'), "%3C%21doctype%20html%3E%3Cnoscript%3E%3C%21--%3Cnoscript%3E%3C/noscript%3E--%3E%3C/noscript%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cnoscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cnoscript%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"ae3967a139a3ecf61ecbc59c8c769a2731626fac":[async_test('html5lib_tests16.html ae3967a139a3ecf61ecbc59c8c769a2731626fac'), "%3C%21doctype%20html%3E%3Cnoscript%3E%3C%21--%3C/noscript%3EX%3Cnoscript%3E--%3E%3C/noscript%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cnoscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%3Cnoscript%3E%0A%7C%20%20%20%20%20%20%20%22--%3E%22"],"3586a5a4a1d1d69b139d139b0823af4753bc3e8d":[async_test('html5lib_tests16.html 3586a5a4a1d1d69b139d139b0823af4753bc3e8d'), "%3C%21doctype%20html%3E%3Cnoscript%3E%3Ciframe%3E%3C/noscript%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cnoscript%3E%0A%7C%20%20%20%20%20%20%20%22%3Ciframe%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22"],"0e99e2603bc91553c252713108e30495d71c3f37":[async_test('html5lib_tests16.html 0e99e2603bc91553c252713108e30495d71c3f37'), "%3C%21doctype%20html%3E%3Cnoframes%3E%3C%21--%3Cnoframes%3E%3C/noframes%3E--%3E%3C/noframes%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cnoframes%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cnoframes%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"f9858d096fa1e68cce0742d125c551878d2d7020":[async_test('html5lib_tests16.html f9858d096fa1e68cce0742d125c551878d2d7020'), "%3C%21doctype%20html%3E%3Cnoframes%3E%3Cbody%3E%3Cscript%3E%3C%21--...%3C/script%3E%3C/body%3E%3C/noframes%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cnoframes%3E%0A%7C%20%20%20%20%20%20%20%22%3Cbody%3E%3Cscript%3E%3C%21--...%3C/script%3E%3C/body%3E%22%0A%7C%20%20%20%3Cbody%3E"],"225e87bce5a4518c3e5cd248ef93ebc39dba14e0":[async_test('html5lib_tests16.html 225e87bce5a4518c3e5cd248ef93ebc39dba14e0'), "%3C%21doctype%20html%3E%3Ctextarea%3E%3C%21--%3Ctextarea%3E%3C/textarea%3E--%3E%3C/textarea%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Ctextarea%3E%22%0A%7C%20%20%20%20%20%22--%3E%22"],"bb08b00b361470ce18b435c97aff4449dc98cc51":[async_test('html5lib_tests16.html bb08b00b361470ce18b435c97aff4449dc98cc51'), "%3C%21doctype%20html%3E%3Ctextarea%3E%26lt%3B/textarea%3E%3C/textarea%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22%3C/textarea%3E%22"],"cd74b727c1c8233f98e325293a2307e882e10f41":[async_test('html5lib_tests16.html cd74b727c1c8233f98e325293a2307e882e10f41'), "%3C%21doctype%20html%3E%3Ctextarea%3E%26lt%3B%3C/textarea%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22%3C%22"],"367bf426c092467300f78e5d7526b5a95b490871":[async_test('html5lib_tests16.html 367bf426c092467300f78e5d7526b5a95b490871'), "%3C%21doctype%20html%3E%3Ctextarea%3Ea%26lt%3Bb%3C/textarea%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22a%3Cb%22"],"96630ff73c222ae5aa31c5d8d32391c00e01d4ae":[async_test('html5lib_tests16.html 96630ff73c222ae5aa31c5d8d32391c00e01d4ae'), "%3C%21doctype%20html%3E%3Ciframe%3E%3C%21--%3Ciframe%3E%3C/iframe%3E--%3E%3C/iframe%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ciframe%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Ciframe%3E%22%0A%7C%20%20%20%20%20%22--%3E%22"],"efd159c8bb96c72857a1b23247240fef25c4bc16":[async_test('html5lib_tests16.html efd159c8bb96c72857a1b23247240fef25c4bc16'), "%3C%21doctype%20html%3E%3Ciframe%3E...%3C%21--X-%3E...%3C%21--/X-%3E...%3C/iframe%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ciframe%3E%0A%7C%20%20%20%20%20%20%20%22...%3C%21--X-%3E...%3C%21--/X-%3E...%22"],"302c14341a82cd1ed9c77beb7ad60ce574f764ff":[async_test('html5lib_tests16.html 302c14341a82cd1ed9c77beb7ad60ce574f764ff'), "%3C%21doctype%20html%3E%3Cxmp%3E%3C%21--%3Cxmp%3E%3C/xmp%3E--%3E%3C/xmp%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cxmp%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cxmp%3E%22%0A%7C%20%20%20%20%20%22--%3E%22"],"40369d98631eb17e8ae0cad61d9b7d6dbcddf424":[async_test('html5lib_tests16.html 40369d98631eb17e8ae0cad61d9b7d6dbcddf424'), "%3C%21doctype%20html%3E%3Cnoembed%3E%3C%21--%3Cnoembed%3E%3C/noembed%3E--%3E%3C/noembed%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cnoembed%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cnoembed%3E%22%0A%7C%20%20%20%20%20%22--%3E%22"],"4285eba81853a6d9ea3121ffa93f1b68bb33c157":[async_test('html5lib_tests16.html 4285eba81853a6d9ea3121ffa93f1b68bb33c157'), "%3Cscript%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%3Cbody%3E"],"824bd03d81ed9d5c1d3effe1ea45db39c27d520e":[async_test('html5lib_tests16.html 824bd03d81ed9d5c1d3effe1ea45db39c27d520e'), "%3Cscript%3Ea", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%3Cbody%3E"],"5593651c759624a4b7d91f3e07fc3e02c9bc6642":[async_test('html5lib_tests16.html 5593651c759624a4b7d91f3e07fc3e02c9bc6642'), "%3Cscript%3E%3C", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%22%0A%7C%20%20%20%3Cbody%3E"],"8862cf5a3972eec607fabbac4bd1dcf5eb50c3f2":[async_test('html5lib_tests16.html 8862cf5a3972eec607fabbac4bd1dcf5eb50c3f2'), "%3Cscript%3E%3C/", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/%22%0A%7C%20%20%20%3Cbody%3E"],"bdaf31925507cd81bace2411601cb50be9ed3339":[async_test('html5lib_tests16.html bdaf31925507cd81bace2411601cb50be9ed3339'), "%3Cscript%3E%3C/S", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/S%22%0A%7C%20%20%20%3Cbody%3E"],"7df307e7cede64fda865c44c0897fc6191ce788c":[async_test('html5lib_tests16.html 7df307e7cede64fda865c44c0897fc6191ce788c'), "%3Cscript%3E%3C/SC", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/SC%22%0A%7C%20%20%20%3Cbody%3E"],"8f275021b4d57f5235abc4efa2f53d0c633a22d6":[async_test('html5lib_tests16.html 8f275021b4d57f5235abc4efa2f53d0c633a22d6'), "%3Cscript%3E%3C/SCR", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/SCR%22%0A%7C%20%20%20%3Cbody%3E"],"b3b17f7b0a43afc62fcc24602488f7c1535eafb1":[async_test('html5lib_tests16.html b3b17f7b0a43afc62fcc24602488f7c1535eafb1'), "%3Cscript%3E%3C/SCRI", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/SCRI%22%0A%7C%20%20%20%3Cbody%3E"],"4383e943d6be1525114a923c5c5c7875d3506f43":[async_test('html5lib_tests16.html 4383e943d6be1525114a923c5c5c7875d3506f43'), "%3Cscript%3E%3C/SCRIP", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/SCRIP%22%0A%7C%20%20%20%3Cbody%3E"],"c47db9cd301d75cc4ff1f4f66a70efaf04d88d34":[async_test('html5lib_tests16.html c47db9cd301d75cc4ff1f4f66a70efaf04d88d34'), "%3Cscript%3E%3C/SCRIPT", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/SCRIPT%22%0A%7C%20%20%20%3Cbody%3E"],"c02e6a5ec0971e7e860b61f3638baecfe8d12edc":[async_test('html5lib_tests16.html c02e6a5ec0971e7e860b61f3638baecfe8d12edc'), "%3Cscript%3E%3C/SCRIPT%20", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%3Cbody%3E"],"b3e566664033b9b6c550d44627807a9c17ac0fec":[async_test('html5lib_tests16.html b3e566664033b9b6c550d44627807a9c17ac0fec'), "%3Cscript%3E%3C/s", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/s%22%0A%7C%20%20%20%3Cbody%3E"],"e1b7c9e452fbd47b9f62901e2802d4880c9798d5":[async_test('html5lib_tests16.html e1b7c9e452fbd47b9f62901e2802d4880c9798d5'), "%3Cscript%3E%3C/sc", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/sc%22%0A%7C%20%20%20%3Cbody%3E"],"20b70b5e4c22aae23ed2f06f957d611b60a16e69":[async_test('html5lib_tests16.html 20b70b5e4c22aae23ed2f06f957d611b60a16e69'), "%3Cscript%3E%3C/scr", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/scr%22%0A%7C%20%20%20%3Cbody%3E"],"80275b0c1f6bd16a37660822a9accc973b9ad6f6":[async_test('html5lib_tests16.html 80275b0c1f6bd16a37660822a9accc973b9ad6f6'), "%3Cscript%3E%3C/scri", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/scri%22%0A%7C%20%20%20%3Cbody%3E"],"0707f977884170b8e752fb7956e658e60b96a39c":[async_test('html5lib_tests16.html 0707f977884170b8e752fb7956e658e60b96a39c'), "%3Cscript%3E%3C/scrip", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/scrip%22%0A%7C%20%20%20%3Cbody%3E"],"3634374d8c7b8c049cfeb6cc9cab3284103d7745":[async_test('html5lib_tests16.html 3634374d8c7b8c049cfeb6cc9cab3284103d7745'), "%3Cscript%3E%3C/script", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/script%22%0A%7C%20%20%20%3Cbody%3E"],"1cef2f6f416ac760843e475fdc3aca248fde2a64":[async_test('html5lib_tests16.html 1cef2f6f416ac760843e475fdc3aca248fde2a64'), "%3Cscript%3E%3C/script%20", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%3Cbody%3E"],"bcc75b33353806f86f5ecb7137309fe33fbc39cf":[async_test('html5lib_tests16.html bcc75b33353806f86f5ecb7137309fe33fbc39cf'), "%3Cscript%3E%3C%21", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21%22%0A%7C%20%20%20%3Cbody%3E"],"2b2b5615880e8fdd80ec772540344d3bf9f6cf98":[async_test('html5lib_tests16.html 2b2b5615880e8fdd80ec772540344d3bf9f6cf98'), "%3Cscript%3E%3C%21a", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21a%22%0A%7C%20%20%20%3Cbody%3E"],"87f5714929355b5a84c5bd86ade881e98135bbb8":[async_test('html5lib_tests16.html 87f5714929355b5a84c5bd86ade881e98135bbb8'), "%3Cscript%3E%3C%21-", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21-%22%0A%7C%20%20%20%3Cbody%3E"],"bc926c61b947962e23f1424d178e8b6caec63984":[async_test('html5lib_tests16.html bc926c61b947962e23f1424d178e8b6caec63984'), "%3Cscript%3E%3C%21-a", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21-a%22%0A%7C%20%20%20%3Cbody%3E"],"0f8650ed2fd554c65428eed896e5a6d0276ffe43":[async_test('html5lib_tests16.html 0f8650ed2fd554c65428eed896e5a6d0276ffe43'), "%3Cscript%3E%3C%21--", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%3Cbody%3E"],"e6c000aaa91a5cf04f15a4b6775e17d1bd9143b7":[async_test('html5lib_tests16.html e6c000aaa91a5cf04f15a4b6775e17d1bd9143b7'), "%3Cscript%3E%3C%21--a", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--a%22%0A%7C%20%20%20%3Cbody%3E"],"6783594161f7848e42e7c89a32da546163892d75":[async_test('html5lib_tests16.html 6783594161f7848e42e7c89a32da546163892d75'), "%3Cscript%3E%3C%21--%3C", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3C%22%0A%7C%20%20%20%3Cbody%3E"],"9c23cc23237032d8decf39d3d886a300c9304707":[async_test('html5lib_tests16.html 9c23cc23237032d8decf39d3d886a300c9304707'), "%3Cscript%3E%3C%21--%3Ca", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Ca%22%0A%7C%20%20%20%3Cbody%3E"],"985c2415bc39a322004bbba6817df37dcdf3f10b":[async_test('html5lib_tests16.html 985c2415bc39a322004bbba6817df37dcdf3f10b'), "%3Cscript%3E%3C%21--%3C/", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3C/%22%0A%7C%20%20%20%3Cbody%3E"],"649e75657bd308f81f93189a02efa6b9a7702902":[async_test('html5lib_tests16.html 649e75657bd308f81f93189a02efa6b9a7702902'), "%3Cscript%3E%3C%21--%3C/script", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3C/script%22%0A%7C%20%20%20%3Cbody%3E"],"d42bb3557b0fbbe59cf5f606445ba973d4a3d720":[async_test('html5lib_tests16.html d42bb3557b0fbbe59cf5f606445ba973d4a3d720'), "%3Cscript%3E%3C%21--%3C/script%20", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%3Cbody%3E"],"d0178734ef1a063624bfd6a737dba933a54bf63d":[async_test('html5lib_tests16.html d0178734ef1a063624bfd6a737dba933a54bf63d'), "%3Cscript%3E%3C%21--%3Cs", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cs%22%0A%7C%20%20%20%3Cbody%3E"],"f6ac88b3fe1743a446da7e0ad895b8f46ea31b23":[async_test('html5lib_tests16.html f6ac88b3fe1743a446da7e0ad895b8f46ea31b23'), "%3Cscript%3E%3C%21--%3Cscript", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%22%0A%7C%20%20%20%3Cbody%3E"],"fb513439a4a4683ec8fc60dc5f2d5588bd656910":[async_test('html5lib_tests16.html fb513439a4a4683ec8fc60dc5f2d5588bd656910'), "%3Cscript%3E%3C%21--%3Cscript%20", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%22%0A%7C%20%20%20%3Cbody%3E"],"4ed828c62d9dcc18ecf8608c9c38708b0b89b83d":[async_test('html5lib_tests16.html 4ed828c62d9dcc18ecf8608c9c38708b0b89b83d'), "%3Cscript%3E%3C%21--%3Cscript%20%3C", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C%22%0A%7C%20%20%20%3Cbody%3E"],"51bbdaeed5d24b370a3456040561f8cad226b1a7":[async_test('html5lib_tests16.html 51bbdaeed5d24b370a3456040561f8cad226b1a7'), "%3Cscript%3E%3C%21--%3Cscript%20%3Ca", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3Ca%22%0A%7C%20%20%20%3Cbody%3E"],"45b8f97a3a29d8b1d5e7b7f2586189ead21873b7":[async_test('html5lib_tests16.html 45b8f97a3a29d8b1d5e7b7f2586189ead21873b7'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/%22%0A%7C%20%20%20%3Cbody%3E"],"1ca26210654f4c95e3f5a337922cd5e8b0694789":[async_test('html5lib_tests16.html 1ca26210654f4c95e3f5a337922cd5e8b0694789'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/s", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/s%22%0A%7C%20%20%20%3Cbody%3E"],"a2cd3e4d9dfccfe71bbf5780b537396b5f76c0d6":[async_test('html5lib_tests16.html a2cd3e4d9dfccfe71bbf5780b537396b5f76c0d6'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/script", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%22%0A%7C%20%20%20%3Cbody%3E"],"bb1450fbedebc1605f79eaa4dc501f47d1d7feb6":[async_test('html5lib_tests16.html bb1450fbedebc1605f79eaa4dc501f47d1d7feb6'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/scripta", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/scripta%22%0A%7C%20%20%20%3Cbody%3E"],"a9d29f0909132226fd57de4a55282f95682778fd":[async_test('html5lib_tests16.html a9d29f0909132226fd57de4a55282f95682778fd'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%22%0A%7C%20%20%20%3Cbody%3E"],"1fdf0dda892b230252ce864b5c7073ee09aa9165":[async_test('html5lib_tests16.html 1fdf0dda892b230252ce864b5c7073ee09aa9165'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%3E%22%0A%7C%20%20%20%3Cbody%3E"],"af1c863ec4e65c29006a0c98ef0872950618a05e":[async_test('html5lib_tests16.html af1c863ec4e65c29006a0c98ef0872950618a05e'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/script/", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script/%22%0A%7C%20%20%20%3Cbody%3E"],"18763f4dd0f9681f043e0124ac26b76795f8afad":[async_test('html5lib_tests16.html 18763f4dd0f9681f043e0124ac26b76795f8afad'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3C", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%3C%22%0A%7C%20%20%20%3Cbody%3E"],"499e8bdd759619c5c2248e854e7cd9148ff5fe6d":[async_test('html5lib_tests16.html 499e8bdd759619c5c2248e854e7cd9148ff5fe6d'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3Ca", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%3Ca%22%0A%7C%20%20%20%3Cbody%3E"],"b442057918b0f6954cf88be6da17b0c5ace03382":[async_test('html5lib_tests16.html b442057918b0f6954cf88be6da17b0c5ace03382'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3C/", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%3C/%22%0A%7C%20%20%20%3Cbody%3E"],"8a4c1d1a49ab635498f581f8341f0f037178d01d":[async_test('html5lib_tests16.html 8a4c1d1a49ab635498f581f8341f0f037178d01d'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3C/script", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%3C/script%22%0A%7C%20%20%20%3Cbody%3E"],"c4d806ce1a7cb0abe0cb26e6950839b47134dc68":[async_test('html5lib_tests16.html c4d806ce1a7cb0abe0cb26e6950839b47134dc68'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3C/script%20", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%22%0A%7C%20%20%20%3Cbody%3E"],"189378cd03b029adb6e679b6a349124155c697b7":[async_test('html5lib_tests16.html 189378cd03b029adb6e679b6a349124155c697b7'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3C/script/", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%22%0A%7C%20%20%20%3Cbody%3E"],"6c9b32168850736c788f14208a39e70272ccc54e":[async_test('html5lib_tests16.html 6c9b32168850736c788f14208a39e70272ccc54e'), "%3Cscript%3E%3C%21--%3Cscript%20%3C/script%20%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20%3C/script%20%22%0A%7C%20%20%20%3Cbody%3E"],"2e9cd7a39540b3bd1df32320556cec71585fb2df":[async_test('html5lib_tests16.html 2e9cd7a39540b3bd1df32320556cec71585fb2df'), "%3Cscript%3E%3C%21--%3Cscript%20-", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20-%22%0A%7C%20%20%20%3Cbody%3E"],"15fee76589fa386fa841a369bf84eb5c75ec131a":[async_test('html5lib_tests16.html 15fee76589fa386fa841a369bf84eb5c75ec131a'), "%3Cscript%3E%3C%21--%3Cscript%20-a", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20-a%22%0A%7C%20%20%20%3Cbody%3E"],"689bc409ce3f93662f1223f16271f8ca9883c647":[async_test('html5lib_tests16.html 689bc409ce3f93662f1223f16271f8ca9883c647'), "%3Cscript%3E%3C%21--%3Cscript%20--", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%22%0A%7C%20%20%20%3Cbody%3E"],"47097173fe23e65b63647777b53b0bdde6ce0f18":[async_test('html5lib_tests16.html 47097173fe23e65b63647777b53b0bdde6ce0f18'), "%3Cscript%3E%3C%21--%3Cscript%20--a", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--a%22%0A%7C%20%20%20%3Cbody%3E"],"fcaa6c59f13ef6a3d6cafeaffaad71b017c34c3c":[async_test('html5lib_tests16.html fcaa6c59f13ef6a3d6cafeaffaad71b017c34c3c'), "%3Cscript%3E%3C%21--%3Cscript%20--%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"dd0a2f0c0e6fdcf01c7a917ea662a7ef1e953f11":[async_test('html5lib_tests16.html dd0a2f0c0e6fdcf01c7a917ea662a7ef1e953f11'), "%3Cscript%3E%3C%21--%3Cscript%20--%3E%3C", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%3C%22%0A%7C%20%20%20%3Cbody%3E"],"b29fb15f9b7a448bb70ca27a4b1aac48c1d4f51f":[async_test('html5lib_tests16.html b29fb15f9b7a448bb70ca27a4b1aac48c1d4f51f'), "%3Cscript%3E%3C%21--%3Cscript%20--%3E%3C/", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%3C/%22%0A%7C%20%20%20%3Cbody%3E"],"0d91bcb1f42c1a7214168ee61e875166bd75d547":[async_test('html5lib_tests16.html 0d91bcb1f42c1a7214168ee61e875166bd75d547'), "%3Cscript%3E%3C%21--%3Cscript%20--%3E%3C/script", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%3C/script%22%0A%7C%20%20%20%3Cbody%3E"],"d561d1634333a05fe3428e355f6ab3d67b69ed44":[async_test('html5lib_tests16.html d561d1634333a05fe3428e355f6ab3d67b69ed44'), "%3Cscript%3E%3C%21--%3Cscript%20--%3E%3C/script%20", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"6a13a34b36f6ea738d10b2a2da4958045c243fb7":[async_test('html5lib_tests16.html 6a13a34b36f6ea738d10b2a2da4958045c243fb7'), "%3Cscript%3E%3C%21--%3Cscript%20--%3E%3C/script/", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"ee49c31a8c40676f366959341cd98aecdcf9c14f":[async_test('html5lib_tests16.html ee49c31a8c40676f366959341cd98aecdcf9c14f'), "%3Cscript%3E%3C%21--%3Cscript%20--%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%20--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"c541aa24beb8107a3726bd8b9e655ca8f95d7b48":[async_test('html5lib_tests16.html c541aa24beb8107a3726bd8b9e655ca8f95d7b48'), "%3Cscript%3E%3C%21--%3Cscript%3E%3C%5C/script%3E--%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C%5C/script%3E--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"7ae06c19dd24dea99940ceaed8dffdd0e24cd5f9":[async_test('html5lib_tests16.html 7ae06c19dd24dea99940ceaed8dffdd0e24cd5f9'), "%3Cscript%3E%3C%21--%3Cscript%3E%3C/scr%27%2B%27ipt%3E--%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/scr%27%2B%27ipt%3E--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"6d2029f0e2404dcc7f836481cef6bf56f060b248":[async_test('html5lib_tests16.html 6d2029f0e2404dcc7f836481cef6bf56f060b248'), "%3Cscript%3E%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E%22%0A%7C%20%20%20%3Cbody%3E"],"5c5a26c8bcb37a214c47f4b6d9843de20a8fb7e1":[async_test('html5lib_tests16.html 5c5a26c8bcb37a214c47f4b6d9843de20a8fb7e1'), "%3Cscript%3E%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E--%3E%3C%21--%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E--%3E%3C%21--%22%0A%7C%20%20%20%3Cbody%3E"],"3ee633bf4e4eadc2b70c6eebfa14c600435604c9":[async_test('html5lib_tests16.html 3ee633bf4e4eadc2b70c6eebfa14c600435604c9'), "%3Cscript%3E%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E--%20%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E--%20%3E%22%0A%7C%20%20%20%3Cbody%3E"],"ad5d10a0d7d8fc98040ff33f1db197735d6d3d52":[async_test('html5lib_tests16.html ad5d10a0d7d8fc98040ff33f1db197735d6d3d52'), "%3Cscript%3E%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E-%20-%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E-%20-%3E%22%0A%7C%20%20%20%3Cbody%3E"],"2bde3ac14192be5f4e664c2b01b5aaa57c14e347":[async_test('html5lib_tests16.html 2bde3ac14192be5f4e664c2b01b5aaa57c14e347'), "%3Cscript%3E%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E-%20-%20%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E-%20-%20%3E%22%0A%7C%20%20%20%3Cbody%3E"],"a87a03c8c3a06269e6ff8d11e142f6ebb05e9306":[async_test('html5lib_tests16.html a87a03c8c3a06269e6ff8d11e142f6ebb05e9306'), "%3Cscript%3E%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E-%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/script%3E%3Cscript%3E%3C/script%3E-%3E%22%0A%7C%20%20%20%3Cbody%3E"],"190325aed218711647eae5581a1f629c76da297c":[async_test('html5lib_tests16.html 190325aed218711647eae5581a1f629c76da297c'), "%3Cscript%3E%3C%21--%3Cscript%3E--%21%3E%3C/script%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E--%21%3E%3C/script%3EX%22%0A%7C%20%20%20%3Cbody%3E"],"e244d9f1edb6275b69c4a832620b9439d39bfb22":[async_test('html5lib_tests16.html e244d9f1edb6275b69c4a832620b9439d39bfb22'), "%3Cscript%3E%3C%21--%3Cscr%27%2B%27ipt%3E%3C/script%3E--%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscr%27%2B%27ipt%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"751f7c9538b9fd00f5c7dd0ed59df07f4d51fdac":[async_test('html5lib_tests16.html 751f7c9538b9fd00f5c7dd0ed59df07f4d51fdac'), "%3Cscript%3E%3C%21--%3Cscript%3E%3C/scr%27%2B%27ipt%3E%3C/script%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cscript%3E%3C/scr%27%2B%27ipt%3E%3C/script%3EX%22%0A%7C%20%20%20%3Cbody%3E"],"762904de405fa26afdd39e024395a441bc6a0f8a":[async_test('html5lib_tests16.html 762904de405fa26afdd39e024395a441bc6a0f8a'), "%3Cstyle%3E%3C%21--%3Cstyle%3E%3C/style%3E--%3E%3C/style%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cstyle%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"4df21df646897816e166b3dd829a8a3e21157f22":[async_test('html5lib_tests16.html 4df21df646897816e166b3dd829a8a3e21157f22'), "%3Cstyle%3E%3C%21--%3C/style%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22"],"9c241f721c1f6677d736b37ecd86bb230df329df":[async_test('html5lib_tests16.html 9c241f721c1f6677d736b37ecd86bb230df329df'), "%3Cstyle%3E%3C%21--...%3C/style%3E...--%3E%3C/style%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--...%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22...--%3E%22"],"96ebedcc684f27f984cc7be467c908bdab2470a9":[async_test('html5lib_tests16.html 96ebedcc684f27f984cc7be467c908bdab2470a9'), "%3Cstyle%3E%3C%21--%3Cbr%3E%3Chtml%20xmlns%3Av%3D%22urn%3Aschemas-microsoft-com%3Avml%22%3E%3C%21--%5Bif%20%21mso%5D%3E%3Cstyle%3E%3C/style%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cbr%3E%3Chtml%20xmlns%3Av%3D%22urn%3Aschemas-microsoft-com%3Avml%22%3E%3C%21--%5Bif%20%21mso%5D%3E%3Cstyle%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22"],"419cfbd87ad35c1d43214b122630cfde1c3ccf1b":[async_test('html5lib_tests16.html 419cfbd87ad35c1d43214b122630cfde1c3ccf1b'), "%3Cstyle%3E%3C%21--...%3Cstyle%3E%3C%21--...--%21%3E%3C/style%3E--%3E%3C/style%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--...%3Cstyle%3E%3C%21--...--%21%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"cf75ace0d7531b8daa271001dbf92b93b0b4490c":[async_test('html5lib_tests16.html cf75ace0d7531b8daa271001dbf92b93b0b4490c'), "%3Cstyle%3E%3C%21--...%3C/style%3E%3C%21--%20--%3E%3Cstyle%3E%40import%20...%3C/style%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--...%22%0A%7C%20%20%20%20%20%3C%21--%20%20%20--%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%40import%20...%22%0A%7C%20%20%20%3Cbody%3E"],"a058b4bb03a689ce8528ed412d62cdd5bb879571":[async_test('html5lib_tests16.html a058b4bb03a689ce8528ed412d62cdd5bb879571'), "%3Cstyle%3E...%3Cstyle%3E%3C%21--...%3C/style%3E%3C%21--%20--%3E%3C/style%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22...%3Cstyle%3E%3C%21--...%22%0A%7C%20%20%20%20%20%3C%21--%20%20%20--%3E%0A%7C%20%20%20%3Cbody%3E"],"d7c871c41c9db40312ffc5af996ede62ecdfc579":[async_test('html5lib_tests16.html d7c871c41c9db40312ffc5af996ede62ecdfc579'), "%3Cstyle%3E...%3C%21--%5Bif%20IE%5D%3E%3Cstyle%3E...%3C/style%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22...%3C%21--%5Bif%20IE%5D%3E%3Cstyle%3E...%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22"],"6c353ee8f48c1227eeab81279dc3eb3890c9c3bd":[async_test('html5lib_tests16.html 6c353ee8f48c1227eeab81279dc3eb3890c9c3bd'), "%3Ctitle%3E%3C%21--%3Ctitle%3E%3C/title%3E--%3E%3C/title%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Ctitle%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"fea28aab54637701c5dfaef4f3fe64c72b272e1c":[async_test('html5lib_tests16.html fea28aab54637701c5dfaef4f3fe64c72b272e1c'), "%3Ctitle%3E%26lt%3B/title%3E%3C/title%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%3C/title%3E%22%0A%7C%20%20%20%3Cbody%3E"],"ecd79b7eb7af2bb4dadf710f70e0d78f62adc40e":[async_test('html5lib_tests16.html ecd79b7eb7af2bb4dadf710f70e0d78f62adc40e'), "%3Ctitle%3Efoo/title%3E%3Clink%3E%3C/head%3E%3Cbody%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22foo/title%3E%3Clink%3E%3C/head%3E%3Cbody%3EX%22%0A%7C%20%20%20%3Cbody%3E"],"43917824cc1d9b5a65601f46e13a0779c3dcff4e":[async_test('html5lib_tests16.html 43917824cc1d9b5a65601f46e13a0779c3dcff4e'), "%3Cnoscript%3E%3C%21--%3Cnoscript%3E%3C/noscript%3E--%3E%3C/noscript%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cnoscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cnoscript%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"5423bb28649f37e70a0559cba78c3b253a60c277":[async_test('html5lib_tests16.html 5423bb28649f37e70a0559cba78c3b253a60c277'), "%3Cnoscript%3E%3C%21--%3C/noscript%3EX%3Cnoscript%3E--%3E%3C/noscript%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cnoscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%3Cnoscript%3E%0A%7C%20%20%20%20%20%20%20%22--%3E%22"],"2c091a50dfd31e766a5a629c0b7c21973e33319d":[async_test('html5lib_tests16.html 2c091a50dfd31e766a5a629c0b7c21973e33319d'), "%3Cnoscript%3E%3Ciframe%3E%3C/noscript%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cnoscript%3E%0A%7C%20%20%20%20%20%20%20%22%3Ciframe%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22"],"920feb4f9d1032dcec2abc5c526e4996f642968b":[async_test('html5lib_tests16.html 920feb4f9d1032dcec2abc5c526e4996f642968b'), "%3Cnoframes%3E%3C%21--%3Cnoframes%3E%3C/noframes%3E--%3E%3C/noframes%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cnoframes%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cnoframes%3E%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"31b9b446263cd5b7a844d43f2a235ed9b0c53efb":[async_test('html5lib_tests16.html 31b9b446263cd5b7a844d43f2a235ed9b0c53efb'), "%3Cnoframes%3E%3Cbody%3E%3Cscript%3E%3C%21--...%3C/script%3E%3C/body%3E%3C/noframes%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cnoframes%3E%0A%7C%20%20%20%20%20%20%20%22%3Cbody%3E%3Cscript%3E%3C%21--...%3C/script%3E%3C/body%3E%22%0A%7C%20%20%20%3Cbody%3E"],"dbb5127246fee18718bcffc6cf0730674d12b98a":[async_test('html5lib_tests16.html dbb5127246fee18718bcffc6cf0730674d12b98a'), "%3Ctextarea%3E%3C%21--%3Ctextarea%3E%3C/textarea%3E--%3E%3C/textarea%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Ctextarea%3E%22%0A%7C%20%20%20%20%20%22--%3E%22"],"3872a4cfeba7651f0671de7e5f3922fd5053837b":[async_test('html5lib_tests16.html 3872a4cfeba7651f0671de7e5f3922fd5053837b'), "%3Ctextarea%3E%26lt%3B/textarea%3E%3C/textarea%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22%3C/textarea%3E%22"],"2fbcb2db61b6416cdf46e0526e1929d146ab3da7":[async_test('html5lib_tests16.html 2fbcb2db61b6416cdf46e0526e1929d146ab3da7'), "%3Ciframe%3E%3C%21--%3Ciframe%3E%3C/iframe%3E--%3E%3C/iframe%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ciframe%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Ciframe%3E%22%0A%7C%20%20%20%20%20%22--%3E%22"],"999da234e770bbf681a819423d04ea57415d9bbc":[async_test('html5lib_tests16.html 999da234e770bbf681a819423d04ea57415d9bbc'), "%3Ciframe%3E...%3C%21--X-%3E...%3C%21--/X-%3E...%3C/iframe%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ciframe%3E%0A%7C%20%20%20%20%20%20%20%22...%3C%21--X-%3E...%3C%21--/X-%3E...%22"],"6fc6be53a87bbb2d2a51a5617009063002321d09":[async_test('html5lib_tests16.html 6fc6be53a87bbb2d2a51a5617009063002321d09'), "%3Cxmp%3E%3C%21--%3Cxmp%3E%3C/xmp%3E--%3E%3C/xmp%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cxmp%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cxmp%3E%22%0A%7C%20%20%20%20%20%22--%3E%22"],"b0de72088fa3e543572329eda36fa4bd16e29fa3":[async_test('html5lib_tests16.html b0de72088fa3e543572329eda36fa4bd16e29fa3'), "%3Cnoembed%3E%3C%21--%3Cnoembed%3E%3C/noembed%3E--%3E%3C/noembed%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cnoembed%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%3Cnoembed%3E%22%0A%7C%20%20%20%20%20%22--%3E%22"],"2a6d8110b8148a9aa83db81dc38d544becea2fa9":[async_test('html5lib_tests16.html 2a6d8110b8148a9aa83db81dc38d544becea2fa9'), "%3C%21doctype%20html%3E%3Ctable%3E%0A", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%22%0A%22"],"6556aaaca3956eafbc1660bce50a2f3568f1bff6":[async_test('html5lib_tests16.html 6556aaaca3956eafbc1660bce50a2f3568f1bff6'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctd%3E%3Cspan%3E%3Cfont%3E%3C/span%3E%3Cspan%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E"],"8ba3d2c7712e9c0484a4cafc8b0ca6f35d8f11ed":[async_test('html5lib_tests16.html 8ba3d2c7712e9c0484a4cafc8b0ca6f35d8f11ed'), "%3C%21doctype%20html%3E%3Cform%3E%3Ctable%3E%3C/form%3E%3Cform%3E%3C/table%3E%3C/form%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cform%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests17.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests17.html
new file mode 100644
index 000000000..6363ca72b
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests17.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests17.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['bad1cc428ca144d278d40343f9da4d22d43b7b50','8a99dcd95c28dc294ec302998adac16111085aea','1d2be91c91dc2506354f01bb0058d0e10123668a','37ef4643c5f11b68f8991c4f1b34c3fe4d78c0af','0739d340b754e400864a668ac7f72259965b8bc7','16cb95e820b074bad119f13b1204cac90db8cf82','8b6c1a5706c668ccc47a4ff61527a30daa14848e','92ebd54a48d986a555e1a456565b3cbd06c78ffa','1fdd1835ee0cb01351d30fc567cd19b3ecda7966','55412bdbb0fe315b9ff46592e8f08ba47568f2e9','d5e1450f92115f6c5704b0b5f27699cd418816f9','a3ed0cf6e162498c7c5b87228c33bbcd960087a6','c1af331cb6400571f5e2b6ec81461223ab603d3d',];
+ var tests = {
+ "bad1cc428ca144d278d40343f9da4d22d43b7b50":[async_test('html5lib_tests17.html bad1cc428ca144d278d40343f9da4d22d43b7b50'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctbody%3E%3Cselect%3E%3Ctr%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"8a99dcd95c28dc294ec302998adac16111085aea":[async_test('html5lib_tests17.html 8a99dcd95c28dc294ec302998adac16111085aea'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctr%3E%3Cselect%3E%3Ctd%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"1d2be91c91dc2506354f01bb0058d0e10123668a":[async_test('html5lib_tests17.html 1d2be91c91dc2506354f01bb0058d0e10123668a'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Cselect%3E%3Ctd%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"37ef4643c5f11b68f8991c4f1b34c3fe4d78c0af":[async_test('html5lib_tests17.html 37ef4643c5f11b68f8991c4f1b34c3fe4d78c0af'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctr%3E%3Cth%3E%3Cselect%3E%3Ctd%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cth%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"0739d340b754e400864a668ac7f72259965b8bc7":[async_test('html5lib_tests17.html 0739d340b754e400864a668ac7f72259965b8bc7'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ccaption%3E%3Cselect%3E%3Ctr%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"16cb95e820b074bad119f13b1204cac90db8cf82":[async_test('html5lib_tests17.html 16cb95e820b074bad119f13b1204cac90db8cf82'), "%3C%21doctype%20html%3E%3Cselect%3E%3Ctr%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"8b6c1a5706c668ccc47a4ff61527a30daa14848e":[async_test('html5lib_tests17.html 8b6c1a5706c668ccc47a4ff61527a30daa14848e'), "%3C%21doctype%20html%3E%3Cselect%3E%3Ctd%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"92ebd54a48d986a555e1a456565b3cbd06c78ffa":[async_test('html5lib_tests17.html 92ebd54a48d986a555e1a456565b3cbd06c78ffa'), "%3C%21doctype%20html%3E%3Cselect%3E%3Cth%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"1fdd1835ee0cb01351d30fc567cd19b3ecda7966":[async_test('html5lib_tests17.html 1fdd1835ee0cb01351d30fc567cd19b3ecda7966'), "%3C%21doctype%20html%3E%3Cselect%3E%3Ctbody%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"55412bdbb0fe315b9ff46592e8f08ba47568f2e9":[async_test('html5lib_tests17.html 55412bdbb0fe315b9ff46592e8f08ba47568f2e9'), "%3C%21doctype%20html%3E%3Cselect%3E%3Cthead%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"d5e1450f92115f6c5704b0b5f27699cd418816f9":[async_test('html5lib_tests17.html d5e1450f92115f6c5704b0b5f27699cd418816f9'), "%3C%21doctype%20html%3E%3Cselect%3E%3Ctfoot%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"a3ed0cf6e162498c7c5b87228c33bbcd960087a6":[async_test('html5lib_tests17.html a3ed0cf6e162498c7c5b87228c33bbcd960087a6'), "%3C%21doctype%20html%3E%3Cselect%3E%3Ccaption%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"c1af331cb6400571f5e2b6ec81461223ab603d3d":[async_test('html5lib_tests17.html c1af331cb6400571f5e2b6ec81461223ab603d3d'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctr%3E%3C/table%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%22a%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests18.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests18.html
new file mode 100644
index 000000000..5c23b22c5
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests18.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests18.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['0d0085749435e0d0ddb56c9db809bfcbbc995767','863c5dd5ef7e9279342de0f714383d3e47033e95','ddeaaff85a50ea415dee1c4ee6c43e98ea331953','61eb7572a2490ac82423953eefe8fcef8dbc78ee','df407b3f102bc2504539136b46afbb895763dc27','9ac591f40aae947707f7d5e83947712bbeca9574','4b6f10fa2d8b7cc70e3b3085aac46c64a0c42eaf','1e88e5946ba773f1202e8af27f2a17ef2658e3ee','17ec3aff2568b56687f00d6ee3aeb6625fdd8ecc','b22cb10082e7328708e1da334a12b015b90535a4','9bfd787aa3b30eb38ce7942696ccc01d991e8e52','41edb5b76ce7a4378daa093e59b1225af546864f','5c6c65bd01758ecb6eb539a979dfacf50ff93a78','76d96fecc3d88820bab5274089886d20bc164d74','28a8566daaae49c529298d0de8a26af1263ff625','13eb2279a1e58eb281541564ae945b87880ae7c2','3c7d4e068461b340966e07dff93d93503fcfa46c','d38ed6488066d3e0d4d74b29888c5d000c2f4808','43180045ad714b405e6fe110a27011f2644f16c2',];
+ var tests = {
+ "0d0085749435e0d0ddb56c9db809bfcbbc995767":[async_test('html5lib_tests18.html 0d0085749435e0d0ddb56c9db809bfcbbc995767'), "%3C%21doctype%20html%3E%3Cplaintext%3E%3C/plaintext%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cplaintext%3E%0A%7C%20%20%20%20%20%20%20%22%3C/plaintext%3E%22"],"863c5dd5ef7e9279342de0f714383d3e47033e95":[async_test('html5lib_tests18.html 863c5dd5ef7e9279342de0f714383d3e47033e95'), "%3C%21doctype%20html%3E%3Ctable%3E%3Cplaintext%3E%3C/plaintext%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cplaintext%3E%0A%7C%20%20%20%20%20%20%20%22%3C/plaintext%3E%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"ddeaaff85a50ea415dee1c4ee6c43e98ea331953":[async_test('html5lib_tests18.html ddeaaff85a50ea415dee1c4ee6c43e98ea331953'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctbody%3E%3Cplaintext%3E%3C/plaintext%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cplaintext%3E%0A%7C%20%20%20%20%20%20%20%22%3C/plaintext%3E%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E"],"61eb7572a2490ac82423953eefe8fcef8dbc78ee":[async_test('html5lib_tests18.html 61eb7572a2490ac82423953eefe8fcef8dbc78ee'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctbody%3E%3Ctr%3E%3Cplaintext%3E%3C/plaintext%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cplaintext%3E%0A%7C%20%20%20%20%20%20%20%22%3C/plaintext%3E%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"df407b3f102bc2504539136b46afbb895763dc27":[async_test('html5lib_tests18.html df407b3f102bc2504539136b46afbb895763dc27'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctd%3E%3Cplaintext%3E%3C/plaintext%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cplaintext%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%3C/plaintext%3E%22"],"9ac591f40aae947707f7d5e83947712bbeca9574":[async_test('html5lib_tests18.html 9ac591f40aae947707f7d5e83947712bbeca9574'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ccaption%3E%3Cplaintext%3E%3C/plaintext%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cplaintext%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%3C/plaintext%3E%22"],"4b6f10fa2d8b7cc70e3b3085aac46c64a0c42eaf":[async_test('html5lib_tests18.html 4b6f10fa2d8b7cc70e3b3085aac46c64a0c42eaf'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctr%3E%3Cstyle%3E%3C/script%3E%3C/style%3Eabc", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22abc%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22%3C/script%3E%22"],"1e88e5946ba773f1202e8af27f2a17ef2658e3ee":[async_test('html5lib_tests18.html 1e88e5946ba773f1202e8af27f2a17ef2658e3ee'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctr%3E%3Cscript%3E%3C/style%3E%3C/script%3Eabc", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22abc%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22%3C/style%3E%22"],"17ec3aff2568b56687f00d6ee3aeb6625fdd8ecc":[async_test('html5lib_tests18.html 17ec3aff2568b56687f00d6ee3aeb6625fdd8ecc'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ccaption%3E%3Cstyle%3E%3C/script%3E%3C/style%3Eabc", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%3C/script%3E%22%0A%7C%20%20%20%20%20%20%20%20%20%22abc%22"],"b22cb10082e7328708e1da334a12b015b90535a4":[async_test('html5lib_tests18.html b22cb10082e7328708e1da334a12b015b90535a4'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctd%3E%3Cstyle%3E%3C/script%3E%3C/style%3Eabc", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%3C/script%3E%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22abc%22"],"9bfd787aa3b30eb38ce7942696ccc01d991e8e52":[async_test('html5lib_tests18.html 9bfd787aa3b30eb38ce7942696ccc01d991e8e52'), "%3C%21doctype%20html%3E%3Cselect%3E%3Cscript%3E%3C/style%3E%3C/script%3Eabc", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%3C/style%3E%22%0A%7C%20%20%20%20%20%20%20%22abc%22"],"41edb5b76ce7a4378daa093e59b1225af546864f":[async_test('html5lib_tests18.html 41edb5b76ce7a4378daa093e59b1225af546864f'), "%3C%21doctype%20html%3E%3Ctable%3E%3Cselect%3E%3Cscript%3E%3C/style%3E%3C/script%3Eabc", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%3C/style%3E%22%0A%7C%20%20%20%20%20%20%20%22abc%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"5c6c65bd01758ecb6eb539a979dfacf50ff93a78":[async_test('html5lib_tests18.html 5c6c65bd01758ecb6eb539a979dfacf50ff93a78'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctr%3E%3Cselect%3E%3Cscript%3E%3C/style%3E%3C/script%3Eabc", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%3C/style%3E%22%0A%7C%20%20%20%20%20%20%20%22abc%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"76d96fecc3d88820bab5274089886d20bc164d74":[async_test('html5lib_tests18.html 76d96fecc3d88820bab5274089886d20bc164d74'), "%3C%21doctype%20html%3E%3Cframeset%3E%3C/frameset%3E%3Cnoframes%3Eabc", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%3Cnoframes%3E%0A%7C%20%20%20%20%20%22abc%22"],"28a8566daaae49c529298d0de8a26af1263ff625":[async_test('html5lib_tests18.html 28a8566daaae49c529298d0de8a26af1263ff625'), "%3C%21doctype%20html%3E%3Cframeset%3E%3C/frameset%3E%3Cnoframes%3Eabc%3C/noframes%3E%3C%21--abc--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%3Cnoframes%3E%0A%7C%20%20%20%20%20%22abc%22%0A%7C%20%20%20%3C%21--%20abc%20--%3E"],"13eb2279a1e58eb281541564ae945b87880ae7c2":[async_test('html5lib_tests18.html 13eb2279a1e58eb281541564ae945b87880ae7c2'), "%3C%21doctype%20html%3E%3Cframeset%3E%3C/frameset%3E%3C/html%3E%3Cnoframes%3Eabc", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%3Cnoframes%3E%0A%7C%20%20%20%20%20%22abc%22"],"3c7d4e068461b340966e07dff93d93503fcfa46c":[async_test('html5lib_tests18.html 3c7d4e068461b340966e07dff93d93503fcfa46c'), "%3C%21doctype%20html%3E%3Cframeset%3E%3C/frameset%3E%3C/html%3E%3Cnoframes%3Eabc%3C/noframes%3E%3C%21--abc--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%3Cnoframes%3E%0A%7C%20%20%20%20%20%22abc%22%0A%7C%20%3C%21--%20abc%20--%3E"],"d38ed6488066d3e0d4d74b29888c5d000c2f4808":[async_test('html5lib_tests18.html d38ed6488066d3e0d4d74b29888c5d000c2f4808'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctr%3E%3C/tbody%3E%3Ctfoot%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%3Ctfoot%3E"],"43180045ad714b405e6fe110a27011f2644f16c2":[async_test('html5lib_tests18.html 43180045ad714b405e6fe110a27011f2644f16c2'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctd%3E%3Csvg%3E%3C/svg%3Eabc%3Ctd%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22abc%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests19.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests19.html
new file mode 100644
index 000000000..151b12170
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests19.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests19.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['6135e0cbdbb22a97e8a13c2442c3e9a9e0a53298','6b46dba2f4d7d1a08359ab21fe5e011463dd8746','bd558a6d89fae63fed9c0801e6fd8e8737bc8dc1','a7955e9f06178980cbc13fc4d548f196fef42b13','2fda53e44aa91cb475f8b1aa57e938adcce60d4d','9f55c21807de5c769197a9a2f29f836f08af050b','197605d0b406dbb3de884de6949237dd33669997','73760ab95f224cf93922b45dbe5898005ada203c','1bba57ac3ccda8d4c7a79bde5342eede0bd10d8e','ce477c47f37eea25ad53c88915b75c801e41ee54','3b1730b917da1c33da80ee08d41573c44404c663','94d253ded5fe8c34906a57f0c16daf5f067cf386','ac6b608079815ad00c84b291ad6715eec523ccf4','a68acf7673e0c886fcf8cf609f3a39fb36362de5','266157f051148b068dad52e9786a0bda96e851db','2fd40bb6048be379000d73bc52a50405ca99b356','19652e3b1ec783f279f527ddfb07073684520ab8','e5676878cff9332b572ebfd327e426f87e32ab4d','03bbba49b30ec908e06e3c84e1fcede1ac7508ff','5f9f25a089e72b4a4e5d7ebbacb440349c53f52f','d26f2542fc6fcee4e737b578c8db716a96a22ade','0e8c4b181993b477f4f215d5724b99ad04f18b2d','e3f1de111562f25106efad76583a3b6c0e3516ba','84db6521d1350830f3e46b7d9676527e1b4ee9e2','033d9b356b2a646471de009fa8a75e40500d2dd2','0971186f913b3c7f915817d2b82c73ea6487e932','5257f17c3ecab5b65d74d7c27f0fd492f82ef9b9','b8c3379e60829428188fd57e974ea4d8a7e7ec45','f9ab61cdf08301bcf02208165cc94e6bdbad746c','c6aa9952dcccdde3fc6d4ba104647f049d038e66','3984cbe166b42d77ff6dadc8e1687075db7a8e65','2d78ba34eecedf8261e9a9e3f8858baf00a0d960','8d45a57b7093df38c88dccb1f3fba6a62c810445','871917ed049ff21b35e74e39de2ca1eef6863562','74ad5d3026f1b3eb6553086eb2811eed4418e334','0b1e97138c4d8e8d770f107202e46a18362fd587','02624fcb7ddb77b15e9bc553d8392fc8cd031f68','a2579d287fd8111306e6dcd7248971a6baa4488d','acd1c9218828ea4367920c7a499c54de7f9a618f','36a6346b03982942b4427d5089271a101ebf1605','e58ed5b56f81d057c23be31e068a10e694f52adf','d422166b880468765f34d89075d4db9c4fcbfee9','fc673f5874c0cf1477554dfb733d6292cc01558b','0d2192c16cc224e770abff9e9e89e860aff9da78','d5941f6b68ef817d062636d0d61c24c68d0d86a2','259a085138224e3dfe0dceded2a043e72a8b6d76','869fff76cfe00ff33987de007ce98dc949bf8cbf','c06518cdbf3816faf265644d28d93b7aee9258f7','2fb0cdb3a9f69ca6c3d564e01f89d7173cd51295','138623cd07ccff1ce13bb1aa5dbaaadc962c414f','52e4a8422d6ef591f33f8686842d974dbaa33302','5ba1d0e97f121810025c1d6447a426c669661637','709ec07924db4c9fd66d48eac08575dfdef01d8f','f72edb80bc3be091e4b448cd1de8fe851d623e05','cb7de0dc7e17c1454ceaa7eb49cb9f9476a1f510','511bf4bae15c8119042e5e80b5358b70e7da26c1','c51ee24ef9d92206318cc5bbba784630cd10e531','819d39ae49fd04f0dfce90ac8ed2f8e423bb9329','ef6bdf5b3ba9d41d6c1c08ede60c2e7fb21c6d71','6bf9c038255c31f20d8fbeaebdf3609eb3c9ed75','08983ab2a54f61b09a1df134cdaf51d321f3ef32','2ef94ed028fa71b70540cf41f0884ae0c1cf8077','5c9ed202789fb29566e0d146d155e0d672e8a037','7d766253cbf500df03506dfb7f2cbdd0f0f533c6','4d5629c61993ef0bb83fcbd80ccc6ead7cd776ee','6320d9fa3295984d3da7e4831ced75dfb97d4848','bdb97868e951b7a719fa8b1afc79650bf9aae7a5','81868cde252694a252b6b0c8d366850f8a54736c','20651db48147f8dda189c563f5fa60bfd0913ac0','d098e8a39897cd8453fc18399622e413872b054c','0beb7903dcc0dbee206d8b6e729963a0461eedb3','78e5cdb86bf2aecef4697d70d50499b50de5c25b','cfb1d482e5971a6915c90434f580721b772fc09b','99d8bff8bbcca1c7faa7b6e10b9ff305b9f99594','daaa43db05ffe9bdd8d734a4389fb3c459caddf1','b3d421e57a4135731309152d7f47e26a4866f3d6','aa5eac4b7a0bafdafcd52cb190a8e181ff74144c','91d56a57f4c8af2bce03e9974df0a80f62686fb4','9cbad5cad719a63d2eb7721de6737a346ad42da1','057c2e91a7e6053d39436efe2bc29049f6fa8e82','61e6517e5e82cdaed41ab3e1f6fa927731aa0c82','9274ab4f08baa52c5d7016f6062f186730cfbe6c','fc2fa41ebadc21653b38d70c1097bd4ac5979948','473303e65f26fafacbaf01c11b04d745ff293963','7854276e1637619f693cd87f64542c08c35d40bd','a2d262d392e8d10645ce559edf401df3f3872eb3','d5e50987bf495e285e279ff8670255d9b1314f5d','be54d7506e54a127a05b115a8659a5b52fa57f6c','af389f1a8ef93c457560fd2445df80a6789dab0d','601dfa9502942deb8bf46a91c64f10f649bc1875','4b01442faf29563d3b736d235515f77c20c81863','696a2b60681b0b6758f165a67e29a84b0f75a153','7a48b98cbae5cd7cbbb90f138c0d12da6c4448b3','d7693a0f2be68925250d3aa2cf295b1d1a60bf94','9e4d91f02184de1b1e5d927144bb06d3bc78bb09','9655591702381a52fe0eb3224e63e2d8bfd735e8','fe9aa1c8ec32796e26f3e58022f0e42dc365b5c7','4c9ec04359c3e94d4a56d6932d289f0c4246d1ef','3fcc2f15951b3c3375c3e359cf7888c71187994a','a94b35c317763de75150df6b436c7c153aeb8c51','173b990198dd8fd9534d7808817c19440b75d406','48ed5945491d4ad0c00acfd01c2060a459436d34','392b8d4d25351467da961e4ab011a1d4e970b97a','bd14373173ea3617610fc8154237f59f1a810733','db3c4ddb389a2b8f42ca6b3719007d4de2eccc41','c1741a62627b2e5bb1cfa2b2cd667f3f9f76157e','0d6cf626790e9f06e30ceb6baf3004663b0247e7',];
+ var tests = {
+ "6135e0cbdbb22a97e8a13c2442c3e9a9e0a53298":[async_test('html5lib_tests19.html 6135e0cbdbb22a97e8a13c2442c3e9a9e0a53298'), "%3C%21doctype%20html%3E%3Cmath%3E%3Cmn%20DefinitionUrl%3D%22foo%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mn%3E%0A%7C%20%20%20%20%20%20%20%20%20definitionURL%3D%22foo%22"],"6b46dba2f4d7d1a08359ab21fe5e011463dd8746":[async_test('html5lib_tests19.html 6b46dba2f4d7d1a08359ab21fe5e011463dd8746'), "%3C%21doctype%20html%3E%3Chtml%3E%3C/p%3E%3C%21--foo--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3C%21--%20foo%20--%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"bd558a6d89fae63fed9c0801e6fd8e8737bc8dc1":[async_test('html5lib_tests19.html bd558a6d89fae63fed9c0801e6fd8e8737bc8dc1'), "%3C%21doctype%20html%3E%3Chead%3E%3C/head%3E%3C/p%3E%3C%21--foo--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3C%21--%20foo%20--%3E%0A%7C%20%20%20%3Cbody%3E"],"a7955e9f06178980cbc13fc4d548f196fef42b13":[async_test('html5lib_tests19.html a7955e9f06178980cbc13fc4d548f196fef42b13'), "%3C%21doctype%20html%3E%3Cbody%3E%3Cp%3E%3Cpre%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Cpre%3E"],"2fda53e44aa91cb475f8b1aa57e938adcce60d4d":[async_test('html5lib_tests19.html 2fda53e44aa91cb475f8b1aa57e938adcce60d4d'), "%3C%21doctype%20html%3E%3Cbody%3E%3Cp%3E%3Clisting%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Clisting%3E"],"9f55c21807de5c769197a9a2f29f836f08af050b":[async_test('html5lib_tests19.html 9f55c21807de5c769197a9a2f29f836f08af050b'), "%3C%21doctype%20html%3E%3Cp%3E%3Cplaintext%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Cplaintext%3E"],"197605d0b406dbb3de884de6949237dd33669997":[async_test('html5lib_tests19.html 197605d0b406dbb3de884de6949237dd33669997'), "%3C%21doctype%20html%3E%3Cp%3E%3Ch1%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Ch1%3E"],"73760ab95f224cf93922b45dbe5898005ada203c":[async_test('html5lib_tests19.html 73760ab95f224cf93922b45dbe5898005ada203c'), "%3C%21doctype%20html%3E%3Cform%3E%3Cisindex%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E"],"1bba57ac3ccda8d4c7a79bde5342eede0bd10d8e":[async_test('html5lib_tests19.html 1bba57ac3ccda8d4c7a79bde5342eede0bd10d8e'), "%3C%21doctype%20html%3E%3Cisindex%20action%3D%22POST%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20action%3D%22POST%22%0A%7C%20%20%20%20%20%20%20%3Chr%3E%0A%7C%20%20%20%20%20%20%20%3Clabel%3E%0A%7C%20%20%20%20%20%20%20%20%20%22This%20is%20a%20searchable%20index.%20Enter%20search%20keywords%3A%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20name%3D%22isindex%22%0A%7C%20%20%20%20%20%20%20%3Chr%3E"],"ce477c47f37eea25ad53c88915b75c801e41ee54":[async_test('html5lib_tests19.html ce477c47f37eea25ad53c88915b75c801e41ee54'), "%3C%21doctype%20html%3E%3Cisindex%20prompt%3D%22this%20is%20isindex%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20%3Chr%3E%0A%7C%20%20%20%20%20%20%20%3Clabel%3E%0A%7C%20%20%20%20%20%20%20%20%20%22this%20is%20isindex%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20name%3D%22isindex%22%0A%7C%20%20%20%20%20%20%20%3Chr%3E"],"3b1730b917da1c33da80ee08d41573c44404c663":[async_test('html5lib_tests19.html 3b1730b917da1c33da80ee08d41573c44404c663'), "%3C%21doctype%20html%3E%3Cisindex%20type%3D%22hidden%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20%3Chr%3E%0A%7C%20%20%20%20%20%20%20%3Clabel%3E%0A%7C%20%20%20%20%20%20%20%20%20%22This%20is%20a%20searchable%20index.%20Enter%20search%20keywords%3A%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20name%3D%22isindex%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20type%3D%22hidden%22%0A%7C%20%20%20%20%20%20%20%3Chr%3E"],"94d253ded5fe8c34906a57f0c16daf5f067cf386":[async_test('html5lib_tests19.html 94d253ded5fe8c34906a57f0c16daf5f067cf386'), "%3C%21doctype%20html%3E%3Cisindex%20name%3D%22foo%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20%3Chr%3E%0A%7C%20%20%20%20%20%20%20%3Clabel%3E%0A%7C%20%20%20%20%20%20%20%20%20%22This%20is%20a%20searchable%20index.%20Enter%20search%20keywords%3A%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20name%3D%22isindex%22%0A%7C%20%20%20%20%20%20%20%3Chr%3E"],"ac6b608079815ad00c84b291ad6715eec523ccf4":[async_test('html5lib_tests19.html ac6b608079815ad00c84b291ad6715eec523ccf4'), "%3C%21doctype%20html%3E%3Cruby%3E%3Cp%3E%3Crp%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cruby%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Crp%3E"],"a68acf7673e0c886fcf8cf609f3a39fb36362de5":[async_test('html5lib_tests19.html a68acf7673e0c886fcf8cf609f3a39fb36362de5'), "%3C%21doctype%20html%3E%3Cruby%3E%3Cdiv%3E%3Cspan%3E%3Crp%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cruby%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Crp%3E"],"266157f051148b068dad52e9786a0bda96e851db":[async_test('html5lib_tests19.html 266157f051148b068dad52e9786a0bda96e851db'), "%3C%21doctype%20html%3E%3Cruby%3E%3Cdiv%3E%3Cp%3E%3Crp%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cruby%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Crp%3E"],"2fd40bb6048be379000d73bc52a50405ca99b356":[async_test('html5lib_tests19.html 2fd40bb6048be379000d73bc52a50405ca99b356'), "%3C%21doctype%20html%3E%3Cruby%3E%3Cp%3E%3Crt%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cruby%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Crt%3E"],"19652e3b1ec783f279f527ddfb07073684520ab8":[async_test('html5lib_tests19.html 19652e3b1ec783f279f527ddfb07073684520ab8'), "%3C%21doctype%20html%3E%3Cruby%3E%3Cdiv%3E%3Cspan%3E%3Crt%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cruby%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Crt%3E"],"e5676878cff9332b572ebfd327e426f87e32ab4d":[async_test('html5lib_tests19.html e5676878cff9332b572ebfd327e426f87e32ab4d'), "%3C%21doctype%20html%3E%3Cruby%3E%3Cdiv%3E%3Cp%3E%3Crt%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cruby%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Crt%3E"],"03bbba49b30ec908e06e3c84e1fcede1ac7508ff":[async_test('html5lib_tests19.html 03bbba49b30ec908e06e3c84e1fcede1ac7508ff'), "%3Chtml%3E%3Cruby%3Ea%3Crb%3Eb%3Crt%3E%3C/ruby%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cruby%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%3Crb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22b%22%0A%7C%20%20%20%20%20%20%20%3Crt%3E"],"5f9f25a089e72b4a4e5d7ebbacb440349c53f52f":[async_test('html5lib_tests19.html 5f9f25a089e72b4a4e5d7ebbacb440349c53f52f'), "%3Chtml%3E%3Cruby%3Ea%3Crp%3Eb%3Crt%3E%3C/ruby%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cruby%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%3Crp%3E%0A%7C%20%20%20%20%20%20%20%20%20%22b%22%0A%7C%20%20%20%20%20%20%20%3Crt%3E"],"d26f2542fc6fcee4e737b578c8db716a96a22ade":[async_test('html5lib_tests19.html d26f2542fc6fcee4e737b578c8db716a96a22ade'), "%3Chtml%3E%3Cruby%3Ea%3Crt%3Eb%3Crt%3E%3C/ruby%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cruby%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%3Crt%3E%0A%7C%20%20%20%20%20%20%20%20%20%22b%22%0A%7C%20%20%20%20%20%20%20%3Crt%3E"],"0e8c4b181993b477f4f215d5724b99ad04f18b2d":[async_test('html5lib_tests19.html 0e8c4b181993b477f4f215d5724b99ad04f18b2d'), "%3Chtml%3E%3Cruby%3Ea%3Crtc%3Eb%3Crt%3Ec%3Crb%3Ed%3C/ruby%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cruby%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%3Crtc%3E%0A%7C%20%20%20%20%20%20%20%20%20%22b%22%0A%7C%20%20%20%20%20%20%20%20%20%3Crt%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22c%22%0A%7C%20%20%20%20%20%20%20%3Crb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22d%22"],"e3f1de111562f25106efad76583a3b6c0e3516ba":[async_test('html5lib_tests19.html e3f1de111562f25106efad76583a3b6c0e3516ba'), "%3C%21doctype%20html%3E%3Cmath/%3E%3Cfoo%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%3Cfoo%3E"],"84db6521d1350830f3e46b7d9676527e1b4ee9e2":[async_test('html5lib_tests19.html 84db6521d1350830f3e46b7d9676527e1b4ee9e2'), "%3C%21doctype%20html%3E%3Csvg/%3E%3Cfoo%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%3Cfoo%3E"],"033d9b356b2a646471de009fa8a75e40500d2dd2":[async_test('html5lib_tests19.html 033d9b356b2a646471de009fa8a75e40500d2dd2'), "%3C%21doctype%20html%3E%3Cdiv%3E%3C/body%3E%3C%21--foo--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%3C%21--%20foo%20--%3E"],"0971186f913b3c7f915817d2b82c73ea6487e932":[async_test('html5lib_tests19.html 0971186f913b3c7f915817d2b82c73ea6487e932'), "%3C%21doctype%20html%3E%3Ch1%3E%3Cdiv%3E%3Ch3%3E%3Cspan%3E%3C/h1%3Efoo", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ch1%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ch3%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22"],"5257f17c3ecab5b65d74d7c27f0fd492f82ef9b9":[async_test('html5lib_tests19.html 5257f17c3ecab5b65d74d7c27f0fd492f82ef9b9'), "%3C%21doctype%20html%3E%3Cp%3E%3C/h3%3Efoo", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22foo%22"],"b8c3379e60829428188fd57e974ea4d8a7e7ec45":[async_test('html5lib_tests19.html b8c3379e60829428188fd57e974ea4d8a7e7ec45'), "%3C%21doctype%20html%3E%3Ch3%3E%3Cli%3Eabc%3C/h2%3Efoo", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ch3%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%20%20%22abc%22%0A%7C%20%20%20%20%20%22foo%22"],"f9ab61cdf08301bcf02208165cc94e6bdbad746c":[async_test('html5lib_tests19.html f9ab61cdf08301bcf02208165cc94e6bdbad746c'), "%3C%21doctype%20html%3E%3Ctable%3Eabc%3C%21--foo--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22abc%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3C%21--%20foo%20--%3E"],"c6aa9952dcccdde3fc6d4ba104647f049d038e66":[async_test('html5lib_tests19.html c6aa9952dcccdde3fc6d4ba104647f049d038e66'), "%3C%21doctype%20html%3E%3Ctable%3E%20%20%3C%21--foo--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%22%20%20%22%0A%7C%20%20%20%20%20%20%20%3C%21--%20foo%20--%3E"],"3984cbe166b42d77ff6dadc8e1687075db7a8e65":[async_test('html5lib_tests19.html 3984cbe166b42d77ff6dadc8e1687075db7a8e65'), "%3C%21doctype%20html%3E%3Ctable%3E%20b%20%3C%21--foo--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%20b%20%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3C%21--%20foo%20--%3E"],"2d78ba34eecedf8261e9a9e3f8858baf00a0d960":[async_test('html5lib_tests19.html 2d78ba34eecedf8261e9a9e3f8858baf00a0d960'), "%3C%21doctype%20html%3E%3Cselect%3E%3Coption%3E%3Coption%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E"],"8d45a57b7093df38c88dccb1f3fba6a62c810445":[async_test('html5lib_tests19.html 8d45a57b7093df38c88dccb1f3fba6a62c810445'), "%3C%21doctype%20html%3E%3Cselect%3E%3Coption%3E%3C/optgroup%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E"],"871917ed049ff21b35e74e39de2ca1eef6863562":[async_test('html5lib_tests19.html 871917ed049ff21b35e74e39de2ca1eef6863562'), "%3C%21doctype%20html%3E%3Cdd%3E%3Coptgroup%3E%3Cdd%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdd%3E%0A%7C%20%20%20%20%20%20%20%3Coptgroup%3E%0A%7C%20%20%20%20%20%3Cdd%3E"],"74ad5d3026f1b3eb6553086eb2811eed4418e334":[async_test('html5lib_tests19.html 74ad5d3026f1b3eb6553086eb2811eed4418e334'), "%3C%21doctype%20html%3E%3Cp%3E%3Cmath%3E%3Cmi%3E%3Cp%3E%3Ch1%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ch1%3E"],"0b1e97138c4d8e8d770f107202e46a18362fd587":[async_test('html5lib_tests19.html 0b1e97138c4d8e8d770f107202e46a18362fd587'), "%3C%21doctype%20html%3E%3Cp%3E%3Cmath%3E%3Cmo%3E%3Cp%3E%3Ch1%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mo%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ch1%3E"],"02624fcb7ddb77b15e9bc553d8392fc8cd031f68":[async_test('html5lib_tests19.html 02624fcb7ddb77b15e9bc553d8392fc8cd031f68'), "%3C%21doctype%20html%3E%3Cp%3E%3Cmath%3E%3Cmn%3E%3Cp%3E%3Ch1%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mn%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ch1%3E"],"a2579d287fd8111306e6dcd7248971a6baa4488d":[async_test('html5lib_tests19.html a2579d287fd8111306e6dcd7248971a6baa4488d'), "%3C%21doctype%20html%3E%3Cp%3E%3Cmath%3E%3Cms%3E%3Cp%3E%3Ch1%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20ms%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ch1%3E"],"acd1c9218828ea4367920c7a499c54de7f9a618f":[async_test('html5lib_tests19.html acd1c9218828ea4367920c7a499c54de7f9a618f'), "%3C%21doctype%20html%3E%3Cp%3E%3Cmath%3E%3Cmtext%3E%3Cp%3E%3Ch1%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mtext%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ch1%3E"],"36a6346b03982942b4427d5089271a101ebf1605":[async_test('html5lib_tests19.html 36a6346b03982942b4427d5089271a101ebf1605'), "%3C%21doctype%20html%3E%3Cframeset%3E%3C/noframes%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"e58ed5b56f81d057c23be31e068a10e694f52adf":[async_test('html5lib_tests19.html e58ed5b56f81d057c23be31e068a10e694f52adf'), "%3C%21doctype%20html%3E%3Chtml%20c%3Dd%3E%3Cbody%3E%3C/html%3E%3Chtml%20a%3Db%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20a%3D%22b%22%0A%7C%20%20%20c%3D%22d%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"d422166b880468765f34d89075d4db9c4fcbfee9":[async_test('html5lib_tests19.html d422166b880468765f34d89075d4db9c4fcbfee9'), "%3C%21doctype%20html%3E%3Chtml%20c%3Dd%3E%3Cframeset%3E%3C/frameset%3E%3C/html%3E%3Chtml%20a%3Db%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20a%3D%22b%22%0A%7C%20%20%20c%3D%22d%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"fc673f5874c0cf1477554dfb733d6292cc01558b":[async_test('html5lib_tests19.html fc673f5874c0cf1477554dfb733d6292cc01558b'), "%3C%21doctype%20html%3E%3Chtml%3E%3Cframeset%3E%3C/frameset%3E%3C/html%3E%3C%21--foo--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%3C%21--%20foo%20--%3E"],"0d2192c16cc224e770abff9e9e89e860aff9da78":[async_test('html5lib_tests19.html 0d2192c16cc224e770abff9e9e89e860aff9da78'), "%3C%21doctype%20html%3E%3Chtml%3E%3Cframeset%3E%3C/frameset%3E%3C/html%3E%20%20", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%22%20%20%22"],"d5941f6b68ef817d062636d0d61c24c68d0d86a2":[async_test('html5lib_tests19.html d5941f6b68ef817d062636d0d61c24c68d0d86a2'), "%3C%21doctype%20html%3E%3Chtml%3E%3Cframeset%3E%3C/frameset%3E%3C/html%3Eabc", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"259a085138224e3dfe0dceded2a043e72a8b6d76":[async_test('html5lib_tests19.html 259a085138224e3dfe0dceded2a043e72a8b6d76'), "%3C%21doctype%20html%3E%3Chtml%3E%3Cframeset%3E%3C/frameset%3E%3C/html%3E%3Cp%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"869fff76cfe00ff33987de007ce98dc949bf8cbf":[async_test('html5lib_tests19.html 869fff76cfe00ff33987de007ce98dc949bf8cbf'), "%3C%21doctype%20html%3E%3Chtml%3E%3Cframeset%3E%3C/frameset%3E%3C/html%3E%3C/p%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"c06518cdbf3816faf265644d28d93b7aee9258f7":[async_test('html5lib_tests19.html c06518cdbf3816faf265644d28d93b7aee9258f7'), "%3Chtml%3E%3Cframeset%3E%3C/frameset%3E%3C/html%3E%3C%21doctype%20html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"2fb0cdb3a9f69ca6c3d564e01f89d7173cd51295":[async_test('html5lib_tests19.html 2fb0cdb3a9f69ca6c3d564e01f89d7173cd51295'), "%3C%21doctype%20html%3E%3Cbody%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"138623cd07ccff1ce13bb1aa5dbaaadc962c414f":[async_test('html5lib_tests19.html 138623cd07ccff1ce13bb1aa5dbaaadc962c414f'), "%3C%21doctype%20html%3E%3Cp%3E%3Cframeset%3E%3Cframe%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%3Cframe%3E"],"52e4a8422d6ef591f33f8686842d974dbaa33302":[async_test('html5lib_tests19.html 52e4a8422d6ef591f33f8686842d974dbaa33302'), "%3C%21doctype%20html%3E%3Cp%3Ea%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22a%22"],"5ba1d0e97f121810025c1d6447a426c669661637":[async_test('html5lib_tests19.html 5ba1d0e97f121810025c1d6447a426c669661637'), "%3C%21doctype%20html%3E%3Cp%3E%20%3Cframeset%3E%3Cframe%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%3Cframe%3E"],"709ec07924db4c9fd66d48eac08575dfdef01d8f":[async_test('html5lib_tests19.html 709ec07924db4c9fd66d48eac08575dfdef01d8f'), "%3C%21doctype%20html%3E%3Cpre%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cpre%3E"],"f72edb80bc3be091e4b448cd1de8fe851d623e05":[async_test('html5lib_tests19.html f72edb80bc3be091e4b448cd1de8fe851d623e05'), "%3C%21doctype%20html%3E%3Clisting%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Clisting%3E"],"cb7de0dc7e17c1454ceaa7eb49cb9f9476a1f510":[async_test('html5lib_tests19.html cb7de0dc7e17c1454ceaa7eb49cb9f9476a1f510'), "%3C%21doctype%20html%3E%3Cli%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cli%3E"],"511bf4bae15c8119042e5e80b5358b70e7da26c1":[async_test('html5lib_tests19.html 511bf4bae15c8119042e5e80b5358b70e7da26c1'), "%3C%21doctype%20html%3E%3Cdd%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdd%3E"],"c51ee24ef9d92206318cc5bbba784630cd10e531":[async_test('html5lib_tests19.html c51ee24ef9d92206318cc5bbba784630cd10e531'), "%3C%21doctype%20html%3E%3Cdt%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdt%3E"],"819d39ae49fd04f0dfce90ac8ed2f8e423bb9329":[async_test('html5lib_tests19.html 819d39ae49fd04f0dfce90ac8ed2f8e423bb9329'), "%3C%21doctype%20html%3E%3Cbutton%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbutton%3E"],"ef6bdf5b3ba9d41d6c1c08ede60c2e7fb21c6d71":[async_test('html5lib_tests19.html ef6bdf5b3ba9d41d6c1c08ede60c2e7fb21c6d71'), "%3C%21doctype%20html%3E%3Capplet%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Capplet%3E"],"6bf9c038255c31f20d8fbeaebdf3609eb3c9ed75":[async_test('html5lib_tests19.html 6bf9c038255c31f20d8fbeaebdf3609eb3c9ed75'), "%3C%21doctype%20html%3E%3Cmarquee%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmarquee%3E"],"08983ab2a54f61b09a1df134cdaf51d321f3ef32":[async_test('html5lib_tests19.html 08983ab2a54f61b09a1df134cdaf51d321f3ef32'), "%3C%21doctype%20html%3E%3Cobject%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cobject%3E"],"2ef94ed028fa71b70540cf41f0884ae0c1cf8077":[async_test('html5lib_tests19.html 2ef94ed028fa71b70540cf41f0884ae0c1cf8077'), "%3C%21doctype%20html%3E%3Ctable%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E"],"5c9ed202789fb29566e0d146d155e0d672e8a037":[async_test('html5lib_tests19.html 5c9ed202789fb29566e0d146d155e0d672e8a037'), "%3C%21doctype%20html%3E%3Carea%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Carea%3E"],"7d766253cbf500df03506dfb7f2cbdd0f0f533c6":[async_test('html5lib_tests19.html 7d766253cbf500df03506dfb7f2cbdd0f0f533c6'), "%3C%21doctype%20html%3E%3Cbasefont%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cbasefont%3E%0A%7C%20%20%20%3Cframeset%3E"],"4d5629c61993ef0bb83fcbd80ccc6ead7cd776ee":[async_test('html5lib_tests19.html 4d5629c61993ef0bb83fcbd80ccc6ead7cd776ee'), "%3C%21doctype%20html%3E%3Cbgsound%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cbgsound%3E%0A%7C%20%20%20%3Cframeset%3E"],"6320d9fa3295984d3da7e4831ced75dfb97d4848":[async_test('html5lib_tests19.html 6320d9fa3295984d3da7e4831ced75dfb97d4848'), "%3C%21doctype%20html%3E%3Cbr%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbr%3E"],"bdb97868e951b7a719fa8b1afc79650bf9aae7a5":[async_test('html5lib_tests19.html bdb97868e951b7a719fa8b1afc79650bf9aae7a5'), "%3C%21doctype%20html%3E%3Cembed%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cembed%3E"],"81868cde252694a252b6b0c8d366850f8a54736c":[async_test('html5lib_tests19.html 81868cde252694a252b6b0c8d366850f8a54736c'), "%3C%21doctype%20html%3E%3Cimg%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cimg%3E"],"20651db48147f8dda189c563f5fa60bfd0913ac0":[async_test('html5lib_tests19.html 20651db48147f8dda189c563f5fa60bfd0913ac0'), "%3C%21doctype%20html%3E%3Cinput%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cinput%3E"],"d098e8a39897cd8453fc18399622e413872b054c":[async_test('html5lib_tests19.html d098e8a39897cd8453fc18399622e413872b054c'), "%3C%21doctype%20html%3E%3Ckeygen%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ckeygen%3E"],"0beb7903dcc0dbee206d8b6e729963a0461eedb3":[async_test('html5lib_tests19.html 0beb7903dcc0dbee206d8b6e729963a0461eedb3'), "%3C%21doctype%20html%3E%3Cwbr%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cwbr%3E"],"78e5cdb86bf2aecef4697d70d50499b50de5c25b":[async_test('html5lib_tests19.html 78e5cdb86bf2aecef4697d70d50499b50de5c25b'), "%3C%21doctype%20html%3E%3Chr%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Chr%3E"],"cfb1d482e5971a6915c90434f580721b772fc09b":[async_test('html5lib_tests19.html cfb1d482e5971a6915c90434f580721b772fc09b'), "%3C%21doctype%20html%3E%3Ctextarea%3E%3C/textarea%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E"],"99d8bff8bbcca1c7faa7b6e10b9ff305b9f99594":[async_test('html5lib_tests19.html 99d8bff8bbcca1c7faa7b6e10b9ff305b9f99594'), "%3C%21doctype%20html%3E%3Cxmp%3E%3C/xmp%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cxmp%3E"],"daaa43db05ffe9bdd8d734a4389fb3c459caddf1":[async_test('html5lib_tests19.html daaa43db05ffe9bdd8d734a4389fb3c459caddf1'), "%3C%21doctype%20html%3E%3Ciframe%3E%3C/iframe%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ciframe%3E"],"b3d421e57a4135731309152d7f47e26a4866f3d6":[async_test('html5lib_tests19.html b3d421e57a4135731309152d7f47e26a4866f3d6'), "%3C%21doctype%20html%3E%3Cselect%3E%3C/select%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"aa5eac4b7a0bafdafcd52cb190a8e181ff74144c":[async_test('html5lib_tests19.html aa5eac4b7a0bafdafcd52cb190a8e181ff74144c'), "%3C%21doctype%20html%3E%3Csvg%3E%3C/svg%3E%3Cframeset%3E%3Cframe%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%3Cframe%3E"],"91d56a57f4c8af2bce03e9974df0a80f62686fb4":[async_test('html5lib_tests19.html 91d56a57f4c8af2bce03e9974df0a80f62686fb4'), "%3C%21doctype%20html%3E%3Cmath%3E%3C/math%3E%3Cframeset%3E%3Cframe%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%3Cframe%3E"],"9cbad5cad719a63d2eb7721de6737a346ad42da1":[async_test('html5lib_tests19.html 9cbad5cad719a63d2eb7721de6737a346ad42da1'), "%3C%21doctype%20html%3E%3Csvg%3E%3CforeignObject%3E%3Cdiv%3E%20%3Cframeset%3E%3Cframe%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%3Cframe%3E"],"057c2e91a7e6053d39436efe2bc29049f6fa8e82":[async_test('html5lib_tests19.html 057c2e91a7e6053d39436efe2bc29049f6fa8e82'), "%3C%21doctype%20html%3E%3Csvg%3Ea%3C/svg%3E%3Cframeset%3E%3Cframe%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22a%22"],"61e6517e5e82cdaed41ab3e1f6fa927731aa0c82":[async_test('html5lib_tests19.html 61e6517e5e82cdaed41ab3e1f6fa927731aa0c82'), "%3C%21doctype%20html%3E%3Csvg%3E%20%3C/svg%3E%3Cframeset%3E%3Cframe%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%3Cframe%3E"],"9274ab4f08baa52c5d7016f6062f186730cfbe6c":[async_test('html5lib_tests19.html 9274ab4f08baa52c5d7016f6062f186730cfbe6c'), "%3Chtml%3Eaaa%3Cframeset%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22aaa%22"],"fc2fa41ebadc21653b38d70c1097bd4ac5979948":[async_test('html5lib_tests19.html fc2fa41ebadc21653b38d70c1097bd4ac5979948'), "%3Chtml%3E%20a%20%3Cframeset%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22a%20%22"],"473303e65f26fafacbaf01c11b04d745ff293963":[async_test('html5lib_tests19.html 473303e65f26fafacbaf01c11b04d745ff293963'), "%3C%21doctype%20html%3E%3Cdiv%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"7854276e1637619f693cd87f64542c08c35d40bd":[async_test('html5lib_tests19.html 7854276e1637619f693cd87f64542c08c35d40bd'), "%3C%21doctype%20html%3E%3Cdiv%3E%3Cbody%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E"],"a2d262d392e8d10645ce559edf401df3f3872eb3":[async_test('html5lib_tests19.html a2d262d392e8d10645ce559edf401df3f3872eb3'), "%3C%21doctype%20html%3E%3Cp%3E%3Cmath%3E%3C/p%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%22a%22"],"d5e50987bf495e285e279ff8670255d9b1314f5d":[async_test('html5lib_tests19.html d5e50987bf495e285e279ff8670255d9b1314f5d'), "%3C%21doctype%20html%3E%3Cp%3E%3Cmath%3E%3Cmn%3E%3Cspan%3E%3C/p%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mn%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"be54d7506e54a127a05b115a8659a5b52fa57f6c":[async_test('html5lib_tests19.html be54d7506e54a127a05b115a8659a5b52fa57f6c'), "%3C%21doctype%20html%3E%3Cmath%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E"],"af389f1a8ef93c457560fd2445df80a6789dab0d":[async_test('html5lib_tests19.html af389f1a8ef93c457560fd2445df80a6789dab0d'), "%3C%21doctype%20html%3E%3Cmeta%20charset%3D%22ascii%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%20%20charset%3D%22ascii%22%0A%7C%20%20%20%3Cbody%3E"],"601dfa9502942deb8bf46a91c64f10f649bc1875":[async_test('html5lib_tests19.html 601dfa9502942deb8bf46a91c64f10f649bc1875'), "%3C%21doctype%20html%3E%3Cmeta%20http-equiv%3D%22content-type%22%20content%3D%22text/html%3Bcharset%3Dascii%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%20%20content%3D%22text/html%3Bcharset%3Dascii%22%0A%7C%20%20%20%20%20%20%20http-equiv%3D%22content-type%22%0A%7C%20%20%20%3Cbody%3E"],"4b01442faf29563d3b736d235515f77c20c81863":[async_test('html5lib_tests19.html 4b01442faf29563d3b736d235515f77c20c81863'), "%3C%21doctype%20html%3E%3Chead%3E%3C%21--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--%3E%3Cmeta%20charset%3D%22utf8%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3C%21--%20aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%20--%3E%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%20%20charset%3D%22utf8%22%0A%7C%20%20%20%3Cbody%3E"],"696a2b60681b0b6758f165a67e29a84b0f75a153":[async_test('html5lib_tests19.html 696a2b60681b0b6758f165a67e29a84b0f75a153'), "%3C%21doctype%20html%3E%3Chtml%20a%3Db%3E%3Chead%3E%3C/head%3E%3Chtml%20c%3Dd%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20a%3D%22b%22%0A%7C%20%20%20c%3D%22d%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"7a48b98cbae5cd7cbbb90f138c0d12da6c4448b3":[async_test('html5lib_tests19.html 7a48b98cbae5cd7cbbb90f138c0d12da6c4448b3'), "%3C%21doctype%20html%3E%3Cimage/%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cimg%3E"],"d7693a0f2be68925250d3aa2cf295b1d1a60bf94":[async_test('html5lib_tests19.html d7693a0f2be68925250d3aa2cf295b1d1a60bf94'), "%3C%21doctype%20html%3Ea%3Ci%3Eb%3Ctable%3Ec%3Cb%3Ed%3C/i%3Ee%3C/b%3Ef", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%22bc%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22de%22%0A%7C%20%20%20%20%20%20%20%22f%22%0A%7C%20%20%20%20%20%20%20%3Ctable%3E"],"9e4d91f02184de1b1e5d927144bb06d3bc78bb09":[async_test('html5lib_tests19.html 9e4d91f02184de1b1e5d927144bb06d3bc78bb09'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ci%3Ea%3Cb%3Eb%3Cdiv%3Ec%3Ca%3Ed%3C/i%3Ee%3C/b%3Ef", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22b%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22c%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22d%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22e%22%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%22f%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"9655591702381a52fe0eb3224e63e2d8bfd735e8":[async_test('html5lib_tests19.html 9655591702381a52fe0eb3224e63e2d8bfd735e8'), "%3C%21doctype%20html%3E%3Ci%3Ea%3Cb%3Eb%3Cdiv%3Ec%3Ca%3Ed%3C/i%3Ee%3C/b%3Ef", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22b%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22c%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22d%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22e%22%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%22f%22"],"fe9aa1c8ec32796e26f3e58022f0e42dc365b5c7":[async_test('html5lib_tests19.html fe9aa1c8ec32796e26f3e58022f0e42dc365b5c7'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ci%3Ea%3Cb%3Eb%3Cdiv%3Ec%3C/i%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22b%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22c%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"4c9ec04359c3e94d4a56d6932d289f0c4246d1ef":[async_test('html5lib_tests19.html 4c9ec04359c3e94d4a56d6932d289f0c4246d1ef'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ci%3Ea%3Cdiv%3Eb%3Ctr%3Ec%3Cb%3Ed%3C/i%3Ee", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%22b%22%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%22c%22%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22d%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22e%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"3fcc2f15951b3c3375c3e359cf7888c71187994a":[async_test('html5lib_tests19.html 3fcc2f15951b3c3375c3e359cf7888c71187994a'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctd%3E%3Ctable%3E%3Ci%3Ea%3Cdiv%3Eb%3Cb%3Ec%3C/i%3Ed", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22b%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22c%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22d%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E"],"a94b35c317763de75150df6b436c7c153aeb8c51":[async_test('html5lib_tests19.html a94b35c317763de75150df6b436c7c153aeb8c51'), "%3C%21doctype%20html%3E%3Cbody%3E%3Cbgsound%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbgsound%3E"],"173b990198dd8fd9534d7808817c19440b75d406":[async_test('html5lib_tests19.html 173b990198dd8fd9534d7808817c19440b75d406'), "%3C%21doctype%20html%3E%3Cbody%3E%3Cbasefont%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbasefont%3E"],"48ed5945491d4ad0c00acfd01c2060a459436d34":[async_test('html5lib_tests19.html 48ed5945491d4ad0c00acfd01c2060a459436d34'), "%3C%21doctype%20html%3E%3Ca%3E%3Cb%3E%3C/a%3E%3Cbasefont%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cbasefont%3E"],"392b8d4d25351467da961e4ab011a1d4e970b97a":[async_test('html5lib_tests19.html 392b8d4d25351467da961e4ab011a1d4e970b97a'), "%3C%21doctype%20html%3E%3Ca%3E%3Cb%3E%3C/a%3E%3Cbgsound%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cbgsound%3E"],"bd14373173ea3617610fc8154237f59f1a810733":[async_test('html5lib_tests19.html bd14373173ea3617610fc8154237f59f1a810733'), "%3C%21doctype%20html%3E%3Cfigcaption%3E%3Carticle%3E%3C/figcaption%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfigcaption%3E%0A%7C%20%20%20%20%20%20%20%3Carticle%3E%0A%7C%20%20%20%20%20%22a%22"],"db3c4ddb389a2b8f42ca6b3719007d4de2eccc41":[async_test('html5lib_tests19.html db3c4ddb389a2b8f42ca6b3719007d4de2eccc41'), "%3C%21doctype%20html%3E%3Csummary%3E%3Carticle%3E%3C/summary%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csummary%3E%0A%7C%20%20%20%20%20%20%20%3Carticle%3E%0A%7C%20%20%20%20%20%22a%22"],"c1741a62627b2e5bb1cfa2b2cd667f3f9f76157e":[async_test('html5lib_tests19.html c1741a62627b2e5bb1cfa2b2cd667f3f9f76157e'), "%3C%21doctype%20html%3E%3Cp%3E%3Ca%3E%3Cplaintext%3Eb", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Cplaintext%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%22b%22"],"0d6cf626790e9f06e30ceb6baf3004663b0247e7":[async_test('html5lib_tests19.html 0d6cf626790e9f06e30ceb6baf3004663b0247e7'), "%3C%21DOCTYPE%20html%3E%3Cdiv%3Ea%3Ca%3E%3C/div%3Eb%3Cp%3Ec%3C/p%3Ed", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%22b%22%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%22c%22%0A%7C%20%20%20%20%20%20%20%22d%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests2.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests2.html
new file mode 100644
index 000000000..a09d593e2
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests2.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests2.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['e070301fb578bd639ecbc7ec720fa60222d05826','aaf24dabcb42470e447d241a40def0d136c12b93','b6c1142484570bb90c36e454ee193cca17bb618a','1977644a94de1a04245dfef3f3db69c7ac41aa6f','fb0d7207ed9fbc3fe5d1e0f85ad18c247dfb05a3','d662798ca6dd95a205069658396d0f3d78237233','1ec72d53c4c68f9ca56f037ec53a7dc261886131','2d58ae67534b42e52e34c6b2a275fcb30a878008','14836de42a7fb86b75fef03f08823f90d389b7f3','8ced679aed45a123b97a574f24fba909b65f94dd','932ff3ff2c75f7b28ef562dfa9c7cb208f0712d4','c863d867f843bd66c5303db1634931a36afd3ea9','2221f89de75008a31506b22756a5499bc6bda9bd','7471f6a45872ac6d70f69fc3f4e10b13c7c1ac45','47b9eaef1b5aad0e3963a8d415236fed12702d65','decb4ad6eac317f262b4b87c86b33d2d9d700e75','ffcb1856faa7e09cc892c0f5a4d3353716830784','a259db8ee062d858027148f92811ba0f5796e4b9','bf369032d1e6ebb52ab133e4c4b8c2e872349843','73b97cd984a62703ec54ec4a876ec32aa5fd3b8c','2db9616ed62fc2a26056f3395459869cf556974d','b59aa1c714892618eaccd51696658887fcbd2045','98818e7fda2506603bd208662613edb40297c2d3','e0c43080cf61c0696031bdb097bea4f2a647cfc2','f7753d80a422c40b5fa04d99e52d8ae83369757a','7cbd584aef9508a90c98f80040078149a92ec869','e0f7f130b1e3653dd06f10f3492e4f0bf4cd3cfa','4fb9b13eeb5d8a201884c572764a70477822f2d4','7ec82c93064966931ce76618a0cce4f275aafdaf','a8fb1cffc8683f0c47fdf9963e0d52c627343ff0','8dc47e70b94f2bea514ceaa51153ec1beeeda7ef','571719c0f9e1dae32ef993917b02c57f698be3d9','7f3afa5785d4b7ea37f8bae17226528f2a30e818','37918d1876724d3a8980920cf4cf2cbef2c3ac06','5da4e202a8962cacf567ce864873ddbff73f8217','4ca566310edc49450571677e8ef195883919ec2f','8a559c045c3a880e555d31de4dd3aa0b06930b73','3067a820b0195f9c08b8d0fe1dd7f8d800e10779','e1011849d36ebf9d1577c53d940a75c462dcb1e7','c9938e14b139e9c2af300bacd38f2f3cfca3fe58','0582a2e2c0eb00e0ba60b280187006c5e7de6991','478db7eafb3ac4a6abb8dbe083664c8d3ada35d8','c6abe422542794d7e8196d73283e562c309fe2e3','9fd0577023d0eb3662569333f5f231090439a217','a288ea4fde56fc652f4ec4db0b63af1ddfeac826','0c917166dc089cb23a100af2f07cbf95f164533a','60f3ef7971b3259c3d800da672d886b2db778276','341bdf232d96b774988ee3163c953f2581752335','84570bfd25f23f0f40e31ba0c6a08906a2676b6d','4dbef924230e654860aa288a28f6304a062b3faf','2e8a5d6aa8cb0011b6caa08a44cd8871e4b15b71','06e43760aeadae330ad5ba80c4b93952ba568b29','4e58f3f3c581dec50f939a660fd5b5828396dac4','693974a6cb0defd3e0b2d63b31d420f39c83d262','3e03ddf29af0af9c9ece091251f0c1c5e08a5e41','9a5211623fcdd9fc3ad2ea4addc608d7c2574b90','39f31f0fbfcc91157104d64ca081d4271bc7e838','86d793db69ce071e78a18c85f8345316f09e1790','182036d2ef28f86873aee09b15125c828179c1b4','2a818d5fd74c60ac2bb369fb2355b84edab31777','9f88d21c8b77696f7238064a4ee87931cc16a03f','1d00919bf0b2493dfee7422a24acee9026de5fff','0c48a9e7584ede9d13d606057202883c5cff3eab',];
+ var tests = {
+ "e070301fb578bd639ecbc7ec720fa60222d05826":[async_test('html5lib_tests2.html e070301fb578bd639ecbc7ec720fa60222d05826'), "%3C%21DOCTYPE%20html%3ETest", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Test%22"],"aaf24dabcb42470e447d241a40def0d136c12b93":[async_test('html5lib_tests2.html aaf24dabcb42470e447d241a40def0d136c12b93'), "%3Ctextarea%3Etest%3C/div%3Etest", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22test%3C/div%3Etest%22"],"b6c1142484570bb90c36e454ee193cca17bb618a":[async_test('html5lib_tests2.html b6c1142484570bb90c36e454ee193cca17bb618a'), "%3Ctable%3E%3Ctd%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"1977644a94de1a04245dfef3f3db69c7ac41aa6f":[async_test('html5lib_tests2.html 1977644a94de1a04245dfef3f3db69c7ac41aa6f'), "%3Ctable%3E%3Ctd%3Etest%3C/tbody%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22test%22"],"fb0d7207ed9fbc3fe5d1e0f85ad18c247dfb05a3":[async_test('html5lib_tests2.html fb0d7207ed9fbc3fe5d1e0f85ad18c247dfb05a3'), "%3Cframe%3Etest", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22test%22"],"d662798ca6dd95a205069658396d0f3d78237233":[async_test('html5lib_tests2.html d662798ca6dd95a205069658396d0f3d78237233'), "%3C%21DOCTYPE%20html%3E%3Cframeset%3Etest", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"1ec72d53c4c68f9ca56f037ec53a7dc261886131":[async_test('html5lib_tests2.html 1ec72d53c4c68f9ca56f037ec53a7dc261886131'), "%3C%21DOCTYPE%20html%3E%3Cframeset%3E%20te%20st", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%22%20%20%22"],"2d58ae67534b42e52e34c6b2a275fcb30a878008":[async_test('html5lib_tests2.html 2d58ae67534b42e52e34c6b2a275fcb30a878008'), "%3C%21DOCTYPE%20html%3E%3Cframeset%3E%3C/frameset%3E%20te%20st", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%22%20%20%22"],"14836de42a7fb86b75fef03f08823f90d389b7f3":[async_test('html5lib_tests2.html 14836de42a7fb86b75fef03f08823f90d389b7f3'), "%3C%21DOCTYPE%20html%3E%3Cframeset%3E%3C%21DOCTYPE%20html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"8ced679aed45a123b97a574f24fba909b65f94dd":[async_test('html5lib_tests2.html 8ced679aed45a123b97a574f24fba909b65f94dd'), "%3C%21DOCTYPE%20html%3E%3Cfont%3E%3Cp%3E%3Cb%3Etest%3C/font%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22test%22"],"932ff3ff2c75f7b28ef562dfa9c7cb208f0712d4":[async_test('html5lib_tests2.html 932ff3ff2c75f7b28ef562dfa9c7cb208f0712d4'), "%3C%21DOCTYPE%20html%3E%3Cdt%3E%3Cdiv%3E%3Cdd%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdt%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%3Cdd%3E"],"c863d867f843bd66c5303db1634931a36afd3ea9":[async_test('html5lib_tests2.html c863d867f843bd66c5303db1634931a36afd3ea9'), "%3Cscript%3E%3C/x", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C/x%22%0A%7C%20%20%20%3Cbody%3E"],"2221f89de75008a31506b22756a5499bc6bda9bd":[async_test('html5lib_tests2.html 2221f89de75008a31506b22756a5499bc6bda9bd'), "%3Ctable%3E%3Cplaintext%3E%3Ctd%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cplaintext%3E%0A%7C%20%20%20%20%20%20%20%22%3Ctd%3E%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"7471f6a45872ac6d70f69fc3f4e10b13c7c1ac45":[async_test('html5lib_tests2.html 7471f6a45872ac6d70f69fc3f4e10b13c7c1ac45'), "%3Cplaintext%3E%3C/plaintext%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cplaintext%3E%0A%7C%20%20%20%20%20%20%20%22%3C/plaintext%3E%22"],"47b9eaef1b5aad0e3963a8d415236fed12702d65":[async_test('html5lib_tests2.html 47b9eaef1b5aad0e3963a8d415236fed12702d65'), "%3C%21DOCTYPE%20html%3E%3Ctable%3E%3Ctr%3ETEST", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22TEST%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"decb4ad6eac317f262b4b87c86b33d2d9d700e75":[async_test('html5lib_tests2.html decb4ad6eac317f262b4b87c86b33d2d9d700e75'), "%3C%21DOCTYPE%20html%3E%3Cbody%20t1%3D1%3E%3Cbody%20t2%3D2%3E%3Cbody%20t3%3D3%20t4%3D4%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20t1%3D%221%22%0A%7C%20%20%20%20%20t2%3D%222%22%0A%7C%20%20%20%20%20t3%3D%223%22%0A%7C%20%20%20%20%20t4%3D%224%22"],"ffcb1856faa7e09cc892c0f5a4d3353716830784":[async_test('html5lib_tests2.html ffcb1856faa7e09cc892c0f5a4d3353716830784'), "%3C/b%20test", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"a259db8ee062d858027148f92811ba0f5796e4b9":[async_test('html5lib_tests2.html a259db8ee062d858027148f92811ba0f5796e4b9'), "%3C%21DOCTYPE%20html%3E%3C/b%20test%3Cb%20%26%3D%26amp%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22"],"bf369032d1e6ebb52ab133e4c4b8c2e872349843":[async_test('html5lib_tests2.html bf369032d1e6ebb52ab133e4c4b8c2e872349843'), "%3C%21doctypehtml%3E%3CscrIPt%20type%3Dtext/x-foobar%3Bbaz%3EX%3C/SCRipt", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20type%3D%22text/x-foobar%3Bbaz%22%0A%7C%20%20%20%20%20%20%20%22X%3C/SCRipt%22%0A%7C%20%20%20%3Cbody%3E"],"73b97cd984a62703ec54ec4a876ec32aa5fd3b8c":[async_test('html5lib_tests2.html 73b97cd984a62703ec54ec4a876ec32aa5fd3b8c'), "%26", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%26%22"],"2db9616ed62fc2a26056f3395459869cf556974d":[async_test('html5lib_tests2.html 2db9616ed62fc2a26056f3395459869cf556974d'), "%26%23", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%26%23%22"],"b59aa1c714892618eaccd51696658887fcbd2045":[async_test('html5lib_tests2.html b59aa1c714892618eaccd51696658887fcbd2045'), "%26%23X", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%26%23X%22"],"98818e7fda2506603bd208662613edb40297c2d3":[async_test('html5lib_tests2.html 98818e7fda2506603bd208662613edb40297c2d3'), "%26%23x", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%26%23x%22"],"e0c43080cf61c0696031bdb097bea4f2a647cfc2":[async_test('html5lib_tests2.html e0c43080cf61c0696031bdb097bea4f2a647cfc2'), "%26%2345", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22-%22"],"f7753d80a422c40b5fa04d99e52d8ae83369757a":[async_test('html5lib_tests2.html f7753d80a422c40b5fa04d99e52d8ae83369757a'), "%26x-test", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%26x-test%22"],"7cbd584aef9508a90c98f80040078149a92ec869":[async_test('html5lib_tests2.html 7cbd584aef9508a90c98f80040078149a92ec869'), "%3C%21doctypehtml%3E%3Cp%3E%3Cli%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Cli%3E"],"e0f7f130b1e3653dd06f10f3492e4f0bf4cd3cfa":[async_test('html5lib_tests2.html e0f7f130b1e3653dd06f10f3492e4f0bf4cd3cfa'), "%3C%21doctypehtml%3E%3Cp%3E%3Cdt%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Cdt%3E"],"4fb9b13eeb5d8a201884c572764a70477822f2d4":[async_test('html5lib_tests2.html 4fb9b13eeb5d8a201884c572764a70477822f2d4'), "%3C%21doctypehtml%3E%3Cp%3E%3Cdd%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Cdd%3E"],"7ec82c93064966931ce76618a0cce4f275aafdaf":[async_test('html5lib_tests2.html 7ec82c93064966931ce76618a0cce4f275aafdaf'), "%3C%21doctypehtml%3E%3Cp%3E%3Cform%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Cform%3E"],"a8fb1cffc8683f0c47fdf9963e0d52c627343ff0":[async_test('html5lib_tests2.html a8fb1cffc8683f0c47fdf9963e0d52c627343ff0'), "%3C%21DOCTYPE%20html%3E%3Cp%3E%3C/P%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%22X%22"],"8dc47e70b94f2bea514ceaa51153ec1beeeda7ef":[async_test('html5lib_tests2.html 8dc47e70b94f2bea514ceaa51153ec1beeeda7ef'), "%26AMP", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%26%22"],"571719c0f9e1dae32ef993917b02c57f698be3d9":[async_test('html5lib_tests2.html 571719c0f9e1dae32ef993917b02c57f698be3d9'), "%26AMp%3B", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%26AMp%3B%22"],"7f3afa5785d4b7ea37f8bae17226528f2a30e818":[async_test('html5lib_tests2.html 7f3afa5785d4b7ea37f8bae17226528f2a30e818'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E%3CthisISasillyTESTelementNameToMakeSureCrazyTagNamesArePARSEDcorrectLY%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cthisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly%3E"],"37918d1876724d3a8980920cf4cf2cbef2c3ac06":[async_test('html5lib_tests2.html 37918d1876724d3a8980920cf4cf2cbef2c3ac06'), "%3C%21DOCTYPE%20html%3EX%3C/body%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22XX%22"],"5da4e202a8962cacf567ce864873ddbff73f8217":[async_test('html5lib_tests2.html 5da4e202a8962cacf567ce864873ddbff73f8217'), "%3C%21DOCTYPE%20html%3E%3C%21--%20X", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3C%21--%20%20X%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"4ca566310edc49450571677e8ef195883919ec2f":[async_test('html5lib_tests2.html 4ca566310edc49450571677e8ef195883919ec2f'), "%3C%21DOCTYPE%20html%3E%3Ctable%3E%3Ccaption%3Etest%20TEST%3C/caption%3E%3Ctd%3Etest", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%22test%20TEST%22%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22test%22"],"8a559c045c3a880e555d31de4dd3aa0b06930b73":[async_test('html5lib_tests2.html 8a559c045c3a880e555d31de4dd3aa0b06930b73'), "%3C%21DOCTYPE%20html%3E%3Cselect%3E%3Coption%3E%3Coptgroup%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%3Coptgroup%3E"],"3067a820b0195f9c08b8d0fe1dd7f8d800e10779":[async_test('html5lib_tests2.html 3067a820b0195f9c08b8d0fe1dd7f8d800e10779'), "%3C%21DOCTYPE%20html%3E%3Cselect%3E%3Coptgroup%3E%3Coption%3E%3C/optgroup%3E%3Coption%3E%3Cselect%3E%3Coption%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coptgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%3Coption%3E"],"e1011849d36ebf9d1577c53d940a75c462dcb1e7":[async_test('html5lib_tests2.html e1011849d36ebf9d1577c53d940a75c462dcb1e7'), "%3C%21DOCTYPE%20html%3E%3Cselect%3E%3Coptgroup%3E%3Coption%3E%3Coptgroup%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coptgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%3Coptgroup%3E"],"c9938e14b139e9c2af300bacd38f2f3cfca3fe58":[async_test('html5lib_tests2.html c9938e14b139e9c2af300bacd38f2f3cfca3fe58'), "%3C%21DOCTYPE%20html%3E%3Cdatalist%3E%3Coption%3Efoo%3C/datalist%3Ebar", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdatalist%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%22bar%22"],"0582a2e2c0eb00e0ba60b280187006c5e7de6991":[async_test('html5lib_tests2.html 0582a2e2c0eb00e0ba60b280187006c5e7de6991'), "%3C%21DOCTYPE%20html%3E%3Cfont%3E%3Cinput%3E%3Cinput%3E%3C/font%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%3Cinput%3E"],"478db7eafb3ac4a6abb8dbe083664c8d3ada35d8":[async_test('html5lib_tests2.html 478db7eafb3ac4a6abb8dbe083664c8d3ada35d8'), "%3C%21DOCTYPE%20html%3E%3C%21--%20XXX%20-%20XXX%20--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3C%21--%20%20XXX%20-%20XXX%20%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"c6abe422542794d7e8196d73283e562c309fe2e3":[async_test('html5lib_tests2.html c6abe422542794d7e8196d73283e562c309fe2e3'), "%3C%21DOCTYPE%20html%3E%3C%21--%20XXX%20-%20XXX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3C%21--%20%20XXX%20-%20XXX%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"9fd0577023d0eb3662569333f5f231090439a217":[async_test('html5lib_tests2.html 9fd0577023d0eb3662569333f5f231090439a217'), "%3C%21DOCTYPE%20html%3E%3C%21--%20XXX%20-%20XXX%20-%20XXX%20--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3C%21--%20%20XXX%20-%20XXX%20-%20XXX%20%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"a288ea4fde56fc652f4ec4db0b63af1ddfeac826":[async_test('html5lib_tests2.html a288ea4fde56fc652f4ec4db0b63af1ddfeac826'), "%3Cisindex%20test%3Dx%20name%3Dx%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20%3Chr%3E%0A%7C%20%20%20%20%20%20%20%3Clabel%3E%0A%7C%20%20%20%20%20%20%20%20%20%22This%20is%20a%20searchable%20index.%20Enter%20search%20keywords%3A%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20name%3D%22isindex%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20test%3D%22x%22%0A%7C%20%20%20%20%20%20%20%3Chr%3E"],"0c917166dc089cb23a100af2f07cbf95f164533a":[async_test('html5lib_tests2.html 0c917166dc089cb23a100af2f07cbf95f164533a'), "test%0Atest", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22test%0Atest%22"],"60f3ef7971b3259c3d800da672d886b2db778276":[async_test('html5lib_tests2.html 60f3ef7971b3259c3d800da672d886b2db778276'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctitle%3Etest%3C/body%3E%3C/title%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22test%3C/body%3E%22"],"341bdf232d96b774988ee3163c953f2581752335":[async_test('html5lib_tests2.html 341bdf232d96b774988ee3163c953f2581752335'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctitle%3EX%3C/title%3E%3Cmeta%20name%3Dz%3E%3Clink%20rel%3Dfoo%3E%3Cstyle%3E%0Ax%20%7B%20content%3A%22%3C/style%22%20%7D%20%3C/style%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%20%20name%3D%22z%22%0A%7C%20%20%20%20%20%3Clink%3E%0A%7C%20%20%20%20%20%20%20rel%3D%22foo%22%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%0Ax%20%7B%20content%3A%22%3C/style%22%20%7D%20%22"],"84570bfd25f23f0f40e31ba0c6a08906a2676b6d":[async_test('html5lib_tests2.html 84570bfd25f23f0f40e31ba0c6a08906a2676b6d'), "%3C%21DOCTYPE%20html%3E%3Cselect%3E%3Coptgroup%3E%3C/optgroup%3E%3C/select%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coptgroup%3E"],"4dbef924230e654860aa288a28f6304a062b3faf":[async_test('html5lib_tests2.html 4dbef924230e654860aa288a28f6304a062b3faf'), "%20%0A%20", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"2e8a5d6aa8cb0011b6caa08a44cd8871e4b15b71":[async_test('html5lib_tests2.html 2e8a5d6aa8cb0011b6caa08a44cd8871e4b15b71'), "%3C%21DOCTYPE%20html%3E%20%20%3Chtml%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"06e43760aeadae330ad5ba80c4b93952ba568b29":[async_test('html5lib_tests2.html 06e43760aeadae330ad5ba80c4b93952ba568b29'), "%3C%21DOCTYPE%20html%3E%3Cscript%3E%0A%3C/script%3E%20%20%3Ctitle%3Ex%3C/title%3E%20%20%3C/head%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%22%20%20%22%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%22%20%20%22%0A%7C%20%20%20%3Cbody%3E"],"4e58f3f3c581dec50f939a660fd5b5828396dac4":[async_test('html5lib_tests2.html 4e58f3f3c581dec50f939a660fd5b5828396dac4'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Cbody%3E%3Chtml%20id%3Dx%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20id%3D%22x%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"693974a6cb0defd3e0b2d63b31d420f39c83d262":[async_test('html5lib_tests2.html 693974a6cb0defd3e0b2d63b31d420f39c83d262'), "%3C%21DOCTYPE%20html%3EX%3C/body%3E%3Chtml%20id%3D%22x%22%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20id%3D%22x%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22"],"3e03ddf29af0af9c9ece091251f0c1c5e08a5e41":[async_test('html5lib_tests2.html 3e03ddf29af0af9c9ece091251f0c1c5e08a5e41'), "%3C%21DOCTYPE%20html%3E%3Chead%3E%3Chtml%20id%3Dx%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20id%3D%22x%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"9a5211623fcdd9fc3ad2ea4addc608d7c2574b90":[async_test('html5lib_tests2.html 9a5211623fcdd9fc3ad2ea4addc608d7c2574b90'), "%3C%21DOCTYPE%20html%3EX%3C/html%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22XX%22"],"39f31f0fbfcc91157104d64ca081d4271bc7e838":[async_test('html5lib_tests2.html 39f31f0fbfcc91157104d64ca081d4271bc7e838'), "%3C%21DOCTYPE%20html%3EX%3C/html%3E%20", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%20%22"],"86d793db69ce071e78a18c85f8345316f09e1790":[async_test('html5lib_tests2.html 86d793db69ce071e78a18c85f8345316f09e1790'), "%3C%21DOCTYPE%20html%3EX%3C/html%3E%3Cp%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22X%22"],"182036d2ef28f86873aee09b15125c828179c1b4":[async_test('html5lib_tests2.html 182036d2ef28f86873aee09b15125c828179c1b4'), "%3C%21DOCTYPE%20html%3EX%3Cp/x/y/z%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20x%3D%22%22%0A%7C%20%20%20%20%20%20%20y%3D%22%22%0A%7C%20%20%20%20%20%20%20z%3D%22%22"],"2a818d5fd74c60ac2bb369fb2355b84edab31777":[async_test('html5lib_tests2.html 2a818d5fd74c60ac2bb369fb2355b84edab31777'), "%3C%21DOCTYPE%20html%3E%3C%21--x--", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3C%21--%20x%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"9f88d21c8b77696f7238064a4ee87931cc16a03f":[async_test('html5lib_tests2.html 9f88d21c8b77696f7238064a4ee87931cc16a03f'), "%3C%21DOCTYPE%20html%3E%3Ctable%3E%3Ctr%3E%3Ctd%3E%3C/p%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E"],"1d00919bf0b2493dfee7422a24acee9026de5fff":[async_test('html5lib_tests2.html 1d00919bf0b2493dfee7422a24acee9026de5fff'), "%3C%21DOCTYPE%20%3C%21DOCTYPE%20HTML%3E%3E%3C%21--%3C%21--x--%3E--%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20%3C%21doctype%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%3E%22%0A%7C%20%20%20%20%20%3C%21--%20%3C%21--x%20--%3E%0A%7C%20%20%20%20%20%22--%3E%22"],"0c48a9e7584ede9d13d606057202883c5cff3eab":[async_test('html5lib_tests2.html 0c48a9e7584ede9d13d606057202883c5cff3eab'), "%3C%21doctype%20html%3E%3Cdiv%3E%3Cform%3E%3C/form%3E%3Cdiv%3E%3C/div%3E%3C/div%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests20.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests20.html
new file mode 100644
index 000000000..19c904fc5
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests20.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests20.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['cbb5f28bedf4361156ef3c9c37e314c6479be137','e108a4952601b4664098344189c875934ea2f7ab','8ecd0d9e2580f78ff920821bd334bd8d04d165e5','ff10749b8b1aca1fba5d07ba86f49612be43caf9','323a6d9f8d2f74e7e5b88599a87dc5673fb7a0b4','bb36fb89d118b55c66f17b24ffff0ca09ccc939b','3fed75e1a7f46a6e2a74a078bfd955e7de05de4f','8cb9d8f92ba130618646d6fd1f307ca73f4e4add','2b9e6cb75876b4a33b77ae4b1bd3ef5e73c4a40e','f95c6bf3f935fad9fc354f4cf6e0161d6ebfb08a','0b07b135bf8399742cc9e6f3d14b2ea32e3354d3','076d3588e85ce9566d9575d1564e72e8480fadc8','dfad8fc515d74c19bad1ab72e7a03d59a11c7778','7ff774f225899091d6d64e5512ada13ce32dd72a','2fd8cab5e3cc4635be76e2d430ad6fe6e79b8167','c7399a2e531694b47b436bd153823f60bba9071e','bc4092e0e1aaa4b97464005963345b4b38e1f2a1','d85e49fc5be07a699f3930464996d7ddb6a8e8bd','09cf43bae3a4d875da56c67a46cf79102b20b456','aa2a707a627408758a0ee845896ef088d6136013','bb0737ce6cdbbcc055771e2400afda545d58778f','454bb6d0471536f7b91793ddbc786761b5733902','3c8ff013bf2e80392671760c8d444730b1923c0a','9a4f0cd0bdc672beb1c1c821599a11fc8a3d139d','f5ca3a789b7451da3e6030443aee6fae734fc7a1','ca8826661175c3a1ff7c6f1ebbfe646b238deb75','9e30ae7bbd1193deb0d3599c071960d395ca01f7','4417ddedee8e753fd6e911192458168d3b77d1e8','2de333e449ca13c462832e799e13795e2cf6e3e4','23d4d0aee62db4adc7381010d80776270a6db47b','5463426618ff46188d19595aa1c7fdd86c6909b3','2649b566bd2bccc59813286d647269ad251e2fdf','5df7907b99976e4051d1dd433e2bdbeb4ce200e3','a7e70930137ff8338778253ac93dc66f11eef966','b92100bddc318e13996fbe96c087c35152cbb4e3','f55b68de8cf9ec17e0512a6caae94e0fbf151260','7fb0d4342e3ed3fabee650b83ce66ffb2f66c173','72a6100cd60dd49f780168137ed09e27a8090b34',];
+ var tests = {
+ "cbb5f28bedf4361156ef3c9c37e314c6479be137":[async_test('html5lib_tests20.html cbb5f28bedf4361156ef3c9c37e314c6479be137'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Cbutton%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E"],"e108a4952601b4664098344189c875934ea2f7ab":[async_test('html5lib_tests20.html e108a4952601b4664098344189c875934ea2f7ab'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Caddress%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Caddress%3E"],"8ecd0d9e2580f78ff920821bd334bd8d04d165e5":[async_test('html5lib_tests20.html 8ecd0d9e2580f78ff920821bd334bd8d04d165e5'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Cblockquote%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cblockquote%3E"],"ff10749b8b1aca1fba5d07ba86f49612be43caf9":[async_test('html5lib_tests20.html ff10749b8b1aca1fba5d07ba86f49612be43caf9'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Cmenu%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmenu%3E"],"323a6d9f8d2f74e7e5b88599a87dc5673fb7a0b4":[async_test('html5lib_tests20.html 323a6d9f8d2f74e7e5b88599a87dc5673fb7a0b4'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Cp%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E"],"bb36fb89d118b55c66f17b24ffff0ca09ccc939b":[async_test('html5lib_tests20.html bb36fb89d118b55c66f17b24ffff0ca09ccc939b'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Cul%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cul%3E"],"3fed75e1a7f46a6e2a74a078bfd955e7de05de4f":[async_test('html5lib_tests20.html 3fed75e1a7f46a6e2a74a078bfd955e7de05de4f'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Ch1%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ch1%3E"],"8cb9d8f92ba130618646d6fd1f307ca73f4e4add":[async_test('html5lib_tests20.html 8cb9d8f92ba130618646d6fd1f307ca73f4e4add'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Ch6%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ch6%3E"],"2b9e6cb75876b4a33b77ae4b1bd3ef5e73c4a40e":[async_test('html5lib_tests20.html 2b9e6cb75876b4a33b77ae4b1bd3ef5e73c4a40e'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Clisting%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Clisting%3E"],"f95c6bf3f935fad9fc354f4cf6e0161d6ebfb08a":[async_test('html5lib_tests20.html f95c6bf3f935fad9fc354f4cf6e0161d6ebfb08a'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Cpre%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cpre%3E"],"0b07b135bf8399742cc9e6f3d14b2ea32e3354d3":[async_test('html5lib_tests20.html 0b07b135bf8399742cc9e6f3d14b2ea32e3354d3'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Cform%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cform%3E"],"076d3588e85ce9566d9575d1564e72e8480fadc8":[async_test('html5lib_tests20.html 076d3588e85ce9566d9575d1564e72e8480fadc8'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Cli%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cli%3E"],"dfad8fc515d74c19bad1ab72e7a03d59a11c7778":[async_test('html5lib_tests20.html dfad8fc515d74c19bad1ab72e7a03d59a11c7778'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Cdd%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdd%3E"],"7ff774f225899091d6d64e5512ada13ce32dd72a":[async_test('html5lib_tests20.html 7ff774f225899091d6d64e5512ada13ce32dd72a'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Cdt%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdt%3E"],"2fd8cab5e3cc4635be76e2d430ad6fe6e79b8167":[async_test('html5lib_tests20.html 2fd8cab5e3cc4635be76e2d430ad6fe6e79b8167'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Cplaintext%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cplaintext%3E"],"c7399a2e531694b47b436bd153823f60bba9071e":[async_test('html5lib_tests20.html c7399a2e531694b47b436bd153823f60bba9071e'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Ctable%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctable%3E"],"bc4092e0e1aaa4b97464005963345b4b38e1f2a1":[async_test('html5lib_tests20.html bc4092e0e1aaa4b97464005963345b4b38e1f2a1'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Chr%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Chr%3E"],"d85e49fc5be07a699f3930464996d7ddb6a8e8bd":[async_test('html5lib_tests20.html d85e49fc5be07a699f3930464996d7ddb6a8e8bd'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3Cxmp%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cxmp%3E"],"09cf43bae3a4d875da56c67a46cf79102b20b456":[async_test('html5lib_tests20.html 09cf43bae3a4d875da56c67a46cf79102b20b456'), "%3C%21doctype%20html%3E%3Cp%3E%3Cbutton%3E%3C/p%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E"],"aa2a707a627408758a0ee845896ef088d6136013":[async_test('html5lib_tests20.html aa2a707a627408758a0ee845896ef088d6136013'), "%3C%21doctype%20html%3E%3Caddress%3E%3Cbutton%3E%3C/address%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Caddress%3E%0A%7C%20%20%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%22a%22"],"bb0737ce6cdbbcc055771e2400afda545d58778f":[async_test('html5lib_tests20.html bb0737ce6cdbbcc055771e2400afda545d58778f'), "%3Cp%3E%3Ctable%3E%3C/p%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E"],"454bb6d0471536f7b91793ddbc786761b5733902":[async_test('html5lib_tests20.html 454bb6d0471536f7b91793ddbc786761b5733902'), "%3C%21doctype%20html%3E%3Csvg%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E"],"3c8ff013bf2e80392671760c8d444730b1923c0a":[async_test('html5lib_tests20.html 3c8ff013bf2e80392671760c8d444730b1923c0a'), "%3C%21doctype%20html%3E%3Cp%3E%3Cfigcaption%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Cfigcaption%3E"],"9a4f0cd0bdc672beb1c1c821599a11fc8a3d139d":[async_test('html5lib_tests20.html 9a4f0cd0bdc672beb1c1c821599a11fc8a3d139d'), "%3C%21doctype%20html%3E%3Cp%3E%3Csummary%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Csummary%3E"],"f5ca3a789b7451da3e6030443aee6fae734fc7a1":[async_test('html5lib_tests20.html f5ca3a789b7451da3e6030443aee6fae734fc7a1'), "%3C%21doctype%20html%3E%3Cform%3E%3Ctable%3E%3Cform%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E"],"ca8826661175c3a1ff7c6f1ebbfe646b238deb75":[async_test('html5lib_tests20.html ca8826661175c3a1ff7c6f1ebbfe646b238deb75'), "%3C%21doctype%20html%3E%3Ctable%3E%3Cform%3E%3Cform%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cform%3E"],"9e30ae7bbd1193deb0d3599c071960d395ca01f7":[async_test('html5lib_tests20.html 9e30ae7bbd1193deb0d3599c071960d395ca01f7'), "%3C%21doctype%20html%3E%3Ctable%3E%3Cform%3E%3C/table%3E%3Cform%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cform%3E"],"4417ddedee8e753fd6e911192458168d3b77d1e8":[async_test('html5lib_tests20.html 4417ddedee8e753fd6e911192458168d3b77d1e8'), "%3C%21doctype%20html%3E%3Csvg%3E%3CforeignObject%3E%3Cp%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E"],"2de333e449ca13c462832e799e13795e2cf6e3e4":[async_test('html5lib_tests20.html 2de333e449ca13c462832e799e13795e2cf6e3e4'), "%3C%21doctype%20html%3E%3Csvg%3E%3Ctitle%3Eabc", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20title%3E%0A%7C%20%20%20%20%20%20%20%20%20%22abc%22"],"23d4d0aee62db4adc7381010d80776270a6db47b":[async_test('html5lib_tests20.html 23d4d0aee62db4adc7381010d80776270a6db47b'), "%3Coption%3E%3Cspan%3E%3Coption%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Coption%3E"],"5463426618ff46188d19595aa1c7fdd86c6909b3":[async_test('html5lib_tests20.html 5463426618ff46188d19595aa1c7fdd86c6909b3'), "%3Coption%3E%3Coption%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%3Coption%3E"],"2649b566bd2bccc59813286d647269ad251e2fdf":[async_test('html5lib_tests20.html 2649b566bd2bccc59813286d647269ad251e2fdf'), "%3Cmath%3E%3Cannotation-xml%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%3Cdiv%3E"],"5df7907b99976e4051d1dd433e2bdbeb4ce200e3":[async_test('html5lib_tests20.html 5df7907b99976e4051d1dd433e2bdbeb4ce200e3'), "%3Cmath%3E%3Cannotation-xml%20encoding%3D%22application/svg%2Bxml%22%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20encoding%3D%22application/svg%2Bxml%22%0A%7C%20%20%20%20%20%3Cdiv%3E"],"a7e70930137ff8338778253ac93dc66f11eef966":[async_test('html5lib_tests20.html a7e70930137ff8338778253ac93dc66f11eef966'), "%3Cmath%3E%3Cannotation-xml%20encoding%3D%22application/xhtml%2Bxml%22%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20encoding%3D%22application/xhtml%2Bxml%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"b92100bddc318e13996fbe96c087c35152cbb4e3":[async_test('html5lib_tests20.html b92100bddc318e13996fbe96c087c35152cbb4e3'), "%3Cmath%3E%3Cannotation-xml%20encoding%3D%22aPPlication/xhtmL%2BxMl%22%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20encoding%3D%22aPPlication/xhtmL%2BxMl%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"f55b68de8cf9ec17e0512a6caae94e0fbf151260":[async_test('html5lib_tests20.html f55b68de8cf9ec17e0512a6caae94e0fbf151260'), "%3Cmath%3E%3Cannotation-xml%20encoding%3D%22text/html%22%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20encoding%3D%22text/html%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"7fb0d4342e3ed3fabee650b83ce66ffb2f66c173":[async_test('html5lib_tests20.html 7fb0d4342e3ed3fabee650b83ce66ffb2f66c173'), "%3Cmath%3E%3Cannotation-xml%20encoding%3D%22Text/htmL%22%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20encoding%3D%22Text/htmL%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"72a6100cd60dd49f780168137ed09e27a8090b34":[async_test('html5lib_tests20.html 72a6100cd60dd49f780168137ed09e27a8090b34'), "%3Cmath%3E%3Cannotation-xml%20encoding%3D%22%20text/html%20%22%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20encoding%3D%22%20text/html%20%22%0A%7C%20%20%20%20%20%3Cdiv%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests21.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests21.html
new file mode 100644
index 000000000..e13295a97
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests21.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests21.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['49994884ec96a706a3c1b702049a1612e43a81b5','9128ce0d001f8a331dadfd0091dc0faaadcc27a3','250daec0d65f2528955e24fbe667cf40adaee33f','7cdfc1d2d87a4f9ebd754d18dc7b55f73f5ba58b','3d12442cdaef117f92af7ca90e7e03550e07314a','afeea6e5607448d59d16db2c2dad6e0f4f571f25','30b6ff244d2cd3716c1ad482e30ff294dcfed2b7','49b8f552d24bba176c920b40208e1d9f3d866075','60293a1ec80139eb1c9f05e48ca631e812a708da','753ad0dcb4fd3b1d6da2c87dd59116287e08d412','80607dd011814b8d3ef5c9ca380fec044dd5e1aa','b313be34a12fd540ab959b6cf18610fba03cb63f','c9f579bf49de2d4c553d03e43772c0d94be474c0','e714d65a37389755cd7385275f14a757c36b9510','df235b5f7ba9e6e1032bae6c75e92e6a68f48cda','fec253c6085a518dd72fdaff371da31e0d6bdb96','64150a9d88b6214a4a83cf9335e0b0a35e3be170','8c1c2ca15e12599448980201683ece12d4923d9d','32780672eec230ac59d4b61a1adb209bd6a0ed46','be6b00c6bd7e576953b0bceefd9c38d14b452b8d','9df59cd349097dca330fefef6c1b1bbbfddadae6','671f606f5cb7033854d99b96b040994f0f451496','caa80af33c7880aaddd17824efff1774ece01325',];
+ var tests = {
+ "49994884ec96a706a3c1b702049a1612e43a81b5":[async_test('html5lib_tests21.html 49994884ec96a706a3c1b702049a1612e43a81b5'), "%3Csvg%3E%3C%21%5BCDATA%5Bfoo%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22foo%22"],"9128ce0d001f8a331dadfd0091dc0faaadcc27a3":[async_test('html5lib_tests21.html 9128ce0d001f8a331dadfd0091dc0faaadcc27a3'), "%3Cmath%3E%3C%21%5BCDATA%5Bfoo%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%22foo%22"],"250daec0d65f2528955e24fbe667cf40adaee33f":[async_test('html5lib_tests21.html 250daec0d65f2528955e24fbe667cf40adaee33f'), "%3Cdiv%3E%3C%21%5BCDATA%5Bfoo%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3C%21--%20%5BCDATA%5Bfoo%5D%5D%20--%3E"],"7cdfc1d2d87a4f9ebd754d18dc7b55f73f5ba58b":[async_test('html5lib_tests21.html 7cdfc1d2d87a4f9ebd754d18dc7b55f73f5ba58b'), "%3Csvg%3E%3C%21%5BCDATA%5Bfoo", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22foo%22"],"3d12442cdaef117f92af7ca90e7e03550e07314a":[async_test('html5lib_tests21.html 3d12442cdaef117f92af7ca90e7e03550e07314a'), "%3Csvg%3E%3C%21%5BCDATA%5B", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E"],"afeea6e5607448d59d16db2c2dad6e0f4f571f25":[async_test('html5lib_tests21.html afeea6e5607448d59d16db2c2dad6e0f4f571f25'), "%3Csvg%3E%3C%21%5BCDATA%5B%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E"],"30b6ff244d2cd3716c1ad482e30ff294dcfed2b7":[async_test('html5lib_tests21.html 30b6ff244d2cd3716c1ad482e30ff294dcfed2b7'), "%3Csvg%3E%3C%21%5BCDATA%5B%5D%5D%20%3E%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%5D%5D%20%3E%22"],"49b8f552d24bba176c920b40208e1d9f3d866075":[async_test('html5lib_tests21.html 49b8f552d24bba176c920b40208e1d9f3d866075'), "%3Csvg%3E%3C%21%5BCDATA%5B%5D%5D", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%5D%5D%22"],"60293a1ec80139eb1c9f05e48ca631e812a708da":[async_test('html5lib_tests21.html 60293a1ec80139eb1c9f05e48ca631e812a708da'), "%3Csvg%3E%3C%21%5BCDATA%5B%5D", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%5D%22"],"753ad0dcb4fd3b1d6da2c87dd59116287e08d412":[async_test('html5lib_tests21.html 753ad0dcb4fd3b1d6da2c87dd59116287e08d412'), "%3Csvg%3E%3C%21%5BCDATA%5B%5D%3Ea", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%5D%3Ea%22"],"80607dd011814b8d3ef5c9ca380fec044dd5e1aa":[async_test('html5lib_tests21.html 80607dd011814b8d3ef5c9ca380fec044dd5e1aa'), "%3C%21DOCTYPE%20html%3E%3Csvg%3E%3C%21%5BCDATA%5Bfoo%5D%5D%5D%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22foo%5D%22"],"b313be34a12fd540ab959b6cf18610fba03cb63f":[async_test('html5lib_tests21.html b313be34a12fd540ab959b6cf18610fba03cb63f'), "%3C%21DOCTYPE%20html%3E%3Csvg%3E%3C%21%5BCDATA%5Bfoo%5D%5D%5D%5D%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22foo%5D%5D%22"],"c9f579bf49de2d4c553d03e43772c0d94be474c0":[async_test('html5lib_tests21.html c9f579bf49de2d4c553d03e43772c0d94be474c0'), "%3C%21DOCTYPE%20html%3E%3Csvg%3E%3C%21%5BCDATA%5Bfoo%5D%5D%5D%5D%5D%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22foo%5D%5D%5D%22"],"e714d65a37389755cd7385275f14a757c36b9510":[async_test('html5lib_tests21.html e714d65a37389755cd7385275f14a757c36b9510'), "%3Csvg%3E%3CforeignObject%3E%3Cdiv%3E%3C%21%5BCDATA%5Bfoo%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3C%21--%20%5BCDATA%5Bfoo%5D%5D%20--%3E"],"df235b5f7ba9e6e1032bae6c75e92e6a68f48cda":[async_test('html5lib_tests21.html df235b5f7ba9e6e1032bae6c75e92e6a68f48cda'), "%3Csvg%3E%3C%21%5BCDATA%5B%3Csvg%3E%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%3Csvg%3E%22"],"fec253c6085a518dd72fdaff371da31e0d6bdb96":[async_test('html5lib_tests21.html fec253c6085a518dd72fdaff371da31e0d6bdb96'), "%3Csvg%3E%3C%21%5BCDATA%5B%3C/svg%3Ea%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%3C/svg%3Ea%22"],"64150a9d88b6214a4a83cf9335e0b0a35e3be170":[async_test('html5lib_tests21.html 64150a9d88b6214a4a83cf9335e0b0a35e3be170'), "%3Csvg%3E%3C%21%5BCDATA%5B%3Csvg%3Ea", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%3Csvg%3Ea%22"],"8c1c2ca15e12599448980201683ece12d4923d9d":[async_test('html5lib_tests21.html 8c1c2ca15e12599448980201683ece12d4923d9d'), "%3Csvg%3E%3C%21%5BCDATA%5B%3C/svg%3Ea", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%3C/svg%3Ea%22"],"32780672eec230ac59d4b61a1adb209bd6a0ed46":[async_test('html5lib_tests21.html 32780672eec230ac59d4b61a1adb209bd6a0ed46'), "%3Csvg%3E%3C%21%5BCDATA%5B%3Csvg%3E%5D%5D%3E%3Cpath%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%3Csvg%3E%22%0A%7C%20%20%20%20%20%20%20%3Csvg%20path%3E"],"be6b00c6bd7e576953b0bceefd9c38d14b452b8d":[async_test('html5lib_tests21.html be6b00c6bd7e576953b0bceefd9c38d14b452b8d'), "%3Csvg%3E%3C%21%5BCDATA%5B%3Csvg%3E%5D%5D%3E%3C/path%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%3Csvg%3E%22"],"9df59cd349097dca330fefef6c1b1bbbfddadae6":[async_test('html5lib_tests21.html 9df59cd349097dca330fefef6c1b1bbbfddadae6'), "%3Csvg%3E%3C%21%5BCDATA%5B%3Csvg%3E%5D%5D%3E%3C%21--path--%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%3Csvg%3E%22%0A%7C%20%20%20%20%20%20%20%3C%21--%20path%20--%3E"],"671f606f5cb7033854d99b96b040994f0f451496":[async_test('html5lib_tests21.html 671f606f5cb7033854d99b96b040994f0f451496'), "%3Csvg%3E%3C%21%5BCDATA%5B%3Csvg%3E%5D%5D%3Epath", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%3Csvg%3Epath%22"],"caa80af33c7880aaddd17824efff1774ece01325":[async_test('html5lib_tests21.html caa80af33c7880aaddd17824efff1774ece01325'), "%3Csvg%3E%3C%21%5BCDATA%5B%3C%21--svg--%3E%5D%5D%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--svg--%3E%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests22.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests22.html
new file mode 100644
index 000000000..74886e166
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests22.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests22.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['0aae674c4a721f0a6f6205bca13056f08a516b00','9ee2a7fffc0ac4b0a2d59ac154d9d79b3b62499f','eba4be47ca51e9c659aaa2de43e17aded0d13e50','d69b2cbec658966233616e553d8b0b1dd544310d','4685334adccb0ef98b769fb8546b5696e28af968',];
+ var tests = {
+ "0aae674c4a721f0a6f6205bca13056f08a516b00":[async_test('html5lib_tests22.html 0aae674c4a721f0a6f6205bca13056f08a516b00'), "%3Ca%3E%3Cb%3E%3Cbig%3E%3Cem%3E%3Cstrong%3E%3Cdiv%3EX%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cbig%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cem%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cstrong%3E%0A%7C%20%20%20%20%20%3Cbig%3E%0A%7C%20%20%20%20%20%20%20%3Cem%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cstrong%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22X%22"],"9ee2a7fffc0ac4b0a2d59ac154d9d79b3b62499f":[async_test('html5lib_tests22.html 9ee2a7fffc0ac4b0a2d59ac154d9d79b3b62499f'), "%3Ca%3E%3Cb%3E%3Cdiv%20id%3D1%3E%3Cdiv%20id%3D2%3E%3Cdiv%20id%3D3%3E%3Cdiv%20id%3D4%3E%3Cdiv%20id%3D5%3E%3Cdiv%20id%3D6%3E%3Cdiv%20id%3D7%3E%3Cdiv%20id%3D8%3EA%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20id%3D%221%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20id%3D%222%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%223%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%225%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%226%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%227%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%228%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22A%22"],"eba4be47ca51e9c659aaa2de43e17aded0d13e50":[async_test('html5lib_tests22.html eba4be47ca51e9c659aaa2de43e17aded0d13e50'), "%3Ca%3E%3Cb%3E%3Cdiv%20id%3D1%3E%3Cdiv%20id%3D2%3E%3Cdiv%20id%3D3%3E%3Cdiv%20id%3D4%3E%3Cdiv%20id%3D5%3E%3Cdiv%20id%3D6%3E%3Cdiv%20id%3D7%3E%3Cdiv%20id%3D8%3E%3Cdiv%20id%3D9%3EA%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20id%3D%221%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20id%3D%222%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%223%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%225%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%226%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%227%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%228%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%229%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22A%22"],"d69b2cbec658966233616e553d8b0b1dd544310d":[async_test('html5lib_tests22.html d69b2cbec658966233616e553d8b0b1dd544310d'), "%3Ca%3E%3Cb%3E%3Cdiv%20id%3D1%3E%3Cdiv%20id%3D2%3E%3Cdiv%20id%3D3%3E%3Cdiv%20id%3D4%3E%3Cdiv%20id%3D5%3E%3Cdiv%20id%3D6%3E%3Cdiv%20id%3D7%3E%3Cdiv%20id%3D8%3E%3Cdiv%20id%3D9%3E%3Cdiv%20id%3D10%3EA%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20id%3D%221%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20id%3D%222%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%223%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%225%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%226%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%227%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%228%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%229%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%2210%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22A%22"],"4685334adccb0ef98b769fb8546b5696e28af968":[async_test('html5lib_tests22.html 4685334adccb0ef98b769fb8546b5696e28af968'), "%3Ccite%3E%3Cb%3E%3Ccite%3E%3Ci%3E%3Ccite%3E%3Ci%3E%3Ccite%3E%3Ci%3E%3Cdiv%3EX%3C/b%3ETEST", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ccite%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccite%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ccite%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ccite%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22TEST%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests23.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests23.html
new file mode 100644
index 000000000..b471f34dd
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests23.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests23.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['79c0dc8da653d983d07795852b5f38d1533ff404','403404388390abddf3fb44db8dd7d643652f5df9','b9a81ae44ab81719fc6a4e3b6460fc6efc684e65','d271d3662baafff4893d32b250cadcf4c2ff3352','f8e296b2f362a64c1c464bedd6248e314f41c701',];
+ var tests = {
+ "79c0dc8da653d983d07795852b5f38d1533ff404":[async_test('html5lib_tests23.html 79c0dc8da653d983d07795852b5f38d1533ff404'), "%3Cp%3E%3Cfont%20size%3D4%3E%3Cfont%20color%3Dred%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cfont%20color%3Dred%3E%3Cp%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20color%3D%22red%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20color%3D%22red%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20color%3D%22red%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20color%3D%22red%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22X%22"],"403404388390abddf3fb44db8dd7d643652f5df9":[async_test('html5lib_tests23.html 403404388390abddf3fb44db8dd7d643652f5df9'), "%3Cp%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cp%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22X%22"],"b9a81ae44ab81719fc6a4e3b6460fc6efc684e65":[async_test('html5lib_tests23.html b9a81ae44ab81719fc6a4e3b6460fc6efc684e65'), "%3Cp%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D%225%22%3E%3Cfont%20size%3D4%3E%3Cp%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%225%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%225%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22X%22"],"d271d3662baafff4893d32b250cadcf4c2ff3352":[async_test('html5lib_tests23.html d271d3662baafff4893d32b250cadcf4c2ff3352'), "%3Cp%3E%3Cfont%20size%3D4%20id%3Da%3E%3Cfont%20size%3D4%20id%3Db%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cp%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20id%3D%22a%22%0A%7C%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20id%3D%22b%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20id%3D%22a%22%0A%7C%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20id%3D%22b%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22X%22"],"f8e296b2f362a64c1c464bedd6248e314f41c701":[async_test('html5lib_tests23.html f8e296b2f362a64c1c464bedd6248e314f41c701'), "%3Cp%3E%3Cb%20id%3Da%3E%3Cb%20id%3Da%3E%3Cb%20id%3Da%3E%3Cb%3E%3Cobject%3E%3Cb%20id%3Da%3E%3Cb%20id%3Da%3EX%3C/object%3E%3Cp%3EY", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20id%3D%22a%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20id%3D%22a%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%22a%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cobject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%22a%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%22a%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20id%3D%22a%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20id%3D%22a%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20id%3D%22a%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Y%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests24.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests24.html
new file mode 100644
index 000000000..ecfd895e8
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests24.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests24.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['692c2dbacf18cb758f26a3d9e7d9add4356f9067','614cc9827d3a0c5f91863dde5281dd0d97f64e6d','c517924583ee71b8e684c9ca1f2eed5e88139a39','140a82fab878c139b388d159c511eb999fe2d8c7','a2ddddcccb652a6529daafd4153a0e12b6d5ca8c','da2e30a0b6577b608bf48bbd11a16ff832bc7e46','66a5777f5453bd4b5161f00df02883b6d71f7cea','c8d97f31b70f67005eeacc3c86ac29e577c3d0ed',];
+ var tests = {
+ "692c2dbacf18cb758f26a3d9e7d9add4356f9067":[async_test('html5lib_tests24.html 692c2dbacf18cb758f26a3d9e7d9add4356f9067'), "%3C%21DOCTYPE%20html%3E%26NotEqualTilde%3B", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%89%82%CC%B8%22"],"614cc9827d3a0c5f91863dde5281dd0d97f64e6d":[async_test('html5lib_tests24.html 614cc9827d3a0c5f91863dde5281dd0d97f64e6d'), "%3C%21DOCTYPE%20html%3E%26NotEqualTilde%3BA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%89%82%CC%B8A%22"],"c517924583ee71b8e684c9ca1f2eed5e88139a39":[async_test('html5lib_tests24.html c517924583ee71b8e684c9ca1f2eed5e88139a39'), "%3C%21DOCTYPE%20html%3E%26ThickSpace%3B", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%81%9F%E2%80%8A%22"],"140a82fab878c139b388d159c511eb999fe2d8c7":[async_test('html5lib_tests24.html 140a82fab878c139b388d159c511eb999fe2d8c7'), "%3C%21DOCTYPE%20html%3E%26ThickSpace%3BA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%81%9F%E2%80%8AA%22"],"a2ddddcccb652a6529daafd4153a0e12b6d5ca8c":[async_test('html5lib_tests24.html a2ddddcccb652a6529daafd4153a0e12b6d5ca8c'), "%3C%21DOCTYPE%20html%3E%26NotSubset%3B", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%8A%82%E2%83%92%22"],"da2e30a0b6577b608bf48bbd11a16ff832bc7e46":[async_test('html5lib_tests24.html da2e30a0b6577b608bf48bbd11a16ff832bc7e46'), "%3C%21DOCTYPE%20html%3E%26NotSubset%3BA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%8A%82%E2%83%92A%22"],"66a5777f5453bd4b5161f00df02883b6d71f7cea":[async_test('html5lib_tests24.html 66a5777f5453bd4b5161f00df02883b6d71f7cea'), "%3C%21DOCTYPE%20html%3E%26Gopf%3B", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%F0%9D%94%BE%22"],"c8d97f31b70f67005eeacc3c86ac29e577c3d0ed":[async_test('html5lib_tests24.html c8d97f31b70f67005eeacc3c86ac29e577c3d0ed'), "%3C%21DOCTYPE%20html%3E%26Gopf%3BA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%F0%9D%94%BEA%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests25.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests25.html
new file mode 100644
index 000000000..2ae12eb1c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests25.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests25.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['025adbb619bdef9ad228a6b378b9dd6bef9f93dc','7e561454888535bc5c68e7396de2f4206c81e97d','a14bdd90f5a745296e74c23951245cb7c5046ed1','421ad19f7854b9c8e28a0595a8dd20d6bfcd5376','7e8234523fbf67d37ab60f593e1fc3ac67706651','c705ceb6fb37865e6965641ea80137baf44176b6','277da0c4c937f3852d8a7cacf4e4b426a30b3dda','de4aa726e09215ba9c50b97d257e6c6b880107f1','d46fa11c0107d59c84778beae84f388f55bffc31','578e08f11628dc9841f3eb21c016e1e28cec0304','a6e5387b48c4d0399a802215f7fa206bd0d3b492','d56d47bc9d9c7472fb1706bdecda1bbd165dcf91','2779456edd8407b403561e0cf339c8c2308c88b8','17d197ab2416adec6eb92e398c2db6f7efc98b58','1ccc6e280f6dc773e2e00f2cb70cd96e97078296','48ddaacf5355643f27ef704ece88b227f51fc7cb','bf29bfbd56c9863d19e4d66cd67a0dc1813b2e86','73fc7c062b68d4f89579683dbb7f1eaef4ec27f1','057bc2d868d2f365cb2c0b4d07c231d2fa2b23b7','7f684d19be362ec9aa4fe7ecbba4ff3fc9730a43','d79f9119d02447226cc2d151044e6cffc5409e81',];
+ var tests = {
+ "025adbb619bdef9ad228a6b378b9dd6bef9f93dc":[async_test('html5lib_tests25.html 025adbb619bdef9ad228a6b378b9dd6bef9f93dc'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cfoo%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfoo%3E%0A%7C%20%20%20%20%20%20%20%22A%22"],"7e561454888535bc5c68e7396de2f4206c81e97d":[async_test('html5lib_tests25.html 7e561454888535bc5c68e7396de2f4206c81e97d'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Carea%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Carea%3E%0A%7C%20%20%20%20%20%22A%22"],"a14bdd90f5a745296e74c23951245cb7c5046ed1":[async_test('html5lib_tests25.html a14bdd90f5a745296e74c23951245cb7c5046ed1'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cbase%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbase%3E%0A%7C%20%20%20%20%20%22A%22"],"421ad19f7854b9c8e28a0595a8dd20d6bfcd5376":[async_test('html5lib_tests25.html 421ad19f7854b9c8e28a0595a8dd20d6bfcd5376'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cbasefont%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbasefont%3E%0A%7C%20%20%20%20%20%22A%22"],"7e8234523fbf67d37ab60f593e1fc3ac67706651":[async_test('html5lib_tests25.html 7e8234523fbf67d37ab60f593e1fc3ac67706651'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cbgsound%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbgsound%3E%0A%7C%20%20%20%20%20%22A%22"],"c705ceb6fb37865e6965641ea80137baf44176b6":[async_test('html5lib_tests25.html c705ceb6fb37865e6965641ea80137baf44176b6'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cbr%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbr%3E%0A%7C%20%20%20%20%20%22A%22"],"277da0c4c937f3852d8a7cacf4e4b426a30b3dda":[async_test('html5lib_tests25.html 277da0c4c937f3852d8a7cacf4e4b426a30b3dda'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ccol%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22A%22"],"de4aa726e09215ba9c50b97d257e6c6b880107f1":[async_test('html5lib_tests25.html de4aa726e09215ba9c50b97d257e6c6b880107f1'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ccommand%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ccommand%3E%0A%7C%20%20%20%20%20%20%20%22A%22"],"d46fa11c0107d59c84778beae84f388f55bffc31":[async_test('html5lib_tests25.html d46fa11c0107d59c84778beae84f388f55bffc31'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cmenuitem%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmenuitem%3E%0A%7C%20%20%20%20%20%22A%22"],"578e08f11628dc9841f3eb21c016e1e28cec0304":[async_test('html5lib_tests25.html 578e08f11628dc9841f3eb21c016e1e28cec0304'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cembed%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cembed%3E%0A%7C%20%20%20%20%20%22A%22"],"a6e5387b48c4d0399a802215f7fa206bd0d3b492":[async_test('html5lib_tests25.html a6e5387b48c4d0399a802215f7fa206bd0d3b492'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cframe%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22A%22"],"d56d47bc9d9c7472fb1706bdecda1bbd165dcf91":[async_test('html5lib_tests25.html d56d47bc9d9c7472fb1706bdecda1bbd165dcf91'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Chr%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Chr%3E%0A%7C%20%20%20%20%20%22A%22"],"2779456edd8407b403561e0cf339c8c2308c88b8":[async_test('html5lib_tests25.html 2779456edd8407b403561e0cf339c8c2308c88b8'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cimg%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cimg%3E%0A%7C%20%20%20%20%20%22A%22"],"17d197ab2416adec6eb92e398c2db6f7efc98b58":[async_test('html5lib_tests25.html 17d197ab2416adec6eb92e398c2db6f7efc98b58'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cinput%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%22A%22"],"1ccc6e280f6dc773e2e00f2cb70cd96e97078296":[async_test('html5lib_tests25.html 1ccc6e280f6dc773e2e00f2cb70cd96e97078296'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ckeygen%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ckeygen%3E%0A%7C%20%20%20%20%20%22A%22"],"48ddaacf5355643f27ef704ece88b227f51fc7cb":[async_test('html5lib_tests25.html 48ddaacf5355643f27ef704ece88b227f51fc7cb'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Clink%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Clink%3E%0A%7C%20%20%20%20%20%22A%22"],"bf29bfbd56c9863d19e4d66cd67a0dc1813b2e86":[async_test('html5lib_tests25.html bf29bfbd56c9863d19e4d66cd67a0dc1813b2e86'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cmeta%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%22A%22"],"73fc7c062b68d4f89579683dbb7f1eaef4ec27f1":[async_test('html5lib_tests25.html 73fc7c062b68d4f89579683dbb7f1eaef4ec27f1'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cparam%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cparam%3E%0A%7C%20%20%20%20%20%22A%22"],"057bc2d868d2f365cb2c0b4d07c231d2fa2b23b7":[async_test('html5lib_tests25.html 057bc2d868d2f365cb2c0b4d07c231d2fa2b23b7'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Csource%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csource%3E%0A%7C%20%20%20%20%20%22A%22"],"7f684d19be362ec9aa4fe7ecbba4ff3fc9730a43":[async_test('html5lib_tests25.html 7f684d19be362ec9aa4fe7ecbba4ff3fc9730a43'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctrack%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctrack%3E%0A%7C%20%20%20%20%20%22A%22"],"d79f9119d02447226cc2d151044e6cffc5409e81":[async_test('html5lib_tests25.html d79f9119d02447226cc2d151044e6cffc5409e81'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cwbr%3EA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cwbr%3E%0A%7C%20%20%20%20%20%22A%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests26.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests26.html
new file mode 100644
index 000000000..49566d2fe
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests26.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests26.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['6232bd8c710002d3b3c375903a712d05163a821d','5e4fff339b6d191d80311bfa258a9b62e063c6aa','8695403efa4e413a1ad1f99984a8c0ecba379698','c3aa0a4f4e81fa4a2fd398c7a7a090d2c3f955f4','167bc3c289b234ab99fe96eaa0845682345de48c','3dacba9a76b8c454b42b9868252bbb6b68327184','8f1c4c0f0eee7b8136934ee18bd3beffbc7f2fe0','7369c472433b6dd76585b797fd3708e474601ecc','c085683feffd9da64f8782545042884173a1d1e3','be84971ac4a451e91099d225d0315dd17a88b830','9d63346ca23dc3ee41e29fe7d8403934bce8c610','8434eb9c0c3daf656b3158f5955d07e39ddc6444','6c95a99290e309b638b958272686a21486fa561e','37d360649a2b092ad05e1be1c9ea65bfec83ca6d','8919621ebbd1f4df0fdaacee3e53dc959a2d9235','3723d028349cbbc1a5c3f014987bb11c8ba804d0',];
+ var tests = {
+ "6232bd8c710002d3b3c375903a712d05163a821d":[async_test('html5lib_tests26.html 6232bd8c710002d3b3c375903a712d05163a821d'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ca%20href%3D%27%231%27%3E%3Cnobr%3E1%3Cnobr%3E%3C/a%3E%3Cbr%3E%3Ca%20href%3D%27%232%27%3E%3Cnobr%3E2%3Cnobr%3E%3C/a%3E%3Cbr%3E%3Ca%20href%3D%27%233%27%3E%3Cnobr%3E3%3Cnobr%3E%3C/a%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20href%3D%22%231%22%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%3Cbr%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20href%3D%22%232%22%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20href%3D%22%232%22%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%3Cbr%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20href%3D%22%233%22%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20href%3D%22%233%22%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%223%22%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E"],"5e4fff339b6d191d80311bfa258a9b62e063c6aa":[async_test('html5lib_tests26.html 5e4fff339b6d191d80311bfa258a9b62e063c6aa'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cb%3E%3Cnobr%3E1%3Cnobr%3E%3C/b%3E%3Ci%3E%3Cnobr%3E2%3Cnobr%3E%3C/i%3E3", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%223%22"],"8695403efa4e413a1ad1f99984a8c0ecba379698":[async_test('html5lib_tests26.html 8695403efa4e413a1ad1f99984a8c0ecba379698'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cb%3E%3Cnobr%3E1%3Ctable%3E%3Cnobr%3E%3C/b%3E%3Ci%3E%3Cnobr%3E2%3Cnobr%3E%3C/i%3E3", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%223%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ctable%3E"],"c3aa0a4f4e81fa4a2fd398c7a7a090d2c3f955f4":[async_test('html5lib_tests26.html c3aa0a4f4e81fa4a2fd398c7a7a090d2c3f955f4'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cb%3E%3Cnobr%3E1%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Cnobr%3E%3C/b%3E%3Ci%3E%3Cnobr%3E2%3Cnobr%3E%3C/i%3E3", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%223%22"],"167bc3c289b234ab99fe96eaa0845682345de48c":[async_test('html5lib_tests26.html 167bc3c289b234ab99fe96eaa0845682345de48c'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cb%3E%3Cnobr%3E1%3Cdiv%3E%3Cnobr%3E%3C/b%3E%3Ci%3E%3Cnobr%3E2%3Cnobr%3E%3C/i%3E3", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%223%22"],"3dacba9a76b8c454b42b9868252bbb6b68327184":[async_test('html5lib_tests26.html 3dacba9a76b8c454b42b9868252bbb6b68327184'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cb%3E%3Cnobr%3E1%3Cnobr%3E%3C/b%3E%3Cdiv%3E%3Ci%3E%3Cnobr%3E2%3Cnobr%3E%3C/i%3E3", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%223%22"],"8f1c4c0f0eee7b8136934ee18bd3beffbc7f2fe0":[async_test('html5lib_tests26.html 8f1c4c0f0eee7b8136934ee18bd3beffbc7f2fe0'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cb%3E%3Cnobr%3E1%3Cnobr%3E%3Cins%3E%3C/b%3E%3Ci%3E%3Cnobr%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cins%3E%0A%7C%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E"],"7369c472433b6dd76585b797fd3708e474601ecc":[async_test('html5lib_tests26.html 7369c472433b6dd76585b797fd3708e474601ecc'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cb%3E%3Cnobr%3E1%3Cins%3E%3Cnobr%3E%3C/b%3E%3Ci%3E2", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cins%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22"],"c085683feffd9da64f8782545042884173a1d1e3":[async_test('html5lib_tests26.html c085683feffd9da64f8782545042884173a1d1e3'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cb%3E1%3Cnobr%3E%3C/b%3E%3Ci%3E%3Cnobr%3E2%3C/i%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22"],"be84971ac4a451e91099d225d0315dd17a88b830":[async_test('html5lib_tests26.html be84971ac4a451e91099d225d0315dd17a88b830'), "%3Cp%3E%3Ccode%20x%3C/code%3E%3C/p%3E%0A", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Ccode%3E%0A%7C%20%20%20%20%20%20%20%20%20code%3D%22%22%0A%7C%20%20%20%20%20%20%20%20%20x%3C%3D%22%22%0A%7C%20%20%20%20%20%3Ccode%3E%0A%7C%20%20%20%20%20%20%20code%3D%22%22%0A%7C%20%20%20%20%20%20%20x%3C%3D%22%22%0A%7C%20%20%20%20%20%20%20%22%0A%22"],"9d63346ca23dc3ee41e29fe7d8403934bce8c610":[async_test('html5lib_tests26.html 9d63346ca23dc3ee41e29fe7d8403934bce8c610'), "%3C%21DOCTYPE%20html%3E%3Csvg%3E%3CforeignObject%3E%3Cp%3E%3Ci%3E%3C/p%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"8434eb9c0c3daf656b3158f5955d07e39ddc6444":[async_test('html5lib_tests26.html 8434eb9c0c3daf656b3158f5955d07e39ddc6444'), "%3C%21DOCTYPE%20html%3E%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Csvg%3E%3CforeignObject%3E%3Cp%3E%3Ci%3E%3C/p%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"6c95a99290e309b638b958272686a21486fa561e":[async_test('html5lib_tests26.html 6c95a99290e309b638b958272686a21486fa561e'), "%3C%21DOCTYPE%20html%3E%3Cmath%3E%3Cmtext%3E%3Cp%3E%3Ci%3E%3C/p%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mtext%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"37d360649a2b092ad05e1be1c9ea65bfec83ca6d":[async_test('html5lib_tests26.html 37d360649a2b092ad05e1be1c9ea65bfec83ca6d'), "%3C%21DOCTYPE%20html%3E%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Cmath%3E%3Cmtext%3E%3Cp%3E%3Ci%3E%3C/p%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mtext%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"8919621ebbd1f4df0fdaacee3e53dc959a2d9235":[async_test('html5lib_tests26.html 8919621ebbd1f4df0fdaacee3e53dc959a2d9235'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cdiv%3E%3C%21/div%3Ea", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3C%21--%20/div%20--%3E%0A%7C%20%20%20%20%20%20%20%22a%22"],"3723d028349cbbc1a5c3f014987bb11c8ba804d0":[async_test('html5lib_tests26.html 3723d028349cbbc1a5c3f014987bb11c8ba804d0'), "%3Cbutton%3E%3Cp%3E%3Cbutton%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Cbutton%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests3.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests3.html
new file mode 100644
index 000000000..f6f9d6291
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests3.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests3.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['9af28bba864ad2e398d95249fdcd40491e91b23f','be8bf339f25c34d94456b39ceeed74a25167df40','b77d2b4c52c8d57dae80409a39f5e21cb8e5b3bc','7902929c3aa85bf8ffc8d7fa228921acec21808e','16dda22403dee14d6d8627d9139b8c5296f24b61','7022e121d090113a9b6a1f29e8c620b5b6c9b67c','8b5088252a41409e5f5989408f09af986573b007','692cef68475bc2c58dc3a1d6fc804ab69df37117','88bbb8a76e9880c09e8ffcd626660106cf27abce','b43510ea21c96a96255b45aef578af5cbc78475e','5227d81a48fc519767baaca384b9687dad7ba1bf','5bb12f29d0f7c9c30bc8ceb14578c60df73dca2c','9ba44cced626432a79929642154346ab9d01403a','f9031fcb39c793e24b116a1e041dd93ed638a0f4','45ec5c450b3039007112fcb053c2a82ce2e93f17','6a66abfc230b8cfc93c57210ae370b1d5e744b5a','ed9cc49cd8a577e1e6343808c328e242b53ee42d','32c5a1be682ae34b4195cd0481ee6c53c806abeb','daf731117bb7cf43f750f187cbb3528f07c9a012','948e2378d0e6bd68dbc278a993c2774c22b30370','f7fd80272bb4ab6e3bb871de5f7688912740c39f','9eddcf7971dc65d05f25aa4c412acf09a789e5b3','e91b512a3b3307481c8039279d5cf487aa258a9d','6d570cad6386f2e21419f5eb63e7dfa290abe40f',];
+ var tests = {
+ "9af28bba864ad2e398d95249fdcd40491e91b23f":[async_test('html5lib_tests3.html 9af28bba864ad2e398d95249fdcd40491e91b23f'), "%3Chead%3E%3C/head%3E%3Cstyle%3E%3C/style%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%3Cbody%3E"],"be8bf339f25c34d94456b39ceeed74a25167df40":[async_test('html5lib_tests3.html be8bf339f25c34d94456b39ceeed74a25167df40'), "%3Chead%3E%3C/head%3E%3Cscript%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%3Cbody%3E"],"b77d2b4c52c8d57dae80409a39f5e21cb8e5b3bc":[async_test('html5lib_tests3.html b77d2b4c52c8d57dae80409a39f5e21cb8e5b3bc'), "%3Chead%3E%3C/head%3E%3C%21--%20--%3E%3Cstyle%3E%3C/style%3E%3C%21--%20--%3E%3Cscript%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%3C%21--%20%20%20--%3E%0A%7C%20%20%20%3C%21--%20%20%20--%3E%0A%7C%20%20%20%3Cbody%3E"],"7902929c3aa85bf8ffc8d7fa228921acec21808e":[async_test('html5lib_tests3.html 7902929c3aa85bf8ffc8d7fa228921acec21808e'), "%3Chead%3E%3C/head%3E%3C%21--%20--%3Ex%3Cstyle%3E%3C/style%3E%3C%21--%20--%3E%3Cscript%3E%3C/script%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3C%21--%20%20%20--%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%3C%21--%20%20%20--%3E%0A%7C%20%20%20%20%20%3Cscript%3E"],"16dda22403dee14d6d8627d9139b8c5296f24b61":[async_test('html5lib_tests3.html 16dda22403dee14d6d8627d9139b8c5296f24b61'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E%3Cpre%3E%0A%3C/pre%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cpre%3E"],"7022e121d090113a9b6a1f29e8c620b5b6c9b67c":[async_test('html5lib_tests3.html 7022e121d090113a9b6a1f29e8c620b5b6c9b67c'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E%3Cpre%3E%0Afoo%3C/pre%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cpre%3E%0A%7C%20%20%20%20%20%20%20%22foo%22"],"8b5088252a41409e5f5989408f09af986573b007":[async_test('html5lib_tests3.html 8b5088252a41409e5f5989408f09af986573b007'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E%3Cpre%3E%0A%0Afoo%3C/pre%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cpre%3E%0A%7C%20%20%20%20%20%20%20%22%0Afoo%22"],"692cef68475bc2c58dc3a1d6fc804ab69df37117":[async_test('html5lib_tests3.html 692cef68475bc2c58dc3a1d6fc804ab69df37117'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E%3Cpre%3E%0Afoo%0A%3C/pre%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cpre%3E%0A%7C%20%20%20%20%20%20%20%22foo%0A%22"],"88bbb8a76e9880c09e8ffcd626660106cf27abce":[async_test('html5lib_tests3.html 88bbb8a76e9880c09e8ffcd626660106cf27abce'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E%3Cpre%3Ex%3C/pre%3E%3Cspan%3E%0A%3C/span%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cpre%3E%0A%7C%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%22%0A%22"],"b43510ea21c96a96255b45aef578af5cbc78475e":[async_test('html5lib_tests3.html b43510ea21c96a96255b45aef578af5cbc78475e'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E%3Cpre%3Ex%0Ay%3C/pre%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cpre%3E%0A%7C%20%20%20%20%20%20%20%22x%0Ay%22"],"5227d81a48fc519767baaca384b9687dad7ba1bf":[async_test('html5lib_tests3.html 5227d81a48fc519767baaca384b9687dad7ba1bf'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E%3Cpre%3Ex%3Cdiv%3E%0Ay%3C/pre%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cpre%3E%0A%7C%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%0Ay%22"],"5bb12f29d0f7c9c30bc8ceb14578c60df73dca2c":[async_test('html5lib_tests3.html 5bb12f29d0f7c9c30bc8ceb14578c60df73dca2c'), "%3C%21DOCTYPE%20html%3E%3Cpre%3E%26%23x0a%3B%26%23x0a%3BA%3C/pre%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cpre%3E%0A%7C%20%20%20%20%20%20%20%22%0AA%22"],"9ba44cced626432a79929642154346ab9d01403a":[async_test('html5lib_tests3.html 9ba44cced626432a79929642154346ab9d01403a'), "%3C%21DOCTYPE%20html%3E%3CHTML%3E%3CMETA%3E%3CHEAD%3E%3C/HEAD%3E%3C/HTML%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%3Cbody%3E"],"f9031fcb39c793e24b116a1e041dd93ed638a0f4":[async_test('html5lib_tests3.html f9031fcb39c793e24b116a1e041dd93ed638a0f4'), "%3C%21DOCTYPE%20html%3E%3CHTML%3E%3CHEAD%3E%3Chead%3E%3C/HEAD%3E%3C/HTML%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"45ec5c450b3039007112fcb053c2a82ce2e93f17":[async_test('html5lib_tests3.html 45ec5c450b3039007112fcb053c2a82ce2e93f17'), "%3Ctextarea%3Efoo%3Cspan%3Ebar%3C/span%3E%3Ci%3Ebaz", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22foo%3Cspan%3Ebar%3C/span%3E%3Ci%3Ebaz%22"],"6a66abfc230b8cfc93c57210ae370b1d5e744b5a":[async_test('html5lib_tests3.html 6a66abfc230b8cfc93c57210ae370b1d5e744b5a'), "%3Ctitle%3Efoo%3Cspan%3Ebar%3C/em%3E%3Ci%3Ebaz", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22foo%3Cspan%3Ebar%3C/em%3E%3Ci%3Ebaz%22%0A%7C%20%20%20%3Cbody%3E"],"ed9cc49cd8a577e1e6343808c328e242b53ee42d":[async_test('html5lib_tests3.html ed9cc49cd8a577e1e6343808c328e242b53ee42d'), "%3C%21DOCTYPE%20html%3E%3Ctextarea%3E%0A%3C/textarea%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E"],"32c5a1be682ae34b4195cd0481ee6c53c806abeb":[async_test('html5lib_tests3.html 32c5a1be682ae34b4195cd0481ee6c53c806abeb'), "%3C%21DOCTYPE%20html%3E%3Ctextarea%3E%0Afoo%3C/textarea%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22foo%22"],"daf731117bb7cf43f750f187cbb3528f07c9a012":[async_test('html5lib_tests3.html daf731117bb7cf43f750f187cbb3528f07c9a012'), "%3C%21DOCTYPE%20html%3E%3Ctextarea%3E%0A%0Afoo%3C/textarea%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22%0Afoo%22"],"948e2378d0e6bd68dbc278a993c2774c22b30370":[async_test('html5lib_tests3.html 948e2378d0e6bd68dbc278a993c2774c22b30370'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E%3Cul%3E%3Cli%3E%3Cdiv%3E%3Cp%3E%3Cli%3E%3C/ul%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cul%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E"],"f7fd80272bb4ab6e3bb871de5f7688912740c39f":[async_test('html5lib_tests3.html f7fd80272bb4ab6e3bb871de5f7688912740c39f'), "%3C%21doctype%20html%3E%3Cnobr%3E%3Cnobr%3E%3Cnobr%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%3Cnobr%3E"],"9eddcf7971dc65d05f25aa4c412acf09a789e5b3":[async_test('html5lib_tests3.html 9eddcf7971dc65d05f25aa4c412acf09a789e5b3'), "%3C%21doctype%20html%3E%3Cnobr%3E%3Cnobr%3E%3C/nobr%3E%3Cnobr%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%3Cnobr%3E"],"e91b512a3b3307481c8039279d5cf487aa258a9d":[async_test('html5lib_tests3.html e91b512a3b3307481c8039279d5cf487aa258a9d'), "%3C%21doctype%20html%3E%3Chtml%3E%3Cbody%3E%3Cp%3E%3Ctable%3E%3C/table%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Ctable%3E"],"6d570cad6386f2e21419f5eb63e7dfa290abe40f":[async_test('html5lib_tests3.html 6d570cad6386f2e21419f5eb63e7dfa290abe40f'), "%3Cp%3E%3Ctable%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests5.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests5.html
new file mode 100644
index 000000000..b1314ead6
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests5.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests5.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['c482a88c4feb445945f19c77eda5e460cd6db344','b28eaef63aeeb165eceb56152d50767327f975fa','20c1b55aabcd426fa5975648f21cff40fa3fc2e3','cc87be99b2531e4c0c1fd95f81cd4dd989f699d3','283a0f4eb33a3ee80f718020268bf1794a758ec9','bde8b7a035edd6f123f45708ac10b4f60e81edf4','6ace30add7690cda74de9830481c95bef1f5976d','3c5f82c8db30cc1cce4c7fa8a5d18cf13ce8d007','9cac6179dc295f43afd5a41ed98aef3a9d5a08de','021a5fbf8c725781d08dce099d21f7023c9bb26d','412eae0c0e6e5da254550debd587ff86cff55c0c','410a64500216425d811748b0258c92a49fbad0ff','bd7dfd1a0f74731c22b3e2d331f7c14ba7c9a4e8','5f847a390a413a42fcef3d4510ddc56815c7d722','6d5b2f84df760f8995146c406c2dd07ba5510f7f','eded02e700d7329f650a9a38ef7ea6c0e453766b',];
+ var tests = {
+ "c482a88c4feb445945f19c77eda5e460cd6db344":[async_test('html5lib_tests5.html c482a88c4feb445945f19c77eda5e460cd6db344'), "%3Cstyle%3E%20%3C%21--%20%3C/style%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%20%3C%21--%20%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22x%22"],"b28eaef63aeeb165eceb56152d50767327f975fa":[async_test('html5lib_tests5.html b28eaef63aeeb165eceb56152d50767327f975fa'), "%3Cstyle%3E%20%3C%21--%20%3C/style%3E%20--%3E%20%3C/style%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%20%3C%21--%20%22%0A%7C%20%20%20%20%20%22%20%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%20x%22"],"20c1b55aabcd426fa5975648f21cff40fa3fc2e3":[async_test('html5lib_tests5.html 20c1b55aabcd426fa5975648f21cff40fa3fc2e3'), "%3Cstyle%3E%20%3C%21--%3E%20%3C/style%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%20%3C%21--%3E%20%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22x%22"],"cc87be99b2531e4c0c1fd95f81cd4dd989f699d3":[async_test('html5lib_tests5.html cc87be99b2531e4c0c1fd95f81cd4dd989f699d3'), "%3Cstyle%3E%20%3C%21---%3E%20%3C/style%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%20%3C%21---%3E%20%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22x%22"],"283a0f4eb33a3ee80f718020268bf1794a758ec9":[async_test('html5lib_tests5.html 283a0f4eb33a3ee80f718020268bf1794a758ec9'), "%3Ciframe%3E%20%3C%21---%3E%20%3C/iframe%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ciframe%3E%0A%7C%20%20%20%20%20%20%20%22%20%3C%21---%3E%20%22%0A%7C%20%20%20%20%20%22x%22"],"bde8b7a035edd6f123f45708ac10b4f60e81edf4":[async_test('html5lib_tests5.html bde8b7a035edd6f123f45708ac10b4f60e81edf4'), "%3Ciframe%3E%20%3C%21---%20%3C/iframe%3E-%3Ex%3C/iframe%3E%20--%3E%20%3C/iframe%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ciframe%3E%0A%7C%20%20%20%20%20%20%20%22%20%3C%21---%20%22%0A%7C%20%20%20%20%20%22-%3Ex%20--%3E%20x%22"],"6ace30add7690cda74de9830481c95bef1f5976d":[async_test('html5lib_tests5.html 6ace30add7690cda74de9830481c95bef1f5976d'), "%3Cscript%3E%20%3C%21--%20%3C/script%3E%20--%3E%20%3C/script%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%20%3C%21--%20%22%0A%7C%20%20%20%20%20%22%20%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%20x%22"],"3c5f82c8db30cc1cce4c7fa8a5d18cf13ce8d007":[async_test('html5lib_tests5.html 3c5f82c8db30cc1cce4c7fa8a5d18cf13ce8d007'), "%3Ctitle%3E%20%3C%21--%20%3C/title%3E%20--%3E%20%3C/title%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%20%3C%21--%20%22%0A%7C%20%20%20%20%20%22%20%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%20x%22"],"9cac6179dc295f43afd5a41ed98aef3a9d5a08de":[async_test('html5lib_tests5.html 9cac6179dc295f43afd5a41ed98aef3a9d5a08de'), "%3Ctextarea%3E%20%3C%21---%20%3C/textarea%3E-%3Ex%3C/textarea%3E%20--%3E%20%3C/textarea%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctextarea%3E%0A%7C%20%20%20%20%20%20%20%22%20%3C%21---%20%22%0A%7C%20%20%20%20%20%22-%3Ex%20--%3E%20x%22"],"021a5fbf8c725781d08dce099d21f7023c9bb26d":[async_test('html5lib_tests5.html 021a5fbf8c725781d08dce099d21f7023c9bb26d'), "%3Cstyle%3E%20%3C%21%3C/--%20%3C/style%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%22%20%3C%21%3C/--%20%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22x%22"],"412eae0c0e6e5da254550debd587ff86cff55c0c":[async_test('html5lib_tests5.html 412eae0c0e6e5da254550debd587ff86cff55c0c'), "%3Cp%3E%3Cxmp%3E%3C/xmp%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Cxmp%3E"],"410a64500216425d811748b0258c92a49fbad0ff":[async_test('html5lib_tests5.html 410a64500216425d811748b0258c92a49fbad0ff'), "%3Cxmp%3E%20%3C%21--%20%3E%20--%3E%20%3C/xmp%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cxmp%3E%0A%7C%20%20%20%20%20%20%20%22%20%3C%21--%20%3E%20--%3E%20%22"],"bd7dfd1a0f74731c22b3e2d331f7c14ba7c9a4e8":[async_test('html5lib_tests5.html bd7dfd1a0f74731c22b3e2d331f7c14ba7c9a4e8'), "%3Ctitle%3E%26amp%3B%3C/title%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%26%22%0A%7C%20%20%20%3Cbody%3E"],"5f847a390a413a42fcef3d4510ddc56815c7d722":[async_test('html5lib_tests5.html 5f847a390a413a42fcef3d4510ddc56815c7d722'), "%3Ctitle%3E%3C%21--%26amp%3B--%3E%3C/title%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%26--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"6d5b2f84df760f8995146c406c2dd07ba5510f7f":[async_test('html5lib_tests5.html 6d5b2f84df760f8995146c406c2dd07ba5510f7f'), "%3Ctitle%3E%3C%21--%3C/title%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%3Cbody%3E"],"eded02e700d7329f650a9a38ef7ea6c0e453766b":[async_test('html5lib_tests5.html eded02e700d7329f650a9a38ef7ea6c0e453766b'), "%3Cnoscript%3E%3C%21--%3C/noscript%3E--%3E%3C/noscript%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cnoscript%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22--%3E%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests6.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests6.html
new file mode 100644
index 000000000..2bc2df75b
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests6.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests6.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['d6280e971dd654968ee3c867bec8a3c7d1b885e5','c647c78bfe3660e1ea7d50a04440ed5ace26bd98','fa05c524ac7918197adf422a2c4be35d5eca9ddc','652ae0a8ca3ab725b2d10e9866898b3419333f64','03dad50ea8dd5ba10d8ed7c182e6ce5e654c02dc','3ef045a4e33856f8dac96feaf6f9b06df4bbb49e','fe9fca0f0d3f199ab59c8ef90017f34bcc670ecb','9f8748b72268a2f55e31f89ded4321c5aa4cfbb2','33832cc94bb649f53372c331cbf9234f9b131bec','cbec315b899132776db7598e77d306464e274d32','5a5e3a8ce3d91e10976d5f33b40a7f140b76bc36','ee14c28b79472014c7f456e7cf38a0d93d67b4d3','2d5d4c4867479737e6b5c45b0d5c5541b8353b88','2ea8b4e550e7f34dc52aec0b1870f3d729c20962','6d027310e96f9ac1628e4c67f49e0c690a009232','ad38bf32b77d3553168d6009b1b66029e59d8f80','78b741dafb63b9a5a78ad53915c4c4ee35d1ed9c','dbd7339544532dabb0b7a9136f6463a9c13c8897','5289376d3bace713fc7100577490c56e52dbfa46','ec71973ac3055b0dcfd47c0fc7e7dadc17cd6987','8c25d5edc43b61c47914db4e75a4d96bdd6b2be6','747c389eaf38370a1a7ec79bfeeb3b12c6512bfd','80e4700f134aa20d20eb82fd6cb35cb5846e0ce5','dd5e1c5216565fa8a816078e94528d7596cc2d68','b56b3db519a860b7d17e3bef387900a0d633d393','65a48cd67ebd59c603f45a5b9c2ad99a1ce2058a','64ef2f60587cbae9e7ffec9dc1a295ee4e1a116f','cec679ccf989d4a6985421a9cc301ebfa4667c23','4e48da4a2bca8ce4592e83eb0a076e7d61c297b0','3b2d876e5021de26cf6fdc8d76f6953d08d62180','fb1378f51de760693e7b779830d94033e93be24d','50adfdb7bde3e9bee16021cec1acadbe20858971','f9ca74f9f03a884b09d6a0cb6c53ff84807932e1','09f8c3624809ce2d40845ec3dea2bf6b95eadef2','f591efd2366066d4d02bb2f75bc7eb1151df3734','d25453a832050a3d5e5a908387901544ce92cc3b','5e2f65ba7616b7b909591edca14004e84db39220','8a5717873290cad9d9d67ad4785836bed8f93d35','3e215e4e155dec8d3d6a5a9190e78fce621083e1',];
+ var tests = {
+ "d6280e971dd654968ee3c867bec8a3c7d1b885e5":[async_test('html5lib_tests6.html d6280e971dd654968ee3c867bec8a3c7d1b885e5'), "%3C%21doctype%20html%3E%3C/head%3E%20%3Chead%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%22%20%22%0A%7C%20%20%20%3Cbody%3E"],"c647c78bfe3660e1ea7d50a04440ed5ace26bd98":[async_test('html5lib_tests6.html c647c78bfe3660e1ea7d50a04440ed5ace26bd98'), "%3C%21doctype%20html%3E%3Cform%3E%3Cdiv%3E%3C/form%3E%3Cdiv%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"fa05c524ac7918197adf422a2c4be35d5eca9ddc":[async_test('html5lib_tests6.html fa05c524ac7918197adf422a2c4be35d5eca9ddc'), "%3C%21doctype%20html%3E%3Ctitle%3E%26amp%3B%3C/title%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%26%22%0A%7C%20%20%20%3Cbody%3E"],"652ae0a8ca3ab725b2d10e9866898b3419333f64":[async_test('html5lib_tests6.html 652ae0a8ca3ab725b2d10e9866898b3419333f64'), "%3C%21doctype%20html%3E%3Ctitle%3E%3C%21--%26amp%3B--%3E%3C/title%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22%3C%21--%26--%3E%22%0A%7C%20%20%20%3Cbody%3E"],"03dad50ea8dd5ba10d8ed7c182e6ce5e654c02dc":[async_test('html5lib_tests6.html 03dad50ea8dd5ba10d8ed7c182e6ce5e654c02dc'), "%3C%21doctype%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"3ef045a4e33856f8dac96feaf6f9b06df4bbb49e":[async_test('html5lib_tests6.html 3ef045a4e33856f8dac96feaf6f9b06df4bbb49e'), "%3C%21---x", "%23document%0A%7C%20%3C%21--%20-x%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"fe9fca0f0d3f199ab59c8ef90017f34bcc670ecb":[async_test('html5lib_tests6.html fe9fca0f0d3f199ab59c8ef90017f34bcc670ecb'), "%3Cframeset%3E%3C/frameset%3E%0Afoo", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%22%0A%22"],"9f8748b72268a2f55e31f89ded4321c5aa4cfbb2":[async_test('html5lib_tests6.html 9f8748b72268a2f55e31f89ded4321c5aa4cfbb2'), "%3Cframeset%3E%3C/frameset%3E%0A%3Cnoframes%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%22%0A%22%0A%7C%20%20%20%3Cnoframes%3E"],"33832cc94bb649f53372c331cbf9234f9b131bec":[async_test('html5lib_tests6.html 33832cc94bb649f53372c331cbf9234f9b131bec'), "%3Cframeset%3E%3C/frameset%3E%0A%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%22%0A%22"],"cbec315b899132776db7598e77d306464e274d32":[async_test('html5lib_tests6.html cbec315b899132776db7598e77d306464e274d32'), "%3Cframeset%3E%3C/frameset%3E%0A%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%22%0A%22"],"5a5e3a8ce3d91e10976d5f33b40a7f140b76bc36":[async_test('html5lib_tests6.html 5a5e3a8ce3d91e10976d5f33b40a7f140b76bc36'), "%3Cframeset%3E%3C/frameset%3E%0A%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%22%0A%22"],"ee14c28b79472014c7f456e7cf38a0d93d67b4d3":[async_test('html5lib_tests6.html ee14c28b79472014c7f456e7cf38a0d93d67b4d3'), "%3Cform%3E%3Cform%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E"],"2d5d4c4867479737e6b5c45b0d5c5541b8353b88":[async_test('html5lib_tests6.html 2d5d4c4867479737e6b5c45b0d5c5541b8353b88'), "%3Cbutton%3E%3Cbutton%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%3Cbutton%3E"],"2ea8b4e550e7f34dc52aec0b1870f3d729c20962":[async_test('html5lib_tests6.html 2ea8b4e550e7f34dc52aec0b1870f3d729c20962'), "%3Ctable%3E%3Ctr%3E%3Ctd%3E%3C/th%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"6d027310e96f9ac1628e4c67f49e0c690a009232":[async_test('html5lib_tests6.html 6d027310e96f9ac1628e4c67f49e0c690a009232'), "%3Ctable%3E%3Ccaption%3E%3Ctd%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"ad38bf32b77d3553168d6009b1b66029e59d8f80":[async_test('html5lib_tests6.html ad38bf32b77d3553168d6009b1b66029e59d8f80'), "%3Ctable%3E%3Ccaption%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"78b741dafb63b9a5a78ad53915c4c4ee35d1ed9c":[async_test('html5lib_tests6.html 78b741dafb63b9a5a78ad53915c4c4ee35d1ed9c'), "%3Ctable%3E%3Ccaption%3E%3Cdiv%3E%3C/caption%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"dbd7339544532dabb0b7a9136f6463a9c13c8897":[async_test('html5lib_tests6.html dbd7339544532dabb0b7a9136f6463a9c13c8897'), "%3Ctable%3E%3Ccaption%3E%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E"],"5289376d3bace713fc7100577490c56e52dbfa46":[async_test('html5lib_tests6.html 5289376d3bace713fc7100577490c56e52dbfa46'), "%3Ctable%3E%3Ccaption%3E%3C/body%3E%3C/col%3E%3C/colgroup%3E%3C/html%3E%3C/tbody%3E%3C/td%3E%3C/tfoot%3E%3C/th%3E%3C/thead%3E%3C/tr%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E"],"ec71973ac3055b0dcfd47c0fc7e7dadc17cd6987":[async_test('html5lib_tests6.html ec71973ac3055b0dcfd47c0fc7e7dadc17cd6987'), "%3Ctable%3E%3Ccaption%3E%3Cdiv%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"8c25d5edc43b61c47914db4e75a4d96bdd6b2be6":[async_test('html5lib_tests6.html 8c25d5edc43b61c47914db4e75a4d96bdd6b2be6'), "%3Ctable%3E%3Ctr%3E%3Ctd%3E%3C/body%3E%3C/caption%3E%3C/col%3E%3C/colgroup%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"747c389eaf38370a1a7ec79bfeeb3b12c6512bfd":[async_test('html5lib_tests6.html 747c389eaf38370a1a7ec79bfeeb3b12c6512bfd'), "%3Ctable%3E%3Ccolgroup%3Efoo", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E"],"80e4700f134aa20d20eb82fd6cb35cb5846e0ce5":[async_test('html5lib_tests6.html 80e4700f134aa20d20eb82fd6cb35cb5846e0ce5'), "%3Ctable%3E%3Ccolgroup%3E%3C/col%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E"],"dd5e1c5216565fa8a816078e94528d7596cc2d68":[async_test('html5lib_tests6.html dd5e1c5216565fa8a816078e94528d7596cc2d68'), "%3Cframeset%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"b56b3db519a860b7d17e3bef387900a0d633d393":[async_test('html5lib_tests6.html b56b3db519a860b7d17e3bef387900a0d633d393'), "%3Cframeset%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"65a48cd67ebd59c603f45a5b9c2ad99a1ce2058a":[async_test('html5lib_tests6.html 65a48cd67ebd59c603f45a5b9c2ad99a1ce2058a'), "%3Ctable%3E%3Ctr%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"64ef2f60587cbae9e7ffec9dc1a295ee4e1a116f":[async_test('html5lib_tests6.html 64ef2f60587cbae9e7ffec9dc1a295ee4e1a116f'), "%3Ctable%3E%3Ctr%3E%3Cdiv%3E%3Ctd%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"cec679ccf989d4a6985421a9cc301ebfa4667c23":[async_test('html5lib_tests6.html cec679ccf989d4a6985421a9cc301ebfa4667c23'), "%3Ctable%3E%3Ctbody%3E%3C/thead%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E"],"4e48da4a2bca8ce4592e83eb0a076e7d61c297b0":[async_test('html5lib_tests6.html 4e48da4a2bca8ce4592e83eb0a076e7d61c297b0'), "%3Ctable%3E%3Ctbody%3E%3C/body%3E%3C/caption%3E%3C/col%3E%3C/colgroup%3E%3C/html%3E%3C/td%3E%3C/th%3E%3C/tr%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E"],"3b2d876e5021de26cf6fdc8d76f6953d08d62180":[async_test('html5lib_tests6.html 3b2d876e5021de26cf6fdc8d76f6953d08d62180'), "%3Ctable%3E%3Ctbody%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E"],"fb1378f51de760693e7b779830d94033e93be24d":[async_test('html5lib_tests6.html fb1378f51de760693e7b779830d94033e93be24d'), "%3Ctable%3E%3Ctable%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%3Ctable%3E"],"50adfdb7bde3e9bee16021cec1acadbe20858971":[async_test('html5lib_tests6.html 50adfdb7bde3e9bee16021cec1acadbe20858971'), "%3Ctable%3E%3C/body%3E%3C/caption%3E%3C/col%3E%3C/colgroup%3E%3C/html%3E%3C/tbody%3E%3C/td%3E%3C/tfoot%3E%3C/th%3E%3C/thead%3E%3C/tr%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E"],"f9ca74f9f03a884b09d6a0cb6c53ff84807932e1":[async_test('html5lib_tests6.html f9ca74f9f03a884b09d6a0cb6c53ff84807932e1'), "%3Chtml%3E%3Cframeset%3E%3C/frameset%3E%3C/html%3E%20", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%22%20%22"],"09f8c3624809ce2d40845ec3dea2bf6b95eadef2":[async_test('html5lib_tests6.html 09f8c3624809ce2d40845ec3dea2bf6b95eadef2'), "%3C%21DOCTYPE%20html%20PUBLIC%20%22-//W3C//DTD%20HTML%204.01//EN%22%3E%3Chtml%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%20%22-//W3C//DTD%20HTML%204.01//EN%22%20%22%22%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"f591efd2366066d4d02bb2f75bc7eb1151df3734":[async_test('html5lib_tests6.html f591efd2366066d4d02bb2f75bc7eb1151df3734'), "%3Cparam%3E%3Cframeset%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"d25453a832050a3d5e5a908387901544ce92cc3b":[async_test('html5lib_tests6.html d25453a832050a3d5e5a908387901544ce92cc3b'), "%3Csource%3E%3Cframeset%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"5e2f65ba7616b7b909591edca14004e84db39220":[async_test('html5lib_tests6.html 5e2f65ba7616b7b909591edca14004e84db39220'), "%3Ctrack%3E%3Cframeset%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"8a5717873290cad9d9d67ad4785836bed8f93d35":[async_test('html5lib_tests6.html 8a5717873290cad9d9d67ad4785836bed8f93d35'), "%3C/html%3E%3Cframeset%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"3e215e4e155dec8d3d6a5a9190e78fce621083e1":[async_test('html5lib_tests6.html 3e215e4e155dec8d3d6a5a9190e78fce621083e1'), "%3C/body%3E%3Cframeset%3E%3C/frameset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests7.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests7.html
new file mode 100644
index 000000000..8a74e16ed
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests7.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests7.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['7cb496e242a4dc9aed321252b5ca6ebf4f02ebcd','c0cffec1e999db2aefb2f6beb679fd9620566dbd','7c644a6da21bfd551385b0a5044b82cf7be0a22f','52fde917ba333b89afeff0e31104421455f4bf1b','a8f53ca779c0e5fc484771c4ec2aa6fb6d609779','e4ce65a5fb6a3726b341ec94da583dee7c2c8232','8779e761986b4c724bfe73fee95b7972145fb4d3','620e44a8a55e82cec0d51e9d93025d8a5c4456fc','37b910b755c2df155a3129d5a1150f0c0fdd7934','868bff3a23219b836fdc702063d637f817ce65e1','a33a56f5571b4bcb23138ffb60df3824f5c53773','8ba11b54fa74a1c229d079b2902d6e33e139f33b','84e2152c284f4dfee7d8d12846c08b2c025578a6','8e3432411baa59cbef731ab3ba2703cb5d518453','e2f6144290512430ad25bbf9598eae77288c7b7a','350ebd648764d585f4aa0c29b925e6276579e9d0','9120ef80d3ee017007f3510121ddf7eba31b79e0','2026cd3ed42e41c168dd37c8c2675584f4eef335','ff2e324237e22efc8430ad7137d50d6d3d311820','02c9eb822611b0c206b544e0f2e5044695195ba8','cb3d1a50dd56a85135a0856cfa1c23a091ef2af4','13847685cfff75642823a0e78c6ef232ecb9d94b','99bb5e9a6e0daf62ba418dd97b5e8e3925f4137e','7a8e5ec2c95e725717c564dd49bfa86c2e1a88ba','17dcea170bb74d18ed4776dbb98f0bac6a11364d','9457c10c9f987bbc95937b34763fe956d61d237b','0fa23bb5d8b2a591afb1842b8f4c00c490c127b4','f6d60b3ae48e2b69b4c25125f9b5a3ab4867521b','5b0b3edcc3ce9fdc9f58eb62d326865ca0aab8c8',];
+ var tests = {
+ "7cb496e242a4dc9aed321252b5ca6ebf4f02ebcd":[async_test('html5lib_tests7.html 7cb496e242a4dc9aed321252b5ca6ebf4f02ebcd'), "%3C%21doctype%20html%3E%3Cbody%3E%3Ctitle%3EX%3C/title%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22X%22"],"c0cffec1e999db2aefb2f6beb679fd9620566dbd":[async_test('html5lib_tests7.html c0cffec1e999db2aefb2f6beb679fd9620566dbd'), "%3C%21doctype%20html%3E%3Ctable%3E%3Ctitle%3EX%3C/title%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"7c644a6da21bfd551385b0a5044b82cf7be0a22f":[async_test('html5lib_tests7.html 7c644a6da21bfd551385b0a5044b82cf7be0a22f'), "%3C%21doctype%20html%3E%3Chead%3E%3C/head%3E%3Ctitle%3EX%3C/title%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22X%22%0A%7C%20%20%20%3Cbody%3E"],"52fde917ba333b89afeff0e31104421455f4bf1b":[async_test('html5lib_tests7.html 52fde917ba333b89afeff0e31104421455f4bf1b'), "%3C%21doctype%20html%3E%3C/head%3E%3Ctitle%3EX%3C/title%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22X%22%0A%7C%20%20%20%3Cbody%3E"],"a8f53ca779c0e5fc484771c4ec2aa6fb6d609779":[async_test('html5lib_tests7.html a8f53ca779c0e5fc484771c4ec2aa6fb6d609779'), "%3C%21doctype%20html%3E%3Ctable%3E%3Cmeta%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%3Ctable%3E"],"e4ce65a5fb6a3726b341ec94da583dee7c2c8232":[async_test('html5lib_tests7.html e4ce65a5fb6a3726b341ec94da583dee7c2c8232'), "%3C%21doctype%20html%3E%3Ctable%3EX%3Ctr%3E%3Ctd%3E%3Ctable%3E%20%3Cmeta%3E%3C/table%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%20%22"],"8779e761986b4c724bfe73fee95b7972145fb4d3":[async_test('html5lib_tests7.html 8779e761986b4c724bfe73fee95b7972145fb4d3'), "%3C%21doctype%20html%3E%3Chtml%3E%20%3Chead%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"620e44a8a55e82cec0d51e9d93025d8a5c4456fc":[async_test('html5lib_tests7.html 620e44a8a55e82cec0d51e9d93025d8a5c4456fc'), "%3C%21doctype%20html%3E%20%3Chead%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"37b910b755c2df155a3129d5a1150f0c0fdd7934":[async_test('html5lib_tests7.html 37b910b755c2df155a3129d5a1150f0c0fdd7934'), "%3C%21doctype%20html%3E%3Ctable%3E%3Cstyle%3E%20%3Ctr%3Ex%20%3C/style%3E%20%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20%3Ctr%3Ex%20%22%0A%7C%20%20%20%20%20%20%20%22%20%22"],"868bff3a23219b836fdc702063d637f817ce65e1":[async_test('html5lib_tests7.html 868bff3a23219b836fdc702063d637f817ce65e1'), "%3C%21doctype%20html%3E%3Ctable%3E%3CTBODY%3E%3Cscript%3E%20%3Ctr%3Ex%20%3C/script%3E%20%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20%3Ctr%3Ex%20%22%0A%7C%20%20%20%20%20%20%20%20%20%22%20%22"],"a33a56f5571b4bcb23138ffb60df3824f5c53773":[async_test('html5lib_tests7.html a33a56f5571b4bcb23138ffb60df3824f5c53773'), "%3C%21doctype%20html%3E%3Cp%3E%3Capplet%3E%3Cp%3EX%3C/p%3E%3C/applet%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Capplet%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22X%22"],"8ba11b54fa74a1c229d079b2902d6e33e139f33b":[async_test('html5lib_tests7.html 8ba11b54fa74a1c229d079b2902d6e33e139f33b'), "%3C%21doctype%20html%3E%3Clisting%3E%0AX%3C/listing%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Clisting%3E%0A%7C%20%20%20%20%20%20%20%22X%22"],"84e2152c284f4dfee7d8d12846c08b2c025578a6":[async_test('html5lib_tests7.html 84e2152c284f4dfee7d8d12846c08b2c025578a6'), "%3C%21doctype%20html%3E%3Cselect%3E%3Cinput%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%22X%22"],"8e3432411baa59cbef731ab3ba2703cb5d518453":[async_test('html5lib_tests7.html 8e3432411baa59cbef731ab3ba2703cb5d518453'), "%3C%21doctype%20html%3E%3Cselect%3E%3Cselect%3EX", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%22X%22"],"e2f6144290512430ad25bbf9598eae77288c7b7a":[async_test('html5lib_tests7.html e2f6144290512430ad25bbf9598eae77288c7b7a'), "%3C%21doctype%20html%3E%3Ctable%3E%3Cinput%20type%3DhidDEN%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20type%3D%22hidDEN%22"],"350ebd648764d585f4aa0c29b925e6276579e9d0":[async_test('html5lib_tests7.html 350ebd648764d585f4aa0c29b925e6276579e9d0'), "%3C%21doctype%20html%3E%3Ctable%3EX%3Cinput%20type%3DhidDEN%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20type%3D%22hidDEN%22"],"9120ef80d3ee017007f3510121ddf7eba31b79e0":[async_test('html5lib_tests7.html 9120ef80d3ee017007f3510121ddf7eba31b79e0'), "%3C%21doctype%20html%3E%3Ctable%3E%20%20%3Cinput%20type%3DhidDEN%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%22%20%20%22%0A%7C%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20type%3D%22hidDEN%22"],"2026cd3ed42e41c168dd37c8c2675584f4eef335":[async_test('html5lib_tests7.html 2026cd3ed42e41c168dd37c8c2675584f4eef335'), "%3C%21doctype%20html%3E%3Ctable%3E%20%20%3Cinput%20type%3D%27hidDEN%27%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%22%20%20%22%0A%7C%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20type%3D%22hidDEN%22"],"ff2e324237e22efc8430ad7137d50d6d3d311820":[async_test('html5lib_tests7.html ff2e324237e22efc8430ad7137d50d6d3d311820'), "%3C%21doctype%20html%3E%3Ctable%3E%3Cinput%20type%3D%22%20hidden%22%3E%3Cinput%20type%3DhidDEN%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20type%3D%22%20hidden%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20type%3D%22hidDEN%22"],"02c9eb822611b0c206b544e0f2e5044695195ba8":[async_test('html5lib_tests7.html 02c9eb822611b0c206b544e0f2e5044695195ba8'), "%3C%21doctype%20html%3E%3Ctable%3E%3Cselect%3EX%3Ctr%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%22X%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"cb3d1a50dd56a85135a0856cfa1c23a091ef2af4":[async_test('html5lib_tests7.html cb3d1a50dd56a85135a0856cfa1c23a091ef2af4'), "%3C%21doctype%20html%3E%3Cselect%3EX%3C/select%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%22X%22"],"13847685cfff75642823a0e78c6ef232ecb9d94b":[async_test('html5lib_tests7.html 13847685cfff75642823a0e78c6ef232ecb9d94b'), "%3C%21DOCTYPE%20hTmL%3E%3Chtml%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"99bb5e9a6e0daf62ba418dd97b5e8e3925f4137e":[async_test('html5lib_tests7.html 99bb5e9a6e0daf62ba418dd97b5e8e3925f4137e'), "%3C%21DOCTYPE%20HTML%3E%3Chtml%3E%3C/html%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"7a8e5ec2c95e725717c564dd49bfa86c2e1a88ba":[async_test('html5lib_tests7.html 7a8e5ec2c95e725717c564dd49bfa86c2e1a88ba'), "%3Cdiv%3E%3Cp%3Ea%3C/x%3E%20b", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%22a%20b%22"],"17dcea170bb74d18ed4776dbb98f0bac6a11364d":[async_test('html5lib_tests7.html 17dcea170bb74d18ed4776dbb98f0bac6a11364d'), "%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Ccode%3E%3C/code%3E%20%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ccode%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22%20%22"],"9457c10c9f987bbc95937b34763fe956d61d237b":[async_test('html5lib_tests7.html 9457c10c9f987bbc95937b34763fe956d61d237b'), "%3Ctable%3E%3Cb%3E%3Ctr%3E%3Ctd%3Eaaa%3C/td%3E%3C/tr%3Ebbb%3C/table%3Eccc", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22bbb%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22aaa%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22ccc%22"],"0fa23bb5d8b2a591afb1842b8f4c00c490c127b4":[async_test('html5lib_tests7.html 0fa23bb5d8b2a591afb1842b8f4c00c490c127b4'), "A%3Ctable%3E%3Ctr%3E%20B%3C/tr%3E%20B%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22A%20B%20B%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"f6d60b3ae48e2b69b4c25125f9b5a3ab4867521b":[async_test('html5lib_tests7.html f6d60b3ae48e2b69b4c25125f9b5a3ab4867521b'), "A%3Ctable%3E%3Ctr%3E%20B%3C/tr%3E%20%3C/em%3EC%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22A%20BC%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20%22"],"5b0b3edcc3ce9fdc9f58eb62d326865ca0aab8c8":[async_test('html5lib_tests7.html 5b0b3edcc3ce9fdc9f58eb62d326865ca0aab8c8'), "%3Cselect%3E%3Ckeygen%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%3Ckeygen%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests8.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests8.html
new file mode 100644
index 000000000..762533a8c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests8.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests8.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['5097f2cd0124cf5a23c7ccbe25f71a06966503df','0e11d51b0f71098caaccd166c368918c93683a7c','5c8ec9b2d6f03c2e971dc192897f3fcff92e5a32','a1fe2c2debb936fc1bf663f0d7228eb509522467','dbd09e012016b52703ab081360265d3bf96f3c76','a57d838264ec0d79c8b0c3cb1feb5cb941c0084d','263ff1438ee785d081669eea0fa110cca1d0d590','1ace730a87644923b11aa89e4e472cc5dd91edb7','26454c08b0d791754bf2f94fbee62624cae5fa5c',];
+ var tests = {
+ "5097f2cd0124cf5a23c7ccbe25f71a06966503df":[async_test('html5lib_tests8.html 5097f2cd0124cf5a23c7ccbe25f71a06966503df'), "%3Cdiv%3E%0A%3Cdiv%3E%3C/div%3E%0A%3C/span%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%0Ax%22"],"0e11d51b0f71098caaccd166c368918c93683a7c":[async_test('html5lib_tests8.html 0e11d51b0f71098caaccd166c368918c93683a7c'), "%3Cdiv%3Ex%3Cdiv%3E%3C/div%3E%0A%3C/span%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%0Ax%22"],"5c8ec9b2d6f03c2e971dc192897f3fcff92e5a32":[async_test('html5lib_tests8.html 5c8ec9b2d6f03c2e971dc192897f3fcff92e5a32'), "%3Cdiv%3Ex%3Cdiv%3E%3C/div%3Ex%3C/span%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22xx%22"],"a1fe2c2debb936fc1bf663f0d7228eb509522467":[async_test('html5lib_tests8.html a1fe2c2debb936fc1bf663f0d7228eb509522467'), "%3Cdiv%3Ex%3Cdiv%3E%3C/div%3Ey%3C/span%3Ez", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22yz%22"],"dbd09e012016b52703ab081360265d3bf96f3c76":[async_test('html5lib_tests8.html dbd09e012016b52703ab081360265d3bf96f3c76'), "%3Ctable%3E%3Cdiv%3Ex%3Cdiv%3E%3C/div%3Ex%3C/span%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22xx%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"a57d838264ec0d79c8b0c3cb1feb5cb941c0084d":[async_test('html5lib_tests8.html a57d838264ec0d79c8b0c3cb1feb5cb941c0084d'), "x%3Ctable%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22xx%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"263ff1438ee785d081669eea0fa110cca1d0d590":[async_test('html5lib_tests8.html 263ff1438ee785d081669eea0fa110cca1d0d590'), "x%3Ctable%3E%3Ctable%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"1ace730a87644923b11aa89e4e472cc5dd91edb7":[async_test('html5lib_tests8.html 1ace730a87644923b11aa89e4e472cc5dd91edb7'), "%3Cb%3Ea%3Cdiv%3E%3C/div%3E%3Cdiv%3E%3C/b%3Ey", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22y%22"],"26454c08b0d791754bf2f94fbee62624cae5fa5c":[async_test('html5lib_tests8.html 26454c08b0d791754bf2f94fbee62624cae5fa5c'), "%3Ca%3E%3Cdiv%3E%3Cp%3E%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tests9.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests9.html
new file mode 100644
index 000000000..8cd9132d1
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tests9.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tests9.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['cb005f4b2a248cc98dc153d7391715b8d113cd0d','6b687e562bd878d3a6098f0a1b1c05b04dc8c02c','a28615629ac367bd8127ff3049e81b349e7ec7f6','d70e711bf9b7582d9b83488ab14f99b53a0f3a26','b2a8131e72e53265479c08cd18d4f4663278a021','a45a8948b799dadc321a86ff0bebf13167b5f076','9d6809ff0d5796525b655f44e8abe4267cfd84e1','2243c76da49f512eddbdf3f63965a70b8f3f5563','64ccbdfede00715ff2b6c0818d78774e0ea49fd4','58a5b5c13c3cc04948ca053afec1879602812beb','3be30b785cfbb6b1210720d032808e6484004fad','fe4054e577d1a3afa91c02b6782e35b76f2b3a50','9f12eef91092bcaaef567214144e1320b389296a','2f18900946d7a7f7922c929b72537e5ce8aacb70','2d4f10eec8e9623ef881edd20a639d3572134fd5','18485b14fd6568a096121ce8b8683a47945326d3','1d7a80644fe4b5f580c39adee71d5432cb186285','224e1bcb8030f0972c17d0fc68d912be17905e1c','e84d33cef974e49b69bdbc0c663c018a4dd010c0','5f4d3b90e4d99fae5ff97ebb9968185c77ffc591','00a77c689b7b8bb6440604f4273de3bfbcbcbe8b','15d4afd62caf2fcb27bb4aff89ba4fcb0e58c0b9','ef6c7a1da34520d2a4a90a0f2e8de9ed334bd482','0705988884bc08d8133e5d8a8eb693db5c86688e','093c0dbf464f9745c3730de57afebd9da308d34c','35aec8963beaced8149a74366eb9b1eb13be6717','931baaac96aab65ad0449b70c374ba56dcdbab9d',];
+ var tests = {
+ "cb005f4b2a248cc98dc153d7391715b8d113cd0d":[async_test('html5lib_tests9.html cb005f4b2a248cc98dc153d7391715b8d113cd0d'), "%3C%21DOCTYPE%20html%3E%3Cmath%3E%3C/math%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E"],"6b687e562bd878d3a6098f0a1b1c05b04dc8c02c":[async_test('html5lib_tests9.html 6b687e562bd878d3a6098f0a1b1c05b04dc8c02c'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cmath%3E%3C/math%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E"],"a28615629ac367bd8127ff3049e81b349e7ec7f6":[async_test('html5lib_tests9.html a28615629ac367bd8127ff3049e81b349e7ec7f6'), "%3C%21DOCTYPE%20html%3E%3Cmath%3E%3Cmi%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E"],"d70e711bf9b7582d9b83488ab14f99b53a0f3a26":[async_test('html5lib_tests9.html d70e711bf9b7582d9b83488ab14f99b53a0f3a26'), "%3C%21DOCTYPE%20html%3E%3Cmath%3E%3Cannotation-xml%3E%3Csvg%3E%3Cu%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%3Cu%3E"],"b2a8131e72e53265479c08cd18d4f4663278a021":[async_test('html5lib_tests9.html b2a8131e72e53265479c08cd18d4f4663278a021'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cselect%3E%3Cmath%3E%3C/math%3E%3C/select%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E"],"a45a8948b799dadc321a86ff0bebf13167b5f076":[async_test('html5lib_tests9.html a45a8948b799dadc321a86ff0bebf13167b5f076'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cselect%3E%3Coption%3E%3Cmath%3E%3C/math%3E%3C/option%3E%3C/select%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E"],"9d6809ff0d5796525b655f44e8abe4267cfd84e1":[async_test('html5lib_tests9.html 9d6809ff0d5796525b655f44e8abe4267cfd84e1'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Cmath%3E%3C/math%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%3Ctable%3E"],"2243c76da49f512eddbdf3f63965a70b8f3f5563":[async_test('html5lib_tests9.html 2243c76da49f512eddbdf3f63965a70b8f3f5563'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3C/math%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"64ccbdfede00715ff2b6c0818d78774e0ea49fd4":[async_test('html5lib_tests9.html 64ccbdfede00715ff2b6c0818d78774e0ea49fd4'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3E%3C/math%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"58a5b5c13c3cc04948ca053afec1879602812beb":[async_test('html5lib_tests9.html 58a5b5c13c3cc04948ca053afec1879602812beb'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ctbody%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3E%3C/math%3E%3C/tbody%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E"],"3be30b785cfbb6b1210720d032808e6484004fad":[async_test('html5lib_tests9.html 3be30b785cfbb6b1210720d032808e6484004fad'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ctbody%3E%3Ctr%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3E%3C/math%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"fe4054e577d1a3afa91c02b6782e35b76f2b3a50":[async_test('html5lib_tests9.html fe4054e577d1a3afa91c02b6782e35b76f2b3a50'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ctbody%3E%3Ctr%3E%3Ctd%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3E%3C/math%3E%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22bar%22"],"9f12eef91092bcaaef567214144e1320b389296a":[async_test('html5lib_tests9.html 9f12eef91092bcaaef567214144e1320b389296a'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ctbody%3E%3Ctr%3E%3Ctd%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3E%3C/math%3E%3Cp%3Ebaz%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22baz%22"],"2f18900946d7a7f7922c929b72537e5ce8aacb70":[async_test('html5lib_tests9.html 2f18900946d7a7f7922c929b72537e5ce8aacb70'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ccaption%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3E%3C/math%3E%3Cp%3Ebaz%3C/caption%3E%3C/table%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22baz%22"],"2d4f10eec8e9623ef881edd20a639d3572134fd5":[async_test('html5lib_tests9.html 2d4f10eec8e9623ef881edd20a639d3572134fd5'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ccaption%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3E%3Cp%3Ebaz%3C/table%3E%3Cp%3Equux", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22baz%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22quux%22"],"18485b14fd6568a096121ce8b8683a47945326d3":[async_test('html5lib_tests9.html 18485b14fd6568a096121ce8b8683a47945326d3'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ccaption%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3Ebaz%3C/table%3E%3Cp%3Equux", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22baz%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22quux%22"],"1d7a80644fe4b5f580c39adee71d5432cb186285":[async_test('html5lib_tests9.html 1d7a80644fe4b5f580c39adee71d5432cb186285'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ccolgroup%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3E%3Cp%3Ebaz%3C/table%3E%3Cp%3Equux", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22baz%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22quux%22"],"224e1bcb8030f0972c17d0fc68d912be17905e1c":[async_test('html5lib_tests9.html 224e1bcb8030f0972c17d0fc68d912be17905e1c'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Cselect%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3E%3Cp%3Ebaz%3C/table%3E%3Cp%3Equux", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22foobarbaz%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22quux%22"],"e84d33cef974e49b69bdbc0c663c018a4dd010c0":[async_test('html5lib_tests9.html e84d33cef974e49b69bdbc0c663c018a4dd010c0'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Ctable%3E%3Cselect%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3E%3Cp%3Ebaz%3C/table%3E%3Cp%3Equux", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%22foobarbaz%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22quux%22"],"5f4d3b90e4d99fae5ff97ebb9968185c77ffc591":[async_test('html5lib_tests9.html 5f4d3b90e4d99fae5ff97ebb9968185c77ffc591'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3C/body%3E%3C/html%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3E%3Cp%3Ebaz", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22baz%22"],"00a77c689b7b8bb6440604f4273de3bfbcbcbe8b":[async_test('html5lib_tests9.html 00a77c689b7b8bb6440604f4273de3bfbcbcbe8b'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3C/body%3E%3Cmath%3E%3Cmi%3Efoo%3C/mi%3E%3Cmi%3Ebar%3C/mi%3E%3Cp%3Ebaz", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22baz%22"],"15d4afd62caf2fcb27bb4aff89ba4fcb0e58c0b9":[async_test('html5lib_tests9.html 15d4afd62caf2fcb27bb4aff89ba4fcb0e58c0b9'), "%3C%21DOCTYPE%20html%3E%3Cframeset%3E%3Cmath%3E%3Cmi%3E%3C/mi%3E%3Cmi%3E%3C/mi%3E%3Cp%3E%3Cspan%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"ef6c7a1da34520d2a4a90a0f2e8de9ed334bd482":[async_test('html5lib_tests9.html ef6c7a1da34520d2a4a90a0f2e8de9ed334bd482'), "%3C%21DOCTYPE%20html%3E%3Cframeset%3E%3C/frameset%3E%3Cmath%3E%3Cmi%3E%3C/mi%3E%3Cmi%3E%3C/mi%3E%3Cp%3E%3Cspan%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"0705988884bc08d8133e5d8a8eb693db5c86688e":[async_test('html5lib_tests9.html 0705988884bc08d8133e5d8a8eb693db5c86688e'), "%3C%21DOCTYPE%20html%3E%3Cbody%20xlink%3Ahref%3Dfoo%3E%3Cmath%20xlink%3Ahref%3Dfoo%3E%3C/math%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20xlink%3Ahref%3D%22foo%22%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20xlink%20href%3D%22foo%22"],"093c0dbf464f9745c3730de57afebd9da308d34c":[async_test('html5lib_tests9.html 093c0dbf464f9745c3730de57afebd9da308d34c'), "%3C%21DOCTYPE%20html%3E%3Cbody%20xlink%3Ahref%3Dfoo%20xml%3Alang%3Den%3E%3Cmath%3E%3Cmi%20xml%3Alang%3Den%20xlink%3Ahref%3Dfoo%3E%3C/mi%3E%3C/math%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20xlink%3Ahref%3D%22foo%22%0A%7C%20%20%20%20%20xml%3Alang%3D%22en%22%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20xlink%20href%3D%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20xml%20lang%3D%22en%22"],"35aec8963beaced8149a74366eb9b1eb13be6717":[async_test('html5lib_tests9.html 35aec8963beaced8149a74366eb9b1eb13be6717'), "%3C%21DOCTYPE%20html%3E%3Cbody%20xlink%3Ahref%3Dfoo%20xml%3Alang%3Den%3E%3Cmath%3E%3Cmi%20xml%3Alang%3Den%20xlink%3Ahref%3Dfoo%20/%3E%3C/math%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20xlink%3Ahref%3D%22foo%22%0A%7C%20%20%20%20%20xml%3Alang%3D%22en%22%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20xlink%20href%3D%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20xml%20lang%3D%22en%22"],"931baaac96aab65ad0449b70c374ba56dcdbab9d":[async_test('html5lib_tests9.html 931baaac96aab65ad0449b70c374ba56dcdbab9d'), "%3C%21DOCTYPE%20html%3E%3Cbody%20xlink%3Ahref%3Dfoo%20xml%3Alang%3Den%3E%3Cmath%3E%3Cmi%20xml%3Alang%3Den%20xlink%3Ahref%3Dfoo%20/%3Ebar%3C/math%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20xlink%3Ahref%3D%22foo%22%0A%7C%20%20%20%20%20xml%3Alang%3D%22en%22%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20xlink%20href%3D%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20xml%20lang%3D%22en%22%0A%7C%20%20%20%20%20%20%20%22bar%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_tricky01.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_tricky01.html
new file mode 100644
index 000000000..f90e7f01f
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_tricky01.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_tricky01.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['06f0a6904729cd6a3ab91f3121c0b0eb54ee04d2','c99581b7d1d8c1cd421054891981c3fe8267e83c','09ba1d973acb46344442ea1e77a37de8736ce6e7','9e40dd21a29521d60a43cb016f4100501ea26ec8','23bed40fe77c77e3119528d9f77e041eeb77eebb','eced3856a69153ad0408470634ee37c284670bcf','f12f21485b685300c282d5eab08fe35c634e7708','8626fa9be928ded0aa6438e32037ef365bfdabc1','ee4120938804980035bacecb2d2597ae8cf254ac',];
+ var tests = {
+ "06f0a6904729cd6a3ab91f3121c0b0eb54ee04d2":[async_test('html5lib_tricky01.html 06f0a6904729cd6a3ab91f3121c0b0eb54ee04d2'), "%3Cb%3E%3Cp%3EBold%20%3C/b%3E%20Not%20bold%3C/p%3E%0AAlso%20not%20bold.", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%22Bold%20%22%0A%7C%20%20%20%20%20%20%20%22%20Not%20bold%22%0A%7C%20%20%20%20%20%22%0AAlso%20not%20bold.%22"],"c99581b7d1d8c1cd421054891981c3fe8267e83c":[async_test('html5lib_tricky01.html c99581b7d1d8c1cd421054891981c3fe8267e83c'), "%3Chtml%3E%0A%3Cfont%20color%3Dred%3E%3Ci%3EItalic%20and%20Red%3Cp%3EItalic%20and%20Red%20%3C/font%3E%20Just%20italic.%3C/p%3E%20Italic%20only.%3C/i%3E%20Plain%0A%3Cp%3EI%20should%20not%20be%20red.%20%3Cfont%20color%3Dred%3ERed.%20%3Ci%3EItalic%20and%20red.%3C/p%3E%0A%3Cp%3EItalic%20and%20red.%20%3C/i%3E%20Red.%3C/font%3E%20I%20should%20not%20be%20red.%3C/p%3E%0A%3Cb%3EBold%20%3Ci%3EBold%20and%20italic%3C/b%3E%20Only%20Italic%20%3C/i%3E%20Plain", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20color%3D%22red%22%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%22Italic%20and%20Red%22%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20color%3D%22red%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22Italic%20and%20Red%20%22%0A%7C%20%20%20%20%20%20%20%20%20%22%20Just%20italic.%22%0A%7C%20%20%20%20%20%20%20%22%20Italic%20only.%22%0A%7C%20%20%20%20%20%22%20Plain%0A%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22I%20should%20not%20be%20red.%20%22%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20color%3D%22red%22%0A%7C%20%20%20%20%20%20%20%20%20%22Red.%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22Italic%20and%20red.%22%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20color%3D%22red%22%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20color%3D%22red%22%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22Italic%20and%20red.%20%22%0A%7C%20%20%20%20%20%20%20%20%20%22%20Red.%22%0A%7C%20%20%20%20%20%20%20%22%20I%20should%20not%20be%20red.%22%0A%7C%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22Bold%20%22%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%22Bold%20and%20italic%22%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%22%20Only%20Italic%20%22%0A%7C%20%20%20%20%20%22%20Plain%22"],"09ba1d973acb46344442ea1e77a37de8736ce6e7":[async_test('html5lib_tricky01.html 09ba1d973acb46344442ea1e77a37de8736ce6e7'), "%3Chtml%3E%3Cbody%3E%0A%3Cp%3E%3Cfont%20size%3D%227%22%3EFirst%20paragraph.%3C/p%3E%0A%3Cp%3ESecond%20paragraph.%3C/p%3E%3C/font%3E%0A%3Cb%3E%3Cp%3E%3Ci%3EBold%20and%20Italic%3C/b%3E%20Italic%3C/p%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20size%3D%227%22%0A%7C%20%20%20%20%20%20%20%20%20%22First%20paragraph.%22%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20size%3D%227%22%0A%7C%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%22Second%20paragraph.%22%0A%7C%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22Bold%20and%20Italic%22%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%20Italic%22"],"9e40dd21a29521d60a43cb016f4100501ea26ec8":[async_test('html5lib_tricky01.html 9e40dd21a29521d60a43cb016f4100501ea26ec8'), "%3Chtml%3E%0A%3Cdl%3E%0A%3Cdt%3E%3Cb%3EBoo%0A%3Cdd%3EGoo%3F%0A%3C/dl%3E%0A%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdl%3E%0A%7C%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%20%20%3Cdt%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22Boo%0A%22%0A%7C%20%20%20%20%20%20%20%3Cdd%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22Goo%3F%0A%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22%0A%22"],"23bed40fe77c77e3119528d9f77e041eeb77eebb":[async_test('html5lib_tricky01.html 23bed40fe77c77e3119528d9f77e041eeb77eebb'), "%3Chtml%3E%3Cbody%3E%0A%3Clabel%3E%3Ca%3E%3Cdiv%3EHello%3Cdiv%3EWorld%3C/div%3E%3C/a%3E%3C/label%3E%20%20%0A%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%3Clabel%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22Hello%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22World%22%0A%7C%20%20%20%20%20%20%20%20%20%22%20%20%0A%22"],"eced3856a69153ad0408470634ee37c284670bcf":[async_test('html5lib_tricky01.html eced3856a69153ad0408470634ee37c284670bcf'), "%3Ctable%3E%3Ccenter%3E%20%3Cfont%3Ea%3C/center%3E%20%3Cimg%3E%20%3Ctr%3E%3Ctd%3E%20%3C/td%3E%20%3C/tr%3E%20%3C/table%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ccenter%3E%0A%7C%20%20%20%20%20%20%20%22%20%22%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%3Cimg%3E%0A%7C%20%20%20%20%20%20%20%22%20%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%22%20%22%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22%20%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%20%22%0A%7C%20%20%20%20%20%20%20%20%20%22%20%22"],"f12f21485b685300c282d5eab08fe35c634e7708":[async_test('html5lib_tricky01.html f12f21485b685300c282d5eab08fe35c634e7708'), "%3Ctable%3E%3Ctr%3E%3Cp%3E%3Ca%3E%3Cp%3EYou%20should%20see%20this%20text.", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%22You%20should%20see%20this%20text.%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"8626fa9be928ded0aa6438e32037ef365bfdabc1":[async_test('html5lib_tricky01.html 8626fa9be928ded0aa6438e32037ef365bfdabc1'), "%3CTABLE%3E%0A%3CTR%3E%0A%3CCENTER%3E%3CCENTER%3E%3CTD%3E%3C/TD%3E%3C/TR%3E%3CTR%3E%0A%3CFONT%3E%0A%3CTABLE%3E%3Ctr%3E%3C/tr%3E%3C/TABLE%3E%0A%3C/P%3E%0A%3Ca%3E%3C/font%3E%3Cfont%3E%3C/a%3E%0AThis%20page%20contains%20an%20insanely%20badly-nested%20tag%20sequence.", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ccenter%3E%0A%7C%20%20%20%20%20%20%20%3Ccenter%3E%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%22%0AThis%20page%20contains%20an%20insanely%20badly-nested%20tag%20sequence.%22"],"ee4120938804980035bacecb2d2597ae8cf254ac":[async_test('html5lib_tricky01.html ee4120938804980035bacecb2d2597ae8cf254ac'), "%3Chtml%3E%0A%3Cbody%3E%0A%3Cb%3E%3Cnobr%3E%3Cdiv%3EThis%20text%20is%20in%20a%20div%20inside%20a%20nobr%3C/nobr%3EMore%20text%20that%20should%20not%20be%20in%20the%20nobr%2C%20i.e.%2C%20the%0Anobr%20should%20have%20closed%20the%20div%20inside%20it%20implicitly.%20%3C/b%3E%3Cpre%3EA%20pre%20tag%20outside%20everything%20else.%3C/pre%3E%0A%3C/body%3E%0A%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22This%20text%20is%20in%20a%20div%20inside%20a%20nobr%22%0A%7C%20%20%20%20%20%20%20%20%20%22More%20text%20that%20should%20not%20be%20in%20the%20nobr%2C%20i.e.%2C%20the%0Anobr%20should%20have%20closed%20the%20div%20inside%20it%20implicitly.%20%22%0A%7C%20%20%20%20%20%20%20%3Cpre%3E%0A%7C%20%20%20%20%20%20%20%20%20%22A%20pre%20tag%20outside%20everything%20else.%22%0A%7C%20%20%20%20%20%20%20%22%0A%0A%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_webkit01.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_webkit01.html
new file mode 100644
index 000000000..43f07f59e
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_webkit01.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_webkit01.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['4235382bf15f93f7dd1096832ae74cc71edef4d7','9906bb30ae08654f4c67bf6d97040abbca91082d','97974a9c541d97c7bb5bd8ba97c2ccbe0c6e55bd','f30960ce7d5b25adc846e47823f977616d38b296','f3ed3ec3a14058fd97c9aad83299bc8836d21283','f073fda1df7d917e37a207c326bdc4db0b4b3481','5533bf52e328c5748a203be1bb245848de592783','5b753a783c228a1b423152d9707cf900e57bc5da','eea9ac89544ec31fb78f7629ea0e065bd7422c98','03a99ca235d60b3191a3c5671ff7df5ffca5372d','c37bc2e44b2765025f58c9680a560c1a3dc3ab93','c6b4dc9c0041dd5a069741dbf228f03439115b8d','d4613a2b82f5d4ec251149508096f8071a8714d5','0f78a3fae382185ef9ac8f767efafb401249c1e1','375260e547e078df727a3669f5c8dcef7ccf71a7','3bea2bf663be5de2bbcdad57ac95c5933e266d42','19944775fd9dd871fbc4cf813eb105c29bc5d834','25b53e528a0ad0b002c8a26b7260213a24981860','ce59a8ae9cf138cb81fd017711097d1643c6f227','913071287591cc570d512c824b419d9a172d4339','2669743ff272e43978ac0f8a2f2c602ec9036c26','a9e759bf3ce415ad6216c58ee906639c03ffa03f','bbbea9a3752a36a64f2b62f15383406b16113fe7','e0910f26aac678f50612da8d05d20aa29e140655','f30a9e97cdf3c54ffccaa7b9c2067ff109317530','0d99b69e40dbb898cd4a188aa4920042c30815b4','a20991a86f6d34fd67ddb4002e3972d82230d879','006dbf89bfa3df51d837e7557c3e32dfbc6f0f4c','7e8f1399f9c87dbd103303c6051873079b265360','5081f4afe652b92f23e80d275f67dec9139df8e3','f904db0ad0c00794f8a2ca238b4c36084993c741','d56fcf271bf902fc4739f055f031f0d11620057c','a897ca0ad0492945709d0772c91e33d485ddf9c7','7274654c671e2e1715a017a239a98399496b7ba6','346ed4219453716e3fee23ccddf283fde408d349','4d1b6f58e6bb11d27e2097f656abdd1122a45a67','bb7bc3a43938aef67cffb49084f27cc678cd9b7a','992947d22821e1eb7b9116a99420b6c7f5ad46f2','88eca99701e0ad1fda391722e5f0cdcf1e2b667d','4b36a9545e5d8df93c447eaa8b1dc42d704d9c61','dc2437252e38b998fec43311653af309a65ef35f','ec499b1124d241faaa28e2f985ecf5f3fa00fcf8','cd236e537fa5d967d11efea30d96cd6ef6c9f46b','2ee90ed930fca8db8278161af28adde1e0c3907b','a785e349a36349db19df18c06032315c6356486c','401c8625b8574b46d03b8e95acd29358c82b53d3','1390b296dc6152683e9de9820194bca39e18cbd6','7dc7e88fa9eba71234bdb4037a15a4f70183a466',];
+ var tests = {
+ "4235382bf15f93f7dd1096832ae74cc71edef4d7":[async_test('html5lib_webkit01.html 4235382bf15f93f7dd1096832ae74cc71edef4d7'), "Test", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Test%22"],"9906bb30ae08654f4c67bf6d97040abbca91082d":[async_test('html5lib_webkit01.html 9906bb30ae08654f4c67bf6d97040abbca91082d'), "%3Cdiv%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E"],"97974a9c541d97c7bb5bd8ba97c2ccbe0c6e55bd":[async_test('html5lib_webkit01.html 97974a9c541d97c7bb5bd8ba97c2ccbe0c6e55bd'), "%3Cdiv%3ETest%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22Test%22"],"f30960ce7d5b25adc846e47823f977616d38b296":[async_test('html5lib_webkit01.html f30960ce7d5b25adc846e47823f977616d38b296'), "%3Cdi", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"f3ed3ec3a14058fd97c9aad83299bc8836d21283":[async_test('html5lib_webkit01.html f3ed3ec3a14058fd97c9aad83299bc8836d21283'), "%3Cdiv%3EHello%3C/div%3E%0A%3Cscript%3E%0Aconsole.log%28%22PASS%22%29%3B%0A%3C/script%3E%0A%3Cdiv%3EBye%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22Hello%22%0A%7C%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%0Aconsole.log%28%22PASS%22%29%3B%0A%22%0A%7C%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22Bye%22"],"f073fda1df7d917e37a207c326bdc4db0b4b3481":[async_test('html5lib_webkit01.html f073fda1df7d917e37a207c326bdc4db0b4b3481'), "%3Cdiv%20foo%3D%22bar%22%3EHello%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20foo%3D%22bar%22%0A%7C%20%20%20%20%20%20%20%22Hello%22"],"5533bf52e328c5748a203be1bb245848de592783":[async_test('html5lib_webkit01.html 5533bf52e328c5748a203be1bb245848de592783'), "%3Cdiv%3EHello%3C/div%3E%0A%3Cscript%3E%0Aconsole.log%28%22FOO%3Cspan%3EBAR%3C/span%3EBAZ%22%29%3B%0A%3C/script%3E%0A%3Cdiv%3EBye%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22Hello%22%0A%7C%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22%0Aconsole.log%28%22FOO%3Cspan%3EBAR%3C/span%3EBAZ%22%29%3B%0A%22%0A%7C%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22Bye%22"],"5b753a783c228a1b423152d9707cf900e57bc5da":[async_test('html5lib_webkit01.html 5b753a783c228a1b423152d9707cf900e57bc5da'), "%3Cfoo%20bar%3D%22baz%22%3E%3C/foo%3E%3Cpotato%20quack%3D%22duck%22%3E%3C/potato%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfoo%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22baz%22%0A%7C%20%20%20%20%20%3Cpotato%3E%0A%7C%20%20%20%20%20%20%20quack%3D%22duck%22"],"eea9ac89544ec31fb78f7629ea0e065bd7422c98":[async_test('html5lib_webkit01.html eea9ac89544ec31fb78f7629ea0e065bd7422c98'), "%3Cfoo%20bar%3D%22baz%22%3E%3Cpotato%20quack%3D%22duck%22%3E%3C/potato%3E%3C/foo%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfoo%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22baz%22%0A%7C%20%20%20%20%20%20%20%3Cpotato%3E%0A%7C%20%20%20%20%20%20%20%20%20quack%3D%22duck%22"],"03a99ca235d60b3191a3c5671ff7df5ffca5372d":[async_test('html5lib_webkit01.html 03a99ca235d60b3191a3c5671ff7df5ffca5372d'), "%3Cfoo%3E%3C/foo%20bar%3D%22baz%22%3E%3Cpotato%3E%3C/potato%20quack%3D%22duck%22%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfoo%3E%0A%7C%20%20%20%20%20%3Cpotato%3E"],"c37bc2e44b2765025f58c9680a560c1a3dc3ab93":[async_test('html5lib_webkit01.html c37bc2e44b2765025f58c9680a560c1a3dc3ab93'), "%3C/%20tttt%3E", "%23document%0A%7C%20%3C%21--%20%20tttt%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"c6b4dc9c0041dd5a069741dbf228f03439115b8d":[async_test('html5lib_webkit01.html c6b4dc9c0041dd5a069741dbf228f03439115b8d'), "%3Cdiv%20FOO%20%3E%3Cimg%3E%3Cimg%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20foo%3D%22%22%0A%7C%20%20%20%20%20%20%20%3Cimg%3E%0A%7C%20%20%20%20%20%20%20%3Cimg%3E"],"d4613a2b82f5d4ec251149508096f8071a8714d5":[async_test('html5lib_webkit01.html d4613a2b82f5d4ec251149508096f8071a8714d5'), "%3Cp%3ETest%3C/p%3Cp%3ETest2%3C/p%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22TestTest2%22"],"0f78a3fae382185ef9ac8f767efafb401249c1e1":[async_test('html5lib_webkit01.html 0f78a3fae382185ef9ac8f767efafb401249c1e1'), "%3Crdar%3A//problem/6869687%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Crdar%3A%3E%0A%7C%20%20%20%20%20%20%206869687%3D%22%22%0A%7C%20%20%20%20%20%20%20problem%3D%22%22"],"375260e547e078df727a3669f5c8dcef7ccf71a7":[async_test('html5lib_webkit01.html 375260e547e078df727a3669f5c8dcef7ccf71a7'), "%3CA%3Etest%3C%20/A%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%22test%3C%20/A%3E%22"],"3bea2bf663be5de2bbcdad57ac95c5933e266d42":[async_test('html5lib_webkit01.html 3bea2bf663be5de2bbcdad57ac95c5933e266d42'), "%26lt%3B", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%3C%22"],"19944775fd9dd871fbc4cf813eb105c29bc5d834":[async_test('html5lib_webkit01.html 19944775fd9dd871fbc4cf813eb105c29bc5d834'), "%3Cbody%20foo%3D%27bar%27%3E%3Cbody%20foo%3D%27baz%27%20yo%3D%27mama%27%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20foo%3D%22bar%22%0A%7C%20%20%20%20%20yo%3D%22mama%22"],"25b53e528a0ad0b002c8a26b7260213a24981860":[async_test('html5lib_webkit01.html 25b53e528a0ad0b002c8a26b7260213a24981860'), "%3Cbody%3E%3C/br%20foo%3D%22bar%22%3E%3C/body%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbr%3E"],"ce59a8ae9cf138cb81fd017711097d1643c6f227":[async_test('html5lib_webkit01.html ce59a8ae9cf138cb81fd017711097d1643c6f227'), "%3Cbdy%3E%3Cbr%20foo%3D%22bar%22%3E%3C/body%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbdy%3E%0A%7C%20%20%20%20%20%20%20%3Cbr%3E%0A%7C%20%20%20%20%20%20%20%20%20foo%3D%22bar%22"],"913071287591cc570d512c824b419d9a172d4339":[async_test('html5lib_webkit01.html 913071287591cc570d512c824b419d9a172d4339'), "%3Cbody%3E%3C/body%3E%3C/br%20foo%3D%22bar%22%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbr%3E"],"2669743ff272e43978ac0f8a2f2c602ec9036c26":[async_test('html5lib_webkit01.html 2669743ff272e43978ac0f8a2f2c602ec9036c26'), "%3Cbdy%3E%3C/body%3E%3Cbr%20foo%3D%22bar%22%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbdy%3E%0A%7C%20%20%20%20%20%20%20%3Cbr%3E%0A%7C%20%20%20%20%20%20%20%20%20foo%3D%22bar%22"],"a9e759bf3ce415ad6216c58ee906639c03ffa03f":[async_test('html5lib_webkit01.html a9e759bf3ce415ad6216c58ee906639c03ffa03f'), "%3Chtml%3E%3Cbody%3E%3C/body%3E%3C/html%3E%3C%21--%20Hi%20there%20--%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%3C%21--%20%20Hi%20there%20%20--%3E"],"bbbea9a3752a36a64f2b62f15383406b16113fe7":[async_test('html5lib_webkit01.html bbbea9a3752a36a64f2b62f15383406b16113fe7'), "%3Chtml%3E%3Cbody%3E%3C/body%3E%3C/html%3Ex%3C%21--%20Hi%20there%20--%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%3C%21--%20%20Hi%20there%20%20--%3E"],"e0910f26aac678f50612da8d05d20aa29e140655":[async_test('html5lib_webkit01.html e0910f26aac678f50612da8d05d20aa29e140655'), "%3Chtml%3E%3Cbody%3E%3C/body%3E%3C/html%3Ex%3C%21--%20Hi%20there%20--%3E%3C/html%3E%3C%21--%20Again%20--%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%3C%21--%20%20Hi%20there%20%20--%3E%0A%7C%20%3C%21--%20%20Again%20%20--%3E"],"f30a9e97cdf3c54ffccaa7b9c2067ff109317530":[async_test('html5lib_webkit01.html f30a9e97cdf3c54ffccaa7b9c2067ff109317530'), "%3Chtml%3E%3Cbody%3E%3C/body%3E%3C/html%3Ex%3C%21--%20Hi%20there%20--%3E%3C/body%3E%3C/html%3E%3C%21--%20Again%20--%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%3C%21--%20%20Hi%20there%20%20--%3E%0A%7C%20%3C%21--%20%20Again%20%20--%3E"],"0d99b69e40dbb898cd4a188aa4920042c30815b4":[async_test('html5lib_webkit01.html 0d99b69e40dbb898cd4a188aa4920042c30815b4'), "%3Chtml%3E%3Cbody%3E%3Cruby%3E%3Cdiv%3E%3Crp%3Exx%3C/rp%3E%3C/div%3E%3C/ruby%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cruby%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Crp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22xx%22"],"a20991a86f6d34fd67ddb4002e3972d82230d879":[async_test('html5lib_webkit01.html a20991a86f6d34fd67ddb4002e3972d82230d879'), "%3Chtml%3E%3Cbody%3E%3Cruby%3E%3Cdiv%3E%3Crt%3Exx%3C/rt%3E%3C/div%3E%3C/ruby%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cruby%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Crt%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22xx%22"],"006dbf89bfa3df51d837e7557c3e32dfbc6f0f4c":[async_test('html5lib_webkit01.html 006dbf89bfa3df51d837e7557c3e32dfbc6f0f4c'), "%3Chtml%3E%3Cframeset%3E%3C%21--1--%3E%3Cnoframes%3EA%3C/noframes%3E%3C%21--2--%3E%3C/frameset%3E%3C%21--3--%3E%3Cnoframes%3EB%3C/noframes%3E%3C%21--4--%3E%3C/html%3E%3C%21--5--%3E%3Cnoframes%3EC%3C/noframes%3E%3C%21--6--%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E%0A%7C%20%20%20%20%20%3C%21--%201%20--%3E%0A%7C%20%20%20%20%20%3Cnoframes%3E%0A%7C%20%20%20%20%20%20%20%22A%22%0A%7C%20%20%20%20%20%3C%21--%202%20--%3E%0A%7C%20%20%20%3C%21--%203%20--%3E%0A%7C%20%20%20%3Cnoframes%3E%0A%7C%20%20%20%20%20%22B%22%0A%7C%20%20%20%3C%21--%204%20--%3E%0A%7C%20%20%20%3Cnoframes%3E%0A%7C%20%20%20%20%20%22C%22%0A%7C%20%3C%21--%205%20--%3E%0A%7C%20%3C%21--%206%20--%3E"],"7e8f1399f9c87dbd103303c6051873079b265360":[async_test('html5lib_webkit01.html 7e8f1399f9c87dbd103303c6051873079b265360'), "%3Cselect%3E%3Coption%3EA%3Cselect%3E%3Coption%3EB%3Cselect%3E%3Coption%3EC%3Cselect%3E%3Coption%3ED%3Cselect%3E%3Coption%3EE%3Cselect%3E%3Coption%3EF%3Cselect%3E%3Coption%3EG%3Cselect%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%20%20%22A%22%0A%7C%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%22B%22%0A%7C%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22C%22%0A%7C%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%22D%22%0A%7C%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22E%22%0A%7C%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%22F%22%0A%7C%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Coption%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22G%22"],"5081f4afe652b92f23e80d275f67dec9139df8e3":[async_test('html5lib_webkit01.html 5081f4afe652b92f23e80d275f67dec9139df8e3'), "%3Cdd%3E%3Cdd%3E%3Cdt%3E%3Cdt%3E%3Cdd%3E%3Cli%3E%3Cli%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdd%3E%0A%7C%20%20%20%20%20%3Cdd%3E%0A%7C%20%20%20%20%20%3Cdt%3E%0A%7C%20%20%20%20%20%3Cdt%3E%0A%7C%20%20%20%20%20%3Cdd%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E"],"f904db0ad0c00794f8a2ca238b4c36084993c741":[async_test('html5lib_webkit01.html f904db0ad0c00794f8a2ca238b4c36084993c741'), "%3Cdiv%3E%3Cb%3E%3C/div%3E%3Cdiv%3E%3Cnobr%3Ea%3Cnobr%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cnobr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cnobr%3E"],"d56fcf271bf902fc4739f055f031f0d11620057c":[async_test('html5lib_webkit01.html d56fcf271bf902fc4739f055f031f0d11620057c'), "%3Chead%3E%3C/head%3E%0A%3Cbody%3E%3C/body%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%22%0A%22%0A%7C%20%20%20%3Cbody%3E"],"a897ca0ad0492945709d0772c91e33d485ddf9c7":[async_test('html5lib_webkit01.html a897ca0ad0492945709d0772c91e33d485ddf9c7'), "%3Chead%3E%3C/head%3E%20%3Cstyle%3E%3C/style%3Eddd", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%22%20%22%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22ddd%22"],"7274654c671e2e1715a017a239a98399496b7ba6":[async_test('html5lib_webkit01.html 7274654c671e2e1715a017a239a98399496b7ba6'), "%3Ckbd%3E%3Ctable%3E%3C/kbd%3E%3Ccol%3E%3Cselect%3E%3Ctr%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ckbd%3E%0A%7C%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E"],"346ed4219453716e3fee23ccddf283fde408d349":[async_test('html5lib_webkit01.html 346ed4219453716e3fee23ccddf283fde408d349'), "%3Ckbd%3E%3Ctable%3E%3C/kbd%3E%3Ccol%3E%3Cselect%3E%3Ctr%3E%3C/table%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ckbd%3E%0A%7C%20%20%20%20%20%20%20%3Cselect%3E%0A%7C%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ccolgroup%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ccol%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E"],"4d1b6f58e6bb11d27e2097f656abdd1122a45a67":[async_test('html5lib_webkit01.html 4d1b6f58e6bb11d27e2097f656abdd1122a45a67'), "%3Ca%3E%3Cli%3E%3Cstyle%3E%3C/style%3E%3Ctitle%3E%3C/title%3E%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctitle%3E"],"bb7bc3a43938aef67cffb49084f27cc678cd9b7a":[async_test('html5lib_webkit01.html bb7bc3a43938aef67cffb49084f27cc678cd9b7a'), "%3Cfont%3E%3C/p%3E%3Cp%3E%3Cmeta%3E%3Ctitle%3E%3C/title%3E%3C/font%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmeta%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctitle%3E"],"992947d22821e1eb7b9116a99420b6c7f5ad46f2":[async_test('html5lib_webkit01.html 992947d22821e1eb7b9116a99420b6c7f5ad46f2'), "%3Ca%3E%3Ccenter%3E%3Ctitle%3E%3C/title%3E%3Ca%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Ccenter%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E"],"88eca99701e0ad1fda391722e5f0cdcf1e2b667d":[async_test('html5lib_webkit01.html 88eca99701e0ad1fda391722e5f0cdcf1e2b667d'), "%3Csvg%3E%3Ctitle%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20title%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"4b36a9545e5d8df93c447eaa8b1dc42d704d9c61":[async_test('html5lib_webkit01.html 4b36a9545e5d8df93c447eaa8b1dc42d704d9c61'), "%3Csvg%3E%3Ctitle%3E%3Crect%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20title%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Crect%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"dc2437252e38b998fec43311653af309a65ef35f":[async_test('html5lib_webkit01.html dc2437252e38b998fec43311653af309a65ef35f'), "%3Csvg%3E%3Ctitle%3E%3Csvg%3E%3Cdiv%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20title%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"ec499b1124d241faaa28e2f985ecf5f3fa00fcf8":[async_test('html5lib_webkit01.html ec499b1124d241faaa28e2f985ecf5f3fa00fcf8'), "%3Cimg%20%3C%3D%22%22%20FAIL%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cimg%3E%0A%7C%20%20%20%20%20%20%20%3C%3D%22%22%0A%7C%20%20%20%20%20%20%20fail%3D%22%22"],"cd236e537fa5d967d11efea30d96cd6ef6c9f46b":[async_test('html5lib_webkit01.html cd236e537fa5d967d11efea30d96cd6ef6c9f46b'), "%3Cul%3E%3Cli%3E%3Cdiv%20id%3D%27foo%27/%3EA%3C/li%3E%3Cli%3EB%3Cdiv%3EC%3C/div%3E%3C/li%3E%3C/ul%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cul%3E%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20id%3D%22foo%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22A%22%0A%7C%20%20%20%20%20%20%20%3Cli%3E%0A%7C%20%20%20%20%20%20%20%20%20%22B%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22C%22"],"2ee90ed930fca8db8278161af28adde1e0c3907b":[async_test('html5lib_webkit01.html 2ee90ed930fca8db8278161af28adde1e0c3907b'), "%3Csvg%3E%3Cem%3E%3Cdesc%3E%3C/em%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%3Cem%3E%0A%7C%20%20%20%20%20%20%20%3Cdesc%3E"],"a785e349a36349db19df18c06032315c6356486c":[async_test('html5lib_webkit01.html a785e349a36349db19df18c06032315c6356486c'), "%3Csvg%3E%3Ctfoot%3E%3C/mi%3E%3Ctd%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20tfoot%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20td%3E"],"401c8625b8574b46d03b8e95acd29358c82b53d3":[async_test('html5lib_webkit01.html 401c8625b8574b46d03b8e95acd29358c82b53d3'), "%3Cmath%3E%3Cmrow%3E%3Cmrow%3E%3Cmn%3E1%3C/mn%3E%3C/mrow%3E%3Cmi%3Ea%3C/mi%3E%3C/mrow%3E%3C/math%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mrow%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mrow%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cmath%20mn%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mi%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22a%22"],"1390b296dc6152683e9de9820194bca39e18cbd6":[async_test('html5lib_webkit01.html 1390b296dc6152683e9de9820194bca39e18cbd6'), "%3C%21doctype%20html%3E%3Cinput%20type%3D%22hidden%22%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"7dc7e88fa9eba71234bdb4037a15a4f70183a466":[async_test('html5lib_webkit01.html 7dc7e88fa9eba71234bdb4037a15a4f70183a466'), "%3C%21doctype%20html%3E%3Cinput%20type%3D%22button%22%3E%3Cframeset%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20type%3D%22button%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/html5lib_webkit02.html b/testing/web-platform/tests/html/syntax/parsing/html5lib_webkit02.html
new file mode 100644
index 000000000..2d324eb7c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/html5lib_webkit02.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf8">
+ <title>HTML 5 Parser tests html5lib_webkit02.html</title>
+ <meta name="timeout" content="long">
+ <meta name="variant" content="?run_type=uri">
+ <meta name="variant" content="?run_type=write">
+ <meta name="variant" content="?run_type=write_single">
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+ var order = ['f50b8c15847159a6d2c6ecc2bd1e4a944ba5aae6','326328ea805a2ebdde707e08567713f88a4cf8ab','05138397908cfdad69a3bfe5da5a06098320b504','2aaa2ac0d7cec6144633d8f82f3bcaafa7498cd9','4a256d7ef602c7c917c758e15981b9710f9b4130','98cea04429ddbe4ffaaa0b91fe77b8c0b1f7c1f4','209ad7d6f6c9c53cb856c7d78b2bc4a7f38abd5f','cb9a86fbac96b08a6e708a2dbcd9f78539dfe9c6',];
+ var tests = {
+ "f50b8c15847159a6d2c6ecc2bd1e4a944ba5aae6":[async_test('html5lib_webkit02.html f50b8c15847159a6d2c6ecc2bd1e4a944ba5aae6'), "%3Cfoo%20bar%3Dqux/%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfoo%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22qux/%22"],"326328ea805a2ebdde707e08567713f88a4cf8ab":[async_test('html5lib_webkit02.html 326328ea805a2ebdde707e08567713f88a4cf8ab'), "%3Cp%20id%3D%22status%22%3E%3Cnoscript%3E%3Cstrong%3EA%3C/strong%3E%3C/noscript%3E%3Cspan%3EB%3C/span%3E%3C/p%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20id%3D%22status%22%0A%7C%20%20%20%20%20%20%20%3Cnoscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%3Cstrong%3EA%3C/strong%3E%22%0A%7C%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%22B%22"],"05138397908cfdad69a3bfe5da5a06098320b504":[async_test('html5lib_webkit02.html 05138397908cfdad69a3bfe5da5a06098320b504'), "%3Cdiv%3E%3Csarcasm%3E%3Cdiv%3E%3C/div%3E%3C/sarcasm%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Csarcasm%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"2aaa2ac0d7cec6144633d8f82f3bcaafa7498cd9":[async_test('html5lib_webkit02.html 2aaa2ac0d7cec6144633d8f82f3bcaafa7498cd9'), "%3Chtml%3E%3Cbody%3E%3Cimg%20src%3D%22%22%20border%3D%220%22%20alt%3D%22%3E%3Cdiv%3EA%3C/div%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"4a256d7ef602c7c917c758e15981b9710f9b4130":[async_test('html5lib_webkit02.html 4a256d7ef602c7c917c758e15981b9710f9b4130'), "%3Ctable%3E%3Ctd%3E%3C/tbody%3EA", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22A%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"98cea04429ddbe4ffaaa0b91fe77b8c0b1f7c1f4":[async_test('html5lib_webkit02.html 98cea04429ddbe4ffaaa0b91fe77b8c0b1f7c1f4'), "%3Ctable%3E%3Ctd%3E%3C/thead%3EA", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22A%22"],"209ad7d6f6c9c53cb856c7d78b2bc4a7f38abd5f":[async_test('html5lib_webkit02.html 209ad7d6f6c9c53cb856c7d78b2bc4a7f38abd5f'), "%3Ctable%3E%3Ctd%3E%3C/tfoot%3EA", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22A%22"],"cb9a86fbac96b08a6e708a2dbcd9f78539dfe9c6":[async_test('html5lib_webkit02.html cb9a86fbac96b08a6e708a2dbcd9f78539dfe9c6'), "%3Ctable%3E%3Cthead%3E%3Ctd%3E%3C/tbody%3EA", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cthead%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22A%22"],
+ }
+ init_tests(get_type());
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/math-parse01.html b/testing/web-platform/tests/html/syntax/parsing/math-parse01.html
new file mode 100644
index 000000000..3aff716d9
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/math-parse01.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>math in html: parsing</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<h1>math in html: parsing</h1>
+
+<div id="log" style="display:block"></div>
+
+<div style="display:none">
+<div><math id="m1"><mtext/></math></div>
+<div id="d1"><math><mrow/><mi/></math></div>
+<div id="d2"><math><mrow><mrow><mn>1</mn></mrow><mi>a</mi></mrow></math></div>
+<div id="d3">&lang;&rang;</div>
+<div id="d4">&Kopf;</div>
+<div id="d5"><math><semantics><mi>a</mi><annotation-xml><foo/><bar/></annotation-xml></semantics></math></div>
+<div id="d6"><math><semantics><mi>a</mi><annotation-xml encoding="text/html"><div></div></annotation-xml></semantics><mn/></math>
+</div>
+
+
+<script>
+
+test(function() {
+assert_equals(document.getElementById("m1"),document.getElementsByTagName("math")[0]);
+},"The id attribute should be recognised on math elements");
+
+test(function() {
+assert_equals(document.getElementById("d1").firstChild.nodeName,"math")
+},"The node name should be math");
+
+test(function() {
+assert_equals(document.getElementById("d1").firstChild.namespaceURI ,"http://www.w3.org/1998/Math/MathML")
+},"math should be in MathML Namespace");
+
+test(function() {
+assert_equals(document.getElementById("d1").firstChild.childNodes.length ,2)
+},"Math has 2 children (empty tag syntax)");
+
+test(function() {
+assert_equals(document.getElementById("d2").firstChild.childNodes.length ,1)
+},"Nested mrow elements should be parsed correctly");
+
+test(function() {
+assert_equals(document.getElementById("d3").firstChild.nodeValue ,"\u27E8\u27E9")
+},"Testing rang and lang entity code points");
+
+test(function() {
+assert_equals(document.getElementById("d4").firstChild.nodeValue ,"\uD835\uDD42")
+},"Testing Kopf (Plane 1) entity code point");
+
+test(function() {
+assert_equals(document.getElementById("d5").firstChild.firstChild.childNodes[1].childNodes.length ,2)
+},"Empty element tags in annotation-xml parsed as per XML.");
+
+test(function() {
+assert_equals(document.getElementById("d6").firstChild.childNodes.length ,2)
+},"html tags allowed in annotation-xml/@encoding='text/html'.");
+
+</script>
diff --git a/testing/web-platform/tests/html/syntax/parsing/math-parse03.html b/testing/web-platform/tests/html/syntax/parsing/math-parse03.html
new file mode 100755
index 000000000..a3dbdc4e6
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/math-parse03.html
@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>math in html: parsing</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<h1>math in html: parsing</h1>
+
+<div id="log"></div>
+
+<div>
+<div><MATH id="m1"><Mtext/></math></div>
+<div id="d1"><math><MI MATHVARIANT="BOLD" /></math></div>
+<div id="d2"><math><semantics DEFINITIONurl="www.example.org/FOO"><mi>a</mi><annotation-xml><foo/><bar/></annotation-xml></semantics></math></div>
+<div><math id="m3span-mtext"><mtext><Span>x</Span></mtext></math></div>
+<div><math id="m3span-mi"><mi><Span>x</Span></mi></math></div>
+<div><math id="m3span-mrow"><mi><Span>x</Span></mrow></math></div>
+<div><math id="m3p-mtext"><mtext><P>x</P></mtext></math></div>
+<div><math id="m3p-mi"><mi><P>x</P></mi></math></div>
+<div id="d3p-mrow"><math><mrow><P>x</P><mi>y</mi></mrow></math></div>
+<div><math id="m4"><mtext><Undefinedelement>x</Undefinedelement></mtext></math></div>
+<div><math id="m5"><mtext><mi>x</mi></mtext></math></div>
+<div><math><semantics><mi>x</mi>
+ <annotation-xml><p id="p6default">x</p></annotation-xml>
+ </semantics></math></div>
+<div><math><semantics><mi>x</mi>
+ <annotation-xml encoding=text/html><p id="p6texthtml">x</p></annotation-xml>
+ </semantics></math></div>
+<div><math><semantics><mi>x</mi>
+ <annotation-xml encoding=TEXT/HTML><p id="p6uctexthtml">x</p></annotation-xml>
+ </semantics></math></div>
+<div><math><semantics><mi>x</mi>
+ <annotation-xml encoding=application/xhtml+xml><p id="p6applicationxhtmlxml">x</p></annotation-xml>
+ </semantics></math></div>
+<div><math><semantics><mi>x</mi>
+ <annotation-xml encoding=foo><p id="p6foo">x</p></annotation-xml>
+ </semantics></math></div>
+</div>
+<script>
+test(function() {
+assert_equals(document.getElementById("m1"),document.getElementsByTagName("math")[0]);
+},"MATH element name should be lowercased");
+
+test(function() {
+assert_equals(document.getElementById("d1").firstChild.firstChild.nodeName,"mi");
+assert_equals(document.getElementById("d1").firstChild.firstChild.namespaceURI, "http://www.w3.org/1998/Math/MathML");
+assert_true(document.getElementById("d1").firstChild.firstChild.hasAttribute("mathvariant"));
+assert_equals(document.getElementById("d1").firstChild.firstChild.getAttribute("mathvariant"),"BOLD")
+},"MI element name and mathvariant attribute name should be lowercased, attribute value unchanged");
+
+test(function() {
+assert_true(document.getElementById("d2").firstChild.firstChild.hasAttribute("definitionURL"));
+assert_equals(document.getElementById("d2").firstChild.firstChild.getAttribute("definitionURL"),"www.example.org/FOO")
+},"DEFINITIONurl attribute markup should produce a definitionURL attribute, attribute value unchanged");
+
+test(function() {
+assert_equals(document.getElementById("m3span-mtext").firstChild.firstChild.nodeName,"SPAN");
+assert_equals(document.getElementById("m3span-mtext").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
+},"html Span in mtext produces SPAN nodename in XHTML namespace");
+
+test(function() {
+assert_equals(document.getElementById("m3span-mi").firstChild.firstChild.nodeName,"SPAN");
+assert_equals(document.getElementById("m3span-mi").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
+},"html Span in mi produces SPAN nodename in XHTML namespace");
+
+test(function() {
+assert_equals(document.getElementById("m3span-mrow").firstChild.firstChild.nodeName,"SPAN");
+assert_equals(document.getElementById("m3span-mrow").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
+},"html Span in mrow produces SPAN nodename in XHTML namespace");
+
+test(function() {
+assert_equals(document.getElementById("m3p-mtext").firstChild.firstChild.nodeName,"P");
+assert_equals(document.getElementById("m3p-mtext").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
+},"html P in mtext produces P nodename in XHTML namespace");
+
+test(function() {
+assert_equals(document.getElementById("m3p-mi").firstChild.firstChild.nodeName,"P");
+assert_equals(document.getElementById("m3p-mi").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
+},"html P in mi produces P nodename in XHTML namespace");
+
+test(function() {
+assert_equals(document.getElementById("d3p-mrow").childNodes.length ,3)
+},"html P in mrow terminates the math: mrow,P,MI children of div");
+
+test(function() {
+assert_equals(document.getElementById("d3p-mrow").firstChild.childNodes.length ,1)
+},"html P in mrow terminates the math: mrow child of math");
+
+test(function() {
+assert_equals(document.getElementById("d3p-mrow").firstChild.firstChild.childNodes.length ,0)
+},"html P in mrow terminates the math: mrow empty");
+
+test(function() {
+assert_equals(document.getElementById("d3p-mrow").childNodes[0].nodeName,"math");
+assert_equals(document.getElementById("d3p-mrow").childNodes[1].nodeName,"P");
+assert_equals(document.getElementById("d3p-mrow").childNodes[2].nodeName,"MI");
+},"html P in mrow terminates the math: math,P,MI children of div");
+
+test(function() {
+assert_equals(document.getElementById("m4").firstChild.firstChild.nodeName,"UNDEFINEDELEMENT");
+assert_equals(document.getElementById("m4").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
+},"Undefinedelement in mtext produces UNDEFINEDELEMENT nodename in XHTML namespace");
+
+test(function() {
+assert_equals(document.getElementById("m5").firstChild.firstChild.nodeName,"MI");
+assert_equals(document.getElementById("m5").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
+},"mi in mtext produces MI nodename in XHTML namespace");
+
+test(function() {
+assert_equals(document.getElementById("p6default").parentNode.nodeName,"DIV")
+},"p in annotation-xml moves to be child of DIV");
+
+test(function() {
+assert_equals(document.getElementById("p6texthtml").parentNode.nodeName,"annotation-xml")
+},"p in annotation-xml encoding=text/html stays as child of annotation-xml");
+
+test(function() {
+assert_equals(document.getElementById("p6uctexthtml").parentNode.nodeName,"annotation-xml")
+},"p in annotation-xml encoding=TEXT/HTML stays as child of annotation-xml");
+
+test(function() {
+assert_equals(document.getElementById("p6applicationxhtmlxml").parentNode.nodeName,"annotation-xml")
+},"p in annotation-xml encoding=application/xhtml+xml stays as child of annotation-xml");
+
+test(function() {
+assert_equals(document.getElementById("p6foo").parentNode.nodeName,"DIV")
+},"p in annotation-xml encoding=foo moves to be child of DIV");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/named-character-references-data.js b/testing/web-platform/tests/html/syntax/parsing/named-character-references-data.js
new file mode 100644
index 000000000..48ab30e47
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/named-character-references-data.js
@@ -0,0 +1,2233 @@
+window.data = {
+ '&AElig': { 'codepoints': [0x000C6], 'characters': '\xC6' },
+ '&AElig;': { 'codepoints': [0x000C6], 'characters': '\xC6' },
+ '&AMP': { 'codepoints': [0x00026], 'characters': '\x26' },
+ '&AMP;': { 'codepoints': [0x00026], 'characters': '\x26' },
+ '&Aacute': { 'codepoints': [0x000C1], 'characters': '\xC1' },
+ '&Aacute;': { 'codepoints': [0x000C1], 'characters': '\xC1' },
+ '&Abreve;': { 'codepoints': [0x00102], 'characters': '\u0102' },
+ '&Acirc': { 'codepoints': [0x000C2], 'characters': '\xC2' },
+ '&Acirc;': { 'codepoints': [0x000C2], 'characters': '\xC2' },
+ '&Acy;': { 'codepoints': [0x00410], 'characters': '\u0410' },
+ '&Afr;': { 'codepoints': [0x1D504], 'characters': '\uD835\uDD04' },
+ '&Agrave': { 'codepoints': [0x000C0], 'characters': '\xC0' },
+ '&Agrave;': { 'codepoints': [0x000C0], 'characters': '\xC0' },
+ '&Alpha;': { 'codepoints': [0x00391], 'characters': '\u0391' },
+ '&Amacr;': { 'codepoints': [0x00100], 'characters': '\u0100' },
+ '&And;': { 'codepoints': [0x02A53], 'characters': '\u2A53' },
+ '&Aogon;': { 'codepoints': [0x00104], 'characters': '\u0104' },
+ '&Aopf;': { 'codepoints': [0x1D538], 'characters': '\uD835\uDD38' },
+ '&ApplyFunction;': { 'codepoints': [0x02061], 'characters': '\u2061' },
+ '&Aring': { 'codepoints': [0x000C5], 'characters': '\xC5' },
+ '&Aring;': { 'codepoints': [0x000C5], 'characters': '\xC5' },
+ '&Ascr;': { 'codepoints': [0x1D49C], 'characters': '\uD835\uDC9C' },
+ '&Assign;': { 'codepoints': [0x02254], 'characters': '\u2254' },
+ '&Atilde': { 'codepoints': [0x000C3], 'characters': '\xC3' },
+ '&Atilde;': { 'codepoints': [0x000C3], 'characters': '\xC3' },
+ '&Auml': { 'codepoints': [0x000C4], 'characters': '\xC4' },
+ '&Auml;': { 'codepoints': [0x000C4], 'characters': '\xC4' },
+ '&Backslash;': { 'codepoints': [0x02216], 'characters': '\u2216' },
+ '&Barv;': { 'codepoints': [0x02AE7], 'characters': '\u2AE7' },
+ '&Barwed;': { 'codepoints': [0x02306], 'characters': '\u2306' },
+ '&Bcy;': { 'codepoints': [0x00411], 'characters': '\u0411' },
+ '&Because;': { 'codepoints': [0x02235], 'characters': '\u2235' },
+ '&Bernoullis;': { 'codepoints': [0x0212C], 'characters': '\u212C' },
+ '&Beta;': { 'codepoints': [0x00392], 'characters': '\u0392' },
+ '&Bfr;': { 'codepoints': [0x1D505], 'characters': '\uD835\uDD05' },
+ '&Bopf;': { 'codepoints': [0x1D539], 'characters': '\uD835\uDD39' },
+ '&Breve;': { 'codepoints': [0x002D8], 'characters': '\u02D8' },
+ '&Bscr;': { 'codepoints': [0x0212C], 'characters': '\u212C' },
+ '&Bumpeq;': { 'codepoints': [0x0224E], 'characters': '\u224E' },
+ '&CHcy;': { 'codepoints': [0x00427], 'characters': '\u0427' },
+ '&COPY': { 'codepoints': [0x000A9], 'characters': '\xA9' },
+ '&COPY;': { 'codepoints': [0x000A9], 'characters': '\xA9' },
+ '&Cacute;': { 'codepoints': [0x00106], 'characters': '\u0106' },
+ '&Cap;': { 'codepoints': [0x022D2], 'characters': '\u22D2' },
+ '&CapitalDifferentialD;': { 'codepoints': [0x02145], 'characters': '\u2145' },
+ '&Cayleys;': { 'codepoints': [0x0212D], 'characters': '\u212D' },
+ '&Ccaron;': { 'codepoints': [0x0010C], 'characters': '\u010C' },
+ '&Ccedil': { 'codepoints': [0x000C7], 'characters': '\xC7' },
+ '&Ccedil;': { 'codepoints': [0x000C7], 'characters': '\xC7' },
+ '&Ccirc;': { 'codepoints': [0x00108], 'characters': '\u0108' },
+ '&Cconint;': { 'codepoints': [0x02230], 'characters': '\u2230' },
+ '&Cdot;': { 'codepoints': [0x0010A], 'characters': '\u010A' },
+ '&Cedilla;': { 'codepoints': [0x000B8], 'characters': '\xB8' },
+ '&CenterDot;': { 'codepoints': [0x000B7], 'characters': '\xB7' },
+ '&Cfr;': { 'codepoints': [0x0212D], 'characters': '\u212D' },
+ '&Chi;': { 'codepoints': [0x003A7], 'characters': '\u03A7' },
+ '&CircleDot;': { 'codepoints': [0x02299], 'characters': '\u2299' },
+ '&CircleMinus;': { 'codepoints': [0x02296], 'characters': '\u2296' },
+ '&CirclePlus;': { 'codepoints': [0x02295], 'characters': '\u2295' },
+ '&CircleTimes;': { 'codepoints': [0x02297], 'characters': '\u2297' },
+ '&ClockwiseContourIntegral;': { 'codepoints': [0x02232], 'characters': '\u2232' },
+ '&CloseCurlyDoubleQuote;': { 'codepoints': [0x0201D], 'characters': '\u201D' },
+ '&CloseCurlyQuote;': { 'codepoints': [0x02019], 'characters': '\u2019' },
+ '&Colon;': { 'codepoints': [0x02237], 'characters': '\u2237' },
+ '&Colone;': { 'codepoints': [0x02A74], 'characters': '\u2A74' },
+ '&Congruent;': { 'codepoints': [0x02261], 'characters': '\u2261' },
+ '&Conint;': { 'codepoints': [0x0222F], 'characters': '\u222F' },
+ '&ContourIntegral;': { 'codepoints': [0x0222E], 'characters': '\u222E' },
+ '&Copf;': { 'codepoints': [0x02102], 'characters': '\u2102' },
+ '&Coproduct;': { 'codepoints': [0x02210], 'characters': '\u2210' },
+ '&CounterClockwiseContourIntegral;': { 'codepoints': [0x02233], 'characters': '\u2233' },
+ '&Cross;': { 'codepoints': [0x02A2F], 'characters': '\u2A2F' },
+ '&Cscr;': { 'codepoints': [0x1D49E], 'characters': '\uD835\uDC9E' },
+ '&Cup;': { 'codepoints': [0x022D3], 'characters': '\u22D3' },
+ '&CupCap;': { 'codepoints': [0x0224D], 'characters': '\u224D' },
+ '&DD;': { 'codepoints': [0x02145], 'characters': '\u2145' },
+ '&DDotrahd;': { 'codepoints': [0x02911], 'characters': '\u2911' },
+ '&DJcy;': { 'codepoints': [0x00402], 'characters': '\u0402' },
+ '&DScy;': { 'codepoints': [0x00405], 'characters': '\u0405' },
+ '&DZcy;': { 'codepoints': [0x0040F], 'characters': '\u040F' },
+ '&Dagger;': { 'codepoints': [0x02021], 'characters': '\u2021' },
+ '&Darr;': { 'codepoints': [0x021A1], 'characters': '\u21A1' },
+ '&Dashv;': { 'codepoints': [0x02AE4], 'characters': '\u2AE4' },
+ '&Dcaron;': { 'codepoints': [0x0010E], 'characters': '\u010E' },
+ '&Dcy;': { 'codepoints': [0x00414], 'characters': '\u0414' },
+ '&Del;': { 'codepoints': [0x02207], 'characters': '\u2207' },
+ '&Delta;': { 'codepoints': [0x00394], 'characters': '\u0394' },
+ '&Dfr;': { 'codepoints': [0x1D507], 'characters': '\uD835\uDD07' },
+ '&DiacriticalAcute;': { 'codepoints': [0x000B4], 'characters': '\xB4' },
+ '&DiacriticalDot;': { 'codepoints': [0x002D9], 'characters': '\u02D9' },
+ '&DiacriticalDoubleAcute;': { 'codepoints': [0x002DD], 'characters': '\u02DD' },
+ '&DiacriticalGrave;': { 'codepoints': [0x00060], 'characters': '\x60' },
+ '&DiacriticalTilde;': { 'codepoints': [0x002DC], 'characters': '\u02DC' },
+ '&Diamond;': { 'codepoints': [0x022C4], 'characters': '\u22C4' },
+ '&DifferentialD;': { 'codepoints': [0x02146], 'characters': '\u2146' },
+ '&Dopf;': { 'codepoints': [0x1D53B], 'characters': '\uD835\uDD3B' },
+ '&Dot;': { 'codepoints': [0x000A8], 'characters': '\xA8' },
+ '&DotDot;': { 'codepoints': [0x020DC], 'characters': '\u20DC' },
+ '&DotEqual;': { 'codepoints': [0x02250], 'characters': '\u2250' },
+ '&DoubleContourIntegral;': { 'codepoints': [0x0222F], 'characters': '\u222F' },
+ '&DoubleDot;': { 'codepoints': [0x000A8], 'characters': '\xA8' },
+ '&DoubleDownArrow;': { 'codepoints': [0x021D3], 'characters': '\u21D3' },
+ '&DoubleLeftArrow;': { 'codepoints': [0x021D0], 'characters': '\u21D0' },
+ '&DoubleLeftRightArrow;': { 'codepoints': [0x021D4], 'characters': '\u21D4' },
+ '&DoubleLeftTee;': { 'codepoints': [0x02AE4], 'characters': '\u2AE4' },
+ '&DoubleLongLeftArrow;': { 'codepoints': [0x027F8], 'characters': '\u27F8' },
+ '&DoubleLongLeftRightArrow;': { 'codepoints': [0x027FA], 'characters': '\u27FA' },
+ '&DoubleLongRightArrow;': { 'codepoints': [0x027F9], 'characters': '\u27F9' },
+ '&DoubleRightArrow;': { 'codepoints': [0x021D2], 'characters': '\u21D2' },
+ '&DoubleRightTee;': { 'codepoints': [0x022A8], 'characters': '\u22A8' },
+ '&DoubleUpArrow;': { 'codepoints': [0x021D1], 'characters': '\u21D1' },
+ '&DoubleUpDownArrow;': { 'codepoints': [0x021D5], 'characters': '\u21D5' },
+ '&DoubleVerticalBar;': { 'codepoints': [0x02225], 'characters': '\u2225' },
+ '&DownArrow;': { 'codepoints': [0x02193], 'characters': '\u2193' },
+ '&DownArrowBar;': { 'codepoints': [0x02913], 'characters': '\u2913' },
+ '&DownArrowUpArrow;': { 'codepoints': [0x021F5], 'characters': '\u21F5' },
+ '&DownBreve;': { 'codepoints': [0x00311], 'characters': '\u0311' },
+ '&DownLeftRightVector;': { 'codepoints': [0x02950], 'characters': '\u2950' },
+ '&DownLeftTeeVector;': { 'codepoints': [0x0295E], 'characters': '\u295E' },
+ '&DownLeftVector;': { 'codepoints': [0x021BD], 'characters': '\u21BD' },
+ '&DownLeftVectorBar;': { 'codepoints': [0x02956], 'characters': '\u2956' },
+ '&DownRightTeeVector;': { 'codepoints': [0x0295F], 'characters': '\u295F' },
+ '&DownRightVector;': { 'codepoints': [0x021C1], 'characters': '\u21C1' },
+ '&DownRightVectorBar;': { 'codepoints': [0x02957], 'characters': '\u2957' },
+ '&DownTee;': { 'codepoints': [0x022A4], 'characters': '\u22A4' },
+ '&DownTeeArrow;': { 'codepoints': [0x021A7], 'characters': '\u21A7' },
+ '&Downarrow;': { 'codepoints': [0x021D3], 'characters': '\u21D3' },
+ '&Dscr;': { 'codepoints': [0x1D49F], 'characters': '\uD835\uDC9F' },
+ '&Dstrok;': { 'codepoints': [0x00110], 'characters': '\u0110' },
+ '&ENG;': { 'codepoints': [0x0014A], 'characters': '\u014A' },
+ '&ETH': { 'codepoints': [0x000D0], 'characters': '\xD0' },
+ '&ETH;': { 'codepoints': [0x000D0], 'characters': '\xD0' },
+ '&Eacute': { 'codepoints': [0x000C9], 'characters': '\xC9' },
+ '&Eacute;': { 'codepoints': [0x000C9], 'characters': '\xC9' },
+ '&Ecaron;': { 'codepoints': [0x0011A], 'characters': '\u011A' },
+ '&Ecirc': { 'codepoints': [0x000CA], 'characters': '\xCA' },
+ '&Ecirc;': { 'codepoints': [0x000CA], 'characters': '\xCA' },
+ '&Ecy;': { 'codepoints': [0x0042D], 'characters': '\u042D' },
+ '&Edot;': { 'codepoints': [0x00116], 'characters': '\u0116' },
+ '&Efr;': { 'codepoints': [0x1D508], 'characters': '\uD835\uDD08' },
+ '&Egrave': { 'codepoints': [0x000C8], 'characters': '\xC8' },
+ '&Egrave;': { 'codepoints': [0x000C8], 'characters': '\xC8' },
+ '&Element;': { 'codepoints': [0x02208], 'characters': '\u2208' },
+ '&Emacr;': { 'codepoints': [0x00112], 'characters': '\u0112' },
+ '&EmptySmallSquare;': { 'codepoints': [0x025FB], 'characters': '\u25FB' },
+ '&EmptyVerySmallSquare;': { 'codepoints': [0x025AB], 'characters': '\u25AB' },
+ '&Eogon;': { 'codepoints': [0x00118], 'characters': '\u0118' },
+ '&Eopf;': { 'codepoints': [0x1D53C], 'characters': '\uD835\uDD3C' },
+ '&Epsilon;': { 'codepoints': [0x00395], 'characters': '\u0395' },
+ '&Equal;': { 'codepoints': [0x02A75], 'characters': '\u2A75' },
+ '&EqualTilde;': { 'codepoints': [0x02242], 'characters': '\u2242' },
+ '&Equilibrium;': { 'codepoints': [0x021CC], 'characters': '\u21CC' },
+ '&Escr;': { 'codepoints': [0x02130], 'characters': '\u2130' },
+ '&Esim;': { 'codepoints': [0x02A73], 'characters': '\u2A73' },
+ '&Eta;': { 'codepoints': [0x00397], 'characters': '\u0397' },
+ '&Euml': { 'codepoints': [0x000CB], 'characters': '\xCB' },
+ '&Euml;': { 'codepoints': [0x000CB], 'characters': '\xCB' },
+ '&Exists;': { 'codepoints': [0x02203], 'characters': '\u2203' },
+ '&ExponentialE;': { 'codepoints': [0x02147], 'characters': '\u2147' },
+ '&Fcy;': { 'codepoints': [0x00424], 'characters': '\u0424' },
+ '&Ffr;': { 'codepoints': [0x1D509], 'characters': '\uD835\uDD09' },
+ '&FilledSmallSquare;': { 'codepoints': [0x025FC], 'characters': '\u25FC' },
+ '&FilledVerySmallSquare;': { 'codepoints': [0x025AA], 'characters': '\u25AA' },
+ '&Fopf;': { 'codepoints': [0x1D53D], 'characters': '\uD835\uDD3D' },
+ '&ForAll;': { 'codepoints': [0x02200], 'characters': '\u2200' },
+ '&Fouriertrf;': { 'codepoints': [0x02131], 'characters': '\u2131' },
+ '&Fscr;': { 'codepoints': [0x02131], 'characters': '\u2131' },
+ '&GJcy;': { 'codepoints': [0x00403], 'characters': '\u0403' },
+ '&GT': { 'codepoints': [0x0003E], 'characters': '\x3E' },
+ '&GT;': { 'codepoints': [0x0003E], 'characters': '\x3E' },
+ '&Gamma;': { 'codepoints': [0x00393], 'characters': '\u0393' },
+ '&Gammad;': { 'codepoints': [0x003DC], 'characters': '\u03DC' },
+ '&Gbreve;': { 'codepoints': [0x0011E], 'characters': '\u011E' },
+ '&Gcedil;': { 'codepoints': [0x00122], 'characters': '\u0122' },
+ '&Gcirc;': { 'codepoints': [0x0011C], 'characters': '\u011C' },
+ '&Gcy;': { 'codepoints': [0x00413], 'characters': '\u0413' },
+ '&Gdot;': { 'codepoints': [0x00120], 'characters': '\u0120' },
+ '&Gfr;': { 'codepoints': [0x1D50A], 'characters': '\uD835\uDD0A' },
+ '&Gg;': { 'codepoints': [0x022D9], 'characters': '\u22D9' },
+ '&Gopf;': { 'codepoints': [0x1D53E], 'characters': '\uD835\uDD3E' },
+ '&GreaterEqual;': { 'codepoints': [0x02265], 'characters': '\u2265' },
+ '&GreaterEqualLess;': { 'codepoints': [0x022DB], 'characters': '\u22DB' },
+ '&GreaterFullEqual;': { 'codepoints': [0x02267], 'characters': '\u2267' },
+ '&GreaterGreater;': { 'codepoints': [0x02AA2], 'characters': '\u2AA2' },
+ '&GreaterLess;': { 'codepoints': [0x02277], 'characters': '\u2277' },
+ '&GreaterSlantEqual;': { 'codepoints': [0x02A7E], 'characters': '\u2A7E' },
+ '&GreaterTilde;': { 'codepoints': [0x02273], 'characters': '\u2273' },
+ '&Gscr;': { 'codepoints': [0x1D4A2], 'characters': '\uD835\uDCA2' },
+ '&Gt;': { 'codepoints': [0x0226B], 'characters': '\u226B' },
+ '&HARDcy;': { 'codepoints': [0x0042A], 'characters': '\u042A' },
+ '&Hacek;': { 'codepoints': [0x002C7], 'characters': '\u02C7' },
+ '&Hat;': { 'codepoints': [0x0005E], 'characters': '\x5E' },
+ '&Hcirc;': { 'codepoints': [0x00124], 'characters': '\u0124' },
+ '&Hfr;': { 'codepoints': [0x0210C], 'characters': '\u210C' },
+ '&HilbertSpace;': { 'codepoints': [0x0210B], 'characters': '\u210B' },
+ '&Hopf;': { 'codepoints': [0x0210D], 'characters': '\u210D' },
+ '&HorizontalLine;': { 'codepoints': [0x02500], 'characters': '\u2500' },
+ '&Hscr;': { 'codepoints': [0x0210B], 'characters': '\u210B' },
+ '&Hstrok;': { 'codepoints': [0x00126], 'characters': '\u0126' },
+ '&HumpDownHump;': { 'codepoints': [0x0224E], 'characters': '\u224E' },
+ '&HumpEqual;': { 'codepoints': [0x0224F], 'characters': '\u224F' },
+ '&IEcy;': { 'codepoints': [0x00415], 'characters': '\u0415' },
+ '&IJlig;': { 'codepoints': [0x00132], 'characters': '\u0132' },
+ '&IOcy;': { 'codepoints': [0x00401], 'characters': '\u0401' },
+ '&Iacute': { 'codepoints': [0x000CD], 'characters': '\xCD' },
+ '&Iacute;': { 'codepoints': [0x000CD], 'characters': '\xCD' },
+ '&Icirc': { 'codepoints': [0x000CE], 'characters': '\xCE' },
+ '&Icirc;': { 'codepoints': [0x000CE], 'characters': '\xCE' },
+ '&Icy;': { 'codepoints': [0x00418], 'characters': '\u0418' },
+ '&Idot;': { 'codepoints': [0x00130], 'characters': '\u0130' },
+ '&Ifr;': { 'codepoints': [0x02111], 'characters': '\u2111' },
+ '&Igrave': { 'codepoints': [0x000CC], 'characters': '\xCC' },
+ '&Igrave;': { 'codepoints': [0x000CC], 'characters': '\xCC' },
+ '&Im;': { 'codepoints': [0x02111], 'characters': '\u2111' },
+ '&Imacr;': { 'codepoints': [0x0012A], 'characters': '\u012A' },
+ '&ImaginaryI;': { 'codepoints': [0x02148], 'characters': '\u2148' },
+ '&Implies;': { 'codepoints': [0x021D2], 'characters': '\u21D2' },
+ '&Int;': { 'codepoints': [0x0222C], 'characters': '\u222C' },
+ '&Integral;': { 'codepoints': [0x0222B], 'characters': '\u222B' },
+ '&Intersection;': { 'codepoints': [0x022C2], 'characters': '\u22C2' },
+ '&InvisibleComma;': { 'codepoints': [0x02063], 'characters': '\u2063' },
+ '&InvisibleTimes;': { 'codepoints': [0x02062], 'characters': '\u2062' },
+ '&Iogon;': { 'codepoints': [0x0012E], 'characters': '\u012E' },
+ '&Iopf;': { 'codepoints': [0x1D540], 'characters': '\uD835\uDD40' },
+ '&Iota;': { 'codepoints': [0x00399], 'characters': '\u0399' },
+ '&Iscr;': { 'codepoints': [0x02110], 'characters': '\u2110' },
+ '&Itilde;': { 'codepoints': [0x00128], 'characters': '\u0128' },
+ '&Iukcy;': { 'codepoints': [0x00406], 'characters': '\u0406' },
+ '&Iuml': { 'codepoints': [0x000CF], 'characters': '\xCF' },
+ '&Iuml;': { 'codepoints': [0x000CF], 'characters': '\xCF' },
+ '&Jcirc;': { 'codepoints': [0x00134], 'characters': '\u0134' },
+ '&Jcy;': { 'codepoints': [0x00419], 'characters': '\u0419' },
+ '&Jfr;': { 'codepoints': [0x1D50D], 'characters': '\uD835\uDD0D' },
+ '&Jopf;': { 'codepoints': [0x1D541], 'characters': '\uD835\uDD41' },
+ '&Jscr;': { 'codepoints': [0x1D4A5], 'characters': '\uD835\uDCA5' },
+ '&Jsercy;': { 'codepoints': [0x00408], 'characters': '\u0408' },
+ '&Jukcy;': { 'codepoints': [0x00404], 'characters': '\u0404' },
+ '&KHcy;': { 'codepoints': [0x00425], 'characters': '\u0425' },
+ '&KJcy;': { 'codepoints': [0x0040C], 'characters': '\u040C' },
+ '&Kappa;': { 'codepoints': [0x0039A], 'characters': '\u039A' },
+ '&Kcedil;': { 'codepoints': [0x00136], 'characters': '\u0136' },
+ '&Kcy;': { 'codepoints': [0x0041A], 'characters': '\u041A' },
+ '&Kfr;': { 'codepoints': [0x1D50E], 'characters': '\uD835\uDD0E' },
+ '&Kopf;': { 'codepoints': [0x1D542], 'characters': '\uD835\uDD42' },
+ '&Kscr;': { 'codepoints': [0x1D4A6], 'characters': '\uD835\uDCA6' },
+ '&LJcy;': { 'codepoints': [0x00409], 'characters': '\u0409' },
+ '&LT': { 'codepoints': [0x0003C], 'characters': '\x3C' },
+ '&LT;': { 'codepoints': [0x0003C], 'characters': '\x3C' },
+ '&Lacute;': { 'codepoints': [0x00139], 'characters': '\u0139' },
+ '&Lambda;': { 'codepoints': [0x0039B], 'characters': '\u039B' },
+ '&Lang;': { 'codepoints': [0x027EA], 'characters': '\u27EA' },
+ '&Laplacetrf;': { 'codepoints': [0x02112], 'characters': '\u2112' },
+ '&Larr;': { 'codepoints': [0x0219E], 'characters': '\u219E' },
+ '&Lcaron;': { 'codepoints': [0x0013D], 'characters': '\u013D' },
+ '&Lcedil;': { 'codepoints': [0x0013B], 'characters': '\u013B' },
+ '&Lcy;': { 'codepoints': [0x0041B], 'characters': '\u041B' },
+ '&LeftAngleBracket;': { 'codepoints': [0x027E8], 'characters': '\u27E8' },
+ '&LeftArrow;': { 'codepoints': [0x02190], 'characters': '\u2190' },
+ '&LeftArrowBar;': { 'codepoints': [0x021E4], 'characters': '\u21E4' },
+ '&LeftArrowRightArrow;': { 'codepoints': [0x021C6], 'characters': '\u21C6' },
+ '&LeftCeiling;': { 'codepoints': [0x02308], 'characters': '\u2308' },
+ '&LeftDoubleBracket;': { 'codepoints': [0x027E6], 'characters': '\u27E6' },
+ '&LeftDownTeeVector;': { 'codepoints': [0x02961], 'characters': '\u2961' },
+ '&LeftDownVector;': { 'codepoints': [0x021C3], 'characters': '\u21C3' },
+ '&LeftDownVectorBar;': { 'codepoints': [0x02959], 'characters': '\u2959' },
+ '&LeftFloor;': { 'codepoints': [0x0230A], 'characters': '\u230A' },
+ '&LeftRightArrow;': { 'codepoints': [0x02194], 'characters': '\u2194' },
+ '&LeftRightVector;': { 'codepoints': [0x0294E], 'characters': '\u294E' },
+ '&LeftTee;': { 'codepoints': [0x022A3], 'characters': '\u22A3' },
+ '&LeftTeeArrow;': { 'codepoints': [0x021A4], 'characters': '\u21A4' },
+ '&LeftTeeVector;': { 'codepoints': [0x0295A], 'characters': '\u295A' },
+ '&LeftTriangle;': { 'codepoints': [0x022B2], 'characters': '\u22B2' },
+ '&LeftTriangleBar;': { 'codepoints': [0x029CF], 'characters': '\u29CF' },
+ '&LeftTriangleEqual;': { 'codepoints': [0x022B4], 'characters': '\u22B4' },
+ '&LeftUpDownVector;': { 'codepoints': [0x02951], 'characters': '\u2951' },
+ '&LeftUpTeeVector;': { 'codepoints': [0x02960], 'characters': '\u2960' },
+ '&LeftUpVector;': { 'codepoints': [0x021BF], 'characters': '\u21BF' },
+ '&LeftUpVectorBar;': { 'codepoints': [0x02958], 'characters': '\u2958' },
+ '&LeftVector;': { 'codepoints': [0x021BC], 'characters': '\u21BC' },
+ '&LeftVectorBar;': { 'codepoints': [0x02952], 'characters': '\u2952' },
+ '&Leftarrow;': { 'codepoints': [0x021D0], 'characters': '\u21D0' },
+ '&Leftrightarrow;': { 'codepoints': [0x021D4], 'characters': '\u21D4' },
+ '&LessEqualGreater;': { 'codepoints': [0x022DA], 'characters': '\u22DA' },
+ '&LessFullEqual;': { 'codepoints': [0x02266], 'characters': '\u2266' },
+ '&LessGreater;': { 'codepoints': [0x02276], 'characters': '\u2276' },
+ '&LessLess;': { 'codepoints': [0x02AA1], 'characters': '\u2AA1' },
+ '&LessSlantEqual;': { 'codepoints': [0x02A7D], 'characters': '\u2A7D' },
+ '&LessTilde;': { 'codepoints': [0x02272], 'characters': '\u2272' },
+ '&Lfr;': { 'codepoints': [0x1D50F], 'characters': '\uD835\uDD0F' },
+ '&Ll;': { 'codepoints': [0x022D8], 'characters': '\u22D8' },
+ '&Lleftarrow;': { 'codepoints': [0x021DA], 'characters': '\u21DA' },
+ '&Lmidot;': { 'codepoints': [0x0013F], 'characters': '\u013F' },
+ '&LongLeftArrow;': { 'codepoints': [0x027F5], 'characters': '\u27F5' },
+ '&LongLeftRightArrow;': { 'codepoints': [0x027F7], 'characters': '\u27F7' },
+ '&LongRightArrow;': { 'codepoints': [0x027F6], 'characters': '\u27F6' },
+ '&Longleftarrow;': { 'codepoints': [0x027F8], 'characters': '\u27F8' },
+ '&Longleftrightarrow;': { 'codepoints': [0x027FA], 'characters': '\u27FA' },
+ '&Longrightarrow;': { 'codepoints': [0x027F9], 'characters': '\u27F9' },
+ '&Lopf;': { 'codepoints': [0x1D543], 'characters': '\uD835\uDD43' },
+ '&LowerLeftArrow;': { 'codepoints': [0x02199], 'characters': '\u2199' },
+ '&LowerRightArrow;': { 'codepoints': [0x02198], 'characters': '\u2198' },
+ '&Lscr;': { 'codepoints': [0x02112], 'characters': '\u2112' },
+ '&Lsh;': { 'codepoints': [0x021B0], 'characters': '\u21B0' },
+ '&Lstrok;': { 'codepoints': [0x00141], 'characters': '\u0141' },
+ '&Lt;': { 'codepoints': [0x0226A], 'characters': '\u226A' },
+ '&Map;': { 'codepoints': [0x02905], 'characters': '\u2905' },
+ '&Mcy;': { 'codepoints': [0x0041C], 'characters': '\u041C' },
+ '&MediumSpace;': { 'codepoints': [0x0205F], 'characters': '\u205F' },
+ '&Mellintrf;': { 'codepoints': [0x02133], 'characters': '\u2133' },
+ '&Mfr;': { 'codepoints': [0x1D510], 'characters': '\uD835\uDD10' },
+ '&MinusPlus;': { 'codepoints': [0x02213], 'characters': '\u2213' },
+ '&Mopf;': { 'codepoints': [0x1D544], 'characters': '\uD835\uDD44' },
+ '&Mscr;': { 'codepoints': [0x02133], 'characters': '\u2133' },
+ '&Mu;': { 'codepoints': [0x0039C], 'characters': '\u039C' },
+ '&NJcy;': { 'codepoints': [0x0040A], 'characters': '\u040A' },
+ '&Nacute;': { 'codepoints': [0x00143], 'characters': '\u0143' },
+ '&Ncaron;': { 'codepoints': [0x00147], 'characters': '\u0147' },
+ '&Ncedil;': { 'codepoints': [0x00145], 'characters': '\u0145' },
+ '&Ncy;': { 'codepoints': [0x0041D], 'characters': '\u041D' },
+ '&NegativeMediumSpace;': { 'codepoints': [0x0200B], 'characters': '\u200B' },
+ '&NegativeThickSpace;': { 'codepoints': [0x0200B], 'characters': '\u200B' },
+ '&NegativeThinSpace;': { 'codepoints': [0x0200B], 'characters': '\u200B' },
+ '&NegativeVeryThinSpace;': { 'codepoints': [0x0200B], 'characters': '\u200B' },
+ '&NestedGreaterGreater;': { 'codepoints': [0x0226B], 'characters': '\u226B' },
+ '&NestedLessLess;': { 'codepoints': [0x0226A], 'characters': '\u226A' },
+ '&NewLine;': { 'codepoints': [0x0000A], 'characters': '\x0A' },
+ '&Nfr;': { 'codepoints': [0x1D511], 'characters': '\uD835\uDD11' },
+ '&NoBreak;': { 'codepoints': [0x02060], 'characters': '\u2060' },
+ '&NonBreakingSpace;': { 'codepoints': [0x000A0], 'characters': '\xA0' },
+ '&Nopf;': { 'codepoints': [0x02115], 'characters': '\u2115' },
+ '&Not;': { 'codepoints': [0x02AEC], 'characters': '\u2AEC' },
+ '&NotCongruent;': { 'codepoints': [0x02262], 'characters': '\u2262' },
+ '&NotCupCap;': { 'codepoints': [0x0226D], 'characters': '\u226D' },
+ '&NotDoubleVerticalBar;': { 'codepoints': [0x02226], 'characters': '\u2226' },
+ '&NotElement;': { 'codepoints': [0x02209], 'characters': '\u2209' },
+ '&NotEqual;': { 'codepoints': [0x02260], 'characters': '\u2260' },
+ '&NotEqualTilde;': { 'codepoints': [0x02242, 0x00338], 'characters': '\u2242\u0338' },
+ '&NotExists;': { 'codepoints': [0x02204], 'characters': '\u2204' },
+ '&NotGreater;': { 'codepoints': [0x0226F], 'characters': '\u226F' },
+ '&NotGreaterEqual;': { 'codepoints': [0x02271], 'characters': '\u2271' },
+ '&NotGreaterFullEqual;': { 'codepoints': [0x02267, 0x00338], 'characters': '\u2267\u0338' },
+ '&NotGreaterGreater;': { 'codepoints': [0x0226B, 0x00338], 'characters': '\u226B\u0338' },
+ '&NotGreaterLess;': { 'codepoints': [0x02279], 'characters': '\u2279' },
+ '&NotGreaterSlantEqual;': { 'codepoints': [0x02A7E, 0x00338], 'characters': '\u2A7E\u0338' },
+ '&NotGreaterTilde;': { 'codepoints': [0x02275], 'characters': '\u2275' },
+ '&NotHumpDownHump;': { 'codepoints': [0x0224E, 0x00338], 'characters': '\u224E\u0338' },
+ '&NotHumpEqual;': { 'codepoints': [0x0224F, 0x00338], 'characters': '\u224F\u0338' },
+ '&NotLeftTriangle;': { 'codepoints': [0x022EA], 'characters': '\u22EA' },
+ '&NotLeftTriangleBar;': { 'codepoints': [0x029CF, 0x00338], 'characters': '\u29CF\u0338' },
+ '&NotLeftTriangleEqual;': { 'codepoints': [0x022EC], 'characters': '\u22EC' },
+ '&NotLess;': { 'codepoints': [0x0226E], 'characters': '\u226E' },
+ '&NotLessEqual;': { 'codepoints': [0x02270], 'characters': '\u2270' },
+ '&NotLessGreater;': { 'codepoints': [0x02278], 'characters': '\u2278' },
+ '&NotLessLess;': { 'codepoints': [0x0226A, 0x00338], 'characters': '\u226A\u0338' },
+ '&NotLessSlantEqual;': { 'codepoints': [0x02A7D, 0x00338], 'characters': '\u2A7D\u0338' },
+ '&NotLessTilde;': { 'codepoints': [0x02274], 'characters': '\u2274' },
+ '&NotNestedGreaterGreater;': { 'codepoints': [0x02AA2, 0x00338], 'characters': '\u2AA2\u0338' },
+ '&NotNestedLessLess;': { 'codepoints': [0x02AA1, 0x00338], 'characters': '\u2AA1\u0338' },
+ '&NotPrecedes;': { 'codepoints': [0x02280], 'characters': '\u2280' },
+ '&NotPrecedesEqual;': { 'codepoints': [0x02AAF, 0x00338], 'characters': '\u2AAF\u0338' },
+ '&NotPrecedesSlantEqual;': { 'codepoints': [0x022E0], 'characters': '\u22E0' },
+ '&NotReverseElement;': { 'codepoints': [0x0220C], 'characters': '\u220C' },
+ '&NotRightTriangle;': { 'codepoints': [0x022EB], 'characters': '\u22EB' },
+ '&NotRightTriangleBar;': { 'codepoints': [0x029D0, 0x00338], 'characters': '\u29D0\u0338' },
+ '&NotRightTriangleEqual;': { 'codepoints': [0x022ED], 'characters': '\u22ED' },
+ '&NotSquareSubset;': { 'codepoints': [0x0228F, 0x00338], 'characters': '\u228F\u0338' },
+ '&NotSquareSubsetEqual;': { 'codepoints': [0x022E2], 'characters': '\u22E2' },
+ '&NotSquareSuperset;': { 'codepoints': [0x02290, 0x00338], 'characters': '\u2290\u0338' },
+ '&NotSquareSupersetEqual;': { 'codepoints': [0x022E3], 'characters': '\u22E3' },
+ '&NotSubset;': { 'codepoints': [0x02282, 0x020D2], 'characters': '\u2282\u20D2' },
+ '&NotSubsetEqual;': { 'codepoints': [0x02288], 'characters': '\u2288' },
+ '&NotSucceeds;': { 'codepoints': [0x02281], 'characters': '\u2281' },
+ '&NotSucceedsEqual;': { 'codepoints': [0x02AB0, 0x00338], 'characters': '\u2AB0\u0338' },
+ '&NotSucceedsSlantEqual;': { 'codepoints': [0x022E1], 'characters': '\u22E1' },
+ '&NotSucceedsTilde;': { 'codepoints': [0x0227F, 0x00338], 'characters': '\u227F\u0338' },
+ '&NotSuperset;': { 'codepoints': [0x02283, 0x020D2], 'characters': '\u2283\u20D2' },
+ '&NotSupersetEqual;': { 'codepoints': [0x02289], 'characters': '\u2289' },
+ '&NotTilde;': { 'codepoints': [0x02241], 'characters': '\u2241' },
+ '&NotTildeEqual;': { 'codepoints': [0x02244], 'characters': '\u2244' },
+ '&NotTildeFullEqual;': { 'codepoints': [0x02247], 'characters': '\u2247' },
+ '&NotTildeTilde;': { 'codepoints': [0x02249], 'characters': '\u2249' },
+ '&NotVerticalBar;': { 'codepoints': [0x02224], 'characters': '\u2224' },
+ '&Nscr;': { 'codepoints': [0x1D4A9], 'characters': '\uD835\uDCA9' },
+ '&Ntilde': { 'codepoints': [0x000D1], 'characters': '\xD1' },
+ '&Ntilde;': { 'codepoints': [0x000D1], 'characters': '\xD1' },
+ '&Nu;': { 'codepoints': [0x0039D], 'characters': '\u039D' },
+ '&OElig;': { 'codepoints': [0x00152], 'characters': '\u0152' },
+ '&Oacute': { 'codepoints': [0x000D3], 'characters': '\xD3' },
+ '&Oacute;': { 'codepoints': [0x000D3], 'characters': '\xD3' },
+ '&Ocirc': { 'codepoints': [0x000D4], 'characters': '\xD4' },
+ '&Ocirc;': { 'codepoints': [0x000D4], 'characters': '\xD4' },
+ '&Ocy;': { 'codepoints': [0x0041E], 'characters': '\u041E' },
+ '&Odblac;': { 'codepoints': [0x00150], 'characters': '\u0150' },
+ '&Ofr;': { 'codepoints': [0x1D512], 'characters': '\uD835\uDD12' },
+ '&Ograve': { 'codepoints': [0x000D2], 'characters': '\xD2' },
+ '&Ograve;': { 'codepoints': [0x000D2], 'characters': '\xD2' },
+ '&Omacr;': { 'codepoints': [0x0014C], 'characters': '\u014C' },
+ '&Omega;': { 'codepoints': [0x003A9], 'characters': '\u03A9' },
+ '&Omicron;': { 'codepoints': [0x0039F], 'characters': '\u039F' },
+ '&Oopf;': { 'codepoints': [0x1D546], 'characters': '\uD835\uDD46' },
+ '&OpenCurlyDoubleQuote;': { 'codepoints': [0x0201C], 'characters': '\u201C' },
+ '&OpenCurlyQuote;': { 'codepoints': [0x02018], 'characters': '\u2018' },
+ '&Or;': { 'codepoints': [0x02A54], 'characters': '\u2A54' },
+ '&Oscr;': { 'codepoints': [0x1D4AA], 'characters': '\uD835\uDCAA' },
+ '&Oslash': { 'codepoints': [0x000D8], 'characters': '\xD8' },
+ '&Oslash;': { 'codepoints': [0x000D8], 'characters': '\xD8' },
+ '&Otilde': { 'codepoints': [0x000D5], 'characters': '\xD5' },
+ '&Otilde;': { 'codepoints': [0x000D5], 'characters': '\xD5' },
+ '&Otimes;': { 'codepoints': [0x02A37], 'characters': '\u2A37' },
+ '&Ouml': { 'codepoints': [0x000D6], 'characters': '\xD6' },
+ '&Ouml;': { 'codepoints': [0x000D6], 'characters': '\xD6' },
+ '&OverBar;': { 'codepoints': [0x0203E], 'characters': '\u203E' },
+ '&OverBrace;': { 'codepoints': [0x023DE], 'characters': '\u23DE' },
+ '&OverBracket;': { 'codepoints': [0x023B4], 'characters': '\u23B4' },
+ '&OverParenthesis;': { 'codepoints': [0x023DC], 'characters': '\u23DC' },
+ '&PartialD;': { 'codepoints': [0x02202], 'characters': '\u2202' },
+ '&Pcy;': { 'codepoints': [0x0041F], 'characters': '\u041F' },
+ '&Pfr;': { 'codepoints': [0x1D513], 'characters': '\uD835\uDD13' },
+ '&Phi;': { 'codepoints': [0x003A6], 'characters': '\u03A6' },
+ '&Pi;': { 'codepoints': [0x003A0], 'characters': '\u03A0' },
+ '&PlusMinus;': { 'codepoints': [0x000B1], 'characters': '\xB1' },
+ '&Poincareplane;': { 'codepoints': [0x0210C], 'characters': '\u210C' },
+ '&Popf;': { 'codepoints': [0x02119], 'characters': '\u2119' },
+ '&Pr;': { 'codepoints': [0x02ABB], 'characters': '\u2ABB' },
+ '&Precedes;': { 'codepoints': [0x0227A], 'characters': '\u227A' },
+ '&PrecedesEqual;': { 'codepoints': [0x02AAF], 'characters': '\u2AAF' },
+ '&PrecedesSlantEqual;': { 'codepoints': [0x0227C], 'characters': '\u227C' },
+ '&PrecedesTilde;': { 'codepoints': [0x0227E], 'characters': '\u227E' },
+ '&Prime;': { 'codepoints': [0x02033], 'characters': '\u2033' },
+ '&Product;': { 'codepoints': [0x0220F], 'characters': '\u220F' },
+ '&Proportion;': { 'codepoints': [0x02237], 'characters': '\u2237' },
+ '&Proportional;': { 'codepoints': [0x0221D], 'characters': '\u221D' },
+ '&Pscr;': { 'codepoints': [0x1D4AB], 'characters': '\uD835\uDCAB' },
+ '&Psi;': { 'codepoints': [0x003A8], 'characters': '\u03A8' },
+ '&QUOT': { 'codepoints': [0x00022], 'characters': '\x22' },
+ '&QUOT;': { 'codepoints': [0x00022], 'characters': '\x22' },
+ '&Qfr;': { 'codepoints': [0x1D514], 'characters': '\uD835\uDD14' },
+ '&Qopf;': { 'codepoints': [0x0211A], 'characters': '\u211A' },
+ '&Qscr;': { 'codepoints': [0x1D4AC], 'characters': '\uD835\uDCAC' },
+ '&RBarr;': { 'codepoints': [0x02910], 'characters': '\u2910' },
+ '&REG': { 'codepoints': [0x000AE], 'characters': '\xAE' },
+ '&REG;': { 'codepoints': [0x000AE], 'characters': '\xAE' },
+ '&Racute;': { 'codepoints': [0x00154], 'characters': '\u0154' },
+ '&Rang;': { 'codepoints': [0x027EB], 'characters': '\u27EB' },
+ '&Rarr;': { 'codepoints': [0x021A0], 'characters': '\u21A0' },
+ '&Rarrtl;': { 'codepoints': [0x02916], 'characters': '\u2916' },
+ '&Rcaron;': { 'codepoints': [0x00158], 'characters': '\u0158' },
+ '&Rcedil;': { 'codepoints': [0x00156], 'characters': '\u0156' },
+ '&Rcy;': { 'codepoints': [0x00420], 'characters': '\u0420' },
+ '&Re;': { 'codepoints': [0x0211C], 'characters': '\u211C' },
+ '&ReverseElement;': { 'codepoints': [0x0220B], 'characters': '\u220B' },
+ '&ReverseEquilibrium;': { 'codepoints': [0x021CB], 'characters': '\u21CB' },
+ '&ReverseUpEquilibrium;': { 'codepoints': [0x0296F], 'characters': '\u296F' },
+ '&Rfr;': { 'codepoints': [0x0211C], 'characters': '\u211C' },
+ '&Rho;': { 'codepoints': [0x003A1], 'characters': '\u03A1' },
+ '&RightAngleBracket;': { 'codepoints': [0x027E9], 'characters': '\u27E9' },
+ '&RightArrow;': { 'codepoints': [0x02192], 'characters': '\u2192' },
+ '&RightArrowBar;': { 'codepoints': [0x021E5], 'characters': '\u21E5' },
+ '&RightArrowLeftArrow;': { 'codepoints': [0x021C4], 'characters': '\u21C4' },
+ '&RightCeiling;': { 'codepoints': [0x02309], 'characters': '\u2309' },
+ '&RightDoubleBracket;': { 'codepoints': [0x027E7], 'characters': '\u27E7' },
+ '&RightDownTeeVector;': { 'codepoints': [0x0295D], 'characters': '\u295D' },
+ '&RightDownVector;': { 'codepoints': [0x021C2], 'characters': '\u21C2' },
+ '&RightDownVectorBar;': { 'codepoints': [0x02955], 'characters': '\u2955' },
+ '&RightFloor;': { 'codepoints': [0x0230B], 'characters': '\u230B' },
+ '&RightTee;': { 'codepoints': [0x022A2], 'characters': '\u22A2' },
+ '&RightTeeArrow;': { 'codepoints': [0x021A6], 'characters': '\u21A6' },
+ '&RightTeeVector;': { 'codepoints': [0x0295B], 'characters': '\u295B' },
+ '&RightTriangle;': { 'codepoints': [0x022B3], 'characters': '\u22B3' },
+ '&RightTriangleBar;': { 'codepoints': [0x029D0], 'characters': '\u29D0' },
+ '&RightTriangleEqual;': { 'codepoints': [0x022B5], 'characters': '\u22B5' },
+ '&RightUpDownVector;': { 'codepoints': [0x0294F], 'characters': '\u294F' },
+ '&RightUpTeeVector;': { 'codepoints': [0x0295C], 'characters': '\u295C' },
+ '&RightUpVector;': { 'codepoints': [0x021BE], 'characters': '\u21BE' },
+ '&RightUpVectorBar;': { 'codepoints': [0x02954], 'characters': '\u2954' },
+ '&RightVector;': { 'codepoints': [0x021C0], 'characters': '\u21C0' },
+ '&RightVectorBar;': { 'codepoints': [0x02953], 'characters': '\u2953' },
+ '&Rightarrow;': { 'codepoints': [0x021D2], 'characters': '\u21D2' },
+ '&Ropf;': { 'codepoints': [0x0211D], 'characters': '\u211D' },
+ '&RoundImplies;': { 'codepoints': [0x02970], 'characters': '\u2970' },
+ '&Rrightarrow;': { 'codepoints': [0x021DB], 'characters': '\u21DB' },
+ '&Rscr;': { 'codepoints': [0x0211B], 'characters': '\u211B' },
+ '&Rsh;': { 'codepoints': [0x021B1], 'characters': '\u21B1' },
+ '&RuleDelayed;': { 'codepoints': [0x029F4], 'characters': '\u29F4' },
+ '&SHCHcy;': { 'codepoints': [0x00429], 'characters': '\u0429' },
+ '&SHcy;': { 'codepoints': [0x00428], 'characters': '\u0428' },
+ '&SOFTcy;': { 'codepoints': [0x0042C], 'characters': '\u042C' },
+ '&Sacute;': { 'codepoints': [0x0015A], 'characters': '\u015A' },
+ '&Sc;': { 'codepoints': [0x02ABC], 'characters': '\u2ABC' },
+ '&Scaron;': { 'codepoints': [0x00160], 'characters': '\u0160' },
+ '&Scedil;': { 'codepoints': [0x0015E], 'characters': '\u015E' },
+ '&Scirc;': { 'codepoints': [0x0015C], 'characters': '\u015C' },
+ '&Scy;': { 'codepoints': [0x00421], 'characters': '\u0421' },
+ '&Sfr;': { 'codepoints': [0x1D516], 'characters': '\uD835\uDD16' },
+ '&ShortDownArrow;': { 'codepoints': [0x02193], 'characters': '\u2193' },
+ '&ShortLeftArrow;': { 'codepoints': [0x02190], 'characters': '\u2190' },
+ '&ShortRightArrow;': { 'codepoints': [0x02192], 'characters': '\u2192' },
+ '&ShortUpArrow;': { 'codepoints': [0x02191], 'characters': '\u2191' },
+ '&Sigma;': { 'codepoints': [0x003A3], 'characters': '\u03A3' },
+ '&SmallCircle;': { 'codepoints': [0x02218], 'characters': '\u2218' },
+ '&Sopf;': { 'codepoints': [0x1D54A], 'characters': '\uD835\uDD4A' },
+ '&Sqrt;': { 'codepoints': [0x0221A], 'characters': '\u221A' },
+ '&Square;': { 'codepoints': [0x025A1], 'characters': '\u25A1' },
+ '&SquareIntersection;': { 'codepoints': [0x02293], 'characters': '\u2293' },
+ '&SquareSubset;': { 'codepoints': [0x0228F], 'characters': '\u228F' },
+ '&SquareSubsetEqual;': { 'codepoints': [0x02291], 'characters': '\u2291' },
+ '&SquareSuperset;': { 'codepoints': [0x02290], 'characters': '\u2290' },
+ '&SquareSupersetEqual;': { 'codepoints': [0x02292], 'characters': '\u2292' },
+ '&SquareUnion;': { 'codepoints': [0x02294], 'characters': '\u2294' },
+ '&Sscr;': { 'codepoints': [0x1D4AE], 'characters': '\uD835\uDCAE' },
+ '&Star;': { 'codepoints': [0x022C6], 'characters': '\u22C6' },
+ '&Sub;': { 'codepoints': [0x022D0], 'characters': '\u22D0' },
+ '&Subset;': { 'codepoints': [0x022D0], 'characters': '\u22D0' },
+ '&SubsetEqual;': { 'codepoints': [0x02286], 'characters': '\u2286' },
+ '&Succeeds;': { 'codepoints': [0x0227B], 'characters': '\u227B' },
+ '&SucceedsEqual;': { 'codepoints': [0x02AB0], 'characters': '\u2AB0' },
+ '&SucceedsSlantEqual;': { 'codepoints': [0x0227D], 'characters': '\u227D' },
+ '&SucceedsTilde;': { 'codepoints': [0x0227F], 'characters': '\u227F' },
+ '&SuchThat;': { 'codepoints': [0x0220B], 'characters': '\u220B' },
+ '&Sum;': { 'codepoints': [0x02211], 'characters': '\u2211' },
+ '&Sup;': { 'codepoints': [0x022D1], 'characters': '\u22D1' },
+ '&Superset;': { 'codepoints': [0x02283], 'characters': '\u2283' },
+ '&SupersetEqual;': { 'codepoints': [0x02287], 'characters': '\u2287' },
+ '&Supset;': { 'codepoints': [0x022D1], 'characters': '\u22D1' },
+ '&THORN': { 'codepoints': [0x000DE], 'characters': '\xDE' },
+ '&THORN;': { 'codepoints': [0x000DE], 'characters': '\xDE' },
+ '&TRADE;': { 'codepoints': [0x02122], 'characters': '\u2122' },
+ '&TSHcy;': { 'codepoints': [0x0040B], 'characters': '\u040B' },
+ '&TScy;': { 'codepoints': [0x00426], 'characters': '\u0426' },
+ '&Tab;': { 'codepoints': [0x00009], 'characters': '\x09' },
+ '&Tau;': { 'codepoints': [0x003A4], 'characters': '\u03A4' },
+ '&Tcaron;': { 'codepoints': [0x00164], 'characters': '\u0164' },
+ '&Tcedil;': { 'codepoints': [0x00162], 'characters': '\u0162' },
+ '&Tcy;': { 'codepoints': [0x00422], 'characters': '\u0422' },
+ '&Tfr;': { 'codepoints': [0x1D517], 'characters': '\uD835\uDD17' },
+ '&Therefore;': { 'codepoints': [0x02234], 'characters': '\u2234' },
+ '&Theta;': { 'codepoints': [0x00398], 'characters': '\u0398' },
+ '&ThickSpace;': { 'codepoints': [0x0205F, 0x0200A], 'characters': '\u205F\u200A' },
+ '&ThinSpace;': { 'codepoints': [0x02009], 'characters': '\u2009' },
+ '&Tilde;': { 'codepoints': [0x0223C], 'characters': '\u223C' },
+ '&TildeEqual;': { 'codepoints': [0x02243], 'characters': '\u2243' },
+ '&TildeFullEqual;': { 'codepoints': [0x02245], 'characters': '\u2245' },
+ '&TildeTilde;': { 'codepoints': [0x02248], 'characters': '\u2248' },
+ '&Topf;': { 'codepoints': [0x1D54B], 'characters': '\uD835\uDD4B' },
+ '&TripleDot;': { 'codepoints': [0x020DB], 'characters': '\u20DB' },
+ '&Tscr;': { 'codepoints': [0x1D4AF], 'characters': '\uD835\uDCAF' },
+ '&Tstrok;': { 'codepoints': [0x00166], 'characters': '\u0166' },
+ '&Uacute': { 'codepoints': [0x000DA], 'characters': '\xDA' },
+ '&Uacute;': { 'codepoints': [0x000DA], 'characters': '\xDA' },
+ '&Uarr;': { 'codepoints': [0x0219F], 'characters': '\u219F' },
+ '&Uarrocir;': { 'codepoints': [0x02949], 'characters': '\u2949' },
+ '&Ubrcy;': { 'codepoints': [0x0040E], 'characters': '\u040E' },
+ '&Ubreve;': { 'codepoints': [0x0016C], 'characters': '\u016C' },
+ '&Ucirc': { 'codepoints': [0x000DB], 'characters': '\xDB' },
+ '&Ucirc;': { 'codepoints': [0x000DB], 'characters': '\xDB' },
+ '&Ucy;': { 'codepoints': [0x00423], 'characters': '\u0423' },
+ '&Udblac;': { 'codepoints': [0x00170], 'characters': '\u0170' },
+ '&Ufr;': { 'codepoints': [0x1D518], 'characters': '\uD835\uDD18' },
+ '&Ugrave': { 'codepoints': [0x000D9], 'characters': '\xD9' },
+ '&Ugrave;': { 'codepoints': [0x000D9], 'characters': '\xD9' },
+ '&Umacr;': { 'codepoints': [0x0016A], 'characters': '\u016A' },
+ '&UnderBar;': { 'codepoints': [0x0005F], 'characters': '\x5F' },
+ '&UnderBrace;': { 'codepoints': [0x023DF], 'characters': '\u23DF' },
+ '&UnderBracket;': { 'codepoints': [0x023B5], 'characters': '\u23B5' },
+ '&UnderParenthesis;': { 'codepoints': [0x023DD], 'characters': '\u23DD' },
+ '&Union;': { 'codepoints': [0x022C3], 'characters': '\u22C3' },
+ '&UnionPlus;': { 'codepoints': [0x0228E], 'characters': '\u228E' },
+ '&Uogon;': { 'codepoints': [0x00172], 'characters': '\u0172' },
+ '&Uopf;': { 'codepoints': [0x1D54C], 'characters': '\uD835\uDD4C' },
+ '&UpArrow;': { 'codepoints': [0x02191], 'characters': '\u2191' },
+ '&UpArrowBar;': { 'codepoints': [0x02912], 'characters': '\u2912' },
+ '&UpArrowDownArrow;': { 'codepoints': [0x021C5], 'characters': '\u21C5' },
+ '&UpDownArrow;': { 'codepoints': [0x02195], 'characters': '\u2195' },
+ '&UpEquilibrium;': { 'codepoints': [0x0296E], 'characters': '\u296E' },
+ '&UpTee;': { 'codepoints': [0x022A5], 'characters': '\u22A5' },
+ '&UpTeeArrow;': { 'codepoints': [0x021A5], 'characters': '\u21A5' },
+ '&Uparrow;': { 'codepoints': [0x021D1], 'characters': '\u21D1' },
+ '&Updownarrow;': { 'codepoints': [0x021D5], 'characters': '\u21D5' },
+ '&UpperLeftArrow;': { 'codepoints': [0x02196], 'characters': '\u2196' },
+ '&UpperRightArrow;': { 'codepoints': [0x02197], 'characters': '\u2197' },
+ '&Upsi;': { 'codepoints': [0x003D2], 'characters': '\u03D2' },
+ '&Upsilon;': { 'codepoints': [0x003A5], 'characters': '\u03A5' },
+ '&Uring;': { 'codepoints': [0x0016E], 'characters': '\u016E' },
+ '&Uscr;': { 'codepoints': [0x1D4B0], 'characters': '\uD835\uDCB0' },
+ '&Utilde;': { 'codepoints': [0x00168], 'characters': '\u0168' },
+ '&Uuml': { 'codepoints': [0x000DC], 'characters': '\xDC' },
+ '&Uuml;': { 'codepoints': [0x000DC], 'characters': '\xDC' },
+ '&VDash;': { 'codepoints': [0x022AB], 'characters': '\u22AB' },
+ '&Vbar;': { 'codepoints': [0x02AEB], 'characters': '\u2AEB' },
+ '&Vcy;': { 'codepoints': [0x00412], 'characters': '\u0412' },
+ '&Vdash;': { 'codepoints': [0x022A9], 'characters': '\u22A9' },
+ '&Vdashl;': { 'codepoints': [0x02AE6], 'characters': '\u2AE6' },
+ '&Vee;': { 'codepoints': [0x022C1], 'characters': '\u22C1' },
+ '&Verbar;': { 'codepoints': [0x02016], 'characters': '\u2016' },
+ '&Vert;': { 'codepoints': [0x02016], 'characters': '\u2016' },
+ '&VerticalBar;': { 'codepoints': [0x02223], 'characters': '\u2223' },
+ '&VerticalLine;': { 'codepoints': [0x0007C], 'characters': '\x7C' },
+ '&VerticalSeparator;': { 'codepoints': [0x02758], 'characters': '\u2758' },
+ '&VerticalTilde;': { 'codepoints': [0x02240], 'characters': '\u2240' },
+ '&VeryThinSpace;': { 'codepoints': [0x0200A], 'characters': '\u200A' },
+ '&Vfr;': { 'codepoints': [0x1D519], 'characters': '\uD835\uDD19' },
+ '&Vopf;': { 'codepoints': [0x1D54D], 'characters': '\uD835\uDD4D' },
+ '&Vscr;': { 'codepoints': [0x1D4B1], 'characters': '\uD835\uDCB1' },
+ '&Vvdash;': { 'codepoints': [0x022AA], 'characters': '\u22AA' },
+ '&Wcirc;': { 'codepoints': [0x00174], 'characters': '\u0174' },
+ '&Wedge;': { 'codepoints': [0x022C0], 'characters': '\u22C0' },
+ '&Wfr;': { 'codepoints': [0x1D51A], 'characters': '\uD835\uDD1A' },
+ '&Wopf;': { 'codepoints': [0x1D54E], 'characters': '\uD835\uDD4E' },
+ '&Wscr;': { 'codepoints': [0x1D4B2], 'characters': '\uD835\uDCB2' },
+ '&Xfr;': { 'codepoints': [0x1D51B], 'characters': '\uD835\uDD1B' },
+ '&Xi;': { 'codepoints': [0x0039E], 'characters': '\u039E' },
+ '&Xopf;': { 'codepoints': [0x1D54F], 'characters': '\uD835\uDD4F' },
+ '&Xscr;': { 'codepoints': [0x1D4B3], 'characters': '\uD835\uDCB3' },
+ '&YAcy;': { 'codepoints': [0x0042F], 'characters': '\u042F' },
+ '&YIcy;': { 'codepoints': [0x00407], 'characters': '\u0407' },
+ '&YUcy;': { 'codepoints': [0x0042E], 'characters': '\u042E' },
+ '&Yacute': { 'codepoints': [0x000DD], 'characters': '\xDD' },
+ '&Yacute;': { 'codepoints': [0x000DD], 'characters': '\xDD' },
+ '&Ycirc;': { 'codepoints': [0x00176], 'characters': '\u0176' },
+ '&Ycy;': { 'codepoints': [0x0042B], 'characters': '\u042B' },
+ '&Yfr;': { 'codepoints': [0x1D51C], 'characters': '\uD835\uDD1C' },
+ '&Yopf;': { 'codepoints': [0x1D550], 'characters': '\uD835\uDD50' },
+ '&Yscr;': { 'codepoints': [0x1D4B4], 'characters': '\uD835\uDCB4' },
+ '&Yuml;': { 'codepoints': [0x00178], 'characters': '\u0178' },
+ '&ZHcy;': { 'codepoints': [0x00416], 'characters': '\u0416' },
+ '&Zacute;': { 'codepoints': [0x00179], 'characters': '\u0179' },
+ '&Zcaron;': { 'codepoints': [0x0017D], 'characters': '\u017D' },
+ '&Zcy;': { 'codepoints': [0x00417], 'characters': '\u0417' },
+ '&Zdot;': { 'codepoints': [0x0017B], 'characters': '\u017B' },
+ '&ZeroWidthSpace;': { 'codepoints': [0x0200B], 'characters': '\u200B' },
+ '&Zeta;': { 'codepoints': [0x00396], 'characters': '\u0396' },
+ '&Zfr;': { 'codepoints': [0x02128], 'characters': '\u2128' },
+ '&Zopf;': { 'codepoints': [0x02124], 'characters': '\u2124' },
+ '&Zscr;': { 'codepoints': [0x1D4B5], 'characters': '\uD835\uDCB5' },
+ '&aacute': { 'codepoints': [0x000E1], 'characters': '\xE1' },
+ '&aacute;': { 'codepoints': [0x000E1], 'characters': '\xE1' },
+ '&abreve;': { 'codepoints': [0x00103], 'characters': '\u0103' },
+ '&ac;': { 'codepoints': [0x0223E], 'characters': '\u223E' },
+ '&acE;': { 'codepoints': [0x0223E, 0x00333], 'characters': '\u223E\u0333' },
+ '&acd;': { 'codepoints': [0x0223F], 'characters': '\u223F' },
+ '&acirc': { 'codepoints': [0x000E2], 'characters': '\xE2' },
+ '&acirc;': { 'codepoints': [0x000E2], 'characters': '\xE2' },
+ '&acute': { 'codepoints': [0x000B4], 'characters': '\xB4' },
+ '&acute;': { 'codepoints': [0x000B4], 'characters': '\xB4' },
+ '&acy;': { 'codepoints': [0x00430], 'characters': '\u0430' },
+ '&aelig': { 'codepoints': [0x000E6], 'characters': '\xE6' },
+ '&aelig;': { 'codepoints': [0x000E6], 'characters': '\xE6' },
+ '&af;': { 'codepoints': [0x02061], 'characters': '\u2061' },
+ '&afr;': { 'codepoints': [0x1D51E], 'characters': '\uD835\uDD1E' },
+ '&agrave': { 'codepoints': [0x000E0], 'characters': '\xE0' },
+ '&agrave;': { 'codepoints': [0x000E0], 'characters': '\xE0' },
+ '&alefsym;': { 'codepoints': [0x02135], 'characters': '\u2135' },
+ '&aleph;': { 'codepoints': [0x02135], 'characters': '\u2135' },
+ '&alpha;': { 'codepoints': [0x003B1], 'characters': '\u03B1' },
+ '&amacr;': { 'codepoints': [0x00101], 'characters': '\u0101' },
+ '&amalg;': { 'codepoints': [0x02A3F], 'characters': '\u2A3F' },
+ '&amp': { 'codepoints': [0x00026], 'characters': '\x26' },
+ '&amp;': { 'codepoints': [0x00026], 'characters': '\x26' },
+ '&and;': { 'codepoints': [0x02227], 'characters': '\u2227' },
+ '&andand;': { 'codepoints': [0x02A55], 'characters': '\u2A55' },
+ '&andd;': { 'codepoints': [0x02A5C], 'characters': '\u2A5C' },
+ '&andslope;': { 'codepoints': [0x02A58], 'characters': '\u2A58' },
+ '&andv;': { 'codepoints': [0x02A5A], 'characters': '\u2A5A' },
+ '&ang;': { 'codepoints': [0x02220], 'characters': '\u2220' },
+ '&ange;': { 'codepoints': [0x029A4], 'characters': '\u29A4' },
+ '&angle;': { 'codepoints': [0x02220], 'characters': '\u2220' },
+ '&angmsd;': { 'codepoints': [0x02221], 'characters': '\u2221' },
+ '&angmsdaa;': { 'codepoints': [0x029A8], 'characters': '\u29A8' },
+ '&angmsdab;': { 'codepoints': [0x029A9], 'characters': '\u29A9' },
+ '&angmsdac;': { 'codepoints': [0x029AA], 'characters': '\u29AA' },
+ '&angmsdad;': { 'codepoints': [0x029AB], 'characters': '\u29AB' },
+ '&angmsdae;': { 'codepoints': [0x029AC], 'characters': '\u29AC' },
+ '&angmsdaf;': { 'codepoints': [0x029AD], 'characters': '\u29AD' },
+ '&angmsdag;': { 'codepoints': [0x029AE], 'characters': '\u29AE' },
+ '&angmsdah;': { 'codepoints': [0x029AF], 'characters': '\u29AF' },
+ '&angrt;': { 'codepoints': [0x0221F], 'characters': '\u221F' },
+ '&angrtvb;': { 'codepoints': [0x022BE], 'characters': '\u22BE' },
+ '&angrtvbd;': { 'codepoints': [0x0299D], 'characters': '\u299D' },
+ '&angsph;': { 'codepoints': [0x02222], 'characters': '\u2222' },
+ '&angst;': { 'codepoints': [0x000C5], 'characters': '\xC5' },
+ '&angzarr;': { 'codepoints': [0x0237C], 'characters': '\u237C' },
+ '&aogon;': { 'codepoints': [0x00105], 'characters': '\u0105' },
+ '&aopf;': { 'codepoints': [0x1D552], 'characters': '\uD835\uDD52' },
+ '&ap;': { 'codepoints': [0x02248], 'characters': '\u2248' },
+ '&apE;': { 'codepoints': [0x02A70], 'characters': '\u2A70' },
+ '&apacir;': { 'codepoints': [0x02A6F], 'characters': '\u2A6F' },
+ '&ape;': { 'codepoints': [0x0224A], 'characters': '\u224A' },
+ '&apid;': { 'codepoints': [0x0224B], 'characters': '\u224B' },
+ '&apos;': { 'codepoints': [0x00027], 'characters': '\x27' },
+ '&approx;': { 'codepoints': [0x02248], 'characters': '\u2248' },
+ '&approxeq;': { 'codepoints': [0x0224A], 'characters': '\u224A' },
+ '&aring': { 'codepoints': [0x000E5], 'characters': '\xE5' },
+ '&aring;': { 'codepoints': [0x000E5], 'characters': '\xE5' },
+ '&ascr;': { 'codepoints': [0x1D4B6], 'characters': '\uD835\uDCB6' },
+ '&ast;': { 'codepoints': [0x0002A], 'characters': '\x2A' },
+ '&asymp;': { 'codepoints': [0x02248], 'characters': '\u2248' },
+ '&asympeq;': { 'codepoints': [0x0224D], 'characters': '\u224D' },
+ '&atilde': { 'codepoints': [0x000E3], 'characters': '\xE3' },
+ '&atilde;': { 'codepoints': [0x000E3], 'characters': '\xE3' },
+ '&auml': { 'codepoints': [0x000E4], 'characters': '\xE4' },
+ '&auml;': { 'codepoints': [0x000E4], 'characters': '\xE4' },
+ '&awconint;': { 'codepoints': [0x02233], 'characters': '\u2233' },
+ '&awint;': { 'codepoints': [0x02A11], 'characters': '\u2A11' },
+ '&bNot;': { 'codepoints': [0x02AED], 'characters': '\u2AED' },
+ '&backcong;': { 'codepoints': [0x0224C], 'characters': '\u224C' },
+ '&backepsilon;': { 'codepoints': [0x003F6], 'characters': '\u03F6' },
+ '&backprime;': { 'codepoints': [0x02035], 'characters': '\u2035' },
+ '&backsim;': { 'codepoints': [0x0223D], 'characters': '\u223D' },
+ '&backsimeq;': { 'codepoints': [0x022CD], 'characters': '\u22CD' },
+ '&barvee;': { 'codepoints': [0x022BD], 'characters': '\u22BD' },
+ '&barwed;': { 'codepoints': [0x02305], 'characters': '\u2305' },
+ '&barwedge;': { 'codepoints': [0x02305], 'characters': '\u2305' },
+ '&bbrk;': { 'codepoints': [0x023B5], 'characters': '\u23B5' },
+ '&bbrktbrk;': { 'codepoints': [0x023B6], 'characters': '\u23B6' },
+ '&bcong;': { 'codepoints': [0x0224C], 'characters': '\u224C' },
+ '&bcy;': { 'codepoints': [0x00431], 'characters': '\u0431' },
+ '&bdquo;': { 'codepoints': [0x0201E], 'characters': '\u201E' },
+ '&becaus;': { 'codepoints': [0x02235], 'characters': '\u2235' },
+ '&because;': { 'codepoints': [0x02235], 'characters': '\u2235' },
+ '&bemptyv;': { 'codepoints': [0x029B0], 'characters': '\u29B0' },
+ '&bepsi;': { 'codepoints': [0x003F6], 'characters': '\u03F6' },
+ '&bernou;': { 'codepoints': [0x0212C], 'characters': '\u212C' },
+ '&beta;': { 'codepoints': [0x003B2], 'characters': '\u03B2' },
+ '&beth;': { 'codepoints': [0x02136], 'characters': '\u2136' },
+ '&between;': { 'codepoints': [0x0226C], 'characters': '\u226C' },
+ '&bfr;': { 'codepoints': [0x1D51F], 'characters': '\uD835\uDD1F' },
+ '&bigcap;': { 'codepoints': [0x022C2], 'characters': '\u22C2' },
+ '&bigcirc;': { 'codepoints': [0x025EF], 'characters': '\u25EF' },
+ '&bigcup;': { 'codepoints': [0x022C3], 'characters': '\u22C3' },
+ '&bigodot;': { 'codepoints': [0x02A00], 'characters': '\u2A00' },
+ '&bigoplus;': { 'codepoints': [0x02A01], 'characters': '\u2A01' },
+ '&bigotimes;': { 'codepoints': [0x02A02], 'characters': '\u2A02' },
+ '&bigsqcup;': { 'codepoints': [0x02A06], 'characters': '\u2A06' },
+ '&bigstar;': { 'codepoints': [0x02605], 'characters': '\u2605' },
+ '&bigtriangledown;': { 'codepoints': [0x025BD], 'characters': '\u25BD' },
+ '&bigtriangleup;': { 'codepoints': [0x025B3], 'characters': '\u25B3' },
+ '&biguplus;': { 'codepoints': [0x02A04], 'characters': '\u2A04' },
+ '&bigvee;': { 'codepoints': [0x022C1], 'characters': '\u22C1' },
+ '&bigwedge;': { 'codepoints': [0x022C0], 'characters': '\u22C0' },
+ '&bkarow;': { 'codepoints': [0x0290D], 'characters': '\u290D' },
+ '&blacklozenge;': { 'codepoints': [0x029EB], 'characters': '\u29EB' },
+ '&blacksquare;': { 'codepoints': [0x025AA], 'characters': '\u25AA' },
+ '&blacktriangle;': { 'codepoints': [0x025B4], 'characters': '\u25B4' },
+ '&blacktriangledown;': { 'codepoints': [0x025BE], 'characters': '\u25BE' },
+ '&blacktriangleleft;': { 'codepoints': [0x025C2], 'characters': '\u25C2' },
+ '&blacktriangleright;': { 'codepoints': [0x025B8], 'characters': '\u25B8' },
+ '&blank;': { 'codepoints': [0x02423], 'characters': '\u2423' },
+ '&blk12;': { 'codepoints': [0x02592], 'characters': '\u2592' },
+ '&blk14;': { 'codepoints': [0x02591], 'characters': '\u2591' },
+ '&blk34;': { 'codepoints': [0x02593], 'characters': '\u2593' },
+ '&block;': { 'codepoints': [0x02588], 'characters': '\u2588' },
+ '&bne;': { 'codepoints': [0x0003D, 0x020E5], 'characters': '\x3D\u20E5' },
+ '&bnequiv;': { 'codepoints': [0x02261, 0x020E5], 'characters': '\u2261\u20E5' },
+ '&bnot;': { 'codepoints': [0x02310], 'characters': '\u2310' },
+ '&bopf;': { 'codepoints': [0x1D553], 'characters': '\uD835\uDD53' },
+ '&bot;': { 'codepoints': [0x022A5], 'characters': '\u22A5' },
+ '&bottom;': { 'codepoints': [0x022A5], 'characters': '\u22A5' },
+ '&bowtie;': { 'codepoints': [0x022C8], 'characters': '\u22C8' },
+ '&boxDL;': { 'codepoints': [0x02557], 'characters': '\u2557' },
+ '&boxDR;': { 'codepoints': [0x02554], 'characters': '\u2554' },
+ '&boxDl;': { 'codepoints': [0x02556], 'characters': '\u2556' },
+ '&boxDr;': { 'codepoints': [0x02553], 'characters': '\u2553' },
+ '&boxH;': { 'codepoints': [0x02550], 'characters': '\u2550' },
+ '&boxHD;': { 'codepoints': [0x02566], 'characters': '\u2566' },
+ '&boxHU;': { 'codepoints': [0x02569], 'characters': '\u2569' },
+ '&boxHd;': { 'codepoints': [0x02564], 'characters': '\u2564' },
+ '&boxHu;': { 'codepoints': [0x02567], 'characters': '\u2567' },
+ '&boxUL;': { 'codepoints': [0x0255D], 'characters': '\u255D' },
+ '&boxUR;': { 'codepoints': [0x0255A], 'characters': '\u255A' },
+ '&boxUl;': { 'codepoints': [0x0255C], 'characters': '\u255C' },
+ '&boxUr;': { 'codepoints': [0x02559], 'characters': '\u2559' },
+ '&boxV;': { 'codepoints': [0x02551], 'characters': '\u2551' },
+ '&boxVH;': { 'codepoints': [0x0256C], 'characters': '\u256C' },
+ '&boxVL;': { 'codepoints': [0x02563], 'characters': '\u2563' },
+ '&boxVR;': { 'codepoints': [0x02560], 'characters': '\u2560' },
+ '&boxVh;': { 'codepoints': [0x0256B], 'characters': '\u256B' },
+ '&boxVl;': { 'codepoints': [0x02562], 'characters': '\u2562' },
+ '&boxVr;': { 'codepoints': [0x0255F], 'characters': '\u255F' },
+ '&boxbox;': { 'codepoints': [0x029C9], 'characters': '\u29C9' },
+ '&boxdL;': { 'codepoints': [0x02555], 'characters': '\u2555' },
+ '&boxdR;': { 'codepoints': [0x02552], 'characters': '\u2552' },
+ '&boxdl;': { 'codepoints': [0x02510], 'characters': '\u2510' },
+ '&boxdr;': { 'codepoints': [0x0250C], 'characters': '\u250C' },
+ '&boxh;': { 'codepoints': [0x02500], 'characters': '\u2500' },
+ '&boxhD;': { 'codepoints': [0x02565], 'characters': '\u2565' },
+ '&boxhU;': { 'codepoints': [0x02568], 'characters': '\u2568' },
+ '&boxhd;': { 'codepoints': [0x0252C], 'characters': '\u252C' },
+ '&boxhu;': { 'codepoints': [0x02534], 'characters': '\u2534' },
+ '&boxminus;': { 'codepoints': [0x0229F], 'characters': '\u229F' },
+ '&boxplus;': { 'codepoints': [0x0229E], 'characters': '\u229E' },
+ '&boxtimes;': { 'codepoints': [0x022A0], 'characters': '\u22A0' },
+ '&boxuL;': { 'codepoints': [0x0255B], 'characters': '\u255B' },
+ '&boxuR;': { 'codepoints': [0x02558], 'characters': '\u2558' },
+ '&boxul;': { 'codepoints': [0x02518], 'characters': '\u2518' },
+ '&boxur;': { 'codepoints': [0x02514], 'characters': '\u2514' },
+ '&boxv;': { 'codepoints': [0x02502], 'characters': '\u2502' },
+ '&boxvH;': { 'codepoints': [0x0256A], 'characters': '\u256A' },
+ '&boxvL;': { 'codepoints': [0x02561], 'characters': '\u2561' },
+ '&boxvR;': { 'codepoints': [0x0255E], 'characters': '\u255E' },
+ '&boxvh;': { 'codepoints': [0x0253C], 'characters': '\u253C' },
+ '&boxvl;': { 'codepoints': [0x02524], 'characters': '\u2524' },
+ '&boxvr;': { 'codepoints': [0x0251C], 'characters': '\u251C' },
+ '&bprime;': { 'codepoints': [0x02035], 'characters': '\u2035' },
+ '&breve;': { 'codepoints': [0x002D8], 'characters': '\u02D8' },
+ '&brvbar': { 'codepoints': [0x000A6], 'characters': '\xA6' },
+ '&brvbar;': { 'codepoints': [0x000A6], 'characters': '\xA6' },
+ '&bscr;': { 'codepoints': [0x1D4B7], 'characters': '\uD835\uDCB7' },
+ '&bsemi;': { 'codepoints': [0x0204F], 'characters': '\u204F' },
+ '&bsim;': { 'codepoints': [0x0223D], 'characters': '\u223D' },
+ '&bsime;': { 'codepoints': [0x022CD], 'characters': '\u22CD' },
+ '&bsol;': { 'codepoints': [0x0005C], 'characters': '\x5C' },
+ '&bsolb;': { 'codepoints': [0x029C5], 'characters': '\u29C5' },
+ '&bsolhsub;': { 'codepoints': [0x027C8], 'characters': '\u27C8' },
+ '&bull;': { 'codepoints': [0x02022], 'characters': '\u2022' },
+ '&bullet;': { 'codepoints': [0x02022], 'characters': '\u2022' },
+ '&bump;': { 'codepoints': [0x0224E], 'characters': '\u224E' },
+ '&bumpE;': { 'codepoints': [0x02AAE], 'characters': '\u2AAE' },
+ '&bumpe;': { 'codepoints': [0x0224F], 'characters': '\u224F' },
+ '&bumpeq;': { 'codepoints': [0x0224F], 'characters': '\u224F' },
+ '&cacute;': { 'codepoints': [0x00107], 'characters': '\u0107' },
+ '&cap;': { 'codepoints': [0x02229], 'characters': '\u2229' },
+ '&capand;': { 'codepoints': [0x02A44], 'characters': '\u2A44' },
+ '&capbrcup;': { 'codepoints': [0x02A49], 'characters': '\u2A49' },
+ '&capcap;': { 'codepoints': [0x02A4B], 'characters': '\u2A4B' },
+ '&capcup;': { 'codepoints': [0x02A47], 'characters': '\u2A47' },
+ '&capdot;': { 'codepoints': [0x02A40], 'characters': '\u2A40' },
+ '&caps;': { 'codepoints': [0x02229, 0x0FE00], 'characters': '\u2229\uFE00' },
+ '&caret;': { 'codepoints': [0x02041], 'characters': '\u2041' },
+ '&caron;': { 'codepoints': [0x002C7], 'characters': '\u02C7' },
+ '&ccaps;': { 'codepoints': [0x02A4D], 'characters': '\u2A4D' },
+ '&ccaron;': { 'codepoints': [0x0010D], 'characters': '\u010D' },
+ '&ccedil': { 'codepoints': [0x000E7], 'characters': '\xE7' },
+ '&ccedil;': { 'codepoints': [0x000E7], 'characters': '\xE7' },
+ '&ccirc;': { 'codepoints': [0x00109], 'characters': '\u0109' },
+ '&ccups;': { 'codepoints': [0x02A4C], 'characters': '\u2A4C' },
+ '&ccupssm;': { 'codepoints': [0x02A50], 'characters': '\u2A50' },
+ '&cdot;': { 'codepoints': [0x0010B], 'characters': '\u010B' },
+ '&cedil': { 'codepoints': [0x000B8], 'characters': '\xB8' },
+ '&cedil;': { 'codepoints': [0x000B8], 'characters': '\xB8' },
+ '&cemptyv;': { 'codepoints': [0x029B2], 'characters': '\u29B2' },
+ '&cent': { 'codepoints': [0x000A2], 'characters': '\xA2' },
+ '&cent;': { 'codepoints': [0x000A2], 'characters': '\xA2' },
+ '&centerdot;': { 'codepoints': [0x000B7], 'characters': '\xB7' },
+ '&cfr;': { 'codepoints': [0x1D520], 'characters': '\uD835\uDD20' },
+ '&chcy;': { 'codepoints': [0x00447], 'characters': '\u0447' },
+ '&check;': { 'codepoints': [0x02713], 'characters': '\u2713' },
+ '&checkmark;': { 'codepoints': [0x02713], 'characters': '\u2713' },
+ '&chi;': { 'codepoints': [0x003C7], 'characters': '\u03C7' },
+ '&cir;': { 'codepoints': [0x025CB], 'characters': '\u25CB' },
+ '&cirE;': { 'codepoints': [0x029C3], 'characters': '\u29C3' },
+ '&circ;': { 'codepoints': [0x002C6], 'characters': '\u02C6' },
+ '&circeq;': { 'codepoints': [0x02257], 'characters': '\u2257' },
+ '&circlearrowleft;': { 'codepoints': [0x021BA], 'characters': '\u21BA' },
+ '&circlearrowright;': { 'codepoints': [0x021BB], 'characters': '\u21BB' },
+ '&circledR;': { 'codepoints': [0x000AE], 'characters': '\xAE' },
+ '&circledS;': { 'codepoints': [0x024C8], 'characters': '\u24C8' },
+ '&circledast;': { 'codepoints': [0x0229B], 'characters': '\u229B' },
+ '&circledcirc;': { 'codepoints': [0x0229A], 'characters': '\u229A' },
+ '&circleddash;': { 'codepoints': [0x0229D], 'characters': '\u229D' },
+ '&cire;': { 'codepoints': [0x02257], 'characters': '\u2257' },
+ '&cirfnint;': { 'codepoints': [0x02A10], 'characters': '\u2A10' },
+ '&cirmid;': { 'codepoints': [0x02AEF], 'characters': '\u2AEF' },
+ '&cirscir;': { 'codepoints': [0x029C2], 'characters': '\u29C2' },
+ '&clubs;': { 'codepoints': [0x02663], 'characters': '\u2663' },
+ '&clubsuit;': { 'codepoints': [0x02663], 'characters': '\u2663' },
+ '&colon;': { 'codepoints': [0x0003A], 'characters': '\x3A' },
+ '&colone;': { 'codepoints': [0x02254], 'characters': '\u2254' },
+ '&coloneq;': { 'codepoints': [0x02254], 'characters': '\u2254' },
+ '&comma;': { 'codepoints': [0x0002C], 'characters': '\x2C' },
+ '&commat;': { 'codepoints': [0x00040], 'characters': '\x40' },
+ '&comp;': { 'codepoints': [0x02201], 'characters': '\u2201' },
+ '&compfn;': { 'codepoints': [0x02218], 'characters': '\u2218' },
+ '&complement;': { 'codepoints': [0x02201], 'characters': '\u2201' },
+ '&complexes;': { 'codepoints': [0x02102], 'characters': '\u2102' },
+ '&cong;': { 'codepoints': [0x02245], 'characters': '\u2245' },
+ '&congdot;': { 'codepoints': [0x02A6D], 'characters': '\u2A6D' },
+ '&conint;': { 'codepoints': [0x0222E], 'characters': '\u222E' },
+ '&copf;': { 'codepoints': [0x1D554], 'characters': '\uD835\uDD54' },
+ '&coprod;': { 'codepoints': [0x02210], 'characters': '\u2210' },
+ '&copy': { 'codepoints': [0x000A9], 'characters': '\xA9' },
+ '&copy;': { 'codepoints': [0x000A9], 'characters': '\xA9' },
+ '&copysr;': { 'codepoints': [0x02117], 'characters': '\u2117' },
+ '&crarr;': { 'codepoints': [0x021B5], 'characters': '\u21B5' },
+ '&cross;': { 'codepoints': [0x02717], 'characters': '\u2717' },
+ '&cscr;': { 'codepoints': [0x1D4B8], 'characters': '\uD835\uDCB8' },
+ '&csub;': { 'codepoints': [0x02ACF], 'characters': '\u2ACF' },
+ '&csube;': { 'codepoints': [0x02AD1], 'characters': '\u2AD1' },
+ '&csup;': { 'codepoints': [0x02AD0], 'characters': '\u2AD0' },
+ '&csupe;': { 'codepoints': [0x02AD2], 'characters': '\u2AD2' },
+ '&ctdot;': { 'codepoints': [0x022EF], 'characters': '\u22EF' },
+ '&cudarrl;': { 'codepoints': [0x02938], 'characters': '\u2938' },
+ '&cudarrr;': { 'codepoints': [0x02935], 'characters': '\u2935' },
+ '&cuepr;': { 'codepoints': [0x022DE], 'characters': '\u22DE' },
+ '&cuesc;': { 'codepoints': [0x022DF], 'characters': '\u22DF' },
+ '&cularr;': { 'codepoints': [0x021B6], 'characters': '\u21B6' },
+ '&cularrp;': { 'codepoints': [0x0293D], 'characters': '\u293D' },
+ '&cup;': { 'codepoints': [0x0222A], 'characters': '\u222A' },
+ '&cupbrcap;': { 'codepoints': [0x02A48], 'characters': '\u2A48' },
+ '&cupcap;': { 'codepoints': [0x02A46], 'characters': '\u2A46' },
+ '&cupcup;': { 'codepoints': [0x02A4A], 'characters': '\u2A4A' },
+ '&cupdot;': { 'codepoints': [0x0228D], 'characters': '\u228D' },
+ '&cupor;': { 'codepoints': [0x02A45], 'characters': '\u2A45' },
+ '&cups;': { 'codepoints': [0x0222A, 0x0FE00], 'characters': '\u222A\uFE00' },
+ '&curarr;': { 'codepoints': [0x021B7], 'characters': '\u21B7' },
+ '&curarrm;': { 'codepoints': [0x0293C], 'characters': '\u293C' },
+ '&curlyeqprec;': { 'codepoints': [0x022DE], 'characters': '\u22DE' },
+ '&curlyeqsucc;': { 'codepoints': [0x022DF], 'characters': '\u22DF' },
+ '&curlyvee;': { 'codepoints': [0x022CE], 'characters': '\u22CE' },
+ '&curlywedge;': { 'codepoints': [0x022CF], 'characters': '\u22CF' },
+ '&curren': { 'codepoints': [0x000A4], 'characters': '\xA4' },
+ '&curren;': { 'codepoints': [0x000A4], 'characters': '\xA4' },
+ '&curvearrowleft;': { 'codepoints': [0x021B6], 'characters': '\u21B6' },
+ '&curvearrowright;': { 'codepoints': [0x021B7], 'characters': '\u21B7' },
+ '&cuvee;': { 'codepoints': [0x022CE], 'characters': '\u22CE' },
+ '&cuwed;': { 'codepoints': [0x022CF], 'characters': '\u22CF' },
+ '&cwconint;': { 'codepoints': [0x02232], 'characters': '\u2232' },
+ '&cwint;': { 'codepoints': [0x02231], 'characters': '\u2231' },
+ '&cylcty;': { 'codepoints': [0x0232D], 'characters': '\u232D' },
+ '&dArr;': { 'codepoints': [0x021D3], 'characters': '\u21D3' },
+ '&dHar;': { 'codepoints': [0x02965], 'characters': '\u2965' },
+ '&dagger;': { 'codepoints': [0x02020], 'characters': '\u2020' },
+ '&daleth;': { 'codepoints': [0x02138], 'characters': '\u2138' },
+ '&darr;': { 'codepoints': [0x02193], 'characters': '\u2193' },
+ '&dash;': { 'codepoints': [0x02010], 'characters': '\u2010' },
+ '&dashv;': { 'codepoints': [0x022A3], 'characters': '\u22A3' },
+ '&dbkarow;': { 'codepoints': [0x0290F], 'characters': '\u290F' },
+ '&dblac;': { 'codepoints': [0x002DD], 'characters': '\u02DD' },
+ '&dcaron;': { 'codepoints': [0x0010F], 'characters': '\u010F' },
+ '&dcy;': { 'codepoints': [0x00434], 'characters': '\u0434' },
+ '&dd;': { 'codepoints': [0x02146], 'characters': '\u2146' },
+ '&ddagger;': { 'codepoints': [0x02021], 'characters': '\u2021' },
+ '&ddarr;': { 'codepoints': [0x021CA], 'characters': '\u21CA' },
+ '&ddotseq;': { 'codepoints': [0x02A77], 'characters': '\u2A77' },
+ '&deg': { 'codepoints': [0x000B0], 'characters': '\xB0' },
+ '&deg;': { 'codepoints': [0x000B0], 'characters': '\xB0' },
+ '&delta;': { 'codepoints': [0x003B4], 'characters': '\u03B4' },
+ '&demptyv;': { 'codepoints': [0x029B1], 'characters': '\u29B1' },
+ '&dfisht;': { 'codepoints': [0x0297F], 'characters': '\u297F' },
+ '&dfr;': { 'codepoints': [0x1D521], 'characters': '\uD835\uDD21' },
+ '&dharl;': { 'codepoints': [0x021C3], 'characters': '\u21C3' },
+ '&dharr;': { 'codepoints': [0x021C2], 'characters': '\u21C2' },
+ '&diam;': { 'codepoints': [0x022C4], 'characters': '\u22C4' },
+ '&diamond;': { 'codepoints': [0x022C4], 'characters': '\u22C4' },
+ '&diamondsuit;': { 'codepoints': [0x02666], 'characters': '\u2666' },
+ '&diams;': { 'codepoints': [0x02666], 'characters': '\u2666' },
+ '&die;': { 'codepoints': [0x000A8], 'characters': '\xA8' },
+ '&digamma;': { 'codepoints': [0x003DD], 'characters': '\u03DD' },
+ '&disin;': { 'codepoints': [0x022F2], 'characters': '\u22F2' },
+ '&div;': { 'codepoints': [0x000F7], 'characters': '\xF7' },
+ '&divide': { 'codepoints': [0x000F7], 'characters': '\xF7' },
+ '&divide;': { 'codepoints': [0x000F7], 'characters': '\xF7' },
+ '&divideontimes;': { 'codepoints': [0x022C7], 'characters': '\u22C7' },
+ '&divonx;': { 'codepoints': [0x022C7], 'characters': '\u22C7' },
+ '&djcy;': { 'codepoints': [0x00452], 'characters': '\u0452' },
+ '&dlcorn;': { 'codepoints': [0x0231E], 'characters': '\u231E' },
+ '&dlcrop;': { 'codepoints': [0x0230D], 'characters': '\u230D' },
+ '&dollar;': { 'codepoints': [0x00024], 'characters': '\x24' },
+ '&dopf;': { 'codepoints': [0x1D555], 'characters': '\uD835\uDD55' },
+ '&dot;': { 'codepoints': [0x002D9], 'characters': '\u02D9' },
+ '&doteq;': { 'codepoints': [0x02250], 'characters': '\u2250' },
+ '&doteqdot;': { 'codepoints': [0x02251], 'characters': '\u2251' },
+ '&dotminus;': { 'codepoints': [0x02238], 'characters': '\u2238' },
+ '&dotplus;': { 'codepoints': [0x02214], 'characters': '\u2214' },
+ '&dotsquare;': { 'codepoints': [0x022A1], 'characters': '\u22A1' },
+ '&doublebarwedge;': { 'codepoints': [0x02306], 'characters': '\u2306' },
+ '&downarrow;': { 'codepoints': [0x02193], 'characters': '\u2193' },
+ '&downdownarrows;': { 'codepoints': [0x021CA], 'characters': '\u21CA' },
+ '&downharpoonleft;': { 'codepoints': [0x021C3], 'characters': '\u21C3' },
+ '&downharpoonright;': { 'codepoints': [0x021C2], 'characters': '\u21C2' },
+ '&drbkarow;': { 'codepoints': [0x02910], 'characters': '\u2910' },
+ '&drcorn;': { 'codepoints': [0x0231F], 'characters': '\u231F' },
+ '&drcrop;': { 'codepoints': [0x0230C], 'characters': '\u230C' },
+ '&dscr;': { 'codepoints': [0x1D4B9], 'characters': '\uD835\uDCB9' },
+ '&dscy;': { 'codepoints': [0x00455], 'characters': '\u0455' },
+ '&dsol;': { 'codepoints': [0x029F6], 'characters': '\u29F6' },
+ '&dstrok;': { 'codepoints': [0x00111], 'characters': '\u0111' },
+ '&dtdot;': { 'codepoints': [0x022F1], 'characters': '\u22F1' },
+ '&dtri;': { 'codepoints': [0x025BF], 'characters': '\u25BF' },
+ '&dtrif;': { 'codepoints': [0x025BE], 'characters': '\u25BE' },
+ '&duarr;': { 'codepoints': [0x021F5], 'characters': '\u21F5' },
+ '&duhar;': { 'codepoints': [0x0296F], 'characters': '\u296F' },
+ '&dwangle;': { 'codepoints': [0x029A6], 'characters': '\u29A6' },
+ '&dzcy;': { 'codepoints': [0x0045F], 'characters': '\u045F' },
+ '&dzigrarr;': { 'codepoints': [0x027FF], 'characters': '\u27FF' },
+ '&eDDot;': { 'codepoints': [0x02A77], 'characters': '\u2A77' },
+ '&eDot;': { 'codepoints': [0x02251], 'characters': '\u2251' },
+ '&eacute': { 'codepoints': [0x000E9], 'characters': '\xE9' },
+ '&eacute;': { 'codepoints': [0x000E9], 'characters': '\xE9' },
+ '&easter;': { 'codepoints': [0x02A6E], 'characters': '\u2A6E' },
+ '&ecaron;': { 'codepoints': [0x0011B], 'characters': '\u011B' },
+ '&ecir;': { 'codepoints': [0x02256], 'characters': '\u2256' },
+ '&ecirc': { 'codepoints': [0x000EA], 'characters': '\xEA' },
+ '&ecirc;': { 'codepoints': [0x000EA], 'characters': '\xEA' },
+ '&ecolon;': { 'codepoints': [0x02255], 'characters': '\u2255' },
+ '&ecy;': { 'codepoints': [0x0044D], 'characters': '\u044D' },
+ '&edot;': { 'codepoints': [0x00117], 'characters': '\u0117' },
+ '&ee;': { 'codepoints': [0x02147], 'characters': '\u2147' },
+ '&efDot;': { 'codepoints': [0x02252], 'characters': '\u2252' },
+ '&efr;': { 'codepoints': [0x1D522], 'characters': '\uD835\uDD22' },
+ '&eg;': { 'codepoints': [0x02A9A], 'characters': '\u2A9A' },
+ '&egrave': { 'codepoints': [0x000E8], 'characters': '\xE8' },
+ '&egrave;': { 'codepoints': [0x000E8], 'characters': '\xE8' },
+ '&egs;': { 'codepoints': [0x02A96], 'characters': '\u2A96' },
+ '&egsdot;': { 'codepoints': [0x02A98], 'characters': '\u2A98' },
+ '&el;': { 'codepoints': [0x02A99], 'characters': '\u2A99' },
+ '&elinters;': { 'codepoints': [0x023E7], 'characters': '\u23E7' },
+ '&ell;': { 'codepoints': [0x02113], 'characters': '\u2113' },
+ '&els;': { 'codepoints': [0x02A95], 'characters': '\u2A95' },
+ '&elsdot;': { 'codepoints': [0x02A97], 'characters': '\u2A97' },
+ '&emacr;': { 'codepoints': [0x00113], 'characters': '\u0113' },
+ '&empty;': { 'codepoints': [0x02205], 'characters': '\u2205' },
+ '&emptyset;': { 'codepoints': [0x02205], 'characters': '\u2205' },
+ '&emptyv;': { 'codepoints': [0x02205], 'characters': '\u2205' },
+ '&emsp13;': { 'codepoints': [0x02004], 'characters': '\u2004' },
+ '&emsp14;': { 'codepoints': [0x02005], 'characters': '\u2005' },
+ '&emsp;': { 'codepoints': [0x02003], 'characters': '\u2003' },
+ '&eng;': { 'codepoints': [0x0014B], 'characters': '\u014B' },
+ '&ensp;': { 'codepoints': [0x02002], 'characters': '\u2002' },
+ '&eogon;': { 'codepoints': [0x00119], 'characters': '\u0119' },
+ '&eopf;': { 'codepoints': [0x1D556], 'characters': '\uD835\uDD56' },
+ '&epar;': { 'codepoints': [0x022D5], 'characters': '\u22D5' },
+ '&eparsl;': { 'codepoints': [0x029E3], 'characters': '\u29E3' },
+ '&eplus;': { 'codepoints': [0x02A71], 'characters': '\u2A71' },
+ '&epsi;': { 'codepoints': [0x003B5], 'characters': '\u03B5' },
+ '&epsilon;': { 'codepoints': [0x003B5], 'characters': '\u03B5' },
+ '&epsiv;': { 'codepoints': [0x003F5], 'characters': '\u03F5' },
+ '&eqcirc;': { 'codepoints': [0x02256], 'characters': '\u2256' },
+ '&eqcolon;': { 'codepoints': [0x02255], 'characters': '\u2255' },
+ '&eqsim;': { 'codepoints': [0x02242], 'characters': '\u2242' },
+ '&eqslantgtr;': { 'codepoints': [0x02A96], 'characters': '\u2A96' },
+ '&eqslantless;': { 'codepoints': [0x02A95], 'characters': '\u2A95' },
+ '&equals;': { 'codepoints': [0x0003D], 'characters': '\x3D' },
+ '&equest;': { 'codepoints': [0x0225F], 'characters': '\u225F' },
+ '&equiv;': { 'codepoints': [0x02261], 'characters': '\u2261' },
+ '&equivDD;': { 'codepoints': [0x02A78], 'characters': '\u2A78' },
+ '&eqvparsl;': { 'codepoints': [0x029E5], 'characters': '\u29E5' },
+ '&erDot;': { 'codepoints': [0x02253], 'characters': '\u2253' },
+ '&erarr;': { 'codepoints': [0x02971], 'characters': '\u2971' },
+ '&escr;': { 'codepoints': [0x0212F], 'characters': '\u212F' },
+ '&esdot;': { 'codepoints': [0x02250], 'characters': '\u2250' },
+ '&esim;': { 'codepoints': [0x02242], 'characters': '\u2242' },
+ '&eta;': { 'codepoints': [0x003B7], 'characters': '\u03B7' },
+ '&eth': { 'codepoints': [0x000F0], 'characters': '\xF0' },
+ '&eth;': { 'codepoints': [0x000F0], 'characters': '\xF0' },
+ '&euml': { 'codepoints': [0x000EB], 'characters': '\xEB' },
+ '&euml;': { 'codepoints': [0x000EB], 'characters': '\xEB' },
+ '&euro;': { 'codepoints': [0x020AC], 'characters': '\u20AC' },
+ '&excl;': { 'codepoints': [0x00021], 'characters': '\x21' },
+ '&exist;': { 'codepoints': [0x02203], 'characters': '\u2203' },
+ '&expectation;': { 'codepoints': [0x02130], 'characters': '\u2130' },
+ '&exponentiale;': { 'codepoints': [0x02147], 'characters': '\u2147' },
+ '&fallingdotseq;': { 'codepoints': [0x02252], 'characters': '\u2252' },
+ '&fcy;': { 'codepoints': [0x00444], 'characters': '\u0444' },
+ '&female;': { 'codepoints': [0x02640], 'characters': '\u2640' },
+ '&ffilig;': { 'codepoints': [0x0FB03], 'characters': '\uFB03' },
+ '&fflig;': { 'codepoints': [0x0FB00], 'characters': '\uFB00' },
+ '&ffllig;': { 'codepoints': [0x0FB04], 'characters': '\uFB04' },
+ '&ffr;': { 'codepoints': [0x1D523], 'characters': '\uD835\uDD23' },
+ '&filig;': { 'codepoints': [0x0FB01], 'characters': '\uFB01' },
+ '&fjlig;': { 'codepoints': [0x00066, 0x0006A], 'characters': '\x66\x6A' },
+ '&flat;': { 'codepoints': [0x0266D], 'characters': '\u266D' },
+ '&fllig;': { 'codepoints': [0x0FB02], 'characters': '\uFB02' },
+ '&fltns;': { 'codepoints': [0x025B1], 'characters': '\u25B1' },
+ '&fnof;': { 'codepoints': [0x00192], 'characters': '\u0192' },
+ '&fopf;': { 'codepoints': [0x1D557], 'characters': '\uD835\uDD57' },
+ '&forall;': { 'codepoints': [0x02200], 'characters': '\u2200' },
+ '&fork;': { 'codepoints': [0x022D4], 'characters': '\u22D4' },
+ '&forkv;': { 'codepoints': [0x02AD9], 'characters': '\u2AD9' },
+ '&fpartint;': { 'codepoints': [0x02A0D], 'characters': '\u2A0D' },
+ '&frac12': { 'codepoints': [0x000BD], 'characters': '\xBD' },
+ '&frac12;': { 'codepoints': [0x000BD], 'characters': '\xBD' },
+ '&frac13;': { 'codepoints': [0x02153], 'characters': '\u2153' },
+ '&frac14': { 'codepoints': [0x000BC], 'characters': '\xBC' },
+ '&frac14;': { 'codepoints': [0x000BC], 'characters': '\xBC' },
+ '&frac15;': { 'codepoints': [0x02155], 'characters': '\u2155' },
+ '&frac16;': { 'codepoints': [0x02159], 'characters': '\u2159' },
+ '&frac18;': { 'codepoints': [0x0215B], 'characters': '\u215B' },
+ '&frac23;': { 'codepoints': [0x02154], 'characters': '\u2154' },
+ '&frac25;': { 'codepoints': [0x02156], 'characters': '\u2156' },
+ '&frac34': { 'codepoints': [0x000BE], 'characters': '\xBE' },
+ '&frac34;': { 'codepoints': [0x000BE], 'characters': '\xBE' },
+ '&frac35;': { 'codepoints': [0x02157], 'characters': '\u2157' },
+ '&frac38;': { 'codepoints': [0x0215C], 'characters': '\u215C' },
+ '&frac45;': { 'codepoints': [0x02158], 'characters': '\u2158' },
+ '&frac56;': { 'codepoints': [0x0215A], 'characters': '\u215A' },
+ '&frac58;': { 'codepoints': [0x0215D], 'characters': '\u215D' },
+ '&frac78;': { 'codepoints': [0x0215E], 'characters': '\u215E' },
+ '&frasl;': { 'codepoints': [0x02044], 'characters': '\u2044' },
+ '&frown;': { 'codepoints': [0x02322], 'characters': '\u2322' },
+ '&fscr;': { 'codepoints': [0x1D4BB], 'characters': '\uD835\uDCBB' },
+ '&gE;': { 'codepoints': [0x02267], 'characters': '\u2267' },
+ '&gEl;': { 'codepoints': [0x02A8C], 'characters': '\u2A8C' },
+ '&gacute;': { 'codepoints': [0x001F5], 'characters': '\u01F5' },
+ '&gamma;': { 'codepoints': [0x003B3], 'characters': '\u03B3' },
+ '&gammad;': { 'codepoints': [0x003DD], 'characters': '\u03DD' },
+ '&gap;': { 'codepoints': [0x02A86], 'characters': '\u2A86' },
+ '&gbreve;': { 'codepoints': [0x0011F], 'characters': '\u011F' },
+ '&gcirc;': { 'codepoints': [0x0011D], 'characters': '\u011D' },
+ '&gcy;': { 'codepoints': [0x00433], 'characters': '\u0433' },
+ '&gdot;': { 'codepoints': [0x00121], 'characters': '\u0121' },
+ '&ge;': { 'codepoints': [0x02265], 'characters': '\u2265' },
+ '&gel;': { 'codepoints': [0x022DB], 'characters': '\u22DB' },
+ '&geq;': { 'codepoints': [0x02265], 'characters': '\u2265' },
+ '&geqq;': { 'codepoints': [0x02267], 'characters': '\u2267' },
+ '&geqslant;': { 'codepoints': [0x02A7E], 'characters': '\u2A7E' },
+ '&ges;': { 'codepoints': [0x02A7E], 'characters': '\u2A7E' },
+ '&gescc;': { 'codepoints': [0x02AA9], 'characters': '\u2AA9' },
+ '&gesdot;': { 'codepoints': [0x02A80], 'characters': '\u2A80' },
+ '&gesdoto;': { 'codepoints': [0x02A82], 'characters': '\u2A82' },
+ '&gesdotol;': { 'codepoints': [0x02A84], 'characters': '\u2A84' },
+ '&gesl;': { 'codepoints': [0x022DB, 0x0FE00], 'characters': '\u22DB\uFE00' },
+ '&gesles;': { 'codepoints': [0x02A94], 'characters': '\u2A94' },
+ '&gfr;': { 'codepoints': [0x1D524], 'characters': '\uD835\uDD24' },
+ '&gg;': { 'codepoints': [0x0226B], 'characters': '\u226B' },
+ '&ggg;': { 'codepoints': [0x022D9], 'characters': '\u22D9' },
+ '&gimel;': { 'codepoints': [0x02137], 'characters': '\u2137' },
+ '&gjcy;': { 'codepoints': [0x00453], 'characters': '\u0453' },
+ '&gl;': { 'codepoints': [0x02277], 'characters': '\u2277' },
+ '&glE;': { 'codepoints': [0x02A92], 'characters': '\u2A92' },
+ '&gla;': { 'codepoints': [0x02AA5], 'characters': '\u2AA5' },
+ '&glj;': { 'codepoints': [0x02AA4], 'characters': '\u2AA4' },
+ '&gnE;': { 'codepoints': [0x02269], 'characters': '\u2269' },
+ '&gnap;': { 'codepoints': [0x02A8A], 'characters': '\u2A8A' },
+ '&gnapprox;': { 'codepoints': [0x02A8A], 'characters': '\u2A8A' },
+ '&gne;': { 'codepoints': [0x02A88], 'characters': '\u2A88' },
+ '&gneq;': { 'codepoints': [0x02A88], 'characters': '\u2A88' },
+ '&gneqq;': { 'codepoints': [0x02269], 'characters': '\u2269' },
+ '&gnsim;': { 'codepoints': [0x022E7], 'characters': '\u22E7' },
+ '&gopf;': { 'codepoints': [0x1D558], 'characters': '\uD835\uDD58' },
+ '&grave;': { 'codepoints': [0x00060], 'characters': '\x60' },
+ '&gscr;': { 'codepoints': [0x0210A], 'characters': '\u210A' },
+ '&gsim;': { 'codepoints': [0x02273], 'characters': '\u2273' },
+ '&gsime;': { 'codepoints': [0x02A8E], 'characters': '\u2A8E' },
+ '&gsiml;': { 'codepoints': [0x02A90], 'characters': '\u2A90' },
+ '&gt': { 'codepoints': [0x0003E], 'characters': '\x3E' },
+ '&gt;': { 'codepoints': [0x0003E], 'characters': '\x3E' },
+ '&gtcc;': { 'codepoints': [0x02AA7], 'characters': '\u2AA7' },
+ '&gtcir;': { 'codepoints': [0x02A7A], 'characters': '\u2A7A' },
+ '&gtdot;': { 'codepoints': [0x022D7], 'characters': '\u22D7' },
+ '&gtlPar;': { 'codepoints': [0x02995], 'characters': '\u2995' },
+ '&gtquest;': { 'codepoints': [0x02A7C], 'characters': '\u2A7C' },
+ '&gtrapprox;': { 'codepoints': [0x02A86], 'characters': '\u2A86' },
+ '&gtrarr;': { 'codepoints': [0x02978], 'characters': '\u2978' },
+ '&gtrdot;': { 'codepoints': [0x022D7], 'characters': '\u22D7' },
+ '&gtreqless;': { 'codepoints': [0x022DB], 'characters': '\u22DB' },
+ '&gtreqqless;': { 'codepoints': [0x02A8C], 'characters': '\u2A8C' },
+ '&gtrless;': { 'codepoints': [0x02277], 'characters': '\u2277' },
+ '&gtrsim;': { 'codepoints': [0x02273], 'characters': '\u2273' },
+ '&gvertneqq;': { 'codepoints': [0x02269, 0x0FE00], 'characters': '\u2269\uFE00' },
+ '&gvnE;': { 'codepoints': [0x02269, 0x0FE00], 'characters': '\u2269\uFE00' },
+ '&hArr;': { 'codepoints': [0x021D4], 'characters': '\u21D4' },
+ '&hairsp;': { 'codepoints': [0x0200A], 'characters': '\u200A' },
+ '&half;': { 'codepoints': [0x000BD], 'characters': '\xBD' },
+ '&hamilt;': { 'codepoints': [0x0210B], 'characters': '\u210B' },
+ '&hardcy;': { 'codepoints': [0x0044A], 'characters': '\u044A' },
+ '&harr;': { 'codepoints': [0x02194], 'characters': '\u2194' },
+ '&harrcir;': { 'codepoints': [0x02948], 'characters': '\u2948' },
+ '&harrw;': { 'codepoints': [0x021AD], 'characters': '\u21AD' },
+ '&hbar;': { 'codepoints': [0x0210F], 'characters': '\u210F' },
+ '&hcirc;': { 'codepoints': [0x00125], 'characters': '\u0125' },
+ '&hearts;': { 'codepoints': [0x02665], 'characters': '\u2665' },
+ '&heartsuit;': { 'codepoints': [0x02665], 'characters': '\u2665' },
+ '&hellip;': { 'codepoints': [0x02026], 'characters': '\u2026' },
+ '&hercon;': { 'codepoints': [0x022B9], 'characters': '\u22B9' },
+ '&hfr;': { 'codepoints': [0x1D525], 'characters': '\uD835\uDD25' },
+ '&hksearow;': { 'codepoints': [0x02925], 'characters': '\u2925' },
+ '&hkswarow;': { 'codepoints': [0x02926], 'characters': '\u2926' },
+ '&hoarr;': { 'codepoints': [0x021FF], 'characters': '\u21FF' },
+ '&homtht;': { 'codepoints': [0x0223B], 'characters': '\u223B' },
+ '&hookleftarrow;': { 'codepoints': [0x021A9], 'characters': '\u21A9' },
+ '&hookrightarrow;': { 'codepoints': [0x021AA], 'characters': '\u21AA' },
+ '&hopf;': { 'codepoints': [0x1D559], 'characters': '\uD835\uDD59' },
+ '&horbar;': { 'codepoints': [0x02015], 'characters': '\u2015' },
+ '&hscr;': { 'codepoints': [0x1D4BD], 'characters': '\uD835\uDCBD' },
+ '&hslash;': { 'codepoints': [0x0210F], 'characters': '\u210F' },
+ '&hstrok;': { 'codepoints': [0x00127], 'characters': '\u0127' },
+ '&hybull;': { 'codepoints': [0x02043], 'characters': '\u2043' },
+ '&hyphen;': { 'codepoints': [0x02010], 'characters': '\u2010' },
+ '&iacute': { 'codepoints': [0x000ED], 'characters': '\xED' },
+ '&iacute;': { 'codepoints': [0x000ED], 'characters': '\xED' },
+ '&ic;': { 'codepoints': [0x02063], 'characters': '\u2063' },
+ '&icirc': { 'codepoints': [0x000EE], 'characters': '\xEE' },
+ '&icirc;': { 'codepoints': [0x000EE], 'characters': '\xEE' },
+ '&icy;': { 'codepoints': [0x00438], 'characters': '\u0438' },
+ '&iecy;': { 'codepoints': [0x00435], 'characters': '\u0435' },
+ '&iexcl': { 'codepoints': [0x000A1], 'characters': '\xA1' },
+ '&iexcl;': { 'codepoints': [0x000A1], 'characters': '\xA1' },
+ '&iff;': { 'codepoints': [0x021D4], 'characters': '\u21D4' },
+ '&ifr;': { 'codepoints': [0x1D526], 'characters': '\uD835\uDD26' },
+ '&igrave': { 'codepoints': [0x000EC], 'characters': '\xEC' },
+ '&igrave;': { 'codepoints': [0x000EC], 'characters': '\xEC' },
+ '&ii;': { 'codepoints': [0x02148], 'characters': '\u2148' },
+ '&iiiint;': { 'codepoints': [0x02A0C], 'characters': '\u2A0C' },
+ '&iiint;': { 'codepoints': [0x0222D], 'characters': '\u222D' },
+ '&iinfin;': { 'codepoints': [0x029DC], 'characters': '\u29DC' },
+ '&iiota;': { 'codepoints': [0x02129], 'characters': '\u2129' },
+ '&ijlig;': { 'codepoints': [0x00133], 'characters': '\u0133' },
+ '&imacr;': { 'codepoints': [0x0012B], 'characters': '\u012B' },
+ '&image;': { 'codepoints': [0x02111], 'characters': '\u2111' },
+ '&imagline;': { 'codepoints': [0x02110], 'characters': '\u2110' },
+ '&imagpart;': { 'codepoints': [0x02111], 'characters': '\u2111' },
+ '&imath;': { 'codepoints': [0x00131], 'characters': '\u0131' },
+ '&imof;': { 'codepoints': [0x022B7], 'characters': '\u22B7' },
+ '&imped;': { 'codepoints': [0x001B5], 'characters': '\u01B5' },
+ '&in;': { 'codepoints': [0x02208], 'characters': '\u2208' },
+ '&incare;': { 'codepoints': [0x02105], 'characters': '\u2105' },
+ '&infin;': { 'codepoints': [0x0221E], 'characters': '\u221E' },
+ '&infintie;': { 'codepoints': [0x029DD], 'characters': '\u29DD' },
+ '&inodot;': { 'codepoints': [0x00131], 'characters': '\u0131' },
+ '&int;': { 'codepoints': [0x0222B], 'characters': '\u222B' },
+ '&intcal;': { 'codepoints': [0x022BA], 'characters': '\u22BA' },
+ '&integers;': { 'codepoints': [0x02124], 'characters': '\u2124' },
+ '&intercal;': { 'codepoints': [0x022BA], 'characters': '\u22BA' },
+ '&intlarhk;': { 'codepoints': [0x02A17], 'characters': '\u2A17' },
+ '&intprod;': { 'codepoints': [0x02A3C], 'characters': '\u2A3C' },
+ '&iocy;': { 'codepoints': [0x00451], 'characters': '\u0451' },
+ '&iogon;': { 'codepoints': [0x0012F], 'characters': '\u012F' },
+ '&iopf;': { 'codepoints': [0x1D55A], 'characters': '\uD835\uDD5A' },
+ '&iota;': { 'codepoints': [0x003B9], 'characters': '\u03B9' },
+ '&iprod;': { 'codepoints': [0x02A3C], 'characters': '\u2A3C' },
+ '&iquest': { 'codepoints': [0x000BF], 'characters': '\xBF' },
+ '&iquest;': { 'codepoints': [0x000BF], 'characters': '\xBF' },
+ '&iscr;': { 'codepoints': [0x1D4BE], 'characters': '\uD835\uDCBE' },
+ '&isin;': { 'codepoints': [0x02208], 'characters': '\u2208' },
+ '&isinE;': { 'codepoints': [0x022F9], 'characters': '\u22F9' },
+ '&isindot;': { 'codepoints': [0x022F5], 'characters': '\u22F5' },
+ '&isins;': { 'codepoints': [0x022F4], 'characters': '\u22F4' },
+ '&isinsv;': { 'codepoints': [0x022F3], 'characters': '\u22F3' },
+ '&isinv;': { 'codepoints': [0x02208], 'characters': '\u2208' },
+ '&it;': { 'codepoints': [0x02062], 'characters': '\u2062' },
+ '&itilde;': { 'codepoints': [0x00129], 'characters': '\u0129' },
+ '&iukcy;': { 'codepoints': [0x00456], 'characters': '\u0456' },
+ '&iuml': { 'codepoints': [0x000EF], 'characters': '\xEF' },
+ '&iuml;': { 'codepoints': [0x000EF], 'characters': '\xEF' },
+ '&jcirc;': { 'codepoints': [0x00135], 'characters': '\u0135' },
+ '&jcy;': { 'codepoints': [0x00439], 'characters': '\u0439' },
+ '&jfr;': { 'codepoints': [0x1D527], 'characters': '\uD835\uDD27' },
+ '&jmath;': { 'codepoints': [0x00237], 'characters': '\u0237' },
+ '&jopf;': { 'codepoints': [0x1D55B], 'characters': '\uD835\uDD5B' },
+ '&jscr;': { 'codepoints': [0x1D4BF], 'characters': '\uD835\uDCBF' },
+ '&jsercy;': { 'codepoints': [0x00458], 'characters': '\u0458' },
+ '&jukcy;': { 'codepoints': [0x00454], 'characters': '\u0454' },
+ '&kappa;': { 'codepoints': [0x003BA], 'characters': '\u03BA' },
+ '&kappav;': { 'codepoints': [0x003F0], 'characters': '\u03F0' },
+ '&kcedil;': { 'codepoints': [0x00137], 'characters': '\u0137' },
+ '&kcy;': { 'codepoints': [0x0043A], 'characters': '\u043A' },
+ '&kfr;': { 'codepoints': [0x1D528], 'characters': '\uD835\uDD28' },
+ '&kgreen;': { 'codepoints': [0x00138], 'characters': '\u0138' },
+ '&khcy;': { 'codepoints': [0x00445], 'characters': '\u0445' },
+ '&kjcy;': { 'codepoints': [0x0045C], 'characters': '\u045C' },
+ '&kopf;': { 'codepoints': [0x1D55C], 'characters': '\uD835\uDD5C' },
+ '&kscr;': { 'codepoints': [0x1D4C0], 'characters': '\uD835\uDCC0' },
+ '&lAarr;': { 'codepoints': [0x021DA], 'characters': '\u21DA' },
+ '&lArr;': { 'codepoints': [0x021D0], 'characters': '\u21D0' },
+ '&lAtail;': { 'codepoints': [0x0291B], 'characters': '\u291B' },
+ '&lBarr;': { 'codepoints': [0x0290E], 'characters': '\u290E' },
+ '&lE;': { 'codepoints': [0x02266], 'characters': '\u2266' },
+ '&lEg;': { 'codepoints': [0x02A8B], 'characters': '\u2A8B' },
+ '&lHar;': { 'codepoints': [0x02962], 'characters': '\u2962' },
+ '&lacute;': { 'codepoints': [0x0013A], 'characters': '\u013A' },
+ '&laemptyv;': { 'codepoints': [0x029B4], 'characters': '\u29B4' },
+ '&lagran;': { 'codepoints': [0x02112], 'characters': '\u2112' },
+ '&lambda;': { 'codepoints': [0x003BB], 'characters': '\u03BB' },
+ '&lang;': { 'codepoints': [0x027E8], 'characters': '\u27E8' },
+ '&langd;': { 'codepoints': [0x02991], 'characters': '\u2991' },
+ '&langle;': { 'codepoints': [0x027E8], 'characters': '\u27E8' },
+ '&lap;': { 'codepoints': [0x02A85], 'characters': '\u2A85' },
+ '&laquo': { 'codepoints': [0x000AB], 'characters': '\xAB' },
+ '&laquo;': { 'codepoints': [0x000AB], 'characters': '\xAB' },
+ '&larr;': { 'codepoints': [0x02190], 'characters': '\u2190' },
+ '&larrb;': { 'codepoints': [0x021E4], 'characters': '\u21E4' },
+ '&larrbfs;': { 'codepoints': [0x0291F], 'characters': '\u291F' },
+ '&larrfs;': { 'codepoints': [0x0291D], 'characters': '\u291D' },
+ '&larrhk;': { 'codepoints': [0x021A9], 'characters': '\u21A9' },
+ '&larrlp;': { 'codepoints': [0x021AB], 'characters': '\u21AB' },
+ '&larrpl;': { 'codepoints': [0x02939], 'characters': '\u2939' },
+ '&larrsim;': { 'codepoints': [0x02973], 'characters': '\u2973' },
+ '&larrtl;': { 'codepoints': [0x021A2], 'characters': '\u21A2' },
+ '&lat;': { 'codepoints': [0x02AAB], 'characters': '\u2AAB' },
+ '&latail;': { 'codepoints': [0x02919], 'characters': '\u2919' },
+ '&late;': { 'codepoints': [0x02AAD], 'characters': '\u2AAD' },
+ '&lates;': { 'codepoints': [0x02AAD, 0x0FE00], 'characters': '\u2AAD\uFE00' },
+ '&lbarr;': { 'codepoints': [0x0290C], 'characters': '\u290C' },
+ '&lbbrk;': { 'codepoints': [0x02772], 'characters': '\u2772' },
+ '&lbrace;': { 'codepoints': [0x0007B], 'characters': '\x7B' },
+ '&lbrack;': { 'codepoints': [0x0005B], 'characters': '\x5B' },
+ '&lbrke;': { 'codepoints': [0x0298B], 'characters': '\u298B' },
+ '&lbrksld;': { 'codepoints': [0x0298F], 'characters': '\u298F' },
+ '&lbrkslu;': { 'codepoints': [0x0298D], 'characters': '\u298D' },
+ '&lcaron;': { 'codepoints': [0x0013E], 'characters': '\u013E' },
+ '&lcedil;': { 'codepoints': [0x0013C], 'characters': '\u013C' },
+ '&lceil;': { 'codepoints': [0x02308], 'characters': '\u2308' },
+ '&lcub;': { 'codepoints': [0x0007B], 'characters': '\x7B' },
+ '&lcy;': { 'codepoints': [0x0043B], 'characters': '\u043B' },
+ '&ldca;': { 'codepoints': [0x02936], 'characters': '\u2936' },
+ '&ldquo;': { 'codepoints': [0x0201C], 'characters': '\u201C' },
+ '&ldquor;': { 'codepoints': [0x0201E], 'characters': '\u201E' },
+ '&ldrdhar;': { 'codepoints': [0x02967], 'characters': '\u2967' },
+ '&ldrushar;': { 'codepoints': [0x0294B], 'characters': '\u294B' },
+ '&ldsh;': { 'codepoints': [0x021B2], 'characters': '\u21B2' },
+ '&le;': { 'codepoints': [0x02264], 'characters': '\u2264' },
+ '&leftarrow;': { 'codepoints': [0x02190], 'characters': '\u2190' },
+ '&leftarrowtail;': { 'codepoints': [0x021A2], 'characters': '\u21A2' },
+ '&leftharpoondown;': { 'codepoints': [0x021BD], 'characters': '\u21BD' },
+ '&leftharpoonup;': { 'codepoints': [0x021BC], 'characters': '\u21BC' },
+ '&leftleftarrows;': { 'codepoints': [0x021C7], 'characters': '\u21C7' },
+ '&leftrightarrow;': { 'codepoints': [0x02194], 'characters': '\u2194' },
+ '&leftrightarrows;': { 'codepoints': [0x021C6], 'characters': '\u21C6' },
+ '&leftrightharpoons;': { 'codepoints': [0x021CB], 'characters': '\u21CB' },
+ '&leftrightsquigarrow;': { 'codepoints': [0x021AD], 'characters': '\u21AD' },
+ '&leftthreetimes;': { 'codepoints': [0x022CB], 'characters': '\u22CB' },
+ '&leg;': { 'codepoints': [0x022DA], 'characters': '\u22DA' },
+ '&leq;': { 'codepoints': [0x02264], 'characters': '\u2264' },
+ '&leqq;': { 'codepoints': [0x02266], 'characters': '\u2266' },
+ '&leqslant;': { 'codepoints': [0x02A7D], 'characters': '\u2A7D' },
+ '&les;': { 'codepoints': [0x02A7D], 'characters': '\u2A7D' },
+ '&lescc;': { 'codepoints': [0x02AA8], 'characters': '\u2AA8' },
+ '&lesdot;': { 'codepoints': [0x02A7F], 'characters': '\u2A7F' },
+ '&lesdoto;': { 'codepoints': [0x02A81], 'characters': '\u2A81' },
+ '&lesdotor;': { 'codepoints': [0x02A83], 'characters': '\u2A83' },
+ '&lesg;': { 'codepoints': [0x022DA, 0x0FE00], 'characters': '\u22DA\uFE00' },
+ '&lesges;': { 'codepoints': [0x02A93], 'characters': '\u2A93' },
+ '&lessapprox;': { 'codepoints': [0x02A85], 'characters': '\u2A85' },
+ '&lessdot;': { 'codepoints': [0x022D6], 'characters': '\u22D6' },
+ '&lesseqgtr;': { 'codepoints': [0x022DA], 'characters': '\u22DA' },
+ '&lesseqqgtr;': { 'codepoints': [0x02A8B], 'characters': '\u2A8B' },
+ '&lessgtr;': { 'codepoints': [0x02276], 'characters': '\u2276' },
+ '&lesssim;': { 'codepoints': [0x02272], 'characters': '\u2272' },
+ '&lfisht;': { 'codepoints': [0x0297C], 'characters': '\u297C' },
+ '&lfloor;': { 'codepoints': [0x0230A], 'characters': '\u230A' },
+ '&lfr;': { 'codepoints': [0x1D529], 'characters': '\uD835\uDD29' },
+ '&lg;': { 'codepoints': [0x02276], 'characters': '\u2276' },
+ '&lgE;': { 'codepoints': [0x02A91], 'characters': '\u2A91' },
+ '&lhard;': { 'codepoints': [0x021BD], 'characters': '\u21BD' },
+ '&lharu;': { 'codepoints': [0x021BC], 'characters': '\u21BC' },
+ '&lharul;': { 'codepoints': [0x0296A], 'characters': '\u296A' },
+ '&lhblk;': { 'codepoints': [0x02584], 'characters': '\u2584' },
+ '&ljcy;': { 'codepoints': [0x00459], 'characters': '\u0459' },
+ '&ll;': { 'codepoints': [0x0226A], 'characters': '\u226A' },
+ '&llarr;': { 'codepoints': [0x021C7], 'characters': '\u21C7' },
+ '&llcorner;': { 'codepoints': [0x0231E], 'characters': '\u231E' },
+ '&llhard;': { 'codepoints': [0x0296B], 'characters': '\u296B' },
+ '&lltri;': { 'codepoints': [0x025FA], 'characters': '\u25FA' },
+ '&lmidot;': { 'codepoints': [0x00140], 'characters': '\u0140' },
+ '&lmoust;': { 'codepoints': [0x023B0], 'characters': '\u23B0' },
+ '&lmoustache;': { 'codepoints': [0x023B0], 'characters': '\u23B0' },
+ '&lnE;': { 'codepoints': [0x02268], 'characters': '\u2268' },
+ '&lnap;': { 'codepoints': [0x02A89], 'characters': '\u2A89' },
+ '&lnapprox;': { 'codepoints': [0x02A89], 'characters': '\u2A89' },
+ '&lne;': { 'codepoints': [0x02A87], 'characters': '\u2A87' },
+ '&lneq;': { 'codepoints': [0x02A87], 'characters': '\u2A87' },
+ '&lneqq;': { 'codepoints': [0x02268], 'characters': '\u2268' },
+ '&lnsim;': { 'codepoints': [0x022E6], 'characters': '\u22E6' },
+ '&loang;': { 'codepoints': [0x027EC], 'characters': '\u27EC' },
+ '&loarr;': { 'codepoints': [0x021FD], 'characters': '\u21FD' },
+ '&lobrk;': { 'codepoints': [0x027E6], 'characters': '\u27E6' },
+ '&longleftarrow;': { 'codepoints': [0x027F5], 'characters': '\u27F5' },
+ '&longleftrightarrow;': { 'codepoints': [0x027F7], 'characters': '\u27F7' },
+ '&longmapsto;': { 'codepoints': [0x027FC], 'characters': '\u27FC' },
+ '&longrightarrow;': { 'codepoints': [0x027F6], 'characters': '\u27F6' },
+ '&looparrowleft;': { 'codepoints': [0x021AB], 'characters': '\u21AB' },
+ '&looparrowright;': { 'codepoints': [0x021AC], 'characters': '\u21AC' },
+ '&lopar;': { 'codepoints': [0x02985], 'characters': '\u2985' },
+ '&lopf;': { 'codepoints': [0x1D55D], 'characters': '\uD835\uDD5D' },
+ '&loplus;': { 'codepoints': [0x02A2D], 'characters': '\u2A2D' },
+ '&lotimes;': { 'codepoints': [0x02A34], 'characters': '\u2A34' },
+ '&lowast;': { 'codepoints': [0x02217], 'characters': '\u2217' },
+ '&lowbar;': { 'codepoints': [0x0005F], 'characters': '\x5F' },
+ '&loz;': { 'codepoints': [0x025CA], 'characters': '\u25CA' },
+ '&lozenge;': { 'codepoints': [0x025CA], 'characters': '\u25CA' },
+ '&lozf;': { 'codepoints': [0x029EB], 'characters': '\u29EB' },
+ '&lpar;': { 'codepoints': [0x00028], 'characters': '\x28' },
+ '&lparlt;': { 'codepoints': [0x02993], 'characters': '\u2993' },
+ '&lrarr;': { 'codepoints': [0x021C6], 'characters': '\u21C6' },
+ '&lrcorner;': { 'codepoints': [0x0231F], 'characters': '\u231F' },
+ '&lrhar;': { 'codepoints': [0x021CB], 'characters': '\u21CB' },
+ '&lrhard;': { 'codepoints': [0x0296D], 'characters': '\u296D' },
+ '&lrm;': { 'codepoints': [0x0200E], 'characters': '\u200E' },
+ '&lrtri;': { 'codepoints': [0x022BF], 'characters': '\u22BF' },
+ '&lsaquo;': { 'codepoints': [0x02039], 'characters': '\u2039' },
+ '&lscr;': { 'codepoints': [0x1D4C1], 'characters': '\uD835\uDCC1' },
+ '&lsh;': { 'codepoints': [0x021B0], 'characters': '\u21B0' },
+ '&lsim;': { 'codepoints': [0x02272], 'characters': '\u2272' },
+ '&lsime;': { 'codepoints': [0x02A8D], 'characters': '\u2A8D' },
+ '&lsimg;': { 'codepoints': [0x02A8F], 'characters': '\u2A8F' },
+ '&lsqb;': { 'codepoints': [0x0005B], 'characters': '\x5B' },
+ '&lsquo;': { 'codepoints': [0x02018], 'characters': '\u2018' },
+ '&lsquor;': { 'codepoints': [0x0201A], 'characters': '\u201A' },
+ '&lstrok;': { 'codepoints': [0x00142], 'characters': '\u0142' },
+ '&lt': { 'codepoints': [0x0003C], 'characters': '\x3C' },
+ '&lt;': { 'codepoints': [0x0003C], 'characters': '\x3C' },
+ '&ltcc;': { 'codepoints': [0x02AA6], 'characters': '\u2AA6' },
+ '&ltcir;': { 'codepoints': [0x02A79], 'characters': '\u2A79' },
+ '&ltdot;': { 'codepoints': [0x022D6], 'characters': '\u22D6' },
+ '&lthree;': { 'codepoints': [0x022CB], 'characters': '\u22CB' },
+ '&ltimes;': { 'codepoints': [0x022C9], 'characters': '\u22C9' },
+ '&ltlarr;': { 'codepoints': [0x02976], 'characters': '\u2976' },
+ '&ltquest;': { 'codepoints': [0x02A7B], 'characters': '\u2A7B' },
+ '&ltrPar;': { 'codepoints': [0x02996], 'characters': '\u2996' },
+ '&ltri;': { 'codepoints': [0x025C3], 'characters': '\u25C3' },
+ '&ltrie;': { 'codepoints': [0x022B4], 'characters': '\u22B4' },
+ '&ltrif;': { 'codepoints': [0x025C2], 'characters': '\u25C2' },
+ '&lurdshar;': { 'codepoints': [0x0294A], 'characters': '\u294A' },
+ '&luruhar;': { 'codepoints': [0x02966], 'characters': '\u2966' },
+ '&lvertneqq;': { 'codepoints': [0x02268, 0x0FE00], 'characters': '\u2268\uFE00' },
+ '&lvnE;': { 'codepoints': [0x02268, 0x0FE00], 'characters': '\u2268\uFE00' },
+ '&mDDot;': { 'codepoints': [0x0223A], 'characters': '\u223A' },
+ '&macr': { 'codepoints': [0x000AF], 'characters': '\xAF' },
+ '&macr;': { 'codepoints': [0x000AF], 'characters': '\xAF' },
+ '&male;': { 'codepoints': [0x02642], 'characters': '\u2642' },
+ '&malt;': { 'codepoints': [0x02720], 'characters': '\u2720' },
+ '&maltese;': { 'codepoints': [0x02720], 'characters': '\u2720' },
+ '&map;': { 'codepoints': [0x021A6], 'characters': '\u21A6' },
+ '&mapsto;': { 'codepoints': [0x021A6], 'characters': '\u21A6' },
+ '&mapstodown;': { 'codepoints': [0x021A7], 'characters': '\u21A7' },
+ '&mapstoleft;': { 'codepoints': [0x021A4], 'characters': '\u21A4' },
+ '&mapstoup;': { 'codepoints': [0x021A5], 'characters': '\u21A5' },
+ '&marker;': { 'codepoints': [0x025AE], 'characters': '\u25AE' },
+ '&mcomma;': { 'codepoints': [0x02A29], 'characters': '\u2A29' },
+ '&mcy;': { 'codepoints': [0x0043C], 'characters': '\u043C' },
+ '&mdash;': { 'codepoints': [0x02014], 'characters': '\u2014' },
+ '&measuredangle;': { 'codepoints': [0x02221], 'characters': '\u2221' },
+ '&mfr;': { 'codepoints': [0x1D52A], 'characters': '\uD835\uDD2A' },
+ '&mho;': { 'codepoints': [0x02127], 'characters': '\u2127' },
+ '&micro': { 'codepoints': [0x000B5], 'characters': '\xB5' },
+ '&micro;': { 'codepoints': [0x000B5], 'characters': '\xB5' },
+ '&mid;': { 'codepoints': [0x02223], 'characters': '\u2223' },
+ '&midast;': { 'codepoints': [0x0002A], 'characters': '\x2A' },
+ '&midcir;': { 'codepoints': [0x02AF0], 'characters': '\u2AF0' },
+ '&middot': { 'codepoints': [0x000B7], 'characters': '\xB7' },
+ '&middot;': { 'codepoints': [0x000B7], 'characters': '\xB7' },
+ '&minus;': { 'codepoints': [0x02212], 'characters': '\u2212' },
+ '&minusb;': { 'codepoints': [0x0229F], 'characters': '\u229F' },
+ '&minusd;': { 'codepoints': [0x02238], 'characters': '\u2238' },
+ '&minusdu;': { 'codepoints': [0x02A2A], 'characters': '\u2A2A' },
+ '&mlcp;': { 'codepoints': [0x02ADB], 'characters': '\u2ADB' },
+ '&mldr;': { 'codepoints': [0x02026], 'characters': '\u2026' },
+ '&mnplus;': { 'codepoints': [0x02213], 'characters': '\u2213' },
+ '&models;': { 'codepoints': [0x022A7], 'characters': '\u22A7' },
+ '&mopf;': { 'codepoints': [0x1D55E], 'characters': '\uD835\uDD5E' },
+ '&mp;': { 'codepoints': [0x02213], 'characters': '\u2213' },
+ '&mscr;': { 'codepoints': [0x1D4C2], 'characters': '\uD835\uDCC2' },
+ '&mstpos;': { 'codepoints': [0x0223E], 'characters': '\u223E' },
+ '&mu;': { 'codepoints': [0x003BC], 'characters': '\u03BC' },
+ '&multimap;': { 'codepoints': [0x022B8], 'characters': '\u22B8' },
+ '&mumap;': { 'codepoints': [0x022B8], 'characters': '\u22B8' },
+ '&nGg;': { 'codepoints': [0x022D9, 0x00338], 'characters': '\u22D9\u0338' },
+ '&nGt;': { 'codepoints': [0x0226B, 0x020D2], 'characters': '\u226B\u20D2' },
+ '&nGtv;': { 'codepoints': [0x0226B, 0x00338], 'characters': '\u226B\u0338' },
+ '&nLeftarrow;': { 'codepoints': [0x021CD], 'characters': '\u21CD' },
+ '&nLeftrightarrow;': { 'codepoints': [0x021CE], 'characters': '\u21CE' },
+ '&nLl;': { 'codepoints': [0x022D8, 0x00338], 'characters': '\u22D8\u0338' },
+ '&nLt;': { 'codepoints': [0x0226A, 0x020D2], 'characters': '\u226A\u20D2' },
+ '&nLtv;': { 'codepoints': [0x0226A, 0x00338], 'characters': '\u226A\u0338' },
+ '&nRightarrow;': { 'codepoints': [0x021CF], 'characters': '\u21CF' },
+ '&nVDash;': { 'codepoints': [0x022AF], 'characters': '\u22AF' },
+ '&nVdash;': { 'codepoints': [0x022AE], 'characters': '\u22AE' },
+ '&nabla;': { 'codepoints': [0x02207], 'characters': '\u2207' },
+ '&nacute;': { 'codepoints': [0x00144], 'characters': '\u0144' },
+ '&nang;': { 'codepoints': [0x02220, 0x020D2], 'characters': '\u2220\u20D2' },
+ '&nap;': { 'codepoints': [0x02249], 'characters': '\u2249' },
+ '&napE;': { 'codepoints': [0x02A70, 0x00338], 'characters': '\u2A70\u0338' },
+ '&napid;': { 'codepoints': [0x0224B, 0x00338], 'characters': '\u224B\u0338' },
+ '&napos;': { 'codepoints': [0x00149], 'characters': '\u0149' },
+ '&napprox;': { 'codepoints': [0x02249], 'characters': '\u2249' },
+ '&natur;': { 'codepoints': [0x0266E], 'characters': '\u266E' },
+ '&natural;': { 'codepoints': [0x0266E], 'characters': '\u266E' },
+ '&naturals;': { 'codepoints': [0x02115], 'characters': '\u2115' },
+ '&nbsp': { 'codepoints': [0x000A0], 'characters': '\xA0' },
+ '&nbsp;': { 'codepoints': [0x000A0], 'characters': '\xA0' },
+ '&nbump;': { 'codepoints': [0x0224E, 0x00338], 'characters': '\u224E\u0338' },
+ '&nbumpe;': { 'codepoints': [0x0224F, 0x00338], 'characters': '\u224F\u0338' },
+ '&ncap;': { 'codepoints': [0x02A43], 'characters': '\u2A43' },
+ '&ncaron;': { 'codepoints': [0x00148], 'characters': '\u0148' },
+ '&ncedil;': { 'codepoints': [0x00146], 'characters': '\u0146' },
+ '&ncong;': { 'codepoints': [0x02247], 'characters': '\u2247' },
+ '&ncongdot;': { 'codepoints': [0x02A6D, 0x00338], 'characters': '\u2A6D\u0338' },
+ '&ncup;': { 'codepoints': [0x02A42], 'characters': '\u2A42' },
+ '&ncy;': { 'codepoints': [0x0043D], 'characters': '\u043D' },
+ '&ndash;': { 'codepoints': [0x02013], 'characters': '\u2013' },
+ '&ne;': { 'codepoints': [0x02260], 'characters': '\u2260' },
+ '&neArr;': { 'codepoints': [0x021D7], 'characters': '\u21D7' },
+ '&nearhk;': { 'codepoints': [0x02924], 'characters': '\u2924' },
+ '&nearr;': { 'codepoints': [0x02197], 'characters': '\u2197' },
+ '&nearrow;': { 'codepoints': [0x02197], 'characters': '\u2197' },
+ '&nedot;': { 'codepoints': [0x02250, 0x00338], 'characters': '\u2250\u0338' },
+ '&nequiv;': { 'codepoints': [0x02262], 'characters': '\u2262' },
+ '&nesear;': { 'codepoints': [0x02928], 'characters': '\u2928' },
+ '&nesim;': { 'codepoints': [0x02242, 0x00338], 'characters': '\u2242\u0338' },
+ '&nexist;': { 'codepoints': [0x02204], 'characters': '\u2204' },
+ '&nexists;': { 'codepoints': [0x02204], 'characters': '\u2204' },
+ '&nfr;': { 'codepoints': [0x1D52B], 'characters': '\uD835\uDD2B' },
+ '&ngE;': { 'codepoints': [0x02267, 0x00338], 'characters': '\u2267\u0338' },
+ '&nge;': { 'codepoints': [0x02271], 'characters': '\u2271' },
+ '&ngeq;': { 'codepoints': [0x02271], 'characters': '\u2271' },
+ '&ngeqq;': { 'codepoints': [0x02267, 0x00338], 'characters': '\u2267\u0338' },
+ '&ngeqslant;': { 'codepoints': [0x02A7E, 0x00338], 'characters': '\u2A7E\u0338' },
+ '&nges;': { 'codepoints': [0x02A7E, 0x00338], 'characters': '\u2A7E\u0338' },
+ '&ngsim;': { 'codepoints': [0x02275], 'characters': '\u2275' },
+ '&ngt;': { 'codepoints': [0x0226F], 'characters': '\u226F' },
+ '&ngtr;': { 'codepoints': [0x0226F], 'characters': '\u226F' },
+ '&nhArr;': { 'codepoints': [0x021CE], 'characters': '\u21CE' },
+ '&nharr;': { 'codepoints': [0x021AE], 'characters': '\u21AE' },
+ '&nhpar;': { 'codepoints': [0x02AF2], 'characters': '\u2AF2' },
+ '&ni;': { 'codepoints': [0x0220B], 'characters': '\u220B' },
+ '&nis;': { 'codepoints': [0x022FC], 'characters': '\u22FC' },
+ '&nisd;': { 'codepoints': [0x022FA], 'characters': '\u22FA' },
+ '&niv;': { 'codepoints': [0x0220B], 'characters': '\u220B' },
+ '&njcy;': { 'codepoints': [0x0045A], 'characters': '\u045A' },
+ '&nlArr;': { 'codepoints': [0x021CD], 'characters': '\u21CD' },
+ '&nlE;': { 'codepoints': [0x02266, 0x00338], 'characters': '\u2266\u0338' },
+ '&nlarr;': { 'codepoints': [0x0219A], 'characters': '\u219A' },
+ '&nldr;': { 'codepoints': [0x02025], 'characters': '\u2025' },
+ '&nle;': { 'codepoints': [0x02270], 'characters': '\u2270' },
+ '&nleftarrow;': { 'codepoints': [0x0219A], 'characters': '\u219A' },
+ '&nleftrightarrow;': { 'codepoints': [0x021AE], 'characters': '\u21AE' },
+ '&nleq;': { 'codepoints': [0x02270], 'characters': '\u2270' },
+ '&nleqq;': { 'codepoints': [0x02266, 0x00338], 'characters': '\u2266\u0338' },
+ '&nleqslant;': { 'codepoints': [0x02A7D, 0x00338], 'characters': '\u2A7D\u0338' },
+ '&nles;': { 'codepoints': [0x02A7D, 0x00338], 'characters': '\u2A7D\u0338' },
+ '&nless;': { 'codepoints': [0x0226E], 'characters': '\u226E' },
+ '&nlsim;': { 'codepoints': [0x02274], 'characters': '\u2274' },
+ '&nlt;': { 'codepoints': [0x0226E], 'characters': '\u226E' },
+ '&nltri;': { 'codepoints': [0x022EA], 'characters': '\u22EA' },
+ '&nltrie;': { 'codepoints': [0x022EC], 'characters': '\u22EC' },
+ '&nmid;': { 'codepoints': [0x02224], 'characters': '\u2224' },
+ '&nopf;': { 'codepoints': [0x1D55F], 'characters': '\uD835\uDD5F' },
+ '&not': { 'codepoints': [0x000AC], 'characters': '\xAC' },
+ '&not;': { 'codepoints': [0x000AC], 'characters': '\xAC' },
+ '&notin;': { 'codepoints': [0x02209], 'characters': '\u2209' },
+ '&notinE;': { 'codepoints': [0x022F9, 0x00338], 'characters': '\u22F9\u0338' },
+ '&notindot;': { 'codepoints': [0x022F5, 0x00338], 'characters': '\u22F5\u0338' },
+ '&notinva;': { 'codepoints': [0x02209], 'characters': '\u2209' },
+ '&notinvb;': { 'codepoints': [0x022F7], 'characters': '\u22F7' },
+ '&notinvc;': { 'codepoints': [0x022F6], 'characters': '\u22F6' },
+ '&notni;': { 'codepoints': [0x0220C], 'characters': '\u220C' },
+ '&notniva;': { 'codepoints': [0x0220C], 'characters': '\u220C' },
+ '&notnivb;': { 'codepoints': [0x022FE], 'characters': '\u22FE' },
+ '&notnivc;': { 'codepoints': [0x022FD], 'characters': '\u22FD' },
+ '&npar;': { 'codepoints': [0x02226], 'characters': '\u2226' },
+ '&nparallel;': { 'codepoints': [0x02226], 'characters': '\u2226' },
+ '&nparsl;': { 'codepoints': [0x02AFD, 0x020E5], 'characters': '\u2AFD\u20E5' },
+ '&npart;': { 'codepoints': [0x02202, 0x00338], 'characters': '\u2202\u0338' },
+ '&npolint;': { 'codepoints': [0x02A14], 'characters': '\u2A14' },
+ '&npr;': { 'codepoints': [0x02280], 'characters': '\u2280' },
+ '&nprcue;': { 'codepoints': [0x022E0], 'characters': '\u22E0' },
+ '&npre;': { 'codepoints': [0x02AAF, 0x00338], 'characters': '\u2AAF\u0338' },
+ '&nprec;': { 'codepoints': [0x02280], 'characters': '\u2280' },
+ '&npreceq;': { 'codepoints': [0x02AAF, 0x00338], 'characters': '\u2AAF\u0338' },
+ '&nrArr;': { 'codepoints': [0x021CF], 'characters': '\u21CF' },
+ '&nrarr;': { 'codepoints': [0x0219B], 'characters': '\u219B' },
+ '&nrarrc;': { 'codepoints': [0x02933, 0x00338], 'characters': '\u2933\u0338' },
+ '&nrarrw;': { 'codepoints': [0x0219D, 0x00338], 'characters': '\u219D\u0338' },
+ '&nrightarrow;': { 'codepoints': [0x0219B], 'characters': '\u219B' },
+ '&nrtri;': { 'codepoints': [0x022EB], 'characters': '\u22EB' },
+ '&nrtrie;': { 'codepoints': [0x022ED], 'characters': '\u22ED' },
+ '&nsc;': { 'codepoints': [0x02281], 'characters': '\u2281' },
+ '&nsccue;': { 'codepoints': [0x022E1], 'characters': '\u22E1' },
+ '&nsce;': { 'codepoints': [0x02AB0, 0x00338], 'characters': '\u2AB0\u0338' },
+ '&nscr;': { 'codepoints': [0x1D4C3], 'characters': '\uD835\uDCC3' },
+ '&nshortmid;': { 'codepoints': [0x02224], 'characters': '\u2224' },
+ '&nshortparallel;': { 'codepoints': [0x02226], 'characters': '\u2226' },
+ '&nsim;': { 'codepoints': [0x02241], 'characters': '\u2241' },
+ '&nsime;': { 'codepoints': [0x02244], 'characters': '\u2244' },
+ '&nsimeq;': { 'codepoints': [0x02244], 'characters': '\u2244' },
+ '&nsmid;': { 'codepoints': [0x02224], 'characters': '\u2224' },
+ '&nspar;': { 'codepoints': [0x02226], 'characters': '\u2226' },
+ '&nsqsube;': { 'codepoints': [0x022E2], 'characters': '\u22E2' },
+ '&nsqsupe;': { 'codepoints': [0x022E3], 'characters': '\u22E3' },
+ '&nsub;': { 'codepoints': [0x02284], 'characters': '\u2284' },
+ '&nsubE;': { 'codepoints': [0x02AC5, 0x00338], 'characters': '\u2AC5\u0338' },
+ '&nsube;': { 'codepoints': [0x02288], 'characters': '\u2288' },
+ '&nsubset;': { 'codepoints': [0x02282, 0x020D2], 'characters': '\u2282\u20D2' },
+ '&nsubseteq;': { 'codepoints': [0x02288], 'characters': '\u2288' },
+ '&nsubseteqq;': { 'codepoints': [0x02AC5, 0x00338], 'characters': '\u2AC5\u0338' },
+ '&nsucc;': { 'codepoints': [0x02281], 'characters': '\u2281' },
+ '&nsucceq;': { 'codepoints': [0x02AB0, 0x00338], 'characters': '\u2AB0\u0338' },
+ '&nsup;': { 'codepoints': [0x02285], 'characters': '\u2285' },
+ '&nsupE;': { 'codepoints': [0x02AC6, 0x00338], 'characters': '\u2AC6\u0338' },
+ '&nsupe;': { 'codepoints': [0x02289], 'characters': '\u2289' },
+ '&nsupset;': { 'codepoints': [0x02283, 0x020D2], 'characters': '\u2283\u20D2' },
+ '&nsupseteq;': { 'codepoints': [0x02289], 'characters': '\u2289' },
+ '&nsupseteqq;': { 'codepoints': [0x02AC6, 0x00338], 'characters': '\u2AC6\u0338' },
+ '&ntgl;': { 'codepoints': [0x02279], 'characters': '\u2279' },
+ '&ntilde': { 'codepoints': [0x000F1], 'characters': '\xF1' },
+ '&ntilde;': { 'codepoints': [0x000F1], 'characters': '\xF1' },
+ '&ntlg;': { 'codepoints': [0x02278], 'characters': '\u2278' },
+ '&ntriangleleft;': { 'codepoints': [0x022EA], 'characters': '\u22EA' },
+ '&ntrianglelefteq;': { 'codepoints': [0x022EC], 'characters': '\u22EC' },
+ '&ntriangleright;': { 'codepoints': [0x022EB], 'characters': '\u22EB' },
+ '&ntrianglerighteq;': { 'codepoints': [0x022ED], 'characters': '\u22ED' },
+ '&nu;': { 'codepoints': [0x003BD], 'characters': '\u03BD' },
+ '&num;': { 'codepoints': [0x00023], 'characters': '\x23' },
+ '&numero;': { 'codepoints': [0x02116], 'characters': '\u2116' },
+ '&numsp;': { 'codepoints': [0x02007], 'characters': '\u2007' },
+ '&nvDash;': { 'codepoints': [0x022AD], 'characters': '\u22AD' },
+ '&nvHarr;': { 'codepoints': [0x02904], 'characters': '\u2904' },
+ '&nvap;': { 'codepoints': [0x0224D, 0x020D2], 'characters': '\u224D\u20D2' },
+ '&nvdash;': { 'codepoints': [0x022AC], 'characters': '\u22AC' },
+ '&nvge;': { 'codepoints': [0x02265, 0x020D2], 'characters': '\u2265\u20D2' },
+ '&nvgt;': { 'codepoints': [0x0003E, 0x020D2], 'characters': '\x3E\u20D2' },
+ '&nvinfin;': { 'codepoints': [0x029DE], 'characters': '\u29DE' },
+ '&nvlArr;': { 'codepoints': [0x02902], 'characters': '\u2902' },
+ '&nvle;': { 'codepoints': [0x02264, 0x020D2], 'characters': '\u2264\u20D2' },
+ '&nvlt;': { 'codepoints': [0x0003C, 0x020D2], 'characters': '\x3C\u20D2' },
+ '&nvltrie;': { 'codepoints': [0x022B4, 0x020D2], 'characters': '\u22B4\u20D2' },
+ '&nvrArr;': { 'codepoints': [0x02903], 'characters': '\u2903' },
+ '&nvrtrie;': { 'codepoints': [0x022B5, 0x020D2], 'characters': '\u22B5\u20D2' },
+ '&nvsim;': { 'codepoints': [0x0223C, 0x020D2], 'characters': '\u223C\u20D2' },
+ '&nwArr;': { 'codepoints': [0x021D6], 'characters': '\u21D6' },
+ '&nwarhk;': { 'codepoints': [0x02923], 'characters': '\u2923' },
+ '&nwarr;': { 'codepoints': [0x02196], 'characters': '\u2196' },
+ '&nwarrow;': { 'codepoints': [0x02196], 'characters': '\u2196' },
+ '&nwnear;': { 'codepoints': [0x02927], 'characters': '\u2927' },
+ '&oS;': { 'codepoints': [0x024C8], 'characters': '\u24C8' },
+ '&oacute': { 'codepoints': [0x000F3], 'characters': '\xF3' },
+ '&oacute;': { 'codepoints': [0x000F3], 'characters': '\xF3' },
+ '&oast;': { 'codepoints': [0x0229B], 'characters': '\u229B' },
+ '&ocir;': { 'codepoints': [0x0229A], 'characters': '\u229A' },
+ '&ocirc': { 'codepoints': [0x000F4], 'characters': '\xF4' },
+ '&ocirc;': { 'codepoints': [0x000F4], 'characters': '\xF4' },
+ '&ocy;': { 'codepoints': [0x0043E], 'characters': '\u043E' },
+ '&odash;': { 'codepoints': [0x0229D], 'characters': '\u229D' },
+ '&odblac;': { 'codepoints': [0x00151], 'characters': '\u0151' },
+ '&odiv;': { 'codepoints': [0x02A38], 'characters': '\u2A38' },
+ '&odot;': { 'codepoints': [0x02299], 'characters': '\u2299' },
+ '&odsold;': { 'codepoints': [0x029BC], 'characters': '\u29BC' },
+ '&oelig;': { 'codepoints': [0x00153], 'characters': '\u0153' },
+ '&ofcir;': { 'codepoints': [0x029BF], 'characters': '\u29BF' },
+ '&ofr;': { 'codepoints': [0x1D52C], 'characters': '\uD835\uDD2C' },
+ '&ogon;': { 'codepoints': [0x002DB], 'characters': '\u02DB' },
+ '&ograve': { 'codepoints': [0x000F2], 'characters': '\xF2' },
+ '&ograve;': { 'codepoints': [0x000F2], 'characters': '\xF2' },
+ '&ogt;': { 'codepoints': [0x029C1], 'characters': '\u29C1' },
+ '&ohbar;': { 'codepoints': [0x029B5], 'characters': '\u29B5' },
+ '&ohm;': { 'codepoints': [0x003A9], 'characters': '\u03A9' },
+ '&oint;': { 'codepoints': [0x0222E], 'characters': '\u222E' },
+ '&olarr;': { 'codepoints': [0x021BA], 'characters': '\u21BA' },
+ '&olcir;': { 'codepoints': [0x029BE], 'characters': '\u29BE' },
+ '&olcross;': { 'codepoints': [0x029BB], 'characters': '\u29BB' },
+ '&oline;': { 'codepoints': [0x0203E], 'characters': '\u203E' },
+ '&olt;': { 'codepoints': [0x029C0], 'characters': '\u29C0' },
+ '&omacr;': { 'codepoints': [0x0014D], 'characters': '\u014D' },
+ '&omega;': { 'codepoints': [0x003C9], 'characters': '\u03C9' },
+ '&omicron;': { 'codepoints': [0x003BF], 'characters': '\u03BF' },
+ '&omid;': { 'codepoints': [0x029B6], 'characters': '\u29B6' },
+ '&ominus;': { 'codepoints': [0x02296], 'characters': '\u2296' },
+ '&oopf;': { 'codepoints': [0x1D560], 'characters': '\uD835\uDD60' },
+ '&opar;': { 'codepoints': [0x029B7], 'characters': '\u29B7' },
+ '&operp;': { 'codepoints': [0x029B9], 'characters': '\u29B9' },
+ '&oplus;': { 'codepoints': [0x02295], 'characters': '\u2295' },
+ '&or;': { 'codepoints': [0x02228], 'characters': '\u2228' },
+ '&orarr;': { 'codepoints': [0x021BB], 'characters': '\u21BB' },
+ '&ord;': { 'codepoints': [0x02A5D], 'characters': '\u2A5D' },
+ '&order;': { 'codepoints': [0x02134], 'characters': '\u2134' },
+ '&orderof;': { 'codepoints': [0x02134], 'characters': '\u2134' },
+ '&ordf': { 'codepoints': [0x000AA], 'characters': '\xAA' },
+ '&ordf;': { 'codepoints': [0x000AA], 'characters': '\xAA' },
+ '&ordm': { 'codepoints': [0x000BA], 'characters': '\xBA' },
+ '&ordm;': { 'codepoints': [0x000BA], 'characters': '\xBA' },
+ '&origof;': { 'codepoints': [0x022B6], 'characters': '\u22B6' },
+ '&oror;': { 'codepoints': [0x02A56], 'characters': '\u2A56' },
+ '&orslope;': { 'codepoints': [0x02A57], 'characters': '\u2A57' },
+ '&orv;': { 'codepoints': [0x02A5B], 'characters': '\u2A5B' },
+ '&oscr;': { 'codepoints': [0x02134], 'characters': '\u2134' },
+ '&oslash': { 'codepoints': [0x000F8], 'characters': '\xF8' },
+ '&oslash;': { 'codepoints': [0x000F8], 'characters': '\xF8' },
+ '&osol;': { 'codepoints': [0x02298], 'characters': '\u2298' },
+ '&otilde': { 'codepoints': [0x000F5], 'characters': '\xF5' },
+ '&otilde;': { 'codepoints': [0x000F5], 'characters': '\xF5' },
+ '&otimes;': { 'codepoints': [0x02297], 'characters': '\u2297' },
+ '&otimesas;': { 'codepoints': [0x02A36], 'characters': '\u2A36' },
+ '&ouml': { 'codepoints': [0x000F6], 'characters': '\xF6' },
+ '&ouml;': { 'codepoints': [0x000F6], 'characters': '\xF6' },
+ '&ovbar;': { 'codepoints': [0x0233D], 'characters': '\u233D' },
+ '&par;': { 'codepoints': [0x02225], 'characters': '\u2225' },
+ '&para': { 'codepoints': [0x000B6], 'characters': '\xB6' },
+ '&para;': { 'codepoints': [0x000B6], 'characters': '\xB6' },
+ '&parallel;': { 'codepoints': [0x02225], 'characters': '\u2225' },
+ '&parsim;': { 'codepoints': [0x02AF3], 'characters': '\u2AF3' },
+ '&parsl;': { 'codepoints': [0x02AFD], 'characters': '\u2AFD' },
+ '&part;': { 'codepoints': [0x02202], 'characters': '\u2202' },
+ '&pcy;': { 'codepoints': [0x0043F], 'characters': '\u043F' },
+ '&percnt;': { 'codepoints': [0x00025], 'characters': '\x25' },
+ '&period;': { 'codepoints': [0x0002E], 'characters': '\x2E' },
+ '&permil;': { 'codepoints': [0x02030], 'characters': '\u2030' },
+ '&perp;': { 'codepoints': [0x022A5], 'characters': '\u22A5' },
+ '&pertenk;': { 'codepoints': [0x02031], 'characters': '\u2031' },
+ '&pfr;': { 'codepoints': [0x1D52D], 'characters': '\uD835\uDD2D' },
+ '&phi;': { 'codepoints': [0x003C6], 'characters': '\u03C6' },
+ '&phiv;': { 'codepoints': [0x003D5], 'characters': '\u03D5' },
+ '&phmmat;': { 'codepoints': [0x02133], 'characters': '\u2133' },
+ '&phone;': { 'codepoints': [0x0260E], 'characters': '\u260E' },
+ '&pi;': { 'codepoints': [0x003C0], 'characters': '\u03C0' },
+ '&pitchfork;': { 'codepoints': [0x022D4], 'characters': '\u22D4' },
+ '&piv;': { 'codepoints': [0x003D6], 'characters': '\u03D6' },
+ '&planck;': { 'codepoints': [0x0210F], 'characters': '\u210F' },
+ '&planckh;': { 'codepoints': [0x0210E], 'characters': '\u210E' },
+ '&plankv;': { 'codepoints': [0x0210F], 'characters': '\u210F' },
+ '&plus;': { 'codepoints': [0x0002B], 'characters': '\x2B' },
+ '&plusacir;': { 'codepoints': [0x02A23], 'characters': '\u2A23' },
+ '&plusb;': { 'codepoints': [0x0229E], 'characters': '\u229E' },
+ '&pluscir;': { 'codepoints': [0x02A22], 'characters': '\u2A22' },
+ '&plusdo;': { 'codepoints': [0x02214], 'characters': '\u2214' },
+ '&plusdu;': { 'codepoints': [0x02A25], 'characters': '\u2A25' },
+ '&pluse;': { 'codepoints': [0x02A72], 'characters': '\u2A72' },
+ '&plusmn': { 'codepoints': [0x000B1], 'characters': '\xB1' },
+ '&plusmn;': { 'codepoints': [0x000B1], 'characters': '\xB1' },
+ '&plussim;': { 'codepoints': [0x02A26], 'characters': '\u2A26' },
+ '&plustwo;': { 'codepoints': [0x02A27], 'characters': '\u2A27' },
+ '&pm;': { 'codepoints': [0x000B1], 'characters': '\xB1' },
+ '&pointint;': { 'codepoints': [0x02A15], 'characters': '\u2A15' },
+ '&popf;': { 'codepoints': [0x1D561], 'characters': '\uD835\uDD61' },
+ '&pound': { 'codepoints': [0x000A3], 'characters': '\xA3' },
+ '&pound;': { 'codepoints': [0x000A3], 'characters': '\xA3' },
+ '&pr;': { 'codepoints': [0x0227A], 'characters': '\u227A' },
+ '&prE;': { 'codepoints': [0x02AB3], 'characters': '\u2AB3' },
+ '&prap;': { 'codepoints': [0x02AB7], 'characters': '\u2AB7' },
+ '&prcue;': { 'codepoints': [0x0227C], 'characters': '\u227C' },
+ '&pre;': { 'codepoints': [0x02AAF], 'characters': '\u2AAF' },
+ '&prec;': { 'codepoints': [0x0227A], 'characters': '\u227A' },
+ '&precapprox;': { 'codepoints': [0x02AB7], 'characters': '\u2AB7' },
+ '&preccurlyeq;': { 'codepoints': [0x0227C], 'characters': '\u227C' },
+ '&preceq;': { 'codepoints': [0x02AAF], 'characters': '\u2AAF' },
+ '&precnapprox;': { 'codepoints': [0x02AB9], 'characters': '\u2AB9' },
+ '&precneqq;': { 'codepoints': [0x02AB5], 'characters': '\u2AB5' },
+ '&precnsim;': { 'codepoints': [0x022E8], 'characters': '\u22E8' },
+ '&precsim;': { 'codepoints': [0x0227E], 'characters': '\u227E' },
+ '&prime;': { 'codepoints': [0x02032], 'characters': '\u2032' },
+ '&primes;': { 'codepoints': [0x02119], 'characters': '\u2119' },
+ '&prnE;': { 'codepoints': [0x02AB5], 'characters': '\u2AB5' },
+ '&prnap;': { 'codepoints': [0x02AB9], 'characters': '\u2AB9' },
+ '&prnsim;': { 'codepoints': [0x022E8], 'characters': '\u22E8' },
+ '&prod;': { 'codepoints': [0x0220F], 'characters': '\u220F' },
+ '&profalar;': { 'codepoints': [0x0232E], 'characters': '\u232E' },
+ '&profline;': { 'codepoints': [0x02312], 'characters': '\u2312' },
+ '&profsurf;': { 'codepoints': [0x02313], 'characters': '\u2313' },
+ '&prop;': { 'codepoints': [0x0221D], 'characters': '\u221D' },
+ '&propto;': { 'codepoints': [0x0221D], 'characters': '\u221D' },
+ '&prsim;': { 'codepoints': [0x0227E], 'characters': '\u227E' },
+ '&prurel;': { 'codepoints': [0x022B0], 'characters': '\u22B0' },
+ '&pscr;': { 'codepoints': [0x1D4C5], 'characters': '\uD835\uDCC5' },
+ '&psi;': { 'codepoints': [0x003C8], 'characters': '\u03C8' },
+ '&puncsp;': { 'codepoints': [0x02008], 'characters': '\u2008' },
+ '&qfr;': { 'codepoints': [0x1D52E], 'characters': '\uD835\uDD2E' },
+ '&qint;': { 'codepoints': [0x02A0C], 'characters': '\u2A0C' },
+ '&qopf;': { 'codepoints': [0x1D562], 'characters': '\uD835\uDD62' },
+ '&qprime;': { 'codepoints': [0x02057], 'characters': '\u2057' },
+ '&qscr;': { 'codepoints': [0x1D4C6], 'characters': '\uD835\uDCC6' },
+ '&quaternions;': { 'codepoints': [0x0210D], 'characters': '\u210D' },
+ '&quatint;': { 'codepoints': [0x02A16], 'characters': '\u2A16' },
+ '&quest;': { 'codepoints': [0x0003F], 'characters': '\x3F' },
+ '&questeq;': { 'codepoints': [0x0225F], 'characters': '\u225F' },
+ '&quot': { 'codepoints': [0x00022], 'characters': '\x22' },
+ '&quot;': { 'codepoints': [0x00022], 'characters': '\x22' },
+ '&rAarr;': { 'codepoints': [0x021DB], 'characters': '\u21DB' },
+ '&rArr;': { 'codepoints': [0x021D2], 'characters': '\u21D2' },
+ '&rAtail;': { 'codepoints': [0x0291C], 'characters': '\u291C' },
+ '&rBarr;': { 'codepoints': [0x0290F], 'characters': '\u290F' },
+ '&rHar;': { 'codepoints': [0x02964], 'characters': '\u2964' },
+ '&race;': { 'codepoints': [0x0223D, 0x00331], 'characters': '\u223D\u0331' },
+ '&racute;': { 'codepoints': [0x00155], 'characters': '\u0155' },
+ '&radic;': { 'codepoints': [0x0221A], 'characters': '\u221A' },
+ '&raemptyv;': { 'codepoints': [0x029B3], 'characters': '\u29B3' },
+ '&rang;': { 'codepoints': [0x027E9], 'characters': '\u27E9' },
+ '&rangd;': { 'codepoints': [0x02992], 'characters': '\u2992' },
+ '&range;': { 'codepoints': [0x029A5], 'characters': '\u29A5' },
+ '&rangle;': { 'codepoints': [0x027E9], 'characters': '\u27E9' },
+ '&raquo': { 'codepoints': [0x000BB], 'characters': '\xBB' },
+ '&raquo;': { 'codepoints': [0x000BB], 'characters': '\xBB' },
+ '&rarr;': { 'codepoints': [0x02192], 'characters': '\u2192' },
+ '&rarrap;': { 'codepoints': [0x02975], 'characters': '\u2975' },
+ '&rarrb;': { 'codepoints': [0x021E5], 'characters': '\u21E5' },
+ '&rarrbfs;': { 'codepoints': [0x02920], 'characters': '\u2920' },
+ '&rarrc;': { 'codepoints': [0x02933], 'characters': '\u2933' },
+ '&rarrfs;': { 'codepoints': [0x0291E], 'characters': '\u291E' },
+ '&rarrhk;': { 'codepoints': [0x021AA], 'characters': '\u21AA' },
+ '&rarrlp;': { 'codepoints': [0x021AC], 'characters': '\u21AC' },
+ '&rarrpl;': { 'codepoints': [0x02945], 'characters': '\u2945' },
+ '&rarrsim;': { 'codepoints': [0x02974], 'characters': '\u2974' },
+ '&rarrtl;': { 'codepoints': [0x021A3], 'characters': '\u21A3' },
+ '&rarrw;': { 'codepoints': [0x0219D], 'characters': '\u219D' },
+ '&ratail;': { 'codepoints': [0x0291A], 'characters': '\u291A' },
+ '&ratio;': { 'codepoints': [0x02236], 'characters': '\u2236' },
+ '&rationals;': { 'codepoints': [0x0211A], 'characters': '\u211A' },
+ '&rbarr;': { 'codepoints': [0x0290D], 'characters': '\u290D' },
+ '&rbbrk;': { 'codepoints': [0x02773], 'characters': '\u2773' },
+ '&rbrace;': { 'codepoints': [0x0007D], 'characters': '\x7D' },
+ '&rbrack;': { 'codepoints': [0x0005D], 'characters': '\x5D' },
+ '&rbrke;': { 'codepoints': [0x0298C], 'characters': '\u298C' },
+ '&rbrksld;': { 'codepoints': [0x0298E], 'characters': '\u298E' },
+ '&rbrkslu;': { 'codepoints': [0x02990], 'characters': '\u2990' },
+ '&rcaron;': { 'codepoints': [0x00159], 'characters': '\u0159' },
+ '&rcedil;': { 'codepoints': [0x00157], 'characters': '\u0157' },
+ '&rceil;': { 'codepoints': [0x02309], 'characters': '\u2309' },
+ '&rcub;': { 'codepoints': [0x0007D], 'characters': '\x7D' },
+ '&rcy;': { 'codepoints': [0x00440], 'characters': '\u0440' },
+ '&rdca;': { 'codepoints': [0x02937], 'characters': '\u2937' },
+ '&rdldhar;': { 'codepoints': [0x02969], 'characters': '\u2969' },
+ '&rdquo;': { 'codepoints': [0x0201D], 'characters': '\u201D' },
+ '&rdquor;': { 'codepoints': [0x0201D], 'characters': '\u201D' },
+ '&rdsh;': { 'codepoints': [0x021B3], 'characters': '\u21B3' },
+ '&real;': { 'codepoints': [0x0211C], 'characters': '\u211C' },
+ '&realine;': { 'codepoints': [0x0211B], 'characters': '\u211B' },
+ '&realpart;': { 'codepoints': [0x0211C], 'characters': '\u211C' },
+ '&reals;': { 'codepoints': [0x0211D], 'characters': '\u211D' },
+ '&rect;': { 'codepoints': [0x025AD], 'characters': '\u25AD' },
+ '&reg': { 'codepoints': [0x000AE], 'characters': '\xAE' },
+ '&reg;': { 'codepoints': [0x000AE], 'characters': '\xAE' },
+ '&rfisht;': { 'codepoints': [0x0297D], 'characters': '\u297D' },
+ '&rfloor;': { 'codepoints': [0x0230B], 'characters': '\u230B' },
+ '&rfr;': { 'codepoints': [0x1D52F], 'characters': '\uD835\uDD2F' },
+ '&rhard;': { 'codepoints': [0x021C1], 'characters': '\u21C1' },
+ '&rharu;': { 'codepoints': [0x021C0], 'characters': '\u21C0' },
+ '&rharul;': { 'codepoints': [0x0296C], 'characters': '\u296C' },
+ '&rho;': { 'codepoints': [0x003C1], 'characters': '\u03C1' },
+ '&rhov;': { 'codepoints': [0x003F1], 'characters': '\u03F1' },
+ '&rightarrow;': { 'codepoints': [0x02192], 'characters': '\u2192' },
+ '&rightarrowtail;': { 'codepoints': [0x021A3], 'characters': '\u21A3' },
+ '&rightharpoondown;': { 'codepoints': [0x021C1], 'characters': '\u21C1' },
+ '&rightharpoonup;': { 'codepoints': [0x021C0], 'characters': '\u21C0' },
+ '&rightleftarrows;': { 'codepoints': [0x021C4], 'characters': '\u21C4' },
+ '&rightleftharpoons;': { 'codepoints': [0x021CC], 'characters': '\u21CC' },
+ '&rightrightarrows;': { 'codepoints': [0x021C9], 'characters': '\u21C9' },
+ '&rightsquigarrow;': { 'codepoints': [0x0219D], 'characters': '\u219D' },
+ '&rightthreetimes;': { 'codepoints': [0x022CC], 'characters': '\u22CC' },
+ '&ring;': { 'codepoints': [0x002DA], 'characters': '\u02DA' },
+ '&risingdotseq;': { 'codepoints': [0x02253], 'characters': '\u2253' },
+ '&rlarr;': { 'codepoints': [0x021C4], 'characters': '\u21C4' },
+ '&rlhar;': { 'codepoints': [0x021CC], 'characters': '\u21CC' },
+ '&rlm;': { 'codepoints': [0x0200F], 'characters': '\u200F' },
+ '&rmoust;': { 'codepoints': [0x023B1], 'characters': '\u23B1' },
+ '&rmoustache;': { 'codepoints': [0x023B1], 'characters': '\u23B1' },
+ '&rnmid;': { 'codepoints': [0x02AEE], 'characters': '\u2AEE' },
+ '&roang;': { 'codepoints': [0x027ED], 'characters': '\u27ED' },
+ '&roarr;': { 'codepoints': [0x021FE], 'characters': '\u21FE' },
+ '&robrk;': { 'codepoints': [0x027E7], 'characters': '\u27E7' },
+ '&ropar;': { 'codepoints': [0x02986], 'characters': '\u2986' },
+ '&ropf;': { 'codepoints': [0x1D563], 'characters': '\uD835\uDD63' },
+ '&roplus;': { 'codepoints': [0x02A2E], 'characters': '\u2A2E' },
+ '&rotimes;': { 'codepoints': [0x02A35], 'characters': '\u2A35' },
+ '&rpar;': { 'codepoints': [0x00029], 'characters': '\x29' },
+ '&rpargt;': { 'codepoints': [0x02994], 'characters': '\u2994' },
+ '&rppolint;': { 'codepoints': [0x02A12], 'characters': '\u2A12' },
+ '&rrarr;': { 'codepoints': [0x021C9], 'characters': '\u21C9' },
+ '&rsaquo;': { 'codepoints': [0x0203A], 'characters': '\u203A' },
+ '&rscr;': { 'codepoints': [0x1D4C7], 'characters': '\uD835\uDCC7' },
+ '&rsh;': { 'codepoints': [0x021B1], 'characters': '\u21B1' },
+ '&rsqb;': { 'codepoints': [0x0005D], 'characters': '\x5D' },
+ '&rsquo;': { 'codepoints': [0x02019], 'characters': '\u2019' },
+ '&rsquor;': { 'codepoints': [0x02019], 'characters': '\u2019' },
+ '&rthree;': { 'codepoints': [0x022CC], 'characters': '\u22CC' },
+ '&rtimes;': { 'codepoints': [0x022CA], 'characters': '\u22CA' },
+ '&rtri;': { 'codepoints': [0x025B9], 'characters': '\u25B9' },
+ '&rtrie;': { 'codepoints': [0x022B5], 'characters': '\u22B5' },
+ '&rtrif;': { 'codepoints': [0x025B8], 'characters': '\u25B8' },
+ '&rtriltri;': { 'codepoints': [0x029CE], 'characters': '\u29CE' },
+ '&ruluhar;': { 'codepoints': [0x02968], 'characters': '\u2968' },
+ '&rx;': { 'codepoints': [0x0211E], 'characters': '\u211E' },
+ '&sacute;': { 'codepoints': [0x0015B], 'characters': '\u015B' },
+ '&sbquo;': { 'codepoints': [0x0201A], 'characters': '\u201A' },
+ '&sc;': { 'codepoints': [0x0227B], 'characters': '\u227B' },
+ '&scE;': { 'codepoints': [0x02AB4], 'characters': '\u2AB4' },
+ '&scap;': { 'codepoints': [0x02AB8], 'characters': '\u2AB8' },
+ '&scaron;': { 'codepoints': [0x00161], 'characters': '\u0161' },
+ '&sccue;': { 'codepoints': [0x0227D], 'characters': '\u227D' },
+ '&sce;': { 'codepoints': [0x02AB0], 'characters': '\u2AB0' },
+ '&scedil;': { 'codepoints': [0x0015F], 'characters': '\u015F' },
+ '&scirc;': { 'codepoints': [0x0015D], 'characters': '\u015D' },
+ '&scnE;': { 'codepoints': [0x02AB6], 'characters': '\u2AB6' },
+ '&scnap;': { 'codepoints': [0x02ABA], 'characters': '\u2ABA' },
+ '&scnsim;': { 'codepoints': [0x022E9], 'characters': '\u22E9' },
+ '&scpolint;': { 'codepoints': [0x02A13], 'characters': '\u2A13' },
+ '&scsim;': { 'codepoints': [0x0227F], 'characters': '\u227F' },
+ '&scy;': { 'codepoints': [0x00441], 'characters': '\u0441' },
+ '&sdot;': { 'codepoints': [0x022C5], 'characters': '\u22C5' },
+ '&sdotb;': { 'codepoints': [0x022A1], 'characters': '\u22A1' },
+ '&sdote;': { 'codepoints': [0x02A66], 'characters': '\u2A66' },
+ '&seArr;': { 'codepoints': [0x021D8], 'characters': '\u21D8' },
+ '&searhk;': { 'codepoints': [0x02925], 'characters': '\u2925' },
+ '&searr;': { 'codepoints': [0x02198], 'characters': '\u2198' },
+ '&searrow;': { 'codepoints': [0x02198], 'characters': '\u2198' },
+ '&sect': { 'codepoints': [0x000A7], 'characters': '\xA7' },
+ '&sect;': { 'codepoints': [0x000A7], 'characters': '\xA7' },
+ '&semi;': { 'codepoints': [0x0003B], 'characters': '\x3B' },
+ '&seswar;': { 'codepoints': [0x02929], 'characters': '\u2929' },
+ '&setminus;': { 'codepoints': [0x02216], 'characters': '\u2216' },
+ '&setmn;': { 'codepoints': [0x02216], 'characters': '\u2216' },
+ '&sext;': { 'codepoints': [0x02736], 'characters': '\u2736' },
+ '&sfr;': { 'codepoints': [0x1D530], 'characters': '\uD835\uDD30' },
+ '&sfrown;': { 'codepoints': [0x02322], 'characters': '\u2322' },
+ '&sharp;': { 'codepoints': [0x0266F], 'characters': '\u266F' },
+ '&shchcy;': { 'codepoints': [0x00449], 'characters': '\u0449' },
+ '&shcy;': { 'codepoints': [0x00448], 'characters': '\u0448' },
+ '&shortmid;': { 'codepoints': [0x02223], 'characters': '\u2223' },
+ '&shortparallel;': { 'codepoints': [0x02225], 'characters': '\u2225' },
+ '&shy': { 'codepoints': [0x000AD], 'characters': '\xAD' },
+ '&shy;': { 'codepoints': [0x000AD], 'characters': '\xAD' },
+ '&sigma;': { 'codepoints': [0x003C3], 'characters': '\u03C3' },
+ '&sigmaf;': { 'codepoints': [0x003C2], 'characters': '\u03C2' },
+ '&sigmav;': { 'codepoints': [0x003C2], 'characters': '\u03C2' },
+ '&sim;': { 'codepoints': [0x0223C], 'characters': '\u223C' },
+ '&simdot;': { 'codepoints': [0x02A6A], 'characters': '\u2A6A' },
+ '&sime;': { 'codepoints': [0x02243], 'characters': '\u2243' },
+ '&simeq;': { 'codepoints': [0x02243], 'characters': '\u2243' },
+ '&simg;': { 'codepoints': [0x02A9E], 'characters': '\u2A9E' },
+ '&simgE;': { 'codepoints': [0x02AA0], 'characters': '\u2AA0' },
+ '&siml;': { 'codepoints': [0x02A9D], 'characters': '\u2A9D' },
+ '&simlE;': { 'codepoints': [0x02A9F], 'characters': '\u2A9F' },
+ '&simne;': { 'codepoints': [0x02246], 'characters': '\u2246' },
+ '&simplus;': { 'codepoints': [0x02A24], 'characters': '\u2A24' },
+ '&simrarr;': { 'codepoints': [0x02972], 'characters': '\u2972' },
+ '&slarr;': { 'codepoints': [0x02190], 'characters': '\u2190' },
+ '&smallsetminus;': { 'codepoints': [0x02216], 'characters': '\u2216' },
+ '&smashp;': { 'codepoints': [0x02A33], 'characters': '\u2A33' },
+ '&smeparsl;': { 'codepoints': [0x029E4], 'characters': '\u29E4' },
+ '&smid;': { 'codepoints': [0x02223], 'characters': '\u2223' },
+ '&smile;': { 'codepoints': [0x02323], 'characters': '\u2323' },
+ '&smt;': { 'codepoints': [0x02AAA], 'characters': '\u2AAA' },
+ '&smte;': { 'codepoints': [0x02AAC], 'characters': '\u2AAC' },
+ '&smtes;': { 'codepoints': [0x02AAC, 0x0FE00], 'characters': '\u2AAC\uFE00' },
+ '&softcy;': { 'codepoints': [0x0044C], 'characters': '\u044C' },
+ '&sol;': { 'codepoints': [0x0002F], 'characters': '\x2F' },
+ '&solb;': { 'codepoints': [0x029C4], 'characters': '\u29C4' },
+ '&solbar;': { 'codepoints': [0x0233F], 'characters': '\u233F' },
+ '&sopf;': { 'codepoints': [0x1D564], 'characters': '\uD835\uDD64' },
+ '&spades;': { 'codepoints': [0x02660], 'characters': '\u2660' },
+ '&spadesuit;': { 'codepoints': [0x02660], 'characters': '\u2660' },
+ '&spar;': { 'codepoints': [0x02225], 'characters': '\u2225' },
+ '&sqcap;': { 'codepoints': [0x02293], 'characters': '\u2293' },
+ '&sqcaps;': { 'codepoints': [0x02293, 0x0FE00], 'characters': '\u2293\uFE00' },
+ '&sqcup;': { 'codepoints': [0x02294], 'characters': '\u2294' },
+ '&sqcups;': { 'codepoints': [0x02294, 0x0FE00], 'characters': '\u2294\uFE00' },
+ '&sqsub;': { 'codepoints': [0x0228F], 'characters': '\u228F' },
+ '&sqsube;': { 'codepoints': [0x02291], 'characters': '\u2291' },
+ '&sqsubset;': { 'codepoints': [0x0228F], 'characters': '\u228F' },
+ '&sqsubseteq;': { 'codepoints': [0x02291], 'characters': '\u2291' },
+ '&sqsup;': { 'codepoints': [0x02290], 'characters': '\u2290' },
+ '&sqsupe;': { 'codepoints': [0x02292], 'characters': '\u2292' },
+ '&sqsupset;': { 'codepoints': [0x02290], 'characters': '\u2290' },
+ '&sqsupseteq;': { 'codepoints': [0x02292], 'characters': '\u2292' },
+ '&squ;': { 'codepoints': [0x025A1], 'characters': '\u25A1' },
+ '&square;': { 'codepoints': [0x025A1], 'characters': '\u25A1' },
+ '&squarf;': { 'codepoints': [0x025AA], 'characters': '\u25AA' },
+ '&squf;': { 'codepoints': [0x025AA], 'characters': '\u25AA' },
+ '&srarr;': { 'codepoints': [0x02192], 'characters': '\u2192' },
+ '&sscr;': { 'codepoints': [0x1D4C8], 'characters': '\uD835\uDCC8' },
+ '&ssetmn;': { 'codepoints': [0x02216], 'characters': '\u2216' },
+ '&ssmile;': { 'codepoints': [0x02323], 'characters': '\u2323' },
+ '&sstarf;': { 'codepoints': [0x022C6], 'characters': '\u22C6' },
+ '&star;': { 'codepoints': [0x02606], 'characters': '\u2606' },
+ '&starf;': { 'codepoints': [0x02605], 'characters': '\u2605' },
+ '&straightepsilon;': { 'codepoints': [0x003F5], 'characters': '\u03F5' },
+ '&straightphi;': { 'codepoints': [0x003D5], 'characters': '\u03D5' },
+ '&strns;': { 'codepoints': [0x000AF], 'characters': '\xAF' },
+ '&sub;': { 'codepoints': [0x02282], 'characters': '\u2282' },
+ '&subE;': { 'codepoints': [0x02AC5], 'characters': '\u2AC5' },
+ '&subdot;': { 'codepoints': [0x02ABD], 'characters': '\u2ABD' },
+ '&sube;': { 'codepoints': [0x02286], 'characters': '\u2286' },
+ '&subedot;': { 'codepoints': [0x02AC3], 'characters': '\u2AC3' },
+ '&submult;': { 'codepoints': [0x02AC1], 'characters': '\u2AC1' },
+ '&subnE;': { 'codepoints': [0x02ACB], 'characters': '\u2ACB' },
+ '&subne;': { 'codepoints': [0x0228A], 'characters': '\u228A' },
+ '&subplus;': { 'codepoints': [0x02ABF], 'characters': '\u2ABF' },
+ '&subrarr;': { 'codepoints': [0x02979], 'characters': '\u2979' },
+ '&subset;': { 'codepoints': [0x02282], 'characters': '\u2282' },
+ '&subseteq;': { 'codepoints': [0x02286], 'characters': '\u2286' },
+ '&subseteqq;': { 'codepoints': [0x02AC5], 'characters': '\u2AC5' },
+ '&subsetneq;': { 'codepoints': [0x0228A], 'characters': '\u228A' },
+ '&subsetneqq;': { 'codepoints': [0x02ACB], 'characters': '\u2ACB' },
+ '&subsim;': { 'codepoints': [0x02AC7], 'characters': '\u2AC7' },
+ '&subsub;': { 'codepoints': [0x02AD5], 'characters': '\u2AD5' },
+ '&subsup;': { 'codepoints': [0x02AD3], 'characters': '\u2AD3' },
+ '&succ;': { 'codepoints': [0x0227B], 'characters': '\u227B' },
+ '&succapprox;': { 'codepoints': [0x02AB8], 'characters': '\u2AB8' },
+ '&succcurlyeq;': { 'codepoints': [0x0227D], 'characters': '\u227D' },
+ '&succeq;': { 'codepoints': [0x02AB0], 'characters': '\u2AB0' },
+ '&succnapprox;': { 'codepoints': [0x02ABA], 'characters': '\u2ABA' },
+ '&succneqq;': { 'codepoints': [0x02AB6], 'characters': '\u2AB6' },
+ '&succnsim;': { 'codepoints': [0x022E9], 'characters': '\u22E9' },
+ '&succsim;': { 'codepoints': [0x0227F], 'characters': '\u227F' },
+ '&sum;': { 'codepoints': [0x02211], 'characters': '\u2211' },
+ '&sung;': { 'codepoints': [0x0266A], 'characters': '\u266A' },
+ '&sup1': { 'codepoints': [0x000B9], 'characters': '\xB9' },
+ '&sup1;': { 'codepoints': [0x000B9], 'characters': '\xB9' },
+ '&sup2': { 'codepoints': [0x000B2], 'characters': '\xB2' },
+ '&sup2;': { 'codepoints': [0x000B2], 'characters': '\xB2' },
+ '&sup3': { 'codepoints': [0x000B3], 'characters': '\xB3' },
+ '&sup3;': { 'codepoints': [0x000B3], 'characters': '\xB3' },
+ '&sup;': { 'codepoints': [0x02283], 'characters': '\u2283' },
+ '&supE;': { 'codepoints': [0x02AC6], 'characters': '\u2AC6' },
+ '&supdot;': { 'codepoints': [0x02ABE], 'characters': '\u2ABE' },
+ '&supdsub;': { 'codepoints': [0x02AD8], 'characters': '\u2AD8' },
+ '&supe;': { 'codepoints': [0x02287], 'characters': '\u2287' },
+ '&supedot;': { 'codepoints': [0x02AC4], 'characters': '\u2AC4' },
+ '&suphsol;': { 'codepoints': [0x027C9], 'characters': '\u27C9' },
+ '&suphsub;': { 'codepoints': [0x02AD7], 'characters': '\u2AD7' },
+ '&suplarr;': { 'codepoints': [0x0297B], 'characters': '\u297B' },
+ '&supmult;': { 'codepoints': [0x02AC2], 'characters': '\u2AC2' },
+ '&supnE;': { 'codepoints': [0x02ACC], 'characters': '\u2ACC' },
+ '&supne;': { 'codepoints': [0x0228B], 'characters': '\u228B' },
+ '&supplus;': { 'codepoints': [0x02AC0], 'characters': '\u2AC0' },
+ '&supset;': { 'codepoints': [0x02283], 'characters': '\u2283' },
+ '&supseteq;': { 'codepoints': [0x02287], 'characters': '\u2287' },
+ '&supseteqq;': { 'codepoints': [0x02AC6], 'characters': '\u2AC6' },
+ '&supsetneq;': { 'codepoints': [0x0228B], 'characters': '\u228B' },
+ '&supsetneqq;': { 'codepoints': [0x02ACC], 'characters': '\u2ACC' },
+ '&supsim;': { 'codepoints': [0x02AC8], 'characters': '\u2AC8' },
+ '&supsub;': { 'codepoints': [0x02AD4], 'characters': '\u2AD4' },
+ '&supsup;': { 'codepoints': [0x02AD6], 'characters': '\u2AD6' },
+ '&swArr;': { 'codepoints': [0x021D9], 'characters': '\u21D9' },
+ '&swarhk;': { 'codepoints': [0x02926], 'characters': '\u2926' },
+ '&swarr;': { 'codepoints': [0x02199], 'characters': '\u2199' },
+ '&swarrow;': { 'codepoints': [0x02199], 'characters': '\u2199' },
+ '&swnwar;': { 'codepoints': [0x0292A], 'characters': '\u292A' },
+ '&szlig': { 'codepoints': [0x000DF], 'characters': '\xDF' },
+ '&szlig;': { 'codepoints': [0x000DF], 'characters': '\xDF' },
+ '&target;': { 'codepoints': [0x02316], 'characters': '\u2316' },
+ '&tau;': { 'codepoints': [0x003C4], 'characters': '\u03C4' },
+ '&tbrk;': { 'codepoints': [0x023B4], 'characters': '\u23B4' },
+ '&tcaron;': { 'codepoints': [0x00165], 'characters': '\u0165' },
+ '&tcedil;': { 'codepoints': [0x00163], 'characters': '\u0163' },
+ '&tcy;': { 'codepoints': [0x00442], 'characters': '\u0442' },
+ '&tdot;': { 'codepoints': [0x020DB], 'characters': '\u20DB' },
+ '&telrec;': { 'codepoints': [0x02315], 'characters': '\u2315' },
+ '&tfr;': { 'codepoints': [0x1D531], 'characters': '\uD835\uDD31' },
+ '&there4;': { 'codepoints': [0x02234], 'characters': '\u2234' },
+ '&therefore;': { 'codepoints': [0x02234], 'characters': '\u2234' },
+ '&theta;': { 'codepoints': [0x003B8], 'characters': '\u03B8' },
+ '&thetasym;': { 'codepoints': [0x003D1], 'characters': '\u03D1' },
+ '&thetav;': { 'codepoints': [0x003D1], 'characters': '\u03D1' },
+ '&thickapprox;': { 'codepoints': [0x02248], 'characters': '\u2248' },
+ '&thicksim;': { 'codepoints': [0x0223C], 'characters': '\u223C' },
+ '&thinsp;': { 'codepoints': [0x02009], 'characters': '\u2009' },
+ '&thkap;': { 'codepoints': [0x02248], 'characters': '\u2248' },
+ '&thksim;': { 'codepoints': [0x0223C], 'characters': '\u223C' },
+ '&thorn': { 'codepoints': [0x000FE], 'characters': '\xFE' },
+ '&thorn;': { 'codepoints': [0x000FE], 'characters': '\xFE' },
+ '&tilde;': { 'codepoints': [0x002DC], 'characters': '\u02DC' },
+ '&times': { 'codepoints': [0x000D7], 'characters': '\xD7' },
+ '&times;': { 'codepoints': [0x000D7], 'characters': '\xD7' },
+ '&timesb;': { 'codepoints': [0x022A0], 'characters': '\u22A0' },
+ '&timesbar;': { 'codepoints': [0x02A31], 'characters': '\u2A31' },
+ '&timesd;': { 'codepoints': [0x02A30], 'characters': '\u2A30' },
+ '&tint;': { 'codepoints': [0x0222D], 'characters': '\u222D' },
+ '&toea;': { 'codepoints': [0x02928], 'characters': '\u2928' },
+ '&top;': { 'codepoints': [0x022A4], 'characters': '\u22A4' },
+ '&topbot;': { 'codepoints': [0x02336], 'characters': '\u2336' },
+ '&topcir;': { 'codepoints': [0x02AF1], 'characters': '\u2AF1' },
+ '&topf;': { 'codepoints': [0x1D565], 'characters': '\uD835\uDD65' },
+ '&topfork;': { 'codepoints': [0x02ADA], 'characters': '\u2ADA' },
+ '&tosa;': { 'codepoints': [0x02929], 'characters': '\u2929' },
+ '&tprime;': { 'codepoints': [0x02034], 'characters': '\u2034' },
+ '&trade;': { 'codepoints': [0x02122], 'characters': '\u2122' },
+ '&triangle;': { 'codepoints': [0x025B5], 'characters': '\u25B5' },
+ '&triangledown;': { 'codepoints': [0x025BF], 'characters': '\u25BF' },
+ '&triangleleft;': { 'codepoints': [0x025C3], 'characters': '\u25C3' },
+ '&trianglelefteq;': { 'codepoints': [0x022B4], 'characters': '\u22B4' },
+ '&triangleq;': { 'codepoints': [0x0225C], 'characters': '\u225C' },
+ '&triangleright;': { 'codepoints': [0x025B9], 'characters': '\u25B9' },
+ '&trianglerighteq;': { 'codepoints': [0x022B5], 'characters': '\u22B5' },
+ '&tridot;': { 'codepoints': [0x025EC], 'characters': '\u25EC' },
+ '&trie;': { 'codepoints': [0x0225C], 'characters': '\u225C' },
+ '&triminus;': { 'codepoints': [0x02A3A], 'characters': '\u2A3A' },
+ '&triplus;': { 'codepoints': [0x02A39], 'characters': '\u2A39' },
+ '&trisb;': { 'codepoints': [0x029CD], 'characters': '\u29CD' },
+ '&tritime;': { 'codepoints': [0x02A3B], 'characters': '\u2A3B' },
+ '&trpezium;': { 'codepoints': [0x023E2], 'characters': '\u23E2' },
+ '&tscr;': { 'codepoints': [0x1D4C9], 'characters': '\uD835\uDCC9' },
+ '&tscy;': { 'codepoints': [0x00446], 'characters': '\u0446' },
+ '&tshcy;': { 'codepoints': [0x0045B], 'characters': '\u045B' },
+ '&tstrok;': { 'codepoints': [0x00167], 'characters': '\u0167' },
+ '&twixt;': { 'codepoints': [0x0226C], 'characters': '\u226C' },
+ '&twoheadleftarrow;': { 'codepoints': [0x0219E], 'characters': '\u219E' },
+ '&twoheadrightarrow;': { 'codepoints': [0x021A0], 'characters': '\u21A0' },
+ '&uArr;': { 'codepoints': [0x021D1], 'characters': '\u21D1' },
+ '&uHar;': { 'codepoints': [0x02963], 'characters': '\u2963' },
+ '&uacute': { 'codepoints': [0x000FA], 'characters': '\xFA' },
+ '&uacute;': { 'codepoints': [0x000FA], 'characters': '\xFA' },
+ '&uarr;': { 'codepoints': [0x02191], 'characters': '\u2191' },
+ '&ubrcy;': { 'codepoints': [0x0045E], 'characters': '\u045E' },
+ '&ubreve;': { 'codepoints': [0x0016D], 'characters': '\u016D' },
+ '&ucirc': { 'codepoints': [0x000FB], 'characters': '\xFB' },
+ '&ucirc;': { 'codepoints': [0x000FB], 'characters': '\xFB' },
+ '&ucy;': { 'codepoints': [0x00443], 'characters': '\u0443' },
+ '&udarr;': { 'codepoints': [0x021C5], 'characters': '\u21C5' },
+ '&udblac;': { 'codepoints': [0x00171], 'characters': '\u0171' },
+ '&udhar;': { 'codepoints': [0x0296E], 'characters': '\u296E' },
+ '&ufisht;': { 'codepoints': [0x0297E], 'characters': '\u297E' },
+ '&ufr;': { 'codepoints': [0x1D532], 'characters': '\uD835\uDD32' },
+ '&ugrave': { 'codepoints': [0x000F9], 'characters': '\xF9' },
+ '&ugrave;': { 'codepoints': [0x000F9], 'characters': '\xF9' },
+ '&uharl;': { 'codepoints': [0x021BF], 'characters': '\u21BF' },
+ '&uharr;': { 'codepoints': [0x021BE], 'characters': '\u21BE' },
+ '&uhblk;': { 'codepoints': [0x02580], 'characters': '\u2580' },
+ '&ulcorn;': { 'codepoints': [0x0231C], 'characters': '\u231C' },
+ '&ulcorner;': { 'codepoints': [0x0231C], 'characters': '\u231C' },
+ '&ulcrop;': { 'codepoints': [0x0230F], 'characters': '\u230F' },
+ '&ultri;': { 'codepoints': [0x025F8], 'characters': '\u25F8' },
+ '&umacr;': { 'codepoints': [0x0016B], 'characters': '\u016B' },
+ '&uml': { 'codepoints': [0x000A8], 'characters': '\xA8' },
+ '&uml;': { 'codepoints': [0x000A8], 'characters': '\xA8' },
+ '&uogon;': { 'codepoints': [0x00173], 'characters': '\u0173' },
+ '&uopf;': { 'codepoints': [0x1D566], 'characters': '\uD835\uDD66' },
+ '&uparrow;': { 'codepoints': [0x02191], 'characters': '\u2191' },
+ '&updownarrow;': { 'codepoints': [0x02195], 'characters': '\u2195' },
+ '&upharpoonleft;': { 'codepoints': [0x021BF], 'characters': '\u21BF' },
+ '&upharpoonright;': { 'codepoints': [0x021BE], 'characters': '\u21BE' },
+ '&uplus;': { 'codepoints': [0x0228E], 'characters': '\u228E' },
+ '&upsi;': { 'codepoints': [0x003C5], 'characters': '\u03C5' },
+ '&upsih;': { 'codepoints': [0x003D2], 'characters': '\u03D2' },
+ '&upsilon;': { 'codepoints': [0x003C5], 'characters': '\u03C5' },
+ '&upuparrows;': { 'codepoints': [0x021C8], 'characters': '\u21C8' },
+ '&urcorn;': { 'codepoints': [0x0231D], 'characters': '\u231D' },
+ '&urcorner;': { 'codepoints': [0x0231D], 'characters': '\u231D' },
+ '&urcrop;': { 'codepoints': [0x0230E], 'characters': '\u230E' },
+ '&uring;': { 'codepoints': [0x0016F], 'characters': '\u016F' },
+ '&urtri;': { 'codepoints': [0x025F9], 'characters': '\u25F9' },
+ '&uscr;': { 'codepoints': [0x1D4CA], 'characters': '\uD835\uDCCA' },
+ '&utdot;': { 'codepoints': [0x022F0], 'characters': '\u22F0' },
+ '&utilde;': { 'codepoints': [0x00169], 'characters': '\u0169' },
+ '&utri;': { 'codepoints': [0x025B5], 'characters': '\u25B5' },
+ '&utrif;': { 'codepoints': [0x025B4], 'characters': '\u25B4' },
+ '&uuarr;': { 'codepoints': [0x021C8], 'characters': '\u21C8' },
+ '&uuml': { 'codepoints': [0x000FC], 'characters': '\xFC' },
+ '&uuml;': { 'codepoints': [0x000FC], 'characters': '\xFC' },
+ '&uwangle;': { 'codepoints': [0x029A7], 'characters': '\u29A7' },
+ '&vArr;': { 'codepoints': [0x021D5], 'characters': '\u21D5' },
+ '&vBar;': { 'codepoints': [0x02AE8], 'characters': '\u2AE8' },
+ '&vBarv;': { 'codepoints': [0x02AE9], 'characters': '\u2AE9' },
+ '&vDash;': { 'codepoints': [0x022A8], 'characters': '\u22A8' },
+ '&vangrt;': { 'codepoints': [0x0299C], 'characters': '\u299C' },
+ '&varepsilon;': { 'codepoints': [0x003F5], 'characters': '\u03F5' },
+ '&varkappa;': { 'codepoints': [0x003F0], 'characters': '\u03F0' },
+ '&varnothing;': { 'codepoints': [0x02205], 'characters': '\u2205' },
+ '&varphi;': { 'codepoints': [0x003D5], 'characters': '\u03D5' },
+ '&varpi;': { 'codepoints': [0x003D6], 'characters': '\u03D6' },
+ '&varpropto;': { 'codepoints': [0x0221D], 'characters': '\u221D' },
+ '&varr;': { 'codepoints': [0x02195], 'characters': '\u2195' },
+ '&varrho;': { 'codepoints': [0x003F1], 'characters': '\u03F1' },
+ '&varsigma;': { 'codepoints': [0x003C2], 'characters': '\u03C2' },
+ '&varsubsetneq;': { 'codepoints': [0x0228A, 0x0FE00], 'characters': '\u228A\uFE00' },
+ '&varsubsetneqq;': { 'codepoints': [0x02ACB, 0x0FE00], 'characters': '\u2ACB\uFE00' },
+ '&varsupsetneq;': { 'codepoints': [0x0228B, 0x0FE00], 'characters': '\u228B\uFE00' },
+ '&varsupsetneqq;': { 'codepoints': [0x02ACC, 0x0FE00], 'characters': '\u2ACC\uFE00' },
+ '&vartheta;': { 'codepoints': [0x003D1], 'characters': '\u03D1' },
+ '&vartriangleleft;': { 'codepoints': [0x022B2], 'characters': '\u22B2' },
+ '&vartriangleright;': { 'codepoints': [0x022B3], 'characters': '\u22B3' },
+ '&vcy;': { 'codepoints': [0x00432], 'characters': '\u0432' },
+ '&vdash;': { 'codepoints': [0x022A2], 'characters': '\u22A2' },
+ '&vee;': { 'codepoints': [0x02228], 'characters': '\u2228' },
+ '&veebar;': { 'codepoints': [0x022BB], 'characters': '\u22BB' },
+ '&veeeq;': { 'codepoints': [0x0225A], 'characters': '\u225A' },
+ '&vellip;': { 'codepoints': [0x022EE], 'characters': '\u22EE' },
+ '&verbar;': { 'codepoints': [0x0007C], 'characters': '\x7C' },
+ '&vert;': { 'codepoints': [0x0007C], 'characters': '\x7C' },
+ '&vfr;': { 'codepoints': [0x1D533], 'characters': '\uD835\uDD33' },
+ '&vltri;': { 'codepoints': [0x022B2], 'characters': '\u22B2' },
+ '&vnsub;': { 'codepoints': [0x02282, 0x020D2], 'characters': '\u2282\u20D2' },
+ '&vnsup;': { 'codepoints': [0x02283, 0x020D2], 'characters': '\u2283\u20D2' },
+ '&vopf;': { 'codepoints': [0x1D567], 'characters': '\uD835\uDD67' },
+ '&vprop;': { 'codepoints': [0x0221D], 'characters': '\u221D' },
+ '&vrtri;': { 'codepoints': [0x022B3], 'characters': '\u22B3' },
+ '&vscr;': { 'codepoints': [0x1D4CB], 'characters': '\uD835\uDCCB' },
+ '&vsubnE;': { 'codepoints': [0x02ACB, 0x0FE00], 'characters': '\u2ACB\uFE00' },
+ '&vsubne;': { 'codepoints': [0x0228A, 0x0FE00], 'characters': '\u228A\uFE00' },
+ '&vsupnE;': { 'codepoints': [0x02ACC, 0x0FE00], 'characters': '\u2ACC\uFE00' },
+ '&vsupne;': { 'codepoints': [0x0228B, 0x0FE00], 'characters': '\u228B\uFE00' },
+ '&vzigzag;': { 'codepoints': [0x0299A], 'characters': '\u299A' },
+ '&wcirc;': { 'codepoints': [0x00175], 'characters': '\u0175' },
+ '&wedbar;': { 'codepoints': [0x02A5F], 'characters': '\u2A5F' },
+ '&wedge;': { 'codepoints': [0x02227], 'characters': '\u2227' },
+ '&wedgeq;': { 'codepoints': [0x02259], 'characters': '\u2259' },
+ '&weierp;': { 'codepoints': [0x02118], 'characters': '\u2118' },
+ '&wfr;': { 'codepoints': [0x1D534], 'characters': '\uD835\uDD34' },
+ '&wopf;': { 'codepoints': [0x1D568], 'characters': '\uD835\uDD68' },
+ '&wp;': { 'codepoints': [0x02118], 'characters': '\u2118' },
+ '&wr;': { 'codepoints': [0x02240], 'characters': '\u2240' },
+ '&wreath;': { 'codepoints': [0x02240], 'characters': '\u2240' },
+ '&wscr;': { 'codepoints': [0x1D4CC], 'characters': '\uD835\uDCCC' },
+ '&xcap;': { 'codepoints': [0x022C2], 'characters': '\u22C2' },
+ '&xcirc;': { 'codepoints': [0x025EF], 'characters': '\u25EF' },
+ '&xcup;': { 'codepoints': [0x022C3], 'characters': '\u22C3' },
+ '&xdtri;': { 'codepoints': [0x025BD], 'characters': '\u25BD' },
+ '&xfr;': { 'codepoints': [0x1D535], 'characters': '\uD835\uDD35' },
+ '&xhArr;': { 'codepoints': [0x027FA], 'characters': '\u27FA' },
+ '&xharr;': { 'codepoints': [0x027F7], 'characters': '\u27F7' },
+ '&xi;': { 'codepoints': [0x003BE], 'characters': '\u03BE' },
+ '&xlArr;': { 'codepoints': [0x027F8], 'characters': '\u27F8' },
+ '&xlarr;': { 'codepoints': [0x027F5], 'characters': '\u27F5' },
+ '&xmap;': { 'codepoints': [0x027FC], 'characters': '\u27FC' },
+ '&xnis;': { 'codepoints': [0x022FB], 'characters': '\u22FB' },
+ '&xodot;': { 'codepoints': [0x02A00], 'characters': '\u2A00' },
+ '&xopf;': { 'codepoints': [0x1D569], 'characters': '\uD835\uDD69' },
+ '&xoplus;': { 'codepoints': [0x02A01], 'characters': '\u2A01' },
+ '&xotime;': { 'codepoints': [0x02A02], 'characters': '\u2A02' },
+ '&xrArr;': { 'codepoints': [0x027F9], 'characters': '\u27F9' },
+ '&xrarr;': { 'codepoints': [0x027F6], 'characters': '\u27F6' },
+ '&xscr;': { 'codepoints': [0x1D4CD], 'characters': '\uD835\uDCCD' },
+ '&xsqcup;': { 'codepoints': [0x02A06], 'characters': '\u2A06' },
+ '&xuplus;': { 'codepoints': [0x02A04], 'characters': '\u2A04' },
+ '&xutri;': { 'codepoints': [0x025B3], 'characters': '\u25B3' },
+ '&xvee;': { 'codepoints': [0x022C1], 'characters': '\u22C1' },
+ '&xwedge;': { 'codepoints': [0x022C0], 'characters': '\u22C0' },
+ '&yacute': { 'codepoints': [0x000FD], 'characters': '\xFD' },
+ '&yacute;': { 'codepoints': [0x000FD], 'characters': '\xFD' },
+ '&yacy;': { 'codepoints': [0x0044F], 'characters': '\u044F' },
+ '&ycirc;': { 'codepoints': [0x00177], 'characters': '\u0177' },
+ '&ycy;': { 'codepoints': [0x0044B], 'characters': '\u044B' },
+ '&yen': { 'codepoints': [0x000A5], 'characters': '\xA5' },
+ '&yen;': { 'codepoints': [0x000A5], 'characters': '\xA5' },
+ '&yfr;': { 'codepoints': [0x1D536], 'characters': '\uD835\uDD36' },
+ '&yicy;': { 'codepoints': [0x00457], 'characters': '\u0457' },
+ '&yopf;': { 'codepoints': [0x1D56A], 'characters': '\uD835\uDD6A' },
+ '&yscr;': { 'codepoints': [0x1D4CE], 'characters': '\uD835\uDCCE' },
+ '&yucy;': { 'codepoints': [0x0044E], 'characters': '\u044E' },
+ '&yuml': { 'codepoints': [0x000FF], 'characters': '\xFF' },
+ '&yuml;': { 'codepoints': [0x000FF], 'characters': '\xFF' },
+ '&zacute;': { 'codepoints': [0x0017A], 'characters': '\u017A' },
+ '&zcaron;': { 'codepoints': [0x0017E], 'characters': '\u017E' },
+ '&zcy;': { 'codepoints': [0x00437], 'characters': '\u0437' },
+ '&zdot;': { 'codepoints': [0x0017C], 'characters': '\u017C' },
+ '&zeetrf;': { 'codepoints': [0x02128], 'characters': '\u2128' },
+ '&zeta;': { 'codepoints': [0x003B6], 'characters': '\u03B6' },
+ '&zfr;': { 'codepoints': [0x1D537], 'characters': '\uD835\uDD37' },
+ '&zhcy;': { 'codepoints': [0x00436], 'characters': '\u0436' },
+ '&zigrarr;': { 'codepoints': [0x021DD], 'characters': '\u21DD' },
+ '&zopf;': { 'codepoints': [0x1D56B], 'characters': '\uD835\uDD6B' },
+ '&zscr;': { 'codepoints': [0x1D4CF], 'characters': '\uD835\uDCCF' },
+ '&zwj;': { 'codepoints': [0x0200D], 'characters': '\u200D' },
+ '&zwnj;': { 'codepoints': [0x0200C], 'characters': '\u200C' }
+};
diff --git a/testing/web-platform/tests/html/syntax/parsing/named-character-references.html b/testing/web-platform/tests/html/syntax/parsing/named-character-references.html
new file mode 100644
index 000000000..d09915cd9
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/named-character-references.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Tests for known named character references</title>
+<meta name=viewport content="width=device-width">
+<!-- Alternative output: http://mathias.html5.org/tests/html/named-character-references/ -->
+<div id=log></div>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=named-character-references-data.js></script>
+<script>
+ (function() {
+
+ function pad(string, totalCharacters) {
+ return totalCharacters < string.length ? string : (Array(totalCharacters + 1).join('0') + string).slice(-totalCharacters);
+ }
+
+ var dummy = document.createElement('p');
+
+ Object.keys(data).forEach(function(entity) {
+ var object = data[entity];
+ dummy.innerHTML = entity;
+ test(
+ function() {
+ assert_equals(
+ dummy.textContent,
+ object.characters
+ );
+ },
+ entity + ' should match ' + object.codepoints.map(function(codePoint) {
+ return 'U+' + pad(codePoint.toString(16).toUpperCase(), 5);
+ }).join(' ')
+ );
+ });
+
+ }());
+</script>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template.js b/testing/web-platform/tests/html/syntax/parsing/template.js
new file mode 100644
index 000000000..b249fb64c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template.js
@@ -0,0 +1,214 @@
+ /*
+ * Template code
+ *
+ * A template is just a javascript structure. An element is represented as:
+ *
+ * [tag_name, {attr_name:attr_value}, child1, child2]
+ *
+ * the children can either be strings (which act like text nodes), other templates or
+ * functions (see below)
+ *
+ * A text node is represented as
+ *
+ * ["{text}", value]
+ *
+ * String values have a simple substitution syntax; ${foo} represents a variable foo.
+ *
+ * It is possible to embed logic in templates by using a function in a place where a
+ * node would usually go. The function must either return part of a template or null.
+ *
+ * In cases where a set of nodes are required as output rather than a single node
+ * with children it is possible to just use a list
+ * [node1, node2, node3]
+ *
+ * Usage:
+ *
+ * render(template, substitutions) - take a template and an object mapping
+ * variable names to parameters and return either a DOM node or a list of DOM nodes
+ *
+ * substitute(template, substitutions) - take a template and variable mapping object,
+ * make the variable substitutions and return the substituted template
+ *
+ */
+
+ function is_single_node(template)
+ {
+ return typeof template[0] === "string";
+ }
+
+ function substitute(template, substitutions)
+ {
+ if (typeof template === "function") {
+ var replacement = template(substitutions);
+ if (replacement)
+ {
+ var rv = substitute(replacement, substitutions);
+ return rv;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else if (is_single_node(template))
+ {
+ return substitute_single(template, substitutions);
+ }
+ else
+ {
+ return filter(map(template, function(x) {
+ return substitute(x, substitutions);
+ }), function(x) {return x !== null;});
+ }
+ }
+ expose(substitute, "template.substitute");
+
+ function substitute_single(template, substitutions)
+ {
+ var substitution_re = /\${([^ }]*)}/g;
+
+ function do_substitution(input) {
+ var components = input.split(substitution_re);
+ var rv = [];
+ for (var i=0; i<components.length; i+=2)
+ {
+ rv.push(components[i]);
+ if (components[i+1])
+ {
+ rv.push(substitutions[components[i+1]]);
+ }
+ }
+ return rv;
+ }
+
+ var rv = [];
+ rv.push(do_substitution(String(template[0])).join(""));
+
+ if (template[0] === "{text}") {
+ substitute_children(template.slice(1), rv);
+ } else {
+ substitute_attrs(template[1], rv);
+ substitute_children(template.slice(2), rv);
+ }
+
+ function substitute_attrs(attrs, rv)
+ {
+ rv[1] = {};
+ for (name in template[1])
+ {
+ if (attrs.hasOwnProperty(name))
+ {
+ var new_name = do_substitution(name).join("");
+ var new_value = do_substitution(attrs[name]).join("");
+ rv[1][new_name] = new_value;
+ };
+ }
+ }
+
+ function substitute_children(children, rv)
+ {
+ for (var i=0; i<children.length; i++)
+ {
+ if (children[i] instanceof Object) {
+ var replacement = substitute(children[i], substitutions);
+ if (replacement !== null)
+ {
+ if (is_single_node(replacement))
+ {
+ rv.push(replacement);
+ }
+ else
+ {
+ extend(rv, replacement);
+ }
+ }
+ }
+ else
+ {
+ extend(rv, do_substitution(String(children[i])));
+ }
+ }
+ return rv;
+ }
+
+ return rv;
+ }
+
+ function make_dom_single(template)
+ {
+ if (template[0] === "{text}")
+ {
+ var element = document.createTextNode("");
+ for (var i=1; i<template.length; i++)
+ {
+ element.data += template[i];
+ }
+ }
+ else
+ {
+ var element = document.createElement(template[0]);
+ for (name in template[1]) {
+ if (template[1].hasOwnProperty(name))
+ {
+ element.setAttribute(name, template[1][name]);
+ }
+ }
+ for (var i=2; i<template.length; i++)
+ {
+ if (template[i] instanceof Object)
+ {
+ var sub_element = make_dom(template[i]);
+ element.appendChild(sub_element);
+ }
+ else
+ {
+ var text_node = document.createTextNode(template[i]);
+ element.appendChild(text_node);
+ }
+ }
+ }
+
+ return element;
+ }
+
+
+
+ function make_dom(template, substitutions)
+ {
+ if (is_single_node(template))
+ {
+ return make_dom_single(template);
+ }
+ else
+ {
+ return map(template, function(x) {
+ return make_dom_single(x);
+ });
+ }
+ }
+
+ function render(template, substitutions)
+ {
+ return make_dom(substitute(template, substitutions));
+ }
+ expose(render, "template.render");
+
+function expose(object, name)
+{
+ var components = name.split(".");
+ var target = window;
+ for (var i=0; i<components.length - 1; i++)
+ {
+ if (!(components[i] in target))
+ {
+ target[components[i]] = {};
+ }
+ target = target[components[i]];
+ }
+ target[components[components.length - 1]] = object;
+}
+
+function extend(array, items)
+{
+ Array.prototype.push.apply(array, items);
+} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-foster-parenting/template-is-a-foster-parent-element.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-foster-parenting/template-is-a-foster-parent-element.html
new file mode 100644
index 000000000..6f6e7a725
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-foster-parenting/template-is-a-foster-parent-element.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Template is a foster parent element</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="The last template element with either no table element is below it, or a table element immediately below it, in the stack of open elements is the foster parent element (NOT the template's parent!)">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#foster-parent-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '' +
+ '<div id="tmplParent">' +
+ '<template id="tmpl1">' +
+ '<table id="tbl">' +
+ '<tr><td>Cell 1</td></tr>' +
+ // Misplaced <div>. It should be foster parented
+ '<div id="orphanDiv">Orphan div content</div>' +
+ '<tr><td>Cell 2</td></tr>' +
+ '</table>' +
+ '</template>' +
+ '</div>';
+
+ var template = doc.querySelector('#tmpl1');
+ var div = template.content.querySelector('#orphanDiv');
+
+ assert_equals(div.parentNode, template.content, 'Wrong foster parent element');
+
+}, 'Template is a foster parent element. Test <table> immediately below <template>');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '' +
+ '<div id="tmplParent">' +
+ '<template id="tmpl1">' +
+ '<tr><td>Cell 1</td></tr>' +
+ // Misplaced <div>. It should be foster parented
+ '<div id="orphanDiv">Orphan div content</div>' +
+ '<tr><td>Cell 2</td></tr>' +
+ '</template>' +
+ '</div>';
+
+ var template = doc.querySelector('#tmpl1');
+ var div = template.content.querySelector('#orphanDiv');
+
+ assert_equals(div.parentNode, template.content, 'Wrong foster parent element');
+
+}, 'Template is a foster parent element. Test <template> element without <table>');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-foster-parenting/template-is-not-a-foster-parent-element.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-foster-parenting/template-is-not-a-foster-parent-element.html
new file mode 100644
index 000000000..677dfaf3e
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-foster-parenting/template-is-not-a-foster-parent-element.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Template is not a foster parent element</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="When template element shouldn't be a foster parent then regular rules of foster parenting should be applied">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#foster-parent-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '' +
+ '<div id="tmplParent">' +
+ '<template id="tmpl1">' +
+ '<div id="fosterParent">' +
+ '<table id="tbl">' +
+ '<tr><td>Cell 1</td></tr>' +
+ // Misplaced <div>. It should be foster parented
+ '<div id="orphanDiv">Orphan div content</div>' +
+ '<tr><td>Cell 2</td></tr>' +
+ '</table>' +
+ '</div>' +
+ '</template>' +
+ '</div>';
+
+ var template = doc.querySelector('#tmpl1');
+ var fosterParent = template.content.querySelector('#fosterParent');
+ var div = template.content.querySelector('#orphanDiv');
+
+ assert_equals(div.parentNode, fosterParent, 'Wrong foster parent element');
+
+}, 'Template is not a foster parent element. '
+ + 'Test the case when <template> is higher in stack of open elements');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '' +
+ '<div id="fosterParent">' +
+ '<table id="tbl">' +
+ '<tr><td><template id="tmpl1">Template content</template></td></tr>' +
+ // Misplaced <div>. It should be foster parented
+ '<div id="orphanDiv">Orphan div content</div>' +
+ '<tr><td>Cell 2</td></tr>' +
+ '</table>' +
+ '</div>' +
+ '</div>';
+
+ var t = doc.querySelector('#tmpl1');
+ var fosterParent = doc.querySelector('#fosterParent');
+ var div = doc.querySelector('#orphanDiv');
+
+ assert_equals(div.parentNode, fosterParent, 'Wrong foster parent element');
+
+}, 'Template is not a foster parent element. '
+ + 'Test the case when <template> is lower in stack of open elements');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/generating-of-implied-end-tags.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/generating-of-implied-end-tags.html
new file mode 100644
index 000000000..6edce84ef
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/generating-of-implied-end-tags.html
@@ -0,0 +1,136 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: 'In body' insertion mode: when template end tag is met, implied end tags should be generated</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
+<meta name="assert" content="'In body' insertion mode: when template end tag is met, implied end tags should be generated">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ //No end </td></tr></table> tags. Should be added implicitly
+ doc.body.innerHTML = '<template id="tpl">'
+ + '<table id="tbl"><tr id="tr"><td id="td"></template>';
+
+ var template = doc.querySelector('#tpl');
+
+ assert_not_equals(template, null, 'Template element must be parsed');
+
+ assert_equals(doc.querySelector('#tbl'), null, 'Table element should not be available');
+ assert_equals(doc.querySelector('#tr'), null, 'TR element should not be available');
+ assert_equals(doc.querySelector('#td'), null, 'TD element should not be available');
+
+ assert_not_equals(template.content.querySelector('#tbl'), null,
+ 'Template should contain table element');
+ assert_not_equals(template.content.querySelector('#tr'), null,
+ 'Template should contain TR element');
+ assert_not_equals(template.content.querySelector('#td'), null,
+ 'Template should contain TD element');
+
+}, 'Generating of implied end tags. Test table elements');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ //No end </div> tag. Should be added implicitly
+ doc.body.innerHTML = '<template id="tpl"><div id="dv">Div content</template>';
+
+ var template = doc.querySelector('#tpl');
+
+ assert_not_equals(template, null, 'Template element must be parsed');
+
+ assert_equals(doc.querySelector('#dv'), null, 'DIV element should not be available');
+
+ assert_not_equals(template.content.querySelector('#dv'), null,
+ 'Template should contain DIV element');
+
+}, 'Generating of implied end tags. Test div element');
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ //No end </div> tag. Should be added implicitly after text content
+ doc.body.innerHTML = '<template id="tpl">Template text<div id="dv">Div content</template>';
+
+ var template = doc.querySelector('#tpl');
+
+ assert_not_equals(template, null, 'Template element must be parsed');
+
+ assert_equals(doc.querySelector('#dv'), null, 'DIV element should not be available');
+
+ var div = template.content.querySelector('#dv');
+
+ assert_not_equals( div, null, 'Template should contain DIV element');
+ assert_equals(div.textContent, 'Div content', 'Wrong template content inner text');
+
+}, 'Generating of implied end tags. Test some text and DIV element');
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ // Wrong end tag. Correct end tag must be added implicitly, wrong one ignored
+ doc.body.innerHTML = '<template id="tpl"><div id="dv">Div content</span></template>';
+
+ var template = doc.querySelector('#tpl');
+
+ assert_not_equals(template, null, 'Template element must be parsed');
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Wrong number of template\'s children');
+
+ assert_equals(doc.querySelector('#dv'), null, 'DIV element should not be available');
+
+ assert_not_equals(template.content.querySelector('#dv'), null,
+ 'Template should contain DIV element');
+ assert_equals(template.content.querySelector('#dv').textContent,
+ 'Div content', 'Wrong template content inner text');
+
+}, 'Generating of implied end tags. Test wrong end tag');
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-table-no-end-tag.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.body.querySelector('template');
+
+ assert_not_equals(template, null, 'Template element must be parsed');
+
+ assert_not_equals(template.content.querySelector('table'), null,
+ 'Template should contain table element');
+ assert_not_equals(template.content.querySelector('tr'), null,
+ 'Template should contain TR element');
+ assert_not_equals(template.content.querySelector('td'), null,
+ 'Template should contain TD element');
+
+}, 'Generating of implied end tags. Test table elements. Loading of HTML document from a file');
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-div-no-end-tag.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.body.querySelector('template');
+
+ assert_not_equals(template, null, 'Template element must be parsed');
+
+ var div = template.content.querySelector('div');
+ assert_not_equals(div, null, 'Template should contain div element');
+ assert_equals(div.textContent, 'Hello, template\n ', 'Invalid div contents');
+
+}, 'Generating of implied end tags. Test div element. Loading of HTML document from a file');
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-body-token.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-body-token.html
new file mode 100644
index 000000000..4549f5fec
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-body-token.html
@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: In body insertion mode: parser should ignore BODY token</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+/*
+ * According to http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-contents-insertion-mode
+ * when parser is in "template content" mode and meets <body> tag it should be switched to
+ * "in body" insertion mode.
+ * According to http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition
+ * this token (BODY) should be ignored
+ */
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<body></body>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 0,
+ 'Template cannot contain BODY element');
+
+}, 'Ignore BODY token. Test empty BODY element assigned to template innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<body><div>Some content</div></body>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Wrong number of template content children');
+ assert_equals(template.content.firstChild.nodeName, 'DIV',
+ 'Template should contain children of ignored BODY element');
+
+}, 'Ignore BODY token. Test not empty BODY element assigned to template innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<body><div <div id="div1">Some content</div></body><div id="div2">Some valid content</div>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 2,
+ 'Wrong number of template content children');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Template should contain children of the ignored BODY element');
+ assert_not_equals(template.content.querySelector('#div2'), null,
+ 'Template should contain valid element');
+
+}, 'Ignore BODY token. '
+ + 'Test BODY element and some valid element after BODY tag assigned to template innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<div id="div1">Some valid content</div><body><div id="div2">Some content</div></body>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 2,
+ 'Template cannot contain BODY element');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Template should contain valid element');
+ assert_not_equals(template.content.querySelector('#div2'), null,
+ 'Template should contain children of the ignored BODY element');
+
+}, 'Ignore BODY token. '
+ + 'Test BODY element and some valid element before BODY tag assigned to template innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<template id="t2"><body><span>Body!<span></body></template>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Template should contain nested template');
+ assert_not_equals(template.content.querySelector('#t2'), null,
+ 'Template should contain nested element');
+
+ var nestedTemplate = template.content.querySelector('#t2');
+
+ assert_equals(nestedTemplate.content.childNodes.length, 1,
+ 'Template cannot contain BODY element');
+ assert_equals(nestedTemplate.content.firstChild.nodeName, 'SPAN',
+ 'Template cannot contain BODY element');
+
+}, 'Ignore BODY token. '
+ + 'Test template with not empty BODY element inside assigned to another '
+ + 'template\'s innerHTML');
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-body.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.body.querySelector('template');
+
+ assert_equals(template.content.childNodes.length, 0,
+ 'Template cannot contain BODY element');
+
+}, 'Ignore BODY token. '
+ + 'Test loading a HTML file with BODY tag inside template');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-frameset-token.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-frameset-token.html
new file mode 100644
index 000000000..121115075
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-frameset-token.html
@@ -0,0 +1,125 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: In body insertion mode: parser should ignore FRAMESET token</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="If parser is in 'in body' insertion mode and meets HTML token it should be ignored">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+/*
+ * According to http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-contents-insertion-mode
+ * when parser is in "template content" mode and meets <frameset> tag it should be switched to
+ * "in body" insertion mode.
+ * According to https://html.spec.whatwg.org/multipage/#parsing-main-inbody
+ * this token (FRAMESET) should be ignored
+ */
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<frameset cols="25%,*,25%">'
+ + '<frame src="frame_a.htm">'
+ + '<frame src="frame_b.htm">' + '<frame src="frame_c.htm">'
+ + '</frameset>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 0,
+ 'Template cannot contain FRAMESET element');
+
+}, 'Ignore frameset token. Test FRAMESET element assigned to template innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<div id="div1">Some text</div>'
+ + '<frameset cols="25%,*,25%">'
+ + '<frame src="frame_a.htm">'
+ + '<frame src="frame_b.htm">'
+ + '<frame src="frame_c.htm">'
+ + '</frameset>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Template cannot contain FRAMESET element');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Template should contain valid element');
+
+}, 'Ignore frameset token. '
+ + 'Test FRAMESET element and some valid element before it, assigned '
+ + 'to the template\'s innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<frameset cols="25%,*,25%">'
+ + '<frame src="frame_a.htm">'
+ + '<frame src="frame_b.htm">'
+ + '<frame src="frame_c.htm">'
+ + '</frameset><div id="div1">Some text</div>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Template cannot contain FRAMESET element');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Template should contain valid element');
+
+}, 'Ignore frameset token. '
+ + 'Test FRAMESET element and some valid element after it, assigned '
+ + 'to the template\'s innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<template id="t2">'
+ + '<frameset cols="25%,*,25%">'
+ + '<frame src="frame_a.htm">'
+ + '<frame src="frame_b.htm">'
+ + '<frame src="frame_c.htm">'
+ + '</frameset></template>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Template should contain nested template');
+ assert_not_equals(template.content.querySelector('#t2'), null,
+ 'Template should contain nested element');
+
+ var nestedTemplate = template.content.querySelector('#t2');
+
+ assert_equals(nestedTemplate.content.childNodes.length, 0,
+ 'Template cannot contain FRAMESET element');
+
+}, 'Ignore frameset token. '
+ + 'Test FRAMESET tag inside template tag assigned to another template\'s innerHTML');
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-frameset.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.body.querySelector('template');
+
+ assert_equals(template.content.childNodes.length, 0,
+ 'Template cannot contain FRAMESET element');
+}, 'Ignore frameset token. Test loading a HTML file with FRAMESET tag inside template');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-head-token.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-head-token.html
new file mode 100644
index 000000000..9b14df917
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-head-token.html
@@ -0,0 +1,129 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: In body insertion mode: parser should ignore HEAD token</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="If parser is in 'in body' insertion mode and meets HEAD token it should be ignored">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+/*
+ * According to http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-contents-insertion-mode
+ * when parser is in "template content" mode and meets <head> tag it should be switched to
+ * "in body" insertion mode.
+ * According to https://html.spec.whatwg.org/multipage/#parsing-main-inbody
+ * this token (HEAD) should be ignored
+ */
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<head></head>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 0,
+ 'Template cannot contain HEAD element');
+
+}, 'Ignore HEAD token. Test empty HEAD element assigned to template innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<head><title>test</title></head>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Wrong number of template content children');
+ assert_equals(template.content.firstChild.nodeName, 'TITLE',
+ 'Template should contain children of ignored HEAD element');
+
+}, 'Ignore HEAD token. Test not empty HEAD element assigned to template innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<div id="div1">Some text</div><head><title>test</title></head>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 2,
+ 'Wrong number of template content children');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Template should contain valid element');
+ assert_equals(template.content.lastChild.tagName, 'TITLE',
+ 'Template should contain children of ignored HEAD element');
+
+}, 'Ignore HEAD token. '
+ + 'Test HEAD element and some valid element before it, assigned to template innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<head><title>test</title></head><div id="div1">Some text</div>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 2,
+ 'Wrong number of template content children');
+ assert_equals(template.content.firstChild.tagName, 'TITLE',
+ 'Template should contain children of ignored HEAD element');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Template should contain valid element');
+
+}, 'Ignore HEAD token. '
+ + 'Test HEAD element and some valid element after it, assigned to template innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<template id="t2"><head><title>test</title></head></template>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Template should contain nested template');
+ assert_not_equals(template.content.querySelector('#t2'), null,
+ 'Template should contain nested element');
+
+ var nestedTemplate = template.content.querySelector('#t2');
+
+ assert_equals(nestedTemplate.content.childNodes.length, 1,
+ 'Wrong number of template content children');
+ assert_equals(nestedTemplate.content.firstChild.tagName, 'TITLE',
+ 'Template should contain children of ignored HEAD element');
+
+}, 'Ignore HEAD token. '
+ + 'Test HEAD tag inside template tag assigned to another template\'s innerHTML');
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-head.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.body.querySelector('template');
+
+ assert_equals(template.content.childNodes.length, 0,
+ 'Template cannot contain HEAD element');
+
+}, 'Ignore HEAD token. Test loading a HTML file with HEAD tag inside template');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-html-token.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-html-token.html
new file mode 100644
index 000000000..5c53be842
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-html-token.html
@@ -0,0 +1,158 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: In body insertion mode: parser should ignore HTML token</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="If parser is in 'in body' insertion mode and meets HTML token it should be ignored">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+/*
+ * According to http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-contents-insertion-mode
+ * when parser is in "template content" mode and meets <html> tag it should be switched to
+ * "in body" insertion mode.
+ * According to https://html.spec.whatwg.org/multipage/#parsing-main-inbody
+ * this token (HTML) should be ignored
+ */
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<html><body></body></html>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 0,
+ 'Template cannot contain HTML element');
+
+}, 'Ignore HTML token. Test HTML element assigned to template innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<div id="div1">Some text</div><html><body></body></html>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Template cannot contain HTML element');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Template should contain valid element');
+
+}, 'Ignore HTML token.'
+ + 'Test HTML element and some valid element before it, assigned to template innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<html><body></body></html><div id="div1">Some text</div>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Template cannot contain HTML element');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Template should contain valid element');
+
+}, 'Ignore HTML token. '
+ + 'Test HEAD element and some valid element after it, assigned to template innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<template id="t2"><html><body></body></html></template>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Template should contain nested template');
+ assert_not_equals(template.content.querySelector('#t2'), null,
+ 'Template should contain nested element');
+
+ var nestedTemplate = template.content.querySelector('#t2');
+
+ assert_equals(nestedTemplate.content.childNodes.length, 0,
+ 'Template cannot contain HTML element');
+
+}, 'Ignore HTML token. '
+ + 'Test HTML tag inside template tag assigned to another template\'s innerHTML');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<html><div id="div1">Some text</div></html>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Template cannot contain HTML element');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Template should contain a valid element');
+
+}, 'Ignore HTML token. Test some valid element inside HTML element');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<html><body><div id="div1">Some text</div><body></html>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Template cannot contain HTML element');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Template should contain valid element');
+
+}, 'Ignore HTML token. Test valid element inside HTML and BODY elements');
+
+
+test(function() {
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+
+ template.innerHTML = '<html><span id="span1">Span</span><body><div id="div1">Some text</div><body></html>';
+
+ doc.body.appendChild(template);
+
+ assert_equals(template.content.childNodes.length, 2,
+ 'Template cannot contain HTML element');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Template should contain valid DIV element');
+
+ assert_not_equals(template.content.querySelector('#span1'), null,
+ 'Template should contain valid SPAN element');
+
+}, 'Ignore HTML token. Test valid element inside and between HTML and BODY elements');
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-html.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.body.querySelector('template');
+
+ assert_equals(template.content.childNodes.length, 0,
+ 'Template cannot contain HTML element');
+
+}, 'Ignore HTML token. Test loading a HTML file with HTML tag inside template');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/start-tag-body.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/start-tag-body.html
new file mode 100644
index 000000000..738c86106
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/start-tag-body.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: In body insertion mode: Template contains a start tag whose tag name is body</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="If the stack of open elements has a template element in html scope then ignore <body> the token. (fragment or template contents case)">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '<template id="tmpl"><body></template>';
+
+ var template = doc.querySelector('#tmpl');
+
+ assert_equals(template.content.childNodes.length, 0, 'Element must be ignored');
+
+}, 'In body insertion mode: Template contains a start tag whose tag name is body.'
+ + 'Test <body> tag only');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '<template id="tmpl"><body>Body text content</body></template>';
+
+ var template = doc.querySelector('#tmpl');
+
+ assert_equals(template.content.querySelector('body'), null,
+ '<body> element must be ignored');
+ assert_equals(template.content.childNodes.length, 1, 'Text shouldn\'t be ignored');
+ assert_equals(template.content.firstChild.nodeType, Node.TEXT_NODE,
+ 'Text shouldn\'t be ignored');
+
+}, 'In body insertion mode: Template contains a start tag whose tag name is body. '
+ + 'Test <body> tag containing some text');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '<template id="tmpl"><body>'
+ + '<div id="div1">DIV 1</div>'
+ + '<div id="div2">DIV 2</div>'
+ + '</body></template>';
+
+ var template = doc.querySelector('#tmpl');
+
+ assert_equals(template.content.querySelector('body'), null,
+ '<body> element must be ignored');
+ assert_equals(template.content.childNodes.length, 2,
+ 'Only body tag should be ignored');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Children of <body tag shouldn\'t be ignored');
+ assert_not_equals(template.content.querySelector('#div2'), null,
+ 'Children of <body tag shouldn\'t be ignored');
+
+}, 'In body insertion mode: Template contains a start tag whose tag name is body. '
+ + 'Test <body> tag containing some other elements');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '<template id="tmpl1"><template id="tmpl2"><body>'
+ + '<div id="div1">DIV 1</div>'
+ + '<div id="div2">DIV 2</div>'
+ + '</body></template></template>';
+
+ var template = doc.querySelector('#tmpl1').content.querySelector('#tmpl2');
+
+ assert_equals(template.content.querySelector('body'), null,
+ '<body> element must be ignored');
+ assert_equals(template.content.childNodes.length, 2,
+ 'Only body tag should be ignored');
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Children of <body tag shouldn\'t be ignored');
+ assert_not_equals(template.content.querySelector('#div2'), null,
+ 'Children of <body tag shouldn\'t be ignored');
+
+}, 'In body insertion mode: Template contains a start tag whose tag name is body. '
+ + 'Test nested template tag containing <body> tag with some other elements');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/start-tag-html.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/start-tag-html.html
new file mode 100644
index 000000000..33c43cd50
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/start-tag-html.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: In body insertion mode: A start tag whose tag name is html</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="If HTML parser is in 'in body' insertion mode and meets HTML start tag, then for each attribute on the token, check to see if the attribute is already present on the top element of the stack of open elements. If it is not, add the attribute and its corresponding value to that element">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+// test <template><html class="htmlClass"></html></template><html id="htmlId" tabindex="5">
+// id attribute should be added to root <html> element
+// tabindex attribute should not be modified
+//class attribute should be ignored
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/html-start-tag.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.body.querySelector('template');
+
+ var html = doc.documentElement;
+
+ assert_equals(html.getAttribute('tabindex'), '5', 'Attribute should be accessible');
+ assert_equals(html.getAttribute('id'), 'htmlId',
+ 'Attribute \'id\' should be added and accessible');
+ assert_false(html.hasAttribute('class'), 'Attribute \'class\' should be ignored');
+ assert_equals(template.content.childNodes.length, 0, 'Template should not contain HTML element');
+
+
+}, 'In body insertion mode: html start tag should add only absent attributes');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/template-end-tag-without-start-one.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/template-end-tag-without-start-one.html
new file mode 100644
index 000000000..ca124ee79
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/template-end-tag-without-start-one.html
@@ -0,0 +1,102 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: 'In body' insertion mode: Template end tag without start one. Element should be ignored</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
+<meta name="assert" content="If parser in 'in body' insertion mode meets template end tag and if the stack of open elements has no template element in html scope, then this is a parse error; ignore the token">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '</template>';
+
+ assert_equals(doc.body.childNodes.length, 0, 'Element must be ignored');
+
+}, '</template> tag in HTML body without start one should be ignored');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '<template id="tmpl"></template></template>';
+
+ assert_equals(doc.body.childNodes.length, 1, 'Element must be ignored');
+ assert_not_equals(doc.querySelector('#tmpl'), null,
+ 'Element should present it document body');
+
+}, '</template> tag in HTML body without start one should be ignored. '
+ + 'Test valid <template> element and </template> tag after it');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '</template><template id="tmpl"></template>';
+
+ assert_equals(doc.body.childNodes.length, 1, 'Element must be ignored');
+ assert_not_equals(doc.querySelector('#tmpl'), null,
+ 'Element should present it document body');
+
+}, '</template> tag in HTML body without start one should be ignored. '
+ + 'Test valid <template> element and </template> tag before it');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '</template><template id="tmpl"></template><title></title>';
+
+ assert_equals(doc.body.childNodes.length, 2, 'Element must be ignored');
+ assert_not_equals(doc.querySelector('#tmpl'), null,
+ 'Valid element should present it document body');
+ assert_not_equals(doc.querySelector('title'), null,
+ 'Valid title element should present it document body');
+
+}, '</template> tag in HTML body without start one should be ignored. '
+ + 'Test valid <template> element, <title> element and </template> tag before them');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '<template id="tmpl"></template><title></title></template>';
+
+ assert_equals(doc.body.childNodes.length, 2, 'Element must be ignored');
+ assert_not_equals(doc.querySelector('#tmpl'), null,
+ 'Valid element should present it document body');
+ assert_not_equals(doc.querySelector('title'), null,
+ 'Valid title element should present it document body');
+
+}, '</template> tag in HTML body without start one should be ignored. '
+ + 'Test valid <template> element, <title> element and </template> tag after them');
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/end-template-tag-in-body.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ assert_equals(doc.body.querySelector('template'), null,
+ '</template> must be ignored');
+ assert_not_equals(doc.body.querySelector('div'), null,
+ 'Valid element should present it document body');
+
+}, '</template> tag in HTML body without start one should be ignored. '
+ + 'Test HTML document loaded from file');
+
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-frameset-insertion-mode/end-tag-frameset.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-frameset-insertion-mode/end-tag-frameset.html
new file mode 100644
index 000000000..f03f5a30b
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-frameset-insertion-mode/end-tag-frameset.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: additions to 'in frameset' insertion mode</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="If parser is in 'in frameset' insertion mode then a start tag or an end tag whose name is 'template' is a parsing error">
+<link rel="help" href="https://www.w3.org/TR/2015/WD-html51-20151008/syntax.html#parsing-main-inframeset">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/frameset-end-tag.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var frameset = doc.querySelector('frameset');
+ assert_equals(frameset.children.length, 0, 'Wrong number of frameset children elements');
+
+}, '<template> tag should be ignored in "in frameset" insertion mode');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags.html
new file mode 100644
index 000000000..2f7e6f63c
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags.html
@@ -0,0 +1,137 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: When template end tag is met, implied end tags should be generated</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
+<meta name="assert" content="When template end tag is met, implied end tags should be generated">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-head-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ //No end </td></tr></table> tags. Should be added implicitly
+ doc.head.innerHTML = '<template id="tpl">'
+ + '<table id="tbl"><tr id="tr"><td id="td"></template>';
+
+ var template = doc.querySelector('#tpl');
+
+ assert_not_equals(template, null, 'Template element must be parsed');
+
+ assert_equals(doc.querySelector('#tbl'), null, 'Table element should not be available');
+ assert_equals(doc.querySelector('#tr'), null, 'TR element should not be available');
+ assert_equals(doc.querySelector('#td'), null, 'TD element should not be available');
+
+ assert_not_equals(template.content.querySelector('#tbl'), null,
+ 'Template should contain table element');
+ assert_not_equals(template.content.querySelector('#tr'), null,
+ 'Template should contain TR element');
+ assert_not_equals(template.content.querySelector('#td'), null,
+ 'Template should contain TD element');
+
+}, 'Generating of implied end tags. Test table elements');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ //No end </div> tag. Should be added implicitly
+ doc.head.innerHTML = '<template id="tpl"><div id="dv">Div content</template>';
+
+ var template = doc.querySelector('#tpl');
+
+ assert_not_equals(template, null, 'Template element must be parsed');
+
+ assert_equals(doc.querySelector('#dv'), null, 'DIV element should not be available');
+
+ assert_not_equals(template.content.querySelector('#dv'), null,
+ 'Template should contain DIV element');
+
+}, 'Generating of implied end tags. Test DIV element');
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ //No end </div> tag. Should be added implicitly after text content
+ doc.head.innerHTML = '<template id="tpl">Template text<div id="dv">Div content</template>';
+
+ var template = doc.querySelector('#tpl');
+
+ assert_not_equals(template, null, 'Template element must be parsed');
+
+ assert_equals(doc.querySelector('#dv'), null, 'DIV element should not be available');
+
+ var div = template.content.querySelector('#dv');
+
+ assert_not_equals( div, null, 'Template should contain DIV element');
+ assert_equals(div.textContent, 'Div content', 'Wrong template content inner text');
+
+}, 'Generating of implied end tags. Test some text and DIV element');
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ // Wrong end tag. Correct end tag must be added implicitly, wrong one ignored
+ doc.head.innerHTML = '<template id="tpl"><div id="dv">Div content</span></template>';
+
+ var template = doc.querySelector('#tpl');
+
+ assert_not_equals(template, null, 'Template element must be parsed');
+
+ assert_equals(template.content.childNodes.length, 1,
+ 'Wrong number of template\'s children');
+
+ assert_equals(doc.querySelector('#dv'), null, 'DIV element should not be available');
+
+ assert_not_equals(template.content.querySelector('#dv'), null,
+ 'Template should contain DIV element');
+ assert_equals(template.content.querySelector('#dv').textContent,
+ 'Div content', 'Wrong template content inner text');
+
+}, 'Generating of implied end tags. Test wrong end tag');
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/head-template-contents-table-no-end-tag.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.head.querySelector('template');
+
+ assert_not_equals(template, null,
+ 'Template element must be parsed');
+
+ assert_not_equals(template.content.querySelector('table'), null,
+ 'Template should contain table element');
+ assert_not_equals(template.content.querySelector('tr'), null,
+ 'Template should contain TR element');
+ assert_not_equals(template.content.querySelector('td'), null,
+ 'Template should contain TD element');
+
+}, 'Generating of implied end tags. Test table elements. Load HTML document from file');
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/head-template-contents-div-no-end-tag.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.head.querySelector('template');
+
+ assert_not_equals(template, null, 'Template element must be parsed');
+
+ var div = template.content.querySelector('div');
+ assert_not_equals(div, null, 'Template should contain div element');
+ assert_equals(div.textContent, 'Hello, template\n ', 'Invalid div contents');
+
+}, 'Generating of implied end tags. Test div element. Load HTML document from file');
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-head-insertion-mode/template-end-tag-without-start-one.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-head-insertion-mode/template-end-tag-without-start-one.html
new file mode 100644
index 000000000..ccb43341b
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-head-insertion-mode/template-end-tag-without-start-one.html
@@ -0,0 +1,101 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Template end tag without start one. Element should be ignored</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
+<meta name="assert" content="If parser in 'in head' insertion mode meets template end tag and if the stack of open elements has no template element in html scope, then this is a parse error; ignore the token">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-head-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.head.innerHTML = '</template>';
+
+ assert_equals(doc.head.childNodes.length, 0, 'Element must be ignored');
+
+}, '</template> tag in HTML head without start one should be ignored');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.head.innerHTML = '<template id="tmpl"></template></template>';
+
+ assert_equals(doc.head.childNodes.length, 1, 'Element must be ignored');
+ assert_not_equals(doc.querySelector('#tmpl'), null,
+ 'Element should present it document head');
+
+}, '</template> tag in HTML head without start one should be ignored. '
+ + 'Test valid <template> element and </template> tag after it');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.head.innerHTML = '</template><template id="tmpl"></template>';
+
+ assert_equals(doc.head.childNodes.length, 1, 'Element must be ignored');
+ assert_not_equals(doc.querySelector('#tmpl'), null,
+ 'Element should present it document head');
+
+}, '</template> tag in HTML head without start one should be ignored. '
+ + 'Test valid <template> element and </template> tag before it');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.head.innerHTML = '</template><template id="tmpl"></template><title></title>';
+
+ assert_equals(doc.head.childNodes.length, 2, 'Element must be ignored');
+ assert_not_equals(doc.querySelector('#tmpl'), null,
+ 'Valid element should present it document head');
+ assert_not_equals(doc.querySelector('title'), null,
+ 'Valid title element should present it document head');
+
+}, '</template> tag in HTML head without start one should be ignored. '
+ + 'Test valid <template> element, <title> element and </template> tag before them');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.head.innerHTML = '<template id="tmpl"></template><title></title></template>';
+
+ assert_equals(doc.head.childNodes.length, 2, 'Element must be ignored');
+ assert_not_equals(doc.querySelector('#tmpl'), null,
+ 'Valid element should present it document head');
+ assert_not_equals(doc.querySelector('title'), null,
+ 'Valid title element should present it document head');
+
+}, '</template> tag in HTML head without start one should be ignored. '
+ + 'Test valid <template> element, <title> element and </template> tag after them');
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/end-template-tag-in-head.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ assert_equals(doc.head.querySelector('template'), null, '</template> must be ignored');
+ assert_not_equals(doc.head.querySelector('title'), null,
+ 'Valid element should present it document head');
+
+}, '</template> tag in HTML head without start one should be ignored. '
+ + 'Test HTML document loaded from file');
+
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-table-insertion-mode/end-tag-table.html b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-table-insertion-mode/end-tag-table.html
new file mode 100644
index 000000000..feb2eb108
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/additions-to-the-in-table-insertion-mode/end-tag-table.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: 'In table' insertion mode: ignore TABLE end tag</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="If parser is in 'in table' insertion mode and end tag table is met the ignore this token">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-table-addition">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function () {
+ var doc = newHTMLDocument();
+
+ doc.body.innerHTML = '<table id="table">'
+ + '<template id="template">'
+ + '</table>'
+ + '</template>'
+ + '<tr><td></td></tr>'
+ + '</table>';
+
+ var table = doc.querySelector('#table');
+ var template = table.querySelector('#template');
+
+ assert_equals(table.childNodes.length, 2, 'Wrong number of table children');
+ assert_not_equals(template, null, 'Template element must be parsed');
+ assert_equals(table.rows.length, 1, 'Wrong number of table rows');
+ assert_equals(template.childNodes.length, 0, 'Wrong number of the template child nodes');
+ assert_equals(template.content.childNodes.length, 0,
+ 'Wrong number of the template child nodes');
+
+
+}, 'In table insertion mode. Ignore </table> token');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/appending-to-a-template/template-child-nodes.html b/testing/web-platform/tests/html/syntax/parsing/template/appending-to-a-template/template-child-nodes.html
new file mode 100644
index 000000000..6292c3522
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/appending-to-a-template/template-child-nodes.html
@@ -0,0 +1,116 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: HTML parser appends child nodes only to the template contents node</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="HTML parser must append template's child nodes only to the template contents node.">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#appending-to-a-template">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="tmpl1">' +
+ '<div id="div1">This is div inside template</div>' +
+ '<div id="div2">This is another div inside template</div>' +
+ '</template>';
+
+ var template = doc.querySelector('#tmpl1');
+
+ assert_equals(template.childNodes.length, 0, 'Wrong number of template child nodes');
+ assert_equals(template.content.childNodes.length, 2,
+ 'Wrong number of template content child nodes');
+
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Element is absent in the template content');
+ assert_not_equals(template.content.querySelector('#div2'), null,
+ 'Element is absent in the template content');
+
+}, 'Template child nodes must be appended to template content node');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="tmpl1">' +
+ '<div id="div1">This is div inside template</div>' +
+ '<div id="div2">This is another div inside template</div>' +
+ '<template id="tmpl2">' +
+ '<div id="div3">This is div inside nested template</div>' +
+ '<div id="div4">This is another div inside nested template</div>' +
+ '</template>' +
+ '</template>';
+
+ var template = doc.querySelector('#tmpl1');
+
+ assert_equals(template.childNodes.length, 0,
+ 'Wrong number of template child nodes');
+ assert_equals(template.content.childNodes.length, 3,
+ 'Wrong number of template content child nodes');
+
+ assert_not_equals(template.content.querySelector('#div1'), null,
+ 'Element is absent in the template content');
+ assert_not_equals(template.content.querySelector('#div2'), null,
+ 'Element is absent in the template content');
+
+ var nestedTemplate = template.content.querySelector('#tmpl2');
+
+ assert_equals(nestedTemplate.childNodes.length, 0,
+ 'Wrong number of template child nodes');
+ assert_equals(nestedTemplate.content.childNodes.length, 2,
+ 'Wrong number of nested template content child nodes');
+
+ assert_not_equals(nestedTemplate.content.querySelector('#div3'), null,
+ 'Element is absent in the template content');
+ assert_not_equals(nestedTemplate.content.querySelector('#div4'), null,
+ 'Element is absent in the template content');
+
+}, 'Template child nodes must be appended to template content. Test nested template');
+
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ assert_equals(template.childNodes.length, 0, 'Wrong number of template child nodes');
+
+ assert_not_equals(template.content.querySelector('div'), null,
+ 'Element is absent in the template content');
+
+}, 'Template child nodes must be appended to template content node. '
+ + 'Load HTML document from a file');
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-nested.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ assert_equals(template.childNodes.length, 0, 'Wrong number of template child nodes');
+
+ var nestedTemplate = template.content.querySelector('template');
+
+ assert_not_equals(nestedTemplate, null,
+ 'Element is absent in the template content');
+
+ assert_equals(nestedTemplate.childNodes.length, 0,
+ 'Wrong number of template child nodes');
+
+ assert_not_equals(nestedTemplate.content.querySelector('div'), null,
+ 'Element is absent in the template content');
+
+}, 'Template child nodes must be appended to nested template content node. '
+ + 'Load HTML document from a file');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context.html b/testing/web-platform/tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context.html
new file mode 100644
index 000000000..a150faa1d
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context.html
@@ -0,0 +1,182 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Clearing stack back to a table body context</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="Clearing the stack back to a table body context must be aborted if the current node is template">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#clearing-the-stack">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+function doTest(doc, tagToTest, templateInnerHTML, id, tagName, bodiesNum, footerIsNull,
+ footerId, headerIsNull, headerId) {
+
+ doc.body.innerHTML = '' +
+ '<table id="tbl">' +
+ '<' + tagToTest + '>' +
+ '<template id="tmpl1">' +
+ // When parser meets <tr>, </tbody>, </tfoot>, </thead>, <caption>, <col>,
+ // <colgroup>, <tbody>, <tfoot>, <thead>, </table>
+ // stack must be cleared back to table body context. But <template> tag should
+ // abort this
+ templateInnerHTML +
+ '</template>' +
+ '<tr id="tr">' +
+ '<td id="td">' +
+ '</td>' +
+ '</tr>' +
+ '</' + tagToTest + '>' +
+ '</table>';
+
+ var table = doc.querySelector('#tbl');
+ var tr = doc.querySelector('#tr');
+ var td = doc.querySelector('#td');
+ var template = doc.querySelector('#tmpl1');
+
+ assert_equals(table.rows.length, 1, 'Wrong number of table rows');
+ assert_equals(table.rows[0].cells.length, 1, 'Wrong number of table cells');
+ if (id !== null) {
+ assert_not_equals(template.content.querySelector('#' + id), null,
+ 'Element should present in the template content');
+ }
+ if (tagName !== null) {
+ assert_equals(template.content.querySelector('#' + id).tagName, tagName,
+ 'Wrong element in the template content');
+ }
+
+ assert_equals(table.caption, null, 'Table should have no caption');
+
+ if (bodiesNum) {
+ assert_equals(table.tBodies.length, bodiesNum, 'Table should have '
+ + bodiesNum + ' body');
+ }
+ if (footerIsNull) {
+ assert_equals(table.tFoot, null, 'Table should have no footer');
+ }
+ if (footerId) {
+ assert_not_equals(table.tFoot.id, footerId,
+ 'Table should have no footer with id="' + footerId + '"');
+ }
+ if (headerIsNull) {
+ assert_equals(table.tHead, null, 'Table should have no header');
+ }
+ if (headerId) {
+ assert_not_equals(table.tHead.id, headerId,
+ 'Table should have no header with id="' + headerId + '"');
+ }
+}
+
+
+
+var doc = newHTMLDocument();
+var parameters = [
+ ['Clearing stack back to a table body context. Test <tr> in <tbody>',
+ doc, 'tbody', '<tr id="tr1"><td>Cell content</td></tr>', 'tr1', 'TR'],
+
+ ['Clearing stack back to a table body context. Test <tr> in <thead>',
+ doc, 'thead', '<tr id="tr2"><td>Cell content</td></tr>', 'tr2', 'TR'],
+
+ ['Clearing stack back to a table body context. Test <tr> in <tfoot>',
+ doc, 'tfoot', '<tr id="tr3"><td>Cell content</td></tr>', 'tr3', 'TR'],
+
+ ['Clearing stack back to a table body context. Test </tbody>',
+ doc, 'tbody', '</tbody>', null, null],
+
+ ['Clearing stack back to a table body context. Test </thead>',
+ doc, 'thead', '</thead>', null, null],
+
+ ['Clearing stack back to a table body context. Test </tfoot>',
+ doc, 'tfoot', '</tfoot>', null, null],
+
+ ['Clearing stack back to a table body context. Test <caption> in <tbody>',
+ doc, 'tbody', '<caption id="caption1">Table Caption</caption>', 'caption1', 'CAPTION'],
+
+ ['Clearing stack back to a table body context. Test <caption> in <tfoot>',
+ doc, 'tfoot', '<caption id="caption2">Table Caption</caption>', 'caption2', 'CAPTION'],
+
+ ['Clearing stack back to a table body context. Test <caption> in <thead>',
+ doc, 'thead', '<caption id="caption3">Table Caption</caption>', 'caption3', 'CAPTION'],
+
+ ['Clearing stack back to a table body context. Test <col> in <tbody>',
+ doc, 'tbody', '<col id="col1" width="150"/>', 'col1', 'COL'],
+
+ ['Clearing stack back to a table body context. Test <col> in <tfoot>',
+ doc, 'tfoot', '<col id="col2" width="150"/>', 'col2', 'COL'],
+
+ ['Clearing stack back to a table body context. Test <col> in <thead>',
+ doc, 'thead', '<col id="col3" width="150"/>', 'col3', 'COL'],
+
+ ['Clearing stack back to a table body context. Test <colgroup> in <tbody>',
+ doc, 'tbody', '<colgroup id="colgroup1" width="150"/>', 'colgroup1', 'COLGROUP'],
+
+ ['Clearing stack back to a table body context. Test <colgroup> in <tfoot>',
+ doc, 'tfoot', '<colgroup id="colgroup2" width="150"/>', 'colgroup2', 'COLGROUP'],
+
+ ['Clearing stack back to a table body context. Test <colgroup> in <thead>',
+ doc, 'thead', '<colgroup id="colgroup3" width="150"/>', 'colgroup3', 'COLGROUP'],
+
+ ['Clearing stack back to a table body context. Test <tbody> in <tbody>',
+ doc, 'tbody', '<tbody id="tbody1"></tbody>', 'tbody1', 'TBODY', 1],
+
+ ['Clearing stack back to a table body context. Test <tbody> in <tfoot>',
+ doc, 'tfoot', '<tbody id="tbody2"></tbody>', 'tbody2', 'TBODY', 0],
+
+ ['Clearing stack back to a table body context. Test <tbody> in <thead>',
+ doc, 'thead', '<tbody id="tbody3"></tbody>', 'tbody3', 'TBODY', 0],
+
+ ['Clearing stack back to a table body context. Test <tfoot> in <tbody>',
+ doc, 'tbody', '<tfoot id="tfoot1"></tfoot>', 'tfoot1', 'TFOOT', null, true],
+
+ ['Clearing stack back to a table body context. Test <tfoot> in <tfoot>',
+ doc, 'tfoot', '<tfoot id="tfoot2"></tfoot>', 'tfoot2', 'TFOOT', null, false, 'tfoot2'],
+
+ ['Clearing stack back to a table body context. Test <tfoot> in <thead>',
+ doc, 'thead', '<tfoot id="tfoot3"></tfoot>', 'tfoot3', 'TFOOT', null, true],
+
+ ['Clearing stack back to a table body context. Test <thead> in <tbody>',
+ doc, 'tbody', '<thead id="thead1"></thead>', 'thead1', 'THEAD', null, false, null, true],
+
+ ['Clearing stack back to a table body context. Test <thead> in <tfoot>',
+ doc, 'tfoot', '<thead id="thead2"></thead>', 'thead2', 'THEAD', null, false, null, true],
+
+ ['Clearing stack back to a table body context. Test <thead> in <thead>',
+ doc, 'thead', '<thead id="thead3"></thead>', 'thead3', 'THEAD', null, false, null, false, 'thead3'],
+
+ ['Clearing stack back to a table body context. Test </table> in <tbody>',
+ doc, 'tbody', '</table>', null, null, null, false, null, true],
+
+ ['Clearing stack back to a table body context. Test </table> in <tfoot>',
+ doc, 'tfoot', '</table>', null, null, null, false, null, true],
+
+ ['Clearing stack back to a table body context. Test </table> in <thead>',
+ doc, 'thead', '</table>', null, null],
+
+ ['Clearing stack back to a table body context. Test </tbody> in <thead>',
+ doc, 'thead', '</tbody>', null, null],
+
+ ['Clearing stack back to a table body context. Test </tbody> in <tfoot>',
+ doc, 'tfoot', '</tbody>', null, null],
+
+ ['Clearing stack back to a table body context. Test </thead> in <tbody>',
+ doc, 'tbody', '</thead>', null, null],
+
+ ['Clearing stack back to a table body context. Test </thead> in <tfoot>',
+ doc, 'tfoot', '</thead>', null, null],
+
+ ['Clearing stack back to a table body context. Test </tfoot> in <thead>',
+ doc, 'thead', '</tfoot>', null, null],
+
+ ['Clearing stack back to a table body context. Test </tfoot> in <tbody>',
+ doc, 'tbody', '</tfoot>', null, null]
+];
+
+generate_tests(doTest, parameters, 'Clearing stack back to a table body context.');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context.html b/testing/web-platform/tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context.html
new file mode 100644
index 000000000..23a4e7b0b
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Clearing stack back to a table context</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="Clearing the stack back to a table context must be aborted if the current node is template">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#clearing-the-stack">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+function doTest(doc, templateInnerHTML, id, tagName, bodiesNum, footerIsNull,
+ headerIsNull) {
+
+ doc.body.innerHTML = '' +
+ '<table id="tbl">' +
+ '<template id="tmpl1">' +
+ // When parser meets <caption>, <colgroup>, <tbody>, <tfoot>, <thead>, <col>
+ // stack must be cleared back to table context.
+ //But <template> tag should abort this process
+ templateInnerHTML +
+ '</template>' +
+ '<tr id="tr">' +
+ '<td id="td">' +
+ '</td>' +
+ '</tr>' +
+ '</table>';
+
+ var table = doc.querySelector('#tbl');
+ var tr = doc.querySelector('#tr');
+ var td = doc.querySelector('#td');
+ var template = doc.querySelector('#tmpl1');
+
+ assert_equals(table.rows.length, 1, 'Wrong number of table rows');
+ assert_equals(table.rows[0].cells.length, 1, 'Wrong number of table cells');
+ assert_equals(template.parentNode, table, 'Wrong template parent');
+ assert_not_equals(template.content.querySelector('#' + id), null,
+ 'Element should present in the template content');
+ assert_equals(doc.querySelector('#tbl').caption, null, 'Table should have no caption');
+ assert_equals(template.content.querySelector('#' + id).tagName, tagName,
+ 'Wrong element in the template content');
+ if (bodiesNum) {
+ assert_equals(table.tBodies.length, bodiesNum, 'Table should have '
+ + bodiesNum + ' body');
+ }
+ if (footerIsNull) {
+ assert_equals(table.tFoot, null, 'Table should have no footer');
+ }
+ if (headerIsNull) {
+ assert_equals(table.tHead, null, 'Table should have no header');
+ }
+}
+
+
+var doc = newHTMLDocument();
+var parameters = [
+ ['Clearing stack back to a table context. Test <caption>',
+ doc, '<caption id="caption1">Table caption</caption>', 'caption1', 'CAPTION'],
+
+ ['Clearing stack back to a table context. Test <colgroup>',
+ doc, '<colgroup id="colgroup1" width="100%"/>', 'colgroup1', 'COLGROUP'],
+
+ ['Clearing stack back to a table context. Test <tbody>',
+ doc, '<tbody id="tbody1"></tbody>', 'tbody1', 'TBODY', 1],
+
+ ['Clearing stack back to a table context. Test <tfoot>',
+ doc, '<tfoot id="tfoot1"></tfoot>', 'tfoot1', 'TFOOT', null, true],
+
+ ['Clearing stack back to a table context. Test <thead>',
+ doc, '<thead id="thead1"></thead>', 'thead1', 'THEAD', null, false, true],
+
+ ['Clearing stack back to a table context. Test <col>',
+ doc, '<col id="col1" width="100%"/>', 'col1', 'COL']
+];
+
+generate_tests(doTest, parameters, 'Clearing stack back to a table body context.');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context.html b/testing/web-platform/tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context.html
new file mode 100644
index 000000000..250391612
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: Clearing stack back to a table row context</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="assert" content="Clearing the stack back to a table row context must be aborted if the current node is template">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#clearing-the-stack">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+function doTest(doc, templateInnerHTML, id, tagName, elementId) {
+
+ doc.body.innerHTML = '' +
+ '<table id="tbl">' +
+ '<tr id="tr">' +
+ '<template id="tmpl1">' +
+ // When parser meets <th>, <td>, </tr>, stack must be cleared
+ // back to table row context.
+ // But <template> tag should abort this
+ templateInnerHTML +
+ '</template>' +
+ '<td id="td">' +
+ '</td>' +
+ '</tr>' +
+ '</table>';
+
+ var table = doc.querySelector('#tbl');
+ var tr = doc.querySelector('#tr');
+ var td = doc.querySelector('#td');
+ var template = doc.querySelector('#tmpl1');
+
+ assert_equals(table.rows.length, 1, 'Wrong number of table rows');
+ assert_equals(table.rows[0].cells.length, 1, 'Wrong number of table cells');
+ assert_equals(template.parentNode, tr, 'Wrong template parent');
+ if (id !== null) {
+ assert_not_equals(template.content.querySelector('#' + id), null,
+ 'Element should present in the template content');
+ }
+ if (tagName !== null) {
+ assert_equals(template.content.querySelector('#' + id).tagName, tagName,
+ 'Wrong element in the template content');
+ }
+ if (elementId) {
+ assert_equals(doc.querySelector('#' + elementId), null,
+ 'Table should have no element with ID ' + elementId);
+ }
+}
+
+
+var doc = newHTMLDocument();
+var parameters = [
+ ['Clearing stack back to a table row context. Test <th>',
+ doc, '<th id="th1">Table header</th>', 'th1', 'TH', 'th1'],
+
+ ['Clearing stack back to a table row context. Test <td>',
+ doc, '<td id="td1">Table cell</td>', 'td1', 'TD', 'td1'],
+
+ ['Clearing stack back to a table row context. Test </tr>',
+ doc, '</tr>', null, null]
+];
+
+generate_tests(doTest, parameters, 'Clearing stack back to a table body context.');
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/template/creating-an-element-for-the-token/template-owner-document.html b/testing/web-platform/tests/html/syntax/parsing/template/creating-an-element-for-the-token/template-owner-document.html
new file mode 100644
index 000000000..e1f999511
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/template/creating-an-element-for-the-token/template-owner-document.html
@@ -0,0 +1,221 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: ownerDocument property of the element in template</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<meta name="assert" content="ownerDocument property of the element appended to template must be set to the template contents owner of the ownerDocument of the template element">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#creating-an-element-for-a-token">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/resources/common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<div><template id="tmpl1"><div id="div">DIV</div></template></div>';
+
+ var template = doc.querySelector('#tmpl1');
+
+ var div = template.content.querySelector('#div');
+
+ assert_equals(div.ownerDocument, template.content.ownerDocument,
+ 'Wrong ownerDocument of the element in template');
+
+}, 'Test ownerDocument property of the element in a template. '
+ + 'Current DOCUMENT has no browsing context. Test template element inside the div');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="tmpl1"><div id="div">DIV</div></template>';
+
+ var template = doc.querySelector('#tmpl1');
+
+ var div = template.content.querySelector('#div');
+
+ assert_equals(div.ownerDocument, template.content.ownerDocument,
+ 'Wrong ownerDocument of the element in template');
+
+}, 'Test ownerDocument property of the element in a template. '
+ + 'Current DOCUMENT has no browsing context. Test template element '
+ + 'in the root of the body');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.head.innerHTML = '<template id="tmpl1"><div id="div">DIV</div></template>';
+
+ var template = doc.querySelector('#tmpl1');
+
+ var div = template.content.querySelector('#div');
+
+ assert_equals(div.ownerDocument, template.content.ownerDocument,
+ 'Wrong ownerDocument of the element in template');
+
+}, 'Test ownerDocument property of the element in a template. '
+ + 'Current DOCUMENT has no browsing context. Test template element '
+ + 'in the root of the head');
+
+
+
+test(function () {
+ var doc = newHTMLDocument();
+ doc.body.innerHTML = '<template id="tmpl1">'
+ + '<template id="tmpl2"><div id="div">DIV</div></template></template>';
+
+ var template = doc.querySelector('#tmpl1');
+
+ var nestedTemplate = template.content.querySelector('#tmpl2');
+
+ assert_equals(nestedTemplate.ownerDocument, template.content.ownerDocument,
+ 'Wrong nested template owner document');
+
+ var div = nestedTemplate.content.querySelector('#div');
+
+ assert_equals(div.ownerDocument, nestedTemplate.content.ownerDocument,
+ 'Wrong div ownerDocument');
+
+}, 'Test ownerDocument property of the element in a nested template');
+
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ var div = template.content.querySelector('div');
+
+ assert_equals(div.ownerDocument, template.content.ownerDocument,
+ 'Wrong ownerDocument of the element in template');
+
+}, 'Test ownerDocument property of the element in a template. '
+ + 'Load HTML document from a file, current DOCUMENT has browsing context');
+
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-nested.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template = doc.querySelector('template');
+
+ var nestedTemplate = template.content.querySelector('template');
+
+ assert_equals(nestedTemplate.ownerDocument, template.content.ownerDocument,
+ 'Wrong nested template owner document');
+
+ var div = nestedTemplate.content.querySelector('div');
+
+ assert_equals(div.ownerDocument, nestedTemplate.content.ownerDocument,
+ 'Wrong div ownerDocument');
+
+}, 'Test ownerDocument property of the element in a nested template. '
+ + 'Load HTML document from a file, current DOCUMENT has browsing context');
+
+
+
+testInIFrame('/html/semantics/scripting-1/the-template-element/resources/two-templates.html', function(context) {
+ var doc = context.iframes[0].contentDocument;
+
+ var template1 = doc.querySelector('#template1');
+ var div1 = template1.content.querySelector('div');
+ var template2 = doc.querySelector('#template2');
+ var div2 = template2.content.querySelector('div');
+
+ assert_equals(div1.ownerDocument, template1.content.ownerDocument,
+ 'Wrong ownerDocument of the element in template');
+ assert_equals(div2.ownerDocument, template2.content.ownerDocument,
+ 'Wrong ownerDocument of the element in template');
+ assert_equals(div1.ownerDocument, div2.ownerDocument,
+ 'Different elements in the same document should share the same template contents owner');
+
+}, 'Test ownerDocument property of two elements in a template. '
+ + 'Load HTML document from a file, current DOCUMENT has browsing context');
+
+
+var parameters = [];
+
+HTML5_ELEMENTS.forEach(function(value) {
+ if (value !== 'body' && value !== 'html' && value !== 'head' && value !== 'frameset') {
+
+ var doc = newHTMLDocument();
+
+ if (isVoidElement(value)) {
+ doc.body.innerHTML = '<template><' + value + '/></template>';
+ } else {
+ doc.body.innerHTML = '<template><' + value + '></' + value + '></template>';
+ }
+
+ var template = doc.querySelector('template');
+ var element = template.content.querySelector(value);
+
+ doc.body.appendChild(template);
+
+ parameters.push([
+ 'Test ownerDocument for the element ' + value + ' in the template',
+ element,
+ template
+ ]);
+ }
+});
+
+function compare_owners(element, template) {
+ assert_equals(element.ownerDocument, template.content.ownerDocument)
+}
+
+generate_tests(compare_owners, parameters,
+ 'Test ownerDocument property of all HTML5 elements in a template. '
+ + 'Current DOCUMENT has no browsing context.');
+
+var context = newContext();
+parameters = [];
+
+try {
+
+ HTML5_ELEMENTS.forEach(function(value) {
+
+ if (value !== 'body' && value !== 'html' && value !== 'head' && value !== 'frameset') {
+
+ var doc = newRenderedHTMLDocument(context);
+
+ if (isVoidElement(value)) {
+ doc.body.innerHTML = '<template><' + value + '/></template>';
+ } else {
+ doc.body.innerHTML = '<template><' + value + '></' + value + '></template>';
+ }
+
+ var template = doc.querySelector('template');
+ var element = template.content.querySelector(value);
+
+ doc.body.appendChild(template);
+
+ parameters.push([
+ 'Test ownerDocument for the element ' + value + ' in the template. '
+ + 'Document has browsing context',
+ element,
+ template
+ ]);
+ }
+ });
+ generate_tests(compare_owners, parameters,
+ 'Test ownerDocument property of all HTML5 elements in a template. '
+ + 'Current DOCUMENT has browsing context.');
+
+} finally {
+ try {
+ cleanContext(context);
+ } catch (e) {
+ //do nothing
+ }
+}
+
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/parsing/test.js b/testing/web-platform/tests/html/syntax/parsing/test.js
new file mode 100644
index 000000000..362272a2f
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/test.js
@@ -0,0 +1,331 @@
+var namespaces = {
+ "html":"http://www.w3.org/1999/xhtml",
+ "mathml":"http://www.w3.org/1998/Math/MathML",
+ "svg":"http://www.w3.org/2000/svg",
+ "xlink":"http://www.w3.org/1999/xlink",
+ "xml":"http://www.w3.org/XML/1998/namespace",
+ "xmlns":"http://www.w3.org/2000/xmlns/"
+};
+
+var prefixes = {};
+for (var prefix in namespaces) {
+ if (namespaces.hasOwnProperty(prefix)) {
+ prefixes[namespaces[prefix]] = prefix;
+ }
+}
+prefixes[namespaces["mathml"]] = "math";
+
+function format(format_string) {
+ var insertions = Array.prototype.slice.call(arguments, 1);
+ var regexp = /%s/g;
+ var match_count = 0;
+ var rv = format_string.replace(regexp, function(match) {
+ var rv = insertions[match_count];
+ match_count++;
+ return rv;
+ });
+ return rv;
+}
+
+function test_serializer(element) {
+ element.normalize();
+ var lines = [];
+ function serialize_element(element, indent) {
+ var indent_spaces = (new Array(indent)).join(" ");
+ switch(element.nodeType) {
+ case Node.DOCUMENT_TYPE_NODE:
+ if (element.name) {
+ if (element.publicId || element.systemId) {
+ var publicId = element.publicId ? element.publicId : "";
+ var systemId = element.systemId ? element.systemId : "";
+ lines.push(format("|%s<!DOCTYPE %s \"%s\" \"%s\">", indent_spaces,
+ element.name, publicId, systemId));
+ } else {
+ lines.push(format("|%s<!DOCTYPE %s>", indent_spaces,
+ element.name));
+ }
+ } else {
+ lines.push(format("|%s<!DOCTYPE >", indent_spaces));
+ }
+ break;
+ case Node.DOCUMENT_NODE:
+ lines.push("#document");
+ break;
+ case Node.DOCUMENT_FRAGMENT_NODE:
+ lines.push("#document-fragment");
+ break;
+ case Node.COMMENT_NODE:
+ lines.push(format("|%s<!-- %s -->", indent_spaces, element.nodeValue));
+ break;
+ case Node.TEXT_NODE:
+ lines.push(format("|%s\"%s\"", indent_spaces, element.nodeValue));
+ break;
+ case Node.ELEMENT_NODE:
+ if (element.getAttribute("data-skip") !== null) {
+ return;
+ }
+ if (element.namespaceURI !== null && element.namespaceURI !== namespaces.html) {
+ var name = format("%s %s", prefixes[element.namespaceURI],
+ element.localName);
+ } else {
+ var name = element.localName;
+ }
+ lines.push(format("|%s<%s>", indent_spaces, name));
+
+ var attributes = Array.prototype.map.call(
+ element.attributes,
+ function(attr) {
+ var name = (attr.namespaceURI ? prefixes[attr.namespaceURI] + " " : "") +
+ attr.localName;
+ return [name, attr.value];
+ });
+ attributes.sort(function (a, b) {
+ var x = a[0];
+ var y = b[0];
+ if (x === y) {
+ return 0;
+ }
+ return x > y ? 1 : -1;
+ });
+
+ attributes.forEach(
+ function(attr) {
+ var indent_spaces = (new Array(indent + 2)).join(" ");
+ lines.push(format("|%s%s=\"%s\"", indent_spaces, attr[0], attr[1]));
+ }
+ );
+ break;
+ }
+ indent += 2;
+ Array.prototype.forEach.call(element.childNodes,
+ function(node) {
+ serialize_element(node, indent);
+ });
+ }
+ serialize_element(element, 0);
+ return lines.join("\n");
+}
+
+function parse_query() {
+ var query = location.search.slice(1);
+ var vars = query.split("&");
+ var fields = vars.map(function (x) {
+ var split = x.split("=");
+ return [split[0], split.slice(1).join("=")];
+ });
+ return fields;
+}
+
+function get_type() {
+ var run_type = "uri";
+ var fields = parse_query();
+ fields.forEach(function(x) {
+ if(x[0] == "run_type") {
+ run_type = x[1];
+ }
+ });
+ return run_type;
+};
+
+var test_in_blob_uri = get_test_func(function (iframe, uri_encoded_input, t) {
+ var b = new Blob([decodeURIComponent(uri_encoded_input)], { type: "text/html" });
+ var blobURL = URL.createObjectURL(b);
+ iframe.src = blobURL;
+ t.add_cleanup(function() {
+ URL.revokeObjectURL(blobURL);
+ });
+ });
+
+var test_document_write = get_test_func(function(iframe, uri_encoded_input, t) {
+ iframe.contentDocument.open();
+ var input = decodeURIComponent(uri_encoded_input);
+ iframe.contentDocument.write(input);
+ iframe.contentDocument.close();
+ });
+
+var test_document_write_single = get_test_func(function(iframe, uri_encoded_input, t) {
+ iframe.contentDocument.open();
+ var input = decodeURIComponent(uri_encoded_input);
+ for (var i=0; i< input.length; i++) {
+ iframe.contentDocument.write(input[i]);
+ }
+ iframe.contentDocument.close();
+ });
+
+function get_test_func(inject_func) {
+ function test_func(iframe, t, test_id, uri_encoded_input, escaped_expected) {
+ var expected = decodeURIComponent(escaped_expected);
+ current_tests[iframe.id] = {test_id:test_id,
+ uri_encoded_input:uri_encoded_input,
+ expected:expected,
+ actual:null
+ };
+
+ iframe.onload = function() {
+ t.step(function() {
+ iframe.onload = null;
+ var serialized_dom = test_serializer(iframe.contentDocument);
+ current_tests[iframe.id].actual = serialized_dom;
+ assert_equals(serialized_dom, expected);
+ t.done();
+ }
+ );
+ };
+ inject_func(iframe, uri_encoded_input, t);
+ }
+ return test_func;
+}
+
+function test_fragment(iframe, t, test_id, uri_encoded_input, escaped_expected, container) {
+ var input_string = decodeURIComponent(uri_encoded_input);
+ var expected = decodeURIComponent(escaped_expected);
+ current_tests[iframe.id] = {
+ test_id:test_id,
+ input:uri_encoded_input,
+ expected:expected,
+ actual:null,
+ container:container
+ };
+
+ var components = container.split(" ");
+ var container_elem = null;
+ if (components.length > 1) {
+ var namespace = namespaces[components[0]];
+ container_elem = document.createElementNS(namespace,
+ components[0] + ":" +
+ components[1]);
+ } else {
+ container_elem = document.createElement(container);
+ }
+ container_elem.innerHTML = input_string;
+ var serialized_dom = test_serializer(container_elem);
+ current_tests[iframe.id].actual = serialized_dom;
+ serialized_dom = convert_innerHTML(serialized_dom);
+ assert_equals(serialized_dom, expected);
+ t.done();
+}
+
+function convert_innerHTML(serialized_dom) {
+ var lines = serialized_dom.split("\n");
+ lines[0] = "#document";
+ return lines.join("\n");
+}
+
+function print_diffs(test_id, uri_encoded_input, expected, actual, container) {
+ container = container ? container : null;
+ if (actual) {
+ var diffs = mark_diffs(expected, actual);
+ var expected_text = diffs[0];
+ var actual_text = diffs[1];
+ } else {
+ var expected_text = expected;
+ var actual_text = "";
+ }
+
+ var tmpl = ["div", {"id":"${test_id}"},
+ ["h2", {}, "${test_id}"],
+ function(vars) {
+ if (vars.container !== null) {
+ return ["div", {"class":"container"},
+ ["h3", {}, "innerHTML Container"],
+ ["pre", {}, vars.container]];
+ } else {
+ return null;
+ }
+ },
+ ["div", {"id":"input_${test_id}"}, ["h3", {}, "Input"], ["pre", {},
+ ["code", {}, decodeURIComponent(uri_encoded_input)]]],
+ ["div", {"id":"expected_${test_id}"}, ["h3", {}, "Expected"],
+ ["pre", {}, ["code", {}, expected_text]]],
+ ["div", {"id":"actual_${test_id}"}, ["h3", {}, "Actual"],
+ ["pre", {}, ["code", {}, actual_text]]]
+ ];
+
+ var diff_dom = template.render(tmpl, {test_id:test_id, container:container});
+ document.body.appendChild(diff_dom);
+}
+
+var current_tests = {};
+var iframe_map = {};
+
+function init_tests(test_type) {
+ var test_func = null;
+ var test_funcs = {
+ "write":test_document_write,
+ "write_single":test_document_write_single,
+ "uri":test_in_blob_uri,
+ "innerHTML":test_fragment
+ };
+ var tests_started = 0;
+ var tests_complete = 0;
+
+ setup(function() {
+ test_func = test_funcs[test_type];
+
+ var fails = [];
+
+ add_result_callback(function(test) {
+ tests_complete++;
+ var iframe = document.getElementById(iframe_map[test.name]);
+ if (test.status !== test.PASS) {
+ fails.push(current_tests[iframe.id]);
+ var new_iframe = document.createElement("iframe");
+ new_iframe.style.display = "none";
+ new_iframe.id = iframe.id;
+ document.body.replaceChild(new_iframe, iframe);
+ iframe = new_iframe;
+ }
+ if (tests_complete === order.length) {
+ done();
+ } else if (tests_started < order.length) {
+ test_next(iframe);
+ }
+ });
+
+ add_completion_callback(function() {
+ fails.forEach(function(t) {
+ print_diffs(t.test_id, t.uri_encoded_input,
+ t.expected, t.actual);
+ });
+ });
+
+ //Create the iframes we will use to test
+ //in the innerHTML case these are not actually used
+ //but it is convenient to reuse the same code
+ for (var i=0; i<num_iframes; i++) {
+ var iframe = document.createElement("iframe");
+ iframe.id = "iframe_" + i;
+ iframe.style.display = "none";
+ document.body.appendChild(iframe);
+ }
+ },
+ {explicit_done:true});
+
+ function test_next(iframe) {
+ var test_id = order[tests_started];
+ tests_started++;
+ var x = tests[test_id];
+ var t = x[0];
+ iframe_map[t.name] = iframe.id;
+ setTimeout(function() {
+ t.step(function() {
+ var string_uri_encoded_input = x[1];
+ var string_escaped_expected = x[2];
+ if (test_type === "innerHTML") {
+ var container = x[3];
+ }
+ test_func(iframe, t, test_id, string_uri_encoded_input, string_escaped_expected,
+ container);
+ });
+ }, 0);
+ }
+
+ onload = function() {
+ Array.prototype.forEach.call(document.getElementsByTagName("iframe"),
+ function(iframe) {
+ if (tests_started<order.length) {
+ test_next(iframe);
+ }
+ });
+ };
+}
diff --git a/testing/web-platform/tests/html/syntax/parsing/the-end.html b/testing/web-platform/tests/html/syntax/parsing/the-end.html
new file mode 100644
index 000000000..0a7babf0b
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/parsing/the-end.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>The end</title>
+<link rel=help href="https://html.spec.whatwg.org/multipage/#the-end">
+<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(e) {
+ assert_equals(e.type, "DOMContentLoaded");
+ assert_true(e.bubbles, "bubbles should be true");
+ assert_false(e.cancelable, "cancelable should be false");
+ assert_equals(e.target, document, "target should be document");
+ assert_true(e.isTrusted, "isTrusted should be true");
+ assert_class_string(e, "Event");
+ }));
+}, "DOMContentLoaded");
+
+async_test(function() {
+ window.addEventListener("load", this.step_func_done(function(e) {
+ assert_equals(e.type, "load");
+ assert_false(e.bubbles, "bubbles should be false");
+ assert_false(e.cancelable, "cancelable should be false");
+ assert_equals(e.target, document, "target should be document");
+ assert_true(e.isTrusted, "isTrusted should be true");
+ assert_class_string(e, "Event");
+ }));
+}, "load");
+
+async_test(function() {
+ var seen = false;
+ document.addEventListener("DOMContentLoaded", this.step_func(function() {
+ seen = true;
+ }));
+ window.addEventListener("load", this.step_func_done(function() {
+ assert_true(seen, "DOMContentLoaded should be fired before load");
+ }));
+}, "order");
+</script>
diff --git a/testing/web-platform/tests/html/syntax/serializing-html-fragments/.gitkeep b/testing/web-platform/tests/html/syntax/serializing-html-fragments/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/serializing-html-fragments/.gitkeep
diff --git a/testing/web-platform/tests/html/syntax/serializing-html-fragments/initial-linefeed-pre.html b/testing/web-platform/tests/html/syntax/serializing-html-fragments/initial-linefeed-pre.html
new file mode 100644
index 000000000..d4e30bb60
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/serializing-html-fragments/initial-linefeed-pre.html
@@ -0,0 +1,48 @@
+<!doctype html>
+<title>innerHTML getter for pre/textarea/listing with initial LF</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id="outer">
+<div id="inner">
+<pre id="pre1">
+x</pre>
+<pre id="pre2">
+
+x</pre>
+<textarea id="textarea1">
+x</textarea>
+<textarea id="textarea2">
+
+x</textarea>
+<listing id="listing1">
+x</listing>
+<listing id="listing2">
+
+x</listing>
+</div>
+</div>
+
+<script>
+var expected_outer = '\n<div id="inner">\n<pre id="pre1">x</pre>\n<pre id="pre2">\nx</pre>\n<textarea id="textarea1">x</textarea>\n<textarea id="textarea2">\nx</textarea>\n<listing id="listing1">x</listing>\n<listing id="listing2">\nx</listing>\n</div>\n';
+var expected_inner = expected_outer.replace('\n<div id="inner">', '').replace('</div>\n', '');
+var expected_1 = 'x';
+var expected_2 = '\nx';
+
+test(function() {
+ assert_equals(outer.innerHTML, expected_outer);
+}, 'outer div');
+
+test(function() {
+ assert_equals(inner.innerHTML, expected_inner);
+}, 'inner div');
+
+['pre', 'textarea', 'listing'].forEach(function(tag) {
+ test(function() {
+ assert_equals(document.getElementById(tag + '1').innerHTML, expected_1);
+ }, tag + '1');
+
+ test(function() {
+ assert_equals(document.getElementById(tag + '2').innerHTML, expected_2);
+ }, tag + '2');
+});
+</script>
diff --git a/testing/web-platform/tests/html/syntax/serializing-html-fragments/outerHTML.html b/testing/web-platform/tests/html/syntax/serializing-html-fragments/outerHTML.html
new file mode 100644
index 000000000..2e4805a20
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/serializing-html-fragments/outerHTML.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML Test: element.outerHTML to verify HTML fragment serialization algorithm</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/">
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#html-fragment-serialization-algorithm">
+ <link rel="help" href="https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#widl-Element-outerHTML">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../html-element-list.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function() {
+ elements_with_end_tag.forEach(function(ele) {
+ test(function() {
+ var e = document.createElement(ele);
+ assert_equals(e.outerHTML, "<" + ele + "></" + ele + ">", ele + " node created." );
+ }, "Node for " + ele);
+ });
+ elements_without_end_tag.forEach(function(ele) {
+ test(function() {
+ var e = document.createElement(ele);
+ assert_equals(e.outerHTML, "<" + ele + ">", ele + " node created." );
+ }, "Node for " + ele);
+ });
+ }, document.title);
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/serializing-html-fragments/serializing.html b/testing/web-platform/tests/html/syntax/serializing-html-fragments/serializing.html
new file mode 100644
index 000000000..6b7e678a3
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/serializing-html-fragments/serializing.html
@@ -0,0 +1,332 @@
+<!DOCTYPE html>
+<title>innerHTML in HTML</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+
+<!-- test elments. Each has an expected innerHTML and outerHTML in an array in the <script>-->
+<div id="test" style="display:none">
+<span></span>
+<span><a></a></span>
+<span><a b=c></a></span>
+<span><a b='c'></a></span>
+<span><a b='&'></a></span>
+<span><a b='&nbsp;'></a></span>
+<span><a b='"'></a></span>
+<span><a b="<"></a></span>
+<span><a b=">"></a></span>
+<span><svg xlink:href="a"></svg></span>
+<span><svg xmlns:svg="test"></svg></span>
+<span>a</span>
+<span>&amp;</span>
+<span>&nbsp;</span>
+<span>&lt;</span>
+<span>&gt;</span>
+<span>&quot;</span>
+<span><style><&></style></span>
+<span><script type="test"><&></script></span>
+<span><xmp><&></xmp></span>
+<span><iframe><&></iframe></span>
+<span><noembed><&></noembed></span>
+<span><noframes><&></noframes></span>
+<span><noscript><&></noscript></span>
+<span><!--data--></span>
+<span><a><b><c></c></b><d>e</d><f><g>h</g></f></a></span>
+<span b=c></span>
+</div>
+<!-- TODO: template element -->
+<script>
+
+var test_data = document.getElementById("test").getElementsByTagName("span");
+var expected = [
+["", "<span></span>"],
+["<a></a>", "<span><a></a></span>"],
+["<a b=\"c\"></a>", "<span><a b=\"c\"></a></span>"],
+["<a b=\"c\"></a>", "<span><a b=\"c\"></a></span>"],
+["<a b=\"&amp;\"></a>", "<span><a b=\"&amp;\"></a></span>"],
+["<a b=\"&nbsp;\"></a>", "<span><a b=\"&nbsp;\"></a></span>"],
+["<a b=\"&quot;\"></a>", "<span><a b=\"&quot;\"></a></span>"],
+["<a b=\"<\"></a>", "<span><a b=\"<\"></a></span>"],
+["<a b=\">\"></a>", "<span><a b=\">\"></a></span>"],
+["<svg xlink:href=\"a\"></svg>", "<span><svg xlink:href=\"a\"></svg></span>"],
+["<svg xmlns:svg=\"test\"></svg>", "<span><svg xmlns:svg=\"test\"></svg></span>"],
+["a", "<span>a</span>"],
+["&amp;", "<span>&amp;</span>"],
+["&nbsp;", "<span>&nbsp;</span>"],
+["&lt;", "<span>&lt;</span>"],
+["&gt;", "<span>&gt;</span>"],
+["\"", "<span>\"</span>"],
+["<style><&></style>", "<span><style><&></style></span>"],
+["<script type=\"test\"><&><\/script>", "<span><script type=\"test\"><&><\/script></span>"],
+["<xmp><&></xmp>", "<span><xmp><&></xmp></span>"],
+["<iframe><&></iframe>", "<span><iframe><&></iframe></span>"],
+["<noembed><&></noembed>", "<span><noembed><&></noembed></span>"],
+["<noframes><&></noframes>", "<span><noframes><&></noframes></span>"],
+["<noscript><&></noscript>", "<span><noscript><&></noscript></span>"],
+["<!--data-->", "<span><!--data--></span>"],
+["<a><b><c></c></b><d>e</d><f><g>h</g></f></a>", "<span><a><b><c></c></b><d>e</d><f><g>h</g></f></a></span>"],
+["", "<span b=\"c\"></span>"]
+];
+
+var dom_tests = [
+ ["Attribute in the XML namespace",
+ function() {
+ var span = document.createElement("span");
+ var svg = document.createElement("svg");
+ svg.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:foo", "test");
+ span.appendChild(svg);
+ return span;
+ },
+ '<svg xml:foo="test"></svg>',
+ '<span><svg xml:foo="test"></svg></span>'],
+
+ ["Attribute in the XML namespace with the prefix not set to xml:",
+ function() {
+ var span = document.createElement("span");
+ var svg = document.createElement("svg");
+ svg.setAttributeNS("http://www.w3.org/XML/1998/namespace", "abc:foo", "test");
+ span.appendChild(svg);
+ return span;
+ },
+ '<svg xml:foo="test"></svg>',
+ '<span><svg xml:foo="test"></svg></span>'],
+
+ ["Non-'xmlns' attribute in the xmlns namespace",
+ function() {
+ var span = document.createElement("span");
+ var svg = document.createElement("svg");
+ svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:foo", "test")
+ span.appendChild(svg);
+ return span;
+ },
+ '<svg xmlns:foo="test"></svg>',
+ '<span><svg xmlns:foo="test"></svg></span>'],
+
+ ["'xmlns' attribute in the xmlns namespace",
+ function() {
+ var span = document.createElement("span");
+ var svg = document.createElement("svg");
+ svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "test")
+ span.appendChild(svg);
+ return span;
+ },
+ '<svg xmlns="test"></svg>',
+ '<span><svg xmlns="test"></svg></span>'],
+
+ ["Attribute in non-standard namespace",
+ function() {
+ var span = document.createElement("span");
+ var svg = document.createElement("svg");
+ svg.setAttributeNS("fake_ns", "abc:def", "test")
+ span.appendChild(svg);
+ return span;
+ },
+ '<svg abc:def="test"></svg>',
+ '<span><svg abc:def="test"></svg></span>'],
+
+ ["<span> starting with U+000A",
+ function() {
+ var elem = document.createElement("span");
+ elem.appendChild(document.createTextNode("\x0A"));
+ return elem;
+ },
+ "\x0A",
+ "<span>\x0A</span>"],
+
+ //TODO: Processing instructions
+]
+
+var text_elements = ["pre", "textarea", "listing"];
+
+var text_tests = [
+ ["<%text> context starting with U+000A",
+ function(elem) {
+ elem.appendChild(document.createTextNode("\x0A"));
+ return elem;
+ },
+ "\x0A",
+ "<%text>\x0A</%text>"],
+
+ ["<%text> context not starting with U+000A",
+ function(elem) {
+ elem.appendChild(document.createTextNode("a\x0A"));
+ return elem;
+ },
+ "a\x0A",
+ "<%text>a\x0A</%text>"],
+
+ ["<%text> non-context starting with U+000A",
+ function(elem) {
+ var span = document.createElement("span");
+ elem.appendChild(document.createTextNode("\x0A"));
+ span.appendChild(elem);
+ return span;
+ },
+ "<%text>\x0A</%text>",
+ "<span><%text>\x0A</%text></span>"],
+
+ ["<%text> non-context not starting with U+000A",
+ function(elem) {
+ var span = document.createElement("span");
+ elem.appendChild(document.createTextNode("a\x0A"));
+ span.appendChild(elem);
+ return span;
+ },
+ "<%text>a\x0A</%text>",
+ "<span><%text>a\x0A</%text></span>"],
+]
+
+var void_elements = [
+ "area", "base", "basefont", "bgsound", "br", "col", "embed",
+ "frame", "hr", "img", "input", "keygen", "link", "menuitem",
+ "meta", "param", "source", "track", "wbr"
+];
+
+var void_tests = [
+ ["Void context node",
+ function (void_elem) {
+ return void_elem;
+ },
+ "",
+ "<%void>"
+ ],
+ ["void as first child with following siblings",
+ function (void_elem) {
+ var span = document.createElement("span");
+ span.appendChild(void_elem);
+ span.appendChild(document.createElement("a")).appendChild(document.createTextNode("test"));
+ span.appendChild(document.createElement("b"))
+ return span
+ },
+ "<%void><a>test</a><b></b>",
+ "<span><%void><a>test</a><b></b></span>"
+ ],
+ ["void as second child with following siblings",
+ function (void_elem) {
+ var span = document.createElement("span");
+ span.appendChild(document.createElement("a")).appendChild(document.createTextNode("test"));
+ span.appendChild(void_elem);
+ span.appendChild(document.createElement("b"))
+ return span;
+ },
+ "<a>test</a><%void><b></b>",
+ "<span><a>test</a><%void><b></b></span>"
+ ],
+ ["void as last child with preceding siblings",
+ function (void_elem) {
+ var span = document.createElement("span");
+ span.appendChild(document.createElement("a")).appendChild(document.createTextNode("test"));
+ span.appendChild(document.createElement("b"))
+ span.appendChild(void_elem);
+ return span;
+ },
+ "<a>test</a><b></b><%void>",
+ "<span><a>test</a><b></b><%void></span>"
+ ],
+]
+
+function cross_map(a1, a2, f) {
+ var rv = [];
+ a1.forEach(function(a1_elem) {
+ a2.forEach(function(a2_elem) {
+ rv.push(f(a1_elem, a2_elem));
+ })
+ });
+ return rv;
+}
+
+function innerHTML_test(func, elem, expected) {
+ assert_equals(func(elem).innerHTML, expected);
+}
+
+function outerHTML_test(func, elem, expected) {
+ assert_equals(func(elem).outerHTML, expected);
+}
+
+
+function make_void(name) {
+ var rv = document.createElement(name);
+ rv.appendChild(document.createElement("a")).appendChild(document.createComment("abc"))
+ rv.appendChild(document.createElement("b")).
+ appendChild(document.createElement("c")).
+ appendChild(document.createTextNode("abc"))
+ return rv;
+}
+
+function make_text(name) {
+ return document.createElement(name);
+}
+
+generate_tests(innerHTML_test,
+ expected.map(function(item, i) {
+ return ["innerHTML " + i + " " + expected[i][0],
+ function() {return test_data[i]},
+ null,
+ item[0]];
+ }))
+
+generate_tests(outerHTML_test,
+ expected.map(function(item, i) {
+ return ["outerHTML " + i + " " + expected[i][1],
+ function() {return test_data[i]},
+ null,
+ item[1]];
+ }))
+
+generate_tests(innerHTML_test,
+ dom_tests.map(function(item) {
+ return ["innerHTML " + item[0],
+ item[1],
+ null,
+ item[2]];
+ }))
+
+generate_tests(outerHTML_test,
+ dom_tests.map(function(item) {
+ return ["outerHTML " + item[0],
+ item[1],
+ null,
+ item[3]];
+ }))
+
+generate_tests(innerHTML_test,
+ cross_map(text_tests, text_elements,
+ function(test_data, elem_name) {
+ var rv = ["innerHTML " + test_data[0].replace(/%text/g, elem_name),
+ test_data[1],
+ document.createElement(elem_name),
+ test_data[2].replace(/%text/g, elem_name)];
+ return rv;
+ }))
+
+generate_tests(outerHTML_test,
+ cross_map(text_tests, text_elements,
+ function(test_data, elem_name) {
+ var rv = ["outerHTML " + test_data[0].replace(/%text/g, elem_name),
+ test_data[1],
+ document.createElement(elem_name),
+ test_data[3].replace(/%text/g, elem_name)];
+ return rv;
+ }))
+
+generate_tests(innerHTML_test,
+ cross_map(void_tests, void_elements,
+ function(test_data, elem_name) {
+ var rv = ["innerHTML " + test_data[0] + " " + elem_name,
+ test_data[1],
+ make_void(elem_name),
+ test_data[2].replace(/%void/g, elem_name)];
+ return rv;
+ }))
+
+generate_tests(outerHTML_test,
+ cross_map(void_tests, void_elements,
+ function(test_data, elem_name) {
+ var rv = ["outerHTML " + test_data[0] + " " + elem_name,
+ test_data[1],
+ make_void(elem_name),
+ test_data[3].replace(/%void/g, elem_name)];
+ return rv;
+ }))
+
+</script>
diff --git a/testing/web-platform/tests/html/syntax/serializing-xml-fragments/outerHTML.html b/testing/web-platform/tests/html/syntax/serializing-xml-fragments/outerHTML.html
new file mode 100644
index 000000000..334ce8adf
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/serializing-xml-fragments/outerHTML.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTML Test: element.outerHTML to verify XML fragment serialization algorithm</title>
+ <link rel="author" title="Intel" href="http://www.intel.com/">
+ <link rel="help" href="https://w3c.github.io/DOM-Parsing/#dfn-concept-serialize-xml">
+ <link rel="help" href="https://w3c.github.io/DOM-Parsing/#widl-Element-outerHTML">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="../html-element-list.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function() {
+ var doc = document.implementation.createDocument(null, "");
+ assert_equals(doc.contentType, "application/xml");
+ var html_ns = "http://www.w3.org/1999/xhtml";
+ elements_with_end_tag.forEach(function(ele) {
+ test(function() {
+ var e = doc.createElementNS(html_ns, ele);
+ assert_equals(e.outerHTML,
+ `<${ele} xmlns="${html_ns}"></${ele}>`,
+ ele + " node created." );
+ }, "Node for " + ele);
+ });
+ elements_without_end_tag.forEach(function(ele) {
+ test(function() {
+ var e = doc.createElementNS(html_ns, ele);
+ assert_equals(e.outerHTML,
+ `<${ele} xmlns="${html_ns}" />`,
+ ele + " node created." );
+ }, "Node for " + ele);
+ });
+ }, document.title);
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/syntax/writing/.gitkeep b/testing/web-platform/tests/html/syntax/writing/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/writing/.gitkeep
diff --git a/testing/web-platform/tests/html/syntax/writing/cdata-sections/.gitkeep b/testing/web-platform/tests/html/syntax/writing/cdata-sections/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/writing/cdata-sections/.gitkeep
diff --git a/testing/web-platform/tests/html/syntax/writing/character-references/.gitkeep b/testing/web-platform/tests/html/syntax/writing/character-references/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/writing/character-references/.gitkeep
diff --git a/testing/web-platform/tests/html/syntax/writing/comments/.gitkeep b/testing/web-platform/tests/html/syntax/writing/comments/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/writing/comments/.gitkeep
diff --git a/testing/web-platform/tests/html/syntax/writing/elements-0/.gitkeep b/testing/web-platform/tests/html/syntax/writing/elements-0/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/writing/elements-0/.gitkeep
diff --git a/testing/web-platform/tests/html/syntax/writing/elements-0/contains.json b/testing/web-platform/tests/html/syntax/writing/elements-0/contains.json
new file mode 100644
index 000000000..39711a0a2
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/writing/elements-0/contains.json
@@ -0,0 +1,26 @@
+[
+ {
+ "id": "start-tags",
+ "original_id": "start-tags"
+ },
+ {
+ "id": "end-tags",
+ "original_id": "end-tags"
+ },
+ {
+ "id": "attributes-0",
+ "original_id": "attributes-0"
+ },
+ {
+ "id": "optional-tags",
+ "original_id": "optional-tags"
+ },
+ {
+ "id": "element-restrictions",
+ "original_id": "element-restrictions"
+ },
+ {
+ "id": "cdata-rcdata-restrictions",
+ "original_id": "cdata-rcdata-restrictions"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/writing/text/.gitkeep b/testing/web-platform/tests/html/syntax/writing/text/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/writing/text/.gitkeep
diff --git a/testing/web-platform/tests/html/syntax/writing/text/contains.json b/testing/web-platform/tests/html/syntax/writing/text/contains.json
new file mode 100644
index 000000000..870ff58a3
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/writing/text/contains.json
@@ -0,0 +1,6 @@
+[
+ {
+ "id": "newlines",
+ "original_id": "newlines"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/syntax/writing/the-doctype/.gitkeep b/testing/web-platform/tests/html/syntax/writing/the-doctype/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/writing/the-doctype/.gitkeep
diff --git a/testing/web-platform/tests/html/the-xhtml-syntax/.gitkeep b/testing/web-platform/tests/html/the-xhtml-syntax/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/the-xhtml-syntax/.gitkeep
diff --git a/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/.gitkeep b/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/.gitkeep
diff --git a/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm b/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm
new file mode 100644
index 000000000..8460f5ff1
--- /dev/null
+++ b/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>HTML entities for various XHTML Doctype variants</title>
+<link rel=help href="http://w3c.github.io/html/xhtml.html#parsing-xhtml-documents">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ var parser = new DOMParser();
+ var parse = parser.parseFromString.bind(parser);
+
+ function generateTestFunction(entitystring, expectedString, publicId, systemId, mimeType, friendlyMime) {
+ return function () {
+ var doctypeString = '<!DOCTYPE html';
+ if (publicId != null)
+ doctypeString += ' PUBLIC "' + publicId + '" "' + systemId + '">';
+ else if (systemId != null)
+ doctypeString += ' SYSTEM "' + systemId + '">';
+ else // both are null
+ doctypeString += '>';
+ var doc = parse(doctypeString + "<html><head></head><body id='test'>"+entitystring+"</body></html>", mimeType);
+ var root = doc.getElementById('test');
+ assert_not_equals(root, null, friendlyMime + " parsing the entity reference caused a parse error;");
+ assert_true(!!root.firstChild);
+ // Next line because some browsers include the partial parsed result in the parser error returned document.
+ assert_equals(root.firstChild.nodeType, 3/*Text*/, friendlyMime + " parsing the entity reference caused a parse error;");
+ var text = root.firstChild.data;
+ for (var i = 0, len = expectedString.length; i < len; i++) {
+ assert_equals(text.charCodeAt(i),expectedString.charCodeAt(i));
+ }
+ }
+ }
+
+ function setupTests(jsonEntities, publicId, systemId, mimeType, friendlyMime) {
+ for (entityName in jsonEntities) {
+ if ((mimeType == "text/html") || /;$/.test(entityName)) {
+ test(generateTestFunction(entityName, jsonEntities[entityName].characters, publicId, systemId, mimeType, friendlyMime), friendlyMime + " parsing " + entityName);
+ }
+ }
+ }
+
+ setup(function() {}, {explicit_done: true});
+
+ var xhr = new XMLHttpRequest();
+ xhr.open("GET", "/common/entities.json");
+ xhr.onload = function () {
+ var entitiesJSON = JSON.parse(xhr.response);
+ [
+ ["application/xhtml+xml", "-//W3C//DTD XHTML 1.0 Transitional//EN", "foo", "XHTML1.0 Transitional"],
+ ["application/xhtml+xml", "-//W3C//DTD XHTML 1.1//EN", "foo", "XHTML1.1"],
+ ["application/xhtml+xml", "-//W3C//DTD XHTML 1.0 Strict//EN", "foo", "XHTML1.0 Strict"],
+ ["application/xhtml+xml", "-//W3C//DTD XHTML 1.0 Frameset//EN", "foo", "XHTML1.0 Frameset"],
+ ["application/xhtml+xml", "-//W3C//DTD XHTML Basic 1.0//EN", "foo", "XHTML Basic"],
+ ["application/xhtml+xml", "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN", "foo", "XHTML1.1+MathML"],
+ ["application/xhtml+xml", "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN", "foo", "XHTML1.1+MathML+SVG"],
+ ["application/xhtml+xml", "-//W3C//DTD MathML 2.0//EN", "foo", "MathML"],
+ ["application/xhtml+xml", "-//WAPFORUM//DTD XHTML Mobile 1.0//EN", "foo", "XHTML Mobile"],
+// ["application/xhtml+xml", null, "mathml.dtd", "SYSTEM MathML"], // Experimental
+ ["text/html", null, null, "HTML"]
+ ].forEach(function (row) {
+ setupTests(entitiesJSON, row[1], row[2], row[0], row[3]);
+ });
+ done();
+ }
+ xhr.send();
+
+</script>
diff --git a/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-fragments/.gitkeep b/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-fragments/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/the-xhtml-syntax/parsing-xhtml-fragments/.gitkeep
diff --git a/testing/web-platform/tests/html/the-xhtml-syntax/serializing-xhtml-fragments/.gitkeep b/testing/web-platform/tests/html/the-xhtml-syntax/serializing-xhtml-fragments/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/the-xhtml-syntax/serializing-xhtml-fragments/.gitkeep
diff --git a/testing/web-platform/tests/html/the-xhtml-syntax/writing-xhtml-documents/.gitkeep b/testing/web-platform/tests/html/the-xhtml-syntax/writing-xhtml-documents/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/the-xhtml-syntax/writing-xhtml-documents/.gitkeep
diff --git a/testing/web-platform/tests/html/tools/html5lib_test.xml b/testing/web-platform/tests/html/tools/html5lib_test.xml
new file mode 100644
index 000000000..8af4adce1
--- /dev/null
+++ b/testing/web-platform/tests/html/tools/html5lib_test.xml
@@ -0,0 +1,29 @@
+<html xmlns:py="http://genshi.edgewall.org/">
+ <head>
+ <meta charset="utf8"/>
+ <title>HTML 5 Parser tests ${file_name}</title>
+ <meta name="timeout" content="long"/>
+ <meta name="variant" content="?run_type=uri"/>
+ <meta name="variant" content="?run_type=write"/>
+ <meta name="variant" content="?run_type=write_single"/>
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="template.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ var num_iframes = 8;
+
+ var order = [<py:for each="test in tests">'${test.id}',</py:for>];
+ var tests = {
+ <py:for each="test in tests">"${test.id}":[async_test('${file_name} ${test.id}'), ${test.string_uri_encoded_input}, ${test.string_escaped_expected}],</py:for>
+ }
+ init_tests(get_type());
+ </script>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/tools/html5lib_test_fragment.xml b/testing/web-platform/tests/html/tools/html5lib_test_fragment.xml
new file mode 100644
index 000000000..5be259b74
--- /dev/null
+++ b/testing/web-platform/tests/html/tools/html5lib_test_fragment.xml
@@ -0,0 +1,27 @@
+<html xmlns:py="http://genshi.edgewall.org/">
+ <head>
+ <meta charset="utf8"/>
+ <title>HTML 5 Parser tests ${file_name}</title>
+ <meta name="timeout" content="long"/>
+ </head>
+ <body>
+ <h1>html5lib Parser Test</h1>
+ <div id="log"></div>
+ <script src="common.js"></script>
+ <script src="test.js"></script>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+
+ var num_iframes = 8;
+
+ var order = [<py:for each="test in tests">'${test.id}',</py:for>];
+ var tests = {
+ <py:for each="test in tests">"${test.id}":[async_test('${file_name} ${test.id}'), ${test.string_uri_encoded_input}, ${test.string_escaped_expected}, '${test.container}'],</py:for>
+ }
+
+ init_tests("innerHTML");
+
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/tools/update_html5lib_tests.py b/testing/web-platform/tests/html/tools/update_html5lib_tests.py
new file mode 100644
index 000000000..2235ddffd
--- /dev/null
+++ b/testing/web-platform/tests/html/tools/update_html5lib_tests.py
@@ -0,0 +1,152 @@
+import sys
+import os
+import hashlib
+import urllib
+import itertools
+import re
+import json
+import glob
+import shutil
+
+try:
+ import genshi
+ from genshi.template import MarkupTemplate
+
+ from html5lib.tests import support
+except ImportError:
+ print """This script requires the Genshi templating library and html5lib source
+
+It is recommended that these are installed in a virtualenv:
+
+virtualenv venv
+source venv/bin/activate
+pip install genshi
+cd venv
+git clone git@github.com:html5lib/html5lib-python.git html5lib
+cd html5lib
+git submodule init
+git submodule update
+pip install -e ./
+
+Then run this script again, with the virtual environment still active.
+When you are done, type "deactivate" to deactivate the virtual environment.
+"""
+
+TESTS_PATH = "html/syntax/parsing/"
+
+def get_paths():
+ script_path = os.path.split(os.path.abspath(__file__))[0]
+ repo_base = get_repo_base(script_path)
+ tests_path = os.path.join(repo_base, TESTS_PATH)
+ return script_path, tests_path
+
+def get_repo_base(path):
+ while path:
+ if os.path.exists(os.path.join(path, ".git")):
+ return path
+ else:
+ path = os.path.split(path)[0]
+
+def get_expected(data):
+ data = "#document\n" + data
+ return data
+
+def get_hash(data, container=None):
+ if container == None:
+ container = ""
+ return hashlib.sha1("#container%s#data%s"%(container.encode("utf8"),
+ data.encode("utf8"))).hexdigest()
+
+def make_tests(script_dir, out_dir, input_file_name, test_data):
+ tests = []
+ innerHTML_tests = []
+ ids_seen = {}
+ print input_file_name
+ for test in test_data:
+ if "script-off" in test:
+ continue
+ is_innerHTML = "document-fragment" in test
+ data = test["data"]
+ container = test["document-fragment"] if is_innerHTML else None
+ assert test["document"], test
+ expected = get_expected(test["document"])
+ test_list = innerHTML_tests if is_innerHTML else tests
+ test_id = get_hash(data, container)
+ if test_id in ids_seen:
+ print "WARNING: id %s seen multiple times in file %s this time for test (%s, %s) before for test %s, skipping"%(test_id, input_file_name, container, data, ids_seen[test_id])
+ continue
+ ids_seen[test_id] = (container, data)
+ test_list.append({'string_uri_encoded_input':"\"%s\""%urllib.quote(data.encode("utf8")),
+ 'input':data,
+ 'expected':expected,
+ 'string_escaped_expected':json.dumps(urllib.quote(expected.encode("utf8"))),
+ 'id':test_id,
+ 'container':container
+ })
+ path_normal = None
+ if tests:
+ path_normal = write_test_file(script_dir, out_dir,
+ tests, "html5lib_%s"%input_file_name,
+ "html5lib_test.xml")
+ path_innerHTML = None
+ if innerHTML_tests:
+ path_innerHTML = write_test_file(script_dir, out_dir,
+ innerHTML_tests, "html5lib_innerHTML_%s"%input_file_name,
+ "html5lib_test_fragment.xml")
+
+ return path_normal, path_innerHTML
+
+def write_test_file(script_dir, out_dir, tests, file_name, template_file_name):
+ file_name = os.path.join(out_dir, file_name + ".html")
+ short_name = os.path.split(file_name)[1]
+
+ with open(os.path.join(script_dir, template_file_name), "r") as f:
+ template = MarkupTemplate(f)
+
+ stream = template.generate(file_name=short_name, tests=tests)
+
+ with open(file_name, "w") as f:
+ f.write(stream.render('html', doctype='html5',
+ encoding="utf8"))
+ return file_name
+
+def escape_js_string(in_data):
+ return in_data.encode("utf8").encode("string-escape")
+
+def serialize_filenames(test_filenames):
+ return "[" + ",\n".join("\"%s\""%item for item in test_filenames) + "]"
+
+def main():
+
+ script_dir, out_dir = get_paths()
+
+ test_files = []
+ inner_html_files = []
+
+ if len(sys.argv) > 2:
+ test_iterator = itertools.izip(
+ itertools.repeat(False),
+ sorted(os.path.abspath(item) for item in
+ glob.glob(os.path.join(sys.argv[2], "*.dat"))))
+ else:
+ test_iterator = itertools.chain(
+ itertools.izip(itertools.repeat(False),
+ sorted(support.get_data_files("tree-construction"))),
+ itertools.izip(itertools.repeat(True),
+ sorted(support.get_data_files(
+ os.path.join("tree-construction", "scripted")))))
+
+ for (scripted, test_file) in test_iterator:
+ input_file_name = os.path.splitext(os.path.split(test_file)[1])[0]
+ if scripted:
+ input_file_name = "scripted_" + input_file_name
+ test_data = support.TestData(test_file)
+ test_filename, inner_html_file_name = make_tests(script_dir, out_dir,
+ input_file_name, test_data)
+ if test_filename is not None:
+ test_files.append(test_filename)
+ if inner_html_file_name is not None:
+ inner_html_files.append(inner_html_file_name)
+
+if __name__ == "__main__":
+ main()
diff --git a/testing/web-platform/tests/html/webappapis/.gitkeep b/testing/web-platform/tests/html/webappapis/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/animation-frames/callback-exception.html b/testing/web-platform/tests/html/webappapis/animation-frames/callback-exception.html
new file mode 100644
index 000000000..3867f0c41
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/animation-frames/callback-exception.html
@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+ <head>
+ <title>requestAnimationFrame callback exception reported to error handler</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <link rel="help" href="https://w3c.github.io/web-performance/specs/RequestAnimationFrame/Overview.html#dom-windowanimationtiming-requestanimationframe"/>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var custom_exception = 'requestAnimationFrameException';
+ setup({allow_uncaught_exception : true});
+ async_test(function (t) {
+ addEventListener("error",function(e) {
+ t.step(function() {
+ assert_equals(e.error.message, custom_exception);
+ t.done();
+ })
+ });
+ window.requestAnimationFrame(function () {
+ throw new Error(custom_exception);
+ });
+ }, "requestAnimationFrame callback exceptions are reported to error handler");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/animation-frames/callback-invoked.html b/testing/web-platform/tests/html/webappapis/animation-frames/callback-invoked.html
new file mode 100644
index 000000000..ca34e455a
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/animation-frames/callback-invoked.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<html>
+ <head>
+ <title>requestAnimationFrame must be triggered once</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <link rel="help" href="https://w3c.github.io/web-performance/specs/RequestAnimationFrame/Overview.html#dom-windowanimationtiming-requestanimationframe"/>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ async_test(function (t) {
+ assert_false(document.hidden, "document.hidden must exist and be false to run this test properly");
+ window.requestAnimationFrame(t.step_func_done());
+ }, "requestAnimationFrame callback is invoked at least once before the timeout");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/animation-frames/callback-multicalls.html b/testing/web-platform/tests/html/webappapis/animation-frames/callback-multicalls.html
new file mode 100644
index 000000000..38f34171e
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/animation-frames/callback-multicalls.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>AnimationTiming Test: multiple calls to requestAnimationFrame with the same callback</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-window-requestanimationframe">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+
+ async_test(function(t) {
+ var counter = 0;
+ window.requestAnimationFrame(callback);
+
+ function callback() {
+ ++counter;
+ if (counter == 2) {
+ t.done();
+ } else {
+ window.requestAnimationFrame(callback);
+ }
+ };
+
+ }, "Check that multiple calls to requestAnimationFrame with the same callback will result in multiple entries being in the list with that same callback.");
+
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/animation-frames/cancel-invoked.html b/testing/web-platform/tests/html/webappapis/animation-frames/cancel-invoked.html
new file mode 100644
index 000000000..d075c0fda
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/animation-frames/cancel-invoked.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<html>
+ <head>
+ <title>cancelAnimationFrame does nothing</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <link rel="help" href="https://w3c.github.io/web-performance/specs/RequestAnimationFrame/Overview.html#dom-windowanimationtiming-cancelanimationframe"/>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function (t) {
+ window.cancelAnimationFrame(42);
+ assert_true(true);
+ }, "cancelAnimationFrame does nothing if there is no callback with the given handle");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/animation-frames/idlharness.html b/testing/web-platform/tests/html/webappapis/animation-frames/idlharness.html
new file mode 100644
index 000000000..acc6657fa
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/animation-frames/idlharness.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>idlharness test</title>
+<link rel="author" title="Kensaku Komatsu" href="mailto:kensaku.komatsu@gmail.com" />
+<link rel="help" href="http://www.w3.org/TR/animation-timing/#definitions"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/WebIDLParser.js"></script>
+<script src="/resources/idlharness.js"></script>
+</head>
+<body>
+<h1>idlharness test</h1>
+<p>This test validates the WebIDL included in the Timing control for script-based animations specification.</p>
+
+<pre id='untested_idl' style='display:none'>
+[PrimaryGlobal]
+interface Window {
+};
+</pre>
+
+<pre id='idl'>
+partial interface Window {
+ long requestAnimationFrame(FrameRequestCallback callback);
+ void cancelAnimationFrame(long handle);
+};
+
+callback FrameRequestCallback = void (DOMHighResTimeStamp time);
+</pre>
+
+<script>
+
+(function() {
+ var idl_array = new IdlArray();
+
+ idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
+ idl_array.add_idls(document.getElementById("idl").textContent);
+
+ idl_array.add_objects({Window: ["window"]});
+
+ idl_array.test();
+})();
+
+</script>
+
+<div id="log"></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/animation-frames/same-dispatch-time.html b/testing/web-platform/tests/html/webappapis/animation-frames/same-dispatch-time.html
new file mode 100644
index 000000000..e92eb61e9
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/animation-frames/same-dispatch-time.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<html>
+ <head>
+ <title>requestAnimationFrame in queue get the same timestamp</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <link rel="help" href="http://w3c.github.io/animation-timing/#dfn-invoke-callbacks-algorithm"/>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function (t) {
+ var a = 0, b = 0;
+
+ /* REASONING:
+ * These two methods that will be called with a timestamp. Because
+ * they execute right after eachother, they're added to the same
+ * queue and SHOULD be timestamped with the same value.
+ */
+ window.requestAnimationFrame(function() { a = arguments[0]; });
+ window.requestAnimationFrame(function() { b = arguments[0]; });
+
+ setTimeout(function() {
+ assert_true(a != 0);
+ assert_true(b != 0);
+ assert_true(a == b);
+ }, 100);
+ }, "requestAnimationFrame will timestamp events in the same queue with the same time");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/atob/.gitkeep b/testing/web-platform/tests/html/webappapis/atob/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/atob/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/atob/base64.html b/testing/web-platform/tests/html/webappapis/atob/base64.html
new file mode 100644
index 000000000..c33ab228f
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/atob/base64.html
@@ -0,0 +1,306 @@
+<!doctype html>
+<!-- Originally developed by Aryeh Gregor, funded by Google. Copyright belongs
+to Google. -->
+<title>atob()/btoa() tests</title>
+<meta charset=utf-8>
+<div id=log></div>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+/**
+ * btoa() as defined by the HTML5 spec, which mostly just references RFC4648.
+ */
+function mybtoa(s) {
+ // String conversion as required by WebIDL.
+ s = String(s);
+
+ // "The btoa() method must throw an INVALID_CHARACTER_ERR exception if the
+ // method's first argument contains any character whose code point is
+ // greater than U+00FF."
+ for (var i = 0; i < s.length; i++) {
+ if (s.charCodeAt(i) > 255) {
+ return "INVALID_CHARACTER_ERR";
+ }
+ }
+
+ var out = "";
+ for (var i = 0; i < s.length; i += 3) {
+ var groupsOfSix = [undefined, undefined, undefined, undefined];
+ groupsOfSix[0] = s.charCodeAt(i) >> 2;
+ groupsOfSix[1] = (s.charCodeAt(i) & 0x03) << 4;
+ if (s.length > i + 1) {
+ groupsOfSix[1] |= s.charCodeAt(i + 1) >> 4;
+ groupsOfSix[2] = (s.charCodeAt(i + 1) & 0x0f) << 2;
+ }
+ if (s.length > i + 2) {
+ groupsOfSix[2] |= s.charCodeAt(i + 2) >> 6;
+ groupsOfSix[3] = s.charCodeAt(i + 2) & 0x3f;
+ }
+ for (var j = 0; j < groupsOfSix.length; j++) {
+ if (typeof groupsOfSix[j] == "undefined") {
+ out += "=";
+ } else {
+ out += btoaLookup(groupsOfSix[j]);
+ }
+ }
+ }
+ return out;
+}
+
+/**
+ * Lookup table for mybtoa(), which converts a six-bit number into the
+ * corresponding ASCII character.
+ */
+function btoaLookup(idx) {
+ if (idx < 26) {
+ return String.fromCharCode(idx + 'A'.charCodeAt(0));
+ }
+ if (idx < 52) {
+ return String.fromCharCode(idx - 26 + 'a'.charCodeAt(0));
+ }
+ if (idx < 62) {
+ return String.fromCharCode(idx - 52 + '0'.charCodeAt(0));
+ }
+ if (idx == 62) {
+ return '+';
+ }
+ if (idx == 63) {
+ return '/';
+ }
+ // Throw INVALID_CHARACTER_ERR exception here -- won't be hit in the tests.
+}
+
+/**
+ * Implementation of atob() according to the HTML spec, except that instead of
+ * throwing INVALID_CHARACTER_ERR we return null.
+ */
+function myatob(input) {
+ // WebIDL requires DOMStrings to just be converted using ECMAScript
+ // ToString, which in our case amounts to calling String().
+ input = String(input);
+
+ // "Remove all space characters from input."
+ input = input.replace(/[ \t\n\f\r]/g, "");
+
+ // "If the length of input divides by 4 leaving no remainder, then: if
+ // input ends with one or two U+003D EQUALS SIGN (=) characters, remove
+ // them from input."
+ if (input.length % 4 == 0 && /==?$/.test(input)) {
+ input = input.replace(/==?$/, "");
+ }
+
+ // "If the length of input divides by 4 leaving a remainder of 1, throw an
+ // INVALID_CHARACTER_ERR exception and abort these steps."
+ //
+ // "If input contains a character that is not in the following list of
+ // characters and character ranges, throw an INVALID_CHARACTER_ERR
+ // exception and abort these steps:
+ //
+ // U+002B PLUS SIGN (+)
+ // U+002F SOLIDUS (/)
+ // U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9)
+ // U+0041 LATIN CAPITAL LETTER A to U+005A LATIN CAPITAL LETTER Z
+ // U+0061 LATIN SMALL LETTER A to U+007A LATIN SMALL LETTER Z"
+ if (input.length % 4 == 1
+ || !/^[+/0-9A-Za-z]*$/.test(input)) {
+ return null;
+ }
+
+ // "Let output be a string, initially empty."
+ var output = "";
+
+ // "Let buffer be a buffer that can have bits appended to it, initially
+ // empty."
+ //
+ // We append bits via left-shift and or. accumulatedBits is used to track
+ // when we've gotten to 24 bits.
+ var buffer = 0;
+ var accumulatedBits = 0;
+
+ // "While position does not point past the end of input, run these
+ // substeps:"
+ for (var i = 0; i < input.length; i++) {
+ // "Find the character pointed to by position in the first column of
+ // the following table. Let n be the number given in the second cell of
+ // the same row."
+ //
+ // "Append to buffer the six bits corresponding to number, most
+ // significant bit first."
+ //
+ // atobLookup() implements the table from the spec.
+ buffer <<= 6;
+ buffer |= atobLookup(input[i]);
+
+ // "If buffer has accumulated 24 bits, interpret them as three 8-bit
+ // big-endian numbers. Append the three characters with code points
+ // equal to those numbers to output, in the same order, and then empty
+ // buffer."
+ accumulatedBits += 6;
+ if (accumulatedBits == 24) {
+ output += String.fromCharCode((buffer & 0xff0000) >> 16);
+ output += String.fromCharCode((buffer & 0xff00) >> 8);
+ output += String.fromCharCode(buffer & 0xff);
+ buffer = accumulatedBits = 0;
+ }
+
+ // "Advance position by one character."
+ }
+
+ // "If buffer is not empty, it contains either 12 or 18 bits. If it
+ // contains 12 bits, discard the last four and interpret the remaining
+ // eight as an 8-bit big-endian number. If it contains 18 bits, discard the
+ // last two and interpret the remaining 16 as two 8-bit big-endian numbers.
+ // Append the one or two characters with code points equal to those one or
+ // two numbers to output, in the same order."
+ if (accumulatedBits == 12) {
+ buffer >>= 4;
+ output += String.fromCharCode(buffer);
+ } else if (accumulatedBits == 18) {
+ buffer >>= 2;
+ output += String.fromCharCode((buffer & 0xff00) >> 8);
+ output += String.fromCharCode(buffer & 0xff);
+ }
+
+ // "Return output."
+ return output;
+}
+
+/**
+ * A lookup table for atob(), which converts an ASCII character to the
+ * corresponding six-bit number.
+ */
+function atobLookup(chr) {
+ if (/[A-Z]/.test(chr)) {
+ return chr.charCodeAt(0) - "A".charCodeAt(0);
+ }
+ if (/[a-z]/.test(chr)) {
+ return chr.charCodeAt(0) - "a".charCodeAt(0) + 26;
+ }
+ if (/[0-9]/.test(chr)) {
+ return chr.charCodeAt(0) - "0".charCodeAt(0) + 52;
+ }
+ if (chr == "+") {
+ return 62;
+ }
+ if (chr == "/") {
+ return 63;
+ }
+ // Throw exception; should not be hit in tests
+}
+
+function btoaException(input) {
+ input = String(input);
+ for (var i = 0; i < input.length; i++) {
+ if (input.charCodeAt(i) > 255) {
+ return true;
+ }
+ }
+ return false;
+}
+
+function testBtoa(input) {
+ // "The btoa() method must throw an INVALID_CHARACTER_ERR exception if the
+ // method's first argument contains any character whose code point is
+ // greater than U+00FF."
+ var normalizedInput = String(input);
+ for (var i = 0; i < normalizedInput.length; i++) {
+ if (normalizedInput.charCodeAt(i) > 255) {
+ assert_throws("InvalidCharacterError", function() { btoa(input); },
+ "Code unit " + i + " has value " + normalizedInput.charCodeAt(i) + ", which is greater than 255");
+ return;
+ }
+ }
+ assert_equals(btoa(input), mybtoa(input));
+ assert_equals(atob(btoa(input)), String(input), "atob(btoa(input)) must be the same as String(input)");
+}
+
+var tests = ["עברית", "", "ab", "abc", "abcd", "abcde",
+ // This one is thrown in because IE9 seems to fail atob(btoa()) on it. Or
+ // possibly to fail btoa(). I actually can't tell what's happening here,
+ // but it doesn't hurt.
+ "\xff\xff\xc0",
+ // Is your DOM implementation binary-safe?
+ "\0a", "a\0b",
+ // WebIDL tests.
+ undefined, null, 7, 12, 1.5, true, false, NaN, +Infinity, -Infinity, 0, -0,
+ {toString: function() { return "foo" }},
+];
+for (var i = 0; i < 258; i++) {
+ tests.push(String.fromCharCode(i));
+}
+tests.push(String.fromCharCode(10000));
+tests.push(String.fromCharCode(65534));
+tests.push(String.fromCharCode(65535));
+
+// This is supposed to be U+10000.
+tests.push(String.fromCharCode(0xd800, 0xdc00));
+tests = tests.map(
+ function(elem) {
+ var expected = mybtoa(elem);
+ if (expected === "INVALID_CHARACTER_ERR") {
+ return ["btoa(" + format_value(elem) + ") must raise INVALID_CHARACTER_ERR", elem];
+ }
+ return ["btoa(" + format_value(elem) + ") == " + format_value(mybtoa(elem)), elem];
+ }
+);
+
+var everything = "";
+for (var i = 0; i < 256; i++) {
+ everything += String.fromCharCode(i);
+}
+tests.push(["btoa(first 256 code points concatenated)", everything]);
+
+generate_tests(testBtoa, tests);
+
+function testAtob(input) {
+ var expected = myatob(input);
+ if (expected === null) {
+ assert_throws("InvalidCharacterError", function() { atob(input) });
+ return;
+ }
+
+ assert_equals(atob(input), expected);
+}
+
+var tests = ["", "abcd", " abcd", "abcd ", " abcd===", "abcd=== ",
+ "abcd ===", "a", "ab", "abc", "abcde", String.fromCharCode(0xd800, 0xdc00),
+ "=", "==", "===", "====", "=====",
+ "a=", "a==", "a===", "a====", "a=====",
+ "ab=", "ab==", "ab===", "ab====", "ab=====",
+ "abc=", "abc==", "abc===", "abc====", "abc=====",
+ "abcd=", "abcd==", "abcd===", "abcd====", "abcd=====",
+ "abcde=", "abcde==", "abcde===", "abcde====", "abcde=====",
+ "=a", "=a=", "a=b", "a=b=", "ab=c", "ab=c=", "abc=d", "abc=d=",
+ // With whitespace
+ "ab\tcd", "ab\ncd", "ab\fcd", "ab\rcd", "ab cd", "ab\u00a0cd",
+ "ab\t\n\f\r cd", " \t\n\f\r ab\t\n\f\r cd\t\n\f\r ",
+ "ab\t\n\f\r =\t\n\f\r =\t\n\f\r ",
+ // Test if any bits are set at the end. These should all be fine, since
+ // they end with A, which becomes 0:
+ "A", "/A", "//A", "///A", "////A",
+ // These are all bad, since they end in / (= 63, all bits set) but their
+ // length isn't a multiple of four characters, so they can't be output by
+ // btoa(). Thus one might expect some UAs to throw exceptions or otherwise
+ // object, since they could never be output by btoa(), so they're good to
+ // test.
+ "/", "A/", "AA/", "AAAA/",
+ // But this one is possible:
+ "AAA/",
+ // Binary-safety tests
+ "\0nonsense", "abcd\0nonsense",
+ // WebIDL tests
+ undefined, null, 7, 12, 1.5, true, false, NaN, +Infinity, -Infinity, 0, -0,
+ {toString: function() { return "foo" }},
+ {toString: function() { return "abcd" }},
+];
+tests = tests.map(
+ function(elem) {
+ if (myatob(elem) === null) {
+ return ["atob(" + format_value(elem) + ") must raise InvalidCharacterError", elem];
+ }
+ return ["atob(" + format_value(elem) + ") == " + format_value(myatob(elem)), elem];
+ }
+);
+
+generate_tests(testAtob, tests);
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-exception.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-exception.html
new file mode 100644
index 000000000..fecda221d
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-exception.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>requestIdleCallback callback exception reported to error handler</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id="log"></div>
+<script>
+ var custom_exception = 'requestIdleCallbackException';
+ setup({allow_uncaught_exception : true});
+ async_test(function (t) {
+ assert_false(document.hidden, "document.hidden must exist and be false to run this test properly");
+ addEventListener("error",function(e) {
+ t.step(function() {
+ assert_equals(e.error.message, custom_exception);
+ t.done();
+ })
+ });
+ window.requestIdleCallback(function () {
+ throw new Error(custom_exception);
+ });
+ }, "requestIdleCallback callback exceptions are reported to error handler");
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-iframe.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-iframe.html
new file mode 100644
index 000000000..965941be1
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-iframe.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<meta charset=utf-8>
+<title></title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id="log"></div>
+<iframe style="display:none" id="frame"></iframe>
+<script>
+ async_test(function (t) {
+ let frame = document.getElementById("frame");
+ frame.contentWindow.test = function() {
+ frame.contentWindow.requestIdleCallback(t.step_func_done());
+ }
+
+ frame.contentWindow.test();
+ });
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-invoked.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-invoked.html
new file mode 100644
index 000000000..5e799cf39
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-invoked.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>requestIdleCallback callback must be called eventually</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id="log"></div>
+<script>
+ async_test(function (t) {
+ assert_false(document.hidden, "document.hidden must exist and be false to run this test properly");
+ window.requestIdleCallback(t.step_func_done());
+ }, "requestIdleCallback callback is invoked at least once before the timeout");
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-multiple-calls.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-multiple-calls.html
new file mode 100644
index 000000000..8584c71da
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-multiple-calls.html
@@ -0,0 +1,41 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>multiple calls to requestIdleCallback</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id="log"></div>
+<script>
+ async_test(function (t) {
+ assert_false(document.hidden, "document.hidden must exist and be false to run this test properly");
+ var counter = 0;
+ function f(c) {
+ assert_equals(counter, c);
+ if (counter === 99) {
+ t.done();
+ }
+
+ ++counter;
+ }
+ for (var i = 0; i < 100; ++i) {
+ let j = i;
+ window.requestIdleCallback(t.step_func(function () { f(j) }));
+ }
+ }, "requestIdleCallback callbacks should be invoked in order (called iteratively)");
+
+ async_test(function (t) {
+ assert_false(document.hidden, "document.hidden must exist and be false to run this test properly");
+ var counter = 0;
+
+ function f(c) {
+ assert_equals(counter, c);
+ if (counter === 99) {
+ t.done();
+ }
+
+ ++counter;
+ window.requestIdleCallback(t.step_func(function () { f(c + 1) }));
+ }
+
+ window.requestIdleCallback(t.step_func(function () { f(0) }));
+ }, "requestIdleCallback callbacks should be invoked in order (called recursively)");
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-timeout.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-timeout.html
new file mode 100644
index 000000000..823d5f5db
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-timeout.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>requestIdleCallback timeout callback must be called with didTimeout equal to true</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id="log"></div>
+<script>
+ async_test(function (t) {
+ assert_false(document.hidden, "document.hidden must exist and be false to run this test properly");
+ var counter = 0;
+
+ function g(deadline) {
+ assert_true(deadline.didTimeout)
+ t.done();
+ }
+
+ function f(deadline) {
+ assert_false(deadline.didTimeout);
+ window.requestIdleCallback(t.step_func(g), {timeout:300});
+
+ var d = Date.now() + 500;
+ while (Date.now() < d) {
+
+ }
+ }
+ window.requestIdleCallback(t.step_func(f));
+ }, "requestIdleCallback callback should time out");
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/cancel-invoked.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/cancel-invoked.html
new file mode 100644
index 000000000..8956b8709
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/cancel-invoked.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>cancelling idle requests</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id="log"></div>
+<script>
+ test(function (t) {
+ window.cancelIdleCallback(42);
+ assert_true(true);
+ }, "cancelIdleCallback does nothing if there is no callback with the given handle");
+
+ async_test(function (t) {
+ assert_false(document.hidden, "document.hidden must exist and be false to run this test properly");
+ var neverCalled = true;
+ var handle = window.requestIdleCallback(function () {
+ neverCalled = false;
+ });
+ window.cancelIdleCallback(handle);
+
+ t.step_timeout(function() {
+ assert_true(neverCalled);
+ t.done();
+ }, 2000);
+ }, "A cancelled callback is never invoked");
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/idlharness.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/idlharness.html
new file mode 100644
index 000000000..6033535f3
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/idlharness.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>idlharness test</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src="/resources/WebIDLParser.js"></script>
+<script src="/resources/idlharness.js"></script>
+
+<pre id='untested_idl' style='display:none'>
+[PrimaryGlobal]
+interface Window {
+};
+</pre>
+
+<pre id='idl'>
+partial interface Window {
+ unsigned long requestIdleCallback(IdleRequestCallback callback,
+ optional IdleRequestOptions options);
+ void cancelIdleCallback(unsigned long handle);
+};
+
+dictionary IdleRequestOptions {
+ unsigned long timeout;
+};
+
+callback IdleRequestCallback = void (IdleDeadline deadline);
+</pre>
+<script>
+ var idl_array = new IdlArray();
+ idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
+ idl_array.add_idls(document.getElementById("idl").textContent);
+ idl_array.add_objects({Window: ["window"]});
+ idl_array.test();
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/.gitkeep b/testing/web-platform/tests/html/webappapis/scripting/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/scripting/enabling-and-disabling-scripting/.gitkeep b/testing/web-platform/tests/html/webappapis/scripting/enabling-and-disabling-scripting/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/enabling-and-disabling-scripting/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/scripting/event-loops/.gitkeep b/testing/web-platform/tests/html/webappapis/scripting/event-loops/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/event-loops/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/scripting/event-loops/contains.json b/testing/web-platform/tests/html/webappapis/scripting/event-loops/contains.json
new file mode 100644
index 000000000..5d7e5e600
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/event-loops/contains.json
@@ -0,0 +1,14 @@
+[
+ {
+ "id": "definitions-1",
+ "original_id": "definitions-1"
+ },
+ {
+ "id": "processing-model-3",
+ "original_id": "processing-model-3"
+ },
+ {
+ "id": "generic-task-sources",
+ "original_id": "generic-task-sources"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/event-loops/microtask_after_raf.html b/testing/web-platform/tests/html/webappapis/scripting/event-loops/microtask_after_raf.html
new file mode 100644
index 000000000..824dbc4b9
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/event-loops/microtask_after_raf.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<head>
+<link rel=author title="Aleks Totic" href="mailto:atotic@chromium.org">
+<link rel=help href="https://html.spec.whatwg.org/#clean-up-after-running-script">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/common.js"></script>
+</head>
+<body style="height:2000px;">
+<script>
+/*
+promise 1, promise 2 execute immediately after rAF
+promise 1 child executes immediately after promise 2.
+
+Relevant specs:
+
+https://html.spec.whatwg.org/#clean-up-after-running-script
+If the JavaScript execution context stack is now empty, perform a microtask checkpoint.
+
+https://html.spec.whatwg.org/#perform-a-microtask-checkpoint
+"perform a microtask checkpoint" runs in a loop until all microtasks have been delivered.
+*/
+
+var test = async_test("Microtask execute immediately after script");
+
+window.requestAnimationFrame( function() {
+ var events = [];
+
+ Promise.resolve()
+ .then(function() {
+ events.push("promise 1");
+ return Promise.resolve();
+ })
+ .then(function() {
+ test.step(function() {
+ events.push("promise 1 child");
+ assert_array_equals(events, ["promise 1", "promise 2", "promise 1 child"]);
+ test.done();
+ });
+ });
+ Promise.resolve()
+ .then(function() {
+ events.push("promise 2");
+ });
+
+ // Set up events that must be executed after Promise.
+ window.setTimeout(function() {
+ events.push('timeout');
+ }, 0);
+ window.addEventListener('scroll', function() {
+ events.push('scroll');
+ });
+ window.scrollBy(0,10);
+
+});
+</script>
+</body>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/event-loops/microtask_after_script.html b/testing/web-platform/tests/html/webappapis/scripting/event-loops/microtask_after_script.html
new file mode 100644
index 000000000..799a0de60
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/event-loops/microtask_after_script.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<head>
+<link rel=author title="Aleks Totic" href="mailto:atotic@chromium.org">
+<link rel=help href="https://html.spec.whatwg.org/#clean-up-after-running-script">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/common.js"></script>
+</head>
+<body style="height:2000px;">
+<script>
+/*
+promise 1, promise 2 execute immediately after script tag
+promise 1 child executes immediately after promise 2.
+
+Relevant specs:
+
+https://html.spec.whatwg.org/#clean-up-after-running-script
+If the JavaScript execution context stack is now empty, perform a microtask checkpoint.
+
+https://html.spec.whatwg.org/#perform-a-microtask-checkpoint
+"perform a microtask checkpoint" runs in a loop until all microtasks have been delivered.
+*/
+
+var test = async_test("Microtask immediately after script");
+
+var events = [];
+
+Promise.resolve()
+.then(function() {
+ events.push("promise 1");
+ return Promise.resolve();
+})
+.then(function() {
+ test.step(function() {
+ events.push("promise 1 child");
+ assert_array_equals(events, ["promise 1", "promise 2", "promise 1 child"]);
+ test.done();
+ });
+});
+Promise.resolve()
+.then(function() {
+ events.push("promise 2");
+});
+
+// Set up events that must be executed after Promise.
+window.setTimeout(function() {
+ events.push('timeout');
+}, 0);
+window.addEventListener('scroll', function() {
+ events.push('scroll');
+});
+window.scrollBy(0,10);
+
+</script>
+</body>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/event-loops/resources/common.js b/testing/web-platform/tests/html/webappapis/scripting/event-loops/resources/common.js
new file mode 100644
index 000000000..e2279f93d
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/event-loops/resources/common.js
@@ -0,0 +1,20 @@
+// Helper for tests that just want to verify the ordering of a series of events.
+// Usage:
+// log_test(function(t, log) {
+// log('first');
+// log('second');
+// }, ['first', 'second'], 'Ordinal numbers are ordinal');
+
+function log_test(func, expected, description) {
+ async_test(function(t) {
+ var actual = [];
+ function log(entry) {
+ actual.push(entry);
+ if (expected.length <= actual.length) {
+ assert_array_equals(actual, expected);
+ t.done();
+ }
+ }
+ func(t, t.step_func(log));
+ }, description);
+}
diff --git a/testing/web-platform/tests/html/webappapis/scripting/event-loops/task_microtask_ordering-manual.html b/testing/web-platform/tests/html/webappapis/scripting/event-loops/task_microtask_ordering-manual.html
new file mode 100644
index 000000000..ed2f70e19
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/event-loops/task_microtask_ordering-manual.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<title>Task and Microtask Ordering </title>
+<link rel=author title="Joshua Bell" href="mailto:jsbell@google.com">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#event-loops">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/common.js"></script>
+<style>
+.inner { padding: 46px; width: 0; margin: 0 auto; background: #d4d4d4; }
+.outer { padding: 25px; width: 92px; background: #f1f1f1; }
+</style>
+
+<p>Click on the inner box:</p>
+<div class="outer">
+ <div class="inner"></div>
+</div>
+
+<script>
+
+// Based on: https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/
+
+log_test(function(t, log) {
+ // Let's get hold of those elements
+ var outer = document.querySelector('.outer');
+ var inner = document.querySelector('.inner');
+
+ // Let's listen for attribute changes on the
+ // outer element
+ new MutationObserver(function() {
+ log('mutate');
+ }).observe(outer, {
+ attributes: true
+ });
+
+ // Here's a click listener...
+ function onClick() {
+ log('click');
+
+ setTimeout(function() {
+ log('timeout');
+ }, 0);
+
+ Promise.resolve().then(function() {
+ log('promise');
+ });
+
+ outer.setAttribute('data-random', Math.random());
+ }
+
+ // ...which we'll attach to both elements
+ inner.addEventListener('click', onClick);
+ outer.addEventListener('click', onClick);
+}, [
+ 'click',
+ 'promise',
+ 'mutate',
+ 'click',
+ 'promise',
+ 'mutate',
+ 'timeout',
+ 'timeout'
+], 'Level 1 bossfight (manual click)');
+
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/event-loops/task_microtask_ordering.html b/testing/web-platform/tests/html/webappapis/scripting/event-loops/task_microtask_ordering.html
new file mode 100644
index 000000000..c14a043b6
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/event-loops/task_microtask_ordering.html
@@ -0,0 +1,85 @@
+<!DOCTYPE html>
+<title>Task and Microtask Ordering </title>
+<link rel=author title="Joshua Bell" href="mailto:jsbell@google.com">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#event-loops">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/common.js"></script>
+
+<div class="outer">
+ <div class="inner"></div>
+</div>
+
+<script>
+
+// Based on: https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/
+
+log_test(function(t, log) {
+ log('script start');
+
+ setTimeout(function() {
+ log('setTimeout');
+ }, 0);
+
+ Promise.resolve().then(function() {
+ log('promise1');
+ }).then(function() {
+ log('promise2');
+ });
+
+ log('script end');
+}, [
+ 'script start',
+ 'script end',
+ 'promise1',
+ 'promise2',
+ 'setTimeout'
+], 'Basic task and microtask ordering');
+
+log_test(function(t, log) {
+ // Let's get hold of those elements
+ var outer = document.querySelector('.outer');
+ var inner = document.querySelector('.inner');
+
+ // Let's listen for attribute changes on the
+ // outer element
+ new MutationObserver(function() {
+ log('mutate');
+ }).observe(outer, {
+ attributes: true
+ });
+
+ // Here's a click listener...
+ function onClick() {
+ log('click');
+
+ setTimeout(function() {
+ log('timeout');
+ }, 0);
+
+ Promise.resolve().then(function() {
+ log('promise');
+ });
+
+ outer.setAttribute('data-random', Math.random());
+ }
+
+ // ...which we'll attach to both elements
+ inner.addEventListener('click', onClick);
+ outer.addEventListener('click', onClick);
+
+ // Note that this will behave differently than a real click,
+ // since the dispatch is synchronous and microtasks will not
+ // run between event bubbling steps.
+ inner.click();
+}, [
+ 'click',
+ 'click',
+ 'promise',
+ 'mutate',
+ 'promise',
+ 'timeout',
+ 'timeout'
+], 'Level 1 bossfight (synthetic click)');
+
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/.gitkeep b/testing/web-platform/tests/html/webappapis/scripting/events/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/body-onload.html b/testing/web-platform/tests/html/webappapis/scripting/events/body-onload.html
new file mode 100644
index 000000000..1e43d1ccd
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/body-onload.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<title>HTMLBodyElement.onload</title>
+<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu">
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#handler-window-onload">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test("body.onload should set the window.onload handler")
+window.onload = t.step_func(function() {
+ assert_unreached("This handler should be overwritten.")
+})
+var b = document.createElement("body")
+b.onload = t.step_func(function(e) {
+ assert_equals(e.currentTarget, window,
+ "The event should be fired at the window.")
+ t.done()
+})
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/contains.json b/testing/web-platform/tests/html/webappapis/scripting/events/contains.json
new file mode 100644
index 000000000..65f3062d2
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/contains.json
@@ -0,0 +1,18 @@
+[
+ {
+ "id": "event-handler-attributes",
+ "original_id": "event-handler-attributes"
+ },
+ {
+ "id": "event-handlers-on-elements-document-objects-and-window-objects",
+ "original_id": "event-handlers-on-elements,-document-objects,-and-window-objects"
+ },
+ {
+ "id": "event-firing",
+ "original_id": "event-firing"
+ },
+ {
+ "id": "events-and-the-window-object",
+ "original_id": "events-and-the-window-object"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-attributes-body-window.html b/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-attributes-body-window.html
new file mode 100644
index 000000000..1c87892cb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-attributes-body-window.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>HTMLBodyElement event handlers</title>
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<body>
+<script>
+function f() {
+ return 0;
+}
+
+var handlers = ['blur','error','focus','load','resize','scroll',
+ 'afterprint','beforeprint','beforeunload','hashchange',
+ 'languagechange','message','offline','online','pagehide',
+ 'pageshow','popstate','storage','unload'];
+handlers.forEach(function(handler) {
+ test(function() {
+ document.body['on' + handler] = f;
+ assert_equals(window['on' + handler], f);
+ }, handler);
+});
+
+handlers.forEach(function(handler) {
+ document.body['on' + handler] = null;
+});
+
+handlers.forEach(function(handler) {
+ test(function() {
+ assert_equals(document.body['on' + handler], null);
+ assert_equals(window['on' + handler], null);
+ }, handler + " removal");
+});
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-javascript.html b/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-javascript.html
new file mode 100644
index 000000000..657a37839
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-javascript.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<title>Event handler with labels</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body onload="javascript:
+ for (var i = 0; i < 2; ++i) {
+ for (var j = 0; j < 2; ++j) {
+ t.step(function() {
+ assert_equals(i, 0);
+ assert_equals(j, 0);
+ });
+ break javascript;
+ }
+ }
+ t.done();
+">
+<div id="log"></div>
+<script>
+var t = async_test("Event handlers starting with 'javascript:' should treat that as a label.");
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-onresize.html b/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-onresize.html
new file mode 100644
index 000000000..8686716e1
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-onresize.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>HTMLBodyElement.onresize</title>
+<link rel="author" title="His-Name-Is-Joof" href="mailto:jeffrharrison@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#handler-window-onresize">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test("body.onresize should set the window.onload handler")
+window.onresize = t.step_func(function() {
+ assert_unreached("This handler should be overwritten.")
+})
+
+var body = document.createElement("body")
+body.onresize = t.step_func(function(e) {
+ assert_equals(e.currentTarget, window,
+ "The event should be fired at the window.")
+ t.done()
+})
+window.dispatchEvent(new Event('resize'));
+
+t = async_test("document.onresize should set the document.onresize handler");
+document.onresize = t.step_func(function(e) {
+ assert_equals(e.currentTarget, document,
+ "The event should be fired at the document")
+ t.done()
+})
+document.dispatchEvent(new Event('resize'));
+
+t = async_test("meta.onresize should set the meta.onresize handler");
+var meta = document.createElement("meta")
+meta.onresize = t.step_func(function(e) {
+ assert_equals(e.currentTarget, meta,
+ "The event should be fired at the <meta> object")
+ t.done()
+})
+meta.dispatchEvent(new Event('resize'));
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-processing-algorithm.html b/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-processing-algorithm.html
new file mode 100644
index 000000000..f3848b5ad
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-processing-algorithm.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<title>Event handlers processing algorithm</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+ <body>
+ <div id="foo" style="width: 100px; height: 100px; background-color: black"></div>
+ <script>
+ async_test(function(t) {
+ var ev = new Event('mouseover', {cancelable: true});
+ document.getElementById("foo").onmouseover = t.step_func(function() { return true });
+ document.getElementById("foo").dispatchEvent(ev);
+ assert_equals(ev.defaultPrevented, true)
+ t.done();
+ }, "mouseover listener returning true cancels event");
+
+ async_test(function(t) {
+ var ev = new Event('mouseover', {cancelable: true});
+ document.getElementById("foo").onmouseover = t.step_func(function() { return false; });
+ document.getElementById("foo").dispatchEvent(ev);
+ assert_equals(ev.defaultPrevented, false);
+ t.done();
+ }, "mouseover listener returning false doesn't cancel event");
+
+ async_test(function(t) {
+ var ev = new Event('beforeunload', {cancelable: true});
+ window.onbeforeunload = t.step_func(function() {return null});
+ window.dispatchEvent(ev);
+ assert_equals(ev.defaultPrevented, true);
+ t.done();
+ }, "beforeunload listener returning null cancels event");
+
+ async_test(function(t) {
+ var ev = new Event('beforeunload', {cancelable: true});
+ window.onbeforeunload = t.step_func(function() {return true});
+ window.dispatchEvent(ev);
+ assert_equals(ev.defaultPrevented, false);
+ t.done();
+ }, "beforeunload listener returning non-null doesn't cancel event");
+
+ async_test(function(t) {
+ var ev = new Event("click", {cancelable: true});
+ document.getElementById("foo").onclick = t.step_func(function() { return false; });
+ document.getElementById("foo").dispatchEvent(ev);
+ assert_equals(ev.defaultPrevented, true);
+ t.done();
+ }, "click listener returning false cancels event");
+
+ async_test(function(t) {
+ var ev = new Event("blur", {cancelable: true});
+ document.getElementById("foo").onblur = t.step_func(function() { return false; });
+ document.getElementById("foo").dispatchEvent(ev);
+ assert_equals(ev.defaultPrevented, true);
+ t.done();
+ }, "blur listener returning false cancels event");
+
+ async_test(function(t) {
+ var ev = new Event("dblclick", {cancelable: true});
+ document.getElementById("foo").ondblclick = t.step_func(function() { return false; });
+ document.getElementById("foo").dispatchEvent(ev);
+ assert_equals(ev.defaultPrevented, true);
+ t.done();
+ }, "dblclick listener returning false cancels event");
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-spec-example.html b/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-spec-example.html
new file mode 100644
index 000000000..c06806e3c
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-spec-example.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<title>Event handler invocation order</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var objects = [{}, function() {}, new Number(42), new String()];
+var primitives = [42, null, undefined, ""];
+objects.forEach(function(object) {
+ var t = async_test("Event handler listeners should be registered when they " +
+ "are first set to an object value (" +
+ format_value(object) + ").");
+ t.step(function() {
+ var i = 0;
+ var uncalled = "t.step(function() { assert_unreached('First event handler.') })"
+ var button = document.createElement('button');
+ button.onclick = object; // event handler listener is registered here
+ button.addEventListener('click', t.step_func(function () { assert_equals(++i, 2) }), false);
+ button.setAttribute('onclick', uncalled);
+ button.addEventListener('click', t.step_func(function () { assert_equals(++i, 3) }), false);
+ button.onclick = t.step_func(function () { assert_equals(++i, 1); });
+ button.addEventListener('click', t.step_func(function () { assert_equals(++i, 4) }), false);
+ button.click()
+ assert_equals(button.getAttribute("onclick"), uncalled)
+ assert_equals(i, 4);
+ t.done()
+ });
+});
+primitives.forEach(function(primitive) {
+ var t = async_test("Event handler listeners should be registered when they " +
+ "are first set to an object value (" +
+ format_value(primitive) + ").");
+ t.step(function() {
+ var i = 0;
+ var uncalled = "t.step(function() { assert_unreached('First event handler.') })"
+ var button = document.createElement('button');
+ button.onclick = primitive;
+ button.addEventListener('click', t.step_func(function () { assert_equals(++i, 1) }), false);
+ button.setAttribute('onclick', uncalled); // event handler listener is registered here
+ button.addEventListener('click', t.step_func(function () { assert_equals(++i, 3) }), false);
+ button.onclick = t.step_func(function () { assert_equals(++i, 2); });
+ button.addEventListener('click', t.step_func(function () { assert_equals(++i, 4) }), false);
+ button.click()
+ assert_equals(button.getAttribute("onclick"), uncalled)
+ assert_equals(i, 4);
+ t.done()
+ });
+});
+var t = async_test("Event handler listeners should be registered when they " +
+ "are first set to an object value.");
+t.step(function() {
+ var i = 0;
+ var uncalled = "t.step(function() { assert_unreached('First event handler.') })"
+ var button = document.createElement('button');
+ button.addEventListener('click', t.step_func(function () { assert_equals(++i, 1) }), false);
+ button.setAttribute('onclick', uncalled); // event handler listener is registered here
+ button.addEventListener('click', t.step_func(function () { assert_equals(++i, 3) }), false);
+ button.onclick = t.step_func(function () { assert_equals(++i, 2); });
+ button.addEventListener('click', t.step_func(function () { assert_equals(++i, 4) }), false);
+ button.click()
+ assert_equals(button.getAttribute("onclick"), uncalled)
+ assert_equals(i, 4);
+ t.done()
+});
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/inline-event-handler-ordering.html b/testing/web-platform/tests/html/webappapis/scripting/events/inline-event-handler-ordering.html
new file mode 100644
index 000000000..90e29bfd1
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/inline-event-handler-ordering.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Inline event handlers retain their ordering even when invalid</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<script>
+var events = [];
+
+test(function() {
+ events = [];
+ var e = document.createElement("div");
+ document.body.appendChild(e);
+ e.addEventListener("click", function() { events.push("ONE") });
+ e.setAttribute("onclick", "window.open(");
+ e.addEventListener("click", function() { events.push("THREE") });
+ // Try to compile the event handler.
+ e.onclick;
+ e.setAttribute("onclick", "events.push('TWO')");
+ e.dispatchEvent(new Event("click"));
+ var expected_events = ["ONE", "TWO", "THREE"];
+ assert_array_equals(events, expected_events);
+}, "Inline event handlers retain their ordering when invalid and force-compiled");
+
+test(function() {
+ events = [];
+ var e = document.createElement("div");
+ document.body.appendChild(e);
+ e.addEventListener("click", function() { events.push("ONE") });
+ e.setAttribute("onclick", "window.open(");
+ e.addEventListener("click", function() { events.push("THREE") });
+ e.dispatchEvent(new Event("click"));
+ e.setAttribute("onclick", "events.push('TWO')");
+ e.dispatchEvent(new Event("click"));
+ var expected_events = ["ONE", "THREE", "ONE", "TWO", "THREE"];
+ assert_array_equals(events, expected_events);
+}, "Inline event handlers retain their ordering when invalid and force-compiled via dispatch");
+
+test(function() {
+ events = [];
+ var e = document.createElement("div");
+ document.body.appendChild(e);
+ e.addEventListener("click", function() { events.push("ONE") });
+ e.setAttribute("onclick", "window.open(");
+ e.addEventListener("click", function() { events.push("THREE") });
+ e.setAttribute("onclick", "events.push('TWO')");
+ e.dispatchEvent(new Event("click"));
+ var expected_events = ["ONE", "TWO", "THREE"];
+ assert_array_equals(events, expected_events);
+}, "Inline event handlers retain their ordering when invalid and lazy-compiled");
+</script>
+</body>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late.html b/testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late.html
new file mode 100644
index 000000000..a0e7bbcdd
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Invalid uncompiled raw handlers should only be compiled when about to call them.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<script>
+setup({ allow_uncaught_exception: true });
+
+test(function() {
+ var events = [];
+ window.onerror = function() {
+ events.push("Error");
+ };
+
+ var div = document.createElement("div");
+ div.addEventListener("click", function (e) { events.push("click 1") });
+ div.setAttribute("onclick", "}");
+ div.addEventListener("click", function (e) { events.push("click 2") });
+ div.dispatchEvent(new Event("click"));
+ assert_equals(div.onclick, null);
+ assert_array_equals(events, ["click 1", "error", "click 2"]);
+});
+</script>
+</body>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-once.html b/testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-once.html
new file mode 100644
index 000000000..a67f66ead
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-once.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Invalid uncompiled raw handlers should only be compiled once.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<script>
+setup({ allow_uncaught_exception: true });
+
+var errors = 0;
+window.onerror = function() {
+ errors++;
+};
+
+test(function() {
+ var e = document.body;
+ e.setAttribute("onclick", "window.open(");
+ assert_equals(e.onclick, null);
+ assert_equals(e.onclick, null);
+ assert_equals(errors, 1);
+});
+</script>
+</body>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/onerroreventhandler-frame.html b/testing/web-platform/tests/html/webappapis/scripting/events/onerroreventhandler-frame.html
new file mode 100644
index 000000000..79e4af302
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/onerroreventhandler-frame.html
@@ -0,0 +1,56 @@
+<body></body>
+<script>
+function check1(args, callee) {
+ parent.t.step(function() {
+ parent.assert_equals(callee.length, 5);
+ parent.assert_equals(args.length, 5);
+ parent.assert_equals(args[0], reference_error.message);
+ parent.assert_equals(args[1], reference_error.filename);
+ parent.assert_equals(args[2], reference_error.lineno);
+ parent.assert_equals(args[3], reference_error.colno);
+ parent.assert_equals(args[4], reference_error.error);
+ parent.t.done();
+ });
+}
+
+var reference_error = new ErrorEvent("error", {
+ filename: "error_file.js",
+ lineno: 333,
+ colno: 999,
+ message: "there was an error",
+ error: {nondefault: 'some unusual object'},
+});
+
+parent.t.step(function() {
+ document.body.outerHTML = "<body onerror='check1(arguments, arguments.callee)'></body>"
+ window.dispatchEvent(reference_error);
+});
+
+function check2(args, callee) {
+ parent.t2.step(function() {
+ parent.assert_equals(callee.length, 5);
+ parent.assert_equals(args.length, 1);
+ parent.assert_false(args[0] instanceof ErrorEvent);
+ parent.t2.done()
+ });
+}
+
+parent.t2.step(function() {
+ document.body.outerHTML = "<body onerror='check2(arguments, arguments.callee)'></body>"
+ window.dispatchEvent(new Event("error"));
+});
+
+function check3(args, callee) {
+ parent.t3.step(function() {
+ parent.assert_equals(args.length, 1);
+ parent.assert_equals(callee.length, 1);
+ });
+}
+
+parent.t3.step(function() {
+ document.body.outerHTML = "<body><span onerror='check3(arguments, arguments.callee)'></span></body>"
+ document.body.firstChild.dispatchEvent(reference_error);
+ document.body.firstChild.dispatchEvent(new Event("error"));
+ parent.t3.done();
+});
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/onerroreventhandler.html b/testing/web-platform/tests/html/webappapis/scripting/events/onerroreventhandler.html
new file mode 100644
index 000000000..60fc674d5
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/events/onerroreventhandler.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>OnErrorEventHandler + ErrorEvent is treated differently</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+var t = async_test("onerror + ErrorEvent + Window");
+var t2 = async_test("onerror + !ErrorEvent + Window");
+var t3 = async_test("onerror + Document");
+</script>
+<iframe src="onerroreventhandler-frame.html"></iframe>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/introduction-5/.gitkeep b/testing/web-platform/tests/html/webappapis/scripting/introduction-5/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/introduction-5/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/scripting/javascript-protocol/.gitkeep b/testing/web-platform/tests/html/webappapis/scripting/javascript-protocol/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/javascript-protocol/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/.gitkeep b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/addEventListener.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/addEventListener.html
new file mode 100644
index 000000000..dbb1cdd5a
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/addEventListener.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - addEventListener</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var ran = false;
+ window.addEventListener('error', t.step_func(function(e){
+ ran = true;
+ assert_true(e.isTrusted, 'isTrusted');
+ }), false);
+ </script>
+ <script>
+ undefined_variable;
+ </script>
+ <script>
+ for (;) {}
+ </script>
+ <script>
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error-data-url.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error-data-url.html
new file mode 100644
index 000000000..66e1dfed4
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error-data-url.html
@@ -0,0 +1,37 @@
+<!doctype html>
+<html>
+ <head>
+ <title>&lt;body onerror> - compile error in &lt;script src=data:...></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ </script>
+ <body onerror="
+ t.step(function(){
+ ran = true;
+ assert_equals(typeof event, 'string', 'first arg');
+ assert_equals(source, 'data:text/javascript,for(;){}', 'second arg');
+ assert_equals(typeof lineno, 'number', 'third arg');
+ });
+ t_col.step(function() {
+ assert_equals(typeof colno, 'number', 'fourth arg');
+ });
+ ">
+ <div id=log></div>
+ <script src="data:text/javascript,for(;){}"></script>
+ <script>
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ t_col.done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error.html
new file mode 100644
index 000000000..0f65f7399
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+ <head>
+ <title>&lt;body onerror> - compile error in &lt;script></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ </script>
+ <body onerror="
+ t.step(function(){
+ ran = true;
+ assert_equals(typeof event, 'string', 'first arg');
+ assert_equals(source, location.href, 'second arg');
+ assert_equals(typeof lineno, 'number', 'third arg');
+ });
+ t_col.step(function() {
+ assert_equals(typeof colno, 'number', 'fourth arg');
+ });
+ ">
+ <div id=log></div>
+ <script>
+ for(;) {}
+ </script>
+ <script>
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ t_col.done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-runtime-error.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-runtime-error.html
new file mode 100644
index 000000000..faaddd9ed
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/body-onerror-runtime-error.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+ <head>
+ <title>&lt;body onerror> - runtime error in &lt;script></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ </script>
+ <body onerror="
+ t.step(function(){
+ ran = true;
+ assert_equals(typeof event, 'string', 'first arg');
+ assert_equals(source, location.href, 'second arg');
+ assert_equals(typeof lineno, 'number', 'third arg');
+ });
+ t_col.step(function(){
+ assert_equals(typeof colno, 'number', 'fourth arg');
+ });
+ ">
+ <div id=log></div>
+ <script>
+ undefined_variable;
+ </script>
+ <script>
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ t_col.done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setInterval.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setInterval.html
new file mode 100644
index 000000000..14e9a8bc2
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setInterval.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - compile error in cross-origin setInterval</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ var interval;
+ window.onerror = t.step_func(function(a, b, c, d){
+ clearInterval(interval);
+ ran = true;
+ col_value = d;
+ assert_equals(a, 'Script error.', 'first arg');
+ assert_equals(b, '', 'second arg');
+ assert_equals(c, 0, 'third arg');
+ });
+ function col_check() {
+ assert_equals(col_value, 0, 'fourth arg');
+ t_col.done();
+ }
+ var script = document.createElement('script');
+ script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/syntax-error-in-setInterval.js');
+ document.body.appendChild(script);
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setTimeout.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setTimeout.html
new file mode 100644
index 000000000..ba3be9d0a
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setTimeout.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - compile error in cross-origin setTimeout</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(a, 'Script error.', 'first arg');
+ assert_equals(b, '', 'second arg');
+ assert_equals(c, 0, 'third arg');
+ });
+ function col_check() {
+ assert_equals(col_value, 0, 'fourth arg');
+ t_col.done();
+ }
+ var script = document.createElement('script');
+ script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/syntax-error-in-setTimeout.js');
+ document.body.appendChild(script);
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin.html
new file mode 100644
index 000000000..b7e989529
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - compile error in &lt;script src=//www1...></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(a, 'Script error.', 'first arg');
+ assert_equals(b, '', 'second arg');
+ assert_equals(c, 0, 'third arg');
+ });
+ var script = document.createElement('script');
+ script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/syntax-error.js');
+ document.body.appendChild(script);
+ onload = function(){
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(col_value, 0, 'fourth arg');
+ t_col.done();
+ });
+ };
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-data-url.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-data-url.html
new file mode 100644
index 000000000..08ce2f348
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-data-url.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - compile error in &lt;script src=data:...></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(typeof a, 'string', 'first arg');
+ assert_equals(b, 'data:text/javascript,for(;){}', 'second arg');
+ assert_equals(typeof c, 'number', 'third arg');
+ });
+ </script>
+ <script src="data:text/javascript,for(;){}"></script>
+ <script>
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(typeof col_value, 'number', 'fourth arg');
+ t_col.done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute.html
new file mode 100644
index 000000000..864d09fc1
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - compile error in attribute</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(typeof a, 'string', 'first arg');
+ assert_equals(b, location.href, 'second arg');
+ assert_equals(typeof c, 'number', 'third arg');
+ });
+ </script>
+ <p onclick="{"></p>
+ <script>
+ t.step(function(){
+ var ev = document.createEvent('Event');
+ ev.initEvent('click', false, false);
+ document.querySelector('p').dispatchEvent(ev);
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(typeof col_value, 'number', 'fourth arg');
+ t_col.done();
+ });
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror.html
new file mode 100644
index 000000000..0b094e71c
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - compile error in &lt;body onerror></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var ran = false;
+ window.onerror = t.step_func(function(){
+ ran = true;
+ });
+ </script>
+ </head>
+ <body onerror="{"><!-- sets the event handler to null before compiling -->
+ <div id=log></div>
+ <script>
+ for(;) {}
+ </script>
+ <script>
+ t.step(function(){
+ assert_false(ran, 'ran');
+ t.done();
+ });
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setInterval.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setInterval.html
new file mode 100644
index 000000000..39a01335c
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setInterval.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - compile error in setInterval</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ var interval;
+ window.onerror = t.step_func(function(a, b, c, d){
+ clearInterval(interval);
+ ran = true;
+ col_value = d;
+ assert_equals(typeof a, 'string', 'first arg');
+ assert_equals(b, location.href, 'second arg');
+ assert_equals(typeof c, 'number', 'third arg');
+ });
+ interval = setInterval("{", 10);
+ setTimeout(function(){
+ t.step(function(){
+ clearInterval(interval);
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(typeof col_value, 'number', 'fourth arg');
+ t_col.done();
+ });
+ }, 20);
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setTimeout.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setTimeout.html
new file mode 100644
index 000000000..879660313
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-in-setTimeout.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - compile error in setTimeout</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(typeof a, 'string', 'first arg');
+ assert_equals(b, location.href, 'second arg');
+ assert_equals(typeof c, 'number', 'third arg');
+ });
+ setTimeout("{", 10);
+ setTimeout(function(){
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(typeof col_value, 'number', 'fourth arg');
+ t_col.done();
+ });
+ }, 20);
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin.html
new file mode 100644
index 000000000..71c28b584
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - compile error in &lt;script src=...></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(typeof a, 'string', 'first arg');
+ assert_equals(b, document.querySelector('script[src="support/syntax-error.js"]').src, 'second arg');
+ assert_equals(typeof c, 'number', 'third arg');
+ });
+ </script>
+ <script src="support/syntax-error.js"></script>
+ <script>
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(typeof col_value, 'number', 'fourth arg');
+ t_col.done();
+ });
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error.html
new file mode 100644
index 000000000..a4bdfd9c4
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/compile-error.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - compile error in &lt;script></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(typeof a, 'string', 'first arg');
+ assert_equals(b, location.href, 'second arg');
+ assert_equals(typeof c, 'number', 'third arg');
+ });
+ </script>
+ <script>
+ for(;) {}
+ </script>
+ <script>
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(typeof col_value, 'number', 'fourth arg');
+ t_col.done();
+ });
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/contains.json b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/contains.json
new file mode 100644
index 000000000..b49029277
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/contains.json
@@ -0,0 +1,28 @@
+[
+ {
+ "id": "definitions-0",
+ "original_id": "definitions-0"
+ },
+ {
+ "id": "calling-scripts",
+ "original_id": "calling-scripts"
+ },
+ {
+ "id": "creating-scripts",
+ "original_id": "creating-scripts"
+ },
+ {
+ "id": "killing-scripts",
+ "original_id": "killing-scripts"
+ },
+ {
+ "id": "runtime-script-errors",
+ "original_id": "runtime-script-errors",
+ "children": [
+ {
+ "id": "runtime-script-errors-in-documents",
+ "original_id": "runtime-script-errors-in-documents"
+ }
+ ]
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setInterval.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setInterval.html
new file mode 100644
index 000000000..dd97566d7
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setInterval.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - runtime error in cross-origin setInterval</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ var interval;
+ window.onerror = t.step_func(function(a, b, c, d){
+ clearInterval(interval);
+ ran = true;
+ col_value = d;
+ assert_equals(a, 'Script error.', 'first arg');
+ assert_equals(b, '', 'second arg');
+ assert_equals(c, 0, 'third arg');
+ });
+ function col_check() {
+ assert_equals(col_value, 0, 'fourth arg');
+ t_col.done();
+ }
+ var script = document.createElement('script');
+ script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/undefined-variable-in-setInterval.js');
+ document.body.appendChild(script);
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setTimeout.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setTimeout.html
new file mode 100644
index 000000000..20ee21c61
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setTimeout.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - runtime error in cross-origin setTimeout</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(a, 'Script error.', 'first arg');
+ assert_equals(b, '', 'second arg');
+ assert_equals(c, 0, 'third arg');
+ });
+ function col_check() {
+ assert_equals(col_value, 0, 'fourth arg');
+ t_col.done();
+ }
+ var script = document.createElement('script');
+ script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/undefined-variable-in-setTimeout.js');
+ document.body.appendChild(script);
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin.html
new file mode 100644
index 000000000..d63aaa6d3
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - runtime error in &lt;script src=//www1...></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(a, 'Script error.', 'first arg');
+ assert_equals(b, '', 'second arg');
+ assert_equals(c, 0, 'third arg');
+ });
+ var script = document.createElement('script');
+ script.src = location.href.replace('://', '://www1.').replace(/\/[^\/]+$/, '/support/undefined-variable.js');
+ document.body.appendChild(script);
+ onload = function(){
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(col_value, 0, 'fourth arg');
+ t_col.done();
+ });
+ };
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-data-url.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-data-url.html
new file mode 100644
index 000000000..485ce90aa
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-data-url.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - runtime error in &lt;script src=data:...></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(typeof a, 'string', 'first arg');
+ assert_equals(b, 'data:text/javascript,undefined_variable;', 'second arg');
+ assert_equals(typeof c, 'number', 'third arg');
+ });
+ </script>
+ <script src="data:text/javascript,undefined_variable;"></script>
+ <script>
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(typeof col_value, 'number', 'fourth arg');
+ t_col.done();
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-attribute.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-attribute.html
new file mode 100644
index 000000000..b4f69da7a
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-attribute.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - runtime error in attribute</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(typeof a, 'string', 'first arg');
+ assert_equals(b, location.href, 'second arg');
+ assert_equals(typeof c, 'number', 'third arg');
+ });
+ </script>
+ <p onclick="undefined_variable;"></p>
+ <script>
+ t.step(function(){
+ var ev = document.createEvent('Event');
+ ev.initEvent('click', false, false);
+ document.querySelector('p').dispatchEvent(ev);
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(typeof col_value, 'number', 'fourth arg');
+ t_col.done();
+ });
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-body-onerror.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-body-onerror.html
new file mode 100644
index 000000000..e0fd1dcbd
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-body-onerror.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <title>runtime error in &lt;body onerror></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var ran = 0;
+ </script>
+ </head>
+ <body onerror="ran++; undefined_variable_in_onerror;">
+ <div id=log></div>
+ <script>
+ undefined_variable;
+ </script>
+ <script>
+ t.step(function(){
+ assert_equals(ran, 1, 'ran');
+ t.done();
+ });
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setInterval.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setInterval.html
new file mode 100644
index 000000000..fcfb6c597
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setInterval.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - runtime error in setInterval</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ var interval;
+ window.onerror = t.step_func(function(a, b, c, d){
+ clearInterval(interval);
+ ran = true;
+ col_value = d;
+ assert_equals(typeof a, 'string', 'first arg');
+ assert_equals(b, location.href, 'second arg');
+ assert_equals(typeof c, 'number', 'third arg');
+ });
+ interval = setInterval("undefined_variable;", 10);
+ setTimeout(function(){
+ clearInterval(interval);
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(typeof col_value, 'number', 'fourth arg');
+ t_col.done();
+ });
+ }, 20);
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setTimeout.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setTimeout.html
new file mode 100644
index 000000000..c0c69ad7c
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setTimeout.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - runtime error in setTimeout</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(typeof a, 'string', 'first arg');
+ assert_equals(b, location.href, 'second arg');
+ assert_equals(typeof c, 'number', 'third arg');
+ });
+ setTimeout("undefined_variable;", 10);
+ setTimeout(function(){
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(typeof col_value, 'number', 'fourth arg');
+ t_col.done();
+ });
+ }, 20);
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-window-onerror.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-window-onerror.html
new file mode 100644
index 000000000..150a793b7
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-in-window-onerror.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<html>
+ <head>
+ <title>runtime error in window.onerror</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var ran = 0;
+ window.onerror = function(){
+ ran++;
+ undefined_variable_in_onerror;
+ };
+ </script>
+ <script>
+ undefined_variable;
+ </script>
+ <script>
+ t.step(function(){
+ assert_equals(ran, 1, 'ran');
+ t.done();
+ });
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin.html
new file mode 100644
index 000000000..8f3cfb70b
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - runtime error in &lt;script src=...></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(typeof a, 'string', 'first arg');
+ assert_equals(b, document.querySelector('script[src="support/undefined-variable.js"]').src, 'second arg');
+ assert_equals(typeof c, 'number', 'third arg');
+ });
+ </script>
+ <script src="support/undefined-variable.js"></script>
+ <script>
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(typeof col_value, 'number', 'fourth arg');
+ t_col.done();
+ });
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error.html
new file mode 100644
index 000000000..7907494aa
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/runtime-error.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror - runtime error in &lt;script></title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id=log></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var t = async_test();
+ var t_col = async_test(document.title+' (column)');
+ var ran = false;
+ var col_value;
+ window.onerror = t.step_func(function(a, b, c, d){
+ ran = true;
+ col_value = d;
+ assert_equals(typeof a, 'string', 'first arg');
+ assert_equals(b, location.href, 'second arg');
+ assert_equals(typeof c, 'number', 'third arg');
+ });
+ </script>
+ <script>
+ undefined_variable;
+ </script>
+ <script>
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(function(){
+ assert_equals(typeof col_value, 'number', 'fourth arg');
+ t_col.done();
+ });
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setInterval.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setInterval.js
new file mode 100644
index 000000000..812c0daea
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setInterval.js
@@ -0,0 +1,9 @@
+interval = setInterval('{', 10);
+setTimeout(function(){
+ clearInterval(interval);
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(col_check);
+}, 20); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setTimeout.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setTimeout.js
new file mode 100644
index 000000000..84eb4fc41
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setTimeout.js
@@ -0,0 +1,8 @@
+setTimeout('{', 10);
+setTimeout(function(){
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(col_check);
+}, 20);
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error.js
new file mode 100644
index 000000000..0f74a6fca
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/syntax-error.js
@@ -0,0 +1 @@
+for (;) {} \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setInterval.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setInterval.js
new file mode 100644
index 000000000..2950fdb51
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setInterval.js
@@ -0,0 +1,9 @@
+interval = setInterval('undefined_variable;', 10);
+setTimeout(function(){
+ clearInterval(interval);
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(col_check);
+}, 20); \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setTimeout.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setTimeout.js
new file mode 100644
index 000000000..6350ab62e
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setTimeout.js
@@ -0,0 +1,8 @@
+setTimeout('undefined_variable;', 10);
+setTimeout(function(){
+ t.step(function(){
+ assert_true(ran, 'ran');
+ t.done();
+ });
+ t_col.step(col_check);
+}, 20);
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable.js
new file mode 100644
index 000000000..e73a62ced
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/support/undefined-variable.js
@@ -0,0 +1 @@
+undefined_variable; \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-parse-error.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-parse-error.html
new file mode 100644
index 000000000..3c21df49c
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-parse-error.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror: parse errors</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <!--
+
+ In https://html.spec.whatwg.org/multipage/#creating-scripts ,
+ step 3 describes parsing the script, and step 5 says:
+ # Otherwise, report the error using the onerror event handler of
+ # the script's global object. If the error is still not handled
+ # after this, then the error may be reported to the user.
+ which links to
+ https://html.spec.whatwg.org/multipage/#report-the-error ,
+ which describes what to do when onerror is a Function.
+
+ -->
+ </head>
+ <body>
+
+ <div id="log"></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var error_count = 0;
+ window.onerror = function(msg, url, lineno) {
+ ++error_count;
+ test(function() {assert_equals(url, window.location.href)},
+ "correct url passed to window.onerror");
+ test(function() {assert_equals(lineno, 34)},
+ "correct line number passed to window.onerror");
+ };
+ </script>
+ <script>This script does not parse correctly.</script>
+ <script>
+ test(function() {assert_equals(error_count, 1)},
+ "correct number of calls to window.onerror");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error-throw.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error-throw.html
new file mode 100644
index 000000000..5d2ef0d29
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error-throw.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror: runtime scripterrors</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <!--
+
+ https://html.spec.whatwg.org/multipage/#runtime-script-errors
+ says what to do for uncaught runtime script errors, and just below
+ describes what to do when onerror is a Function.
+
+ -->
+ </head>
+ <body>
+
+ <div id="log"></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var error_count = 0;
+ window.onerror = function(msg, url, lineno) {
+ ++error_count;
+ };
+ </script>
+ <script>
+ try {
+ // This error is caught, so it should NOT trigger onerror.
+ throw "foo";
+ } catch (ex) {
+ }
+ // This error is NOT caught, so it should trigger onerror.
+ throw "bar";
+ </script>
+ <script>
+ test(function() {assert_equals(error_count, 1)},
+ "correct number of calls to window.onerror");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error.html
new file mode 100644
index 000000000..1fdab521a
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error.html
@@ -0,0 +1,43 @@
+<!doctype html>
+<html>
+ <head>
+ <title>window.onerror: runtime scripterrors</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <!--
+
+ https://html.spec.whatwg.org/multipage/#runtime-script-errors
+ says what to do for uncaught runtime script errors, and just below
+ describes what to do when onerror is a Function.
+
+ -->
+ </head>
+ <body>
+
+ <div id="log"></div>
+ <script>
+ setup({allow_uncaught_exception:true});
+ var error_count = 0;
+ window.onerror = function(msg, url, lineno) {
+ ++error_count;
+ test(function() {assert_equals(url, window.location.href)},
+ "correct url passed to window.onerror");
+ test(function() {assert_equals(lineno, 36)},
+ "correct line number passed to window.onerror");
+ };
+ </script>
+ <script>
+ try {
+ // This error is caught, so it should NOT trigger onerror.
+ window.nonexistentproperty.oops();
+ } catch (ex) {
+ }
+ // This error is NOT caught, so it should trigger onerror.
+ window.nonexistentproperty.oops();
+ </script>
+ <script>
+ test(function() {assert_equals(error_count, 1)},
+ "correct number of calls to window.onerror");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1.html
new file mode 100644
index 000000000..65a1a02b1
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>
+ When a listener from window A is added to an event target in window B via the
+ addEventListener function from window B, errors in that listener should be
+ reported to window A.
+</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<iframe></iframe>
+<iframe></iframe>
+<script>
+test(function() {
+ var f = new frames[0].Function("thereIsNoSuchCallable()");
+ frames[1].document.addEventListener("myevent", f);
+ var frame0ErrorFired = false;
+ var frame1ErrorFired = false;
+ var ourErrorFired = false;
+ frames[0].addEventListener("error", function() {
+ frame0ErrorFired = true;
+ });
+ frames[1].addEventListener("error", function() {
+ frame1ErrorFired = true;
+ });
+ addEventListener("error", function() {
+ ourErrorFired = true;
+ });
+ frames[1].document.dispatchEvent(new Event("myevent"));
+ assert_true(frame0ErrorFired);
+ assert_false(frame1ErrorFired);
+ assert_false(ourErrorFired);
+}, "The error event from an event listener should fire on that listener's global");
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2.html
new file mode 100644
index 000000000..6c5476542
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>
+ When a listener from window A is added to an event target in window B via the
+ addEventListener function from window A, errors in that listener should be
+ reported to window A.
+</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<iframe></iframe>
+<iframe></iframe>
+<script>
+test(function() {
+ var f = new frames[0].Function("thereIsNoSuchCallable()");
+ frames[0].document.addEventListener.call(frames[1].document, "myevent", f);
+ var frame0ErrorFired = false;
+ var frame1ErrorFired = false;
+ var ourErrorFired = false;
+ frames[0].addEventListener("error", function() {
+ frame0ErrorFired = true;
+ });
+ frames[1].addEventListener("error", function() {
+ frame1ErrorFired = true;
+ });
+ addEventListener("error", function() {
+ ourErrorFired = true;
+ });
+ frames[1].document.dispatchEvent(new Event("myevent"));
+ assert_true(frame0ErrorFired);
+ assert_false(frame1ErrorFired);
+ assert_false(ourErrorFired);
+}, "The error event from an event listener should fire on that listener's global");
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-3.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-3.html
new file mode 100644
index 000000000..5e78baa8d
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-3.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>
+ When a listener from window A is added to an event target in window A via the
+ addEventListener function from window A, errors in that listener should be
+ reported to window A.
+</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<iframe></iframe>
+<iframe></iframe>
+<script>
+test(function() {
+ var f = new frames[1].Function("thereIsNoSuchCallable()");
+ frames[1].document.addEventListener("myevent", f);
+ var frame0ErrorFired = false;
+ var frame1ErrorFired = false;
+ var ourErrorFired = false;
+ frames[0].addEventListener("error", function() {
+ frame0ErrorFired = true;
+ });
+ frames[1].addEventListener("error", function() {
+ frame1ErrorFired = true;
+ });
+ addEventListener("error", function() {
+ ourErrorFired = true;
+ });
+ frames[1].document.dispatchEvent(new Event("myevent"));
+ assert_false(frame0ErrorFired);
+ assert_true(frame1ErrorFired);
+ assert_false(ourErrorFired);
+}, "The error event from an event listener should fire on that listener's global");
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-4.html b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-4.html
new file mode 100644
index 000000000..a5f35d613
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-4.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>
+ When a listener from window A is added to an event target in window A via the
+ addEventListener function from window B, errors in that listener should be
+ reported to window A.
+</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<iframe></iframe>
+<iframe></iframe>
+<script>
+test(function() {
+ var f = new frames[1].Function("thereIsNoSuchCallable()");
+ frames[0].document.addEventListener.call(frames[1].document, "myevent", f);
+ var frame0ErrorFired = false;
+ var frame1ErrorFired = false;
+ var ourErrorFired = false;
+ frames[0].addEventListener("error", function() {
+ frame0ErrorFired = true;
+ });
+ frames[1].addEventListener("error", function() {
+ frame1ErrorFired = true;
+ });
+ addEventListener("error", function() {
+ ourErrorFired = true;
+ });
+ frames[1].document.dispatchEvent(new Event("myevent"));
+ assert_false(frame0ErrorFired);
+ assert_true(frame1ErrorFired);
+ assert_false(ourErrorFired);
+}, "The error event from an event listener should fire on that listener's global");
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/.gitkeep b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-external-interface/.gitkeep b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-external-interface/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-external-interface/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/.gitkeep b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.html b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.html
new file mode 100644
index 000000000..1956a202c
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>NavigatorID</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src=NavigatorID.js></script>
+<div id="log"></div>
+<script>
+run_test();
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.js b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.js
new file mode 100644
index 000000000..cf16c68d4
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.js
@@ -0,0 +1,63 @@
+function run_test() {
+ test(function() {
+ assert_equals(navigator.appCodeName, "Mozilla");
+ }, "appCodeName");
+
+ test(function() {
+ assert_equals(typeof navigator.appName, "string",
+ "navigator.appName should be a string");
+ }, "appName");
+
+ test(function() {
+ assert_equals(typeof navigator.appVersion, "string",
+ "navigator.appVersion should be a string");
+ }, "appVersion");
+
+ test(function() {
+ assert_equals(typeof navigator.platform, "string",
+ "navigator.platform should be a string");
+ }, "platform");
+
+ test(function() {
+ assert_equals(navigator.product, "Gecko");
+ }, "product");
+
+ test(function() {
+ // See https://www.w3.org/Bugs/Public/show_bug.cgi?id=22555
+ if ("window" in self) {
+ // If you identify as WebKit, taintEnabled should not exist.
+ if (navigator.userAgent.indexOf("WebKit") != -1) {
+ assert_false("taintEnabled" in navigator);
+ }
+ // Otherwise it should exist and return false.
+ else {
+ assert_false(navigator.taintEnabled());
+ }
+ } else {
+ // taintEnabled should not exist in workers.
+ assert_false("taintEnabled" in navigator);
+ }
+ }, "taintEnabled");
+
+ test(function() {
+ assert_equals(typeof navigator.userAgent, "string",
+ "navigator.userAgent should be a string");
+ }, "userAgent type");
+
+ test(function() {
+ assert_equals(navigator.vendorSub, "");
+ }, "vendorSub");
+
+ async_test(function() {
+ var request = new XMLHttpRequest();
+ request.onload = this.step_func_done(function() {
+ assert_equals("user-agent: " + navigator.userAgent + "\n",
+ request.response,
+ "userAgent should return the value sent in the " +
+ "User-Agent header");
+ });
+ request.open("GET", "/XMLHttpRequest/resources/inspect-headers.py?" +
+ "filter_name=User-Agent");
+ request.send();
+ }, "userAgent value");
+}
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker.js b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker.js
new file mode 100644
index 000000000..9ba7defa1
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker.js
@@ -0,0 +1,4 @@
+importScripts("/resources/testharness.js")
+importScripts("NavigatorID.js")
+run_test();
+done();
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/contains.json b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/contains.json
new file mode 100644
index 000000000..441c24cec
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/contains.json
@@ -0,0 +1,22 @@
+[
+ {
+ "id": "client-identification",
+ "original_id": "client-identification"
+ },
+ {
+ "id": "custom-handlers",
+ "original_id": "custom-handlers"
+ },
+ {
+ "id": "security-and-privacy",
+ "original_id": "security-and-privacy"
+ },
+ {
+ "id": "sample-handler-impl",
+ "original_id": "sample-handler-impl"
+ },
+ {
+ "id": "manually-releasing-the-storage-mutex",
+ "original_id": "manually-releasing-the-storage-mutex"
+ }
+] \ No newline at end of file
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content.html b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content.html
new file mode 100644
index 000000000..b6b41c21f
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content.html
@@ -0,0 +1,136 @@
+<!DOCTYPE html>
+<meta charset='utf-8'>
+<title>registerContentHandler()</title>
+
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+
+<noscript><p>Enable JavaScript and reload.</p></noscript>
+
+<p><strong>Note:</strong> If your browser limits the number of handler
+registration requests on a page, you might need to disable or significantly
+increase that limit for the tests below to run.</p>
+
+
+<div id='log'></div>
+
+<script>
+test(function () {
+ assert_idl_attribute(navigator, 'registerContentHandler');
+}, 'the registerContentHandler method should exist on the navigator object');
+
+/* Happy path */
+test(function () {
+ navigator.registerContentHandler('text/x-unknown-type', location.href + '/%s', 'foo');
+}, 'a handler with valid arguments should work');
+
+
+/* URL argument */
+test(function () {
+ navigator.registerContentHandler('text/x-unknown-type', '%s', 'foo');
+}, 'a relative URL should work');
+
+test(function () {
+ navigator.registerContentHandler('text/x-unknown-type', location.href + '#%s', 'foo');
+}, 'a URL with a fragment identifier should work');
+
+test(function () {
+ navigator.registerContentHandler('text/x-unknown-type', location.href + '?foo=%s', 'foo');
+}, 'a URL with a query string should work');
+
+test(function () {
+ navigator.registerContentHandler('text/x-unknown-type', location.href + '?foo=%s&bar', 'foo');
+}, 'a URL with a multi-argument query string should work');
+
+test(function () {
+ navigator.registerContentHandler('text/x-unknown-type', location.href + '/%s/bar/baz/', 'foo');
+}, 'a URL with the passed string as a directory name should work');
+
+test(function () {
+ navigator.registerContentHandler('text/x-unknown-type', location.href + '/%s/bar/baz/?foo=1337&bar#baz', 'foo');
+}, 'a URL with the passed string as a directory name followed by a query string and fragment identifier should work');
+
+test(function () {
+ navigator.registerContentHandler('text/x-unknown-type', location.href + '/%s/foo/%s/', 'foo');
+}, 'a URL with the passed string included twice should work');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerContentHandler('text/x-unknown-type', '', 'foo') } );
+}, 'an empty url argument should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerContentHandler('text/x-unknown-type', 'http://%s.com', 'foo') } );
+}, '%s instead of domain name should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerContentHandler('text/x-unknown-type', 'http://%s.example.com', 'foo') } );
+}, '%s instead of subdomain name should throw syntax_err');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerContentHandler('text/x-unknown-type', location.href + '', 'foo') } );
+}, 'a url argument without %s should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerContentHandler('text/x-unknown-type', 'http://example.com', 'foo') } );
+}, 'a url argument pointing to a different domain name, without %s should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerContentHandler('text/x-unknown-type', location.href + '/%', 'foo') } );
+}, 'a url argument without %s (but with %) should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerContentHandler('text/x-unknown-type', location.href + '/%a', 'foo') } );
+}, 'a url argument without %s (but with %a) should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SECURITY_ERR', function () { navigator.registerContentHandler('text/x-unknown-type', 'http://example.com/%s', 'foo') } );
+}, 'a url argument pointing to a different domain name should throw SECURITY_ERR');
+
+test(function () {
+ assert_throws('SECURITY_ERR', function () { navigator.registerContentHandler('text/x-unknown-type', 'https://example.com/%s', 'foo') } );
+}, 'a url argument pointing to a different domain name should throw SECURITY_ERR (2)');
+
+test(function () {
+ assert_throws('SECURITY_ERR', function () { navigator.registerContentHandler('text/x-unknown-type', 'http://foobar.example.com/%s', 'foo') } );
+}, 'a url argument pointing to a different domain name should throw SECURITY_ERR (3)');
+
+/* Content type argument */
+
+/* The following MIME types are handled natively by the browser, and must not
+ * be possible to override. Note that this list only covers a few basic content
+ * types. Full lists of content types handled by each browser is found under
+ * /vendor/. */
+
+var blacklist = new Array(
+ 'image/jpeg',
+ 'text/html',
+ 'text/javascript',
+ 'text/plain');
+
+for (var bi=0, bl=blacklist.length; bi<bl; ++bi){
+
+ test(function () {
+ assert_throws('SECURITY_ERR', function () { navigator.registerContentHandler(blacklist[bi], location.href + '/%s', 'foo') } );
+ }, 'attempting to override the ' + blacklist[bi] + ' MIME type should throw SECURITY_ERR');
+
+}
+
+/* Overriding the following MIME types should be possible. */
+var whitelist = new Array('application/atom+xml', /* For feeds. */
+ 'application/rss+xml', /* For feeds. */
+ 'application/x-unrecognized', /* Arbitrary MIME types should be overridable. */
+ 'text/unrecognized',
+ 'foo/bar');
+
+for (var wi=0, wl=whitelist.length; wi<wl; ++wi){
+
+ test(function () {
+ navigator.registerContentHandler(whitelist[wi], location.href + '/%s', 'foo');
+ }, 'overriding the ' + whitelist[wi] + ' MIME type should work');
+
+}
+
+</script>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/001.xhtml b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/001.xhtml
new file mode 100644
index 000000000..a0d2fa15b
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/001.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>isContentHandlerRegistered for new content type</title>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script type="application/ecmascript">
+test(function() {
+ assert_equals(navigator.isContentHandlerRegistered('application/x-notRegisteredInOtherTCs-001', location.href.replace(/\/[^\/]*$/, "") + '/%s'), 'new');
+});
+</script>
+</head>
+<body>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/002.xhtml b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/002.xhtml
new file mode 100644
index 000000000..d5c2ff3e0
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/002.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>isContentHandlerRegistered for content type that is not yet accepted</title>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script type="application/ecmascript">
+test(function() {
+ var ctype = 'application/x-notRegisteredInOtherTCs-002';
+ var url = location.href.replace(/\/[^\/]*$/, "") + "/%s";
+ navigator.registerContentHandler(ctype, url, 'test');
+ assert_equals(navigator.isContentHandlerRegistered(ctype, url), 'declined');
+});
+</script>
+</head>
+<body>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/003.xhtml b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/003.xhtml
new file mode 100644
index 000000000..92e7ca8f5
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/003.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Content type case insensitivity in isContentHandlerRegistered</title>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script type="application/ecmascript">
+test(function() {
+ var ctype = 'application/x-notRegisteredInOtherTCs-003', url = location.href.replace(/\/[^\/]*$/, "") + '/%s';
+ navigator.registerContentHandler(ctype, url, 'test');
+ assert_equals(navigator.isContentHandlerRegistered(ctype.toUpperCase(), url), 'declined');
+});
+</script>
+</head>
+<body>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/004.xhtml b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/004.xhtml
new file mode 100644
index 000000000..a82f3506b
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/004.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Non-matching url in isContentHandlerRegistered</title>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script type="application/ecmascript">
+test(function() {
+ var ctype = 'application/x-notRegisteredInOtherTCs-004', url = location.href.replace(/\/[^\/]*$/, "") + '/%s';
+ navigator.registerContentHandler(ctype, url, 'test');
+ assert_equals(navigator.isContentHandlerRegistered(ctype, 'http://t/core/standards/registerhandler/%s'), 'new');
+});
+</script>
+</head>
+<body>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/005.xhtml b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/005.xhtml
new file mode 100644
index 000000000..b8c8b58d1
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/005.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Invalid characters in content type in isContentHandlerRegistered</title>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script type="application/ecmascript">
+test(function() {
+ var ctype = 'application/x-nótRegísteredInOthérTCs-004', url = location.href.replace(/\/[^\/]*$/, "") + '/%s';
+ navigator.registerContentHandler(ctype, url, 'test');
+ assert_equals(navigator.isContentHandlerRegistered(ctype, 'http://t/core/standards/registerhandler/%s'), 'new');
+});
+</script>
+</head>
+<body>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/006.xhtml b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/006.xhtml
new file mode 100644
index 000000000..86d0cff61
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/006.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Blacklisted content type and isContentHandlerRegistered</title>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script type="application/ecmascript">
+test(function() {
+ var ctype = 'application/xhtml+xml', url = location.href.replace(/\/[^\/]*$/, "") + '/%s';
+ navigator.registerContentHandler(ctype, url, 'test');
+ assert_equals(navigator.isContentHandlerRegistered(ctype, 'http://t/core/standards/registerhandler/%s'), 'new');
+});
+</script>
+</head>
+<body>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/get-navigatorlanguage-manual.html b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/get-navigatorlanguage-manual.html
new file mode 100644
index 000000000..4bdab9112
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/get-navigatorlanguage-manual.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>NavigatorLanguage: navigator.language returns the user's preferred language</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#navigatorlanguage">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<h2>Precondition</h2>
+<p>The user agent's preferred language is set as English (en).</p>
+<div id="log"></div>
+<script>
+ test(function() {
+ assert_equals(navigator.language, "en");
+ });
+</script>
+
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-indexed.html b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-indexed.html
new file mode 100644
index 000000000..a971fe9d1
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-indexed.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Test for lack of indexed getter on Navigator</title>
+<link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-navigator-object">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ assert_false("0" in window.navigator);
+ assert_equals(window.navigator[0], undefined);
+}, "window.navigator[0] should not exist");
+test(function() {
+ window.navigator[0] = "pass";
+ assert_true("0" in window.navigator);
+ assert_equals(window.navigator[0], "pass");
+}, "window.navigator[0] should be settable");
+test(function() {
+ assert_false("-1" in window.navigator);
+ assert_equals(window.navigator[-1], undefined);
+}, "window.navigator[-1] should not exist");
+test(function() {
+ window.navigator[-1] = "pass";
+ assert_true("-1" in window.navigator);
+ assert_equals(window.navigator[-1], "pass");
+}, "window.navigator[-1] should be settable");
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigatorlanguage.html b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigatorlanguage.html
new file mode 100644
index 000000000..d56df8a3d
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigatorlanguage.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>NavigatorLanguage: the most preferred language is the one returned by navigator.language</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#navigatorlanguage">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+ test(function() {
+ assert_true("language" in navigator);
+ assert_true("languages" in navigator);
+
+ assert_equals(navigator.languages[0], navigator.language,
+ "navigator.languages is the most preferred language first");
+
+ });
+</script>
+
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.html b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.html
new file mode 100644
index 000000000..a9ceee5a8
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.html
@@ -0,0 +1,214 @@
+<!DOCTYPE html>
+<meta charset='utf-8'>
+<title>registerProtocolHandler()</title>
+
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+
+<noscript><p>Enable JavaScript and reload.</p></noscript>
+
+<p><strong>Note:</strong> If your browser limits the number of handler
+registration requests on a page, you might need to disable or significantly
+increase that limit for the tests below to run.</p>
+
+<div id='log'></div>
+
+<script type='text/javascript'>
+
+test(function () {
+ assert_idl_attribute(navigator, 'registerProtocolHandler');
+}, 'the registerProtocolHandler method should exist on the navigator object');
+
+test(function () {
+ navigator.registerProtocolHandler('tel', location.href + '/%s', 'foo');
+}, 'a handler with valid arguments should work');
+
+
+/* URL argument */
+test(function () {
+ navigator.registerProtocolHandler('tel', '%s', 'foo');
+}, 'a relative URL should work');
+
+test(function () {
+ navigator.registerProtocolHandler('tel', location.href + '#%s', 'foo');
+}, 'a URL with a fragment identifier should work');
+
+test(function () {
+ navigator.registerProtocolHandler('tel', location.href + '?foo=%s', 'foo');
+}, 'a URL with a query string should work');
+
+test(function () {
+ navigator.registerProtocolHandler('tel', location.href + '?foo=%s&bar', 'foo');
+}, 'a URL with a multi-argument query string should work');
+
+test(function () {
+ navigator.registerProtocolHandler('tel', location.href + '/%s/bar/baz/', 'foo');
+}, 'a URL with the passed string as a directory name should work');
+
+test(function () {
+ navigator.registerProtocolHandler('tel', location.href + '/%s/bar/baz/?foo=1337&bar#baz', 'foo');
+}, 'a URL with the passed string as a directory name followed by a query string and fragment identifier should work');
+
+test(function () {
+ navigator.registerProtocolHandler('tel', location.href + '/%s/foo/%s/', 'foo');
+}, 'a URL with the passed string included twice should work');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mailto', '', 'foo') } );
+}, 'an empty url argument should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mailto', 'http://%s.com', 'foo') } );
+}, '%s instead of domain name should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mailto', 'http://%s.example.com', 'foo') } );
+}, '%s instead of subdomain name should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mailto', location.href + '', 'foo') } );
+}, 'a url argument without %s should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mailto', 'http://example.com', 'foo') } );
+}, 'a url argument pointing to a different domain name, without %s should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mailto', location.href + '/%', 'foo') } );
+}, 'a url argument without %s (but with %) should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mailto', location.href + '/%a', 'foo') } );
+}, 'a url argument without %s (but with %a) should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SECURITY_ERR', function () { navigator.registerProtocolHandler('mailto', 'http://example.com/%s', 'foo') } );
+}, 'a url argument pointing to a different domain name should throw SECURITY_ERR');
+
+test(function () {
+ assert_throws('SECURITY_ERR', function () { navigator.registerProtocolHandler('mailto', 'https://example.com/%s', 'foo') } );
+}, 'a url argument pointing to a different domain name should throw SECURITY_ERR (2)');
+
+test(function () {
+ assert_throws('SECURITY_ERR', function () { navigator.registerProtocolHandler('mailto', 'http://foobar.example.com/%s', 'foo') } );
+}, 'a url argument pointing to a different domain name should throw SECURITY_ERR (3)');
+
+test(function () {
+ assert_throws('SECURITY_ERR', function () { navigator.registerProtocolHandler('mailto', 'mailto:%s@example.com', 'foo') } );
+}, 'looping handlers should throw SECURITY_ERR');
+
+test(function () {
+ assert_throws('SECURITY_ERR', function () { navigator.registerProtocolHandler('sms', 'tel:%s', 'foo') } );
+}, 'a url argument pointing to a non-http[s] scheme should throw SECURITY_ERR due to not being of the same origin');
+
+/* Protocol argument */
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('unrecognized', location.href + '/%a', 'foo') } );
+}, 'a protocol argument containing an unrecognized scheme should throw SECURITY_ERR'); /* This is a whitelist, not a blacklist. */
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mailto:', location.href + '/%a', 'foo') } );
+}, 'a protocol argument containing : should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mailto://', location.href + '/%a', 'foo') } );
+}, 'a protocol argument containing :// should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('http://', location.href + '/%a', 'foo') } );
+}, 'a protocol argument containing http:// should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mailto' + String.fromCharCode(0), location.href + '/%a', 'foo') } );
+}, 'a protocol argument containing a null character should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mailtoo' + String.fromCharCode(8), location.href + '/%a', 'foo') } );
+}, 'a protocol argument containing a backspace character should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mailto' + String.fromCharCode(10), location.href + '/%a', 'foo') } );
+}, 'a protocol argument containing a LF character should throw SYNTAX_ERR');
+
+test(function () {
+ assert_throws('SYNTAX_ERR', function () { navigator.registerProtocolHandler('mаilto', location.href + '/%a', 'foo') } );
+}, 'a protocol argument containing non-alphanumeric characters (like a cyrillic “а”) should throw SYNTAX_ERR');
+
+test(function () {
+ navigator.registerProtocolHandler('TEL', location.href + '/%s', 'foo');
+}, 'a protocol argument of “TEL” should be equivalent to “tel”');
+
+test(function () {
+ navigator.registerProtocolHandler('teL', location.href + '/%s', 'foo');
+}, 'a protocol argument of “teL” should be equivalent to “tel”');
+
+
+/* Overriding any of the following protocols must never be allowed. That would
+ * break the browser. */
+var blacklist = new Array(
+ 'about',
+ 'attachment',
+ 'blob',
+ 'chrome',
+ 'cid',
+ 'data',
+ 'file',
+ 'ftp',
+ 'http',
+ 'https',
+ 'javascript',
+ 'livescript',
+ 'mid',
+ 'mocha',
+ 'opera',
+ 'operamail',
+ 'res',
+ 'resource',
+ 'shttp',
+ 'tcl',
+ 'vbscript',
+ 'view-source',
+ 'ws',
+ 'wss',
+ 'wyciwyg');
+
+for ( var bi=0, bl=blacklist.length; bi<bl; ++bi ){
+
+ test(function () {
+ assert_throws('SECURITY_ERR', function () { navigator.registerProtocolHandler(blacklist[bi], location.href + '/%s', 'foo') } );
+ }, 'attempting to override the ' + blacklist[bi] + ' protocol should throw SECURITY_ERR');
+
+}
+
+/* The following protocols must be possible to override.
+ * We're just testing that the call goes through here. Whether or not they
+ * actually work as handlers is covered by the interactive tests. */
+var whitelist = new Array(
+ 'geo',
+ 'im',
+ 'irc',
+ 'ircs',
+ 'mailto',
+ 'mms',
+ 'news',
+ 'nntp',
+ 'sms',
+ 'smsto',
+ 'tel',
+ 'urn',
+ 'webcal',
+ 'wtai',
+ 'xmpp');
+
+for ( var wi=0, wl=whitelist.length; wi<wl; ++wi ){
+
+ test(function () {
+ navigator.registerProtocolHandler(whitelist[wi], location.href + '/%s', 'foo');
+ assert_true(true);
+ }, 'overriding the ' + whitelist[wi] + ' protocol should work');
+
+}
+</script>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/001.xhtml b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/001.xhtml
new file mode 100644
index 000000000..ce9ee1eb0
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/001.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>isProtocolHandlerRegistered for new protocol</title>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script type="application/ecmascript">
+test(function() {
+ var dir_uri = location.href.replace(/\/[^\/]*$/, "");
+ assert_equals(navigator.isProtocolHandlerRegistered('web+CustomProtocolOne', dir_uri + '/%s'), 'new');
+});
+</script>
+</head>
+<body>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/002.xhtml b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/002.xhtml
new file mode 100644
index 000000000..ce2c8dc0d
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/002.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>isProtocolHandlerRegistered for protocol that is not yet accepted</title>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script type="application/ecmascript">
+test(function() {
+ var scheme = 'web+CustomProtocolTwo';
+ var url = location.href.replace(/\/[^\/]*$/, "") + '/%s';
+ navigator.registerProtocolHandler(scheme, url, 'Ignore dialog or decline it');
+ assert_equals(navigator.isProtocolHandlerRegistered(scheme, url), 'declined')
+})
+</script>
+</head>
+<body>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/003.xhtml b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/003.xhtml
new file mode 100644
index 000000000..035d5b9a6
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/003.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Protocol case insensitivity in isProtocolHandlerRegistered</title>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script type="application/ecmascript">
+test(function() {
+ var scheme = 'web+CustomProtocolTree', url = location.href.replace(/\/[^\/]*$/, "") + '/%s';
+ navigator.registerProtocolHandler(scheme, url, 'Ignore dialog or decline it');
+ assert_equals(navigator.isProtocolHandlerRegistered(scheme.toUpperCase(), url), 'declined');
+});
+</script>
+</head>
+<body>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/004.xhtml b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/004.xhtml
new file mode 100644
index 000000000..3fd14dd12
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/004.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Non-matching url in isProtocolHandlerRegistered</title>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script type="application/ecmascript">
+test(function() {
+ var scheme = 'web+CustomProtocolFour', url = location.href.replace(/\/[^\/]*$/, "") + '/%s';
+ navigator.registerProtocolHandler(scheme, url, 'Ignore dialog');
+ assert_equals(navigator.isProtocolHandlerRegistered(scheme, 'http://t/core/standards/registerhandler/%s'), 'new');
+});
+</script>
+</head>
+<body>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/005.xhtml b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/005.xhtml
new file mode 100644
index 000000000..894ff4a6a
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/005.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Invalid characters in protocol scheme and isProtocolHandlerRegistered</title>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script type="application/ecmascript">
+test(function() {
+ var scheme = 'web+CústomPrótocolFíve', url = location.href.replace(/\/[^\/]*$/, "") + '/%s';
+ navigator.registerProtocolHandler(scheme, url, 'Ignore dialog or decline it');
+ assert_equals(navigator.isProtocolHandlerRegistered(scheme, url), 'new');
+});
+</script>
+</head>
+<body>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/006.xhtml b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/006.xhtml
new file mode 100644
index 000000000..7529a7eb2
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/006.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Scheme outside white list and isProtocolHandlerRegistered</title>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<script type="application/ecmascript">
+test(function() {
+ var dir_uri = location.href.replace(/\/[^\/]*$/, "");
+ var scheme = 'http', url = dir_uri + '/%s';
+ navigator.registerProtocolHandler(scheme, url, 'Ignore dialog or decline it');
+ assert_equals(navigator.isProtocolHandlerRegistered(scheme, url), 'new');
+});
+</script>
+</head>
+<body>
+<div id="log"></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/webappapis/timers/.gitkeep b/testing/web-platform/tests/html/webappapis/timers/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/timers/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/timers/evil-spec-example.html b/testing/web-platform/tests/html/webappapis/timers/evil-spec-example.html
new file mode 100644
index 000000000..77a874690
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/timers/evil-spec-example.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>Interaction of setTimeout and WebIDL</title>
+<link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
+<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-windowtimers-settimeout">
+<link rel="help" href="https://heycam.github.io/webidl/#es-operations">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test()
+function finishTest() {
+ assert_equals(log, "ONE TWO ")
+ t.done()
+}
+var log = '';
+function logger(s) { log += s + ' '; }
+
+setTimeout({ toString: function () {
+ setTimeout("logger('ONE')", 100);
+ return "logger('TWO'); t.step(finishTest)";
+} }, 100);
+</script>
diff --git a/testing/web-platform/tests/html/webappapis/user-prompts/.gitkeep b/testing/web-platform/tests/html/webappapis/user-prompts/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/user-prompts/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/user-prompts/dialogs-implemented-using-separate-documents/.gitkeep b/testing/web-platform/tests/html/webappapis/user-prompts/dialogs-implemented-using-separate-documents/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/user-prompts/dialogs-implemented-using-separate-documents/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/user-prompts/printing/.gitkeep b/testing/web-platform/tests/html/webappapis/user-prompts/printing/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/user-prompts/printing/.gitkeep
diff --git a/testing/web-platform/tests/html/webappapis/user-prompts/simple-dialogs/.gitkeep b/testing/web-platform/tests/html/webappapis/user-prompts/simple-dialogs/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/user-prompts/simple-dialogs/.gitkeep