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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/xml/XSLTExtensions.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script>
5 test(() => {
6 var xmlSource = '<go/>';
7 var xslSource = `<xsl:stylesheet version="1.0"
8 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9 xmlns:exsl="http://exslt.org/common"
10 exclude-result-prefixes="exsl">
yosin_UTC9 2017/03/15 07:47:24 We don't need to have exclude-result-prefixes sinc
11
12 <xsl:variable name="empty"></xsl:variable>
13 <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.
14
15 <xsl:template match="go">
16 <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
17 </xsl:template>
18 </xsl:stylesheet>`;
19
20 let parser = new DOMParser();
21 let xsl = parser.parseFromString(xslSource, 'text/xml');
22 let xml = parser.parseFromString(xmlSource, 'text/xml');
23
24 let xslproc = new XSLTProcessor();
yosin_UTC9 2017/03/15 07:47:24 nit: s/let/const/
25 xslproc.importStylesheet(xsl);
26 let result = xslproc.transformToFragment(xml, document);
yosin_UTC9 2017/03/15 07:47:24 nit: s/let/const/
27 assert_equals(result.firstChild.textContent, 'PASS');
28 }, 'node-set of an empty variable should not halt processing');
29 </script>
OLDNEW
« 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