} sourceContextList
+
+ @returns {Promise} A promise that is resolved with an RequestResult object.
+ `sourceContextUrl` is always set. For whether other properties are set,
+ see the comments for requestVia*() above.
+*/
+function invokeRequest(subresource, sourceContextList) {
+ if (sourceContextList.length === 0) {
+ // No further nested global objects. Send the subresource request here.
+
+ const additionalAttributes = {};
+ /** @type {PolicyDelivery} policyDelivery */
+ for (const policyDelivery of (subresource.policyDeliveries || [])) {
+ // Depending on the delivery method, extend the subresource element with
+ // these attributes.
+ if (policyDelivery.deliveryType === "attr") {
+ additionalAttributes[policyDelivery.key] = policyDelivery.value;
+ } else if (policyDelivery.deliveryType === "rel-noref") {
+ additionalAttributes["rel"] = "noreferrer";
+ }
+ }
+
+ return subresourceMap[subresource.subresourceType].invoker(
+ subresource.url,
+ additionalAttributes)
+ .then(result => Object.assign(
+ {sourceContextUrl: location.toString()},
+ result));
+ }
+
+ // Defines invokers for each valid SourceContext.sourceContextType.
+ const sourceContextMap = {
+ "srcdoc": { //
+ invoker: invokeFromIframe,
+ },
+ "iframe": { //
+ invoker: invokeFromIframe,
+ },
+ };
+
+ return sourceContextMap[sourceContextList[0].sourceContextType].invoker(
+ subresource, sourceContextList);
+}
+
+/**
+ invokeFrom*() functions are helper functions with the same parameters
+ and return values as invokeRequest(), that are tied to specific types
+ of top-most environment settings objects.
+ For example, invokeFromIframe() is the helper function for the cases where
+ sourceContextList[0] is an iframe.
+*/
+
+function invokeFromIframe(subresource, sourceContextList) {
+ const currentSourceContext = sourceContextList.shift();
+ const frameUrl =
+ "/common/security-features/scope/document.py?policyDeliveries=" +
+ encodeURIComponent(JSON.stringify(
+ currentSourceContext.policyDeliveries || []));
+
+ let promise;
+ if (currentSourceContext.sourceContextType === 'srcdoc') {
+ promise = fetch(frameUrl)
+ .then(r => r.text())
+ .then(srcdoc => {
+ return createElement("iframe", {srcdoc: srcdoc}, document.body, true);
+ });
+ } else if (currentSourceContext.sourceContextType === 'iframe') {
+ promise = Promise.resolve(
+ createElement("iframe", {src: frameUrl}, document.body, true));
+ }
+
+ return promise
+ .then(iframe => {
+ return iframe.eventPromise
+ .then(() => {
+ const promise = bindEvents2(
+ window, "message", iframe, "error", window, "error");
+ iframe.contentWindow.postMessage(
+ {subresource: subresource,
+ sourceContextList: sourceContextList},
+ "*");
+ return promise;
+ })
+ .then(event => {
+ if (event.data.error)
+ return Promise.reject(event.data.error);
+ return event.data;
+ });
+ });
+}
+
// SanityChecker does nothing in release mode. See sanity-checker.js for debug
// mode.
function SanityChecker() {}
diff --git a/tests/wpt/web-platform-tests/common/security-features/scope/document.py b/tests/wpt/web-platform-tests/common/security-features/scope/document.py
new file mode 100644
index 00000000000..3fc61a1e7ba
--- /dev/null
+++ b/tests/wpt/web-platform-tests/common/security-features/scope/document.py
@@ -0,0 +1,35 @@
+import os, sys, json
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+import util
+
+
+def main(request, response):
+ policyDeliveries = json.loads(request.GET.first("policyDeliveries", "[]"))
+ maybe_additional_headers = {}
+ meta = ''
+ error = ''
+ for delivery in policyDeliveries:
+ if delivery['deliveryType'] == 'meta':
+ if delivery['key'] == 'referrerPolicy':
+ meta += '' % delivery['value']
+ else:
+ error = 'invalid delivery key'
+ elif delivery['deliveryType'] == 'http-rp':
+ if delivery['key'] == 'referrerPolicy':
+ maybe_additional_headers['Referrer-Policy'] = delivery['value']
+ else:
+ error = 'invalid delivery key'
+ else:
+ error = 'invalid deliveryType'
+
+ handler = lambda: util.get_template("document.html.template") % ({
+ "meta": meta,
+ "error": error
+ })
+ util.respond(
+ request,
+ response,
+ payload_generator=handler,
+ content_type="text/html",
+ maybe_additional_headers=maybe_additional_headers)
diff --git a/tests/wpt/web-platform-tests/common/security-features/scope/template/document.html.template b/tests/wpt/web-platform-tests/common/security-features/scope/template/document.html.template
new file mode 100644
index 00000000000..feccb69e9de
--- /dev/null
+++ b/tests/wpt/web-platform-tests/common/security-features/scope/template/document.html.template
@@ -0,0 +1,30 @@
+
+
+
+ %(meta)s
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/common/security-features/scope/util.py b/tests/wpt/web-platform-tests/common/security-features/scope/util.py
new file mode 100644
index 00000000000..42f8326b36a
--- /dev/null
+++ b/tests/wpt/web-platform-tests/common/security-features/scope/util.py
@@ -0,0 +1,42 @@
+import os
+
+
+def get_template(template_basename):
+ script_directory = os.path.dirname(os.path.abspath(__file__))
+ template_directory = os.path.abspath(
+ os.path.join(script_directory, "template"))
+ template_filename = os.path.join(template_directory, template_basename)
+
+ with open(template_filename, "r") as f:
+ return f.read()
+
+
+def __noop(request, response):
+ return ""
+
+
+def respond(request,
+ response,
+ status_code=200,
+ content_type="text/html",
+ payload_generator=__noop,
+ cache_control="no-cache; must-revalidate",
+ access_control_allow_origin="*",
+ maybe_additional_headers=None):
+ response.add_required_headers = False
+ response.writer.write_status(status_code)
+
+ if access_control_allow_origin != None:
+ response.writer.write_header("access-control-allow-origin",
+ access_control_allow_origin)
+ response.writer.write_header("content-type", content_type)
+ response.writer.write_header("cache-control", cache_control)
+
+ additional_headers = maybe_additional_headers or {}
+ for header, value in additional_headers.items():
+ response.writer.write_header(header, value)
+
+ response.writer.end_headers()
+
+ payload = payload_generator()
+ response.writer.write(payload)
diff --git a/tests/wpt/web-platform-tests/common/security-features/tools/generate.py b/tests/wpt/web-platform-tests/common/security-features/tools/generate.py
new file mode 100644
index 00000000000..50c3a2c250c
--- /dev/null
+++ b/tests/wpt/web-platform-tests/common/security-features/tools/generate.py
@@ -0,0 +1,189 @@
+from __future__ import print_function
+
+import copy
+import os, sys, json
+import spec_validator
+import argparse
+import util
+
+
+def expand_pattern(expansion_pattern, test_expansion_schema):
+ expansion = {}
+ for artifact_key in expansion_pattern:
+ artifact_value = expansion_pattern[artifact_key]
+ if artifact_value == '*':
+ expansion[artifact_key] = test_expansion_schema[artifact_key]
+ elif isinstance(artifact_value, list):
+ expansion[artifact_key] = artifact_value
+ elif isinstance(artifact_value, dict):
+ # Flattened expansion.
+ expansion[artifact_key] = []
+ values_dict = expand_pattern(artifact_value,
+ test_expansion_schema[artifact_key])
+ for sub_key in values_dict.keys():
+ expansion[artifact_key] += values_dict[sub_key]
+ else:
+ expansion[artifact_key] = [artifact_value]
+
+ return expansion
+
+
+def permute_expansion(expansion, artifact_order, selection = {}, artifact_index = 0):
+ assert isinstance(artifact_order, list), "artifact_order should be a list"
+
+ if artifact_index >= len(artifact_order):
+ yield selection
+ return
+
+ artifact_key = artifact_order[artifact_index]
+
+ for artifact_value in expansion[artifact_key]:
+ selection[artifact_key] = artifact_value
+ for next_selection in permute_expansion(expansion,
+ artifact_order,
+ selection,
+ artifact_index + 1):
+ yield next_selection
+
+
+def generate_selection(config, selection, spec, test_html_template_basename):
+ # TODO: Refactor out this referrer-policy-specific part.
+ if 'referrer_policy' in spec:
+ # Oddball: it can be None, so in JS it's null.
+ selection['referrer_policy'] = spec['referrer_policy']
+
+ test_parameters = json.dumps(selection, indent=2, separators=(',', ':'))
+ # Adjust the template for the test invoking JS. Indent it to look nice.
+ indent = "\n" + " " * 8
+ test_parameters = test_parameters.replace("\n", indent)
+
+ selection['test_js'] = '''
+ %s(
+ %s,
+ document.querySelector("meta[name=assert]").content,
+ new SanityChecker()
+ ).start();
+ ''' % (config.test_case_name, test_parameters)
+
+ selection['spec_name'] = spec['name']
+ selection['test_page_title'] = config.test_page_title_template % spec['title']
+ selection['spec_description'] = spec['description']
+ selection['spec_specification_url'] = spec['specification_url']
+ selection['helper_js'] = config.helper_js
+ selection['sanity_checker_js'] = config.sanity_checker_js
+ selection['spec_json_js'] = config.spec_json_js
+
+ test_filename = os.path.join(config.spec_directory, config.test_file_path_pattern % selection)
+ test_headers_filename = test_filename + ".headers"
+ test_directory = os.path.dirname(test_filename)
+
+ test_html_template = util.get_template(test_html_template_basename)
+ disclaimer_template = util.get_template('disclaimer.template')
+
+ html_template_filename = os.path.join(util.template_directory,
+ test_html_template_basename)
+ generated_disclaimer = disclaimer_template \
+ % {'generating_script_filename': os.path.relpath(__file__,
+ util.test_root_directory),
+ 'html_template_filename': os.path.relpath(html_template_filename,
+ util.test_root_directory)}
+
+ # Adjust the template for the test invoking JS. Indent it to look nice.
+ selection['generated_disclaimer'] = generated_disclaimer.rstrip()
+ selection['test_description'] = config.test_description_template % selection
+ selection['test_description'] = \
+ selection['test_description'].rstrip().replace("\n", "\n" + " " * 33)
+
+ # Directory for the test files.
+ try:
+ os.makedirs(test_directory)
+ except:
+ pass
+
+ delivery = config.handleDelivery(selection, spec)
+
+ if len(delivery['headers']) > 0:
+ with open(test_headers_filename, "w") as f:
+ for header in delivery['headers']:
+ f.write(header)
+ f.write('\n')
+
+ selection['meta_delivery_method'] = delivery['meta']
+ # Obey the lint and pretty format.
+ if len(selection['meta_delivery_method']) > 0:
+ selection['meta_delivery_method'] = "\n " + \
+ selection['meta_delivery_method']
+
+ # Write out the generated HTML file.
+ util.write_file(test_filename, test_html_template % selection)
+
+
+def generate_test_source_files(config, spec_json, target):
+ test_expansion_schema = spec_json['test_expansion_schema']
+ specification = spec_json['specification']
+
+ spec_json_js_template = util.get_template('spec_json.js.template')
+ generated_spec_json_filename = os.path.join(config.spec_directory, "spec_json.js")
+ util.write_file(generated_spec_json_filename,
+ spec_json_js_template % {'spec_json': json.dumps(spec_json)})
+
+ # Choose a debug/release template depending on the target.
+ html_template = "test.%s.html.template" % target
+
+ artifact_order = test_expansion_schema.keys() + ['name']
+ artifact_order.remove('expansion')
+
+ # Create list of excluded tests.
+ exclusion_dict = {}
+ for excluded_pattern in spec_json['excluded_tests']:
+ excluded_expansion = \
+ expand_pattern(excluded_pattern, test_expansion_schema)
+ for excluded_selection in permute_expansion(excluded_expansion,
+ artifact_order):
+ excluded_selection_path = config.selection_pattern % excluded_selection
+ exclusion_dict[excluded_selection_path] = True
+
+ for spec in specification:
+ # Used to make entries with expansion="override" override preceding
+ # entries with the same |selection_path|.
+ output_dict = {}
+
+ for expansion_pattern in spec['test_expansion']:
+ expansion = expand_pattern(expansion_pattern, test_expansion_schema)
+ for selection in permute_expansion(expansion, artifact_order):
+ selection_path = config.selection_pattern % selection
+ if not selection_path in exclusion_dict:
+ if selection_path in output_dict:
+ if expansion_pattern['expansion'] != 'override':
+ print("Error: %s's expansion is default but overrides %s" % (selection['name'], output_dict[selection_path]['name']))
+ sys.exit(1)
+ output_dict[selection_path] = copy.deepcopy(selection)
+ else:
+ print('Excluding selection:', selection_path)
+
+ for selection_path in output_dict:
+ selection = output_dict[selection_path]
+ generate_selection(config,
+ selection,
+ spec,
+ html_template)
+
+
+def main(config):
+ parser = argparse.ArgumentParser(description='Test suite generator utility')
+ parser.add_argument('-t', '--target', type = str,
+ choices = ("release", "debug"), default = "release",
+ help = 'Sets the appropriate template for generating tests')
+ parser.add_argument('-s', '--spec', type = str, default = None,
+ help = 'Specify a file used for describing and generating the tests')
+ # TODO(kristijanburnik): Add option for the spec_json file.
+ args = parser.parse_args()
+
+ if args.spec:
+ config.spec_directory = args.spec
+
+ spec_filename = os.path.join(config.spec_directory, "spec.src.json")
+ spec_json = util.load_spec_json(spec_filename)
+ spec_validator.assert_valid_spec_json(spec_json)
+
+ generate_test_source_files(config, spec_json, args.target)
diff --git a/tests/wpt/web-platform-tests/mixed-content/generic/template/disclaimer.template b/tests/wpt/web-platform-tests/common/security-features/tools/template/disclaimer.template
similarity index 100%
rename from tests/wpt/web-platform-tests/mixed-content/generic/template/disclaimer.template
rename to tests/wpt/web-platform-tests/common/security-features/tools/template/disclaimer.template
diff --git a/tests/wpt/web-platform-tests/mixed-content/generic/template/spec_json.js.template b/tests/wpt/web-platform-tests/common/security-features/tools/template/spec_json.js.template
similarity index 100%
rename from tests/wpt/web-platform-tests/mixed-content/generic/template/spec_json.js.template
rename to tests/wpt/web-platform-tests/common/security-features/tools/template/spec_json.js.template
diff --git a/tests/wpt/web-platform-tests/referrer-policy/generic/template/test.release.html.template b/tests/wpt/web-platform-tests/common/security-features/tools/template/test.debug.html.template
similarity index 50%
rename from tests/wpt/web-platform-tests/referrer-policy/generic/template/test.release.html.template
rename to tests/wpt/web-platform-tests/common/security-features/tools/template/test.debug.html.template
index e55a50bdc41..7d4a9f12664 100644
--- a/tests/wpt/web-platform-tests/referrer-policy/generic/template/test.release.html.template
+++ b/tests/wpt/web-platform-tests/common/security-features/tools/template/test.debug.html.template
@@ -2,15 +2,20 @@
%(generated_disclaimer)s
- Referrer-Policy: %(spec_title)s
- %(meta_delivery_method)s
+ %(test_page_title)s
+
+
-
+ %(meta_delivery_method)s
-
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/mixed-content/generic/template/test.release.html.template b/tests/wpt/web-platform-tests/common/security-features/tools/template/test.release.html.template
similarity index 73%
rename from tests/wpt/web-platform-tests/mixed-content/generic/template/test.release.html.template
rename to tests/wpt/web-platform-tests/common/security-features/tools/template/test.release.html.template
index 188e32fde4b..091f59be90d 100644
--- a/tests/wpt/web-platform-tests/mixed-content/generic/template/test.release.html.template
+++ b/tests/wpt/web-platform-tests/common/security-features/tools/template/test.release.html.template
@@ -2,16 +2,16 @@
%(generated_disclaimer)s
- Mixed-Content: %(spec_title)s
+ %(test_page_title)s
- %(meta_opt_in)s
+ %(meta_delivery_method)s
-
+
diff --git a/tests/wpt/web-platform-tests/referrer-policy/generic/tools/common_paths.py b/tests/wpt/web-platform-tests/common/security-features/tools/util.py
similarity index 60%
rename from tests/wpt/web-platform-tests/referrer-policy/generic/tools/common_paths.py
rename to tests/wpt/web-platform-tests/common/security-features/tools/util.py
index 1066fb5bb23..77b89769ca2 100644
--- a/tests/wpt/web-platform-tests/referrer-policy/generic/tools/common_paths.py
+++ b/tests/wpt/web-platform-tests/common/security-features/tools/util.py
@@ -3,27 +3,11 @@ from __future__ import print_function
import os, sys, json, re
script_directory = os.path.dirname(os.path.abspath(__file__))
-generic_directory = os.path.abspath(os.path.join(script_directory, '..'))
-
template_directory = os.path.abspath(os.path.join(script_directory,
- '..',
'template'))
-spec_directory = os.path.abspath(os.path.join(script_directory, '..', '..'))
test_root_directory = os.path.abspath(os.path.join(script_directory,
'..', '..', '..'))
-spec_filename = os.path.join(spec_directory, "spec.src.json")
-generated_spec_json_filename = os.path.join(spec_directory, "spec_json.js")
-
-selection_pattern = '%(delivery_method)s/' + \
- '%(origin)s/' + \
- '%(source_protocol)s-%(target_protocol)s/' + \
- '%(subresource)s/' + \
- '%(redirection)s/'
-
-test_file_path_pattern = '%(spec_name)s/' + selection_pattern + \
- '%(name)s.%(source_protocol)s.html'
-
def get_template(basename):
with open(os.path.join(template_directory, basename), "r") as f:
@@ -42,10 +26,7 @@ def read_nth_line(fp, line_number):
return line
-def load_spec_json(path_to_spec = None):
- if path_to_spec is None:
- path_to_spec = spec_filename
-
+def load_spec_json(path_to_spec):
re_error_location = re.compile('line ([0-9]+) column ([0-9]+)')
with open(path_to_spec, "r") as f:
try:
diff --git a/tests/wpt/web-platform-tests/css/CSS2/floats-clear/adjoining-float-nested-forced-clearance.html b/tests/wpt/web-platform-tests/css/CSS2/floats-clear/adjoining-float-nested-forced-clearance.html
new file mode 100644
index 00000000000..426b47537bf
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/CSS2/floats-clear/adjoining-float-nested-forced-clearance.html
@@ -0,0 +1,15 @@
+
+
+
+Test passes if there is a filled green square and no red.
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/CSS2/selectors/first-letter-punctuation-184-ref.xht b/tests/wpt/web-platform-tests/css/CSS2/selectors/first-letter-punctuation-184-ref.xht
deleted file mode 100644
index a3a002927a5..00000000000
--- a/tests/wpt/web-platform-tests/css/CSS2/selectors/first-letter-punctuation-184-ref.xht
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
- CSS Reference: Green 'canadian syllabics chi sign' punctuation character
-
-
-
- Test passes if the "T" and surrounding punctuation below are green.
- ᙭T᙭est
-
-
diff --git a/tests/wpt/web-platform-tests/css/CSS2/selectors/first-letter-punctuation-184.xht b/tests/wpt/web-platform-tests/css/CSS2/selectors/first-letter-punctuation-184.xht
deleted file mode 100644
index ba4755c1ba8..00000000000
--- a/tests/wpt/web-platform-tests/css/CSS2/selectors/first-letter-punctuation-184.xht
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
- CSS Test: First-letter with the 'canadian syllabics chi sign' punctuation character
-
-
-
-
-
-
-
-
- Test passes if the "T" and surrounding punctuation below are green.
- ᙭T᙭est
-
-
diff --git a/tests/wpt/web-platform-tests/css/CSS2/ui/outline-applies-to-016-ref.xht b/tests/wpt/web-platform-tests/css/CSS2/ui/outline-applies-to-016-ref.xht
new file mode 100644
index 00000000000..2ec1fb0447c
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/CSS2/ui/outline-applies-to-016-ref.xht
@@ -0,0 +1,24 @@
+
+
+
+ CSS Test Reference
+
+
+
+ Test passes if there is a blue box below.
+
+
![]()
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/CSS2/ui/outline-applies-to-016.xht b/tests/wpt/web-platform-tests/css/CSS2/ui/outline-applies-to-016.xht
new file mode 100644
index 00000000000..89ba125e511
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/CSS2/ui/outline-applies-to-016.xht
@@ -0,0 +1,30 @@
+
+
+
+ CSS Test: Outline applied to replaced element with display table-column-group
+
+
+
+
+
+
+
+
+ Test passes if there is a blue box below.
+
+
![]()
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/CSS2/ui/outline-applies-to-017.xht b/tests/wpt/web-platform-tests/css/CSS2/ui/outline-applies-to-017.xht
new file mode 100644
index 00000000000..d209d658650
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/CSS2/ui/outline-applies-to-017.xht
@@ -0,0 +1,30 @@
+
+
+
+ CSS Test: Outline applied to replaced element with display table-column
+
+
+
+
+
+
+
+
+ Test passes if there is a blue box below.
+
+
![]()
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-animations/Document-getAnimations.tentative.html b/tests/wpt/web-platform-tests/css/css-animations/Document-getAnimations.tentative.html
index c11b0a90876..175acf84246 100644
--- a/tests/wpt/web-platform-tests/css/css-animations/Document-getAnimations.tentative.html
+++ b/tests/wpt/web-platform-tests/css/css-animations/Document-getAnimations.tentative.html
@@ -18,12 +18,6 @@
@keyframes animRight {
to { right: 100px }
}
-::before {
- content: ''
-}
-::after {
- content: ''
-}
diff --git a/tests/wpt/web-platform-tests/css/css-animations/animationevent-marker-pseudoelement.html b/tests/wpt/web-platform-tests/css/css-animations/animationevent-marker-pseudoelement.html
new file mode 100644
index 00000000000..90c7b86ab9d
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-animations/animationevent-marker-pseudoelement.html
@@ -0,0 +1,35 @@
+
+
+CSS Animations Test: AnimationEvent pseudoElement
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-animations/event-order.tentative.html b/tests/wpt/web-platform-tests/css/css-animations/event-order.tentative.html
index 93d452ace07..f4f9e29a3c8 100644
--- a/tests/wpt/web-platform-tests/css/css-animations/event-order.tentative.html
+++ b/tests/wpt/web-platform-tests/css/css-animations/event-order.tentative.html
@@ -6,10 +6,14 @@
diff --git a/tests/wpt/web-platform-tests/css/css-display/display-contents-shadow-dom-1-ref.html b/tests/wpt/web-platform-tests/css/css-display/display-contents-shadow-dom-1-ref.html
new file mode 100644
index 00000000000..df3aaf33740
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-display/display-contents-shadow-dom-1-ref.html
@@ -0,0 +1,48 @@
+
+
+
+
+ Reference: CSS display:contents; in Shadow DOM
+
+
+
+
+ X 1 c
+ a 2 c
+ a 3 Y
+ X 4 Y
+ a 5 Y
+ X 6 c
+ a 7 c
+ a 8 Y
+ X 9 Y
+ a A Y
+ a 1 2 B
+ A a 1 2 c B
+ A a 1 a 2 ca 3 c B
+ A a 1 c a 2 c B
+ X a 1 c a 2 c B
+ 1a 2 c
+ a 1 c2
+ Abc
+ Abc
+ b cd
+ a b
+ OneTwo
+ OneTwo
+ OneTwo
+ OneTwo
+ OneTwoThree
+
+ V
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-display/display-contents-shadow-dom-1.html b/tests/wpt/web-platform-tests/css/css-display/display-contents-shadow-dom-1.html
new file mode 100644
index 00000000000..1f391163da0
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-display/display-contents-shadow-dom-1.html
@@ -0,0 +1,221 @@
+
+
+
+
+
+ CSS Test: CSS display:contents; in Shadow DOM
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TwoOne
+ TwoOne
+ TwoOne
+ TwoOne
+ TwoOne
Three
+ S
+ T
+ U
+ V
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-fonts/quoted-generic-ignored-ref.html b/tests/wpt/web-platform-tests/css/css-fonts/quoted-generic-ignored-ref.html
new file mode 100644
index 00000000000..70e2d50cd83
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-fonts/quoted-generic-ignored-ref.html
@@ -0,0 +1,20 @@
+
+
+
+
+CSS Reference: quoted font-family names must not be treated as generics
+
+
+
+The following lines should be rendered with the generic font-families as named:
+serif
+sans-serif
+monospace
+serif
+sans-serif
+monospace
diff --git a/tests/wpt/web-platform-tests/css/css-fonts/quoted-generic-ignored.html b/tests/wpt/web-platform-tests/css/css-fonts/quoted-generic-ignored.html
new file mode 100644
index 00000000000..4207ad5cf43
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-fonts/quoted-generic-ignored.html
@@ -0,0 +1,29 @@
+
+
+
+
+CSS Test: quoted font-family names must not be treated as generics
+
+
+
+
+
+
+
+The following lines should be rendered with the generic font-families as named:
+serif
+sans-serif
+monospace
+serif
+sans-serif
+monospace
diff --git a/tests/wpt/web-platform-tests/css/css-grid/grid-layout-properties.html b/tests/wpt/web-platform-tests/css/css-grid/grid-layout-properties.html
index fcc2ce3b88d..b1b0bd87d49 100644
--- a/tests/wpt/web-platform-tests/css/css-grid/grid-layout-properties.html
+++ b/tests/wpt/web-platform-tests/css/css-grid/grid-layout-properties.html
@@ -142,8 +142,8 @@
initial: 'row',
'row': ['row', 'row'],
'column': ['column', 'column'],
- 'dense': ['dense', 'row dense'],
- 'row dense': ['row dense', 'row dense'],
+ 'dense': ['dense', 'dense'],
+ 'row dense': ['dense', 'dense'],
'column dense': ['column dense', 'column dense'],
'reset': ['row', 'row'],
},
diff --git a/tests/wpt/web-platform-tests/css/css-grid/parsing/grid-auto-flow-computed.html b/tests/wpt/web-platform-tests/css/css-grid/parsing/grid-auto-flow-computed.html
index 7484f62ddb6..a91593efc1b 100644
--- a/tests/wpt/web-platform-tests/css/css-grid/parsing/grid-auto-flow-computed.html
+++ b/tests/wpt/web-platform-tests/css/css-grid/parsing/grid-auto-flow-computed.html
@@ -13,13 +13,13 @@
diff --git a/tests/wpt/web-platform-tests/css/css-grid/parsing/grid-auto-flow-valid.html b/tests/wpt/web-platform-tests/css/css-grid/parsing/grid-auto-flow-valid.html
index 4270a3df933..7db8b189a28 100644
--- a/tests/wpt/web-platform-tests/css/css-grid/parsing/grid-auto-flow-valid.html
+++ b/tests/wpt/web-platform-tests/css/css-grid/parsing/grid-auto-flow-valid.html
@@ -14,11 +14,11 @@
diff --git a/tests/wpt/web-platform-tests/css/css-lists/li-counter-increment-computed-style.html b/tests/wpt/web-platform-tests/css/css-lists/li-counter-increment-computed-style.html
new file mode 100644
index 00000000000..0fae6e3f603
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-lists/li-counter-increment-computed-style.html
@@ -0,0 +1,20 @@
+
+Magic list-item counter-increment shouldn't be visible from computed style
+
+
+
+
+
+
+No explicit counter.
+Inherited
+Value attribute.
+Explicit list-item counter.
+Explicit and redundant list-item counter.
+Other counter.
+
diff --git a/tests/wpt/web-platform-tests/css/css-lists/list-item-definition-ref.html b/tests/wpt/web-platform-tests/css/css-lists/list-item-definition-ref.html
index 72a4c90f4ad..2d49bc4cb97 100644
--- a/tests/wpt/web-platform-tests/css/css-lists/list-item-definition-ref.html
+++ b/tests/wpt/web-platform-tests/css/css-lists/list-item-definition-ref.html
@@ -8,4 +8,7 @@
Foo
Bar
+
+
+ Baz
diff --git a/tests/wpt/web-platform-tests/css/css-lists/list-item-definition.html b/tests/wpt/web-platform-tests/css/css-lists/list-item-definition.html
index edae4b96bd9..14e351f9ecd 100644
--- a/tests/wpt/web-platform-tests/css/css-lists/list-item-definition.html
+++ b/tests/wpt/web-platform-tests/css/css-lists/list-item-definition.html
@@ -1,15 +1,27 @@
-The definition of what a list-item is only depends on the display value, and doesn't account for pseudo-elements
+The definition of what a list-item is only depends on the display value
+
-
+
Foo
- Bar
+
- WithBefore
+
- WithAfter
+
- Baz
diff --git a/tests/wpt/web-platform-tests/css/css-multicol/multicol-span-all-children-height-001-ref.html b/tests/wpt/web-platform-tests/css/css-multicol/multicol-span-all-children-height-001-ref.html
new file mode 100644
index 00000000000..e95210fed25
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-multicol/multicol-span-all-children-height-001-ref.html
@@ -0,0 +1,28 @@
+
+
+
+ CSS Multi-column Layout Test Reference: Test a multi-column container with percentage height children
+
+
+
+
+
+
+ block1
+ spanner
+ block2
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-multicol/multicol-span-all-children-height-001.html b/tests/wpt/web-platform-tests/css/css-multicol/multicol-span-all-children-height-001.html
new file mode 100644
index 00000000000..55bdef42788
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-multicol/multicol-span-all-children-height-001.html
@@ -0,0 +1,33 @@
+
+
+
+ CSS Multi-column Layout Test: Test a multi-column container with percentage height children
+
+
+
+
+
+
+
+
+
+ block1
+ spanner
+ block2
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-009-ref.html b/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-009-ref.html
new file mode 100644
index 00000000000..a3db09f0781
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-009-ref.html
@@ -0,0 +1,36 @@
+
+
+
+CSS Reference: ::marker pseudo elements styled with 'content' property
+
+
+
+
+ ABC
D
+ ABC
D
+
+
+
+ ABC
D
+ ABC
D
+
+
+ ABC
D
+ ABC
D
+ ABC
D
+
+
+ ABC
D
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-009.html b/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-009.html
new file mode 100644
index 00000000000..b3627cca755
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-009.html
@@ -0,0 +1,38 @@
+
+
+
+CSS Test: ::marker pseudo elements styled with 'content' property
+
+
+
+
+
+
+ C
D
+ C
D
+
+
+
+ C
D
+ C
D
+
+
+ C
D
+ C
D
+ C
D
+
+
+ C
D
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-010-ref.html b/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-010-ref.html
new file mode 100644
index 00000000000..5bee9bb1794
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-010-ref.html
@@ -0,0 +1,26 @@
+
+
+
+CSS Reference: ::marker pseudo elements styled with 'content' property
+
+
+
+
+ 1.C
D
+ 2.C
D
+
+
+
+ 1.C
D
+ 2.C
D
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-010.html b/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-010.html
new file mode 100644
index 00000000000..ccd377d523d
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-010.html
@@ -0,0 +1,26 @@
+
+
+
+CSS Test: ::marker pseudo elements styled with 'content' property
+
+
+
+
+
+
+ C
D
+ C
D
+
+
+
+ C
D
+ C
D
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-011-ref.html b/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-011-ref.html
new file mode 100644
index 00000000000..62a64a1e5e1
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-011-ref.html
@@ -0,0 +1,36 @@
+
+
+
+CSS Reference: ::marker pseudo elements styled with 'content' property
+
+
+
+
+ ABC
D
+ ABC
D
+
+
+
+ ABC
D
+ ABC
D
+
+
+ ABC
D
+ ABC
D
+ ABC
D
+
+
+ ABC
D
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-011.html b/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-011.html
new file mode 100644
index 00000000000..0cc20b0cdcd
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-pseudo/marker-content-011.html
@@ -0,0 +1,38 @@
+
+
+
+CSS Test: ::marker pseudo elements styled with 'content' property
+
+
+
+
+
+
+ C
D
+ C
D
+
+
+
+ C
D
+ C
D
+
+
+ C
D
+ C
D
+ C
D
+
+
+ C
D
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-scroll-snap/inheritance.html b/tests/wpt/web-platform-tests/css/css-scroll-snap/inheritance.html
index b380cb400f2..2569cf3d8bf 100644
--- a/tests/wpt/web-platform-tests/css/css-scroll-snap/inheritance.html
+++ b/tests/wpt/web-platform-tests/css/css-scroll-snap/inheritance.html
@@ -33,7 +33,7 @@ assert_not_inherited('scroll-padding-right', 'auto', '10px');
assert_not_inherited('scroll-padding-top', 'auto', '10px');
assert_not_inherited('scroll-snap-align', 'none', 'start end');
assert_not_inherited('scroll-snap-stop', 'normal', 'always');
-assert_not_inherited('scroll-snap-type', 'none', 'inline proximity');
+assert_not_inherited('scroll-snap-type', 'none', 'inline');
diff --git a/tests/wpt/web-platform-tests/css/css-scroll-snap/parsing/scroll-snap-type-valid.html b/tests/wpt/web-platform-tests/css/css-scroll-snap/parsing/scroll-snap-type-valid.html
index fde2211f925..59a0cb9ab20 100644
--- a/tests/wpt/web-platform-tests/css/css-scroll-snap/parsing/scroll-snap-type-valid.html
+++ b/tests/wpt/web-platform-tests/css/css-scroll-snap/parsing/scroll-snap-type-valid.html
@@ -20,7 +20,7 @@ test_valid_value("scroll-snap-type", "inline");
test_valid_value("scroll-snap-type", "both");
test_valid_value("scroll-snap-type", "y mandatory");
-test_valid_value("scroll-snap-type", "inline proximity");
+test_valid_value("scroll-snap-type", "inline proximity", "inline"); // The shortest serialization is preferable
diff --git a/tests/wpt/web-platform-tests/css/css-scroll-snap/scroll-padding.html b/tests/wpt/web-platform-tests/css/css-scroll-snap/scroll-padding.html
new file mode 100644
index 00000000000..0c637ed6db2
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-scroll-snap/scroll-padding.html
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-scroll-snap/scroll-snap-type-on-root-element.html b/tests/wpt/web-platform-tests/css/css-scroll-snap/scroll-snap-type-on-root-element.html
new file mode 100644
index 00000000000..c2c413d04bd
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-scroll-snap/scroll-snap-type-on-root-element.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-scroll-snap/scrollTo-scrollBy-snaps.html b/tests/wpt/web-platform-tests/css/css-scroll-snap/scrollTo-scrollBy-snaps.html
index fba38cb703b..48bfb51c2d9 100644
--- a/tests/wpt/web-platform-tests/css/css-scroll-snap/scrollTo-scrollBy-snaps.html
+++ b/tests/wpt/web-platform-tests/css/css-scroll-snap/scrollTo-scrollBy-snaps.html
@@ -3,7 +3,7 @@
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-scroll-snap/snap-to-visible-areas.html b/tests/wpt/web-platform-tests/css/css-scroll-snap/snap-to-visible-areas.html
index 82274344526..3e822db02e6 100644
--- a/tests/wpt/web-platform-tests/css/css-scroll-snap/snap-to-visible-areas.html
+++ b/tests/wpt/web-platform-tests/css/css-scroll-snap/snap-to-visible-areas.html
@@ -40,12 +40,20 @@ div {
top: 800px;
}
+#right-bottom {
+ left: 1800px;
+ top: 1800px;
+ scroll-margin-top: 1000px;
+ scroll-margin-left: 1000px;
+}
+
diff --git a/tests/wpt/web-platform-tests/css/css-scroll-snap/unreachable-snap-positions.html b/tests/wpt/web-platform-tests/css/css-scroll-snap/unreachable-snap-positions.html
new file mode 100644
index 00000000000..ca4f6033cec
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-scroll-snap/unreachable-snap-positions.html
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-shadow-parts/multiple-parts.html b/tests/wpt/web-platform-tests/css/css-shadow-parts/multiple-parts.html
new file mode 100644
index 00000000000..de02a26e164
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-shadow-parts/multiple-parts.html
@@ -0,0 +1,44 @@
+
+
+
+ CSS Shadow Parts - Multiple parts
+
+
+
+
+
+
+
+
+
+
+
+
+ green
+ blue
+ blue
+
+ The following text should match its stated colour:
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-text/line-breaking/line-breaking-015.html b/tests/wpt/web-platform-tests/css/css-text/line-breaking/line-breaking-015.html
new file mode 100644
index 00000000000..aaa1c2ba87b
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-text/line-breaking/line-breaking-015.html
@@ -0,0 +1,16 @@
+
+
+
+CSS Text — line breaking at element boundaries
+
+
+
+
+
+
+The word "unbroken" below should not be broken:
+unbroken
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-text/line-breaking/line-breaking-016.html b/tests/wpt/web-platform-tests/css/css-text/line-breaking/line-breaking-016.html
new file mode 100644
index 00000000000..c600504b4c2
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-text/line-breaking/line-breaking-016.html
@@ -0,0 +1,17 @@
+
+
+
+CSS Text — line breaking at element boundaries
+
+
+
+
+
+
+The word "unbroken" below should not be broken:
+unbroabsoluteken
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-text/line-breaking/line-breaking-017.html b/tests/wpt/web-platform-tests/css/css-text/line-breaking/line-breaking-017.html
new file mode 100644
index 00000000000..36af931b1dc
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-text/line-breaking/line-breaking-017.html
@@ -0,0 +1,17 @@
+
+
+
+CSS Text — line breaking at element boundaries
+
+
+
+
+
+
+The word "unbroken" below should not be broken:
+unbrofloatken
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-text/line-breaking/reference/line-breaking-015-ref.html b/tests/wpt/web-platform-tests/css/css-text/line-breaking/reference/line-breaking-015-ref.html
new file mode 100644
index 00000000000..2837ce0cd7c
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-text/line-breaking/reference/line-breaking-015-ref.html
@@ -0,0 +1,13 @@
+
+
+
+CSS Text — reference file for line-breaking test
+
+
+
+The word "unbroken" below should not be broken:
+unbroken
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-text/line-breaking/reference/line-breaking-016-ref.html b/tests/wpt/web-platform-tests/css/css-text/line-breaking/reference/line-breaking-016-ref.html
new file mode 100644
index 00000000000..e4d30e01158
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-text/line-breaking/reference/line-breaking-016-ref.html
@@ -0,0 +1,14 @@
+
+
+
+CSS Text — reference file for line-breaking test
+
+
+
+The word "unbroken" below should not be broken:
+unbrokenabsolute
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-text/line-breaking/reference/line-breaking-017-ref.html b/tests/wpt/web-platform-tests/css/css-text/line-breaking/reference/line-breaking-017-ref.html
new file mode 100644
index 00000000000..6f94b129d29
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-text/line-breaking/reference/line-breaking-017-ref.html
@@ -0,0 +1,13 @@
+
+
+
+CSS Text — reference file for line-breaking test
+
+
+
+The word "unbroken" below should not be broken:
+unbroken
float
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-text/parsing/text-transform-valid.html b/tests/wpt/web-platform-tests/css/css-text/parsing/text-transform-valid.html
index a40166c37ef..fead45c8b8e 100644
--- a/tests/wpt/web-platform-tests/css/css-text/parsing/text-transform-valid.html
+++ b/tests/wpt/web-platform-tests/css/css-text/parsing/text-transform-valid.html
@@ -22,16 +22,20 @@ test_valid_value("text-transform", "full-size-kana");
test_valid_value("text-transform", "capitalize full-width");
test_valid_value("text-transform", "uppercase full-size-kana");
test_valid_value("text-transform", "full-width full-size-kana");
-test_valid_value("text-transform", "full-width lowercase");
-test_valid_value("text-transform", "full-size-kana capitalize");
-test_valid_value("text-transform", "full-size-kana full-width");
+
+// serialization canonicalizes the order of values: https://drafts.csswg.org/cssom/#serialize-a-css-value
+test_valid_value("text-transform", "full-width lowercase", "lowercase full-width");
+test_valid_value("text-transform", "full-size-kana capitalize", "capitalize full-size-kana");
+test_valid_value("text-transform", "full-size-kana full-width", "full-width full-size-kana");
test_valid_value("text-transform", "capitalize full-width full-size-kana");
-test_valid_value("text-transform", "full-width full-size-kana uppercase");
-test_valid_value("text-transform", "full-size-kana lowercase full-width");
-test_valid_value("text-transform", "lowercase full-size-kana full-width");
-test_valid_value("text-transform", "full-width uppercase full-size-kana");
-test_valid_value("text-transform", "full-size-kana full-width capitalize");
+
+// serialization canonicalizes the order of values
+test_valid_value("text-transform", "full-width full-size-kana uppercase", "uppercase full-width full-size-kana");
+test_valid_value("text-transform", "full-size-kana lowercase full-width", "lowercase full-width full-size-kana");
+test_valid_value("text-transform", "lowercase full-size-kana full-width", "lowercase full-width full-size-kana");
+test_valid_value("text-transform", "full-width uppercase full-size-kana", "uppercase full-width full-size-kana");
+test_valid_value("text-transform", "full-size-kana full-width capitalize", "capitalize full-width full-size-kana");