From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../tests/html/infrastructure/urls/.gitkeep | 0 .../html/infrastructure/urls/base-urls/.gitkeep | 0 .../urls/dynamic-changes-to-base-urls/.gitkeep | 0 .../dynamic-urls.sub.xhtml | 59 ++ .../urls/interfaces-for-url-manipulation/.gitkeep | 0 .../html/infrastructure/urls/parsing-urls/.gitkeep | 0 .../infrastructure/urls/resolving-urls/.gitkeep | 0 .../query-encoding/resources/blank.py | 2 + .../query-encoding/resources/css-tmpl.py | 5 + .../query-encoding/resources/manifest.py | 12 + .../resources/page-using-manifest.py | 12 + .../query-encoding/resources/resolve-url.js | 932 +++++++++++++++++++++ .../query-encoding/resources/resource.py | 131 +++ .../query-encoding/resources/stash.py | 16 + .../resolving-urls/query-encoding/utf-16be.html | Bin 0 -> 906 bytes .../resolving-urls/query-encoding/utf-16le.html | Bin 0 -> 912 bytes .../urls/resolving-urls/query-encoding/utf-8.html | 9 + .../query-encoding/windows-1251.html | 9 + .../query-encoding/windows-1252.html | 9 + .../infrastructure/urls/terminology-0/.gitkeep | 0 .../urls/terminology-0/document-base-url.html | 93 ++ .../urls/terminology-0/multiple-base.sub.html | 17 + .../urls/url-manipulation-and-creation/.gitkeep | 0 23 files changed, 1306 insertions(+) create mode 100644 testing/web-platform/tests/html/infrastructure/urls/.gitkeep create mode 100644 testing/web-platform/tests/html/infrastructure/urls/base-urls/.gitkeep create mode 100644 testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/.gitkeep create mode 100644 testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.xhtml create mode 100644 testing/web-platform/tests/html/infrastructure/urls/interfaces-for-url-manipulation/.gitkeep create mode 100644 testing/web-platform/tests/html/infrastructure/urls/parsing-urls/.gitkeep create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/.gitkeep create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/blank.py create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/css-tmpl.py create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/manifest.py create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/page-using-manifest.py create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16le.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-8.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/terminology-0/.gitkeep create mode 100644 testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/terminology-0/multiple-base.sub.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/url-manipulation-and-creation/.gitkeep (limited to 'testing/web-platform/tests/html/infrastructure/urls') 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 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 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 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 @@ + + + + + HTML Test: Dynamic changes to base URLs + + + + + + +
+ + + + 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 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 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 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 = "" % id + doc = """ + +%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('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 ) + 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 + 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 ', + {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 + + +
+ 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 @@ + + +Resolving URLs, URL character encoding, windows-1251 + + + + +
+ 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 @@ + + +Resolving URLs, URL character encoding, windows-1252 + + + + +
+ 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 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 @@ + + +HTML Test: document base URL + + + + + +
+ + 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 @@ + + +document base URL: multiple base elements + + + + + + + +
+ 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 -- cgit v1.2.3