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 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
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 24 matching lines...) Expand all Loading... |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 // Animated property definitions | 37 // Animated property definitions |
38 DEFINE_ANIMATED_BOOLEAN(SVGFontElement, SVGNames::externalResourcesRequiredAttr,
ExternalResourcesRequired, externalResourcesRequired) | 38 DEFINE_ANIMATED_BOOLEAN(SVGFontElement, SVGNames::externalResourcesRequiredAttr,
ExternalResourcesRequired, externalResourcesRequired) |
39 | 39 |
40 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFontElement) | 40 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFontElement) |
41 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | 41 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) |
42 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) | 42 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) |
43 END_REGISTER_ANIMATED_PROPERTIES | 43 END_REGISTER_ANIMATED_PROPERTIES |
44 | 44 |
45 inline SVGFontElement::SVGFontElement(const QualifiedName& tagName, Document& do
cument) | 45 inline SVGFontElement::SVGFontElement(Document& document) |
46 : SVGElement(tagName, document) | 46 : SVGElement(SVGNames::fontTag, document) |
47 , m_missingGlyph(0) | 47 , m_missingGlyph(0) |
48 , m_isGlyphCacheValid(false) | 48 , m_isGlyphCacheValid(false) |
49 { | 49 { |
50 ASSERT(hasTagName(SVGNames::fontTag)); | |
51 ScriptWrappable::init(this); | 50 ScriptWrappable::init(this); |
52 registerAnimatedPropertiesForSVGFontElement(); | 51 registerAnimatedPropertiesForSVGFontElement(); |
53 | 52 |
54 UseCounter::count(document, UseCounter::SVGFontElement); | 53 UseCounter::count(document, UseCounter::SVGFontElement); |
55 } | 54 } |
56 | 55 |
57 PassRefPtr<SVGFontElement> SVGFontElement::create(const QualifiedName& tagName,
Document& document) | 56 PassRefPtr<SVGFontElement> SVGFontElement::create(Document& document) |
58 { | 57 { |
59 return adoptRef(new SVGFontElement(tagName, document)); | 58 return adoptRef(new SVGFontElement(document)); |
60 } | 59 } |
61 | 60 |
62 void SVGFontElement::invalidateGlyphCache() | 61 void SVGFontElement::invalidateGlyphCache() |
63 { | 62 { |
64 if (m_isGlyphCacheValid) { | 63 if (m_isGlyphCacheValid) { |
65 m_glyphMap.clear(); | 64 m_glyphMap.clear(); |
66 m_horizontalKerningPairs.clear(); | 65 m_horizontalKerningPairs.clear(); |
67 m_verticalKerningPairs.clear(); | 66 m_verticalKerningPairs.clear(); |
68 } | 67 } |
69 m_isGlyphCacheValid = false; | 68 m_isGlyphCacheValid = false; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 251 |
253 Glyph SVGFontElement::missingGlyph() | 252 Glyph SVGFontElement::missingGlyph() |
254 { | 253 { |
255 ensureGlyphCache(); | 254 ensureGlyphCache(); |
256 return m_missingGlyph; | 255 return m_missingGlyph; |
257 } | 256 } |
258 | 257 |
259 } | 258 } |
260 | 259 |
261 #endif // ENABLE(SVG_FONTS) | 260 #endif // ENABLE(SVG_FONTS) |
OLD | NEW |