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

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: 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..edcdf5322931f916a6f6cc279135d0cfe870a5d7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/xsl/xslt-node-set-empty.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(() => {
+ var xmlSource = '<go/>';
+ var xslSource = `<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:exsl="http://exslt.org/common"
+ exclude-result-prefixes="exsl">
yosin_UTC9 2017/03/15 07:47:24 We don't need to have exclude-result-prefixes sinc
+
+ <xsl:variable name="empty"></xsl:variable>
+ <xsl:variable name="look" select="exsl:node-set($empty)"/>
yosin_UTC9 2017/03/15 07:47:24 Can we write this just |exsl:node-set('')|?
dominicc (has gone to gerrit) 2017/03/16 09:23:42 Yes, done.
+
+ <xsl:template match="go">
+ <xsl:text>PASS</xsl:text>
yosin_UTC9 2017/03/15 07:47:24 Rather than checking whether crash or not, checkin
dominicc (has gone to gerrit) 2017/03/16 09:23:42 This unfortunately doesn't work. The thing which h
+ </xsl:template>
+ </xsl:stylesheet>`;
+
+ let parser = new DOMParser();
+ let xsl = parser.parseFromString(xslSource, 'text/xml');
+ let xml = parser.parseFromString(xmlSource, 'text/xml');
+
+ let xslproc = new XSLTProcessor();
yosin_UTC9 2017/03/15 07:47:24 nit: s/let/const/
+ xslproc.importStylesheet(xsl);
+ let result = xslproc.transformToFragment(xml, document);
yosin_UTC9 2017/03/15 07:47:24 nit: s/let/const/
+ assert_equals(result.firstChild.textContent, 'PASS');
+}, 'node-set of an empty variable 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