summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-ui/tools/appearance-build-webkit-reftests.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-ui/tools/appearance-build-webkit-reftests.py
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-ui/tools/appearance-build-webkit-reftests.py')
-rwxr-xr-xtesting/web-platform/tests/css/css-ui/tools/appearance-build-webkit-reftests.py28
1 files changed, 28 insertions, 0 deletions
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'<link rel="(mis)?match"')
+
+files = {}
+
+parentdir = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir))
+assert parentdir.endswith('/css-ui')
+
+for filename in os.listdir(parentdir):
+ path = os.path.join(parentdir, filename)
+ if os.path.isfile(path) and re_testname.search(filename) and not filename in files:
+ with open(path, "r") as file:
+ files[filename] = file.read()
+
+warning = """<!-- DO NOT EDIT THIS FILE.
+Edit the appearance-* file instead and then run:
+ ./tools/appearance-build-webkit-reftests.py
+-->
+"""
+
+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:"))