| 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(const QualifiedName& tagName, Document& do
cument) |
| 46 : SVGElement(tagName, document) | 46 : SVGElement(tagName, document) |
| 47 , m_missingGlyph(0) | 47 , m_missingGlyph(0) |
| 48 , m_isGlyphCacheValid(false) | 48 , m_isGlyphCacheValid(false) |
| 49 { | 49 { |
| 50 ASSERT(hasTagName(SVGNames::fontTag)); | 50 ASSERT(hasTagName(SVGNames::fontTag)); |
| 51 ScriptWrappable::init(this); | 51 ScriptWrappable::init(this); |
| 52 registerAnimatedPropertiesForSVGFontElement(); | 52 registerAnimatedPropertiesForSVGFontElement(); |
| 53 | 53 |
| 54 UseCounter::count(document, UseCounter::SVGFontElement); | 54 UseCounter::count(&document, UseCounter::SVGFontElement); |
| 55 } | 55 } |
| 56 | 56 |
| 57 PassRefPtr<SVGFontElement> SVGFontElement::create(const QualifiedName& tagName,
Document* document) | 57 PassRefPtr<SVGFontElement> SVGFontElement::create(const QualifiedName& tagName,
Document& document) |
| 58 { | 58 { |
| 59 return adoptRef(new SVGFontElement(tagName, document)); | 59 return adoptRef(new SVGFontElement(tagName, document)); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void SVGFontElement::invalidateGlyphCache() | 62 void SVGFontElement::invalidateGlyphCache() |
| 63 { | 63 { |
| 64 if (m_isGlyphCacheValid) { | 64 if (m_isGlyphCacheValid) { |
| 65 m_glyphMap.clear(); | 65 m_glyphMap.clear(); |
| 66 m_horizontalKerningPairs.clear(); | 66 m_horizontalKerningPairs.clear(); |
| 67 m_verticalKerningPairs.clear(); | 67 m_verticalKerningPairs.clear(); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 254 |
| 255 Glyph SVGFontElement::missingGlyph() | 255 Glyph SVGFontElement::missingGlyph() |
| 256 { | 256 { |
| 257 ensureGlyphCache(); | 257 ensureGlyphCache(); |
| 258 return m_missingGlyph; | 258 return m_missingGlyph; |
| 259 } | 259 } |
| 260 | 260 |
| 261 } | 261 } |
| 262 | 262 |
| 263 #endif // ENABLE(SVG_FONTS) | 263 #endif // ENABLE(SVG_FONTS) |
| OLD | NEW |