Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Unified Diff: third_party/WebKit/LayoutTests/fast/xsl/xslt-node-set-empty.html

Issue 2750943004: node-set($x), when $x is empty, should not halt XSLT processing (Closed)
Patch Set: Refine the description. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/xml/XSLTExtensions.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/xsl/xslt-node-set-empty.html
diff --git a/third_party/WebKit/LayoutTests/fast/xsl/xslt-node-set-empty.html b/third_party/WebKit/LayoutTests/fast/xsl/xslt-node-set-empty.html
new file mode 100644
index 0000000000000000000000000000000000000000..ce1ff8a905191fc7918efdad603b98fb5b7a89ae
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/xsl/xslt-node-set-empty.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(() => {
+ const xmlSource = '<poke/>';
+ const xslSource = `<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:exsl="http://exslt.org/common">
+
+ <xsl:variable name="peek" select="exsl:node-set('')"/>
+
+ <xsl:template match="poke">
+ <xsl:text>PASS</xsl:text>
+ </xsl:template>
+ </xsl:stylesheet>`;
+
+ const parser = new DOMParser();
+ const xsl = parser.parseFromString(xslSource, 'text/xml');
+ const xml = parser.parseFromString(xmlSource, 'text/xml');
+
+ const xslproc = new XSLTProcessor();
+ xslproc.importStylesheet(xsl);
+ const result = xslproc.transformToFragment(xml, document);
+ assert_equals(result.firstChild.textContent, 'PASS');
+}, 'a variable set to node-set of a string should not halt processing');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/xml/XSLTExtensions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698