diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/svg/SVGTitleElement.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
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) |