| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 3 * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 4 * Copyright (C) 2008 Rob Buis <buis@kde.org> | 4 * Copyright (C) 2008 Rob Buis <buis@kde.org> |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "core/svg/SVGGlyphElement.h" | 25 #include "core/svg/SVGGlyphElement.h" |
| 26 | 26 |
| 27 #include "SVGNames.h" | 27 #include "SVGNames.h" |
| 28 #include "core/svg/SVGFontData.h" | 28 #include "core/svg/SVGFontData.h" |
| 29 #include "core/svg/SVGFontElement.h" | 29 #include "core/svg/SVGFontElement.h" |
| 30 #include "core/svg/SVGPathUtilities.h" | 30 #include "core/svg/SVGPathUtilities.h" |
| 31 | 31 |
| 32 namespace WebCore { | 32 namespace WebCore { |
| 33 | 33 |
| 34 inline SVGGlyphElement::SVGGlyphElement(const QualifiedName& tagName, Document*
document) | 34 inline SVGGlyphElement::SVGGlyphElement(const QualifiedName& tagName, Document*
document) |
| 35 : SVGStyledElement(tagName, document) | 35 : SVGElement(tagName, document) |
| 36 { | 36 { |
| 37 ASSERT(hasTagName(SVGNames::glyphTag)); | 37 ASSERT(hasTagName(SVGNames::glyphTag)); |
| 38 ScriptWrappable::init(this); | 38 ScriptWrappable::init(this); |
| 39 } | 39 } |
| 40 | 40 |
| 41 PassRefPtr<SVGGlyphElement> SVGGlyphElement::create(const QualifiedName& tagName
, Document* document) | 41 PassRefPtr<SVGGlyphElement> SVGGlyphElement::create(const QualifiedName& tagName
, Document* document) |
| 42 { | 42 { |
| 43 return adoptRef(new SVGGlyphElement(tagName, document)); | 43 return adoptRef(new SVGGlyphElement(tagName, document)); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void SVGGlyphElement::invalidateGlyphCache() | 46 void SVGGlyphElement::invalidateGlyphCache() |
| 47 { | 47 { |
| 48 ContainerNode* fontNode = parentNode(); | 48 ContainerNode* fontNode = parentNode(); |
| 49 if (fontNode && fontNode->hasTagName(SVGNames::fontTag)) | 49 if (fontNode && fontNode->hasTagName(SVGNames::fontTag)) |
| 50 toSVGFontElement(fontNode)->invalidateGlyphCache(); | 50 toSVGFontElement(fontNode)->invalidateGlyphCache(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void SVGGlyphElement::parseAttribute(const QualifiedName& name, const AtomicStri
ng& value) | 53 void SVGGlyphElement::parseAttribute(const QualifiedName& name, const AtomicStri
ng& value) |
| 54 { | 54 { |
| 55 if (name == SVGNames::dAttr) | 55 if (name == SVGNames::dAttr) |
| 56 invalidateGlyphCache(); | 56 invalidateGlyphCache(); |
| 57 else | 57 else |
| 58 SVGStyledElement::parseAttribute(name, value); | 58 SVGElement::parseAttribute(name, value); |
| 59 } | 59 } |
| 60 | 60 |
| 61 Node::InsertionNotificationRequest SVGGlyphElement::insertedInto(ContainerNode*
rootParent) | 61 Node::InsertionNotificationRequest SVGGlyphElement::insertedInto(ContainerNode*
rootParent) |
| 62 { | 62 { |
| 63 invalidateGlyphCache(); | 63 invalidateGlyphCache(); |
| 64 return SVGStyledElement::insertedInto(rootParent); | 64 return SVGElement::insertedInto(rootParent); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void SVGGlyphElement::removedFrom(ContainerNode* rootParent) | 67 void SVGGlyphElement::removedFrom(ContainerNode* rootParent) |
| 68 { | 68 { |
| 69 if (rootParent->inDocument()) | 69 if (rootParent->inDocument()) |
| 70 invalidateGlyphCache(); | 70 invalidateGlyphCache(); |
| 71 SVGStyledElement::removedFrom(rootParent); | 71 SVGElement::removedFrom(rootParent); |
| 72 } | 72 } |
| 73 | 73 |
| 74 static inline SVGGlyph::ArabicForm parseArabicForm(const AtomicString& value) | 74 static inline SVGGlyph::ArabicForm parseArabicForm(const AtomicString& value) |
| 75 { | 75 { |
| 76 if (value == "medial") | 76 if (value == "medial") |
| 77 return SVGGlyph::Medial; | 77 return SVGGlyph::Medial; |
| 78 if (value == "terminal") | 78 if (value == "terminal") |
| 79 return SVGGlyph::Terminal; | 79 return SVGGlyph::Terminal; |
| 80 if (value == "isolated") | 80 if (value == "isolated") |
| 81 return SVGGlyph::Isolated; | 81 return SVGGlyph::Isolated; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 String language = fastGetAttribute(SVGNames::langAttr); | 158 String language = fastGetAttribute(SVGNames::langAttr); |
| 159 if (!language.isEmpty()) | 159 if (!language.isEmpty()) |
| 160 identifier.languages = parseDelimitedString(language, ','); | 160 identifier.languages = parseDelimitedString(language, ','); |
| 161 | 161 |
| 162 return identifier; | 162 return identifier; |
| 163 } | 163 } |
| 164 | 164 |
| 165 } | 165 } |
| 166 | 166 |
| 167 #endif // ENABLE(SVG_FONTS) | 167 #endif // ENABLE(SVG_FONTS) |
| OLD | NEW |