Chromium Code Reviews| OLD | NEW |
|---|---|
| (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> | |
| OLD | NEW |