Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / xsl / xslt-fragment-in-empty-doc.html
blob7fea5ba6ec7f6da31d5b64ca3c431ec951b2b806
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <body>
4 <p>This test checks whether XSLTProcessor.transformToFragment() does not crash
5 when the target document does not have a root node.</p>
7 <div id="console"></div>
8 <script>
9 if (window.testRunner)
10 testRunner.dumpAsText();
12 var xml = (new DOMParser()).parseFromString('<doc/>', 'application/xml');
13 var xsl = (new DOMParser()).parseFromString(
14 '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">' +
15 '<xsl:output method="xml" omit-xml-declaration="yes"/>' +
16 ' <xsl:template match="doc">SUCCESS</xsl:template>' +
17 '</xsl:stylesheet>',
18 'application/xml');
20 var p = new XSLTProcessor;
21 p.importStylesheet(xsl);
22 var ownerDocument = document.implementation.createDocument("", "", null);
23 var f = p.transformToFragment(xml, ownerDocument);
25 // Firefox throws an exception here, while WebKit doesn't:
26 // "An attempt was made to create or change an object in a way which is incorrect with regard to namespaces."
27 ownerDocument = document.implementation.createDocument("", null, null);
28 f = p.transformToFragment(xml, ownerDocument);
29 </script>
30 <p>PASS: You didn't crash.</p>
31 </body>
32 </html>