From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../tools/appearance-build-webkit-reftests.py | 28 +++++ .../build-compute-kind-widget-fallback-props.py | 122 +++++++++++++++++++++ 2 files changed, 150 insertions(+) create mode 100755 testing/web-platform/tests/css/css-ui/tools/appearance-build-webkit-reftests.py create mode 100644 testing/web-platform/tests/css/css-ui/tools/build-compute-kind-widget-fallback-props.py (limited to 'testing/web-platform/tests/css/css-ui/tools') diff --git a/testing/web-platform/tests/css/css-ui/tools/appearance-build-webkit-reftests.py b/testing/web-platform/tests/css/css-ui/tools/appearance-build-webkit-reftests.py new file mode 100755 index 0000000000..010635dddc --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/tools/appearance-build-webkit-reftests.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +import os +import re + +re_testname = re.compile(r"^appearance-.+\d\d\d\.html$") +re_link_match = re.compile(r' +""" + +for filename, text in files.items(): + if re_link_match.search(text): + with open(os.path.join(parentdir, filename.replace("appearance-", "webkit-appearance-")), "w") as outfile: + outfile.write(warning + text.replace("appearance:", "-webkit-appearance:")) diff --git a/testing/web-platform/tests/css/css-ui/tools/build-compute-kind-widget-fallback-props.py b/testing/web-platform/tests/css/css-ui/tools/build-compute-kind-widget-fallback-props.py new file mode 100644 index 0000000000..baede8ee54 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/tools/build-compute-kind-widget-fallback-props.py @@ -0,0 +1,122 @@ +#!/usr/bin/env python3 +import os, shutil + +target_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + "/compute-kind-widget-generated" + +props = [ + u"background-color", + u"border-top-color", + u"border-top-style", + u"border-top-width", + u"border-right-color", + u"border-right-style", + u"border-right-width", + u"border-bottom-color", + u"border-bottom-style", + u"border-bottom-width", + u"border-left-color", + u"border-left-style", + u"border-left-width", + u"border-block-start-color", + u"border-block-end-color", + u"border-inline-start-color", + u"border-inline-end-color", + u"border-block-start-style", + u"border-block-end-style", + u"border-inline-start-style", + u"border-inline-end-style", + u"border-block-start-width", + u"border-block-end-width", + u"border-inline-start-width", + u"border-inline-end-width", + u"background-image", + u"background-attachment", + u"background-position", + u"background-clip", + u"background-origin", + u"background-size", + u"border-image-source", + u"border-image-slice", + u"border-image-width", + u"border-image-outset", + u"border-image-repeat", + u"border-top-left-radius", + u"border-top-right-radius", + u"border-bottom-right-radius", + u"border-bottom-left-radius", + u"border-start-start-radius", + u"border-start-end-radius", + u"border-end-start-radius", + u"border-end-end-radius", +] + +els = [ + [u'link', u'a'], + [u'button', u''], + [u'input-button', u''], + [u'input-submit', u''], + [u'input-reset', u''], + [u'input-text', u''], + [u'input-search-text', u''], + [u'input-search', u''], + [u'range', u''], + [u'checkbox-input', u''], + [u'radio-input', u''], + [u'color-input', u''], + [u'textarea', u''], + [u'select-listbox', u''], + [u'select-dropdown-box', u''], + [u'select-menulist-button', u''], + [u'meter', u''], + [u'progress', u''], +] + +template = u""" + + +CSS Basic User Interface Test: Compute kind of widget: {prop} disables native appearance for {el_id} + + + + + +
+ {el_markup} +
+ + +""" + +# Generate tests + +# wipe target_dir +if os.path.isdir(target_dir): + shutil.rmtree(target_dir) + +def write_file(path, content): + path = os.path.join(target_dir, path) + os.makedirs(os.path.dirname(path), exist_ok=True) + file = open(os.path.join(target_dir, path), 'w') + file.write(content) + file.close() + +def generate_tests(prop, el_id, el_markup): + test = template.format(prop=prop, el_id=el_id, el_markup=el_markup) + write_file(f"kind-of-widget-fallback-{el_id}-{prop}-001.html", test) + +for prop in props: + for el_id, el_markup in els: + generate_tests(prop, el_id, el_markup) -- cgit v1.2.3