From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- testing/web-platform/tests/dom/xslt/README.md | 11 +++++ .../web-platform/tests/dom/xslt/externalScript.js | 1 + .../dom/xslt/invalid-output-encoding-crash.html | 26 ++++++++++++ testing/web-platform/tests/dom/xslt/sort-ref.html | 10 +++++ testing/web-platform/tests/dom/xslt/sort.html | 48 ++++++++++++++++++++++ .../tests/dom/xslt/strip-space-crash.xml | 33 +++++++++++++++ ...gment-on-node-from-inactive-document-crash.html | 11 +++++ .../xslt/transformToFragment.tentative.window.js | 39 ++++++++++++++++++ 8 files changed, 179 insertions(+) create mode 100644 testing/web-platform/tests/dom/xslt/README.md create mode 100644 testing/web-platform/tests/dom/xslt/externalScript.js create mode 100644 testing/web-platform/tests/dom/xslt/invalid-output-encoding-crash.html create mode 100644 testing/web-platform/tests/dom/xslt/sort-ref.html create mode 100644 testing/web-platform/tests/dom/xslt/sort.html create mode 100644 testing/web-platform/tests/dom/xslt/strip-space-crash.xml create mode 100644 testing/web-platform/tests/dom/xslt/transformToFragment-on-node-from-inactive-document-crash.html create mode 100644 testing/web-platform/tests/dom/xslt/transformToFragment.tentative.window.js (limited to 'testing/web-platform/tests/dom/xslt') diff --git a/testing/web-platform/tests/dom/xslt/README.md b/testing/web-platform/tests/dom/xslt/README.md new file mode 100644 index 0000000000..ac713ce179 --- /dev/null +++ b/testing/web-platform/tests/dom/xslt/README.md @@ -0,0 +1,11 @@ +# XSLT + +This directory contains tentative tests for [XSLT](https://dom.spec.whatwg.org/#xslt). + +See [whatwg/dom#181](https://github.com/whatwg/dom/issues/181) for getting XSLT +better specified. + +There are additional details on XSLT in HTML: +- [Interactions with XPath and XSLT](https://html.spec.whatwg.org/multipage/infrastructure.html#interactions-with-xpath-and-xslt) +- [Interaction of `script` elements and XSLT](https://html.spec.whatwg.org/multipage/scripting.html#scriptTagXSLT) (non-normative) +- [Interaction of `template` elements with XSLT and XPath](https://html.spec.whatwg.org/multipage/scripting.html#template-XSLT-XPath) (non-normative) diff --git a/testing/web-platform/tests/dom/xslt/externalScript.js b/testing/web-platform/tests/dom/xslt/externalScript.js new file mode 100644 index 0000000000..7a2bf36225 --- /dev/null +++ b/testing/web-platform/tests/dom/xslt/externalScript.js @@ -0,0 +1 @@ +window.externalScript = true; diff --git a/testing/web-platform/tests/dom/xslt/invalid-output-encoding-crash.html b/testing/web-platform/tests/dom/xslt/invalid-output-encoding-crash.html new file mode 100644 index 0000000000..d84bb5b3c3 --- /dev/null +++ b/testing/web-platform/tests/dom/xslt/invalid-output-encoding-crash.html @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/dom/xslt/sort-ref.html b/testing/web-platform/tests/dom/xslt/sort-ref.html new file mode 100644 index 0000000000..163002d0d0 --- /dev/null +++ b/testing/web-platform/tests/dom/xslt/sort-ref.html @@ -0,0 +1,10 @@ + + + + +
+
1
+
2
+
3
+
7
+
diff --git a/testing/web-platform/tests/dom/xslt/sort.html b/testing/web-platform/tests/dom/xslt/sort.html new file mode 100644 index 0000000000..631c3edd6a --- /dev/null +++ b/testing/web-platform/tests/dom/xslt/sort.html @@ -0,0 +1,48 @@ + + + + +
+ + + + + + + diff --git a/testing/web-platform/tests/dom/xslt/strip-space-crash.xml b/testing/web-platform/tests/dom/xslt/strip-space-crash.xml new file mode 100644 index 0000000000..61a906a5e7 --- /dev/null +++ b/testing/web-platform/tests/dom/xslt/strip-space-crash.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/xslt/transformToFragment-on-node-from-inactive-document-crash.html b/testing/web-platform/tests/dom/xslt/transformToFragment-on-node-from-inactive-document-crash.html new file mode 100644 index 0000000000..38a62a0a9d --- /dev/null +++ b/testing/web-platform/tests/dom/xslt/transformToFragment-on-node-from-inactive-document-crash.html @@ -0,0 +1,11 @@ + + + + diff --git a/testing/web-platform/tests/dom/xslt/transformToFragment.tentative.window.js b/testing/web-platform/tests/dom/xslt/transformToFragment.tentative.window.js new file mode 100644 index 0000000000..7bb6a56855 --- /dev/null +++ b/testing/web-platform/tests/dom/xslt/transformToFragment.tentative.window.js @@ -0,0 +1,39 @@ +const cases = { + internal: '', + external: '', +}; + +const loaded = new Promise(resolve => { + window.addEventListener('load', resolve); +}); + +Object.entries(cases).forEach(([k, v]) => { + const xsltSrc = ` + + +
+ ${v} +
+
+
`; + + const processor = new XSLTProcessor(); + const parser = new DOMParser(); + processor.importStylesheet( + parser.parseFromString(xsltSrc, 'application/xml') + ); + document.body.appendChild( + processor.transformToFragment( + parser.parseFromString('', 'application/xml'), + document + ) + ); + + promise_test(async () => { + await loaded; + assert_true( + window[`${k}Script`], + 'script element from XSLTProcessor.transformToFragment() is evaluated' + ); + }, `${k} script`); +}) -- cgit v1.2.3