Index: LayoutTests/http/tests/dom/create-contextual-fragment-from-bodyless-svg-document-range.html |
diff --git a/LayoutTests/http/tests/dom/create-contextual-fragment-from-bodyless-svg-document-range.html b/LayoutTests/http/tests/dom/create-contextual-fragment-from-bodyless-svg-document-range.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d7613701f61846a7e02e7f485e09da7a7f951bc9 |
--- /dev/null |
+++ b/LayoutTests/http/tests/dom/create-contextual-fragment-from-bodyless-svg-document-range.html |
@@ -0,0 +1,32 @@ |
+<!DOCTYPE html> |
+<p>Test of createContextualFragment from a Range whose container is an SVG document with no <svg> element. If the test succeeds you will see the word "PASS" below.</p> |
+<p id="result"></p> |
+<script> |
+if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.waitUntilDone(); |
+} |
+ |
+function onSvgLoad() |
+{ |
+ window.svgDocument = document.getElementById('container').getSVGDocument(); |
+ window.range = svgDocument.createRange(); |
+ window.fragment = range.createContextualFragment('<text id="fragment" x="0" y="16" fontsize="16">Inserted fragment</text>'); |
+ window.svg = svgDocument.createElementNS('http://www.w3.org/2000/svg', 'svg'); |
+ svg.setAttribute('width', '300px'); |
+ svg.setAttribute('height', '50px'); |
+ svg.setAttribute('viewBox', '0 0 300 24'); |
+ svgDocument.appendChild(svg); |
+ svg.appendChild(fragment); |
+ window.text = svgDocument.getElementById('fragment'); |
+ |
+ window.result = document.getElementById('result'); |
+ result.textContent = (text && text.parentElement === svg && text.namespaceURI === 'http://www.w3.org/2000/svg') ? 'PASS' : 'FAIL'; |
+ |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+} |
+</script> |
+<embed id="container" src="resources/empty-svg-file.svg" onload="onSvgLoad();" /> |
+</embed> |
+ |