Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Range / create-contextual-fragment-namespaces3.xhtml
blob90b9873ae1966784d60851bd51066599f93bf989
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <body onload="onPageLoad()">
5 <p>Test of Range.createContextualFragment() with in-scope namespace prefixes, where the XML fragment introduces additional namespace prefixes. If the test succeeds you will see the word "PASS" below.</p>
6 <p id="result">Running test...</p>
7 <svg:svg xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
8 <svg:defs id="defs"/>
9 </svg:svg>
10 <script type="text/javascript">//<![CDATA[
11 function onPageLoad() {
12 if (window.testRunner)
13 testRunner.dumpAsText();
15 var result = document.getElementById("result");
17 var defs = document.getElementById("defs"),
18 range = document.createRange(),
19 docFragment;
21 range.setStart(defs, 0);
22 docFragment = range.createContextualFragment("<svg:linearGradient id='gradient1'/>" +
23 "<a:aTest id='aTest' xmlns:a='urn:x-test:a' xmlns:b='urn:x-test:b' a:aAttr='aValue' xlink:href='#gradient1'>" +
24 " <b:bTest id='bTest' a:aAttr='aValue2' b:bAttr='bValue'>" +
25 " <xlink:testRedefiningXlink id='testRedefiningXlink' xlink:xlinkAttr='xlinkValue' xmlns:xlink='urn:x-test:xlink'/>" +
26 " <svg:linearGradient id='gradient2' xlink:href='#gradient1'/>" +
27 " </b:bTest>" +
28 "</a:aTest>");
29 defs.appendChild(docFragment);
31 var gradient1 = document.getElementById("gradient1");
32 if (gradient1.namespaceURI != "http://www.w3.org/2000/svg") {
33 result.textContent += ' - #gradient1 has the wrong namespaceURI';
34 return;
37 var aTest = document.getElementById("aTest");
38 if (aTest.namespaceURI != "urn:x-test:a") {
39 result.textContent += ' - #aTest has the wrong namespaceURI';
40 return;
42 if (aTest.getAttributeNS("urn:x-test:a", "aAttr") != "aValue") {
43 result.textContent += ' - wrong value for the a:aAttr attribute of #aTest';
44 return;
46 if (aTest.getAttributeNS("http://www.w3.org/1999/xlink", "href") != "#gradient1") {
47 result.textContent += ' - wrong value for the xlink:href attribute of #aTest';
48 return;
51 var bTest = document.getElementById("bTest");
52 if (bTest.namespaceURI != "urn:x-test:b") {
53 result.textContent += ' - #bTest has the wrong namespaceURI';
54 return;
56 if (bTest.getAttributeNS("urn:x-test:a", "aAttr") != "aValue2") {
57 result.textContent += ' - wrong value for the a:aAttr attribute of #bTest';
58 return;
60 if (bTest.getAttributeNS("urn:x-test:b", "bAttr") != "bValue") {
61 result.textContent += ' - wrong value for the b:bAttr attribute of #bTest';
62 return;
65 var testRedefiningXlink = document.getElementById("testRedefiningXlink");
66 if (testRedefiningXlink.namespaceURI != "urn:x-test:xlink") {
67 result.textContent += ' - #testRedefiningXlink has the wrong namespaceURI';
68 return;
70 if (testRedefiningXlink.getAttributeNS("urn:x-test:xlink", "xlinkAttr") != "xlinkValue") {
71 result.textContent += ' - wrong value for the xlink:xlinkAttr attribute of #testRedefiningXlink';
72 return;
75 var gradient2 = document.getElementById("gradient2");
76 if (gradient2.namespaceURI != "http://www.w3.org/2000/svg") {
77 result.textContent += ' - #gradient2 has the wrong namespaceURI';
78 return;
80 if (gradient2.getAttributeNS("http://www.w3.org/1999/xlink", "href") != "#gradient1") {
81 result.textContent += ' - wrong value for the xlink:href attribute of #gradient2';
82 return;
85 if (result.textContent === "Running test...")
86 result.textContent = "PASS";
88 //]]>
89 </script>
90 </body>
91 </html>