Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: LayoutTests/http/tests/dom/create-contextual-fragment-from-bodyless-svg-document-range.html

Issue 115693010: Fix Range.createContextualFragment for non-Element contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 &lt;svg&gt; 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>
+

Powered by Google App Engine
This is Rietveld 408576698