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 16 matching lines...) Expand all Loading... |
27 #include "core/dom/ElementTraversal.h" | 27 #include "core/dom/ElementTraversal.h" |
28 #include "core/frame/UseCounter.h" | 28 #include "core/frame/UseCounter.h" |
29 #include "core/svg/SVGGlyphElement.h" | 29 #include "core/svg/SVGGlyphElement.h" |
30 #include "core/svg/SVGHKernElement.h" | 30 #include "core/svg/SVGHKernElement.h" |
31 #include "core/svg/SVGMissingGlyphElement.h" | 31 #include "core/svg/SVGMissingGlyphElement.h" |
32 #include "core/svg/SVGVKernElement.h" | 32 #include "core/svg/SVGVKernElement.h" |
33 #include "wtf/ASCIICType.h" | 33 #include "wtf/ASCIICType.h" |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 SVGFontElement::SVGFontElement(Document& document) | 37 inline SVGFontElement::SVGFontElement(Document& document) |
38 : SVGElement(SVGNames::fontTag, document) | 38 : SVGElement(SVGNames::fontTag, document) |
39 , m_missingGlyph(0) | 39 , m_missingGlyph(0) |
40 , m_isGlyphCacheValid(false) | 40 , m_isGlyphCacheValid(false) |
41 { | 41 { |
42 ScriptWrappable::init(this); | 42 ScriptWrappable::init(this); |
43 | 43 |
44 UseCounter::count(document, UseCounter::SVGFontElement); | 44 UseCounter::count(document, UseCounter::SVGFontElement); |
45 } | 45 } |
46 | 46 |
| 47 DEFINE_NODE_FACTORY(SVGFontElement) |
| 48 |
47 void SVGFontElement::invalidateGlyphCache() | 49 void SVGFontElement::invalidateGlyphCache() |
48 { | 50 { |
49 if (m_isGlyphCacheValid) { | 51 if (m_isGlyphCacheValid) { |
50 m_glyphMap.clear(); | 52 m_glyphMap.clear(); |
51 m_horizontalKerningTable.clear(); | 53 m_horizontalKerningTable.clear(); |
52 m_verticalKerningTable.clear(); | 54 m_verticalKerningTable.clear(); |
53 } | 55 } |
54 m_isGlyphCacheValid = false; | 56 m_isGlyphCacheValid = false; |
55 } | 57 } |
56 | 58 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 247 |
246 Glyph SVGFontElement::missingGlyph() | 248 Glyph SVGFontElement::missingGlyph() |
247 { | 249 { |
248 ensureGlyphCache(); | 250 ensureGlyphCache(); |
249 return m_missingGlyph; | 251 return m_missingGlyph; |
250 } | 252 } |
251 | 253 |
252 } | 254 } |
253 | 255 |
254 #endif // ENABLE(SVG_FONTS) | 256 #endif // ENABLE(SVG_FONTS) |
OLD | NEW |