diff options
Diffstat (limited to 'Source/WebCore/svg/SVGTitleElement.cpp')
-rw-r--r-- | Source/WebCore/svg/SVGTitleElement.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/Source/WebCore/svg/SVGTitleElement.cpp b/Source/WebCore/svg/SVGTitleElement.cpp index d805b857a..a43292cf0 100644 --- a/Source/WebCore/svg/SVGTitleElement.cpp +++ b/Source/WebCore/svg/SVGTitleElement.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> + * Copyright (C) 2016 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -19,11 +20,11 @@ */ #include "config.h" -#if ENABLE(SVG) #include "SVGTitleElement.h" #include "Document.h" #include "SVGNames.h" +#include "Text.h" namespace WebCore { @@ -33,38 +34,33 @@ inline SVGTitleElement::SVGTitleElement(const QualifiedName& tagName, Document& ASSERT(hasTagName(SVGNames::titleTag)); } -PassRefPtr<SVGTitleElement> SVGTitleElement::create(const QualifiedName& tagName, Document& document) +Ref<SVGTitleElement> SVGTitleElement::create(const QualifiedName& tagName, Document& document) { - return adoptRef(new SVGTitleElement(tagName, document)); + return adoptRef(*new SVGTitleElement(tagName, document)); } Node::InsertionNotificationRequest SVGTitleElement::insertedInto(ContainerNode& rootParent) { SVGElement::insertedInto(rootParent); - if (!rootParent.inDocument()) + if (!rootParent.isConnected()) return InsertionDone; - // FIXME: It's possible to register SVGTitleElement to an HTMLDocument. - if (firstChild()) - // FIXME: does SVG have a title text direction? - document().setTitleElement(StringWithDirection(textContent(), LTR), this); + + if (firstChild() && document().isSVGDocument()) + document().titleElementAdded(*this); return InsertionDone; } void SVGTitleElement::removedFrom(ContainerNode& rootParent) { SVGElement::removedFrom(rootParent); - if (rootParent.inDocument()) - document().removeTitle(this); + if (rootParent.isConnected() && document().isSVGDocument()) + document().titleElementRemoved(*this); } void SVGTitleElement::childrenChanged(const ChildChange& change) { SVGElement::childrenChanged(change); - if (inDocument()) - // FIXME: does SVG have title text direction? - document().setTitleElement(StringWithDirection(textContent(), LTR), this); + document().titleElementTextChanged(*this); } } - -#endif // ENABLE(SVG) |