OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 19 matching lines...) Expand all Loading... |
30 : SVGElement(SVGNames::titleTag, document) | 30 : SVGElement(SVGNames::titleTag, document) |
31 { | 31 { |
32 ScriptWrappable::init(this); | 32 ScriptWrappable::init(this); |
33 } | 33 } |
34 | 34 |
35 Node::InsertionNotificationRequest SVGTitleElement::insertedInto(ContainerNode*
rootParent) | 35 Node::InsertionNotificationRequest SVGTitleElement::insertedInto(ContainerNode*
rootParent) |
36 { | 36 { |
37 SVGElement::insertedInto(rootParent); | 37 SVGElement::insertedInto(rootParent); |
38 if (!rootParent->inDocument()) | 38 if (!rootParent->inDocument()) |
39 return InsertionDone; | 39 return InsertionDone; |
40 // FIXME: It's possible to register SVGTitleElement to an HTMLDocument. | 40 if (firstChild() && document().isSVGDocument()) |
41 if (firstChild()) | |
42 document().setTitleElement(textContent(), this); | 41 document().setTitleElement(textContent(), this); |
43 return InsertionDone; | 42 return InsertionDone; |
44 } | 43 } |
45 | 44 |
46 void SVGTitleElement::removedFrom(ContainerNode* rootParent) | 45 void SVGTitleElement::removedFrom(ContainerNode* rootParent) |
47 { | 46 { |
48 SVGElement::removedFrom(rootParent); | 47 SVGElement::removedFrom(rootParent); |
49 if (rootParent->inDocument()) | 48 if (rootParent->inDocument() && document().isSVGDocument()) |
50 document().removeTitle(this); | 49 document().removeTitle(this); |
51 } | 50 } |
52 | 51 |
53 void SVGTitleElement::childrenChanged(bool changedByParser, Node* beforeChange,
Node* afterChange, int childCountDelta) | 52 void SVGTitleElement::childrenChanged(bool changedByParser, Node* beforeChange,
Node* afterChange, int childCountDelta) |
54 { | 53 { |
55 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); | 54 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); |
56 if (inDocument()) | 55 if (inDocument() && document().isSVGDocument()) |
57 document().setTitleElement(textContent(), this); | 56 document().setTitleElement(textContent(), this); |
58 } | 57 } |
59 | 58 |
60 } | 59 } |
OLD | NEW |