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

Unified Diff: Source/core/svg/SVGTitleElement.cpp

Issue 291483003: Only set title on SVG documents (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « LayoutTests/svg/custom/html-document-set-title-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGTitleElement.cpp
diff --git a/Source/core/svg/SVGTitleElement.cpp b/Source/core/svg/SVGTitleElement.cpp
index 31dbf43276e94fed5c63ef8fe75ce61b33fb26e9..a50ba304090ac300e3fb462b9d051dbe1ed3d642 100644
--- a/Source/core/svg/SVGTitleElement.cpp
+++ b/Source/core/svg/SVGTitleElement.cpp
@@ -37,8 +37,7 @@ Node::InsertionNotificationRequest SVGTitleElement::insertedInto(ContainerNode*
SVGElement::insertedInto(rootParent);
if (!rootParent->inDocument())
return InsertionDone;
- // FIXME: It's possible to register SVGTitleElement to an HTMLDocument.
- if (firstChild())
+ if (firstChild() && document().isSVGDocument())
document().setTitleElement(textContent(), this);
return InsertionDone;
}
@@ -46,14 +45,14 @@ Node::InsertionNotificationRequest SVGTitleElement::insertedInto(ContainerNode*
void SVGTitleElement::removedFrom(ContainerNode* rootParent)
{
SVGElement::removedFrom(rootParent);
- if (rootParent->inDocument())
+ if (rootParent->inDocument() && document().isSVGDocument())
document().removeTitle(this);
}
void SVGTitleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
- if (inDocument())
+ if (inDocument() && document().isSVGDocument())
document().setTitleElement(textContent(), this);
}
« no previous file with comments | « LayoutTests/svg/custom/html-document-set-title-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698