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

Unified Diff: third_party/WebKit/LayoutTests/svg/dom/svg-document-set-title-mutations.html

Issue 1752713002: Fix SVGDocument return title that is not a child of the root element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: third_party/WebKit/LayoutTests/svg/dom/svg-document-set-title-mutations.html
diff --git a/third_party/WebKit/LayoutTests/svg/dom/svg-document-set-title-mutations.html b/third_party/WebKit/LayoutTests/svg/dom/svg-document-set-title-mutations.html
new file mode 100644
index 0000000000000000000000000000000000000000..389e844fadffb548738e4cbb9b4f426cddb5519a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/dom/svg-document-set-title-mutations.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
+
+function newSVGDocument() {
fs 2016/03/03 15:49:44 This is only used once, so just do this directly w
hyunjunekim2 2016/03/04 11:29:32 Done.
+ return document.implementation.createDocument(SVG_NAMESPACE, "svg", null);
+}
+
+test(function() {
+ var doc = newSVGDocument();
+ doc.title = 'old';
+ var titleElement = doc.querySelector('title');
+ var observer = new MutationObserver(function(mutations) {
+ assert_equals(mutations.length, 1);
+ assert_equals(mutations[0].type, 'childList');
+ assert_equals(mutations[0].addedNodes[0].data, 'new');
+ assert_equals(mutations[0].addedNodes.length, 1);
+ assert_equals(mutations[0].removedNodes[0].data, 'old');
+ assert_equals(mutations[0].removedNodes.length, 1);
+ });
+
+ observer.observe(titleElement, { childList: true });
+ doc.title = 'new';
+}, "Test for mutations to childList when setting title of svg document.");
+</script>

Powered by Google App Engine
This is Rietveld 408576698