Chromium Code Reviews| 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> |