mirror of
https://github.com/servo/servo.git
synced 2025-06-28 11:03:39 +01:00
Update web-platform-tests to revision cb40575e1a57892476f3e326355674d492dedbd2
This commit is contained in:
parent
0afe412d63
commit
fa6a725a86
170 changed files with 1958 additions and 664 deletions
|
@ -0,0 +1,4 @@
|
|||
[hit-test-floats-002.html]
|
||||
[Hit test float]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[hit-test-floats-003.html]
|
||||
[Miss float below something else]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[hit-test-floats-004.html]
|
||||
[Miss float below something else]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[border-image-image-type-003.htm]
|
||||
expected: FAIL
|
|
@ -2,3 +2,6 @@
|
|||
[Hit test intersecting scaled box]
|
||||
expected: FAIL
|
||||
|
||||
[Hit test within unscaled box]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[elementFromPoint-001.html]
|
||||
[CSSOM View - 5 - extensions to the Document interface]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[elementsFromPoint-invalid-cases.html]
|
||||
[The root element is the last element returned for otherwise empty queries within the viewport]
|
||||
expected: FAIL
|
||||
|
|
@ -312,24 +312,24 @@
|
|||
[Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK]
|
||||
expected: NOTRUN
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html */*]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/plain */*]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -56,6 +56,6 @@
|
|||
[separate text/javascript x/x]
|
||||
expected: FAIL
|
||||
|
||||
[separate text/javascript ]
|
||||
[separate text/javascript error]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
|
||||
expected: FAIL
|
||||
|
||||
[X-Content-Type-Options%3A%20%22nosniFF%22]
|
||||
expected: FAIL
|
||||
|
||||
[X-Content-Type-Options%3A%0D%0AX-Content-Type-Options%3A%20nosniff]
|
||||
[X-Content-Type-Options%3A%20no%0D%0AX-Content-Type-Options%3A%20nosniff]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[traverse_the_history_1.html]
|
||||
[Multiple history traversals from the same task]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[cross-origin-objects-on-new-window.html]
|
||||
expected: TIMEOUT
|
|
@ -1,5 +1,4 @@
|
|||
[embedded-opener-remove-frame.html]
|
||||
expected: CRASH
|
||||
[opener of discarded nested browsing context]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[iframe_sandbox_popups_escaping-2.html]
|
||||
expected: CRASH
|
||||
expected: TIMEOUT
|
||||
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
|
||||
expected: TIMEOUT
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
[iframe_sandbox_popups_escaping-3.html]
|
||||
expected: TIMEOUT
|
||||
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
|
||||
expected: FAIL
|
||||
expected: TIMEOUT
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
[iframe_sandbox_popups_nonescaping-1.html]
|
||||
expected: CRASH
|
||||
[Check that popups from a sandboxed iframe do not escape the sandbox]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
[list-of-available-images-matching.https.html]
|
||||
expected: ERROR
|
|
@ -3,6 +3,3 @@
|
|||
[The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
|
||||
expected: TIMEOUT
|
||||
|
||||
[The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[audioworkletprocessor-process-zero-outputs.https.html]
|
||||
[Executing "check-zero-outputs"]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
[003.html]
|
||||
expected: ERROR
|
||||
[shared]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
[shared-worker-in-data-url-context.window.html]
|
||||
expected: TIMEOUT
|
||||
[Create a shared worker in a data url frame]
|
||||
expected: FAIL
|
||||
|
||||
[Create a data url shared worker in a data url frame]
|
||||
expected: FAIL
|
||||
expected: TIMEOUT
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,4 @@
|
|||
[hit-test-floats-002.html]
|
||||
[Hit test float]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[hit-test-floats-003.html]
|
||||
[Miss float below something else]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[hit-test-floats-004.html]
|
||||
[Miss float below something else]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[border-image-image-type-003.htm]
|
||||
expected: FAIL
|
|
@ -2,3 +2,6 @@
|
|||
[Hit test intersecting scaled box]
|
||||
expected: FAIL
|
||||
|
||||
[Hit test within unscaled box]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[elementFromPoint-001.html]
|
||||
[CSSOM View - 5 - extensions to the Document interface]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[elementsFromPoint-invalid-cases.html]
|
||||
[The root element is the last element returned for otherwise empty queries within the viewport]
|
||||
expected: FAIL
|
||||
|
|
@ -312,24 +312,24 @@
|
|||
[fetch(): separate response Content-Type: text/plain ]
|
||||
expected: NOTRUN
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html */*]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/plain */*]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -56,6 +56,6 @@
|
|||
[separate text/javascript x/x]
|
||||
expected: FAIL
|
||||
|
||||
[separate text/javascript ]
|
||||
[separate text/javascript error]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
|
||||
expected: FAIL
|
||||
|
||||
[X-Content-Type-Options%3A%20%22nosniFF%22]
|
||||
expected: FAIL
|
||||
|
||||
[X-Content-Type-Options%3A%0D%0AX-Content-Type-Options%3A%20nosniff]
|
||||
[X-Content-Type-Options%3A%20no%0D%0AX-Content-Type-Options%3A%20nosniff]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[traverse_the_history_1.html]
|
||||
[Multiple history traversals from the same task]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[cross-origin-objects-on-new-window.html]
|
||||
expected: TIMEOUT
|
|
@ -1,5 +1,4 @@
|
|||
[embedded-opener-remove-frame.html]
|
||||
expected: CRASH
|
||||
[opener and "removed" embedded documents]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[iframe_sandbox_popups_escaping-2.html]
|
||||
expected: CRASH
|
||||
expected: TIMEOUT
|
||||
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
|
||||
expected: TIMEOUT
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
[iframe_sandbox_popups_escaping-3.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
|
||||
expected: FAIL
|
||||
expected: TIMEOUT
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
[iframe_sandbox_popups_nonescaping-1.html]
|
||||
type: testharness
|
||||
expected: CRASH
|
||||
[Check that popups from a sandboxed iframe do not escape the sandbox]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
[list-of-available-images-matching.https.html]
|
||||
expected: ERROR
|
|
@ -4,6 +4,3 @@
|
|||
[The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
|
||||
expected: TIMEOUT
|
||||
|
||||
[The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[audioworkletprocessor-process-zero-outputs.https.html]
|
||||
[Executing "check-zero-outputs"]
|
||||
expected: FAIL
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
[003.html]
|
||||
type: testharness
|
||||
expected: ERROR
|
||||
[shared]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
[shared-worker-in-data-url-context.window.html]
|
||||
expected: TIMEOUT
|
||||
[Create a shared worker in a data url frame]
|
||||
expected: FAIL
|
||||
|
||||
[Create a data url shared worker in a data url frame]
|
||||
expected: FAIL
|
||||
expected: TIMEOUT
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# Simply returns the request body to check if the upload succeeded.
|
||||
def main(request, response):
|
||||
return 200, [("Content-Type", request.headers['content-type'])], request.body
|
||||
return 200, [(b"Content-Type", request.headers[b'content-type'])], request.body
|
||||
|
|
|
@ -1,24 +1,26 @@
|
|||
from wptserve.utils import isomorphic_decode
|
||||
|
||||
def main(request, response):
|
||||
"""
|
||||
Simple handler that sets a response header based on which client hint
|
||||
request headers were received.
|
||||
"""
|
||||
|
||||
response.headers.append("Access-Control-Allow-Origin", "*")
|
||||
response.headers.append(b"Access-Control-Allow-Origin", b"*")
|
||||
values = request.GET
|
||||
name = values.first('name')
|
||||
type = values.first('mimeType')
|
||||
dpr = values.first('dpr')
|
||||
name = values.first(b'name')
|
||||
type = values.first(b'mimeType')
|
||||
dpr = values.first(b'dpr')
|
||||
double = None
|
||||
if 'double' in values:
|
||||
double = values.first('double')
|
||||
image_path = request.doc_root + "/".join(request.url_parts[2].split("/")[:-1]) + "/" + name
|
||||
if b'double' in values:
|
||||
double = values.first(b'double')
|
||||
image_path = request.doc_root + u"/".join(request.url_parts[2].split(u"/")[:-1]) + u"/" + isomorphic_decode(name)
|
||||
f = open(image_path, "rb")
|
||||
buff = f.read()
|
||||
f.close()
|
||||
response.headers.set("Content-Type", type)
|
||||
response.headers.set("Content-DPR", dpr)
|
||||
response.headers.set(b"Content-Type", type)
|
||||
response.headers.set(b"Content-DPR", dpr)
|
||||
if double:
|
||||
response.headers.append("Content-DPR", double)
|
||||
response.headers.set("Content-Length", len(buff))
|
||||
response.headers.append(b"Content-DPR", double)
|
||||
response.headers.set(b"Content-Length", len(buff))
|
||||
response.content = buff
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
from os import path
|
||||
from os import listdir
|
||||
|
||||
from wptserve.utils import isomorphic_decode
|
||||
|
||||
"""
|
||||
The main purpose of this script is to set cookies based on files in this folder:
|
||||
cookies/http-state/resources
|
||||
|
@ -13,18 +15,18 @@ If you want to run a test in isolation, append "?debug=" and the test id to the
|
|||
URL above.
|
||||
"""
|
||||
|
||||
SETUP_FILE_TEMPLATE = "{}-test"
|
||||
EXPECTATION_FILE_TEMPLATE = "{}-expected"
|
||||
EXPECTATION_HTML_SCAFFOLD = "iframe-expectation-doc.html.py-str"
|
||||
DEBUGGING_HTML_SCAFFOLD = "debugging-single-test.html.py-str"
|
||||
DEFAULT_RESOURCE_DIR = path.join("cookies", "http-state", "resources")
|
||||
DEFAULT_TEST_DIR = "test-files"
|
||||
ALL_TESTS = "all-tests.html.py-str"
|
||||
SETUP_FILE_TEMPLATE = u"{}-test"
|
||||
EXPECTATION_FILE_TEMPLATE = u"{}-expected"
|
||||
EXPECTATION_HTML_SCAFFOLD = u"iframe-expectation-doc.html.py-str"
|
||||
DEBUGGING_HTML_SCAFFOLD = u"debugging-single-test.html.py-str"
|
||||
DEFAULT_RESOURCE_DIR = path.join(u"cookies", u"http-state", u"resources")
|
||||
DEFAULT_TEST_DIR = u"test-files"
|
||||
ALL_TESTS = u"all-tests.html.py-str"
|
||||
|
||||
|
||||
def dump_file(directory, filename):
|
||||
"""Reads a file into a string."""
|
||||
return open(path.join(directory, filename), "r").read()
|
||||
return open(path.join(directory, filename), u"r").read()
|
||||
|
||||
|
||||
class CookieTestResponse(object):
|
||||
|
@ -46,17 +48,17 @@ class CookieTestResponse(object):
|
|||
"""Returns a full HTML document which contains the expectation."""
|
||||
html_frame = dump_file(self.__resources_dir, EXPECTATION_HTML_SCAFFOLD)
|
||||
expected_data = dump_file(self.__test_files_dir, self.__expectation_file)
|
||||
return html_frame.format(**{'data' : expected_data})
|
||||
return html_frame.format(**{u'data' : expected_data})
|
||||
|
||||
def find_all_test_files(root):
|
||||
"""Retrieves all files from the test-files/ folder and returns them as
|
||||
string pair as used in the JavaScript object. Sorted by filename."""
|
||||
all_files = []
|
||||
line_template = '{{file: "{filename}", name: "{filename}"}},'
|
||||
line_template = u'{{file: "{filename}", name: "{filename}"}},'
|
||||
for file in listdir(path.join(root, DEFAULT_RESOURCE_DIR, DEFAULT_TEST_DIR)):
|
||||
if file.endswith('-test'):
|
||||
name = file.replace('-test', '')
|
||||
all_files.append(line_template.format(**{'filename' : name}))
|
||||
if file.endswith(u'-test'):
|
||||
name = file.replace(u'-test', u'')
|
||||
all_files.append(line_template.format(**{u'filename' : name}))
|
||||
all_files.sort()
|
||||
return all_files
|
||||
|
||||
|
@ -64,29 +66,29 @@ def generate_for_all_tests(root):
|
|||
"""Returns an HTML document which loads and executes all tests in the
|
||||
test-files/ directory."""
|
||||
html_frame = dump_file(path.join(root, DEFAULT_RESOURCE_DIR), ALL_TESTS)
|
||||
return html_frame % '\n'.join(find_all_test_files(root))
|
||||
return html_frame % u'\n'.join(find_all_test_files(root))
|
||||
|
||||
def main(request, response):
|
||||
if "debug" in request.GET:
|
||||
if b"debug" in request.GET:
|
||||
"""If '?debug=' is set, return the document for a single test."""
|
||||
response.writer.write_status(200)
|
||||
response.writer.end_headers()
|
||||
html_frame = dump_file(path.join(request.doc_root, DEFAULT_RESOURCE_DIR),
|
||||
DEBUGGING_HTML_SCAFFOLD)
|
||||
test_file = html_frame % (request.GET['debug'])
|
||||
test_file = html_frame % (isomorphic_decode(request.GET[b'debug']))
|
||||
response.writer.write_content(test_file)
|
||||
return;
|
||||
return
|
||||
|
||||
if "file" in request.GET:
|
||||
if b"file" in request.GET:
|
||||
"""If '?file=' is set, send a cookie and a document which contains the
|
||||
expectation of which cookies should be set by the browser in response."""
|
||||
cookie_response = CookieTestResponse(request.GET['file'], request.doc_root)
|
||||
cookie_response = CookieTestResponse(isomorphic_decode(request.GET[b'file']), request.doc_root)
|
||||
|
||||
response.writer.write_status(200)
|
||||
response.writer.write(cookie_response.cookie_setting_header())
|
||||
response.writer.end_headers()
|
||||
response.writer.write_content(cookie_response.body_with_expectation())
|
||||
return;
|
||||
return
|
||||
|
||||
"""Without any arguments, return documentation and run all available tests."""
|
||||
response.writer.write_status(200)
|
||||
|
|
|
@ -5,11 +5,10 @@ def main(request, response):
|
|||
headers = setNoCacheAndCORSHeaders(request, response)
|
||||
try:
|
||||
# Expire the named cookie, and return a JSON-encoded success code.
|
||||
name = readParameter(request, paramName="name", requireValue=True)
|
||||
name = readParameter(request, paramName=u"name", requireValue=True)
|
||||
scheme = request.url_parts.scheme
|
||||
headers.append(makeDropCookie(name, "https" == scheme))
|
||||
return headers, '{"success": true}'
|
||||
headers.append(makeDropCookie(name, u"https" == scheme))
|
||||
return headers, b'{"success": true}'
|
||||
except:
|
||||
return 500, headers, '{"error" : "Empty or missing name parameter."}'
|
||||
|
||||
return 500, headers, b'{"error" : "Empty or missing name parameter."}'
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ def main(request, response):
|
|||
headers = setNoCacheAndCORSHeaders(request, response)
|
||||
|
||||
# Expire the cookies, and return a JSON-encoded success code.
|
||||
headers.append(makeDropCookie("samesite_strict", False))
|
||||
headers.append(makeDropCookie("samesite_lax", False))
|
||||
headers.append(makeDropCookie("samesite_none", False))
|
||||
headers.append(makeDropCookie("samesite_unspecified", False))
|
||||
return headers, '{"success": true}'
|
||||
headers.append(makeDropCookie(b"samesite_strict", False))
|
||||
headers.append(makeDropCookie(b"samesite_lax", False))
|
||||
headers.append(makeDropCookie(b"samesite_none", False))
|
||||
headers.append(makeDropCookie(b"samesite_unspecified", False))
|
||||
return headers, b'{"success": true}'
|
||||
|
|
|
@ -6,6 +6,6 @@ def main(request, response):
|
|||
headers = setNoCacheAndCORSHeaders(request, response)
|
||||
|
||||
# Expire the cookies, and return a JSON-encoded success code.
|
||||
headers.append(makeDropCookie("samesite_none_insecure", False))
|
||||
headers.append(makeDropCookie("samesite_none_secure", True))
|
||||
return headers, '{"success": true}'
|
||||
headers.append(makeDropCookie(b"samesite_none_insecure", False))
|
||||
headers.append(makeDropCookie(b"samesite_none_secure", True))
|
||||
return headers, b'{"success": true}'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from helpers import makeDropCookie, readParameter, setNoCacheAndCORSHeaders
|
||||
from helpers import makeDropCookie, setNoCacheAndCORSHeaders
|
||||
|
||||
def main(request, response):
|
||||
"""Respond to `/cookie/drop/secure` by dropping the two cookie set by
|
||||
|
@ -6,6 +6,6 @@ def main(request, response):
|
|||
headers = setNoCacheAndCORSHeaders(request, response)
|
||||
|
||||
# Expire the cookies, and return a JSON-encoded success code.
|
||||
headers.append(makeDropCookie("alone_secure", False))
|
||||
headers.append(makeDropCookie("alone_insecure", False))
|
||||
return headers, '{"success": true}'
|
||||
headers.append(makeDropCookie(b"alone_secure", False))
|
||||
headers.append(makeDropCookie(b"alone_insecure", False))
|
||||
return headers, b'{"success": true}'
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import json
|
||||
from wptserve.utils import isomorphic_decode
|
||||
|
||||
def main(request, response):
|
||||
headers = [("Content-Type", "application/json"),
|
||||
("Access-Control-Allow-Credentials", "true")]
|
||||
headers = [(b"Content-Type", b"application/json"),
|
||||
(b"Access-Control-Allow-Credentials", b"true")]
|
||||
|
||||
if "origin" in request.headers:
|
||||
headers.append(("Access-Control-Allow-Origin", request.headers["origin"]))
|
||||
if b"origin" in request.headers:
|
||||
headers.append((b"Access-Control-Allow-Origin", request.headers[b"origin"]))
|
||||
|
||||
values = []
|
||||
for key in request.cookies:
|
||||
for value in request.cookies.get_list(key):
|
||||
values.append("\"%s\": \"%s\"" % (key, value))
|
||||
body = "{ %s }" % ",".join(values)
|
||||
values.append(u"\"%s\": \"%s\"" % (isomorphic_decode(key), value))
|
||||
body = u"{ %s }" % u",".join(values)
|
||||
return headers, body
|
||||
|
|
|
@ -1,47 +1,54 @@
|
|||
import urlparse
|
||||
from six import integer_types
|
||||
|
||||
from six.moves.urllib.parse import parse_qs
|
||||
|
||||
from wptserve.utils import isomorphic_encode
|
||||
|
||||
def setNoCacheAndCORSHeaders(request, response):
|
||||
"""Set Cache-Control, CORS and Content-Type headers appropriate for the cookie tests."""
|
||||
headers = [("Content-Type", "application/json"),
|
||||
("Access-Control-Allow-Credentials", "true")]
|
||||
headers = [(b"Content-Type", b"application/json"),
|
||||
(b"Access-Control-Allow-Credentials", b"true")]
|
||||
|
||||
origin = "*"
|
||||
if "origin" in request.headers:
|
||||
origin = request.headers["origin"]
|
||||
origin = b"*"
|
||||
if b"origin" in request.headers:
|
||||
origin = request.headers[b"origin"]
|
||||
|
||||
headers.append(("Access-Control-Allow-Origin", origin))
|
||||
headers.append((b"Access-Control-Allow-Origin", origin))
|
||||
#headers.append(("Access-Control-Allow-Credentials", "true"))
|
||||
headers.append(("Cache-Control", "no-cache"))
|
||||
headers.append(("Expires", "Fri, 01 Jan 1990 00:00:00 GMT"))
|
||||
headers.append((b"Cache-Control", b"no-cache"))
|
||||
headers.append((b"Expires", b"Fri, 01 Jan 1990 00:00:00 GMT"))
|
||||
|
||||
return headers
|
||||
|
||||
def makeCookieHeader(name, value, otherAttrs):
|
||||
"""Make a Set-Cookie header for a cookie with the name, value and attributes provided."""
|
||||
def makeAV(a, v):
|
||||
if None == v or "" == v:
|
||||
if None == v or b"" == v:
|
||||
return a
|
||||
return "%s=%s" % (a, v)
|
||||
if isinstance(v, integer_types):
|
||||
return b"%s=%i" % (a, v)
|
||||
else:
|
||||
return b"%s=%s" % (a, v)
|
||||
|
||||
# ensure cookie name is always first
|
||||
attrs = ["%s=%s" % (name, value)]
|
||||
attrs.extend(makeAV(a, v) for (a,v) in otherAttrs.iteritems())
|
||||
return ("Set-Cookie", "; ".join(attrs))
|
||||
attrs = [b"%s=%s" % (name, value)]
|
||||
attrs.extend(makeAV(a, v) for (a, v) in otherAttrs.items())
|
||||
return (b"Set-Cookie", b"; ".join((attrs)))
|
||||
|
||||
def makeDropCookie(name, secure):
|
||||
attrs = {"MaxAge": 0, "path": "/"}
|
||||
attrs = {b"MaxAge": 0, b"path": b"/"}
|
||||
if secure:
|
||||
attrs["secure"] = ""
|
||||
return makeCookieHeader(name, "", attrs)
|
||||
attrs[b"secure"] = b""
|
||||
return makeCookieHeader(name, b"", attrs)
|
||||
|
||||
def readParameter(request, paramName, requireValue):
|
||||
"""Read a parameter from the request. Raise if requireValue is set and the
|
||||
parameter has an empty value or is not present."""
|
||||
params = urlparse.parse_qs(request.url_parts.query)
|
||||
params = parse_qs(request.url_parts.query)
|
||||
param = params[paramName][0].strip()
|
||||
if len(param) == 0:
|
||||
raise Exception("Empty or missing name parameter.")
|
||||
return param
|
||||
raise Exception(u"Empty or missing name parameter.")
|
||||
return isomorphic_encode(param)
|
||||
|
||||
def readCookies(request):
|
||||
"""Read the cookies from the client present in the request."""
|
||||
|
@ -52,4 +59,3 @@ def readCookies(request):
|
|||
# need to modify the test to take cookie names and value lists?
|
||||
cookies[key] = cookie.value
|
||||
return cookies
|
||||
|
||||
|
|
|
@ -4,13 +4,13 @@ def main(request, response):
|
|||
"""Respond to `/cookie/imgIfMatch?name={name}&value={value}` with a 404 if
|
||||
the cookie isn't present, and a transparent GIF otherwise."""
|
||||
headers = helpers.setNoCacheAndCORSHeaders(request, response)
|
||||
name = helpers.readParameter(request, paramName="name", requireValue=True)
|
||||
value = helpers.readParameter(request, paramName="value", requireValue=True)
|
||||
name = helpers.readParameter(request, paramName=u"name", requireValue=True)
|
||||
value = helpers.readParameter(request, paramName=u"value", requireValue=True)
|
||||
cookiesWithMatchingNames = request.cookies.get_list(name)
|
||||
for cookie in cookiesWithMatchingNames:
|
||||
if cookie.value == value:
|
||||
# From https://github.com/mathiasbynens/small/blob/master/gif-transparent.gif
|
||||
headers.append(("Content-Type","image/gif"))
|
||||
gif = "\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\xFF\xFF\xFF\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B"
|
||||
headers.append((b"Content-Type", b"image/gif"))
|
||||
gif = b"\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\xFF\xFF\xFF\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B"
|
||||
return headers, gif
|
||||
return 500, headers, '{"error": {"message": "The cookie\'s value did not match the given value."}}'
|
||||
return 500, headers, b'{"error": {"message": "The cookie\'s value did not match the given value."}}'
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import json
|
||||
import helpers
|
||||
|
||||
from wptserve.utils import isomorphic_decode
|
||||
|
||||
def main(request, response):
|
||||
headers = helpers.setNoCacheAndCORSHeaders(request, response)
|
||||
cookies = helpers.readCookies(request)
|
||||
return headers, json.dumps(cookies)
|
||||
decoded_cookies = {isomorphic_decode(key): isomorphic_decode(val) for key, val in cookies.items()}
|
||||
return headers, json.dumps(decoded_cookies)
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
import json
|
||||
import helpers
|
||||
|
||||
from wptserve.utils import isomorphic_decode
|
||||
|
||||
def main(request, response):
|
||||
headers = helpers.setNoCacheAndCORSHeaders(request, response)
|
||||
cookies = helpers.readCookies(request)
|
||||
headers.append(("Content-Type", "text/html; charset=utf-8"))
|
||||
headers.append((b"Content-Type", b"text/html; charset=utf-8"))
|
||||
|
||||
tmpl = """
|
||||
tmpl = u"""
|
||||
<!DOCTYPE html>
|
||||
<script>
|
||||
var data = %s;
|
||||
|
@ -33,4 +35,5 @@ def main(request, response):
|
|||
});
|
||||
</script>
|
||||
"""
|
||||
return headers, tmpl % json.dumps(cookies)
|
||||
decoded_cookies = {isomorphic_decode(key): isomorphic_decode(val) for key, val in cookies.items()}
|
||||
return headers, tmpl % json.dumps(decoded_cookies)
|
||||
|
|
|
@ -8,15 +8,15 @@ def main(request, response):
|
|||
location - The resource to redirect to.
|
||||
"""
|
||||
status = 302
|
||||
if "status" in request.GET:
|
||||
if b"status" in request.GET:
|
||||
try:
|
||||
status = int(request.GET.first("status"))
|
||||
status = int(request.GET.first(b"status"))
|
||||
except ValueError:
|
||||
pass
|
||||
headers = setNoCacheAndCORSHeaders(request, response)
|
||||
|
||||
location = request.GET.first("location")
|
||||
location = request.GET.first(b"location")
|
||||
|
||||
headers.append(("Location", location))
|
||||
headers.append((b"Location", location))
|
||||
|
||||
return status, headers, ""
|
||||
return status, headers, b""
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import helpers
|
||||
import urllib
|
||||
from six.moves.urllib.parse import unquote
|
||||
|
||||
from wptserve.utils import isomorphic_encode
|
||||
|
||||
def main(request, response):
|
||||
"""Respond to `/cookie/set?{cookie}` by echoing `{cookie}` as a `Set-Cookie` header."""
|
||||
|
@ -7,7 +9,7 @@ def main(request, response):
|
|||
|
||||
# Cookies may require whitespace (e.g. in the `Expires` attribute), so the
|
||||
# query string should be decoded.
|
||||
cookie = urllib.unquote(request.url_parts.query)
|
||||
headers.append(("Set-Cookie", cookie))
|
||||
cookie = unquote(request.url_parts.query)
|
||||
headers.append((b"Set-Cookie", isomorphic_encode(cookie)))
|
||||
|
||||
return headers, '{"success": true}'
|
||||
return headers, b'{"success": true}'
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
from helpers import makeCookieHeader, setNoCacheAndCORSHeaders
|
||||
|
||||
from wptserve.utils import isomorphic_encode
|
||||
|
||||
def main(request, response):
|
||||
"""Respond to `/cookie/set/samesite?{value}` by setting four cookies:
|
||||
1. `samesite_strict={value};SameSite=Strict;path=/`
|
||||
|
@ -8,16 +10,16 @@ def main(request, response):
|
|||
4. `samesite_unspecified={value};path=/`
|
||||
Then navigate to a page that will post a message back to the opener with the set cookies"""
|
||||
headers = setNoCacheAndCORSHeaders(request, response)
|
||||
value = request.url_parts.query
|
||||
value = isomorphic_encode(request.url_parts.query)
|
||||
|
||||
headers.append(("Content-Type", "text/html; charset=utf-8"))
|
||||
headers.append(makeCookieHeader("samesite_strict", value, {"SameSite":"Strict","path":"/"}))
|
||||
headers.append(makeCookieHeader("samesite_lax", value, {"SameSite":"Lax","path":"/"}))
|
||||
headers.append((b"Content-Type", b"text/html; charset=utf-8"))
|
||||
headers.append(makeCookieHeader(b"samesite_strict", value, {b"SameSite":b"Strict", b"path":b"/"}))
|
||||
headers.append(makeCookieHeader(b"samesite_lax", value, {b"SameSite":b"Lax", b"path":b"/"}))
|
||||
# SameSite=None cookies must be Secure.
|
||||
headers.append(makeCookieHeader("samesite_none", value, {"SameSite":"None", "path":"/", "Secure": ""}))
|
||||
headers.append(makeCookieHeader("samesite_unspecified", value, {"path":"/"}))
|
||||
headers.append(makeCookieHeader(b"samesite_none", value, {b"SameSite":b"None", b"path":b"/", b"Secure": b""}))
|
||||
headers.append(makeCookieHeader(b"samesite_unspecified", value, {b"path":b"/"}))
|
||||
|
||||
document = """
|
||||
document = b"""
|
||||
<!DOCTYPE html>
|
||||
<script>
|
||||
// A same-site navigation, which should attach all cookies including SameSite ones.
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
from helpers import makeCookieHeader, setNoCacheAndCORSHeaders
|
||||
|
||||
from wptserve.utils import isomorphic_encode
|
||||
|
||||
def main(request, response):
|
||||
"""Respond to `/cookies/resources/setSameSiteNone.py?{value}` by setting two cookies:
|
||||
1. `samesite_none_insecure={value};SameSite=None;path=/`
|
||||
2. `samesite_none_secure={value};SameSite=None;Secure;path=/`
|
||||
"""
|
||||
headers = setNoCacheAndCORSHeaders(request, response)
|
||||
value = request.url_parts.query
|
||||
value = isomorphic_encode(request.url_parts.query)
|
||||
|
||||
headers.append(makeCookieHeader("samesite_none_insecure", value, {"SameSite":"None", "path":"/"}))
|
||||
headers.append(makeCookieHeader("samesite_none_secure", value, {"SameSite":"None", "Secure":"", "path":"/"}))
|
||||
headers.append(makeCookieHeader(b"samesite_none_insecure", value, {b"SameSite":b"None", b"path":b"/"}))
|
||||
headers.append(makeCookieHeader(b"samesite_none_secure", value, {b"SameSite":b"None", b"Secure":b"", b"path":b"/"}))
|
||||
|
||||
return headers, '{"success": true}'
|
||||
return headers, b'{"success": true}'
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
from helpers import makeCookieHeader, readParameter, setNoCacheAndCORSHeaders
|
||||
|
||||
from wptserve.utils import isomorphic_encode
|
||||
|
||||
def main(request, response):
|
||||
"""Respond to `/cookie/set/secure?{value}` by setting two cookies:
|
||||
alone_secure={value};secure;path=/`
|
||||
alone_insecure={value};path=/"""
|
||||
headers = setNoCacheAndCORSHeaders(request, response)
|
||||
value = request.url_parts.query
|
||||
value = isomorphic_encode(request.url_parts.query)
|
||||
|
||||
headers.append(makeCookieHeader("alone_secure", value, {"secure": "","path": "/"}))
|
||||
headers.append(makeCookieHeader("alone_insecure", value, {"path": "/"}))
|
||||
return headers, '{"success": true}'
|
||||
headers.append(makeCookieHeader(b"alone_secure", value, {b"secure": b"", b"path": b"/"}))
|
||||
headers.append(makeCookieHeader(b"alone_insecure", value, {b"path": b"/"}))
|
||||
return headers, b'{"success": true}'
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<title>CSS Reference Test</title>
|
||||
|
||||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
|
||||
|
||||
<style>
|
||||
div#outer
|
||||
{
|
||||
background-image: linear-gradient(to top, blue, orange);
|
||||
height: 140px;
|
||||
margin: 10px;
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
div#inner
|
||||
{
|
||||
background-color: white;
|
||||
height: 80px;
|
||||
left: 30px;
|
||||
position: relative;
|
||||
top: 30px;
|
||||
width: 80px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>Test passes if there is no red visible on the page.
|
||||
|
||||
<div id="outer"><div id="inner"></div></div>
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-break-3/#possible-breaks">
|
||||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
|
||||
<meta name="assert" content="We should break between the two lines (class B breakpoint), rather than between the last line and the container padding">
|
||||
<style>
|
||||
.child { display:inline-block; vertical-align:top; width:100%; height:50px; line-height:50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||
<div style="columns:2; column-fill:auto; column-gap:0; width:100px; height:100px; orphans:1; widows:1; background:red;">
|
||||
<div style="padding-bottom:50px; background:green;">
|
||||
<div class="child"></div>
|
||||
<div class="child"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-break-3/#possible-breaks">
|
||||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
|
||||
<meta name="assert" content="We should break between the last two lines (class B breakpoint), rather than inside the container padding">
|
||||
<style>
|
||||
.child { display:inline-block; vertical-align:top; width:100%; height:30px; line-height:30px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||
<div style="columns:2; column-fill:auto; column-gap:0; width:100px; height:100px; orphans:1; widows:1; background:red;">
|
||||
<div style="padding-bottom:70px; background:green;">
|
||||
<div class="child"></div>
|
||||
<div class="child"></div>
|
||||
<div class="child"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-break-3/#possible-breaks">
|
||||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
|
||||
<meta name="assert" content="We should break between the first two lines (class B breakpoint, also honoring widows), rather than inside the container padding">
|
||||
<style>
|
||||
.child { display:inline-block; vertical-align:top; width:100%; height:30px; line-height:30px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||
<div style="columns:2; column-fill:auto; column-gap:0; width:100px; height:100px; orphans:1; widows:2; background:red;">
|
||||
<div style="padding-bottom:40px; background:green;">
|
||||
<div class="child"></div>
|
||||
<div class="child"></div>
|
||||
<div class="child"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-break-3/#possible-breaks">
|
||||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
|
||||
<meta name="assert" content="The block with padding should be pushed to the second column, so that we won't have to break between the line and the padding edge">
|
||||
<style>
|
||||
.child { display:inline-block; vertical-align:top; width:100%; height:90px; line-height:90px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||
<div style="columns:2; column-fill:auto; column-gap:0; width:100px; height:100px; orphans:1; widows:1; background:red;">
|
||||
<div style="float:left; width:100%; height:100px; background:green;"></div>
|
||||
<div style="height:10px;"></div>
|
||||
<div style="padding-bottom:10px; background:green;">
|
||||
<div class="child"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-break-3/#possible-breaks">
|
||||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
|
||||
<meta name="assert" content="The last line could fit in the third column, but will be pushed to the fourth, so that we won't have to break between the last line and the container padding">
|
||||
<style>
|
||||
.child { display:inline-block; vertical-align:top; width:100%; height:40px; line-height:40px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||
<div style="columns:4; column-fill:auto; column-gap:0; width:100px; height:100px; orphans:1; widows:1; background:red;">
|
||||
<div style="height:40px; background:green;"></div>
|
||||
<div style="padding-bottom:60px; background:green;">
|
||||
<div class="child"></div>
|
||||
<div class="child"></div>
|
||||
<div class="child"></div>
|
||||
<div class="child"></div>
|
||||
<div class="child"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-break-3/#unforced-breaks">
|
||||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
|
||||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||
<div style="columns:3; column-fill:auto; column-gap:0; width:300px; height:50px;">
|
||||
<div style="width:200px; height:0;">
|
||||
<div style="height:20px; background:red;"></div>
|
||||
</div>
|
||||
<!-- No valid breakpoint here, since the preceding sibling takes up no space
|
||||
(and its overflowing child ends up in a parallel flow). -->
|
||||
<div style="height:120px;">
|
||||
<!-- Can't break inside lines. Let it overflow the (shorter) fragmentainer,
|
||||
but not its container. Consume 100px from it. -->
|
||||
<div style="display:inline-block; vertical-align:top; width:100px; height:100px; background:green;"></div>
|
||||
</div>
|
||||
<div style="margin-top:-20px; height:20px; background:white;"></div>
|
||||
</div>
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-break-3/#unforced-breaks">
|
||||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
|
||||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||
<div style="columns:2; column-fill:auto; column-gap:0; width:100px; height:50px; background:red;">
|
||||
<div>
|
||||
<div style="display:inline-block; vertical-align:top; width:50px; height:100px; background:green;"></div>
|
||||
</div>
|
||||
<!-- We're at the very beginning of the second column here, so inserting a
|
||||
forced break will have no effect. -->
|
||||
<div style="break-before:column;">
|
||||
<div style="display:inline-block; vertical-align:top; width:50px; height:100px; background:green;"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-break-3/#unforced-breaks">
|
||||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
|
||||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||
<div style="columns:2; column-fill:auto; column-gap:0; width:100px; height:50px; background:red;">
|
||||
<div style="width:50px; height:100px; line-height:200px; background:green;">
|
||||
<br>
|
||||
</div>
|
||||
<div style="break-before:column; width:50px; line-height:100px; background:green;">
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Multi-column Layout Test Reference: Test fragmentation for a nested multi-column container with column-span in paginated context</title>
|
||||
<link rel="author" title="Ting-Yu Lin" href="tlin@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
|
||||
|
||||
<style>
|
||||
.inner {
|
||||
column-count: 2;
|
||||
column-rule: 3px solid green;
|
||||
background-color: lightgreen;
|
||||
}
|
||||
.block1 {
|
||||
background-color: yellow;
|
||||
height: 3in;
|
||||
}
|
||||
.spanner {
|
||||
height: 2in;
|
||||
background-color: lightblue;
|
||||
}
|
||||
.block2 {
|
||||
background-color: pink;
|
||||
height: 3in;
|
||||
}
|
||||
</style>
|
||||
|
||||
<article class="inner">
|
||||
<div class="block1">block1</div>
|
||||
</article>
|
||||
<div class="spanner">spanner</div>
|
||||
<article class="inner">
|
||||
<div class="block2">block2</div>
|
||||
</article>
|
||||
</html>
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Multi-column Layout Test: Test fragmentation for a nested multi-column container with column-span in paginated context</title>
|
||||
<link rel="match" href="column-balancing-paged-001-print-ref.html">
|
||||
<link rel="author" title="Ting-Yu Lin" href="tlin@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-multicol-1/#column-span">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-break/#breaking-rules">
|
||||
|
||||
<style>
|
||||
.outer {
|
||||
column-count: 1;
|
||||
column-rule: 6px solid black;
|
||||
}
|
||||
.inner {
|
||||
column-count: 2;
|
||||
column-rule: 3px solid green;
|
||||
background-color: lightgreen;
|
||||
}
|
||||
.block1 {
|
||||
background-color: yellow;
|
||||
height: 3in;
|
||||
}
|
||||
.spanner {
|
||||
column-span: all;
|
||||
height: 2in;
|
||||
background-color: lightblue;
|
||||
}
|
||||
.block2 {
|
||||
background-color: pink;
|
||||
height: 3in
|
||||
}
|
||||
</style>
|
||||
|
||||
<article class="outer">
|
||||
<article class="inner">
|
||||
<div class="block1">block1</div>
|
||||
<div class="spanner">spanner</div>
|
||||
<div class="block2">block2</div>
|
||||
</article>
|
||||
</article>
|
||||
</html>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://crbug.com/1098840">
|
||||
<title>Verifies changing 'display' nested positions is not problematic</title>
|
||||
<div style="position:absolute; display:table;">
|
||||
<div style="position:fixed;"></div>
|
||||
</div>
|
||||
<span></span>
|
||||
<div id="boom" style="display:none;"></div>
|
||||
<script>
|
||||
document.body.offsetTop;
|
||||
boom.style.display = "block";
|
||||
</script>
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Reference: ::marker supports 'text-combine-upright'</title>
|
||||
<style>
|
||||
body {
|
||||
writing-mode: vertical-lr;
|
||||
}
|
||||
ol, ul {
|
||||
display: flow-root;
|
||||
list-style-type: none;
|
||||
}
|
||||
.symbol {
|
||||
list-style-type: disc;
|
||||
}
|
||||
ul {
|
||||
list-style-position: inside;
|
||||
}
|
||||
ol span {
|
||||
display: inline-block;
|
||||
margin-top: -50px;
|
||||
height: 50px;
|
||||
text-align: end;
|
||||
}
|
||||
span {
|
||||
text-combine-upright: all;
|
||||
}
|
||||
</style>
|
||||
<ol><li><span>1. </span>outside decimal</li></ol>
|
||||
<ol><li><span>2. </span>outside string</li></ol>
|
||||
<ol><li><span>3. </span>outside content</li></ol>
|
||||
<ol class="symbol"><li>outside symbol</li></ol>
|
||||
|
||||
<ul><li><span>1. </span>inside decimal</li></ul>
|
||||
<ul><li><span>2. </span>inside string</li></ul>
|
||||
<ul><li><span>3. </span>inside content</li></ul>
|
||||
<ul class="symbol"><li>inside symbol</li></ul>
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Test: ::marker supports 'text-combine-upright'</title>
|
||||
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
|
||||
<link rel="match" href="marker-text-combine-upright-ref.html">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#marker-pseudo">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-writing-modes-4/#propdef-text-combine-upright">
|
||||
<meta name="assert" content="Checks that 'text-combine-upright' works well in ::marker, and doesn't crash.">
|
||||
<style>
|
||||
body {
|
||||
writing-mode: vertical-lr;
|
||||
}
|
||||
ol, ul {
|
||||
display: flow-root;
|
||||
}
|
||||
ul {
|
||||
list-style-position: inside;
|
||||
}
|
||||
.decimal {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.string {
|
||||
list-style-type: "2. ";
|
||||
}
|
||||
.content ::marker {
|
||||
content: "3. ";
|
||||
}
|
||||
.symbol {
|
||||
list-style-type: disc;
|
||||
}
|
||||
::marker {
|
||||
text-combine-upright: all;
|
||||
}
|
||||
</style>
|
||||
<ol class="decimal"><li>outside decimal</li></ol>
|
||||
<ol class="string"><li>outside string</li></ol>
|
||||
<ol class="content"><li>outside content</li></ol>
|
||||
<ol class="symbol"><li>outside symbol</li></ol>
|
||||
|
||||
<ul class="decimal"><li>inside decimal</li></ul>
|
||||
<ul class="string"><li>inside string</li></ul>
|
||||
<ul class="content"><li>inside content</li></ul>
|
||||
<ul class="symbol"><li>inside symbol</li></ul>
|
|
@ -6,7 +6,18 @@
|
|||
|
||||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#hyphenation">
|
||||
<link rel="match" href="reference/hyphens-auto-010-ref.html">
|
||||
<link rel="match" href="reference/hyphens-auto-010M-ref.html">
|
||||
<link rel="match" href="reference/hyphens-auto-010H-ref.html">
|
||||
|
||||
<!--
|
||||
User agents may use U+2010 HYPHEN <https://codepoints.net/U+2010>
|
||||
when the font has the glyph, or
|
||||
may use U+002D HYPHEN-MINUS <https://codepoints.net/U+002d>
|
||||
otherwise. Some fonts will display slightly different glyphs for
|
||||
these code points. Therefore these 2 reference files.
|
||||
The M-ref.html reference file means the hyphen-Minus character U+002D.
|
||||
The H-ref.html reference file means the Hyphen character U+2010.
|
||||
-->
|
||||
|
||||
<meta content="" name="flags">
|
||||
<meta content="When 'hyphens' is set to 'auto' and when 'lang' attribute is also set to a valid value, then words may be broken at hyphenation opportunities determined automatically by an hyphenation resource appropriate to the language of the text involved.">
|
||||
|
@ -17,25 +28,11 @@
|
|||
border: black solid 2px;
|
||||
font-family: monospace;
|
||||
font-size: 32px;
|
||||
margin-bottom: 0.25em;
|
||||
width: 6ch;
|
||||
}
|
||||
|
||||
div#test
|
||||
{
|
||||
hyphens: auto;
|
||||
}
|
||||
|
||||
div#reference
|
||||
{
|
||||
hyphens: none;
|
||||
width: 6ch;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body lang="en">
|
||||
|
||||
<p>Test passes if each black-bordered rectangles have identical inside content.
|
||||
|
||||
<div id="test">regulation implementation</div>
|
||||
|
||||
<div id="reference">regu-lation imple-menta-tion</div>
|
||||
<div>regulation implementation</div>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#hyphenation">
|
||||
<link rel="match" href="reference/hyphens-auto-010-ref.html">
|
||||
<link rel="match" href="reference/hyphens-auto-010M-ref.html">
|
||||
|
||||
<meta content="" name="flags">
|
||||
<meta content="This test checks that 'hyphens: none' does not suppress line wrapping after encountering an actual hyphen-minus character (U+002D).">
|
||||
|
@ -17,28 +17,18 @@
|
|||
border: black solid 2px;
|
||||
font-family: monospace;
|
||||
font-size: 32px;
|
||||
margin-bottom: 0.25em;
|
||||
width: 6ch;
|
||||
}
|
||||
|
||||
div#test
|
||||
{
|
||||
hyphens: none;
|
||||
width: 6ch;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div>regu-lation imple-menta-tion</div>
|
||||
|
||||
<p>Test passes if each black-bordered rectangles have identical inside content.
|
||||
|
||||
<div id="test">regu-lation imple-menta-tion</div>
|
||||
|
||||
<div id="reference">regu-<br>lation<br>imple-<br>menta-<br>tion</div>
|
||||
|
||||
<!--
|
||||
|
||||
Hyphen-minus == - == -
|
||||
|
||||
Hyphen == ‐ == ‐
|
||||
|
||||
-->
|
||||
<!--
|
||||
Expected result:
|
||||
regu-
|
||||
lation
|
||||
imple-
|
||||
menta-
|
||||
tion
|
||||
-->
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#hyphenation">
|
||||
<link rel="match" href="reference/hyphens-auto-010-ref.html">
|
||||
<link rel="match" href="reference/hyphens-auto-010H-ref.html">
|
||||
|
||||
<meta content="" name="flags">
|
||||
<meta content="This test checks that 'hyphens: none' does not suppress line wrapping after encountering an actual hyphen character (U+2010).">
|
||||
|
@ -17,28 +17,18 @@
|
|||
border: black solid 2px;
|
||||
font-family: monospace;
|
||||
font-size: 32px;
|
||||
margin-bottom: 0.25em;
|
||||
width: 6ch;
|
||||
}
|
||||
|
||||
div#test
|
||||
{
|
||||
hyphens: none;
|
||||
width: 6ch;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div>regu‐lation imple‐menta‐tion</div>
|
||||
|
||||
<p>Test passes if each black-bordered rectangles have identical inside content.
|
||||
|
||||
<div id="test">regu-lation imple-menta-tion</div>
|
||||
|
||||
<div id="reference">regu‐<br>lation<br>imple‐<br>menta‐<br>tion</div>
|
||||
|
||||
<!--
|
||||
|
||||
Hyphen-minus == - == -
|
||||
|
||||
Hyphen == ‐ == ‐
|
||||
|
||||
-->
|
||||
<!--
|
||||
Expected result:
|
||||
regu-
|
||||
lation
|
||||
imple-
|
||||
menta-
|
||||
tion
|
||||
-->
|
||||
|
|
|
@ -12,16 +12,18 @@
|
|||
border: black solid 2px;
|
||||
font-family: monospace;
|
||||
font-size: 32px;
|
||||
hyphens: none;
|
||||
margin-bottom: 0.25em;
|
||||
width: 6ch;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body lang="en">
|
||||
|
||||
<p>Test passes if each black-bordered rectangles have identical inside content.
|
||||
<div>regu‐<br>lation<br>imple‐<br>menta‐<br>tion</div>
|
||||
|
||||
<div>regu-lation imple-menta-tion</div>
|
||||
<!--
|
||||
|
||||
<div>regu-lation imple-menta-tion</div>
|
||||
Hyphen-minus == - == -
|
||||
|
||||
Hyphen == ‐ == ‐
|
||||
|
||||
-->
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<title>CSS Reference Test</title>
|
||||
|
||||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
|
||||
|
||||
<style>
|
||||
div
|
||||
{
|
||||
border: black solid 2px;
|
||||
font-family: monospace;
|
||||
font-size: 32px;
|
||||
width: 6ch;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body lang="en">
|
||||
|
||||
<div>regu-<br>lation<br>imple-<br>menta-<br>tion</div>
|
||||
|
||||
<!--
|
||||
|
||||
Hyphen-minus == - == -
|
||||
|
||||
Hyphen == ‐ == ‐
|
||||
|
||||
-->
|
|
@ -3,5 +3,5 @@ import time
|
|||
def main(request, response):
|
||||
# Sleep for 500ms to delay onload.
|
||||
time.sleep(0.5)
|
||||
response.headers.set("Cache-Control", "no-cache, must-revalidate");
|
||||
response.headers.set("Location", "data:image/gif;base64,R0lGODlhAQABAJAAAMjIyAAAACwAAAAAAQABAAACAgQBADs%3D");
|
||||
response.headers.set(b"Cache-Control", b"no-cache, must-revalidate");
|
||||
response.headers.set(b"Location", b"data:image/gif;base64,R0lGODlhAQABAJAAAMjIyAAAACwAAAAAAQABAAACAgQBADs%3D");
|
||||
|
|
|
@ -2,68 +2,70 @@ import time
|
|||
|
||||
from six.moves.urllib.parse import urlencode, urlparse
|
||||
|
||||
from wptserve.utils import isomorphic_decode, isomorphic_encode
|
||||
|
||||
def main(request, response):
|
||||
stashed_data = {'count': 0, 'preflight': "0"}
|
||||
stashed_data = {b'count': 0, b'preflight': b"0"}
|
||||
status = 302
|
||||
headers = [("Content-Type", "text/plain"),
|
||||
("Cache-Control", "no-cache"),
|
||||
("Pragma", "no-cache")]
|
||||
if "Origin" in request.headers:
|
||||
headers.append(("Access-Control-Allow-Origin", request.headers.get("Origin", "")))
|
||||
headers.append(("Access-Control-Allow-Credentials", "true"))
|
||||
headers = [(b"Content-Type", b"text/plain"),
|
||||
(b"Cache-Control", b"no-cache"),
|
||||
(b"Pragma", b"no-cache")]
|
||||
if b"Origin" in request.headers:
|
||||
headers.append((b"Access-Control-Allow-Origin", request.headers.get(b"Origin", b"")))
|
||||
headers.append((b"Access-Control-Allow-Credentials", b"true"))
|
||||
else:
|
||||
headers.append(("Access-Control-Allow-Origin", "*"))
|
||||
headers.append((b"Access-Control-Allow-Origin", b"*"))
|
||||
|
||||
token = None
|
||||
if "token" in request.GET:
|
||||
token = request.GET.first("token")
|
||||
if b"token" in request.GET:
|
||||
token = request.GET.first(b"token")
|
||||
data = request.server.stash.take(token)
|
||||
if data:
|
||||
stashed_data = data
|
||||
|
||||
if request.method == "OPTIONS":
|
||||
if "allow_headers" in request.GET:
|
||||
headers.append(("Access-Control-Allow-Headers", request.GET['allow_headers']))
|
||||
stashed_data['preflight'] = "1"
|
||||
if request.method == u"OPTIONS":
|
||||
if b"allow_headers" in request.GET:
|
||||
headers.append((b"Access-Control-Allow-Headers", request.GET[b'allow_headers']))
|
||||
stashed_data[b'preflight'] = b"1"
|
||||
#Preflight is not redirected: return 200
|
||||
if not "redirect_preflight" in request.GET:
|
||||
if not b"redirect_preflight" in request.GET:
|
||||
if token:
|
||||
request.server.stash.put(request.GET.first("token"), stashed_data)
|
||||
return 200, headers, ""
|
||||
request.server.stash.put(request.GET.first(b"token"), stashed_data)
|
||||
return 200, headers, u""
|
||||
|
||||
if "redirect_status" in request.GET:
|
||||
status = int(request.GET['redirect_status'])
|
||||
if b"redirect_status" in request.GET:
|
||||
status = int(request.GET[b'redirect_status'])
|
||||
|
||||
stashed_data['count'] += 1
|
||||
stashed_data[b'count'] += 1
|
||||
|
||||
if "location" in request.GET:
|
||||
url = request.GET['location']
|
||||
if "simple" not in request.GET:
|
||||
if b"location" in request.GET:
|
||||
url = isomorphic_decode(request.GET[b'location'])
|
||||
if b"simple" not in request.GET:
|
||||
scheme = urlparse(url).scheme
|
||||
if scheme == "" or scheme == "http" or scheme == "https":
|
||||
url += "&" if '?' in url else "?"
|
||||
if scheme == u"" or scheme == u"http" or scheme == u"https":
|
||||
url += u"&" if u'?' in url else u"?"
|
||||
#keep url parameters in location
|
||||
url_parameters = {}
|
||||
for item in request.GET.items():
|
||||
url_parameters[item[0]] = item[1][0]
|
||||
url_parameters[isomorphic_decode(item[0])] = isomorphic_decode(item[1][0])
|
||||
url += urlencode(url_parameters)
|
||||
#make sure location changes during redirection loop
|
||||
url += "&count=" + str(stashed_data['count'])
|
||||
headers.append(("Location", url))
|
||||
url += u"&count=" + str(stashed_data[b'count'])
|
||||
headers.append((b"Location", isomorphic_encode(url)))
|
||||
|
||||
if "redirect_referrerpolicy" in request.GET:
|
||||
headers.append(("Referrer-Policy", request.GET['redirect_referrerpolicy']))
|
||||
if b"redirect_referrerpolicy" in request.GET:
|
||||
headers.append((b"Referrer-Policy", request.GET[b'redirect_referrerpolicy']))
|
||||
|
||||
if "delay" in request.GET:
|
||||
time.sleep(float(request.GET.first("delay", 0)) / 1E3)
|
||||
if b"delay" in request.GET:
|
||||
time.sleep(float(request.GET.first(b"delay", 0)) / 1E3)
|
||||
|
||||
if token:
|
||||
request.server.stash.put(request.GET.first("token"), stashed_data)
|
||||
if "max_count" in request.GET:
|
||||
max_count = int(request.GET['max_count'])
|
||||
request.server.stash.put(request.GET.first(b"token"), stashed_data)
|
||||
if b"max_count" in request.GET:
|
||||
max_count = int(request.GET[b'max_count'])
|
||||
#stop redirecting and return count
|
||||
if stashed_data['count'] > max_count:
|
||||
if stashed_data[b'count'] > max_count:
|
||||
# -1 because the last is not a redirection
|
||||
return str(stashed_data['count'] - 1)
|
||||
return str(stashed_data[b'count'] - 1)
|
||||
|
||||
return status, headers, ""
|
||||
return status, headers, u""
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Element#requestFullscreen({ screen }) tentative support</title>
|
||||
<!-- TODO: update link to W3C whenever specifications are ready -->
|
||||
<link rel="help" href="https://github.com/webscreens/window-placement"/>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
promise_test(async t => {
|
||||
// Grant window-placement permissions for testdriver.
|
||||
await test_driver.set_permission({name: "window-placement"}, "granted");
|
||||
|
||||
let invoked = false;
|
||||
let options = { get screen() { invoked = true; return undefined; } };
|
||||
return document.body.requestFullscreen(options).then(
|
||||
() => { assert_unreached("promise unexpectedly fulfilled"); },
|
||||
() => { assert_true(invoked, "screen getter not invoked"); });
|
||||
}, "fullscreenOptions.screen getter is invoked on requestFullscreen");
|
||||
</script>
|
|
@ -69,8 +69,8 @@ async function observeReports(global) {
|
|||
});
|
||||
observer.observe();
|
||||
|
||||
// Wait 3000ms for reports to settle.
|
||||
await new Promise(r => step_timeout(r, 3000));
|
||||
// Wait 5000ms for reports to settle.
|
||||
await new Promise(r => step_timeout(r, 5000));
|
||||
return reports;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- Any copyright is dedicated to the Public Domain.
|
||||
- http://creativecommons.org/publicdomain/zero/1.0/ -->
|
||||
|
||||
<html>
|
||||
<link rel="match" href="details-two-pages-print-ref.html">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements">
|
||||
<style>
|
||||
summary {
|
||||
/* Hide the triangle for comparing with div in reftest. */
|
||||
list-style-type: none;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<details open>
|
||||
<summary style="page-break-after: always;">Summary</summary>
|
||||
<p>This is the details.</p>
|
||||
</details>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- Any copyright is dedicated to the Public Domain.
|
||||
- http://creativecommons.org/publicdomain/zero/1.0/ -->
|
||||
|
||||
<html>
|
||||
<link rel="match" href="details-two-pages-print-ref.html">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements">
|
||||
<style>
|
||||
summary {
|
||||
/* Hide the triangle for comparing with div in reftest. */
|
||||
list-style-type: none;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<details open>
|
||||
<summary>Summary<div style="page-break-before: always;"></div></summary>
|
||||
<p>This is the details.</p>
|
||||
</details>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- Any copyright is dedicated to the Public Domain.
|
||||
- http://creativecommons.org/publicdomain/zero/1.0/ -->
|
||||
|
||||
<html>
|
||||
<link rel="match" href="details-two-pages-print-ref.html">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements">
|
||||
<style>
|
||||
summary {
|
||||
/* Hide the triangle for comparing with div in reftest. */
|
||||
list-style-type: none;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<details open>
|
||||
<summary>Summary</summary>
|
||||
<p style="page-break-before: always;">This is the details.</p>
|
||||
</details>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- Any copyright is dedicated to the Public Domain.
|
||||
- http://creativecommons.org/publicdomain/zero/1.0/ -->
|
||||
|
||||
<html>
|
||||
<link rel="match" href="details-two-pages-print-ref.html">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements">
|
||||
<style>
|
||||
summary {
|
||||
/* Hide the triangle for comparing with div in reftest. */
|
||||
list-style-type: none;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<details open>
|
||||
<summary>Summary<div style="page-break-before: always;"></div></summary>
|
||||
<p>This is the details.</p>
|
||||
</details>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- Any copyright is dedicated to the Public Domain.
|
||||
- http://creativecommons.org/publicdomain/zero/1.0/ -->
|
||||
|
||||
<html>
|
||||
<body>
|
||||
<div>
|
||||
<div style="page-break-after: always;">Summary</div>
|
||||
<p>This is the details.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,68 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<title>List of available images tuple-matching logic</title>
|
||||
<link rel="author" title="Dom Farolino" href="mailto:dom@chromium.org">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-list-of-available-images">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
|
||||
<script>
|
||||
const path = location.origin + '/html/semantics/embedded-content/the-img-element/';
|
||||
const image_url = path + 'image-1.jpg';
|
||||
|
||||
function syncWait(ms) {
|
||||
const start = Date.now();
|
||||
while (Date.now() - start < ms);
|
||||
}
|
||||
|
||||
let sawNoCorsRequest = false;
|
||||
|
||||
navigator.serviceWorker.onmessage = ({data}) => {
|
||||
if (data.url === image_url && data.mode === 'no-cors') {
|
||||
sawNoCorsRequest = true;
|
||||
}
|
||||
};
|
||||
|
||||
promise_test(t => {
|
||||
return service_worker_unregister_and_register(t, 'resources/sw.js', path)
|
||||
.then(r => {
|
||||
return wait_for_state(t, r.installing, 'activated');
|
||||
});
|
||||
}, 'registering service worker');
|
||||
|
||||
promise_test(async t => {
|
||||
const img = new Image();
|
||||
|
||||
function load_img_promise() {
|
||||
return new Promise((resolve, reject) => {
|
||||
img.onload = resolve;
|
||||
img.onerror = e => { reject("The img should not fail to load") };
|
||||
|
||||
img.src = image_url;
|
||||
// If there is not a matching image in the list of available images, the
|
||||
// actual fetch operation is queued as a microtask, so we will see a
|
||||
// request with mode 'cors' due to setting the crossorigin attribute
|
||||
// below.
|
||||
syncWait(500);
|
||||
img.crossOrigin = 'anonymous';
|
||||
});
|
||||
};
|
||||
|
||||
await load_img_promise();
|
||||
assert_false(sawNoCorsRequest, "The image is not fetched with mode: no-cors");
|
||||
await new Promise(resolve => {
|
||||
img.onload = img.onerror = resolve;
|
||||
img.src = '';
|
||||
img.crossOrigin = null;
|
||||
});
|
||||
await load_img_promise();
|
||||
assert_false(sawNoCorsRequest, "The image is not fetched with mode: no-cors");
|
||||
|
||||
}, 'list of available images tuple-matching logic');
|
||||
|
||||
promise_test(t => {
|
||||
return service_worker_unregister(t, path);
|
||||
}, 'unregistering service worker');
|
||||
</script>
|
|
@ -0,0 +1,20 @@
|
|||
addEventListener('install', (event) => {
|
||||
skipWaiting();
|
||||
});
|
||||
|
||||
addEventListener('activate', (event) => {
|
||||
event.waitUntil(clients.claim());
|
||||
});
|
||||
|
||||
async function broadcast(msg) {
|
||||
const allClients = await clients.matchAll();
|
||||
for (const client of allClients) {
|
||||
client.postMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
addEventListener('fetch', (event) => {
|
||||
event.waitUntil(
|
||||
broadcast({ url: event.request.url, mode: event.request.mode })
|
||||
)
|
||||
});
|
|
@ -0,0 +1 @@
|
|||
Service-Worker-Allowed: /html/semantics/embedded-content/the-img-element/
|
|
@ -1,4 +1,4 @@
|
|||
def main(request, response):
|
||||
headers = [("Content-Type", "text/javascript"), ("Cache-control", "public, max-age=100")]
|
||||
body = "throw('fox');"
|
||||
headers = [(b"Content-Type", b"text/javascript"), (b"Cache-control", b"public, max-age=100")]
|
||||
body = u"throw('fox');"
|
||||
return 200, headers, body
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import time
|
||||
|
||||
def main(request, response):
|
||||
response.headers.append("Content-Type", "text/javascript")
|
||||
response.headers.append(b"Content-Type", b"text/javascript")
|
||||
try:
|
||||
script_id = int(request.GET.first("id"))
|
||||
delay = int(request.GET.first("sec"))
|
||||
script_id = int(request.GET.first(b"id"))
|
||||
delay = int(request.GET.first(b"sec"))
|
||||
except:
|
||||
response.set_error(400, "Invalid parameter")
|
||||
response.set_error(400, u"Invalid parameter")
|
||||
|
||||
time.sleep(int(delay))
|
||||
|
||||
return "log('%s')" % script_id
|
||||
return u"log('%s')" % script_id
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import time
|
||||
|
||||
def main(request, response):
|
||||
delay = float(request.GET.first("ms", 500))
|
||||
time.sleep(delay / 1E3);
|
||||
delay = float(request.GET.first(b"ms", 500))
|
||||
time.sleep(delay / 1E3)
|
||||
|
||||
return [("Content-type", "text/javascript")], "export let delayedLoaded = true;"
|
||||
return [(b"Content-type", b"text/javascript")], u"export let delayedLoaded = true;"
|
||||
|
|
|
@ -1,22 +1,25 @@
|
|||
import random
|
||||
import time
|
||||
|
||||
from wptserve.utils import isomorphic_decode
|
||||
|
||||
|
||||
"""
|
||||
This script serves
|
||||
"""
|
||||
|
||||
def main(request, response):
|
||||
inlineOrExternal = request.GET.first("inlineOrExternal", "null")
|
||||
hasBlockingStylesheet = request.GET.first("hasBlockingStylesheet", "true") == "true"
|
||||
result = request.GET.first("result", "success")
|
||||
type = "text/javascript" if request.GET.first("type", "classic") == "classic" else "module"
|
||||
inlineOrExternal = request.GET.first(b"inlineOrExternal", b"null")
|
||||
hasBlockingStylesheet = request.GET.first(b"hasBlockingStylesheet", b"true") == b"true"
|
||||
result = request.GET.first(b"result", b"success")
|
||||
type = u"text/javascript" if request.GET.first(b"type", b"classic") == b"classic" else u"module"
|
||||
|
||||
response.headers.set("Content-Type", "text/html; charset=utf-8")
|
||||
response.headers.set("Transfer-Encoding", "chunked")
|
||||
response.headers.set(b"Content-Type", b"text/html; charset=utf-8")
|
||||
response.headers.set(b"Transfer-Encoding", b"chunked")
|
||||
response.write_status_headers()
|
||||
|
||||
# Step 1: Start parsing.
|
||||
body = """<!DOCTYPE html>
|
||||
body = u"""<!DOCTYPE html>
|
||||
<head>
|
||||
<script>
|
||||
parent.postMessage("fox", "*");
|
||||
|
@ -24,33 +27,33 @@ def main(request, response):
|
|||
"""
|
||||
|
||||
if hasBlockingStylesheet:
|
||||
body += """
|
||||
body += u"""
|
||||
<link rel="stylesheet" href="slow-flag-setter.py?result=css&cache=%f">
|
||||
""" % random.random()
|
||||
|
||||
body += """
|
||||
body += u"""
|
||||
</head>
|
||||
<body>
|
||||
"""
|
||||
|
||||
if inlineOrExternal == "inline" or inlineOrExternal == "external" or inlineOrExternal == "empty-src":
|
||||
body += """
|
||||
if inlineOrExternal == b"inline" or inlineOrExternal == b"external" or inlineOrExternal == b"empty-src":
|
||||
body += u"""
|
||||
<streaming-element>
|
||||
"""
|
||||
|
||||
# Trigger DOM processing
|
||||
body += "A" * 100000
|
||||
body += u"A" * 100000
|
||||
|
||||
response.writer.write("%x\r\n" % len(body))
|
||||
response.writer.write(u"%x\r\n" % len(body))
|
||||
response.writer.write(body)
|
||||
response.writer.write("\r\n")
|
||||
response.writer.write(u"\r\n")
|
||||
response.writer.flush()
|
||||
|
||||
body = ""
|
||||
body = u""
|
||||
|
||||
if inlineOrExternal == "inline":
|
||||
if inlineOrExternal == b"inline":
|
||||
time.sleep(1)
|
||||
body += """
|
||||
body += u"""
|
||||
<script id="s1" type="%s"
|
||||
onload="scriptOnLoad()"
|
||||
onerror="scriptOnError(event)">
|
||||
|
@ -59,26 +62,26 @@ def main(request, response):
|
|||
} else {
|
||||
window.didExecute = "executed";
|
||||
}
|
||||
""" % (type)
|
||||
if result == "parse-error":
|
||||
body += "1=2 parse error\n"
|
||||
""" % type
|
||||
if result == b"parse-error":
|
||||
body += u"1=2 parse error\n"
|
||||
|
||||
body += """
|
||||
body += u"""
|
||||
</script>
|
||||
</streaming-element>
|
||||
"""
|
||||
elif inlineOrExternal == "external":
|
||||
elif inlineOrExternal == b"external":
|
||||
time.sleep(1)
|
||||
body += """
|
||||
body += u"""
|
||||
<script id="s1" type="%s"
|
||||
src="slow-flag-setter.py?result=%s&cache=%s"
|
||||
onload="scriptOnLoad()"
|
||||
onerror="scriptOnError(event)"></script>
|
||||
</streaming-element>
|
||||
""" % (type, result, random.random())
|
||||
elif inlineOrExternal == "empty-src":
|
||||
""" % (type, isomorphic_decode(result), random.random())
|
||||
elif inlineOrExternal == b"empty-src":
|
||||
time.sleep(1)
|
||||
body += """
|
||||
body += u"""
|
||||
<script id="s1" type="%s"
|
||||
src=""
|
||||
onload="scriptOnLoad()"
|
||||
|
@ -90,12 +93,12 @@ def main(request, response):
|
|||
# // wasn't blocked by stylesheets as expected.
|
||||
|
||||
# Trigger DOM processing
|
||||
body += "B" * 100000
|
||||
body += u"B" * 100000
|
||||
|
||||
response.writer.write("%x\r\n" % len(body))
|
||||
response.writer.write(u"%x\r\n" % len(body))
|
||||
response.writer.write(body)
|
||||
response.writer.write("\r\n")
|
||||
response.writer.write(u"\r\n")
|
||||
|
||||
response.writer.write("0\r\n")
|
||||
response.writer.write("\r\n")
|
||||
response.writer.write(u"0\r\n")
|
||||
response.writer.write(u"\r\n")
|
||||
response.writer.flush()
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
import time
|
||||
|
||||
def main(request, response):
|
||||
headers = [("Content-Type", "text/javascript")]
|
||||
headers = [(b"Content-Type", b"text/javascript")]
|
||||
|
||||
result = request.GET.first("result", "success")
|
||||
if result == "css":
|
||||
result = request.GET.first(b"result", b"success")
|
||||
if result == b"css":
|
||||
time.sleep(3)
|
||||
headers = [("Content-Type", "text/css")]
|
||||
body = ""
|
||||
headers = [(b"Content-Type", b"text/css")]
|
||||
body = u""
|
||||
else:
|
||||
time.sleep(2)
|
||||
|
||||
body = """
|
||||
body = u"""
|
||||
fetch('exec');
|
||||
console.log('exec');
|
||||
if (!window.readyToEvaluate) {
|
||||
|
@ -21,9 +21,9 @@ def main(request, response):
|
|||
window.didExecute = "executed";
|
||||
}
|
||||
"""
|
||||
if result == "parse-error":
|
||||
body = "1=2 parse error;"
|
||||
if result == "fetch-error":
|
||||
return 404, [('Content-Type', 'text/plain')], """window.didExecute = "fetch error";"""
|
||||
if result == b"parse-error":
|
||||
body = u"1=2 parse error;"
|
||||
if result == b"fetch-error":
|
||||
return 404, [(b'Content-Type', b'text/plain')], u"""window.didExecute = "fetch error";"""
|
||||
|
||||
return headers, body
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
def main(request, response):
|
||||
origin = request.headers.get("origin")
|
||||
origin = request.headers.get(b"origin")
|
||||
|
||||
if origin is not None:
|
||||
response.headers.set("Access-Control-Allow-Origin", origin)
|
||||
response.headers.set("Access-Control-Allow-Methods", "GET")
|
||||
response.headers.set("Access-Control-Allow-Credentials", "true")
|
||||
response.headers.set(b"Access-Control-Allow-Origin", origin)
|
||||
response.headers.set(b"Access-Control-Allow-Methods", b"GET")
|
||||
response.headers.set(b"Access-Control-Allow-Credentials", b"true")
|
||||
|
||||
if request.method == "OPTIONS":
|
||||
return ""
|
||||
if request.method == u"OPTIONS":
|
||||
return u""
|
||||
|
||||
headers = [("Content-Type", "text/javascript")]
|
||||
milk = request.cookies.first("milk", None)
|
||||
headers = [(b"Content-Type", b"text/javascript")]
|
||||
milk = request.cookies.first(b"milk", None)
|
||||
|
||||
if milk is None:
|
||||
return headers, "var included = false;"
|
||||
elif milk.value == "yes":
|
||||
return headers, "var included = true;"
|
||||
return headers, u"var included = false;"
|
||||
elif milk.value == b"yes":
|
||||
return headers, u"var included = true;"
|
||||
|
||||
return headers, "var included = false;"
|
||||
return headers, u"var included = false;"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue