summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/tools/ci/interfaces_update.sh
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/tools/ci/interfaces_update.sh
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/tools/ci/interfaces_update.sh')
-rwxr-xr-xtesting/web-platform/tests/tools/ci/interfaces_update.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/web-platform/tests/tools/ci/interfaces_update.sh b/testing/web-platform/tests/tools/ci/interfaces_update.sh
new file mode 100755
index 0000000000..6bf7c7c712
--- /dev/null
+++ b/testing/web-platform/tests/tools/ci/interfaces_update.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+set -eux -o pipefail
+
+SCRIPT_DIR=$(cd $(dirname "$0") && pwd -P)
+WPT_ROOT=$SCRIPT_DIR/../..
+
+main () {
+ # Find the latest version of the package to install.
+ VERSION=$(npm info @webref/idl version)
+
+ # Install @webref/idl in a temporary directory.
+ TMPDIR=$(mktemp -d)
+ cd $TMPDIR
+ npm install @webref/idl@$VERSION
+
+ # Delete interfaces/*.idl except tentative ones
+ cd $WPT_ROOT
+ find interfaces/ -name '*.idl' -not -name '*.tentative.idl' -delete
+
+ # Handle cssom.idl with preamble first.
+ cat <<EOF > interfaces/cssom.idl
+// GENERATED PREAMBLE - DO NOT EDIT
+// CSSOMString is an implementation-defined type of either DOMString or
+// USVString in CSSOM: https://drafts.csswg.org/cssom/#cssomstring-type
+// For web-platform-tests, use DOMString because USVString has additional
+// requirements in type conversion and could result in spurious failures for
+// implementations that use DOMString.
+typedef DOMString CSSOMString;
+
+EOF
+ cat $TMPDIR/node_modules/@webref/idl/cssom.idl >> interfaces/cssom.idl
+ rm $TMPDIR/node_modules/@webref/idl/cssom.idl
+
+ # Move remaining *.idl from @webref/idl to interfaces/
+ mv $TMPDIR/node_modules/@webref/idl/*.idl interfaces/
+
+ # Cleanup
+ rm -rf $TMPDIR
+
+ if [ -n "$GITHUB_ENV" ]; then
+ echo webref_idl_version=$VERSION >> $GITHUB_ENV
+ fi
+}
+
+main