| 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);
|
| }
|
|
|
|
|