tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit cd76cd6715d969f29c07ff2547bbb25c9eba2341
parent b6a2946292f0b7d0df2660c892fab2212b18120b
Author: Dominik Röttsches <drott@chromium.org>
Date:   Tue, 16 Dec 2025 08:47:44 +0000

Bug 2005832 [wpt PR 56719] - Add a test for using DOMParser output with XSLTProcessor., a=testonly

Automatic update from web-platform-tests
Add a test for using DOMParser output with XSLTProcessor.

This test verifies that a Document parsed by DOMParser can be successfully imported into an XSLTProcessor and used to transform another Document, producing the expected HTML output.

Needed in Blink to verify whether we can independently
switch the XML parser for DOMParser while still process
XSLT.

Bug: 441911594, 466303347
Change-Id: Ie4b3bffa1d0f6ff799f29b36bedf2d56d33fca91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7254057
Auto-Submit: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1558261}

--

wpt-commits: 6868b09c4e59c3ef9d222f791f5649b4437f73d9
wpt-pr: 56719

Diffstat:
Atesting/web-platform/tests/dom/xslt/domparser-xslt.html | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/web-animations/interfaces/KeyframeEffect/copy-constructor.html | 18++++++++++++++++++
2 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/testing/web-platform/tests/dom/xslt/domparser-xslt.html b/testing/web-platform/tests/dom/xslt/domparser-xslt.html @@ -0,0 +1,50 @@ +<!DOCTYPE html> +<html> +<head> + <title>DOMParser output as XSLT Stylesheet</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <div id="output-container"></div> + + <script> + test(() => { + const xsltStr = ` + <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:template match="/"> + <ul> + <xsl:for-each select="data/item"> + <li><xsl:value-of select="name"/>: <xsl:value-of select="value"/></li> + </xsl:for-each> + </ul> + </xsl:template> + </xsl:stylesheet>`; + + const xmlStr = ` + <data> + <item><name>Alpha</name><value>10</value></item> + <item><name>Beta</name><value>20</value></item> + </data>`; + + const parser = new DOMParser(); + const processor = new XSLTProcessor(); + + const xsltDoc = parser.parseFromString(xsltStr, "text/xml"); + const xmlDoc = parser.parseFromString(xmlStr, "text/xml"); + + processor.importStylesheet(xsltDoc); + const fragment = processor.transformToFragment(xmlDoc, document); + + const container = document.getElementById("output-container"); + container.appendChild(fragment); + + const listItems = container.querySelectorAll("li"); + assert_equals(listItems.length, 2, "Should have exactly 2 list items"); + assert_equals(listItems[0].textContent, "Alpha: 10", "First item content mismatch"); + assert_equals(listItems[1].textContent, "Beta: 20", "Second item content mismatch"); + + }, "Verify XSLT transformation from DOMParser creates expected HTML output."); + </script> +</body> +</html> +\ No newline at end of file diff --git a/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/copy-constructor.html b/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/copy-constructor.html @@ -20,6 +20,24 @@ test(t => { }, 'Copied KeyframeEffect has the same target'); test(t => { + const target = createElement(t, 'input'); + target.setAttribute('type', 'input'); + target.setAttribute('placeholder', "hello"); + let effect = undefined; + try { + // Pseudo-elements for which the user agent has no usable level of support + // are deemed invalid. Test passes if no effect is generated. + effect = new KeyframeEffect(target, [], { pseudoElement: '::placeholder' }); + } catch (e) {} + if (effect) { + // If an effect is generated (UA supports the pseudo), then the copy + // constructor is to retain the correct target. + const copy = new KeyframeEffect(effect); + assert_equals(copy.target, target); + } +}, 'Copied KeyframeEffect does not expose UA-shadow DOM'); + +test(t => { const effect = new KeyframeEffect(null, [ { marginLeft: '0px' },