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

Unified Diff: LayoutTests/fast/dom/Range/create-contextual-fragment-from-svg-element-range.html

Issue 115693010: Fix Range.createContextualFragment for non-Element contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Handle SVG elements. Created 7 years 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/fast/dom/Range/create-contextual-fragment-from-svg-element-range.html
diff --git a/LayoutTests/fast/dom/Range/create-contextual-fragment-from-svg-element-range.html b/LayoutTests/fast/dom/Range/create-contextual-fragment-from-svg-element-range.html
new file mode 100644
index 0000000000000000000000000000000000000000..391f7d98260f841e1860442d459e28b4c8bc8437
--- /dev/null
+++ b/LayoutTests/fast/dom/Range/create-contextual-fragment-from-svg-element-range.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<p>Test of createContextualFragment from a Range whose container is an SVG element. If the test succeeds you will see the word "PASS" below.</p>
+<p id="result"></p>
+<svg width="300px" height="50px" viewBox="0 0 300 24" id="container">
+</svg>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+var contextSvg = document.getElementById('container');
+var range = document.createRange();
+range.setStart(contextSvg, 0);
+var fragment = range.createContextualFragment('<text id="fragment" x="0" y="16" fontsize="16">Inserted fragment</text>');
+contextSvg.appendChild(fragment);
+var text = document.getElementById('fragment');
+
+var result = document.getElementById('result');
+result.textContent = (text && text.parentElement === contextSvg && text.namespaceURI === 'http://www.w3.org/2000/svg') ? 'PASS' : 'FAIL';
+</script>
+

Powered by Google App Engine
This is Rietveld 408576698